package com.zhongshu.card.client.model.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 io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

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

/**
 * @author TRX
 * @date 2024/12/19
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PermissSettingConfigModel {

    private String id;

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

    private String permissSettingTypeStr;

    public String getPermissSettingTypeStr() {
        if (permissSettingType != null) {
            return permissSettingType.getRemark();
        }
        return "";
    }

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

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

    @Schema(description = "关联的数据名称")
    private String aboutShowDataName = "";

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

    private String permissSettingDeviceTypeStr;

    public String getPermissSettingDeviceTypeStr() {
        if (permissSettingDeviceType != null) {
            return permissSettingDeviceType.getRemark();
        }
        return "";
    }

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

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

    private String deviceNames = "";

}
