Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private void sendCommentPushMessageToFeedOwner(User user, Feed feed) {
NotificationType notificationTypeComment = notificationTypeRepository.findByNotificationTypeName("댓글");

String notificationTitle = createNotificationTitle(feed);
String notificationBody = String.format("%s님이 내 수다글에 댓글을 남겼어요", user.getNickname());
String notificationBody = String.format("%s님이 내 수다글에 댓글을 남겼어요.", user.getNickname());
Long feedId = feed.getFeedId();

Notification notification = Notification.create(
Expand Down Expand Up @@ -99,9 +99,10 @@ private void sendCommentPushMessageToFeedOwner(User user, Feed feed) {
private String createNotificationTitle(Feed feed) {
if (feed.getNovelId() == null) {
String feedContent = feed.getFeedContent();
return feedContent.length() <= 12
feedContent = feedContent.length() <= 12
? feedContent
: "'" + feedContent.substring(0, 12) + "...'";
: feedContent.substring(0, 12);
return "'" + feedContent + "...'";
}
Novel novel = novelService.getNovelOrException(feed.getNovelId());
return novel.getTitle();
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/org/websoso/WSSServer/service/FeedService.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,10 @@ private void sendLikePushMessage(User liker, Feed feed) {
private String createNotificationTitle(Feed feed) {
if (feed.getNovelId() == null) {
String feedContent = feed.getFeedContent();
return feedContent.length() <= 12
feedContent = feedContent.length() <= 12
? feedContent
: "'" + feedContent.substring(0, 12) + "...'";
: feedContent.substring(0, 12);
return "'" + feedContent + "...'";
}
Novel novel = novelService.getNovelOrException(feed.getNovelId());
return novel.getTitle();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ private String createNotificationBody(Feed feed) {
private String generateNotificationBodyFragment(Feed feed) {
if (feed.getNovelId() == null) {
String feedContent = feed.getFeedContent();
return feedContent.length() <= 12
feedContent = feedContent.length() <= 12
? feedContent
: "'" + feedContent.substring(0, 12) + "...'";
: feedContent.substring(0, 12);
return "'" + feedContent + "...'";
}
Novel novel = novelService.getNovelOrException(feed.getNovelId());
return String.format("<%s>", novel.getTitle());
Expand Down
Loading