-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #655 from woowacourse-teams/develop
코레아 1.22v 배포
- Loading branch information
Showing
107 changed files
with
1,368 additions
and
705 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
backend/src/main/java/corea/feedback/domain/SocialFeedbackWriter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package corea.feedback.domain; | ||
|
||
import corea.exception.CoreaException; | ||
import corea.exception.ExceptionType; | ||
import corea.feedback.dto.SocialFeedbackUpdateInput; | ||
import corea.feedback.repository.SocialFeedbackRepository; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Slf4j | ||
@Component | ||
@RequiredArgsConstructor | ||
@Transactional | ||
public class SocialFeedbackWriter { | ||
|
||
private final SocialFeedbackRepository socialFeedbackRepository; | ||
|
||
public SocialFeedback create(SocialFeedback socialFeedback, long roomId, long deliverId, long receiverId) { | ||
validateAlreadyExist(roomId, deliverId, receiverId); | ||
log.info("소셜 피드백 작성 [방 ID={}, 작성자 ID={}, 수신자 ID={}]", roomId, deliverId, receiverId); | ||
|
||
return socialFeedbackRepository.save(socialFeedback); | ||
} | ||
|
||
private void validateAlreadyExist(long roomId, long deliverId, long receiverId) { | ||
if (socialFeedbackRepository.existsByRoomIdAndDeliverIdAndReceiverId(roomId, deliverId, receiverId)) { | ||
throw new CoreaException(ExceptionType.ALREADY_COMPLETED_FEEDBACK); | ||
} | ||
} | ||
|
||
public void update(SocialFeedback socialFeedback, long deliverId, SocialFeedbackUpdateInput input) { | ||
validateUpdateAuthority(socialFeedback, deliverId); | ||
log.info("소셜 피드백 업데이트 [피드백 ID={}, 작성자 ID={}, 요청값={}]", socialFeedback.getId(), deliverId, input); | ||
|
||
socialFeedback.update( | ||
input.evaluationPoint(), | ||
input.feedbackKeywords(), | ||
input.feedbackText() | ||
); | ||
} | ||
|
||
private void validateUpdateAuthority(SocialFeedback socialFeedback, long deliverId) { | ||
if (socialFeedback.isNotMatchingDeliver(deliverId)) { | ||
throw new CoreaException(ExceptionType.FEEDBACK_UPDATE_AUTHORIZATION_ERROR); | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
backend/src/main/java/corea/feedback/dto/SocialFeedbackCreateRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package corea.feedback.dto; | ||
|
||
import corea.feedback.domain.SocialFeedback; | ||
import corea.feedback.util.FeedbackKeywordConverter; | ||
import corea.member.domain.Member; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
import java.util.List; | ||
|
||
@Schema(description = "커뮤니케이션 능력 관련 피드백 작성 요청") | ||
public record SocialFeedbackCreateRequest(@Schema(description = "리뷰어 아이디", example = "2") | ||
long receiverId, | ||
|
||
@Schema(description = "평가 점수", example = "4") | ||
int evaluationPoint, | ||
|
||
@Schema(description = "선택한 피드백 키워드", example = "[\"이해가 잘 되게 설명을 잘해줘요(못해줘요)\", \"도움이 되었어요(아니에요)\"]") | ||
List<String> feedbackKeywords, | ||
|
||
@Schema(description = "부가 작성 가능한 피드백 텍스트", example = "말투가 너무 날카로운 것 같아요. ...") | ||
String feedbackText) { | ||
|
||
public SocialFeedback toEntity(long roomId, Member deliver, Member receiver) { | ||
return new SocialFeedback( | ||
null, | ||
roomId, | ||
deliver, | ||
receiver, | ||
evaluationPoint, | ||
FeedbackKeywordConverter.convertToKeywords(feedbackKeywords), | ||
feedbackText | ||
); | ||
} | ||
} |
34 changes: 0 additions & 34 deletions
34
backend/src/main/java/corea/feedback/dto/SocialFeedbackRequest.java
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
backend/src/main/java/corea/feedback/dto/SocialFeedbackUpdateInput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package corea.feedback.dto; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
import java.util.List; | ||
|
||
@Schema(description = "커뮤니케이션 능력 관련 피드백 업데이트 요청") | ||
public record SocialFeedbackUpdateInput(@Schema(description = "업데이트할 평가 점수", example = "4") | ||
int evaluationPoint, | ||
|
||
@Schema(description = "업데이트할 피드백 키워드", example = "[\"이해가 잘 되게 설명을 잘해줘요(못해줘요)\", \"도움이 되었어요(아니에요)\"]") | ||
List<String> feedbackKeywords, | ||
|
||
@Schema(description = "업데이트할 피드백 텍스트", example = "말투가 너무 날카로운 것 같아요. ...") | ||
String feedbackText) { | ||
} |
16 changes: 16 additions & 0 deletions
16
backend/src/main/java/corea/feedback/dto/SocialFeedbackUpdateRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package corea.feedback.dto; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
import java.util.List; | ||
|
||
@Schema(description = "커뮤니케이션 능력 관련 피드백 업데이트 요청") | ||
public record SocialFeedbackUpdateRequest(@Schema(description = "업데이트할 평가 점수", example = "4") | ||
int evaluationPoint, | ||
|
||
@Schema(description = "업데이트할 피드백 키워드", example = "[\"이해가 잘 되게 설명을 잘해줘요(못해줘요)\", \"도움이 되었어요(아니에요)\"]") | ||
List<String> feedbackKeywords, | ||
|
||
@Schema(description = "업데이트할 피드백 텍스트", example = "말투가 너무 날카로운 것 같아요. ...") | ||
String feedbackText) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.