Skip to content

Commit

Permalink
[#25] fix: change LocalDate jsonformat
Browse files Browse the repository at this point in the history
  • Loading branch information
raae7742 committed Jun 4, 2022
1 parent 4db826e commit 7f20ada
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
3 changes: 1 addition & 2 deletions spring/notinote/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ dependencies {
implementation 'com.google.oauth-client:google-oauth-client-jetty:1.32.1'
implementation 'com.google.apis:google-api-services-calendar:v3-rev20211026-1.32.1'

// jwt
implementation 'io.jsonwebtoken:jjwt-api:0.11.2'

implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'org.springframework.boot:spring-boot-starter-validation'
Expand Down Expand Up @@ -70,6 +68,7 @@ dependencies {

//Json Format
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
}

tasks.named('test') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
import com.answer.notinote.Event.util.BooleanToYNConverter;
import com.answer.notinote.Notice.domain.entity.Notice;
import com.answer.notinote.User.domain.entity.Timestamped;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.time.LocalDate;
Expand Down Expand Up @@ -44,6 +46,7 @@ public class Event extends Timestamped implements Comparable<Event> {
@Column(length = 100)
private String description;

@DateTimeFormat(pattern = "yyyy-MM-dd")
@Column
private LocalDate date;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.answer.notinote.Notice.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
Expand All @@ -11,6 +12,8 @@
@Builder
public class NoticeEventListDto {
String title;

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

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.answer.notinote.Notice.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
Expand All @@ -13,6 +14,8 @@ public class NoticeSentenceDto {
int id;
long eid;
String content;

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "Asia/Seoul")
LocalDate date;
boolean highlight;
boolean registered;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.answer.notinote.Notice.dto;

import com.answer.notinote.Notice.domain.entity.Notice;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;

import java.time.LocalDate;
Expand All @@ -11,6 +12,8 @@
public class NoticeTitleListDto {
private String uploadfile;
private String title;

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "Asia/Seoul")
private LocalDate date;
private List<NoticeSentenceDto> fullText = new ArrayList<>();
private String korean;
Expand Down

0 comments on commit 7f20ada

Please sign in to comment.