From 797fe086231dcd25fb3604e1f6671b05b79f1da0 Mon Sep 17 00:00:00 2001 From: Lee-DoHa Date: Sun, 27 Nov 2022 18:04:45 +0900 Subject: [PATCH] Update MessageService.java --- .../project/csletter/message/service/MessageService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/project/csletter/message/service/MessageService.java b/src/main/java/com/project/csletter/message/service/MessageService.java index 05a8169..51d048d 100644 --- a/src/main/java/com/project/csletter/message/service/MessageService.java +++ b/src/main/java/com/project/csletter/message/service/MessageService.java @@ -136,6 +136,12 @@ public List getMessageFeed(Long cursor, Pageable pageable, f.setIsCorrect(f.getBody().containsAll(markingRepository.findByMessageId(f.getMessageId()).orElseThrow().getBody())); } + if (f.getBody().size() > 1) { + f.setHaveSecondLine(true); + } else { + f.setHaveSecondLine(false); + } + f.setBody(Collections.singletonList(f.getBody().get(0).length() > 20 ? initialList(f.getBody().get(0)).substring(0, 20) : initialList(f.getBody().get(0)))); f.setHaveNextMessage(!messageRepository.mainFeedLess(memberToken, f.getMessageId(), pageable).isEmpty());