Commit 901b4c52 by songxiang

统一应用类型枚举1

parent 9fc2e013
...@@ -2,10 +2,10 @@ package com.pcloud.common.core.enums; ...@@ -2,10 +2,10 @@ package com.pcloud.common.core.enums;
import com.pcloud.common.core.constant.ProductTypeConstant; import com.pcloud.common.core.constant.ProductTypeConstant;
import com.pcloud.common.utils.string.StringUtil; import com.pcloud.common.utils.string.StringUtil;
import com.pcloud.common.enums.AppTypeEnum;
/** /**
* Description 应用作品类型关联枚举 * Description 应用作品类型关联枚举 Created by PENG on 2019/3/27.
* Created by PENG on 2019/3/27.
*/ */
public enum AppProductTypeEnum { public enum AppProductTypeEnum {
...@@ -50,6 +50,7 @@ public enum AppProductTypeEnum { ...@@ -50,6 +50,7 @@ public enum AppProductTypeEnum {
/** /**
* 根据应用类型编码获取作品类型编码 * 根据应用类型编码获取作品类型编码
*
* @param appTypeCode 应用类型编码 * @param appTypeCode 应用类型编码
* @return * @return
*/ */
...@@ -70,6 +71,7 @@ public enum AppProductTypeEnum { ...@@ -70,6 +71,7 @@ public enum AppProductTypeEnum {
/** /**
* 根据作品类型编码获取应用类型编码 * 根据作品类型编码获取应用类型编码
*
* @param productTypeCode 作品类型编码 * @param productTypeCode 作品类型编码
* @return * @return
*/ */
...@@ -91,12 +93,15 @@ public enum AppProductTypeEnum { ...@@ -91,12 +93,15 @@ public enum AppProductTypeEnum {
/** /**
* 会员应用可设置会员免费的作品类型 * 会员应用可设置会员免费的作品类型
*/ */
public static final String[] MEMBER_INCLUDE_PRODUCT_TYPE = {ProductTypeConstant.PDF, ProductTypeConstant.AUDIO, ProductTypeConstant.VIDEO, ProductTypeConstant.PRETEST, ProductTypeConstant.ARTICLE, public static final String[] MEMBER_INCLUDE_PRODUCT_TYPE = {ProductTypeConstant.PDF, ProductTypeConstant.AUDIO,
ProductTypeConstant.FORMAT, ProductTypeConstant.ALBUM, ProductTypeConstant.BOOK, ProductTypeConstant.EBOOK, ProductTypeConstant.VIDEO_SCHEDULE}; ProductTypeConstant.VIDEO, ProductTypeConstant.PRETEST, ProductTypeConstant.ARTICLE,
ProductTypeConstant.FORMAT, ProductTypeConstant.ALBUM, ProductTypeConstant.BOOK, ProductTypeConstant.EBOOK,
ProductTypeConstant.VIDEO_SCHEDULE};
/** /**
* 会员应用可设置会员免费的应用类型 * 会员应用可设置会员免费的应用类型
*/ */
public static final String[] MEMBER_INCLUDE_APP_TYPE = {AppTypeEnum.ANSWER.value, AppTypeEnum.ITEM_BANK.value, AppTypeEnum.EBOOK.value, AppTypeEnum.TEACH_RESOURCE.value, AppTypeEnum.COURSE_WARE.value, public static final String[] MEMBER_INCLUDE_APP_TYPE = {AppTypeEnum.ANSWER.value, AppTypeEnum.ITEM_BANK.value,
AppTypeEnum.EBOOK.value, AppTypeEnum.TEACH_RESOURCE.value, AppTypeEnum.COURSE_WARE.value,
AppTypeEnum.TEST_PAPER.value}; AppTypeEnum.TEST_PAPER.value};
} }
package com.pcloud.common.core.enums; package com.pcloud.common.core.enums;
import com.pcloud.common.enums.AppTypeEnum;
/** /**
* @描述: * @描述:
* @作者:songx *
* @创建时间:20"1"7年"1"0月3"1"日,上午"1""1":45:58 * @作者:songx @创建时间:20"1"7年"1"0月3"1"日,上午"1""1":45:58 @版本:"1".0
* @版本:"1".0
*/ */
public enum TempletCodeEnum { public enum TempletCodeEnum {
K12("K12教辅(试卷类)", new String[][] { { PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" }, K12("K12教辅(试卷类)",
new String[][] { { PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" },
{ PcloudTypeEnum.APP.name(), AppTypeEnum.ZSCORE.name(), "1" }, { PcloudTypeEnum.APP.name(), AppTypeEnum.ZSCORE.name(), "1" },
{ PcloudTypeEnum.APP.name(), AppTypeEnum.QA.name(), "1" }, { PcloudTypeEnum.APP.name(), AppTypeEnum.QA.name(), "1" },
{ PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.PDF.name(), "1" } }), { PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.PDF.name(), "1" } }),
PUBLIC_PROSE("大众类散文随笔诗歌", new String[][] { PUBLIC_PROSE("大众类散文随笔诗歌", new String[][] { { PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" } }),
{ PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" } }),
PUBLIC_JOURNAL("大众类期刊", new String[][] { { PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.FORMAT.name(), "1" }, PUBLIC_JOURNAL("大众类期刊", new String[][] { { PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.FORMAT.name(), "1" },
{ PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" } }), { PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" } }),
...@@ -25,7 +26,8 @@ public enum TempletCodeEnum { ...@@ -25,7 +26,8 @@ public enum TempletCodeEnum {
SINOLOGY("国学类图书(18+)", new String[][] { { PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" }, SINOLOGY("国学类图书(18+)", new String[][] { { PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" },
{ PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.PDF.name(), "1" } }), { PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.PDF.name(), "1" } }),
VACATION("假期作业", new String[][] { { PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" }, VACATION("假期作业",
new String[][] { { PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" },
{ PcloudTypeEnum.APP.name(), AppTypeEnum.SPECIAL.name(), "1" }, { PcloudTypeEnum.APP.name(), AppTypeEnum.SPECIAL.name(), "1" },
{ PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.PDF.name(), "1" }, { PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.PDF.name(), "1" },
{ PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.PRETEST.name(), "1" } }), { PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.PRETEST.name(), "1" } }),
...@@ -33,15 +35,18 @@ public enum TempletCodeEnum { ...@@ -33,15 +35,18 @@ public enum TempletCodeEnum {
MILITARY("军事历史类图书", new String[][] { { PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" }, MILITARY("军事历史类图书", new String[][] { { PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" },
{ PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.AUDIO.name(), "1" } }), { PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.AUDIO.name(), "1" } }),
IMPORTED_HIGER("教材教辅类(高中)图书", new String[][] { { PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" }, IMPORTED_HIGER("教材教辅类(高中)图书",
new String[][] { { PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" },
{ PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.PDF.name(), "1" }, { PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.PDF.name(), "1" },
{ PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.PDF.name(), "2" } }), { PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.PDF.name(), "2" } }),
IMPORTED_SMALL("教材教辅类(小学初中)图书", new String[][] { { PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" }, IMPORTED_SMALL("教材教辅类(小学初中)图书",
new String[][] { { PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" },
{ PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.PDF.name(), "1" }, { PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.PDF.name(), "1" },
{ PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.PDF.name(), "2" } }), { PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.PDF.name(), "2" } }),
GERIATRIC("老年大学教材", new String[][] { { PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" }, GERIATRIC("老年大学教材",
new String[][] { { PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" },
{ PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.AUDIO.name(), "1" }, { PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.AUDIO.name(), "1" },
{ PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.VIDEO.name(), "1" } }), { PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.VIDEO.name(), "1" } }),
...@@ -51,7 +56,8 @@ public enum TempletCodeEnum { ...@@ -51,7 +56,8 @@ public enum TempletCodeEnum {
CELEBRITY("名人传记类图书", new String[][] { { PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" }, CELEBRITY("名人传记类图书", new String[][] { { PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" },
{ PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.ALBUM.name(), "1" } }), { PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.ALBUM.name(), "1" } }),
CHILD_PUFFIN("少儿读物类图书", new String[][] { { PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" }, CHILD_PUFFIN("少儿读物类图书",
new String[][] { { PcloudTypeEnum.APP.name(), AppTypeEnum.GROUP.name(), "1" },
{ PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.AUDIO.name(), "1" }, { PcloudTypeEnum.PRODUCT.name(), ProductTypeEnum.AUDIO.name(), "1" },
{ PcloudTypeEnum.APP.name(), AppTypeEnum.KK.name(), "1" } }), { PcloudTypeEnum.APP.name(), AppTypeEnum.KK.name(), "1" } }),
......
/**
*
*/
package com.pcloud.common.constant;
import com.pcloud.common.enums.AppTypeEnum;
/**
*
*
* @author:songx
* @date:2018年1月10日,下午2:58:42
*/
public class AppTypeConstant {
/**
* 含有销售价的应用(创建修改同步操作资源中心)
*/
public static final String[] PRICE_APP = {AppTypeEnum.TEACH_RESOURCE.value, AppTypeEnum.COURSE_WARE.value,
AppTypeEnum.STROKE_ORDER.value, AppTypeEnum.IMAGE.value, AppTypeEnum.RECITE_WORD.value};
/**
* 其它服务的含有销售价的应用
*/
public static final String[] REMOTE_PRICE_APP = {AppTypeEnum.MATCH_LISTEN.value, AppTypeEnum.WORD_DICTATION.value,
AppTypeEnum.ARTICLE_READING.value, AppTypeEnum.ENGLISH_WALKMAN.value, AppTypeEnum.ORAL_EVALUATION.value,
AppTypeEnum.PBSTORY.value};
}
package com.pcloud.common.enums;
/**
* 应用类型路由
*
* @Author: songx
* @Date: 2019/7/2,10:15
*/
public enum AppRouteEnum {
/**
* 一对一辅导
*/
CC("cc", AppTypeEnum.TUTOR.value),
/**
* 圈子
*/
GROUP("group", AppTypeEnum.GROUP.value),
/**
* 扫扫看
*/
KK("kk", AppTypeEnum.KK.value),
/**
* 专题
*/
ST("st", AppTypeEnum.SPECIAL.value),
/**
* 背单词
*/
WD("wd", AppTypeEnum.RECITE_WORD.value),
/**
* 数据采集/问卷调查
*/
QN("qn", AppTypeEnum.DA.value),
/**
* 报名
*/
REPLY_SCENE("mt", AppTypeEnum.BM.value),
/**
* 投票
*/
VT("vt", AppTypeEnum.VOTE.value),
/**
* 题库
*/
PRETEST("pretest", AppTypeEnum.ITEM_BANK.value),
/**
* 标准分
*/
ZSCORE("zscore", AppTypeEnum.ZSCORE.value),
/**
* 读书卡片
*/
BOOKCARD("card", AppTypeEnum.BOOKCARD.value),
/**
* 教育表格
*/
TB("tb", AppTypeEnum.EF.value),
/**
* 直播
*/
LIVE("live", AppTypeEnum.LIVE_TIMETABLE.value),
/**
* 打卡
*/
CLOCK("clock", AppTypeEnum.CLOCK.value),
/**
* 伴读魔法箱
*/
AUDIO_MAGIC("magic", AppTypeEnum.AUDIO_MAGIC.value),
/**
* 课件
*/
COURSE_WARE("cw", AppTypeEnum.COURSE_WARE.value),
/**
* 读者反馈
*/
NAIRE("qn", AppTypeEnum.NAIRE.value),
/**
* 互动墙
*/
INTERACT("interact", AppTypeEnum.INTERACT.value),
/**
* 抽奖
*/
DRAW("luck", AppTypeEnum.DRAW.value),
/**
* 教辅资料包
*/
TEACH_RESOURCE("tr", AppTypeEnum.TEACH_RESOURCE.value),
/**
* 测试工具
*/
TEST("tt", AppTypeEnum.TEST.value),
/**
* 愿望单
*/
WISH("wish", AppTypeEnum.WISH.value),
/**
* 笔顺动图
*/
STROKE_ORDER("pen", AppTypeEnum.STROKE_ORDER.value),
/**
* 生词听写
*/
WORD_DICTATION("dictation", AppTypeEnum.WORD_DICTATION.value),
/**
* 配套听力
*/
MATCH_LISTEN("mv", AppTypeEnum.MATCH_LISTEN.value),
/**
* 开通会员
*/
MEMBER("member", AppTypeEnum.MEMBER.value),
/**
* 课文诵读
*/
ARTICLE_READING("ar", AppTypeEnum.ARTICLE_READING.value),
/**
* 英语随身听
*/
ENGLISH_WALKMAN("wm", AppTypeEnum.ENGLISH_WALKMAN.value),
/**
* 口语评测
*/
ORAL_EVALUATION("speak", AppTypeEnum.ORAL_EVALUATION.value),
/**
* 绘本故事
*/
PBSTORY("pbstory", AppTypeEnum.PBSTORY.value),
/**
* 错题本
*/
SUBJECTNOTE("subject", AppTypeEnum.SUBJECTNOTE.value);
/**
* 值
*/
public final String value;
/**
* 对应的类型编码
*/
public String typeCode;
/**
* 构造
*
* @param value
*/
private AppRouteEnum(String value, String typeCode) {
this.value = value;
this.typeCode = typeCode;
}
}
...@@ -15,64 +15,78 @@ import com.google.common.collect.Maps; ...@@ -15,64 +15,78 @@ import com.google.common.collect.Maps;
*/ */
public enum AppTypeEnum { public enum AppTypeEnum {
MASTER("MASTER"), // 主应用 /**
RECOMMEND("RECOMMEND"), // 推荐应用 * 应用分类
CHARGE("CHARGE"), // 付费应用 */
MASTER("MASTER", "主应用"),
RECOMMEND("RECOMMEND", "推荐应用"),
CHARGE("CHARGE", "付费应用"),
ARTICLE("ARTICLE"), // 文章 ARTICLE("ARTICLE", "文章"),
KK("KK"), // 看一看 KK("KK", " 看一看"),
LIVE("LIVE"), // 直播 LIVE("LIVE", "直播"),
VOTE("VOTE"), // 投票 VOTE("VOTE", "投票"),
ENROLL("ENROLL"), // 编创赛报名 ENROLL("ENROLL", "编创赛报名"),
BM("BM"), // 报名 BM("BM", "报名"),
NAIRE("NAIRE"), // 问卷调查 NAIRE("NAIRE", "问卷调查"),
DA("DA"), // 数据采集 BOOKCARD("BOOKCARD", "读书卡片"),
BOOKCARD("BOOKCARD"), // 读书卡片 TUTOR("TUTOR", "一对一辅导"),
TUTOR("TUTOR"), // 一对一辅导
GROUP("GROUP"), // 与你同行(圈子)(add by gaop at 2017-6-13 16:52:07) /**
ITEM_BANK("ITEM_BANK"), // 题库 * 该类型应用已删除
VOICE_MSG("VOICE_MSG"), // 语音留言 */
AUDIO("AUDIO"), // 音频 DA("DA", "数据采集"),
VIDEO("VIDEO"), // 视频
IMAGE("IMAGE"), // 图片
PDF("PDF"), // PDF
BOOK("BOOK"), // 图书
EF("EF"), // 教育表格
QA("QA"), // 问答
LISTEN("LISTEN"), // 听力
ANSWER("ANSWER"), // 答案
ACTIVITY("ACTIVITY"), // 分享互动
ZSCORE("ZSCORE"), // 标准分
RECITE_WORD("RECITE_WORD"), // 背单词
INTERACT("INTERACT"), // 互动墙
SPECIAL("SPECIAL"), // 专题
CLOCK("CLOCK"), // 打卡
TEST("TEST"), // 趣味测试(测试工具)
EBOOK("EBOOK"), // 电子书
LIVE_TIMETABLE("LIVE_TIMETABLE"), // 直播课表
DRAW("DRAW"), // 抽奖
WISH("WISH"),// 愿望单
LIVEAPP("LIVEAPP"), //直播3.0
TASTETEST("TASTETEST"), //趣味测试
VIDEO_CLASSIC("VIDEO_CLASSIC"), //经典版视频
AUDIO_MAGIC("AUDIO_MAGIC"), //音频伴读魔法箱
TEACH_RESOURCE("TEACH_RESOURCE"), //教辅资料包
COURSE_WARE("COURSE_WARE"), //课件
TEST_PAPER("TEST_PAPER"), //试卷
MATCH_LISTEN("MATCH_LISTEN"), //配套听力
WORD_DICTATION("WORD_DICTATION"), //生词听写
STROKE_ORDER("STROKE_ORDER"), //笔顺动图
ARTICLE_READING("ARTICLE_READING"), //课文诵读
ENGLISH_WALKMAN("ENGLISH_WALKMAN"), //英语随身听
WECHAT_STUDY_GROUP("WECHAT_STUDY_GROUP"), // 微信学习交流圈
TASK_CLOCK("TASK_CLOCK"), //任务打卡
REWARD_CLOCK("REWARD_CLOCK"), //奖励打卡
CUSTOM_CLOCK("CUSTOM_CLOCK"), //自定义打卡
MEMBER("MEMBER"), //开通会员
ORAL_EVALUATION("ORAL_EVALUATION"), //口语评测
PBSTORY("PBSTORY"), //绘本故事
SUBJECTNOTE("SUBJECTNOTE"); // 错题本 /**
* add by gaop at 2017-6-13 16:52:07
*/
GROUP("GROUP", "与你同行(圈子)"),
ITEM_BANK("ITEM_BANK", "题库"),
VOICE_MSG("VOICE_MSG", "语音留言"),
AUDIO("AUDIO", "音频"),
VIDEO("VIDEO", "视频"),
IMAGE("IMAGE", "图片"),
PDF("PDF", "PDF"),
BOOK("BOOK", "图书"),
EF("EF", "教育表格"),
QA("QA", "问答"),
LISTEN("LISTEN", "听力"),
ANSWER("ANSWER", "答案"),
ACTIVITY("ACTIVITY", "分享互动"),
ZSCORE("ZSCORE", "标准分"),
RECITE_WORD("RECITE_WORD", "背单词"),
INTERACT("INTERACT", "互动墙"),
SPECIAL("SPECIAL", "专题"),
CLOCK("CLOCK", "打卡"),
TEST("TEST", "趣味测试(测试工具)"),
EBOOK("EBOOK", "电子书"),
LIVE_TIMETABLE("LIVE_TIMETABLE", "直播课表"),
DRAW("DRAW", "抽奖"),
WISH("WISH", "愿望单"),
LIVEAPP("LIVEAPP", "直播3.0"),
TASTETEST("TASTETEST", "趣味测试"),
VIDEO_CLASSIC("VIDEO_CLASSIC", "经典版视频"),
AUDIO_MAGIC("AUDIO_MAGIC", "音频伴读魔法箱"),
TEACH_RESOURCE("TEACH_RESOURCE", "教辅资料包"),
COURSE_WARE("COURSE_WARE", "课件"),
TEST_PAPER("TEST_PAPER", "试卷"),
MATCH_LISTEN("MATCH_LISTEN", "配套听力"),
WORD_DICTATION("WORD_DICTATION", "生词听写"),
STROKE_ORDER("STROKE_ORDER", "笔顺动图"),
ARTICLE_READING("ARTICLE_READING", "课文诵读"),
ENGLISH_WALKMAN("ENGLISH_WALKMAN", "英语随身听"),
WECHAT_STUDY_GROUP("WECHAT_STUDY_GROUP", "微信学习交流圈"),
TASK_CLOCK("TASK_CLOCK", "任务打卡"),
REWARD_CLOCK("REWARD_CLOCK", "奖励打卡"),
CUSTOM_CLOCK("CUSTOM_CLOCK", "自定义打卡"),
MEMBER("MEMBER", "开通会员"),
ORAL_EVALUATION("ORAL_EVALUATION", "口语评测"),
PBSTORY("PBSTORY", "绘本故事"),
/**
* add by songx at 2019-5-25 16:52:07
*/
SUBJECTNOTE("SUBJECTNOTE", "错题本");
/** /**
* 枚举转换 * 枚举转换
...@@ -91,12 +105,22 @@ public enum AppTypeEnum { ...@@ -91,12 +105,22 @@ public enum AppTypeEnum {
public final String value; public final String value;
/** /**
* 名称
*/
public final String name;
/**
* 构造 * 构造
* *
* @param value * @param value
*/ */
private AppTypeEnum(String value) { private AppTypeEnum(String value, String name) {
this.value = value; this.value = value;
this.name = name;
}
public static void main(String[] args) {
System.out.println(AppTypeEnum.valueOf("SUBJECTNOTE"));
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment