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

import com.github.microservice.models.type.DeviceType;
import com.zhongshu.card.client.type.Sex;
import com.zhongshu.card.client.type.device.PermissSettingDeviceType;
import com.zhongshu.card.client.type.device.PermissSettingType;
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.index.Indexed;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.ArrayList;
import java.util.List;

/**
 * 设备权限 规则 设置数据
 *
 * @author TRX
 * @date 2024/12/19
 */
@Data
@Document
@NoArgsConstructor
@AllArgsConstructor
public class PermissSettingList extends SuperMain {

    @Schema(description = "设备权限规则信息")
    @DBRef(lazy = true)
    @Indexed
    private PermissSetting permissSetting;

    @Indexed
    @Schema(description = "规则数据ID")
    private String permissSettingId;

    @Schema(description = "设备配置类型")
    private PermissSettingType permissSettingType;

    @Schema(description = "性别")
    @Indexed
    private List<Sex> sex;

    @Schema(description = "关联配置的数据id，如：角色id集合")
    @Indexed
    private List<String> dataIds = new ArrayList<>();

    @Schema(description = "设备类型--分组、设备、区域")
    private PermissSettingDeviceType permissSettingDeviceType;

    @Schema(description = "设备类型")
    private List<DeviceType> deviceTypes = new ArrayList<>();

    @Schema(description = "设备关联数据ID")
    @Indexed
    private List<String> deviceIds = new ArrayList<>();

}

