Skip to content

Commit

Permalink
fix #115: history editor 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Ojeegu committed Aug 17, 2023
1 parent 050f8ee commit 54816c3
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ public Object save(ProceedingJoinPoint joinPoint, IssuePostRequest request, Long
IssuePostResponse issuePostResponse = (IssuePostResponse)joinPoint.proceed();
Long issueId = issuePostResponse.getId();

historyService.save(HistoryRequest.builder()
HistoryRequest request1 = HistoryRequest.builder()
.issueId(issueId)
.editor(memberRepository.findById(writerId).getNickName())
.issueIsOpen(true)
.build());
.build();

historyService.save(request1);
return issuePostResponse;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,22 @@ public IssueResponse(FilterResultVO resultVO, List<LabelResponse> labels) {
this.writer = WriterResponse.builder()
.id(resultVO.getWriterId())
.name(resultVO.getWriter())
.imageUrl(resultVO.getWriterImageUrl())
.build();
this.assignees = AssigneeResponse.convertToAssigneeResponseList(resultVO.getAssigneeIds(),
resultVO.getAssigneeNames());
this.milestone = MilestoneResponse.builder()
.id(resultVO.getMilestoneId())
.title(resultVO.getMilestoneTitle())
.build();
setMilestone(resultVO.getMilestoneId(), resultVO.getMilestoneTitle());
}

private void setMilestone(Long id, String title) {
if (title == null) {
this.milestone = null;
} else {
this.milestone = MilestoneResponse.builder()
.id(id)
.title(title)
.build();
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ public class FilterResultVO {
private String labelIds;
private Long writerId;
private String writer;
private String writerImageUrl;
private String assigneeIds;
private String assigneeNames;
private Long milestoneId;
private String milestoneTitle;

@Builder
public FilterResultVO(Long id, Boolean isOpen, String title, String editor, LocalDateTime modifiedAt,
String labelIds, Long writerId,
String writer, String assigneeIds, String assigneeNames, Long milestoneId, String milestoneTitle) {
String labelIds,
Long writerId, String writer, String writerImageUrl, String assigneeIds, String assigneeNames, Long milestoneId,
String milestoneTitle) {
this.id = id;
this.isOpen = isOpen;
this.title = title;
Expand All @@ -34,6 +36,7 @@ public FilterResultVO(Long id, Boolean isOpen, String title, String editor, Loca
this.labelIds = labelIds;
this.writerId = writerId;
this.writer = writer;
this.writerImageUrl = writerImageUrl;
this.assigneeIds = assigneeIds;
this.assigneeNames = assigneeNames;
this.milestoneId = milestoneId;
Expand Down
4 changes: 2 additions & 2 deletions be/src/main/resources/mybatis/FilterMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
i.id, i.is_open, i.title,
m3.nick_name AS editor, latest_editor.modified_at,
GROUP_CONCAT(DISTINCT l.id ORDER BY l.id SEPARATOR ',') AS label_ids,
m.id AS writerId, m.nick_name AS writer,
m.id AS writerId, m.nick_name AS writer, m.image_url AS writer_image_url,
GROUP_CONCAT(DISTINCT m2.id ORDER BY a.id SEPARATOR ',') AS assignee_ids,
GROUP_CONCAT(DISTINCT m2.nick_name ORDER BY a.id SEPARATOR ',') AS assignee_names,
ms.id AS milestone_id, ms.title AS milestone_title
Expand Down Expand Up @@ -34,7 +34,7 @@
LEFT JOIN
member m2 ON a.member_id = m2.id
LEFT JOIN
member m3 ON latest_editor.editor = m3.id
member m3 ON latest_editor.editor = m3.nick_name
LEFT JOIN
milestone ms ON i.milestone_id = ms.id
<choose>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class FilterControllerTest extends ControllerTestSupport {

@DisplayName("필터가 없으면 열린 이슈를 담은 메인 페이지를 반환한다.")
@Test
void mainpageWithNoFilter() throws Exception {
void mainPageWithNoFilter() throws Exception {

// given

Expand All @@ -36,6 +36,7 @@ void mainpageWithNoFilter() throws Exception {
.labelIds("1,2")
.writerId(1L)
.writer("June")
.writerImageUrl("https://issue-tracker-bucket-04.s3.ap-northeast-2.amazonaws.com/profile/green.jpg")
.assigneeIds("1,2")
.assigneeNames("June,Movie")
.milestoneId(1L)
Expand Down

0 comments on commit 54816c3

Please sign in to comment.