From bd42cf0a1d8a4e9c52b77aba629534a516ac6486 Mon Sep 17 00:00:00 2001 From: JunH Date: Thu, 19 Oct 2023 17:37:45 +0900 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20(#799)=20@JsonFormat=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../votogether/domain/notice/dto/response/NoticeResponse.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/src/main/java/com/votogether/domain/notice/dto/response/NoticeResponse.java b/backend/src/main/java/com/votogether/domain/notice/dto/response/NoticeResponse.java index 285eaeb08..124ffd3a8 100644 --- a/backend/src/main/java/com/votogether/domain/notice/dto/response/NoticeResponse.java +++ b/backend/src/main/java/com/votogether/domain/notice/dto/response/NoticeResponse.java @@ -1,5 +1,6 @@ package com.votogether.domain.notice.dto.response; +import com.fasterxml.jackson.annotation.JsonFormat; import com.votogether.domain.notice.entity.Notice; import io.swagger.v3.oas.annotations.media.Schema; import java.time.LocalDateTime; @@ -22,9 +23,11 @@ public record NoticeResponse( String content, @Schema(description = "공지사항 배너 마감기한", example = "2023-12-25 23:59") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") LocalDateTime deadline, @Schema(description = "공지사항 생성시각", example = "2023-12-25 23:59") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") LocalDateTime createdAt ) { From 32dabf9a8a4e4337d6a62bda475af4da76dc2272 Mon Sep 17 00:00:00 2001 From: JunH Date: Thu, 19 Oct 2023 17:49:37 +0900 Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20(#799)=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/NoticeQueryControllerTest.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/backend/src/test/java/com/votogether/domain/notice/controller/NoticeQueryControllerTest.java b/backend/src/test/java/com/votogether/domain/notice/controller/NoticeQueryControllerTest.java index 0e834508b..729340a80 100644 --- a/backend/src/test/java/com/votogether/domain/notice/controller/NoticeQueryControllerTest.java +++ b/backend/src/test/java/com/votogether/domain/notice/controller/NoticeQueryControllerTest.java @@ -13,6 +13,7 @@ import com.votogether.test.ControllerTest; import io.restassured.module.mockmvc.RestAssuredMockMvc; import java.time.LocalDateTime; +import java.time.temporal.ChronoUnit; import java.util.List; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; @@ -52,8 +53,8 @@ void getProgressNotice() throws Exception { "bannerTitle", "bannerSubtitle", "content", - LocalDateTime.now().plusDays(1), - LocalDateTime.now() + LocalDateTime.now().plusDays(1).truncatedTo(ChronoUnit.MINUTES), + LocalDateTime.now().truncatedTo(ChronoUnit.MINUTES) ); given(noticeQueryService.getProgressNotice()).willReturn(expected); @@ -86,8 +87,8 @@ void getNotices() throws Exception { "bannerTitle", "bannerSubtitle", "content", - LocalDateTime.now().plusDays(1), - LocalDateTime.now() + LocalDateTime.now().plusDays(1).truncatedTo(ChronoUnit.MINUTES), + LocalDateTime.now().truncatedTo(ChronoUnit.MINUTES) ); NoticePageResponse expected = new NoticePageResponse(1, 0, List.of(noticeResponse)); given(noticeQueryService.getNotices(anyInt())).willReturn(expected); @@ -153,8 +154,8 @@ void getNotice() throws Exception { "bannerTitle", "bannerSubtitle", "content", - LocalDateTime.now().plusDays(1), - LocalDateTime.now() + LocalDateTime.now().plusDays(1).truncatedTo(ChronoUnit.MINUTES), + LocalDateTime.now().truncatedTo(ChronoUnit.MINUTES) ); given(noticeQueryService.getNotice(anyLong())).willReturn(expected);