Skip to content

Commit e55295d

Browse files
committed
CLAP-375 Fix: 히스토리 조회시 첨부파일 바인딩 변경
1 parent cfbd3fd commit e55295d

4 files changed

Lines changed: 13 additions & 19 deletions

File tree

src/main/java/clap/server/adapter/inbound/web/dto/history/response/FindTaskHistoryResponse.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public static record CommentFileDetails(
3939
Long commentId,
4040
String nickName,
4141
String profileImageUrl,
42-
boolean isModified,
4342
String fileName,
4443
String url,
4544
String size

src/main/java/clap/server/adapter/outbound/persistense/entity/member/MemberEntity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ public class MemberEntity extends BaseTimeEntity {
5454

5555
@Column(name = "kakaowork_notification_enabled")
5656
@Builder.Default
57-
private Boolean kakaoworkNotificationEnabled = Boolean.TRUE;;
57+
private Boolean kakaoworkNotificationEnabled = Boolean.TRUE;
5858

5959
@Column(name = "email_notification_enabled")
6060
@Builder.Default
61-
private Boolean emailNotificationEnabled = Boolean.TRUE;;
61+
private Boolean emailNotificationEnabled = Boolean.TRUE;
6262

6363
@ManyToOne(fetch = FetchType.LAZY)
6464
@JoinColumn(name = "admin_id")

src/main/java/clap/server/application/mapper/response/TaskHistoryResponseMapper.java

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ private TaskHistoryResponseMapper() {
1414
throw new IllegalArgumentException("Utility class");
1515
}
1616

17-
public static FindTaskHistoryResponse toFindTaskHistoryResponse(List<TaskHistory> taskHistories, List<Attachment> attachments) {
17+
public static FindTaskHistoryResponse toFindTaskHistoryResponse(List<TaskHistory> taskHistories) {
1818
List<FindTaskHistoryResponse.TaskHistoryResponse> historyResponses = taskHistories.stream()
1919
.map(taskHistory -> {
2020
FindTaskHistoryResponse.Details details =
@@ -47,19 +47,14 @@ public static FindTaskHistoryResponse toFindTaskHistoryResponse(List<TaskHistory
4747
case COMMENT_FILE -> new FindTaskHistoryResponse.Details(
4848
null,
4949
null,
50-
attachments.stream()
51-
.filter(attachment -> attachment.getComment().getCommentId().equals(taskHistory.getComment().getCommentId()))
52-
.findFirst()
53-
.map(attachment -> new FindTaskHistoryResponse.CommentFileDetails(
54-
taskHistory.getComment().getCommentId(),
55-
taskHistory.getComment().getMember().getNickname(),
56-
taskHistory.getComment().getMember().getImageUrl(),
57-
taskHistory.getComment().isModified(),
58-
attachment.getOriginalName(),
59-
attachment.getFileUrl(),
60-
attachment.getFileSize()
61-
))
62-
.orElse(null)
50+
new FindTaskHistoryResponse.CommentFileDetails(
51+
taskHistory.getComment().getCommentId(),
52+
taskHistory.getComment().getMember().getNickname(),
53+
taskHistory.getComment().getMember().getImageUrl(),
54+
taskHistory.getComment().getOriginalName(),
55+
taskHistory.getComment().getFileUrl(),
56+
taskHistory.getComment().getFileSize()
57+
)
6358
);
6459
};
6560
return new FindTaskHistoryResponse.TaskHistoryResponse(

src/main/java/clap/server/application/service/history/FindTaskHistoriesService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public FindTaskHistoryResponse findTaskHistories(Long memberId, Long taskId) {
3333
memberService.findActiveMember(memberId);
3434
Task task = loadTaskPort.findById(taskId)
3535
.orElseThrow(()-> new DomainException(TaskErrorCode.TASK_NOT_FOUND));
36-
List<Attachment> attachments = loadAttachmentPort.findAllByTaskIdAndCommentIsNotNull(task.getTaskId());
36+
//List<Attachment> attachments = loadAttachmentPort.findAllByTaskIdAndCommentIsNotNull(task.getTaskId());
3737
List<TaskHistory> taskHistories = loadTaskHistoryPort.findAllTaskHistoriesByTaskId(task.getTaskId());
38-
return TaskHistoryResponseMapper.toFindTaskHistoryResponse(taskHistories, attachments);
38+
return TaskHistoryResponseMapper.toFindTaskHistoryResponse(taskHistories);
3939
}
4040
}

0 commit comments

Comments
 (0)