package shop.alien.entity.store;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 操作日志实体类
 *
 * @author ssk
 * @since 2025-12-09
 */
@Data
@TableName("operation_log")
@ApiModel(value = "OperationLog对象", description = "操作日志")
public class OperationLog {

    @ApiModelProperty(value = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "账号ID")
    @TableField("account_id")
    private String accountId;

    @ApiModelProperty(value = "账号")
    @TableField("account")
    private String account;

    @ApiModelProperty(value = "姓名")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "职务")
    @TableField("position")
    private String position;

    @ApiModelProperty(value = "部门")
    @TableField("department")
    private String department;

    @ApiModelProperty(value = "操作时间")
    @TableField("operation_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date operationTime;

    @ApiModelProperty(value = "操作模块")
    @TableField("operation_module")
    private String operationModule;

    @ApiModelProperty(value = "操作类型（导入、删除、新增、修改等）")
    @TableField("operation_type")
    private String operationType;

    @ApiModelProperty(value = "操作内容")
    @TableField("operation_content")
    private String operationContent;

    @ApiModelProperty(value = "用户类型（平台、用户、商家、律师）")
    @TableField("user_type")
    private String userType;

    @ApiModelProperty(value = "修改前的数据（JSON格式）")
    @TableField("before_data")
    private String beforeData;

    @ApiModelProperty(value = "修改后的数据（JSON格式）")
    @TableField("after_data")
    private String afterData;

    @ApiModelProperty(value = "请求方法")
    @TableField("method")
    private String method;

    @ApiModelProperty(value = "请求路径")
    @TableField("request_path")
    private String requestPath;

    @ApiModelProperty(value = "请求参数")
    @TableField("request_params")
    private String requestParams;

    @ApiModelProperty(value = "IP地址")
    @TableField("ip_address")
    private String ipAddress;

    @ApiModelProperty(value = "文件地址")
    @TableField("file_url")
    private String fileUrl;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;

    @ApiModelProperty(value = "创建人ID")
    @TableField(value = "created_user_id", fill = FieldFill.INSERT)
    private Integer createdUserId;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedTime;

    @ApiModelProperty(value = "更新人ID")
    @TableField(value = "updated_user_id", fill = FieldFill.INSERT_UPDATE)
    private Integer updatedUserId;

    @ApiModelProperty(value = "删除标识（0:未删除，1:已删除）")
    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;
}

