Skip to content

Commit

Permalink
refactor: createdAt 필드명 수정
Browse files Browse the repository at this point in the history
yumyeonghan committed Nov 27, 2023
1 parent 02da8a9 commit d7789f2
Showing 7 changed files with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ public record Response(
String title,
String content,
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
LocalDateTime createAt
LocalDateTime createdAt
) {

public static InquiryDetailHTTP.Response from(InquiryDetailDto response) {
@@ -27,7 +27,7 @@ public static InquiryDetailHTTP.Response from(InquiryDetailDto response) {
response.inquirerEmail(),
response.title(),
response.content(),
response.createAt()
response.createdAt()
);
}
}
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ public record InquiryDetailDto(
String inquirerEmail,
String title,
String content,
LocalDateTime createAt
LocalDateTime createdAt
) {

public static InquiryDetailDto of(Inquiry inquiry, User user) {
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@

import coffeemeet.server.inquiry.domain.Inquiry;
import coffeemeet.server.user.domain.Profile;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import java.util.List;

public record InquirySearchResponse(
@@ -19,14 +21,17 @@ public static InquirySearchResponse of(List<InquirySummary> inquiries, boolean h
public record InquirySummary(
Long inquiryId,
String inquirer,
String title
String title,
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
LocalDateTime createdAt
) {

public static InquirySearchResponse.InquirySummary of(Inquiry inquiry, Profile profile) {
return new InquirySearchResponse.InquirySummary(
inquiry.getId(),
profile.getNickname(),
inquiry.getTitle()
inquiry.getTitle(),
inquiry.getCreatedAt()
);
}

Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ public record Response(
String reasonDetail,
int reportedCount,
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
LocalDateTime createAt
LocalDateTime createdAt
) {

public static Response from(ReportDetailDto response) {
@@ -30,7 +30,7 @@ public static Response from(ReportDetailDto response) {
response.reason(),
response.reasonDetail(),
response.reportedCount(),
response.createAt()
response.createdAt()
);
}
}
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ public record ReportDetailDto(
ReportReason reason,
String reasonDetail,
int reportedCount,
LocalDateTime createAt
LocalDateTime createdAt
) {

public static ReportDetailDto of(Report report, User reporter, User targeted) {
Original file line number Diff line number Diff line change
@@ -365,7 +365,7 @@ void findReportTest() throws Exception {
fieldWithPath("reason").type(JsonFieldType.STRING).description("신고 사유"),
fieldWithPath("reasonDetail").type(JsonFieldType.STRING).description("신고 상세 사유"),
fieldWithPath("reportedCount").type(JsonFieldType.NUMBER).description("신고 누적 횟수"),
fieldWithPath("createAt").type(JsonFieldType.STRING).description("신고 생성 날짜")
fieldWithPath("createdAt").type(JsonFieldType.STRING).description("신고 생성 날짜")
)
)
)
@@ -412,6 +412,8 @@ void searchInquiriesTest() throws Exception {
.description("문의자 이름"),
fieldWithPath("contents[].title").type(JsonFieldType.STRING)
.description("문의 제목"),
fieldWithPath("contents[].createdAt").type(JsonFieldType.STRING)
.description("문의 생성 날짜"),
fieldWithPath("hasNext").type(JsonFieldType.BOOLEAN)
.description("다음 페이지 여부")
)
@@ -453,7 +455,7 @@ void viewInquiryTest() throws Exception {
fieldWithPath("inquirerEmail").type(JsonFieldType.STRING).description("문의자 이메일"),
fieldWithPath("title").type(JsonFieldType.STRING).description("문의 제목"),
fieldWithPath("content").type(JsonFieldType.STRING).description("문의 내용"),
fieldWithPath("createAt").type(JsonFieldType.STRING).description("문의 생성 날짜")
fieldWithPath("createdAt").type(JsonFieldType.STRING).description("문의 생성 날짜")
)))
.andExpect(status().isOk())
.andExpect(content().string(objectMapper.writeValueAsString(expectedResponse)));
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ public static ReportDetailHTTP.Response reportDetailHTTPResponse(
response.reason(),
response.reasonDetail(),
response.reportedCount(),
response.createAt()
response.createdAt()
);
}

0 comments on commit d7789f2

Please sign in to comment.