package com.boying.common;
|
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
import javax.persistence.*;
|
import java.util.Date;
|
|
@MappedSuperclass
|
public abstract class BaseEntity {
|
|
@Id
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@Column(name = "id")
|
protected Long id;
|
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
protected Date createTime = new Date();
|
|
public Long getId() {
|
return id;
|
}
|
|
public void setId(Long id) {
|
this.id = id;
|
}
|
|
public Date getCreateTime() {
|
return createTime;
|
}
|
|
public void setCreateTime(Date createTime) {
|
this.createTime = createTime;
|
}
|
}
|