diff --git a/server/.gradle/7.6.1/executionHistory/executionHistory.bin b/server/.gradle/7.6.1/executionHistory/executionHistory.bin index c48cfa0d..13913469 100644 Binary files a/server/.gradle/7.6.1/executionHistory/executionHistory.bin and b/server/.gradle/7.6.1/executionHistory/executionHistory.bin differ diff --git a/server/.gradle/7.6.1/executionHistory/executionHistory.lock b/server/.gradle/7.6.1/executionHistory/executionHistory.lock index 72810d64..4c4bcac2 100644 Binary files a/server/.gradle/7.6.1/executionHistory/executionHistory.lock and b/server/.gradle/7.6.1/executionHistory/executionHistory.lock differ diff --git a/server/.gradle/7.6.1/fileHashes/fileHashes.bin b/server/.gradle/7.6.1/fileHashes/fileHashes.bin index 5b832bbc..c77be88d 100644 Binary files a/server/.gradle/7.6.1/fileHashes/fileHashes.bin and b/server/.gradle/7.6.1/fileHashes/fileHashes.bin differ diff --git a/server/.gradle/7.6.1/fileHashes/fileHashes.lock b/server/.gradle/7.6.1/fileHashes/fileHashes.lock index 37bed07e..9f97222a 100644 Binary files a/server/.gradle/7.6.1/fileHashes/fileHashes.lock and b/server/.gradle/7.6.1/fileHashes/fileHashes.lock differ diff --git a/server/.gradle/7.6.1/fileHashes/resourceHashesCache.bin b/server/.gradle/7.6.1/fileHashes/resourceHashesCache.bin index ec48cbf3..3db58b10 100644 Binary files a/server/.gradle/7.6.1/fileHashes/resourceHashesCache.bin and b/server/.gradle/7.6.1/fileHashes/resourceHashesCache.bin differ diff --git a/server/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/server/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 5ed6a27e..5ef3f9c6 100644 Binary files a/server/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/server/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/server/Recruit-Api/src/main/java/com/econovation/recruit/api/comment/service/CommentService.java b/server/Recruit-Api/src/main/java/com/econovation/recruit/api/comment/service/CommentService.java index a3e1afa4..13153bda 100644 --- a/server/Recruit-Api/src/main/java/com/econovation/recruit/api/comment/service/CommentService.java +++ b/server/Recruit-Api/src/main/java/com/econovation/recruit/api/comment/service/CommentService.java @@ -135,6 +135,7 @@ public List findByCardId(Long cardId) { .map( comment -> { boolean isLiked = commentLikeLoadPort.getByIdpId(currentUserId); + Boolean canEdit = comment.getInterviewerId().equals(currentUserId); String interviewerName = interviewers.stream() .filter( @@ -145,8 +146,7 @@ public List findByCardId(Long cardId) { .findFirst() .map(Interviewer::getName) .orElse(""); - - return CommentPairVo.of(comment, isLiked, interviewerName); + return CommentPairVo.of(comment, isLiked, interviewerName, canEdit); }) .collect(Collectors.toList()); } @@ -192,6 +192,7 @@ public List findByApplicantId(String applicantId) { && commentLike .getIdpId() .equals(idpId)); + Boolean canEdit = comment.getInterviewerId().equals(idpId); String interviewersName = interviewers.stream() .filter( @@ -202,7 +203,7 @@ public List findByApplicantId(String applicantId) { .findFirst() .map(Interviewer::getName) .orElse(""); - return CommentPairVo.of(comment, isLiked, interviewersName); + return CommentPairVo.of(comment, isLiked, interviewersName, canEdit); }) .collect(Collectors.toList()); } diff --git a/server/Recruit-Api/src/main/java/com/econovation/recruit/api/user/service/UserService.java b/server/Recruit-Api/src/main/java/com/econovation/recruit/api/user/service/UserService.java index 2e1e0471..b9704237 100644 --- a/server/Recruit-Api/src/main/java/com/econovation/recruit/api/user/service/UserService.java +++ b/server/Recruit-Api/src/main/java/com/econovation/recruit/api/user/service/UserService.java @@ -38,7 +38,7 @@ public TokenResponse execute(LoginRequestDto loginRequestDto) { public TokenResponse refresh(String refreshToken) { Long idpId = jwtTokenProvider.parseRefreshToken(refreshToken); Interviewer account = interviewerLoadPort.loadInterviewById(idpId); - return jwtTokenProvider.createToken(account.getId(), account.getRole().name()); + return jwtTokenProvider. createToken(account.getId(), account.getRole().name()); } private void checkPassword(String password, String encodePassword) { @@ -69,4 +69,4 @@ public void changePassword(String password) { String encededPassword = passwordEncoder.encode(password); interviewerLoadPort.loadInterviewById(userId).changePassword(encededPassword); } -} +} \ No newline at end of file diff --git a/server/Recruit-Domain/src/main/java/com/econovation/recruitdomain/domains/comment/domain/Comment.java b/server/Recruit-Domain/src/main/java/com/econovation/recruitdomain/domains/comment/domain/Comment.java index a5cc9ed3..40fdfa37 100644 --- a/server/Recruit-Domain/src/main/java/com/econovation/recruitdomain/domains/comment/domain/Comment.java +++ b/server/Recruit-Domain/src/main/java/com/econovation/recruitdomain/domains/comment/domain/Comment.java @@ -43,6 +43,9 @@ public class Comment extends BaseTimeEntity { @Column(name = "idp_id") private Long idpId; + @Column(name = "interviewer_id") + private String interviewerId; + public void delete() { this.isDeleted = true; } diff --git a/server/Recruit-Domain/src/main/java/com/econovation/recruitdomain/domains/dto/CommentPairVo.java b/server/Recruit-Domain/src/main/java/com/econovation/recruitdomain/domains/dto/CommentPairVo.java index 1cb2a744..046bf8f4 100644 --- a/server/Recruit-Domain/src/main/java/com/econovation/recruitdomain/domains/dto/CommentPairVo.java +++ b/server/Recruit-Domain/src/main/java/com/econovation/recruitdomain/domains/dto/CommentPairVo.java @@ -8,14 +8,16 @@ @Getter @Builder public class CommentPairVo { + // commentId private Long id; private LocalDateTime createdAt; private String interviewerName; private String content; private Boolean isLike; private Integer likeCount; + private Boolean canEdit; - public static CommentPairVo of(Comment comment, Boolean isLike, String interviewerName) { + public static CommentPairVo of(Comment comment, Boolean isLike, String interviewerName, Boolean canEdit) { return CommentPairVo.builder() .id(comment.getId()) .createdAt(comment.getCreatedAt())