File tree Expand file tree Collapse file tree 5 files changed +26
-3
lines changed
src/main/java/org/yourssu/festa Expand file tree Collapse file tree 5 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 44import io .swagger .v3 .oas .annotations .servers .Server ;
55import org .springframework .boot .SpringApplication ;
66import org .springframework .boot .autoconfigure .SpringBootApplication ;
7+ import org .springframework .data .jpa .repository .config .EnableJpaAuditing ;
78
9+ @ EnableJpaAuditing
810@ SpringBootApplication
911@ OpenAPIDefinition (
1012 servers = {
Original file line number Diff line number Diff line change 1+ package org .yourssu .festa .domain .entity ;
2+
3+ import jakarta .persistence .EntityListeners ;
4+ import jakarta .persistence .MappedSuperclass ;
5+ import lombok .Getter ;
6+ import org .springframework .data .annotation .CreatedDate ;
7+ import org .springframework .data .annotation .LastModifiedDate ;
8+ import org .springframework .data .jpa .domain .support .AuditingEntityListener ;
9+
10+ import java .time .LocalDateTime ;
11+
12+ @ MappedSuperclass
13+ @ EntityListeners (AuditingEntityListener .class )
14+ @ Getter
15+ public abstract class BaseEntity {
16+ @ CreatedDate
17+ private LocalDateTime createdAt ;
18+
19+ @ LastModifiedDate
20+ private LocalDateTime updatedAt ;
21+ }
Original file line number Diff line number Diff line change 1212@ Table (name = "booth" )
1313@ NoArgsConstructor (access = AccessLevel .PROTECTED )
1414@ Getter
15- public class BoothEntity {
15+ public class BoothEntity extends BaseEntity {
1616
1717 @ Id @ GeneratedValue (strategy = GenerationType .IDENTITY )
1818 private Long id ;
Original file line number Diff line number Diff line change 99@ Getter
1010@ Table (name = "booth_img" )
1111@ NoArgsConstructor (access = AccessLevel .PROTECTED )
12- public class BoothImageEntity {
12+ public class BoothImageEntity extends BaseEntity {
1313 @ Id @ GeneratedValue (strategy = GenerationType .IDENTITY )
1414 private Long id ;
1515
Original file line number Diff line number Diff line change 1111@ Table (name = "product" )
1212@ Getter
1313@ NoArgsConstructor (access = AccessLevel .PROTECTED )
14- public class ProductEntity {
14+ public class ProductEntity extends BaseEntity {
1515 @ Id @ GeneratedValue (strategy = GenerationType .IDENTITY )
1616 private Long id ;
1717
You can’t perform that action at this time.
0 commit comments