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

import com.zhongshu.card.client.type.DataState;
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.checkerframework.common.aliasing.qual.NonLeaked;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * 设备分组
 *
 * @author TRX
 * @date 2024/12/19
 */
@Data
@Document
@AllArgsConstructor
@NoArgsConstructor
@NonLeaked
public class DeviceGroup extends SuperMain {

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

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

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

    public static DeviceGroup build(String id) {
        DeviceGroup entity = new DeviceGroup();
        entity.setId(id);
        return entity;
    }

}
