diff --git a/backend/src/main/java/com/votogether/domain/alarm/controller/AlarmQueryController.java b/backend/src/main/java/com/votogether/domain/alarm/controller/AlarmQueryController.java index 177b1d834..2b5092e25 100644 --- a/backend/src/main/java/com/votogether/domain/alarm/controller/AlarmQueryController.java +++ b/backend/src/main/java/com/votogether/domain/alarm/controller/AlarmQueryController.java @@ -1,7 +1,7 @@ package com.votogether.domain.alarm.controller; -import com.votogether.domain.alarm.dto.ReportActionAlarmResponse; -import com.votogether.domain.alarm.dto.ReportActionResponse; +import com.votogether.domain.alarm.dto.response.ReportActionAlarmResponse; +import com.votogether.domain.alarm.dto.response.ReportActionResponse; import com.votogether.domain.alarm.dto.response.PostAlarmResponse; import com.votogether.domain.alarm.service.AlarmQueryService; import com.votogether.domain.member.entity.Member; diff --git a/backend/src/main/java/com/votogether/domain/alarm/controller/AlarmQueryControllerDocs.java b/backend/src/main/java/com/votogether/domain/alarm/controller/AlarmQueryControllerDocs.java index 8c2a24998..aa3516446 100644 --- a/backend/src/main/java/com/votogether/domain/alarm/controller/AlarmQueryControllerDocs.java +++ b/backend/src/main/java/com/votogether/domain/alarm/controller/AlarmQueryControllerDocs.java @@ -1,7 +1,7 @@ package com.votogether.domain.alarm.controller; -import com.votogether.domain.alarm.dto.ReportActionAlarmResponse; -import com.votogether.domain.alarm.dto.ReportActionResponse; +import com.votogether.domain.alarm.dto.response.ReportActionAlarmResponse; +import com.votogether.domain.alarm.dto.response.ReportActionResponse; import com.votogether.domain.alarm.dto.response.PostAlarmResponse; import com.votogether.domain.member.entity.Member; import com.votogether.global.exception.ExceptionResponse; diff --git a/backend/src/main/java/com/votogether/domain/alarm/dto/ReportActionAlarmResponse.java b/backend/src/main/java/com/votogether/domain/alarm/dto/response/ReportActionAlarmResponse.java similarity index 94% rename from backend/src/main/java/com/votogether/domain/alarm/dto/ReportActionAlarmResponse.java rename to backend/src/main/java/com/votogether/domain/alarm/dto/response/ReportActionAlarmResponse.java index ac82c146f..1e63b6709 100644 --- a/backend/src/main/java/com/votogether/domain/alarm/dto/ReportActionAlarmResponse.java +++ b/backend/src/main/java/com/votogether/domain/alarm/dto/response/ReportActionAlarmResponse.java @@ -1,4 +1,4 @@ -package com.votogether.domain.alarm.dto; +package com.votogether.domain.alarm.dto.response; import com.votogether.domain.alarm.entity.ReportActionAlarm; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/backend/src/main/java/com/votogether/domain/alarm/dto/ReportActionResponse.java b/backend/src/main/java/com/votogether/domain/alarm/dto/response/ReportActionResponse.java similarity index 90% rename from backend/src/main/java/com/votogether/domain/alarm/dto/ReportActionResponse.java rename to backend/src/main/java/com/votogether/domain/alarm/dto/response/ReportActionResponse.java index 9a87f5377..4c63c5540 100644 --- a/backend/src/main/java/com/votogether/domain/alarm/dto/ReportActionResponse.java +++ b/backend/src/main/java/com/votogether/domain/alarm/dto/response/ReportActionResponse.java @@ -1,5 +1,6 @@ -package com.votogether.domain.alarm.dto; +package com.votogether.domain.alarm.dto.response; +import com.fasterxml.jackson.annotation.JsonFormat; import com.votogether.domain.alarm.entity.ReportActionAlarm; import com.votogether.domain.report.entity.vo.ReportType; import io.swagger.v3.oas.annotations.media.Schema; @@ -23,6 +24,7 @@ public record ReportActionResponse( Set reasons, @Schema(description = "신고조치시간", example = "2023-08-01 13:56") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") LocalDateTime createdAt ) { diff --git a/backend/src/main/java/com/votogether/domain/alarm/service/AlarmQueryService.java b/backend/src/main/java/com/votogether/domain/alarm/service/AlarmQueryService.java index edf38c20b..a5c3fdad5 100644 --- a/backend/src/main/java/com/votogether/domain/alarm/service/AlarmQueryService.java +++ b/backend/src/main/java/com/votogether/domain/alarm/service/AlarmQueryService.java @@ -1,7 +1,7 @@ package com.votogether.domain.alarm.service; -import com.votogether.domain.alarm.dto.ReportActionAlarmResponse; -import com.votogether.domain.alarm.dto.ReportActionResponse; +import com.votogether.domain.alarm.dto.response.ReportActionAlarmResponse; +import com.votogether.domain.alarm.dto.response.ReportActionResponse; import com.votogether.domain.alarm.dto.response.PostAlarmResponse; import com.votogether.domain.alarm.entity.Alarm; import com.votogether.domain.alarm.entity.ReportActionAlarm; diff --git a/backend/src/main/java/com/votogether/domain/member/dto/response/MemberInfoResponse.java b/backend/src/main/java/com/votogether/domain/member/dto/response/MemberInfoResponse.java index 5ff5fe81b..c6363b01b 100644 --- a/backend/src/main/java/com/votogether/domain/member/dto/response/MemberInfoResponse.java +++ b/backend/src/main/java/com/votogether/domain/member/dto/response/MemberInfoResponse.java @@ -22,7 +22,7 @@ public record MemberInfoResponse( long voteCount, @Schema(description = "권한", example = "MEMBER") - Roles roles, + Roles role, @Schema(description = "최신 알림 존재 여부", example = "false") boolean hasLatestAlarm diff --git a/backend/src/main/java/com/votogether/domain/post/service/PostCommentService.java b/backend/src/main/java/com/votogether/domain/post/service/PostCommentService.java index dfa715f0d..fe00b5e88 100644 --- a/backend/src/main/java/com/votogether/domain/post/service/PostCommentService.java +++ b/backend/src/main/java/com/votogether/domain/post/service/PostCommentService.java @@ -64,7 +64,7 @@ private void publishAlarmEvent(final Member loginMember, final Post post) { return; } final PostAlarmEvent postAlarmEvent = new PostAlarmEvent( - loginMember, + post.getWriter(), post.getId(), AlarmType.COMMENT, post.getTitle() diff --git a/backend/src/main/java/com/votogether/global/jwt/JwtAuthenticationFilter.java b/backend/src/main/java/com/votogether/global/jwt/JwtAuthenticationFilter.java index 892d5fb09..28667689e 100644 --- a/backend/src/main/java/com/votogether/global/jwt/JwtAuthenticationFilter.java +++ b/backend/src/main/java/com/votogether/global/jwt/JwtAuthenticationFilter.java @@ -38,7 +38,8 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter { private static final Map MATCH_URI_METHOD = new HashMap<>( Map.ofEntries( - Map.entry("^/posts/.+/comments$", "GET") + Map.entry("^/posts/.+/comments$", "GET"), + Map.entry("^/notices/.*$", "GET") ) ); diff --git a/backend/src/test/java/com/votogether/domain/alarm/controller/AlarmQueryControllerTest.java b/backend/src/test/java/com/votogether/domain/alarm/controller/AlarmQueryControllerTest.java index c647b016b..94b14f341 100644 --- a/backend/src/test/java/com/votogether/domain/alarm/controller/AlarmQueryControllerTest.java +++ b/backend/src/test/java/com/votogether/domain/alarm/controller/AlarmQueryControllerTest.java @@ -7,8 +7,8 @@ import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.BDDMockito.given; -import com.votogether.domain.alarm.dto.ReportActionAlarmResponse; -import com.votogether.domain.alarm.dto.ReportActionResponse; +import com.votogether.domain.alarm.dto.response.ReportActionAlarmResponse; +import com.votogether.domain.alarm.dto.response.ReportActionResponse; import com.votogether.domain.alarm.dto.response.PostAlarmDetailResponse; import com.votogether.domain.alarm.dto.response.PostAlarmResponse; import com.votogether.domain.alarm.entity.ReportActionAlarm; diff --git a/backend/src/test/java/com/votogether/domain/alarm/service/AlarmQueryServiceTest.java b/backend/src/test/java/com/votogether/domain/alarm/service/AlarmQueryServiceTest.java index 77794e7c3..a9c92b23f 100644 --- a/backend/src/test/java/com/votogether/domain/alarm/service/AlarmQueryServiceTest.java +++ b/backend/src/test/java/com/votogether/domain/alarm/service/AlarmQueryServiceTest.java @@ -3,8 +3,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.SoftAssertions.assertSoftly; -import com.votogether.domain.alarm.dto.ReportActionAlarmResponse; -import com.votogether.domain.alarm.dto.ReportActionResponse; +import com.votogether.domain.alarm.dto.response.ReportActionAlarmResponse; +import com.votogether.domain.alarm.dto.response.ReportActionResponse; import com.votogether.domain.alarm.dto.response.PostAlarmDetailResponse; import com.votogether.domain.alarm.dto.response.PostAlarmResponse; import com.votogether.domain.alarm.entity.ReportActionAlarm; @@ -61,7 +61,7 @@ void whenCreateComment() throws Exception { Thread.sleep(1000); // when - List postAlarmResponses = alarmQueryService.getPostAlarm(commentWriter, 0); + List postAlarmResponses = alarmQueryService.getPostAlarm(post.getWriter(), 0); // then PostAlarmResponse postAlarmResponse = postAlarmResponses.get(0);