package com.qs.mp.common.enums;

/**
 * 用户身份
 *
 * @author liugl
 * @Date 2022/03/01
 */
public enum UserIdentityEnum {

	ADMIN, // 管理后台
	USER, // 用户
	CHANNEL // 渠道端
	;
	public static boolean isChannel(int identity) {
		return identity == CHANNEL.ordinal();
	}
	public static boolean isUser(int identity) {
		return identity == USER.ordinal();
	}

	public static UserIdentityEnum valueOf(int ordinal) {
		if (ordinal < 0 || ordinal >= values().length) {
			throw new IndexOutOfBoundsException("Invalid ordinal");
		}
		return values()[ordinal];
	}

}
