Skip to content

Commit

Permalink
[#25] fix: return notice title
Browse files Browse the repository at this point in the history
  • Loading branch information
raae7742 committed Jun 3, 2022
1 parent a173a0e commit 6d5245c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public NoticeOCRDto executeOCR (@RequestPart MultipartFile uploadfile, HttpServl
List<NoticeSentenceDto> fullText = noticeService.extractSentenceFromEventRequestDto(trans_full, eventWords);
List<NoticeEventListDto> events = noticeService.extractEventList(fullText);
Integer event_num = events.size();
return new NoticeOCRDto(korean, trans_full, fullText, event_num, events);
return new NoticeOCRDto(title, korean, trans_full, fullText, event_num, events);
}

@RequestMapping(value = "/notice/save", method = RequestMethod.POST)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
package com.answer.notinote.Notice.dto;


import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.List;

@Getter
@NoArgsConstructor
@AllArgsConstructor
public class NoticeOCRDto {
private String title;
private String korean;
private String trans_full;
private List<NoticeSentenceDto> fullText;
private Integer event_num;
private List<NoticeEventListDto> events;

public NoticeOCRDto(String korean, String trans_full, List<NoticeSentenceDto> fullText, Integer event_num, List<NoticeEventListDto> events){
this.korean = korean;
this.trans_full = trans_full;
this.fullText = fullText;
this.event_num = event_num;
this.events = events;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,8 @@ public NoticeTitleListDto saveNotice(MultipartFile uploadfile, NoticeRequestDto
String en_full = englishText(noticeRequestDto.getKorean());

NoticeResponseBody responseBody = detectEvent(notice.getOrigin_full(), notice.getTrans_full(), user.getUlanguage(), en_full);
String title = responseBody.getTitle();

List<EventRequestDto> eventWords = responseBody.getEvents();

List<Event> events = new ArrayList<>();
for (EventRequestDto dto : eventWords) events.add(eventService.create(dto, notice));

Expand Down

0 comments on commit 6d5245c

Please sign in to comment.