package com.ruoyi.bst.commandLog.domain;

import java.math.BigDecimal;
import java.time.LocalDateTime;

import org.springframework.format.annotation.DateTimeFormat;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.interfaces.LogBizParam;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 命令日志对象 bst_command_log
 *
 * @author ruoyi
 * @date 2025-04-03
 */
@Data
public class CommandLog extends BaseEntity implements LogBizParam
{
    private static final long serialVersionUID = 1L;

    private Long id;

    @Excel(name = "类型", readConverterExp = "1=-在线API,2=-蓝牙")
    @ApiModelProperty("类型")
    private String type;

    @Excel(name = "MAC号")
    @ApiModelProperty("MAC号")
    private String mac;

    @Excel(name = "发送命令的原因")
    @ApiModelProperty("发送命令的原因")
    private String reason;

    @Excel(name = "命令")
    @ApiModelProperty("命令")
    private String command;

    @Excel(name = "命令发送的结果")
    @ApiModelProperty("命令发送的结果")
    private String result;

    @Excel(name = "操作人ID")
    @ApiModelProperty("操作人ID")
    private Long userId;

    @Excel(name = "操作人名称")
    @ApiModelProperty("操作人名称")
    private String userName;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("操作时间")
    private LocalDateTime operaTime;

    @Excel(name = "返回值code")
    @ApiModelProperty("返回值code")
    private Integer iotCode;

    @Excel(name = "经度")
    @ApiModelProperty("经度")
    private BigDecimal longitude;

    @Excel(name = "纬度")
    @ApiModelProperty("纬度")
    private BigDecimal latitude;

    @Excel(name = "订单ID")
    @ApiModelProperty("订单ID") 
    private Long orderId;

    @Excel(name = "原始响应")
    @ApiModelProperty("原始响应")
    private String originResponse;

    @Override
    public Object logBizId() {
        return this.id;
    }
}
