package com.sonic.bear.lib.enums;

import lombok.Getter;

/**
 * 账号类型
 * @author code
 */
@Getter
public enum AccountTypeEnum {
    /**
     * 客户用户
     */
    CUSTOMER(1),
    /**
     * 后台账号
     */
    SYSTEM(2),
    ;

    private final Integer code;

    AccountTypeEnum(Integer code) {
        this.code = code;
    }

    public static AccountTypeEnum from(Integer code) {
        for (AccountTypeEnum status : AccountTypeEnum.values()) {
            if (code.equals(status.code)) {
                return status;
            }
        }

        return null;
    }
}
