package api.common.pojo.po.algorithm;

import lombok.Getter;
import lombok.Setter;

import java.util.Date;
import java.util.UUID;

/**
 * 数据表公共字段
 */
@Getter
@Setter
public class BasePo {

    //id
    private String id;

    //创建时间
    private Date createTime;

    //创建人
    private String createUserId;

    //修改时间
    private Date modifyTime;

    //修改人
    private String modifyUserId;

    //是否删除
    private String isDeleted;

    public void createPo(){
        id = createId();
        Date date = new Date();
        createTime = date;
        modifyTime = date;
        isDeleted = "0";
        /// TODO 创建人
    }

    public void updatePo(){
        modifyTime = new Date();
        /// TODO 修改人
    }

    private String createId(){
        return UUID.randomUUID().toString().replace("-","");
    }
}
