public enum RevenueSource {
ALL(0, "all", "总收入", PermissionTag.PTAG_STATISTICS_REVENUE_ALL), //
OFFLINE_ACTIVITY(1, "offlineActivity", "线下活动", PermissionTag.PTAG_STATISTICS_REVENUE_OFFLINEACTIVITY), //
AD(2, "ad", "广告费", PermissionTag.PTAG_STATISTICS_REVENUE_AD), //
T_VIP(3001, "tVip", "老师会员", PermissionTag.PTAG_STATISTICS_REVENUE_TVIP), //
O_VIP(3002, "oVip", "机构会员", PermissionTag.PTAG_STATISTICS_REVENUE_OVIP), //
SERVICE(4, "service", "线下增值服务", PermissionTag.PTAG_STATISTICS_REVENUE_SERVICE), //
MANAGEMENT(5, "management", "管理费", PermissionTag.PTAG_STATISTICS_REVENUE_MANAGEMENT), //
BAIJIABAO(6, "baijiabao", "百加宝", PermissionTag.PTAG_STATISTICS_REVENUE_BAIJIABAO), //
TIANXIAO(7, "tianxiao", "天校", PermissionTag.PTAG_STATISTICS_REVENUE_TIANXIAO), //
SHANGXUEYUAN(8, "shangxueyuan", "商学院", PermissionTag.PTAG_STATISTICS_REVENUE_SHANGXUEYUAN), //
OFFLINE_CPS(9, "offlineCps", "线下CPS", PermissionTag.PTAG_STATISTICS_REVENUE_OFFLINECPS), //
CPS(1001, "cps", "CPS", PermissionTag.PTAG_STATISTICS_REVENUE_CPS), //
ONLINE_SERVICE(1002, "onlineService", "线上增值服务", PermissionTag.PTAG_STATISTICS_REVENUE_ONLINESERVICE), //
POUNDAGE(1003, "poundage", "手续费", PermissionTag.PTAG_STATISTICS_REVENUE_POUNDAGE), //
;
private int id;// 对外服务的标识ID
private String tag;
private String desc;
private String permissionTag;
private static Map<String, RevenueSource> byTagMap = new HashMap<>(values().length);
private static Map<String, RevenueSource> byPermissionTagMap = new HashMap<>(values().length);
private static Map<Integer, RevenueSource> byIdMap = new HashMap<>(values().length);
static {
for (RevenueSource rs : values()) {
byTagMap.put(rs.tag, rs);
byPermissionTagMap.put(rs.permissionTag, rs);
byIdMap.put(rs.id, rs);
}
}
public int getId() {
return id;
}
public String getTag() {
return tag;
}
public String getDesc() {
return desc;
}
public String permissionTag() {
return permissionTag;
}
private RevenueSource(int id, String tag, String desc, String permissionTag) {
this.id = id;
this.tag = tag;
this.desc = desc;
this.permissionTag = permissionTag;
}
public static RevenueSource byTag(String tag) {
return byTagMap.get(tag);
}
public static RevenueSource byPermissionTag(String permissionTag) {
return byPermissionTagMap.get(permissionTag);
}
public static RevenueSource byId(Integer id) {
return byIdMap.get(id);
}
}
枚举
最新推荐文章于 2024-04-29 10:00:00 发布