Skip to content

Commit ef50b6d

Browse files
committed
config: 초기 설정
1 parent cec18e1 commit ef50b6d

File tree

7 files changed

+68
-0
lines changed

7 files changed

+68
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
package com.flow.file.common.entity;
2+
3+
import java.time.LocalDateTime;
4+
5+
import org.springframework.data.annotation.CreatedDate;
6+
import org.springframework.data.annotation.LastModifiedBy;
7+
import org.springframework.data.annotation.LastModifiedDate;
8+
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
9+
10+
import jakarta.persistence.Column;
11+
import jakarta.persistence.EntityListeners;
12+
import jakarta.persistence.MappedSuperclass;
13+
import jakarta.persistence.PrePersist;
14+
import jakarta.persistence.Version;
15+
import lombok.Getter;
16+
import lombok.NoArgsConstructor;
17+
import lombok.experimental.SuperBuilder;
18+
19+
@MappedSuperclass
20+
@EntityListeners(AuditingEntityListener.class)
21+
@Getter
22+
@SuperBuilder
23+
@NoArgsConstructor
24+
public class BaseEntity {
25+
26+
@Column(name = "use_yn")
27+
private boolean useYn;
28+
29+
@Column(name = "create_code", updatable = false)
30+
private String createCode;
31+
32+
@CreatedDate
33+
@Column(name = "create_date", updatable = false)
34+
private LocalDateTime createDate;
35+
36+
@LastModifiedBy
37+
@Column(name = "modify_code")
38+
private String modifyCode;
39+
40+
@LastModifiedDate
41+
@Column(name = "modify_date")
42+
private LocalDateTime modifyDate;
43+
44+
@Column(name = "delete_code")
45+
private String deleteCode;
46+
47+
@Column(name = "delete_date")
48+
private LocalDateTime deleteDate;
49+
50+
@Version
51+
public int version;
52+
53+
@PrePersist
54+
public void prePersist() {
55+
this.createDate = LocalDateTime.now();
56+
this.createCode = "flow-payment";
57+
this.useYn = true;
58+
}
59+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.flow.file.common.mapper;
2+
3+
public interface GenericMapper<D, E> {
4+
5+
D toDto(E entity);
6+
7+
E toEntity(D dto);
8+
9+
}

src/main/java/com/flow/file/dto/.gitkeep

Whitespace-only changes.

src/main/java/com/flow/file/entity/.gitkeep

Whitespace-only changes.

src/main/java/com/flow/file/mapper/.gitkeep

Whitespace-only changes.

src/main/java/com/flow/file/repository/.gitkeep

Whitespace-only changes.

src/main/java/com/flow/file/service/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)