package cn.hanghui.outapi.platform.tenant.entity.enums;

import cn.hanghui.outapi.platform.common.utils.Preconditions;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author shisl
 * @package cn.hanghui.outapi.platform.tenant.entity.enums
 * @class AuthModuleTypeEnum
 * @date 2024/7/1 下午3:43
 * @description
 */
@AllArgsConstructor
@Getter
public enum AuthModuleTypeEnum {

    AMPE_TENANT(0, "商户平台"),
    AMPE(1, "Ampe平台"),
    HHFACE_TENANT(2, "HHFace商户平台"),
    HHFACE_USER_LIB(3, "HHFace用户库"),;

    private Integer code;
    private String desc;

    public static AuthModuleTypeEnum findByCode(Integer code) {
        if (Preconditions.isBlank(code)) {
            return null;
        }
        for (AuthModuleTypeEnum enumObject : values()) {
            if (enumObject.code == code.intValue()) {
                return enumObject;
            }
        }
        return null;
    }


}
