package com.yuchen.saas.device.api.entity.scene;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author: 宋少挺
 * @CreateTime: 2022/10/19 15:24
 * @Description: 场景联动规则执行动作详细日志
 * @Version: 1.0
 */
@Data
@ApiModel(value = "场景联动规则执行动作详细日志 数据表", description = "场景联动规则执行动作详细日志")
@TableName("device_scene_linkage_rule_action_log")
public class DeviceSceneLinkageRuleActionLog implements Serializable {
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty("主键id")
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty(name = "logId", value = "规则执行日志id")
    private Long logId;

    @ApiModelProperty(name = "ruleId", value = "规则id")
    private Long ruleId;

    @ApiModelProperty(name = "actionType", value = "执行类型 setProperty设置属性，service执行设备服务，trigger执行其他规则,triggerAlarm执行报警")
    private String actionType;

    @ApiModelProperty(name = "actionProductKey", value = "执行设备的产品key")
    private String actionProductKey;

    @ApiModelProperty(name = "actionService", value = "执行的设备服务open  开闸，close 关闸")
    private String actionService;

    @ApiModelProperty(name = "actionDeviceName", value = "执行设备的设备名称")
    private String actionDeviceName;

    @ApiModelProperty(name = "actionRuleId", value = "执行的规则id")
    private Long actionRuleId;

    @ApiModelProperty(name = "actionStartTime", value = "执行开始时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date actionStartTime;

    @ApiModelProperty(name = "actionEndTime", value = "执行结束时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date actionEndTime;

    @ApiModelProperty(name = "actionContent", value = "执行内容快照")
    private String actionContent;

    @ApiModelProperty(name = "status", value = "规则执行状态 0:执行中，1：执行成功，-1：执行失败")
    private Integer status;

    @ApiModelProperty(name = "result", value = "规则执行结果描述")
    private String result;

}