feat : BoardSummaryDto create time 추가

This commit is contained in:
yulmam 2024-07-26 16:29:58 +09:00
parent cebabf77c3
commit 97a69ae3af
7 changed files with 44 additions and 18 deletions

View File

@ -2,7 +2,9 @@ package com.edufocus.edufocus;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
@EnableJpaAuditing
@SpringBootApplication @SpringBootApplication
public class EdufocusApplication { public class EdufocusApplication {

View File

@ -5,7 +5,7 @@ import lombok.Builder;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import java.time.LocalTime; import java.time.LocalDateTime;
@Builder @Builder
@Getter @Getter
@ -17,6 +17,6 @@ public class ResponseBoardDetailDto {
private String title; private String title;
private String content; private String content;
private int viewCount; private int viewCount;
private LocalTime createdAt; private LocalDateTime createdAt;
private LocalTime modifiedAt; private LocalDateTime modifiedAt;
} }

View File

@ -5,6 +5,8 @@ import lombok.Builder;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import java.time.LocalDateTime;
@Builder @Builder
@Getter @Getter
@Setter @Setter
@ -12,4 +14,5 @@ public class ResponseBoardSummaryDto {
private long id; private long id;
private String name; private String name;
private String title; private String title;
private LocalDateTime createdAt;
} }

View File

@ -4,6 +4,7 @@ import lombok.Builder;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import java.time.LocalDateTime;
import java.time.LocalTime; import java.time.LocalTime;
@Builder @Builder
@ -13,6 +14,6 @@ public class ResponseCommentDto {
private long id; private long id;
private String name; private String name;
private String content; private String content;
private LocalTime createAt; private LocalDateTime createAt;
private LocalTime modifiedAt; private LocalDateTime modifiedAt;
} }

View File

@ -8,8 +8,11 @@ import com.edufocus.edufocus.user.model.entity.User;
import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonAutoDetect;
import jakarta.persistence.*; import jakarta.persistence.*;
import lombok.*; import lombok.*;
import org.hibernate.annotations.CreationTimestamp; import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import java.time.LocalDateTime;
import java.time.LocalTime; import java.time.LocalTime;
import java.util.List; import java.util.List;
@ -18,6 +21,7 @@ import java.util.List;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Setter @Setter
@EntityListeners(AuditingEntityListener.class)
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
public class Board { public class Board {
@ -37,11 +41,11 @@ public class Board {
@Column(nullable = true) @Column(nullable = true)
private int viewCount; private int viewCount;
@CreationTimestamp @CreatedDate
LocalTime createdAt; LocalDateTime createdAt;
@CreationTimestamp @LastModifiedDate
LocalTime modifiedAt; LocalDateTime modifiedAt;
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id") @JoinColumn(name = "user_id")
@ -60,6 +64,7 @@ public class Board {
.id(id) .id(id)
.title(title) .title(title)
.name(user.getUserId()) .name(user.getUserId())
.createdAt(createdAt)
.build(); .build();
} }

View File

@ -10,7 +10,7 @@ import lombok.Builder;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
import java.time.LocalTime; import java.time.LocalDateTime;
@Entity @Entity
@Builder @Builder
@ -26,10 +26,10 @@ public class Comment {
private String content; private String content;
@Column @Column
private LocalTime createdAt; private LocalDateTime createdAt;
@Column @Column
private LocalTime modifiedAt; private LocalDateTime modifiedAt;
@ManyToOne @ManyToOne
@JoinColumn(name = "user_id") @JoinColumn(name = "user_id")

View File

@ -2,13 +2,15 @@ spring.application.name=edufocus
server.port=8080 server.port=8080
server.ssl.enabled=false server.ssl.enabled=false
server.servlet.context-path=${CONTEXT_PATH}
# LiveKit configuration # LiveKit configuration
livekit.api.key=${LIVEKIT_API_KEY:devkey} livekit.api.key=${LIVEKIT_API_KEY:devkey}
livekit.api.secret=${LIVEKIT_API_SECRET:secret} livekit.api.secret=${LIVEKIT_API_SECRET:secret}
# JWT Salt (??? ?? ???? ???) # JWT Salt (??? ?? ???? ???)
jwt.salt=ssafy-screte-key-20240404-ssafy-screte-key-20240404-ssafy-screte-key-20240404 jwt.salt=${SALT}
# Access Token ?? ?? (??? ??) # Access Token ?? ?? (??? ??)
jwt.access-token.expiretime=3600000 jwt.access-token.expiretime=3600000
@ -16,11 +18,24 @@ jwt.access-token.expiretime=3600000
# Refresh Token ?? ?? (??? ??) # Refresh Token ?? ?? (??? ??)
jwt.refresh-token.expiretime=86400000 jwt.refresh-token.expiretime=86400000
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/edufocus?useSSL=false spring.datasource.url=${DATA_SOURCE_URL}
spring.datasource.username=root spring.datasource.username=${USER_NAME}
spring.datasource.password=root spring.datasource.password=${USER_PASSWORD}
spring.mvc.pathmatch.matching-strategy=ant_path_matcher spring.mvc.pathmatch.matching-strategy=ant_path_matcher
spring.jpa.database=mysql spring.jpa.database=mysql
spring.jpa.hibernate.ddl-auto=create spring.jpa.hibernate.ddl-auto=create
spring.jpa.show-sql=true spring.jpa.show-sql=true
spring.mail.host=smtp.gmail.com
spring.mail.port=587
#spring.mail.username=ssafytestpjt
#spring.mail.password=trpjbxqialufuzih
spring.mail.username=passfinder111@gmail.com
spring.mail.password=mnlyfkiprltjlsmw
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true