diff --git a/src/main/java/corecord/dev/domain/ability/application/AbilityDbService.java b/src/main/java/corecord/dev/domain/ability/application/AbilityDbService.java index 3c66841..5010d89 100644 --- a/src/main/java/corecord/dev/domain/ability/application/AbilityDbService.java +++ b/src/main/java/corecord/dev/domain/ability/application/AbilityDbService.java @@ -2,7 +2,7 @@ import corecord.dev.domain.ability.domain.dto.response.AbilityResponse; import corecord.dev.domain.ability.domain.entity.Ability; -import corecord.dev.domain.ability.domain.entity.Keyword; +import corecord.dev.domain.ability.domain.enums.Keyword; import corecord.dev.domain.ability.domain.repository.AbilityRepository; import corecord.dev.domain.folder.domain.entity.Folder; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/corecord/dev/domain/ability/application/AbilityServiceImpl.java b/src/main/java/corecord/dev/domain/ability/application/AbilityServiceImpl.java index 5855989..5a533a0 100644 --- a/src/main/java/corecord/dev/domain/ability/application/AbilityServiceImpl.java +++ b/src/main/java/corecord/dev/domain/ability/application/AbilityServiceImpl.java @@ -3,7 +3,7 @@ import corecord.dev.domain.ability.domain.converter.AbilityConverter; import corecord.dev.domain.ability.domain.dto.response.AbilityResponse; import corecord.dev.domain.ability.domain.entity.Ability; -import corecord.dev.domain.ability.domain.entity.Keyword; +import corecord.dev.domain.ability.domain.enums.Keyword; import corecord.dev.domain.ability.exception.AbilityException; import corecord.dev.domain.ability.status.AbilityErrorStatus; import corecord.dev.domain.analysis.domain.entity.Analysis; diff --git a/src/main/java/corecord/dev/domain/ability/domain/converter/AbilityConverter.java b/src/main/java/corecord/dev/domain/ability/domain/converter/AbilityConverter.java index cbdeb38..7bb6a4a 100644 --- a/src/main/java/corecord/dev/domain/ability/domain/converter/AbilityConverter.java +++ b/src/main/java/corecord/dev/domain/ability/domain/converter/AbilityConverter.java @@ -2,7 +2,7 @@ import corecord.dev.domain.ability.domain.dto.response.AbilityResponse; import corecord.dev.domain.ability.domain.entity.Ability; -import corecord.dev.domain.ability.domain.entity.Keyword; +import corecord.dev.domain.ability.domain.enums.Keyword; import corecord.dev.domain.analysis.domain.entity.Analysis; import corecord.dev.domain.user.domain.entity.User; diff --git a/src/main/java/corecord/dev/domain/ability/domain/dto/response/AbilityResponse.java b/src/main/java/corecord/dev/domain/ability/domain/dto/response/AbilityResponse.java index bbb7ccb..9352af0 100644 --- a/src/main/java/corecord/dev/domain/ability/domain/dto/response/AbilityResponse.java +++ b/src/main/java/corecord/dev/domain/ability/domain/dto/response/AbilityResponse.java @@ -1,6 +1,6 @@ package corecord.dev.domain.ability.domain.dto.response; -import corecord.dev.domain.ability.domain.entity.Keyword; +import corecord.dev.domain.ability.domain.enums.Keyword; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/src/main/java/corecord/dev/domain/ability/domain/entity/Ability.java b/src/main/java/corecord/dev/domain/ability/domain/entity/Ability.java index 10d7dbc..db90e4f 100644 --- a/src/main/java/corecord/dev/domain/ability/domain/entity/Ability.java +++ b/src/main/java/corecord/dev/domain/ability/domain/entity/Ability.java @@ -1,6 +1,7 @@ package corecord.dev.domain.ability.domain.entity; import corecord.dev.common.base.BaseEntity; +import corecord.dev.domain.ability.domain.enums.Keyword; import corecord.dev.domain.analysis.domain.entity.Analysis; import corecord.dev.domain.user.domain.entity.User; import jakarta.persistence.*; diff --git a/src/main/java/corecord/dev/domain/ability/domain/entity/Keyword.java b/src/main/java/corecord/dev/domain/ability/domain/enums/Keyword.java similarity index 94% rename from src/main/java/corecord/dev/domain/ability/domain/entity/Keyword.java rename to src/main/java/corecord/dev/domain/ability/domain/enums/Keyword.java index af9dd6d..fb2bdbd 100644 --- a/src/main/java/corecord/dev/domain/ability/domain/entity/Keyword.java +++ b/src/main/java/corecord/dev/domain/ability/domain/enums/Keyword.java @@ -1,4 +1,4 @@ -package corecord.dev.domain.ability.domain.entity; +package corecord.dev.domain.ability.domain.enums; import lombok.AllArgsConstructor; diff --git a/src/main/java/corecord/dev/domain/ability/domain/repository/AbilityRepository.java b/src/main/java/corecord/dev/domain/ability/domain/repository/AbilityRepository.java index abc6b05..de52e16 100644 --- a/src/main/java/corecord/dev/domain/ability/domain/repository/AbilityRepository.java +++ b/src/main/java/corecord/dev/domain/ability/domain/repository/AbilityRepository.java @@ -2,7 +2,7 @@ import corecord.dev.domain.ability.domain.dto.response.AbilityResponse; import corecord.dev.domain.ability.domain.entity.Ability; -import corecord.dev.domain.ability.domain.entity.Keyword; +import corecord.dev.domain.ability.domain.enums.Keyword; import corecord.dev.domain.folder.domain.entity.Folder; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; diff --git a/src/main/java/corecord/dev/domain/analysis/domain/converter/AnalysisConverter.java b/src/main/java/corecord/dev/domain/analysis/domain/converter/AnalysisConverter.java index 298a7b4..be6d9af 100644 --- a/src/main/java/corecord/dev/domain/analysis/domain/converter/AnalysisConverter.java +++ b/src/main/java/corecord/dev/domain/analysis/domain/converter/AnalysisConverter.java @@ -4,7 +4,7 @@ import corecord.dev.domain.ability.domain.dto.response.AbilityResponse; import corecord.dev.domain.analysis.domain.dto.response.AnalysisResponse; import corecord.dev.domain.analysis.domain.entity.Analysis; -import corecord.dev.domain.record.domain.entity.RecordType; +import corecord.dev.domain.record.domain.enums.RecordType; import corecord.dev.domain.record.domain.entity.Record; import java.util.List; diff --git a/src/main/java/corecord/dev/domain/analysis/domain/dto/response/AnalysisResponse.java b/src/main/java/corecord/dev/domain/analysis/domain/dto/response/AnalysisResponse.java index 1bc6b77..67fa616 100644 --- a/src/main/java/corecord/dev/domain/analysis/domain/dto/response/AnalysisResponse.java +++ b/src/main/java/corecord/dev/domain/analysis/domain/dto/response/AnalysisResponse.java @@ -1,7 +1,7 @@ package corecord.dev.domain.analysis.domain.dto.response; import corecord.dev.domain.ability.domain.dto.response.AbilityResponse; -import corecord.dev.domain.record.domain.entity.RecordType; +import corecord.dev.domain.record.domain.enums.RecordType; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/src/main/java/corecord/dev/domain/feedback/application/FeedbackAlarmSender.java b/src/main/java/corecord/dev/domain/feedback/application/FeedbackAlarmSender.java new file mode 100644 index 0000000..0f87638 --- /dev/null +++ b/src/main/java/corecord/dev/domain/feedback/application/FeedbackAlarmSender.java @@ -0,0 +1,13 @@ +package corecord.dev.domain.feedback.application; + +import corecord.dev.domain.analysis.domain.entity.Analysis; +import corecord.dev.domain.chat.domain.entity.Chat; +import corecord.dev.domain.feedback.domain.dto.request.FeedbackRequest; +import corecord.dev.domain.record.domain.entity.Record; + +import java.util.List; + +public interface FeedbackAlarmSender { + void sendChatFeedbackAlarm(Record record, FeedbackRequest.FeedbackDto feedbackDto, List chatList); + void sendAnalysisFeedbackAlarm(Record record, FeedbackRequest.FeedbackDto feedbackDto, Analysis analysis); +} diff --git a/src/main/java/corecord/dev/domain/feedback/application/FeedbackDbService.java b/src/main/java/corecord/dev/domain/feedback/application/FeedbackDbService.java new file mode 100644 index 0000000..d967a1e --- /dev/null +++ b/src/main/java/corecord/dev/domain/feedback/application/FeedbackDbService.java @@ -0,0 +1,24 @@ +package corecord.dev.domain.feedback.application; + +import corecord.dev.domain.feedback.domain.entity.Feedback; +import corecord.dev.domain.feedback.domain.repository.FeedbackRepository; +import corecord.dev.domain.user.domain.entity.User; +import jakarta.transaction.Transactional; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +public class FeedbackDbService { + private final FeedbackRepository feedbackRepository; + + @Transactional + public void saveFeedback(Feedback feedback) { + feedbackRepository.save(feedback); + } + + @Transactional + public boolean existsByUserAndRecordId(User user, Long recordId) { + return feedbackRepository.existsByUserAndRecordId(user, recordId); + } +} diff --git a/src/main/java/corecord/dev/domain/feedback/application/FeedbackService.java b/src/main/java/corecord/dev/domain/feedback/application/FeedbackService.java new file mode 100644 index 0000000..9e60bee --- /dev/null +++ b/src/main/java/corecord/dev/domain/feedback/application/FeedbackService.java @@ -0,0 +1,7 @@ +package corecord.dev.domain.feedback.application; + +import corecord.dev.domain.feedback.domain.dto.request.FeedbackRequest; + +public interface FeedbackService { + void saveFeedback(Long userId, FeedbackRequest.FeedbackDto feedbackDto); +} diff --git a/src/main/java/corecord/dev/domain/feedback/application/FeedbackServiceImpl.java b/src/main/java/corecord/dev/domain/feedback/application/FeedbackServiceImpl.java new file mode 100644 index 0000000..eb7e02b --- /dev/null +++ b/src/main/java/corecord/dev/domain/feedback/application/FeedbackServiceImpl.java @@ -0,0 +1,90 @@ +package corecord.dev.domain.feedback.application; + +import corecord.dev.domain.analysis.application.AnalysisDbService; +import corecord.dev.domain.analysis.domain.entity.Analysis; +import corecord.dev.domain.chat.application.ChatDbService; +import corecord.dev.domain.chat.domain.entity.Chat; +import corecord.dev.domain.feedback.domain.converter.FeedbackConverter; +import corecord.dev.domain.feedback.domain.dto.request.FeedbackRequest; +import corecord.dev.domain.feedback.domain.entity.Feedback; +import corecord.dev.domain.feedback.domain.enums.FeedbackType; +import corecord.dev.domain.feedback.domain.enums.Satisfaction; +import corecord.dev.domain.feedback.domain.exception.FeedbackException; +import corecord.dev.domain.feedback.domain.status.FeedbackErrorStatus; +import corecord.dev.domain.record.application.RecordDbService; +import corecord.dev.domain.record.domain.entity.Record; +import corecord.dev.domain.user.application.UserDbService; +import corecord.dev.domain.user.domain.entity.User; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +@RequiredArgsConstructor +public class FeedbackServiceImpl implements FeedbackService { + private final UserDbService userDbService; + private final RecordDbService recordDbService; + private final FeedbackDbService feedbackDbService; + private final ChatDbService chatDbService; + private final AnalysisDbService analysisDbService; + private final FeedbackAlarmSender feedbackAlarmSender; + + /** + * 피드백 저장 + * + * @param userId + * @param feedbackDto + */ + + public void saveFeedback(Long userId, FeedbackRequest.FeedbackDto feedbackDto) { + User user = userDbService.findUserById(userId); + + // 해당 user의 Record 확인 & 피드백 중복 검사 + Record record = getValidatedRecord(user, feedbackDto.getRecordId()); + checkAlreadyFeedback(user, record.getRecordId()); + + // 불만족 피드백 처리 + if (feedbackDto.getSatisfaction() == Satisfaction.BAD) { + checkCommentLength(feedbackDto.getComment()); + sendFeedbackAlarm(record, feedbackDto); + } + + // 피드백 저장 + Feedback feedback = FeedbackConverter.toFeedbackEntity(user, feedbackDto); + feedbackDbService.saveFeedback(feedback); + } + + private Record getValidatedRecord(User user, Long recordId) { + Record record = recordDbService.findRecordById(recordId); + if (!record.getUser().getUserId().equals(user.getUserId())) { + throw new FeedbackException(FeedbackErrorStatus.UNAUTHORIZED_FEEDBACK); + } + return record; + } + + private void checkAlreadyFeedback(User user, Long recordId) { + if (feedbackDbService.existsByUserAndRecordId(user, recordId)) { + throw new FeedbackException(FeedbackErrorStatus.ALREADY_FEEDBACK); + } + } + + private void checkCommentLength(String comment) { + if (comment != null && comment.length() > 200) { + throw new FeedbackException(FeedbackErrorStatus.OVERFLOW_FEEDBACK_COMMENT); + } + } + + private void sendFeedbackAlarm(Record record, FeedbackRequest.FeedbackDto feedbackDto) { + switch (feedbackDto.getFeedbackType()) { + case FeedbackType.CHAT -> { + List chatHistory = chatDbService.findChatsByChatRoom(record.getChatRoom()); + feedbackAlarmSender.sendChatFeedbackAlarm(record, feedbackDto, chatHistory); + } + case FeedbackType.ANALYSIS -> { + Analysis analysis = analysisDbService.findAnalysisById(record.getAnalysis().getAnalysisId()); + feedbackAlarmSender.sendAnalysisFeedbackAlarm(record, feedbackDto, analysis); + } + } + } +} diff --git a/src/main/java/corecord/dev/domain/feedback/domain/converter/FeedbackConverter.java b/src/main/java/corecord/dev/domain/feedback/domain/converter/FeedbackConverter.java new file mode 100644 index 0000000..1eed8d1 --- /dev/null +++ b/src/main/java/corecord/dev/domain/feedback/domain/converter/FeedbackConverter.java @@ -0,0 +1,18 @@ +package corecord.dev.domain.feedback.domain.converter; + +import corecord.dev.domain.feedback.domain.dto.request.FeedbackRequest; +import corecord.dev.domain.feedback.domain.entity.Feedback; +import corecord.dev.domain.user.domain.entity.User; + +public class FeedbackConverter { + public static Feedback toFeedbackEntity(User user, FeedbackRequest.FeedbackDto feedbackDto) { + return Feedback.builder() + .satisfaction(feedbackDto.getSatisfaction()) + .feedbackType(feedbackDto.getFeedbackType()) + .issue(feedbackDto.getIssue()) + .comment(feedbackDto.getComment()) + .recordId(feedbackDto.getRecordId()) + .user(user) + .build(); + } +} diff --git a/src/main/java/corecord/dev/domain/feedback/domain/dto/request/FeedbackRequest.java b/src/main/java/corecord/dev/domain/feedback/domain/dto/request/FeedbackRequest.java new file mode 100644 index 0000000..37faecf --- /dev/null +++ b/src/main/java/corecord/dev/domain/feedback/domain/dto/request/FeedbackRequest.java @@ -0,0 +1,23 @@ +package corecord.dev.domain.feedback.domain.dto.request; + +import corecord.dev.domain.feedback.domain.enums.FeedbackType; +import corecord.dev.domain.feedback.domain.enums.Issue; +import corecord.dev.domain.feedback.domain.enums.Satisfaction; +import jakarta.validation.constraints.NotNull; +import lombok.Builder; +import lombok.Data; + +public class FeedbackRequest { + + @Data + @Builder + public static class FeedbackDto { + @NotNull(message = "recordId를 입력해주세요.") + private Long recordId; + @NotNull(message = "만족 여부를 입력해주세요.") + private Satisfaction satisfaction; + private FeedbackType feedbackType; + private Issue issue; + private String comment; + } +} diff --git a/src/main/java/corecord/dev/domain/feedback/domain/entity/Feedback.java b/src/main/java/corecord/dev/domain/feedback/domain/entity/Feedback.java new file mode 100644 index 0000000..b66f08d --- /dev/null +++ b/src/main/java/corecord/dev/domain/feedback/domain/entity/Feedback.java @@ -0,0 +1,48 @@ +package corecord.dev.domain.feedback.domain.entity; + +import corecord.dev.common.base.BaseEntity; +import corecord.dev.domain.feedback.domain.enums.FeedbackType; +import corecord.dev.domain.feedback.domain.enums.Issue; +import corecord.dev.domain.feedback.domain.enums.Satisfaction; +import corecord.dev.domain.user.domain.entity.User; +import jakarta.persistence.*; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Entity +@Getter +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Table(name = "feedback") +public class Feedback extends BaseEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "feedback_id", nullable = false) + private Long feedbackId; + + @Enumerated(EnumType.STRING) + @Column(name = "satisfaction", nullable = false) + private Satisfaction satisfaction; + + @Enumerated(EnumType.STRING) + @Column(name = "feedback_type", nullable = true) + private FeedbackType feedbackType; + + @Enumerated(EnumType.STRING) + @Column(name = "issue", nullable = true) + private Issue issue; + + @Column(name = "comment", nullable = true, length = 200) + private String comment; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "user_id", nullable = false) + private User user; + + @Column(name = "record_id", nullable = false) + private Long recordId; +} diff --git a/src/main/java/corecord/dev/domain/feedback/domain/enums/FeedbackType.java b/src/main/java/corecord/dev/domain/feedback/domain/enums/FeedbackType.java new file mode 100644 index 0000000..5a62889 --- /dev/null +++ b/src/main/java/corecord/dev/domain/feedback/domain/enums/FeedbackType.java @@ -0,0 +1,5 @@ +package corecord.dev.domain.feedback.domain.enums; + +public enum FeedbackType { + CHAT, ANALYSIS +} diff --git a/src/main/java/corecord/dev/domain/feedback/domain/enums/Issue.java b/src/main/java/corecord/dev/domain/feedback/domain/enums/Issue.java new file mode 100644 index 0000000..4b52ec0 --- /dev/null +++ b/src/main/java/corecord/dev/domain/feedback/domain/enums/Issue.java @@ -0,0 +1,24 @@ +package corecord.dev.domain.feedback.domain.enums; + +import lombok.AllArgsConstructor; + +@AllArgsConstructor +public enum Issue { + // chat issue + IRRELEVANT_ANSWER("제 경험과 관련없는 답변을 해요"), + TOO_SIMPLE("질문이 너무 모호하거나 단순해요"), + REPETITIVE("자연스럽지 않고 같은 질문을 반복해요"), + NO_SPECIFIC("경험을 더 구체적으로 정리할 수 없어요"), + + // analysis issue + IRRELEVANT_KEYWORD("경험과 관련없은 역량 키워드에요"), + TOO_SHORT("코멘트가 짧고 피드백이 구체적이지 않아요"), + AWKWARD("문장이 자연스럽지 않고 어색해요"), + VAGUE_COMMENT("코멘트가 모호해서 개선할 점을 모르겠어요"); + + private final String description; + + public String getDescription() { + return description; + } +} diff --git a/src/main/java/corecord/dev/domain/feedback/domain/enums/Satisfaction.java b/src/main/java/corecord/dev/domain/feedback/domain/enums/Satisfaction.java new file mode 100644 index 0000000..a6d90c1 --- /dev/null +++ b/src/main/java/corecord/dev/domain/feedback/domain/enums/Satisfaction.java @@ -0,0 +1,5 @@ +package corecord.dev.domain.feedback.domain.enums; + +public enum Satisfaction { + GOOD, BAD +} diff --git a/src/main/java/corecord/dev/domain/feedback/domain/exception/FeedbackException.java b/src/main/java/corecord/dev/domain/feedback/domain/exception/FeedbackException.java new file mode 100644 index 0000000..e981b45 --- /dev/null +++ b/src/main/java/corecord/dev/domain/feedback/domain/exception/FeedbackException.java @@ -0,0 +1,18 @@ +package corecord.dev.domain.feedback.domain.exception; + +import corecord.dev.common.base.BaseErrorStatus; +import corecord.dev.common.exception.GeneralException; +import lombok.Getter; + +@Getter +public class FeedbackException extends GeneralException { + + public FeedbackException(BaseErrorStatus errorStatus) { + super(errorStatus); + } + + @Override + public String getMessage() { + return errorStatus.getMessage(); + } +} diff --git a/src/main/java/corecord/dev/domain/feedback/domain/repository/FeedbackRepository.java b/src/main/java/corecord/dev/domain/feedback/domain/repository/FeedbackRepository.java new file mode 100644 index 0000000..b513d35 --- /dev/null +++ b/src/main/java/corecord/dev/domain/feedback/domain/repository/FeedbackRepository.java @@ -0,0 +1,11 @@ +package corecord.dev.domain.feedback.domain.repository; + +import corecord.dev.domain.feedback.domain.entity.Feedback; +import corecord.dev.domain.user.domain.entity.User; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface FeedbackRepository extends JpaRepository { + boolean existsByUserAndRecordId(User user, Long recordId); +} diff --git a/src/main/java/corecord/dev/domain/feedback/domain/status/FeedbackErrorStatus.java b/src/main/java/corecord/dev/domain/feedback/domain/status/FeedbackErrorStatus.java new file mode 100644 index 0000000..c8d56e4 --- /dev/null +++ b/src/main/java/corecord/dev/domain/feedback/domain/status/FeedbackErrorStatus.java @@ -0,0 +1,19 @@ +package corecord.dev.domain.feedback.domain.status; + +import corecord.dev.common.base.BaseErrorStatus; +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.springframework.http.HttpStatus; + +@Getter +@AllArgsConstructor +public enum FeedbackErrorStatus implements BaseErrorStatus { + OVERFLOW_FEEDBACK_COMMENT(HttpStatus.BAD_REQUEST, "E203_OVERFLOW_FEEDBACK_COMMENT", "피드백 내용은 200자 이내여야 합니다."), + UNAUTHORIZED_FEEDBACK(HttpStatus.UNAUTHORIZED, "E203_FEEDBACK_UNAUTHORIZED", "유저가 해당 피드백에 대한 권한이 없습니다."), + ALREADY_FEEDBACK(HttpStatus.BAD_REQUEST, "E203_ALREADY_FEEDBACK", "이미 피드백을 작성한 경험입니다."), + ; + + private final HttpStatus httpStatus; + private final String code; + private final String message; +} diff --git a/src/main/java/corecord/dev/domain/feedback/domain/status/FeedbackSuccessStatus.java b/src/main/java/corecord/dev/domain/feedback/domain/status/FeedbackSuccessStatus.java new file mode 100644 index 0000000..278558c --- /dev/null +++ b/src/main/java/corecord/dev/domain/feedback/domain/status/FeedbackSuccessStatus.java @@ -0,0 +1,17 @@ +package corecord.dev.domain.feedback.domain.status; + +import corecord.dev.common.base.BaseSuccessStatus; +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.springframework.http.HttpStatus; + +@Getter +@AllArgsConstructor +public enum FeedbackSuccessStatus implements BaseSuccessStatus { + FEEDBACK_POST_SUCCESS(HttpStatus.CREATED, "S203", "AI 만족도 조사 결과가 성공적으로 저장되었습니다."), + ; + + private final HttpStatus httpStatus; + private final String code; + private final String message; +} diff --git a/src/main/java/corecord/dev/domain/feedback/infra/notification/converter/FeedbackAlarmConverter.java b/src/main/java/corecord/dev/domain/feedback/infra/notification/converter/FeedbackAlarmConverter.java new file mode 100644 index 0000000..0c6f307 --- /dev/null +++ b/src/main/java/corecord/dev/domain/feedback/infra/notification/converter/FeedbackAlarmConverter.java @@ -0,0 +1,17 @@ +package corecord.dev.domain.feedback.infra.notification.converter; + +import corecord.dev.domain.feedback.domain.dto.request.FeedbackRequest; +import corecord.dev.domain.feedback.infra.notification.dto.FeedbackAlarmDto; + +public class FeedbackAlarmConverter { + public static FeedbackAlarmDto toFeedbackAlarmDto(FeedbackRequest.FeedbackDto feedback, String content) { + return FeedbackAlarmDto.builder() + .recordId(feedback.getRecordId()) + .feedbackType(feedback.getFeedbackType()) + .issue(feedback.getIssue()) + .comment(feedback.getComment()) + .content(content) + .build(); + } +} + diff --git a/src/main/java/corecord/dev/domain/feedback/infra/notification/discord/FeedbackDiscordAlarmSender.java b/src/main/java/corecord/dev/domain/feedback/infra/notification/discord/FeedbackDiscordAlarmSender.java new file mode 100644 index 0000000..455bdd7 --- /dev/null +++ b/src/main/java/corecord/dev/domain/feedback/infra/notification/discord/FeedbackDiscordAlarmSender.java @@ -0,0 +1,53 @@ +package corecord.dev.domain.feedback.infra.notification.discord; + +import corecord.dev.domain.analysis.domain.entity.Analysis; +import corecord.dev.domain.chat.domain.entity.Chat; +import corecord.dev.domain.feedback.application.FeedbackAlarmSender; +import corecord.dev.domain.feedback.domain.dto.request.FeedbackRequest; +import corecord.dev.domain.feedback.infra.notification.converter.FeedbackAlarmConverter; +import corecord.dev.domain.feedback.infra.notification.dto.FeedbackAlarmDto; +import corecord.dev.domain.record.domain.entity.Record; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.env.Environment; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Service; +import org.springframework.web.reactive.function.client.WebClient; + +import java.util.Arrays; +import java.util.List; + +@Service +@RequiredArgsConstructor +public class FeedbackDiscordAlarmSender implements FeedbackAlarmSender { + private final Environment environment; + private final FeedbackDiscordUtil discordUtil; + private final WebClient webClient = WebClient.create(); + + @Value("${logging.discord.feedback-web-hook-url}") + private String feedbackWebHookUrl; + + @Override + public void sendChatFeedbackAlarm(Record record, FeedbackRequest.FeedbackDto feedbackDto, List chatList) { + String content = discordUtil.createChatFeedbackContent(chatList); + sendFeedbackDiscordAlarm(FeedbackAlarmConverter.toFeedbackAlarmDto(feedbackDto, content)); + } + + @Override + public void sendAnalysisFeedbackAlarm(Record record, FeedbackRequest.FeedbackDto feedbackDto, Analysis analysis) { + String content = discordUtil.createAnalysisFeedbackContent(record, analysis); + sendFeedbackDiscordAlarm(FeedbackAlarmConverter.toFeedbackAlarmDto(feedbackDto, content)); + } + + private void sendFeedbackDiscordAlarm(FeedbackAlarmDto feedbackAlarmDto) { + if (Arrays.asList(environment.getActiveProfiles()).contains("dev")) { + webClient.post() + .uri(feedbackWebHookUrl) + .contentType(MediaType.APPLICATION_JSON) + .bodyValue(discordUtil.createFeedbackMessage(feedbackAlarmDto)) + .retrieve() + .bodyToMono(Void.class) + .block(); + } + } +} diff --git a/src/main/java/corecord/dev/domain/feedback/infra/notification/discord/FeedbackDiscordUtil.java b/src/main/java/corecord/dev/domain/feedback/infra/notification/discord/FeedbackDiscordUtil.java new file mode 100644 index 0000000..2d47f8a --- /dev/null +++ b/src/main/java/corecord/dev/domain/feedback/infra/notification/discord/FeedbackDiscordUtil.java @@ -0,0 +1,59 @@ +package corecord.dev.domain.feedback.infra.notification.discord; + +import corecord.dev.common.log.discord.dto.DiscordDto; +import corecord.dev.domain.ability.domain.entity.Ability; +import corecord.dev.domain.analysis.domain.entity.Analysis; +import corecord.dev.domain.chat.domain.entity.Chat; +import corecord.dev.domain.feedback.infra.notification.dto.FeedbackAlarmDto; +import corecord.dev.domain.record.domain.entity.Record; +import org.springframework.stereotype.Component; + +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.stream.Collectors; + +@Component +public class FeedbackDiscordUtil { + public DiscordDto.MessageDto createFeedbackMessage(FeedbackAlarmDto feedbackAlarmDto) { + return DiscordDto.MessageDto.builder() + .content("# 🚨 AI 피드백 불만족 알림 🚨") + .embeds(List.of( + DiscordDto.EmbedDto.builder() + .title("📌 피드백 정보") + .description( + "### 🕒 피드백 작성 시간\n" + + ZonedDateTime.now(ZoneId.of("Asia/Seoul")) + .format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH시 mm분 ss초")) + "\n\n" + + "### 🔍 관련 기록 (Record ID)\n" + + feedbackAlarmDto.getRecordId() + "\n\n" + + "### 📄 피드백 종류\n" + + feedbackAlarmDto.getFeedbackType() + "\n\n" + + (feedbackAlarmDto.getIssue() != null ? + "### ❗ 피드백 제목\n" + feedbackAlarmDto.getIssue().getDescription() + "\n\n" : "") + + (feedbackAlarmDto.getComment() != null ? + "### 💬 사용자 직접 입력 코멘트\n" + + feedbackAlarmDto.getComment() + "\n\n" : "") + + "### 📜 관련 내용\n" + + "```\n" + feedbackAlarmDto.getContent() + "\n```" + ) + .build() + )).build(); + } + + public String createChatFeedbackContent(List chatList) { + return chatList.stream() + .map(chat -> String.format("[%s] : %s", chat.getAuthor() == 0 ? "AI" : "사용자", chat.getContent())) + .collect(Collectors.joining("\n")); + } + + public String createAnalysisFeedbackContent(Record record, Analysis analysis) { + return String.format("[경험 기록]\n%s\n\n[핵심 역량]\n%s\n[보완점]\n%s\n", + record.getContent(), + analysis.getAbilityList().stream() + .map(ability -> String.format("- %s: %s", ability.getKeyword().getValue(), ability.getContent())) + .collect(Collectors.joining("\n")), + analysis.getComment()); + } +} diff --git a/src/main/java/corecord/dev/domain/feedback/infra/notification/dto/FeedbackAlarmDto.java b/src/main/java/corecord/dev/domain/feedback/infra/notification/dto/FeedbackAlarmDto.java new file mode 100644 index 0000000..c23e064 --- /dev/null +++ b/src/main/java/corecord/dev/domain/feedback/infra/notification/dto/FeedbackAlarmDto.java @@ -0,0 +1,16 @@ +package corecord.dev.domain.feedback.infra.notification.dto; + +import corecord.dev.domain.feedback.domain.enums.FeedbackType; +import corecord.dev.domain.feedback.domain.enums.Issue; +import lombok.Builder; +import lombok.Data; + +@Data +@Builder +public class FeedbackAlarmDto { + private Long recordId; + private FeedbackType feedbackType; + private Issue issue; + private String comment; + private String content; +} \ No newline at end of file diff --git a/src/main/java/corecord/dev/domain/feedback/presentation/FeedbackController.java b/src/main/java/corecord/dev/domain/feedback/presentation/FeedbackController.java new file mode 100644 index 0000000..615be5c --- /dev/null +++ b/src/main/java/corecord/dev/domain/feedback/presentation/FeedbackController.java @@ -0,0 +1,31 @@ +package corecord.dev.domain.feedback.presentation; + +import corecord.dev.common.response.ApiResponse; +import corecord.dev.common.web.UserId; +import corecord.dev.domain.feedback.application.FeedbackService; +import corecord.dev.domain.feedback.domain.dto.request.FeedbackRequest; +import corecord.dev.domain.feedback.domain.status.FeedbackSuccessStatus; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +@RequestMapping("/api/feedback") +public class FeedbackController { + private final FeedbackService feedbackService; + + @PostMapping + public ResponseEntity> saveFeedback( + @UserId Long userId, + @RequestBody @Valid FeedbackRequest.FeedbackDto feedbackDto + ) { + feedbackService.saveFeedback(userId, feedbackDto); + return ApiResponse.success(FeedbackSuccessStatus.FEEDBACK_POST_SUCCESS); + + } +} diff --git a/src/main/java/corecord/dev/domain/record/application/RecordDbService.java b/src/main/java/corecord/dev/domain/record/application/RecordDbService.java index 6c25946..d3fbf6e 100644 --- a/src/main/java/corecord/dev/domain/record/application/RecordDbService.java +++ b/src/main/java/corecord/dev/domain/record/application/RecordDbService.java @@ -1,6 +1,6 @@ package corecord.dev.domain.record.application; -import corecord.dev.domain.ability.domain.entity.Keyword; +import corecord.dev.domain.ability.domain.enums.Keyword; import corecord.dev.domain.folder.domain.entity.Folder; import corecord.dev.domain.record.domain.entity.Record; import corecord.dev.domain.record.domain.repository.RecordRepository; diff --git a/src/main/java/corecord/dev/domain/record/application/RecordServiceImpl.java b/src/main/java/corecord/dev/domain/record/application/RecordServiceImpl.java index 0d95fa1..22b402e 100644 --- a/src/main/java/corecord/dev/domain/record/application/RecordServiceImpl.java +++ b/src/main/java/corecord/dev/domain/record/application/RecordServiceImpl.java @@ -1,6 +1,6 @@ package corecord.dev.domain.record.application; -import corecord.dev.domain.ability.domain.entity.Keyword; +import corecord.dev.domain.ability.domain.enums.Keyword; import corecord.dev.domain.ability.exception.AbilityException; import corecord.dev.domain.ability.status.AbilityErrorStatus; import corecord.dev.domain.analysis.application.AnalysisService; @@ -12,7 +12,7 @@ import corecord.dev.domain.record.domain.dto.request.RecordRequest; import corecord.dev.domain.record.domain.dto.response.RecordResponse; import corecord.dev.domain.record.domain.entity.Record; -import corecord.dev.domain.record.domain.entity.RecordType; +import corecord.dev.domain.record.domain.enums.RecordType; import corecord.dev.domain.record.exception.RecordException; import corecord.dev.domain.record.status.RecordErrorStatus; import corecord.dev.domain.user.application.UserDbService; diff --git a/src/main/java/corecord/dev/domain/record/domain/converter/RecordConverter.java b/src/main/java/corecord/dev/domain/record/domain/converter/RecordConverter.java index 06175b4..19ab246 100644 --- a/src/main/java/corecord/dev/domain/record/domain/converter/RecordConverter.java +++ b/src/main/java/corecord/dev/domain/record/domain/converter/RecordConverter.java @@ -1,10 +1,10 @@ package corecord.dev.domain.record.domain.converter; -import corecord.dev.domain.ability.domain.entity.Keyword; +import corecord.dev.domain.ability.domain.enums.Keyword; import corecord.dev.domain.ability.domain.entity.Ability; import corecord.dev.domain.chat.domain.entity.ChatRoom; import corecord.dev.domain.folder.domain.entity.Folder; -import corecord.dev.domain.record.domain.entity.RecordType; +import corecord.dev.domain.record.domain.enums.RecordType; import corecord.dev.domain.record.domain.dto.response.RecordResponse; import corecord.dev.domain.record.domain.entity.Record; import corecord.dev.domain.user.domain.entity.User; diff --git a/src/main/java/corecord/dev/domain/record/domain/dto/request/RecordRequest.java b/src/main/java/corecord/dev/domain/record/domain/dto/request/RecordRequest.java index 761efda..ceb0670 100644 --- a/src/main/java/corecord/dev/domain/record/domain/dto/request/RecordRequest.java +++ b/src/main/java/corecord/dev/domain/record/domain/dto/request/RecordRequest.java @@ -1,6 +1,6 @@ package corecord.dev.domain.record.domain.dto.request; -import corecord.dev.domain.record.domain.entity.RecordType; +import corecord.dev.domain.record.domain.enums.RecordType; import jakarta.validation.constraints.NotBlank; import lombok.Builder; import jakarta.validation.constraints.NotNull; diff --git a/src/main/java/corecord/dev/domain/record/domain/entity/Record.java b/src/main/java/corecord/dev/domain/record/domain/entity/Record.java index 26d50fd..53e51c7 100644 --- a/src/main/java/corecord/dev/domain/record/domain/entity/Record.java +++ b/src/main/java/corecord/dev/domain/record/domain/entity/Record.java @@ -4,6 +4,7 @@ import corecord.dev.domain.analysis.domain.entity.Analysis; import corecord.dev.domain.chat.domain.entity.ChatRoom; import corecord.dev.domain.folder.domain.entity.Folder; +import corecord.dev.domain.record.domain.enums.RecordType; import corecord.dev.domain.user.domain.entity.User; import jakarta.persistence.*; import lombok.AllArgsConstructor; diff --git a/src/main/java/corecord/dev/domain/record/domain/entity/RecordType.java b/src/main/java/corecord/dev/domain/record/domain/entity/RecordType.java deleted file mode 100644 index 526ca39..0000000 --- a/src/main/java/corecord/dev/domain/record/domain/entity/RecordType.java +++ /dev/null @@ -1,5 +0,0 @@ -package corecord.dev.domain.record.domain.entity; - -public enum RecordType { - MEMO, CHAT -} diff --git a/src/main/java/corecord/dev/domain/record/domain/enums/RecordType.java b/src/main/java/corecord/dev/domain/record/domain/enums/RecordType.java new file mode 100644 index 0000000..b227966 --- /dev/null +++ b/src/main/java/corecord/dev/domain/record/domain/enums/RecordType.java @@ -0,0 +1,5 @@ +package corecord.dev.domain.record.domain.enums; + +public enum RecordType { + MEMO, CHAT +} diff --git a/src/main/java/corecord/dev/domain/record/domain/repository/RecordRepository.java b/src/main/java/corecord/dev/domain/record/domain/repository/RecordRepository.java index 1bcfa45..f816384 100644 --- a/src/main/java/corecord/dev/domain/record/domain/repository/RecordRepository.java +++ b/src/main/java/corecord/dev/domain/record/domain/repository/RecordRepository.java @@ -1,6 +1,6 @@ package corecord.dev.domain.record.domain.repository; -import corecord.dev.domain.ability.domain.entity.Keyword; +import corecord.dev.domain.ability.domain.enums.Keyword; import corecord.dev.domain.folder.domain.entity.Folder; import corecord.dev.domain.record.domain.entity.Record; import corecord.dev.domain.user.domain.entity.User; diff --git a/src/main/java/corecord/dev/domain/user/application/UserServiceImpl.java b/src/main/java/corecord/dev/domain/user/application/UserServiceImpl.java index 89850ad..80ac065 100644 --- a/src/main/java/corecord/dev/domain/user/application/UserServiceImpl.java +++ b/src/main/java/corecord/dev/domain/user/application/UserServiceImpl.java @@ -13,7 +13,7 @@ import corecord.dev.domain.user.domain.converter.UserConverter; import corecord.dev.domain.user.domain.dto.request.UserRequest; import corecord.dev.domain.user.domain.dto.response.UserResponse; -import corecord.dev.domain.user.domain.entity.Status; +import corecord.dev.domain.user.domain.enums.Status; import corecord.dev.domain.user.domain.entity.User; import corecord.dev.domain.user.exception.UserException; import corecord.dev.domain.user.status.UserErrorStatus; diff --git a/src/main/java/corecord/dev/domain/user/domain/converter/UserConverter.java b/src/main/java/corecord/dev/domain/user/domain/converter/UserConverter.java index def0245..62422b1 100644 --- a/src/main/java/corecord/dev/domain/user/domain/converter/UserConverter.java +++ b/src/main/java/corecord/dev/domain/user/domain/converter/UserConverter.java @@ -2,7 +2,7 @@ import corecord.dev.domain.user.domain.dto.request.UserRequest; import corecord.dev.domain.user.domain.dto.response.UserResponse; -import corecord.dev.domain.user.domain.entity.Status; +import corecord.dev.domain.user.domain.enums.Status; import corecord.dev.domain.user.domain.entity.User; public class UserConverter { diff --git a/src/main/java/corecord/dev/domain/user/domain/entity/User.java b/src/main/java/corecord/dev/domain/user/domain/entity/User.java index 546c334..3cf4192 100644 --- a/src/main/java/corecord/dev/domain/user/domain/entity/User.java +++ b/src/main/java/corecord/dev/domain/user/domain/entity/User.java @@ -5,6 +5,7 @@ import corecord.dev.domain.chat.domain.entity.ChatRoom; import corecord.dev.domain.folder.domain.entity.Folder; import corecord.dev.domain.record.domain.entity.Record; +import corecord.dev.domain.user.domain.enums.Status; import jakarta.persistence.*; import lombok.*; diff --git a/src/main/java/corecord/dev/domain/user/domain/entity/Status.java b/src/main/java/corecord/dev/domain/user/domain/enums/Status.java similarity index 93% rename from src/main/java/corecord/dev/domain/user/domain/entity/Status.java rename to src/main/java/corecord/dev/domain/user/domain/enums/Status.java index 4a72583..b44d15b 100644 --- a/src/main/java/corecord/dev/domain/user/domain/entity/Status.java +++ b/src/main/java/corecord/dev/domain/user/domain/enums/Status.java @@ -1,4 +1,4 @@ -package corecord.dev.domain.user.domain.entity; +package corecord.dev.domain.user.domain.enums; import corecord.dev.domain.user.status.UserErrorStatus; import corecord.dev.domain.user.exception.UserException; diff --git a/src/test/java/corecord/dev/ability/service/AbilityServiceTest.java b/src/test/java/corecord/dev/ability/service/AbilityServiceTest.java index bc947fa..3ca6433 100644 --- a/src/test/java/corecord/dev/ability/service/AbilityServiceTest.java +++ b/src/test/java/corecord/dev/ability/service/AbilityServiceTest.java @@ -3,16 +3,16 @@ import corecord.dev.domain.ability.application.AbilityDbService; import corecord.dev.domain.ability.domain.dto.response.AbilityResponse; import corecord.dev.domain.ability.domain.entity.Ability; -import corecord.dev.domain.ability.domain.entity.Keyword; +import corecord.dev.domain.ability.domain.enums.Keyword; import corecord.dev.domain.ability.status.AbilityErrorStatus; import corecord.dev.domain.ability.exception.AbilityException; import corecord.dev.domain.ability.application.AbilityService; import corecord.dev.domain.analysis.domain.entity.Analysis; import corecord.dev.domain.folder.domain.entity.Folder; -import corecord.dev.domain.record.domain.entity.RecordType; +import corecord.dev.domain.record.domain.enums.RecordType; import corecord.dev.domain.record.domain.entity.Record; import corecord.dev.domain.user.application.UserDbService; -import corecord.dev.domain.user.domain.entity.Status; +import corecord.dev.domain.user.domain.enums.Status; import corecord.dev.domain.user.domain.entity.User; import jakarta.persistence.EntityManager; import org.junit.jupiter.api.BeforeEach; @@ -27,7 +27,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import java.util.Optional; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/src/test/java/corecord/dev/analysis/service/AnalysisServiceTest.java b/src/test/java/corecord/dev/analysis/service/AnalysisServiceTest.java index f015038..a12bcb5 100644 --- a/src/test/java/corecord/dev/analysis/service/AnalysisServiceTest.java +++ b/src/test/java/corecord/dev/analysis/service/AnalysisServiceTest.java @@ -1,7 +1,7 @@ package corecord.dev.analysis.service; import corecord.dev.domain.ability.domain.entity.Ability; -import corecord.dev.domain.ability.domain.entity.Keyword; +import corecord.dev.domain.ability.domain.enums.Keyword; import corecord.dev.domain.ability.status.AbilityErrorStatus; import corecord.dev.domain.ability.exception.AbilityException; import corecord.dev.domain.ability.application.AbilityService; @@ -16,10 +16,10 @@ import corecord.dev.domain.analysis.application.AnalysisService; import corecord.dev.domain.folder.domain.entity.Folder; import corecord.dev.domain.record.application.RecordDbService; -import corecord.dev.domain.record.domain.entity.RecordType; +import corecord.dev.domain.record.domain.enums.RecordType; import corecord.dev.domain.record.domain.entity.Record; import corecord.dev.domain.user.application.UserDbService; -import corecord.dev.domain.user.domain.entity.Status; +import corecord.dev.domain.user.domain.enums.Status; import corecord.dev.domain.user.domain.entity.User; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; diff --git a/src/test/java/corecord/dev/chat/repository/ChatRepositoryTest.java b/src/test/java/corecord/dev/chat/repository/ChatRepositoryTest.java index 0fac57f..a498399 100644 --- a/src/test/java/corecord/dev/chat/repository/ChatRepositoryTest.java +++ b/src/test/java/corecord/dev/chat/repository/ChatRepositoryTest.java @@ -4,7 +4,7 @@ import corecord.dev.domain.chat.domain.entity.ChatRoom; import corecord.dev.domain.chat.domain.repository.ChatRepository; import corecord.dev.domain.chat.domain.repository.ChatRoomRepository; -import corecord.dev.domain.user.domain.entity.Status; +import corecord.dev.domain.user.domain.enums.Status; import corecord.dev.domain.user.domain.entity.User; import corecord.dev.domain.user.domain.repository.UserRepository; import jakarta.persistence.EntityManager; diff --git a/src/test/java/corecord/dev/chat/repository/ChatRoomRepositoryTest.java b/src/test/java/corecord/dev/chat/repository/ChatRoomRepositoryTest.java index 54005cd..51a2926 100644 --- a/src/test/java/corecord/dev/chat/repository/ChatRoomRepositoryTest.java +++ b/src/test/java/corecord/dev/chat/repository/ChatRoomRepositoryTest.java @@ -2,7 +2,7 @@ import corecord.dev.domain.chat.domain.entity.ChatRoom; import corecord.dev.domain.chat.domain.repository.ChatRoomRepository; -import corecord.dev.domain.user.domain.entity.Status; +import corecord.dev.domain.user.domain.enums.Status; import corecord.dev.domain.user.domain.entity.User; import corecord.dev.domain.user.domain.repository.UserRepository; import jakarta.persistence.EntityManager; diff --git a/src/test/java/corecord/dev/chat/service/ChatServiceTest.java b/src/test/java/corecord/dev/chat/service/ChatServiceTest.java index c4daa61..146e29b 100644 --- a/src/test/java/corecord/dev/chat/service/ChatServiceTest.java +++ b/src/test/java/corecord/dev/chat/service/ChatServiceTest.java @@ -10,7 +10,7 @@ import corecord.dev.domain.chat.domain.entity.ChatRoom; import corecord.dev.domain.chat.exception.ChatException; import corecord.dev.domain.user.application.UserDbService; -import corecord.dev.domain.user.domain.entity.Status; +import corecord.dev.domain.user.domain.enums.Status; import corecord.dev.domain.user.domain.entity.User; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; diff --git a/src/test/java/corecord/dev/folder/repository/FolderRepositoryTest.java b/src/test/java/corecord/dev/folder/repository/FolderRepositoryTest.java index 8a8c400..b8de135 100644 --- a/src/test/java/corecord/dev/folder/repository/FolderRepositoryTest.java +++ b/src/test/java/corecord/dev/folder/repository/FolderRepositoryTest.java @@ -2,7 +2,7 @@ import corecord.dev.domain.folder.domain.entity.Folder; import corecord.dev.domain.folder.domain.repository.FolderRepository; -import corecord.dev.domain.user.domain.entity.Status; +import corecord.dev.domain.user.domain.enums.Status; import corecord.dev.domain.user.domain.entity.User; import jakarta.persistence.EntityManager; import org.junit.jupiter.api.Test; diff --git a/src/test/java/corecord/dev/folder/service/FolderServiceTest.java b/src/test/java/corecord/dev/folder/service/FolderServiceTest.java index 95d9dda..0674f9e 100644 --- a/src/test/java/corecord/dev/folder/service/FolderServiceTest.java +++ b/src/test/java/corecord/dev/folder/service/FolderServiceTest.java @@ -7,7 +7,7 @@ import corecord.dev.domain.folder.exception.FolderException; import corecord.dev.domain.folder.application.FolderService; import corecord.dev.domain.user.application.UserDbService; -import corecord.dev.domain.user.domain.entity.Status; +import corecord.dev.domain.user.domain.enums.Status; import corecord.dev.domain.user.domain.entity.User; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/src/test/java/corecord/dev/record/memo/repository/MemoRecordRepositoryTest.java b/src/test/java/corecord/dev/record/memo/repository/MemoRecordRepositoryTest.java index cf59aa7..f538605 100644 --- a/src/test/java/corecord/dev/record/memo/repository/MemoRecordRepositoryTest.java +++ b/src/test/java/corecord/dev/record/memo/repository/MemoRecordRepositoryTest.java @@ -1,16 +1,16 @@ package corecord.dev.record.memo.repository; import corecord.dev.domain.ability.domain.entity.Ability; -import corecord.dev.domain.ability.domain.entity.Keyword; +import corecord.dev.domain.ability.domain.enums.Keyword; import corecord.dev.domain.ability.domain.repository.AbilityRepository; import corecord.dev.domain.analysis.domain.entity.Analysis; import corecord.dev.domain.analysis.domain.repository.AnalysisRepository; import corecord.dev.domain.folder.domain.entity.Folder; import corecord.dev.domain.folder.domain.repository.FolderRepository; -import corecord.dev.domain.record.domain.entity.RecordType; +import corecord.dev.domain.record.domain.enums.RecordType; import corecord.dev.domain.record.domain.entity.Record; import corecord.dev.domain.record.domain.repository.RecordRepository; -import corecord.dev.domain.user.domain.entity.Status; +import corecord.dev.domain.user.domain.enums.Status; import corecord.dev.domain.user.domain.entity.User; import corecord.dev.domain.user.domain.repository.UserRepository; import org.junit.jupiter.api.DisplayName; diff --git a/src/test/java/corecord/dev/record/memo/service/MemoRecordServiceTest.java b/src/test/java/corecord/dev/record/memo/service/MemoRecordServiceTest.java index f1dfc09..b5b8fd4 100644 --- a/src/test/java/corecord/dev/record/memo/service/MemoRecordServiceTest.java +++ b/src/test/java/corecord/dev/record/memo/service/MemoRecordServiceTest.java @@ -5,16 +5,15 @@ import corecord.dev.domain.folder.application.FolderDbService; import corecord.dev.domain.folder.domain.entity.Folder; import corecord.dev.domain.record.application.RecordDbService; -import corecord.dev.domain.record.domain.entity.RecordType; +import corecord.dev.domain.record.domain.enums.RecordType; import corecord.dev.domain.record.domain.dto.request.RecordRequest; import corecord.dev.domain.record.domain.dto.response.RecordResponse; import corecord.dev.domain.record.domain.entity.Record; -import corecord.dev.domain.record.domain.repository.RecordRepository; import corecord.dev.domain.record.status.RecordErrorStatus; import corecord.dev.domain.record.exception.RecordException; import corecord.dev.domain.record.application.RecordService; import corecord.dev.domain.user.application.UserDbService; -import corecord.dev.domain.user.domain.entity.Status; +import corecord.dev.domain.user.domain.enums.Status; import corecord.dev.domain.user.domain.entity.User; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; diff --git a/src/test/java/corecord/dev/user/repository/UserRepositoryTest.java b/src/test/java/corecord/dev/user/repository/UserRepositoryTest.java index 42f80b5..ad7bbc7 100644 --- a/src/test/java/corecord/dev/user/repository/UserRepositoryTest.java +++ b/src/test/java/corecord/dev/user/repository/UserRepositoryTest.java @@ -1,6 +1,6 @@ package corecord.dev.user.repository; -import corecord.dev.domain.user.domain.entity.Status; +import corecord.dev.domain.user.domain.enums.Status; import corecord.dev.domain.user.domain.entity.User; import corecord.dev.domain.user.domain.repository.UserRepository; import jakarta.persistence.EntityManager; diff --git a/src/test/java/corecord/dev/user/service/UserServiceTest.java b/src/test/java/corecord/dev/user/service/UserServiceTest.java index 1c90385..0a0890f 100644 --- a/src/test/java/corecord/dev/user/service/UserServiceTest.java +++ b/src/test/java/corecord/dev/user/service/UserServiceTest.java @@ -6,7 +6,7 @@ import corecord.dev.domain.user.application.UserDbService; import corecord.dev.domain.user.domain.dto.request.UserRequest; import corecord.dev.domain.user.domain.dto.response.UserResponse; -import corecord.dev.domain.user.domain.entity.Status; +import corecord.dev.domain.user.domain.enums.Status; import corecord.dev.domain.user.domain.entity.User; import corecord.dev.domain.user.status.UserErrorStatus; import corecord.dev.domain.user.exception.UserException;