package org.dromara.payment.common.domain;

import org.dromara.common.core.enums.BusRole;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;

/**
 * 业务操作日志对象 bus_oper_log
 *
 * @author LionLi
 * @date 2024-04-10
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("bus_oper_log")
public class BusOperLog extends BaseEntity {

    @Serial
    private static final long serialVersionUID = 1L;

    public BusOperLog(){}

    public BusOperLog(String logDesc, BusRole role, Long busId, Integer busType) {
        this.logDesc = logDesc;
        this.createRoleId = role.getId();
        this.createRoleName = role.getName();
        this.busId = busId;
        this.busType = busType;
    }

    /**
     * 主键
     */
    @TableId(value = "id")
    private Long id;

    /**
     * 日志描述
     */
    private String logDesc;

    /**
     * 角色id
     */
    private Integer createRoleId;

    /**
     * 角色名称
     */
    private String createRoleName;

    /**
     * 业务id(任务id或账单批次id)
     */
    private Long busId;

    /**
     * 业务类型（1：项目 2：账单批次）
     */
    private Integer busType;
}
