diff --git a/src/main/java/me/snaptime/alarm/controller/AlarmController.java b/src/main/java/me/snaptime/alarm/controller/AlarmController.java index aba308af..61585793 100644 --- a/src/main/java/me/snaptime/alarm/controller/AlarmController.java +++ b/src/main/java/me/snaptime/alarm/controller/AlarmController.java @@ -7,6 +7,7 @@ import jakarta.validation.constraints.NotNull; import lombok.RequiredArgsConstructor; import me.snaptime.alarm.common.AlarmType; +import me.snaptime.alarm.dto.res.FindAlarmsDto; import me.snaptime.alarm.service.AlarmService; import me.snaptime.common.CommonResponseDto; import me.snaptime.reply.dto.res.FindParentReplyResDto; @@ -69,6 +70,30 @@ public ResponseEntity> readReplyAlarm( alarmService.readSnapAlarm(userDetails.getUsername(), replyAlarmId))); } + @GetMapping("/count/not-read") + @Operation(summary = "미확인알림개수 조회", description = "확인되지 않은 알림개수를 조회합니다.") + public ResponseEntity> findNotReadAlarmCnt( + @AuthenticationPrincipal UserDetails userDetails) { + + return ResponseEntity.status(HttpStatus.OK) + .body(new CommonResponseDto("미확인 알림개수 조회성공", + alarmService.findNotReadAlarmCnt(userDetails.getUsername()))); + } + + @GetMapping + @Operation(summary = "알림리스트 조회", description = "자신에게 온 알림리스트를 조회합니다.
"+ + "읽지않은 알림을 먼저 보여주며 시간순으로 정렬하여 반환합니다.
"+ + "알림타입별로 반환되는 데이터가 다릅니다. 팔로우알림에는 snapUrl정보가 없으며 "+ + "댓글알림에만 댓글내용을 보여주는 previewText값이 있습니다.
"+ + "각 알림타입별로 alarmId값이 부여되기 때문에 타입이 다른 알림의 경우 id값이 중복될 수 있습니다.") + public ResponseEntity> findalarms( + @AuthenticationPrincipal UserDetails userDetails) { + + return ResponseEntity.status(HttpStatus.OK) + .body(new CommonResponseDto("알림리스트 조회성공", + alarmService.findAlarms(userDetails.getUsername()))); + } + @DeleteMapping ("/{alarmId}") @Operation(summary = "알림을 삭제합니다.", description = "읽음 여부와 상관없이 알림을 삭제합니다.
" + diff --git a/src/main/java/me/snaptime/alarm/domain/ReplyAlarm.java b/src/main/java/me/snaptime/alarm/domain/ReplyAlarm.java index 8a1dc23b..3f8bc584 100644 --- a/src/main/java/me/snaptime/alarm/domain/ReplyAlarm.java +++ b/src/main/java/me/snaptime/alarm/domain/ReplyAlarm.java @@ -40,7 +40,8 @@ public class ReplyAlarm extends BaseTimeEntity { @Enumerated(EnumType.STRING) @Column(nullable = false, name = "alarm_type") private AlarmType alarmType; - + + // 댓글이 변경되더라도 기존 댓글내용을 유지하기 위해 Reply와 연관관계를 맺지않음 @Column(nullable = false, name = "reply_message") private String replyMessage; @@ -48,10 +49,12 @@ public class ReplyAlarm extends BaseTimeEntity { private boolean isRead = false; @Builder - protected ReplyAlarm(User sender, User receiver, Snap snap, String messgae, AlarmType alarmType){ + protected ReplyAlarm(User sender, User receiver, Snap snap, String replyMessage, AlarmType alarmType){ this.sender=sender; this.receiver=receiver; this.alarmType=alarmType; + this.snap=snap; + this.replyMessage=replyMessage; } public void readAlarm(){ diff --git a/src/main/java/me/snaptime/alarm/dto/res/AlarmInfo.java b/src/main/java/me/snaptime/alarm/dto/res/AlarmInfo.java new file mode 100644 index 00000000..1f241e43 --- /dev/null +++ b/src/main/java/me/snaptime/alarm/dto/res/AlarmInfo.java @@ -0,0 +1,68 @@ +package me.snaptime.alarm.dto.res; + +import lombok.Builder; +import lombok.Getter; +import me.snaptime.alarm.common.AlarmType; +import me.snaptime.alarm.domain.FollowAlarm; +import me.snaptime.alarm.domain.ReplyAlarm; +import me.snaptime.alarm.domain.SnapAlarm; + +import java.time.LocalDateTime; + +@Builder +public record AlarmInfo( + Long alarmId, + String snapPhotoURL, + String senderName, + String senderProfilePhotoURL, + String timeAgo, + String previewText, + AlarmType alarmType, + @Getter + LocalDateTime createdDate + +) { + public static AlarmInfo toDtoByFollowAlarm(String senderProfilePhotoURL, String timeAgo, FollowAlarm followAlarm){ + + return AlarmInfo.builder() + .alarmId(followAlarm.getFollowAlarmId()) + .snapPhotoURL(null) + .senderName(followAlarm.getSender().getName()) + .senderProfilePhotoURL(senderProfilePhotoURL) + .timeAgo(timeAgo) + .previewText(null) + .alarmType(followAlarm.getAlarmType()) + .createdDate(followAlarm.getCreatedDate()) + .build(); + } + + public static AlarmInfo toDtoBySnapAlarm(String senderProfilePhotoURL, String snapPhotoURL, + String timeAgo, SnapAlarm snapAlarm){ + + return AlarmInfo.builder() + .alarmId(snapAlarm.getSnapAlarmId()) + .snapPhotoURL(snapPhotoURL) + .senderName(snapAlarm.getSender().getName()) + .senderProfilePhotoURL(senderProfilePhotoURL) + .timeAgo(timeAgo) + .previewText(null) + .alarmType(snapAlarm.getAlarmType()) + .createdDate(snapAlarm.getCreatedDate()) + .build(); + } + + public static AlarmInfo toDtoByReplyAlarm(String senderProfilePhotoURL, String snapPhotoURL, + String timeAgo, ReplyAlarm replyAlarm){ + + return AlarmInfo.builder() + .alarmId(replyAlarm.getReplyAlarmId()) + .snapPhotoURL(snapPhotoURL) + .senderName(replyAlarm.getSender().getName()) + .senderProfilePhotoURL(senderProfilePhotoURL) + .timeAgo(timeAgo) + .previewText(replyAlarm.getReplyMessage()) + .alarmType(replyAlarm.getAlarmType()) + .createdDate(replyAlarm.getCreatedDate()) + .build(); + } +} diff --git a/src/main/java/me/snaptime/alarm/dto/res/FindAlarmsDto.java b/src/main/java/me/snaptime/alarm/dto/res/FindAlarmsDto.java new file mode 100644 index 00000000..2f8ff8f6 --- /dev/null +++ b/src/main/java/me/snaptime/alarm/dto/res/FindAlarmsDto.java @@ -0,0 +1,22 @@ +package me.snaptime.alarm.dto.res; + +import lombok.Builder; + +import java.util.List; + +@Builder +public record FindAlarmsDto( + + List notReadAlarmInfos, + List readAlarmInfos + +) { + public static FindAlarmsDto toDto(List notReadAlarmInfos, List readAlarmInfos){ + + return FindAlarmsDto.builder() + .notReadAlarmInfos(notReadAlarmInfos) + .readAlarmInfos(readAlarmInfos) + .build(); + } + +} diff --git a/src/main/java/me/snaptime/alarm/repository/FollowAlarmRepository.java b/src/main/java/me/snaptime/alarm/repository/FollowAlarmRepository.java index d3f4effa..6262dcc5 100644 --- a/src/main/java/me/snaptime/alarm/repository/FollowAlarmRepository.java +++ b/src/main/java/me/snaptime/alarm/repository/FollowAlarmRepository.java @@ -1,7 +1,14 @@ package me.snaptime.alarm.repository; import me.snaptime.alarm.domain.FollowAlarm; +import me.snaptime.user.domain.User; import org.springframework.data.jpa.repository.JpaRepository; +import java.util.List; + public interface FollowAlarmRepository extends JpaRepository { + + List findByReceiverAndIsRead(User user, boolean isRead); + + Long countByReceiverAndIsRead(User user, boolean isRead); } diff --git a/src/main/java/me/snaptime/alarm/repository/ReplyAlarmRepository.java b/src/main/java/me/snaptime/alarm/repository/ReplyAlarmRepository.java index e02ef161..91447bd5 100644 --- a/src/main/java/me/snaptime/alarm/repository/ReplyAlarmRepository.java +++ b/src/main/java/me/snaptime/alarm/repository/ReplyAlarmRepository.java @@ -1,7 +1,14 @@ package me.snaptime.alarm.repository; import me.snaptime.alarm.domain.ReplyAlarm; +import me.snaptime.user.domain.User; import org.springframework.data.jpa.repository.JpaRepository; +import java.util.List; + public interface ReplyAlarmRepository extends JpaRepository { + + List findByReceiverAndIsRead(User user, boolean isRead); + + Long countByReceiverAndIsRead(User user, boolean isRead); } diff --git a/src/main/java/me/snaptime/alarm/repository/SnapAlarmRepository.java b/src/main/java/me/snaptime/alarm/repository/SnapAlarmRepository.java index 4516d5a9..1bc80dd1 100644 --- a/src/main/java/me/snaptime/alarm/repository/SnapAlarmRepository.java +++ b/src/main/java/me/snaptime/alarm/repository/SnapAlarmRepository.java @@ -1,8 +1,14 @@ package me.snaptime.alarm.repository; import me.snaptime.alarm.domain.SnapAlarm; +import me.snaptime.user.domain.User; import org.springframework.data.jpa.repository.JpaRepository; +import java.util.List; + public interface SnapAlarmRepository extends JpaRepository { + List findByReceiverAndIsRead(User user, boolean isRead); + + Long countByReceiverAndIsRead(User user, boolean isRead); } diff --git a/src/main/java/me/snaptime/alarm/service/AlarmService.java b/src/main/java/me/snaptime/alarm/service/AlarmService.java index 3aced53e..45c49f78 100644 --- a/src/main/java/me/snaptime/alarm/service/AlarmService.java +++ b/src/main/java/me/snaptime/alarm/service/AlarmService.java @@ -22,10 +22,10 @@ public interface AlarmService { FindParentReplyResDto readReplyAlarm(String reqLoginId, Long replyAlarmId); //유저의 모든 알림을 불러옵니다. - Object findAlarms(Long reqLoginId); + Object findAlarms(String reqLoginId); // 읽지않은 알림이 몇개인지 조회합니다. - Long findNotReadAlarmCnt(Long reqLoginId); + Long findNotReadAlarmCnt(String reqLoginId); /* 알림을 삭제합니다. diff --git a/src/main/java/me/snaptime/alarm/service/CreateAlarmService.java b/src/main/java/me/snaptime/alarm/service/CreateAlarmService.java index fc807f1a..ea0cbec6 100644 --- a/src/main/java/me/snaptime/alarm/service/CreateAlarmService.java +++ b/src/main/java/me/snaptime/alarm/service/CreateAlarmService.java @@ -29,5 +29,5 @@ public interface CreateAlarmService { receiver : 알림을 받는 유저 alarmType : 알림타입 */ - void createReplyAlarm(User sender, User receiver, Snap snap, String message); + void createReplyAlarm(User sender, User receiver, Snap snap, String replyMessage); } diff --git a/src/main/java/me/snaptime/alarm/service/impl/AlarmServiceImpl.java b/src/main/java/me/snaptime/alarm/service/impl/AlarmServiceImpl.java index 079891fb..66fb6fe6 100644 --- a/src/main/java/me/snaptime/alarm/service/impl/AlarmServiceImpl.java +++ b/src/main/java/me/snaptime/alarm/service/impl/AlarmServiceImpl.java @@ -5,6 +5,8 @@ import me.snaptime.alarm.domain.FollowAlarm; import me.snaptime.alarm.domain.ReplyAlarm; import me.snaptime.alarm.domain.SnapAlarm; +import me.snaptime.alarm.dto.res.AlarmInfo; +import me.snaptime.alarm.dto.res.FindAlarmsDto; import me.snaptime.alarm.repository.FollowAlarmRepository; import me.snaptime.alarm.repository.ReplyAlarmRepository; import me.snaptime.alarm.repository.SnapAlarmRepository; @@ -17,9 +19,16 @@ import me.snaptime.reply.service.ReplyService; import me.snaptime.snap.dto.res.FindSnapResDto; import me.snaptime.snap.service.SnapService; +import me.snaptime.user.domain.User; +import me.snaptime.user.repository.UserRepository; +import me.snaptime.util.TimeAgoCalculator; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; + @Service @RequiredArgsConstructor @Transactional(readOnly = true) @@ -28,6 +37,7 @@ public class AlarmServiceImpl implements AlarmService { private final SnapAlarmRepository snapAlarmRepository; private final FollowAlarmRepository followAlarmRepository; private final ReplyAlarmRepository replyAlarmRepository; + private final UserRepository userRepository; private final FriendService friendService; private final SnapService snapService; private final ReplyService replyService; @@ -81,13 +91,21 @@ public FindParentReplyResDto readReplyAlarm(String reqLoginId, Long replyAlarmId } @Override - public Object findAlarms(Long reqLoginId) { - return null; + public FindAlarmsDto findAlarms(String reqLoginId) { + User reqUser = userRepository.findByLoginId(reqLoginId) + .orElseThrow(() -> new CustomException(ExceptionCode.USER_NOT_EXIST)); + + return FindAlarmsDto.toDto(findSortedAlarms(reqUser,false), findSortedAlarms(reqUser,true)); } @Override - public Long findNotReadAlarmCnt(Long reqLoginId) { - return null; + public Long findNotReadAlarmCnt(String reqLoginId) { + User reqUser = userRepository.findByLoginId(reqLoginId) + .orElseThrow(() -> new CustomException(ExceptionCode.USER_NOT_EXIST)); + + return followAlarmRepository.countByReceiverAndIsRead(reqUser,false)+ + snapAlarmRepository.countByReceiverAndIsRead(reqUser, false)+ + replyAlarmRepository.countByReceiverAndIsRead(reqUser, false); } @Override @@ -127,4 +145,50 @@ private void isMyAlarm(String reqLoginId, String alarmReceiverLoginId){ throw new CustomException(ExceptionCode.ACCESS_FAIL_ALARM); } + + // 알림을 최신순으로 정렬하여 조회합니다. + private List findSortedAlarms(User reqUser, boolean isRead){ + + List alarmInfos = new ArrayList<>(); + + List followAlarms = followAlarmRepository.findByReceiverAndIsRead(reqUser,isRead); + List replyAlarms = replyAlarmRepository.findByReceiverAndIsRead(reqUser,isRead); + List snapAlarms = snapAlarmRepository.findByReceiverAndIsRead(reqUser,isRead); + + followAlarms.forEach(followAlarm -> { + + User sender = followAlarm.getSender(); + String profilePhotoURL = urlComponent.makeProfileURL(sender.getProfilePhoto().getProfilePhotoId()); + String timeAgo = TimeAgoCalculator.findTimeAgo(followAlarm.getCreatedDate()); + + AlarmInfo alarmInfo = AlarmInfo.toDtoByFollowAlarm(profilePhotoURL, timeAgo, followAlarm); + alarmInfos.add(alarmInfo); + }); + + replyAlarms.forEach(replyAlarm -> { + + User sender = replyAlarm.getSender(); + String profilePhotoURL = urlComponent.makeProfileURL(sender.getProfilePhoto().getProfilePhotoId()); + String snapPhotoURL = urlComponent.makePhotoURL(replyAlarm.getSnap().getFileName(),false); + String timeAgo = TimeAgoCalculator.findTimeAgo(replyAlarm.getCreatedDate()); + + AlarmInfo alarmInfo = AlarmInfo.toDtoByReplyAlarm(profilePhotoURL, snapPhotoURL, timeAgo, replyAlarm); + alarmInfos.add(alarmInfo); + }); + + snapAlarms.forEach(snapAlarm -> { + + User sender = snapAlarm.getSender(); + String profilePhotoURL = urlComponent.makeProfileURL(sender.getProfilePhoto().getProfilePhotoId()); + String snapPhotoURL = urlComponent.makePhotoURL(snapAlarm.getSnap().getFileName(),false); + String timeAgo = TimeAgoCalculator.findTimeAgo(snapAlarm.getCreatedDate()); + + AlarmInfo alarmInfo = AlarmInfo.toDtoBySnapAlarm(profilePhotoURL, snapPhotoURL, timeAgo, snapAlarm); + alarmInfos.add(alarmInfo); + }); + + alarmInfos.sort(Comparator.comparing(AlarmInfo::getCreatedDate).reversed()); + return alarmInfos; + } + } diff --git a/src/main/java/me/snaptime/alarm/service/impl/CreateAlarmServiceImpl.java b/src/main/java/me/snaptime/alarm/service/impl/CreateAlarmServiceImpl.java index e6ae571b..b71ceb48 100644 --- a/src/main/java/me/snaptime/alarm/service/impl/CreateAlarmServiceImpl.java +++ b/src/main/java/me/snaptime/alarm/service/impl/CreateAlarmServiceImpl.java @@ -49,12 +49,12 @@ public void createFollowAlarm(User sender, User receiver) { @Override @Transactional - public void createReplyAlarm(User sender, User receiver, Snap snap, String message) { + public void createReplyAlarm(User sender, User receiver, Snap snap, String replyMessage) { ReplyAlarm replyAlarm = ReplyAlarm.builder() .sender(sender) .receiver(receiver) .snap(snap) - .messgae(message) + .replyMessage(replyMessage) .alarmType(AlarmType.REPLY) .build(); diff --git a/src/main/java/me/snaptime/common/BaseTimeEntity.java b/src/main/java/me/snaptime/common/BaseTimeEntity.java index 3c8fb069..06b7299f 100644 --- a/src/main/java/me/snaptime/common/BaseTimeEntity.java +++ b/src/main/java/me/snaptime/common/BaseTimeEntity.java @@ -13,6 +13,7 @@ @EntityListeners(value = {AuditingEntityListener.class}) @MappedSuperclass public abstract class BaseTimeEntity { + @CreatedDate private LocalDateTime createdDate; diff --git a/src/main/java/me/snaptime/redis/RedisConfig.java b/src/main/java/me/snaptime/config/RedisConfig.java similarity index 98% rename from src/main/java/me/snaptime/redis/RedisConfig.java rename to src/main/java/me/snaptime/config/RedisConfig.java index b8c023fb..7eb6ce94 100644 --- a/src/main/java/me/snaptime/redis/RedisConfig.java +++ b/src/main/java/me/snaptime/config/RedisConfig.java @@ -1,4 +1,4 @@ -package me.snaptime.redis; +package me.snaptime.config; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; diff --git a/src/main/java/me/snaptime/redis/RefreshToken.java b/src/main/java/me/snaptime/jwt/redis/RefreshToken.java similarity index 93% rename from src/main/java/me/snaptime/redis/RefreshToken.java rename to src/main/java/me/snaptime/jwt/redis/RefreshToken.java index 9b1ada8b..8a3c5881 100644 --- a/src/main/java/me/snaptime/redis/RefreshToken.java +++ b/src/main/java/me/snaptime/jwt/redis/RefreshToken.java @@ -1,4 +1,4 @@ -package me.snaptime.redis; +package me.snaptime.jwt.redis; import jakarta.persistence.Id; import lombok.Getter; diff --git a/src/main/java/me/snaptime/redis/RefreshTokenRepository.java b/src/main/java/me/snaptime/jwt/redis/RefreshTokenRepository.java similarity index 87% rename from src/main/java/me/snaptime/redis/RefreshTokenRepository.java rename to src/main/java/me/snaptime/jwt/redis/RefreshTokenRepository.java index c739e38e..2a3ac06e 100644 --- a/src/main/java/me/snaptime/redis/RefreshTokenRepository.java +++ b/src/main/java/me/snaptime/jwt/redis/RefreshTokenRepository.java @@ -1,4 +1,4 @@ -package me.snaptime.redis; +package me.snaptime.jwt.redis; import org.springframework.data.repository.CrudRepository; diff --git a/src/main/java/me/snaptime/reply/dto/req/AddChildReplyReqDto.java b/src/main/java/me/snaptime/reply/dto/req/AddChildReplyReqDto.java index bfb9844f..0d40bf36 100644 --- a/src/main/java/me/snaptime/reply/dto/req/AddChildReplyReqDto.java +++ b/src/main/java/me/snaptime/reply/dto/req/AddChildReplyReqDto.java @@ -10,7 +10,7 @@ public record AddChildReplyReqDto( description = "대댓글로 등록할 내용을 입력해주세요" ) @NotBlank(message = "내용을 입력해주세요") - String content, + String replyMessage, @Schema( example = "1", diff --git a/src/main/java/me/snaptime/reply/dto/req/AddParentReplyReqDto.java b/src/main/java/me/snaptime/reply/dto/req/AddParentReplyReqDto.java index 1d00cda6..9f34f9e6 100644 --- a/src/main/java/me/snaptime/reply/dto/req/AddParentReplyReqDto.java +++ b/src/main/java/me/snaptime/reply/dto/req/AddParentReplyReqDto.java @@ -10,7 +10,7 @@ public record AddParentReplyReqDto( description = "댓글로 등록할 내용을 입력해주세요" ) @NotBlank(message = "내용을 입력해주세요") - String content, + String replyMessage, @Schema( example = "1", diff --git a/src/main/java/me/snaptime/reply/service/impl/ReplyServiceImpl.java b/src/main/java/me/snaptime/reply/service/impl/ReplyServiceImpl.java index 467035f3..511c9a7a 100644 --- a/src/main/java/me/snaptime/reply/service/impl/ReplyServiceImpl.java +++ b/src/main/java/me/snaptime/reply/service/impl/ReplyServiceImpl.java @@ -58,11 +58,11 @@ public void addParentReply(String reqLoginId, AddParentReplyReqDto addParentRepl ParentReply.builder() .user(reqUser) .snap(snap) - .content(addParentReplyReqDto.content()) + .content(addParentReplyReqDto.replyMessage()) .build() ); - createAlarmService.createReplyAlarm(reqUser, snap.getUser(), snap, addParentReplyReqDto.content()); + createAlarmService.createReplyAlarm(reqUser, snap.getUser(), snap, addParentReplyReqDto.replyMessage()); } @Transactional @@ -78,7 +78,7 @@ public void addChildReply(String reqLoginId, AddChildReplyReqDto addChildReplyRe ChildReply.builder() .parentReply(parentReply) .user(reqUser) - .content(addChildReplyReqDto.content()) + .content(addChildReplyReqDto.replyMessage()) .build() ); } @@ -92,7 +92,7 @@ public void addChildReply(String reqLoginId, AddChildReplyReqDto addChildReplyRe .parentReply(parentReply) .user(reqUser) .tagUser(tagUser) - .content(addChildReplyReqDto.content()) + .content(addChildReplyReqDto.replyMessage()) .build() ); } diff --git a/src/main/java/me/snaptime/user/service/impl/SignServiceImpl.java b/src/main/java/me/snaptime/user/service/impl/SignServiceImpl.java index 7e7f4b5b..a36b1545 100644 --- a/src/main/java/me/snaptime/user/service/impl/SignServiceImpl.java +++ b/src/main/java/me/snaptime/user/service/impl/SignServiceImpl.java @@ -6,10 +6,10 @@ import me.snaptime.exception.CustomException; import me.snaptime.exception.ExceptionCode; import me.snaptime.jwt.JwtProvider; +import me.snaptime.jwt.redis.RefreshToken; +import me.snaptime.jwt.redis.RefreshTokenRepository; import me.snaptime.profilePhoto.domain.ProfilePhoto; import me.snaptime.profilePhoto.repository.ProfilePhotoRepository; -import me.snaptime.redis.RefreshToken; -import me.snaptime.redis.RefreshTokenRepository; import me.snaptime.user.domain.User; import me.snaptime.user.dto.req.SignInReqDto; import me.snaptime.user.dto.req.UserReqDto; diff --git a/src/test/java/me/snaptime/social/controller/ReplyControllerTest.java b/src/test/java/me/snaptime/social/controller/ReplyControllerTest.java index 28cad735..7d8253e9 100644 --- a/src/test/java/me/snaptime/social/controller/ReplyControllerTest.java +++ b/src/test/java/me/snaptime/social/controller/ReplyControllerTest.java @@ -82,7 +82,7 @@ public void addParentReplyTest2() throws Exception { .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isBadRequest()) .andExpect(jsonPath("$.msg").value("올바르지 않은 입력값입니다")) - .andExpect(jsonPath("$.result.content").value("내용을 입력해주세요")) + .andExpect(jsonPath("$.result.replyMessage").value("내용을 입력해주세요")) .andDo(print()); verify(replyService,times(0)) @@ -176,7 +176,7 @@ public void addChildReplyTest2() throws Exception { .andExpect(status().isBadRequest()) .andExpect(jsonPath("$.msg").value("올바르지 않은 입력값입니다")) .andExpect(jsonPath("$.result.parentReplyId").value("parentReplyId를 입력해주세요.")) - .andExpect(jsonPath("$.result.content").value("내용을 입력해주세요")) + .andExpect(jsonPath("$.result.replyMessage").value("내용을 입력해주세요")) .andDo(print()); verify(replyService,times(0)) diff --git a/src/test/java/me/snaptime/user/service/UserServiceTest.java b/src/test/java/me/snaptime/user/service/UserServiceTest.java index f9a7cef6..7d79458b 100644 --- a/src/test/java/me/snaptime/user/service/UserServiceTest.java +++ b/src/test/java/me/snaptime/user/service/UserServiceTest.java @@ -1,10 +1,10 @@ package me.snaptime.user.service; import me.snaptime.jwt.JwtProvider; +import me.snaptime.jwt.redis.RefreshToken; +import me.snaptime.jwt.redis.RefreshTokenRepository; import me.snaptime.profilePhoto.domain.ProfilePhoto; import me.snaptime.profilePhoto.repository.ProfilePhotoRepository; -import me.snaptime.redis.RefreshToken; -import me.snaptime.redis.RefreshTokenRepository; import me.snaptime.user.domain.User; import me.snaptime.user.dto.req.SignInReqDto; import me.snaptime.user.dto.req.UserReqDto;