package com.hdkj.lt.base.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * @Description
 * @Author wcx
 * @Date 2025/5/15 18:10
 * @Version 1.0
 */
@Data
@Accessors(chain = true)
public class FhzgBaseEntity {
    /**
     * 代理主键
     */
    @ApiModelProperty("代理主键")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    protected Long id;

    /**
     * 创建人
     */
    @ApiModelProperty("创建人")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    protected Long creator;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    protected LocalDateTime createTime;

    /**
     * 最后一次修改人
     */
    @ApiModelProperty("最后一次修改人")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    protected Long lastEditor;

    /**
     * 最后一次修改时间
     */
    @ApiModelProperty("最后一次修改时间")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    protected LocalDateTime lastTime;

    public FhzgBaseEntity setCreator(Long creator) {
        this.creator = creator;
        this.lastEditor = creator;
        return this;
    }

    public FhzgBaseEntity setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
        this.lastTime = createTime;
        return this;
    }
}
