model / common 패키지
( 공통 클래스 )
( 등록일 , 수정일 같은 공통 클래스를 만드는 곳 )
예제 코드 (수정 필요)
@Getter
@Setter
@ToString
public class BaseTimeEntity {
/** 등록일 */
private String insertTime;
/** 수정일 */
private String updateTime;
// 초기값 저장
public BaseTimeEntity() {
this.insertTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));;
this.updateTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));;
}
}
'SpringBoot > code' 카테고리의 다른 글
SpringBoot - RedirectView (클래스) (0) | 2023.10.10 |
---|---|
SpringBoot - @ResponseBody (1) | 2023.10.10 |
SpringBoot - @Slf4j (0) | 2023.10.10 |
SpringBoot - Logback , Log4jdbc (로깅) 설정 (0) | 2023.10.06 |
SpringBoot - ResponseEntity (클래스) (1) | 2023.10.06 |