package com.qiuguo.iot.data.resp.device;
import com.qiuguo.iot.base.enums.YesNo;
import com.qiuguo.iot.data.entity.device.DeviceUserTalkRecordEntity;
import lombok.Data;

import java.util.Date;

/**
* <p>
* </p>*设备信息对话记录返回类
* @author wulin
* @since 2023-09-27
*/

@Data
public class DeviceTalkRecordResp {
    //
    private Long id;
    //当前用户当前设备问话一次标识（考虑到可能有多个第三方回答）
    //创建时间
    private Date createTime;
    private Integer askNumber;
    //用户id
    private Long userId;
    //设备id
    private Long deviceId;
    //问话内容
    private String text;
    //回答类型0：文本问答 1：iOT控制 2：天气 3：闹钟 4：U3D 5：音乐声音 100：固件升级
    private Integer askType;

    private Integer AskOrAnswer = 0;

    public DeviceTalkRecordResp(){
    }
    public DeviceTalkRecordResp(DeviceUserTalkRecordEntity entity, Integer aa){
        id = entity.getId();

        createTime = entity.getCreateTime();
        askNumber = entity.getAskNumber();
        userId = entity.getUserId();
        deviceId = entity.getDeviceId();
        if(aa.equals(YesNo.YES.getCode())){
            text = entity.getAskValue();
        }else{
            text = entity.getAnswerValue();
        }
        AskOrAnswer = aa;
        askType = entity.getAskType();

    }
}