package com.erp.supplier.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.Builder;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("supplier_operation_logs")
public class SupplierOperationLog {

    @TableId(type = IdType.AUTO)
    private Long id;

    /** 供应商ID */
    private Long supplierId;

    /** 操作人ID */
    private Long operatorId;

    /** 操作人姓名 */
    private String operatorName;

    /** 操作类型 */
    private String operationType;

    /** 操作描述 */
    private String operationDesc;

    /** 操作前数据(JSON) */
    private String beforeData;

    /** 操作后数据(JSON) */
    private String afterData;

    /** IP地址 */
    private String ip;

    /** User-Agent */
    private String userAgent;

    /** 创建时间 */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;
}
