package cn.fateverse.common.core.entity;

import cn.fateverse.common.core.annotaion.AutoTime;
import cn.fateverse.common.core.annotaion.AutoUser;
import cn.fateverse.common.core.enums.MethodEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author Clay
 * @date 2022/10/30
 */
@Data
public abstract class BaseEntity implements Serializable {

    /**
     * 创建者
     */
    @AutoUser(method = MethodEnum.INSERT)
    private Object createBy;

    /**
     * 创建时间
     */
    @AutoTime(method = MethodEnum.INSERT)
    @JsonFormat(locale = "zh",timezone = "GMT+8",pattern = "yyyy-MM-dd")
    private LocalDateTime createTime;

    /**
     * 更新者
     */
    @AutoUser(method = MethodEnum.UPDATE)
    private Object updateBy;

    /**
     * 更新时间
     */
    @AutoTime(method = MethodEnum.UPDATE)
    @JsonFormat(locale = "zh",timezone = "GMT+8",pattern = "yyyy-MM-dd")
    private LocalDateTime updateTime;


    /**
     * 备注信息
     */
    private String remark;

}
