Skip to content

Commit

Permalink
Merge pull request #25 from jwpark1211/develop
Browse files Browse the repository at this point in the history
fix timestamp
  • Loading branch information
jwpark1211 authored May 16, 2024
2 parents 5518207 + f8e2a12 commit 2f0b424
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 24 deletions.
7 changes: 0 additions & 7 deletions src/main/java/capstone/bookitty/BookittyApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ public static void main(String[] args) {
SpringApplication.run(BookittyApplication.class, args);
}

//한국 표준 시간 설정
@PostConstruct
public void started() {
// timezone UTC 셋팅
TimeZone.setDefault(TimeZone.getTimeZone("KST"));
}

//CORS 에러 해결
@Bean
public WebMvcConfigurer corsConfigurer(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static class StateInfoResponse{
private String bookTitle;
private String bookAuthor;
private String bookImgUrl;
@DateTimeFormat(pattern = "yyyy-mm-dd'T'HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
private LocalDateTime readAt;

public static StateInfoResponse of(BookState state){
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/capstone/bookitty/domain/dto/CommentDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public static class CommentInfoResponse{
private String isbn;
private String content;
private int like_count;
@DateTimeFormat(pattern = "yyyy-mm-dd'T'HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
private LocalDateTime createdAt;
@DateTimeFormat(pattern = "yyyy-mm-dd'T'HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
private LocalDateTime modifiedAt;

public static CommentInfoResponse of(Comment comment, int like_count){
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/capstone/bookitty/domain/dto/MemberDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static class MemberSaveRequest {
private String password;
@ValidEnum(enumClass = Gender.class, message = "Invalid gender")
private Gender gender; //FEMALE 혹은 MALE
@DateTimeFormat(pattern = "yyyy-mm-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate birthdate;
@NotBlank(message = "name is a required entry value.")
private String name;
Expand Down Expand Up @@ -68,7 +68,7 @@ public static class MemberInfoResponse{
private String profileImg;
private String name;
private Gender gender;
@DateTimeFormat(pattern="yyyy-mm-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private LocalDate birthDate;

public static MemberInfoResponse of(Member member){
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/capstone/bookitty/domain/dto/StarDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ public static class StarInfoResponse{
private Long memberId;
private String isbn;
private double score;
@DateTimeFormat(pattern = "yyyy-mm-dd'T'HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
private LocalDateTime createdAt;
@DateTimeFormat(pattern = "yyyy-mm-dd'T'HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
private LocalDateTime modifiedAt;

public static StarInfoResponse of(Star star){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class BookState {
@Enumerated(EnumType.STRING)
private State state;

@DateTimeFormat(pattern = "yyyy-mm-dd'T'HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
private LocalDateTime readAt;

@Builder
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/capstone/bookitty/domain/entity/Comment.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public class Comment {
private String isbn;
private String content;

@DateTimeFormat(pattern = "yyyy-mm-dd'T'HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
private LocalDateTime createdAt;
@DateTimeFormat(pattern = "yyyy-mm-dd'T'HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
private LocalDateTime modifiedAt;

@Builder
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/capstone/bookitty/domain/entity/Like.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class Like {
@OnDelete(action = OnDeleteAction.CASCADE)
private Comment comment;

@DateTimeFormat(pattern = "yyyy-mm-dd'T'HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
private LocalDateTime createdAt;

@Builder
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/capstone/bookitty/domain/entity/Member.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class Member {
private String email;
private String password;

@DateTimeFormat(pattern = "yyyy-mm-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate birthDate;
private LocalDateTime createdAt;

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/capstone/bookitty/domain/entity/Star.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ public class Star {
private String isbn;
private double score;

@DateTimeFormat(pattern = "yyyy-mm-dd'T'HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
private LocalDateTime createdAt;
@DateTimeFormat(pattern = "yyyy-mm-dd'T'HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
private LocalDateTime modifiedAt;

@Builder
public Star(Member member, String isbn, double score, LocalDateTime createdAt) {
public Star(Member member, String isbn, double score) {
this.member = member;
this.isbn = isbn;
this.score = score;
this.createdAt = createdAt;
this.createdAt = LocalDateTime.now();
}

public void updateStar(double score){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public IdResponse saveStar(StarSaveRequest request) {
.score(request.getScore())
.isbn(request.getIsbn())
.member(member)
.createdAt(LocalDateTime.now())
.build();

starRepository.save(star);
Expand Down

0 comments on commit 2f0b424

Please sign in to comment.