package shop.alien.entity.storePlatform;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 平台操作记录表
 *
 * @author system
 * @since 2025-01-XX
 */
@Data
@TableName("store_platform_operation_log")
@ApiModel(value = "StorePlatformOperationLog对象", description = "平台操作记录")
public class StorePlatformOperationLog {

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

    @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 = "操作入参(JSON)")
    @TableField("operation_params")
    private String operationParams;

    @ApiModelProperty(value = "操作者ID")
    @TableField("operator_id")
    private String operatorId;

    @ApiModelProperty(value = "操作者账号")
    @TableField("operator_account")
    private String operatorAccount;

    @ApiModelProperty(value = "操作者姓名")
    @TableField("operator_name")
    private String operatorName;

    @ApiModelProperty(value = "操作者店铺ID")
    @TableField("store_id")
    private Integer storeId;

    @ApiModelProperty(value = "用户类型")
    @TableField("user_type")
    private String userType;

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

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

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

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