package com.yuchen.saas.park.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author 肖祥
 * @date 2022/10/20 17:11
 * 性别:1是男,2是女3未知
 */
@Getter
@AllArgsConstructor
public enum SexV1Enum {

    MAN(1, "男"),

    WOMAN(2, "女"),

    OTHER(3, "未知");

    private Integer code;

    private String description;

    public static String getDescByCode(Integer code) {
        SexV1Enum[] maskEnumArray = SexV1Enum.values();
        for (SexV1Enum maskEnum : maskEnumArray) {
            if (maskEnum.getCode().equals(code)) {
                return maskEnum.getDescription();
            }
        }
        return SexV1Enum.OTHER.description;
    }
}
