/*
 *
 *  * | Licensed 未经许可不能去掉「OPENIITA」相关版权
 *  * +----------------------------------------------------------------------
 *  * | Author: xw2sy@163.com
 *  * +----------------------------------------------------------------------
 *
 *  Copyright [2024] [OPENIITA]
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 * /
 */

package cc.iotkit.manager.dto.vo.deviceinfo;

import cc.iotkit.model.device.DeviceInfo;
import cc.iotkit.model.product.Product;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMapping;
import io.github.linpeilie.annotations.ReverseAutoMapping;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Map;


@ApiModel(value = "DeviceInfoVo")
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = DeviceInfo.class,convertGenerate = false)
public class DeviceInfoVo implements Serializable {

    private static final long serialVersionUID = -1L;

    @ApiModelProperty(value = "")
    @ExcelProperty(value = "")
    private String id;

    @ApiModelProperty(value = "创建时间")
    @ExcelProperty(value = "创建时间")
    private Long createAt;

    @ApiModelProperty(value = "设备id")
    @ExcelProperty(value = "设备id")
    private String deviceId;

    @ApiModelProperty(value = "设备名称")
    @ExcelProperty(value = "设备名称")
    private String deviceName;

    @ApiModelProperty(value = "设备类型")
    @ExcelProperty(value = "设备类型")
    private String model;

    @ApiModelProperty(value = "设备离线时间")
    @ExcelProperty(value = "设备离线时间")
    @ReverseAutoMapping(source = "state.offlineTime", target = "offlineTime")
    @AutoMapping(ignore = true)
    private Long offlineTime;

    @ApiModelProperty(value = "设备在线时间")
    @ExcelProperty(value = "设备在线时间")
    @ReverseAutoMapping(source = "state.onlineTime", target = "onlineTime")
    @AutoMapping(ignore = true)
    private Long onlineTime;

    @ApiModelProperty(value = "父级id")
    @ExcelProperty(value = "父级id")
    private String parentId;

    @ApiModelProperty(value = "产品key")
    @ExcelProperty(value = "产品key")
    private String productKey;

    @ApiModelProperty(value = "设备描述")
    @ExcelProperty(value = "设备描述")
    private String secret;

    @ApiModelProperty(value = "设备状态")
    @ExcelProperty(value = "设备状态")
    @ReverseAutoMapping(source = "state.online", target = "online")
    @AutoMapping(ignore = true)
    private Boolean online;

    @ApiModelProperty(value = "所属产品信息")
    private Product product;

    @ApiModelProperty(value = "所属分组")
    private Map<String, DeviceInfo.Group> group;

    @ApiModelProperty(value = "位置信息")
    private DeviceInfo.Locate locate;
    //@AutoMapping(ignore = true)
    private String onlineStatus;
    @ApiModelProperty(value="部门表-区域id")
    private Long deptAreaId;
    private String productName;
}
