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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author 肖祥
 * @date 2022/11/22 17:11
 * 人员类型:0重点人员 1陌生人 3高频人员
 */
@Getter
@AllArgsConstructor
public enum PersonEnum {

    KEY_PERSON(0, "重点人员"),
    ADMIN(1, "陌生人"),
    COMMON(3, "高频人员");

    private Integer code;

    private String description;

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