package com.zhongshu.card.server.core.domain.devices;

import com.zhongshu.card.client.type.OnLineState;
import com.zhongshu.card.server.core.domain.base.SuperMain;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * 网关和设备的绑定关系 可能一个设备绑定多个网关 一个网关多个设备 （多对多的关系）
 *
 * @author TRX
 * @date 2024/5/14
 */
@Data
@Document
@NoArgsConstructor
@AllArgsConstructor
public class GateWay2Device extends SuperMain {

    @DBRef(lazy = true)
    @Schema(description = "硬件设备网关信息")
    private GateWayInfo gateWayInfo;

    @DBRef(lazy = true)
    @Schema(description = "关联的设备信息")
    private DeviceInfo deviceInfo;

    @Schema(description = "设备在线状态")
    private OnLineState state;

    @Schema(description = "绑定时间")
    private String bindTimeStr;

    @Schema(description = "绑定的项目ID")
    private String projectId;

    @Schema(description = "所属区域")
    private String address;
}
