package com.sunyard.ssp.modules.monitor.log.entity;

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 lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.persistence.Transient;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("SC_LOG_SIGN")
@ApiModel(value="日志签名表", description="")
public class LogSign implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId("ID")
    private Long id;

    @ApiModelProperty(value = "创建时间")
    @TableField("CREATE_TIME")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "签名人id")
    @TableField("OPERATOR_ID")
    private Long operatorId;

    @ApiModelProperty(value = "签名人真实姓名")
    @TableField("OPERATOR_NAME")
    private String operatorName;

    @ApiModelProperty(value = "签名值")
    @TableField("SIGN_VALUE")
    private String signValue;

    @ApiModelProperty(value = "公钥")
    @TableField("PUBLICKEY")
    private String publicKey;

    @ApiModelProperty(value = "U盾序号")
    @TableField("DEVICE_ID")
    private String deviceId;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty(value = "关联日志详情，按id排序")
    private List<AuditLog> auditLogs;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty(value = "关联日志总数")
    private Integer auditLogsCount;
}
