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

import com.zhongshu.card.client.model.base.SuperModel;
import com.zhongshu.card.client.model.school.AreaModel;
import com.zhongshu.card.client.type.OnLineState;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author TRX
 * @date 2024/7/2
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class GateWayInfoModel extends SuperModel {
    @Schema(description = "网关ID")
    private String gateWayId;

    @Schema(description = "网关名称")
    private String gateWayName;

    @Schema(description = "关联的项目code")
    private String projectInfoCode;

    @Schema(description = "关联的项目Name")
    private String projectInfoName;

    @Schema(description = "ip地址")
    private String ip;

    @Schema(description = "网关在线状态")
    OnLineState state;

    private String stateStr;

    public String getStateStr() {
        if (state != null) {
            return state.getRemark();
        }
        return "";
    }

    @Schema(description = "所属区域")
    private AreaModel area;
}
