package com.wzj.soopin.member.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 账户类型枚举
 */
@Getter
@AllArgsConstructor
public enum AccountTypeEnum {

    USER(1, "用户"),
    MERCHANT(2, "商家"),
    AGENT(3, "代理"),
    PLATFORM(4, "平台");

    private final Integer code;
    private final String desc;

    public static String getDesc(Integer code) {
        if (code == null) {
            return "";
        }
        for (AccountTypeEnum type : values()) {
            if (type.getCode().equals(code)) {
                return type.getDesc();
            }
        }
        return "";
    }
}
