package com.games.gateway.enums;

import lombok.Getter;

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

    private final Integer code;

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

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

        return null;
    }
}
