package com.cpop.core.base.table;

import com.cpop.core.base.entity.BaseEntity;
import com.cpop.core.base.entity.BaseInsertListener;
import com.cpop.core.base.entity.BaseUpdateListener;
import com.cpop.core.base.enums.UserType;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * 操作日志表 实体类。
 *
 * @author DB
 * @since 2023-08-05
 */
@Data
@EqualsAndHashCode(callSuper=false)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Table(value = "cp_sys_operation_log", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
public class SysOperationLog extends BaseEntity implements Serializable {

    /**
     * ID
     */
    @Id
    private String id;

    /**
     * 用户ID
     */
    private String operationUserId;

    /**
     * 操作用户
     */
    private String operationUserName;

    /**
     * 操作用户类型
     */
    private UserType operationUserType;

    /**
     * 操作码
     */
    private Integer code;

    /**
     * 操作信息
     */
    private String info;

    /**
     * 操作终端的IP地址
     */
    private String devIp;

    /**
     * 结果  -1:失败 1:成功
     */
    private Boolean result;

    /**
     * 日志级别,0-提示，1-一般，2-危险，3-高危
     */
    private Integer level;

    /**
     * 行为类别，1-一般行为，2-异常行为
     */
    private Integer actionType;

    /**
     * 失败原因
     */
    private String failReason;

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

}
