Skip to content

Commit

Permalink
fix: response시 날짜 타입 JSON 변환
Browse files Browse the repository at this point in the history
  • Loading branch information
jjongwon7 committed May 8, 2023
1 parent bfcb26c commit 6f2e1ab
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.bagasari.sacbagaji.model.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
Expand All @@ -12,6 +13,7 @@
@NoArgsConstructor
public class ProductListWithPurchaseDateDTO {

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "Asia/Seoul")
private LocalDate purchaseDate;
private List<ProductDTO> products;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.bagasari.sacbagaji.model.dto.ProductListWithPurchaseDateDTO;
import com.bagasari.sacbagaji.model.entity.AccountBook;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.NoArgsConstructor;

Expand All @@ -13,8 +14,13 @@
public class AccountProductListResponseDTO {

private String name;

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "Asia/Seoul")
private LocalDate startDate;

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "Asia/Seoul")
private LocalDate endDate;

private Integer totalPrice;
private List<ProductListWithPurchaseDateDTO> products;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.bagasari.sacbagaji.model.dto.res;

import com.bagasari.sacbagaji.model.entity.AccountBook;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.NoArgsConstructor;

Expand All @@ -12,8 +13,13 @@ public class AccountResponseDTO {

private Long id;
private String name;

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "Asia/Seoul")
private LocalDate startDate;

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "Asia/Seoul")
private LocalDate endDate;

private String city;

public AccountResponseDTO(AccountBook accountBook) {
Expand Down

0 comments on commit 6f2e1ab

Please sign in to comment.