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

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.StringUtils;

/**
 * @author TRX
 * @date 2024/5/31
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserCountSimpleModel {

    @Schema(description = "数据ID")
    private String id;

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

    @Schema(description = "登录名")
    private String loginName;

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

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

    @Schema(description = "真实姓名")
    private String realName;

    public String getRealName() {
        if (StringUtils.isNotEmpty(realName)) {
            return realName;
        }
        return name;
    }

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

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

    private String sexStr;

    public String getSexStr() {
        if (sex != null) {
            return sex.getRemark();
        }
        return "";
    }

    @Schema(description = "用户状态")
    private UserState state = UserState.Normal;
}
