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

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

/**
 * @author TRX
 * @date 2024/12/19
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DeviceGroupModel extends SuperModel {

    @Schema(description = "名称")
    private String name;

    @Schema(description = "数据状态")
    private DataState state;

    private String stateStr;

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

    @Schema(description = "关联的设备数量")
    private Long number = 0L;
}
