package com.zhongshu.card.client.model.devices;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.microservice.models.type.DeviceType;
import com.github.microservice.types.deviceUse.OperateState;
import com.github.microservice.types.deviceUse.OperateType;
import com.zhongshu.card.client.model.base.SuperModel;
import com.zhongshu.card.client.model.org.UserCountSimpleModel;
import com.zhongshu.card.client.model.school.CardInfoStoreModel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author TRX
 * @date 2024/10/21
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DeviceUseRecordModel extends SuperModel {

    @Schema(description = "mqtt推送生成的业务数据ID")
    private String mqttDataId;

    @Schema(description = "token")
    private String token;

    @Schema(description = "关联的项目名称")
    private String projectName;

    //----------------------------设备信息start ---------------------

    @Schema(description = "操作模式，卡片、人脸、密码、指纹...")
    private OperateType operateType;

    @Schema(description = "操作记录结果")
    private OperateState operateState;

    @Schema(description = "设备ID")
    private String deviceId;

    @Schema(description = "设备类型")
    private DeviceType deviceType;

    @Schema(description = "设备信息")
    private DeviceInfoStoreModel deviceInfo;

    @Schema(description = "网关ID")
    private String gateWayId;

    @Schema(description = "设备所属机构oid")
    private String beLongOid;

    @Schema(description = "设备所属机构name")
    private String beLongName;

    //----------------------卡片信息 start-------------------

    @Schema(description = "10进制卡序列号（实体卡号或虚拟卡号）")
    private String cardNo;

    @Schema(description = "卡片信息")
    private CardInfoStoreModel cardInfo;

    @Schema(description = "人脸信息")
    private String pic = "";

    //------------------用户信息 start-------------------
    @Schema(description = "用户userId")
    private String userId;

    @Schema(description = "用户信息")
    public UserCountSimpleModel userAccount;

    @Schema(description = "使用时间 2024-09-12 20:40:00")
    private String time;

    @Schema(description = "时间")
    private Long timestamp;

    //-----------------------验证是否通过

    @Schema(description = "创建时间，可阅读的")
    private String createTimeStr;

    @Schema(description = "提示信息")
    private String msg = "";

    @JsonProperty("IsOffLine")
    @Schema(description = "是否是离线使用")
    private Boolean isOffLine = Boolean.FALSE;

    @Schema(description = "过期时间")
    private Date ttl;

    @Schema(description = "关联的数据")
    private Object data;

}
