commit:支持app的纯后台服务

This commit is contained in:
Jerry
2020-10-29 18:55:12 +08:00
parent dd555d8bb1
commit c87fb476d6
185 changed files with 24073 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.orange.demo</groupId>
<artifactId>OrangeSingleDemo</artifactId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>application-common</artifactId>
<version>1.0.0</version>
<name>application-common</name>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.orange.demo</groupId>
<artifactId>common-core</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,49 @@
package com.orange.demo.application.common.constant;
import java.util.HashMap;
import java.util.Map;
/**
* 设备类型常量字典对象。
*
* @author Jerry
* @date 2020-09-24
*/
public final class DeviceType {
/**
* iOS。
*/
public static final int IOS = 0;
/**
* Android。
*/
public static final int ANDROID = 1;
/**
* PC。
*/
public static final int PC = 2;
private static final Map<Object, String> DICT_MAP = new HashMap<>(3);
static {
DICT_MAP.put(IOS, "iOS");
DICT_MAP.put(ANDROID, "Android");
DICT_MAP.put(PC, "PC");
}
/**
* 判断参数是否为当前常量字典的合法值。
*
* @param value 待验证的参数值。
* @return 合法返回true否则false。
*/
public static boolean isValid(Integer value) {
return value != null && DICT_MAP.containsKey(value);
}
/**
* 私有构造函数,明确标识该常量类的作用。
*/
private DeviceType() {
}
}

View File

@@ -0,0 +1,49 @@
package com.orange.demo.application.common.constant;
import java.util.HashMap;
import java.util.Map;
/**
* 经验等级常量字典对象。
*
* @author Jerry
* @date 2020-09-24
*/
public final class ExpLevel {
/**
* 初级学员。
*/
public static final int LOWER = 0;
/**
* 中级学员。
*/
public static final int MIDDLE = 1;
/**
* 高级学员。
*/
public static final int HIGH = 2;
private static final Map<Object, String> DICT_MAP = new HashMap<>(3);
static {
DICT_MAP.put(LOWER, "初级学员");
DICT_MAP.put(MIDDLE, "中级学员");
DICT_MAP.put(HIGH, "高级学员");
}
/**
* 判断参数是否为当前常量字典的合法值。
*
* @param value 待验证的参数值。
* @return 合法返回true否则false。
*/
public static boolean isValid(Integer value) {
return value != null && DICT_MAP.containsKey(value);
}
/**
* 私有构造函数,明确标识该常量类的作用。
*/
private ExpLevel() {
}
}

View File

@@ -0,0 +1,44 @@
package com.orange.demo.application.common.constant;
import java.util.HashMap;
import java.util.Map;
/**
* 性别常量字典对象。
*
* @author Jerry
* @date 2020-09-24
*/
public final class Gender {
/**
* 男。
*/
public static final int MALE = 1;
/**
* 女。
*/
public static final int FEMALE = 0;
private static final Map<Object, String> DICT_MAP = new HashMap<>(2);
static {
DICT_MAP.put(MALE, "");
DICT_MAP.put(FEMALE, "");
}
/**
* 判断参数是否为当前常量字典的合法值。
*
* @param value 待验证的参数值。
* @return 合法返回true否则false。
*/
public static boolean isValid(Integer value) {
return value != null && DICT_MAP.containsKey(value);
}
/**
* 私有构造函数,明确标识该常量类的作用。
*/
private Gender() {
}
}

View File

@@ -0,0 +1,89 @@
package com.orange.demo.application.common.constant;
import java.util.HashMap;
import java.util.Map;
/**
* 学生行为常量字典对象。
*
* @author Jerry
* @date 2020-09-24
*/
public final class StudentActionType {
/**
* 充值。
*/
public static final int RECHARGE = 0;
/**
* 购课。
*/
public static final int BUY_COURSE = 1;
/**
* 上课签到。
*/
public static final int SIGNIN_COURSE = 2;
/**
* 上课签退。
*/
public static final int SIGNOUT_COURSE = 3;
/**
* 看视频课。
*/
public static final int WATCH_VIDEO = 4;
/**
* 做作业。
*/
public static final int DO_PAPER = 5;
/**
* 刷题。
*/
public static final int REFRESH_EXERCISE = 6;
/**
* 献花。
*/
public static final int PRESENT_FLOWER = 7;
/**
* 购买视频。
*/
public static final int BUY_VIDEO_COURSE = 8;
/**
* 购买鲜花。
*/
public static final int BUY_FLOWER = 9;
/**
* 购买作业。
*/
public static final int BUY_PAPER = 10;
private static final Map<Object, String> DICT_MAP = new HashMap<>(11);
static {
DICT_MAP.put(RECHARGE, "充值");
DICT_MAP.put(BUY_COURSE, "购课");
DICT_MAP.put(SIGNIN_COURSE, "上课签到");
DICT_MAP.put(SIGNOUT_COURSE, "上课签退");
DICT_MAP.put(WATCH_VIDEO, "看视频课");
DICT_MAP.put(DO_PAPER, "做作业");
DICT_MAP.put(REFRESH_EXERCISE, "刷题");
DICT_MAP.put(PRESENT_FLOWER, "献花");
DICT_MAP.put(BUY_VIDEO_COURSE, "购买视频");
DICT_MAP.put(BUY_FLOWER, "购买鲜花");
DICT_MAP.put(BUY_PAPER, "购买作业");
}
/**
* 判断参数是否为当前常量字典的合法值。
*
* @param value 待验证的参数值。
* @return 合法返回true否则false。
*/
public static boolean isValid(Integer value) {
return value != null && DICT_MAP.containsKey(value);
}
/**
* 私有构造函数,明确标识该常量类的作用。
*/
private StudentActionType() {
}
}

View File

@@ -0,0 +1,49 @@
package com.orange.demo.application.common.constant;
import java.util.HashMap;
import java.util.Map;
/**
* 学生状态常量字典对象。
*
* @author Jerry
* @date 2020-09-24
*/
public final class StudentStatus {
/**
* 正常。
*/
public static final int NORMAL = 0;
/**
* 锁定。
*/
public static final int LOCKED = 1;
/**
* 注销。
*/
public static final int DELETED = 2;
private static final Map<Object, String> DICT_MAP = new HashMap<>(3);
static {
DICT_MAP.put(NORMAL, "正常");
DICT_MAP.put(LOCKED, "锁定");
DICT_MAP.put(DELETED, "注销");
}
/**
* 判断参数是否为当前常量字典的合法值。
*
* @param value 待验证的参数值。
* @return 合法返回true否则false。
*/
public static boolean isValid(Integer value) {
return value != null && DICT_MAP.containsKey(value);
}
/**
* 私有构造函数,明确标识该常量类的作用。
*/
private StudentStatus() {
}
}

View File

@@ -0,0 +1,49 @@
package com.orange.demo.application.common.constant;
import java.util.HashMap;
import java.util.Map;
/**
* 学科常量字典对象。
*
* @author Jerry
* @date 2020-09-24
*/
public final class Subject {
/**
* 语文。
*/
public static final int CHINESE = 0;
/**
* 数学。
*/
public static final int MATCH = 1;
/**
* 英语。
*/
public static final int ENGLISH = 2;
private static final Map<Object, String> DICT_MAP = new HashMap<>(3);
static {
DICT_MAP.put(CHINESE, "语文");
DICT_MAP.put(MATCH, "数学");
DICT_MAP.put(ENGLISH, "英语");
}
/**
* 判断参数是否为当前常量字典的合法值。
*
* @param value 待验证的参数值。
* @return 合法返回true否则false。
*/
public static boolean isValid(Integer value) {
return value != null && DICT_MAP.containsKey(value);
}
/**
* 私有构造函数,明确标识该常量类的作用。
*/
private Subject() {
}
}