123456789101112131415161718192021222324252627 |
- package com.qs.mp.common.enums;
- /**
- * 用户身份
- *
- * @author liugl
- * @Date 2022/03/01
- */
- public enum UserIdentityEnum {
- CHANNEL, // 代理渠道
- SALESITE, // 经销商
- USER, // 用户
- ADMIN // 管理后台
- ;
- public static boolean isChannel(UserIdentityEnum identity) {
- return identity == CHANNEL || identity == SALESITE;
- }
- public static UserIdentityEnum valueOf(int ordinal) {
- if (ordinal < 0 || ordinal >= values().length) {
- throw new IndexOutOfBoundsException("Invalid ordinal");
- }
- return values()[ordinal];
- }
- }
|