diff --git a/src/main/java/com/telepigeon/server/service/question/QuestionService.java b/src/main/java/com/telepigeon/server/service/question/QuestionService.java index 13f36ec..71f777b 100644 --- a/src/main/java/com/telepigeon/server/service/question/QuestionService.java +++ b/src/main/java/com/telepigeon/server/service/question/QuestionService.java @@ -122,6 +122,9 @@ private boolean checkPenalty(final Question question) { } private String getRandomKeyword(final Profile profile){ + if (Objects.equals(profile.getKeywords(), "-")){ + return "기분"; + } List keywords = Arrays.stream(profile.getKeywords().split(",")).toList(); List alreadyKeywords = questionRetriever.findKeywordsByProfile( profile.getId(), diff --git a/src/main/java/com/telepigeon/server/service/room/RoomService.java b/src/main/java/com/telepigeon/server/service/room/RoomService.java index 621bbf0..49f1877 100644 --- a/src/main/java/com/telepigeon/server/service/room/RoomService.java +++ b/src/main/java/com/telepigeon/server/service/room/RoomService.java @@ -80,12 +80,13 @@ public RoomListDto getAllRooms(final Long userId) { public RoomListDto.RoomDto createRoomDto(final User user, final Room room) { int sentence = 3, emotion = 0; Profile myProfile = profileRetriever.findByUserAndRoom(user, room); + String myRelation = myProfile.getRelation() != null ? myProfile.getRelation().getContent() : "-"; if (!profileRetriever.existsByUserNotAndRoom(user, room)){ return RoomListDto.RoomDto.of( room.getId(), room.getName(), "-", - myProfile.getRelation().getContent(), + myRelation, "-", emotion, sentence @@ -94,7 +95,7 @@ public RoomListDto.RoomDto createRoomDto(final User user, final Room room) { Profile opponentProfile = profileRetriever.findByUserNotAndRoom(user, room); Answer myAnswer = answerRetriever.findFirstByProfile(myProfile); Answer opponentAnswer = answerRetriever.findFirstByProfile(opponentProfile); - + String opponentRelation = opponentProfile.getRelation() != null ? opponentProfile.getRelation().getContent() : "-"; boolean myState = myAnswer.getContent() != null; boolean opponentState = opponentAnswer.getContent() != null; @@ -113,8 +114,8 @@ public RoomListDto.RoomDto createRoomDto(final User user, final Room room) { room.getId(), room.getName(), opponentProfile.getUser().getName(), - myProfile.getRelation().getContent(), - opponentProfile.getRelation().getContent(), + myRelation, + opponentRelation, emotion, sentence );