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

import com.github.microservice.models.type.DeviceType;
import com.zhongshu.card.client.model.devices.DeviceInfoModel;
import com.zhongshu.card.client.model.org.DepartmentModel;
import com.zhongshu.card.client.model.org.OrganizationUserModel;
import com.zhongshu.card.client.model.org.UserCountSimpleModel;
import com.zhongshu.card.client.model.org.role.RoleModel;
import com.zhongshu.card.client.model.school.AreaSimpleModel;
import com.zhongshu.card.client.model.school.DictInfoSimpleModel;
import com.zhongshu.card.client.openApi.base.SuperAPIModel;
import com.zhongshu.card.client.type.DataState;
import com.zhongshu.card.client.type.OnLineState;
import com.zhongshu.card.client.type.Sex;
import com.zhongshu.card.client.type.UserState;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.ObjectUtils;

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

/**
 * @author TRX
 * @date 2024/10/11
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DevicePermissOpenApiModel extends SuperAPIModel {

    //-----------------------设备信息 start-----------------

    @Schema(description = "设备ID、设备号")
    private String deviceId;

    @Schema(description = "设备名称")
    private String deviceName;

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

    @Schema(description = "设备类型，如 消费机 门禁机")
    private DeviceType deviceType;

    private String deviceTypeStr;

    public String getDeviceTypeStr() {
        if (deviceType != null) {
            return deviceType.getRemark();
        }
        return "";
    }

    //----------------------用户信息 start ------------------

    @Schema(description = "工号、编码")
    private String code;

    @Schema(description = "用户ID（由鉴权中心颁发）")
    private String userId;

    @Schema(description = "用户手机号")
    private String phone;

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

    @Schema(description = "头像")
    private String profilePic;

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

    @Schema(description = "权限是否可用")
    private DataState dataState;

    private String dataStateStr;

    public String getDataStateStr() {
        if (dataState != null) {
            return dataState.getRemark();
        }
        return "";
    }
}
