package com.sundot.airport.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 政治面貌枚举
 */
@Getter
@AllArgsConstructor
public enum SysUserPoliticalStatusEnum {

    COMMUNIST_PARTY_MEMBER("COMMUNIST_PARTY_MEMBER", "中共党员"),
    PROBATIONARY_COMMUNIST_PARTY_MEMBER("PROBATIONARY_COMMUNIST_PARTY_MEMBER", "中共预备党员"),
    COMMUNIST_YOUTH_LEAGUE_MEMBER("COMMUNIST_YOUTH_LEAGUE_MEMBER", "共青团员"),
    MASS_PUBLIC("MASS_PUBLIC", "群众"),
    REVOLUTIONARY_COMMITTEE_OF_THE_CHINESE_KUOMINTANG("REVOLUTIONARY_COMMITTEE_OF_THE_CHINESE_KUOMINTANG", "中国国民党革命委员会"),
    CHINA_DEMOCRATIC_LEAGUE("CHINA_DEMOCRATIC_LEAGUE", "中国民主同盟"),
    CHINA_DEMOCRATIC_NATIONAL_CONSTRUCTION_ASSOCIATION("CHINA_DEMOCRATIC_NATIONAL_CONSTRUCTION_ASSOCIATION", "中国民主建国会"),
    CHINA_ASSOCIATION_FOR_PROMOTING_DEMOCRACY("CHINA_ASSOCIATION_FOR_PROMOTING_DEMOCRACY", "中国民主促进会"),
    CHINESE_PEASANTS_AND_WORKERS_DEMOCRATIC_PARTY("CHINESE_PEASANTS_AND_WORKERS_DEMOCRATIC_PARTY", "中国农工民主党"),
    CHINA_ZHI_GONG_PARTY("CHINA_ZHI_GONG_PARTY", "中国致公党"),
    JIU_SAN_SOCIETY("JIU_SAN_SOCIETY", "九三学社"),
    TAIWAN_DEMOCRATIC_SELF_GOVERNMENT_LEAGUE("TAIWAN_DEMOCRATIC_SELF_GOVERNMENT_LEAGUE", "台湾民主自治同盟");

    private final String code;
    private final String desc;

    public static SysUserPoliticalStatusEnum getByCode(String code) {
        for (SysUserPoliticalStatusEnum itemEnum : values()) {
            if (itemEnum.getCode().equals(code)) {
                return itemEnum;
            }
        }
        return null;
    }

    public static SysUserPoliticalStatusEnum getByDesc(String desc) {
        for (SysUserPoliticalStatusEnum itemEnum : values()) {
            if (itemEnum.getDesc().equals(desc)) {
                return itemEnum;
            }
        }
        return null;
    }

}
