瀏覽代碼

Merge branch 'branch_other' 2

deason 5 年之前
父節點
當前提交
07ac3286ff
共有 27 個文件被更改,包括 1185 次插入0 次删除
  1. 12 0
      src/main/java/cn/com/qmth/examcloud/api/commons/CloudService.java
  2. 14 0
      src/main/java/cn/com/qmth/examcloud/api/commons/EnterpriseService.java
  3. 14 0
      src/main/java/cn/com/qmth/examcloud/api/commons/enums/BasicDataType.java
  4. 44 0
      src/main/java/cn/com/qmth/examcloud/api/commons/enums/BooleanSelect.java
  5. 37 0
      src/main/java/cn/com/qmth/examcloud/api/commons/enums/CURD.java
  6. 50 0
      src/main/java/cn/com/qmth/examcloud/api/commons/enums/CourseLevel.java
  7. 27 0
      src/main/java/cn/com/qmth/examcloud/api/commons/enums/ExamSpecialSettingsType.java
  8. 39 0
      src/main/java/cn/com/qmth/examcloud/api/commons/enums/ExamType.java
  9. 8 0
      src/main/java/cn/com/qmth/examcloud/api/commons/enums/Gender.java
  10. 32 0
      src/main/java/cn/com/qmth/examcloud/api/commons/enums/NoticeReceiverRuleType.java
  11. 30 0
      src/main/java/cn/com/qmth/examcloud/api/commons/enums/NoticeStatus.java
  12. 32 0
      src/main/java/cn/com/qmth/examcloud/api/commons/enums/PrivilegeGroupType.java
  13. 13 0
      src/main/java/cn/com/qmth/examcloud/api/commons/exchange/BaseRequest.java
  14. 29 0
      src/main/java/cn/com/qmth/examcloud/api/commons/exchange/BaseResponse.java
  15. 23 0
      src/main/java/cn/com/qmth/examcloud/api/commons/exchange/EnterpriseRequest.java
  16. 23 0
      src/main/java/cn/com/qmth/examcloud/api/commons/exchange/EnterpriseResponse.java
  17. 13 0
      src/main/java/cn/com/qmth/examcloud/api/commons/exchange/ExchangeBean.java
  18. 58 0
      src/main/java/cn/com/qmth/examcloud/api/commons/exchange/FormFilePart.java
  19. 29 0
      src/main/java/cn/com/qmth/examcloud/api/commons/exchange/FormRequest.java
  20. 16 0
      src/main/java/cn/com/qmth/examcloud/api/commons/exchange/JsonSerializable.java
  21. 136 0
      src/main/java/cn/com/qmth/examcloud/api/commons/exchange/PageInfo.java
  22. 66 0
      src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/AccessApp.java
  23. 64 0
      src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/Role.java
  24. 187 0
      src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/User.java
  25. 59 0
      src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/UserType.java
  26. 81 0
      src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/WebSocketSession.java
  27. 49 0
      src/main/java/cn/com/qmth/examcloud/api/commons/security/enums/RoleMeta.java

+ 12 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/CloudService.java

@@ -0,0 +1,12 @@
+package cn.com.qmth.examcloud.api.commons;
+
+import java.io.Serializable;
+
+/**
+ * 云服务顶级接口
+ *
+ * @author WANGWEI
+ */
+public interface CloudService extends Serializable {
+
+}

+ 14 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/EnterpriseService.java

@@ -0,0 +1,14 @@
+package cn.com.qmth.examcloud.api.commons;
+
+import java.io.Serializable;
+
+/**
+ * 对外服务接口
+ *
+ * @author WANGWEI
+ * @date 2018年6月29日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public interface EnterpriseService extends Serializable {
+
+}

+ 14 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/enums/BasicDataType.java

@@ -0,0 +1,14 @@
+package cn.com.qmth.examcloud.api.commons.enums;
+
+/**
+ * 基础数据类型
+ *
+ * @author WANGWEI
+ * @date 2019年2月14日
+ * @Copyright (c) 2018-2020 http://www.qmth.com.cn/ All Rights Reserved.
+ */
+public enum BasicDataType {
+
+	STRING, INTEGER, BOOLEAN, LONG, DATE;
+
+}

+ 44 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/enums/BooleanSelect.java

@@ -0,0 +1,44 @@
+package cn.com.qmth.examcloud.api.commons.enums;
+
+/**
+ * 页面boolean选择
+ *
+ * @author WANGWEI
+ * @date 2018年12月24日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public enum BooleanSelect {
+
+	/**
+	 * 未指定
+	 */
+	UNDEFINED,
+
+	/**
+	 * true
+	 */
+	TRUE,
+
+	/**
+	 * false
+	 */
+	FALSE;
+
+	/**
+	 * 获取boolean
+	 *
+	 * @author WANGWEI
+	 * @param value
+	 * @return
+	 */
+	public Boolean getBoolean() {
+		if (UNDEFINED.equals(this)) {
+			return null;
+		} else if (TRUE.equals(this)) {
+			return true;
+		} else {
+			return false;
+		}
+	}
+
+}

+ 37 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/enums/CURD.java

@@ -0,0 +1,37 @@
+package cn.com.qmth.examcloud.api.commons.enums;
+
+/**
+ * 数据库操作
+ *
+ * @author WANGWEI
+ * @date 2018年11月7日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public enum CURD {
+
+	/**
+	 * 创建
+	 */
+	CREATION,
+
+	/**
+	 * 更新
+	 */
+	UPDATE,
+
+	/**
+	 * 创建或更新
+	 */
+	CREATION_OR_UPDATE,
+
+	/**
+	 * 获取
+	 */
+	RETRIEVE,
+
+	/**
+	 * 删除
+	 */
+	DELETE
+
+}

+ 50 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/enums/CourseLevel.java

@@ -0,0 +1,50 @@
+package cn.com.qmth.examcloud.api.commons.enums;
+
+/**
+ * 重新定义
+ *
+ * @author WANGWEI
+ * @date 2018年7月10日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public enum CourseLevel {
+
+	ZSB("专升本"),
+
+	GQZ("高起专"),
+
+	GQB("高起本"),
+
+	ALL("不限");
+
+	private String name;
+
+	private CourseLevel(String name) {
+		this.name = name;
+	}
+
+	public String getName() {
+		return this.name;
+	}
+
+	/**
+	 * 混合查询
+	 *
+	 * @author WANGWEI
+	 * @param name
+	 * @return
+	 */
+	public static CourseLevel getCourseLevel(String name) {
+		for (CourseLevel cur : CourseLevel.values()) {
+			if (name.equals(cur.getName())) {
+				return cur;
+			}
+			if (name.equals(cur.name())) {
+				return cur;
+			}
+		}
+
+		throw new RuntimeException("level name is wong");
+	}
+
+}

+ 27 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/enums/ExamSpecialSettingsType.java

@@ -0,0 +1,27 @@
+package cn.com.qmth.examcloud.api.commons.enums;
+
+/**
+ * 考试特殊设置类型
+ *
+ * @author WANGWEI
+ * @date 2019年10月23日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public enum ExamSpecialSettingsType {
+
+	/**
+	 * 机构维度
+	 */
+	ORG_BASED,
+
+	/**
+	 * 学生维度
+	 */
+	STUDENT_BASED,
+
+	/**
+	 * 课程维度
+	 */
+	COURSE_BASED
+
+}

+ 39 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/enums/ExamType.java

@@ -0,0 +1,39 @@
+package cn.com.qmth.examcloud.api.commons.enums;
+
+/**
+ * 
+ * @Description: 考试类型
+ * @author ting.yin
+ * @date 2017年1月5日
+ */
+public enum ExamType {
+	/**
+	 * 传统
+	 */
+	TRADITION,
+
+	/**
+	 * 网考
+	 */
+	ONLINE,
+
+	/**
+	 * 练习
+	 */
+	PRACTICE,
+
+	/**
+	 * 离线
+	 */
+	OFFLINE,
+
+	/**
+	 * 分布式印刷考试
+	 */
+	PRINT_EXAM,
+
+	/**
+	 * 在线作业
+	 */
+	ONLINE_HOMEWORK
+}

+ 8 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/enums/Gender.java

@@ -0,0 +1,8 @@
+package cn.com.qmth.examcloud.api.commons.enums;
+
+/**
+ * Created by songyue on 17/2/22.
+ */
+public enum Gender {
+    MAN,WOMAN
+}

+ 32 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/enums/NoticeReceiverRuleType.java

@@ -0,0 +1,32 @@
+package cn.com.qmth.examcloud.api.commons.enums;
+
+/**
+ * 公告接受规则类型
+ *
+ * @author WANGWEI
+ * @date 2019年6月27日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public enum NoticeReceiverRuleType {
+
+	/**
+	 * 归属考试的考生
+	 */
+	STUDENTS_OF_EXAM,
+
+	/**
+	 * 顶级机构下所有学生
+	 */
+	ALL_STUDENTS_OF_ROOT_ORG,
+
+	/**
+	 * 拥有角色的用户
+	 */
+	COMMON_USERS_OF_ROLE,
+
+	/**
+	 * 阅卷工作的老师
+	 */
+	TEACHER_OF_MARK_WORK
+
+}

+ 30 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/enums/NoticeStatus.java

@@ -0,0 +1,30 @@
+package cn.com.qmth.examcloud.api.commons.enums;
+
+/**
+ * 公告状态
+ *
+ * @author WANGWEI
+ * @date 2019年6月27日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public enum NoticeStatus {
+
+	/**
+	 * 草稿
+	 */
+	DRAFT,
+
+	/**
+	 * 待发布
+	 */
+	TO_BE_PUBLISHED,
+	/**
+	 * 发布中
+	 */
+	PUBLISHING,
+	/**
+	 * 已发布
+	 */
+	PUBLISHED
+
+}

+ 32 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/enums/PrivilegeGroupType.java

@@ -0,0 +1,32 @@
+package cn.com.qmth.examcloud.api.commons.enums;
+
+/**
+ * 权限组类型
+ *
+ * @author WANGWEI
+ * @date 2020年2月14日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public enum PrivilegeGroupType {
+
+	/**
+	 * 菜单
+	 */
+	ADMIN_MENU,
+
+	/**
+	 * 功能
+	 */
+	FUNCTION,
+
+	/**
+	 * 数据权限
+	 */
+	DATA_ACCESS,
+
+	/**
+	 * 学生端菜单
+	 */
+	STUDENT_CLIENT_MENU
+
+}

+ 13 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/exchange/BaseRequest.java

@@ -0,0 +1,13 @@
+package cn.com.qmth.examcloud.api.commons.exchange;
+
+/**
+ * 请求体基类
+ * 
+ * @author WANGWEI
+ *
+ */
+public abstract class BaseRequest extends ExchangeBean {
+
+	private static final long serialVersionUID = 6465330136225230063L;
+
+}

+ 29 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/exchange/BaseResponse.java

@@ -0,0 +1,29 @@
+package cn.com.qmth.examcloud.api.commons.exchange;
+
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 响应体基类
+ * 
+ * @author WANGWEI
+ *
+ */
+public abstract class BaseResponse extends ExchangeBean {
+
+	private static final long serialVersionUID = 1755304211766414171L;
+
+	/**
+	 * 耗时(毫秒)
+	 */
+	@ApiModelProperty(value = "耗时(毫秒)", example = "500", required = true)
+	private Long cost;
+
+	public Long getCost() {
+		return cost;
+	}
+
+	public void setCost(Long cost) {
+		this.cost = cost;
+	}
+
+}

+ 23 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/exchange/EnterpriseRequest.java

@@ -0,0 +1,23 @@
+package cn.com.qmth.examcloud.api.commons.exchange;
+
+import io.swagger.annotations.ApiModelProperty;
+
+public class EnterpriseRequest extends BaseRequest {
+
+	private static final long serialVersionUID = -7805477355173448066L;
+
+	@Deprecated
+	@ApiModelProperty(value = "废弃字段", example = "", required = false)
+	private String des;
+
+	@Deprecated
+	public String getDes() {
+		return des;
+	}
+
+	@Deprecated
+	public void setDes(String des) {
+		this.des = des;
+	}
+
+}

+ 23 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/exchange/EnterpriseResponse.java

@@ -0,0 +1,23 @@
+package cn.com.qmth.examcloud.api.commons.exchange;
+
+import io.swagger.annotations.ApiModelProperty;
+
+public class EnterpriseResponse extends BaseResponse {
+
+	private static final long serialVersionUID = 1317937489317321732L;
+
+	@Deprecated
+	@ApiModelProperty(value = "废弃字段", example = "", required = false)
+	private String des;
+
+	@Deprecated
+	public String getDes() {
+		return des;
+	}
+
+	@Deprecated
+	public void setDes(String des) {
+		this.des = des;
+	}
+
+}

+ 13 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/exchange/ExchangeBean.java

@@ -0,0 +1,13 @@
+package cn.com.qmth.examcloud.api.commons.exchange;
+
+/**
+ * bean 基类
+ * 
+ * @author WANGWEI
+ *
+ */
+public abstract class ExchangeBean implements JsonSerializable {
+
+	private static final long serialVersionUID = 3913250969569367810L;
+
+}

+ 58 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/exchange/FormFilePart.java

@@ -0,0 +1,58 @@
+package cn.com.qmth.examcloud.api.commons.exchange;
+
+import java.io.File;
+
+/**
+ * 表单文件参数
+ *
+ * @author WANGWEI
+ * @date 2019年5月9日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class FormFilePart {
+
+	private String paramName;
+
+	private String filename;
+
+	private File file;
+
+	/**
+	 * 构造函数
+	 *
+	 * @param paramName
+	 * @param filename
+	 * @param file
+	 */
+	public FormFilePart(String paramName, String filename, File file) {
+		super();
+		this.paramName = paramName;
+		this.filename = filename;
+		this.file = file;
+	}
+
+	public String getParamName() {
+		return paramName;
+	}
+
+	public void setParamName(String paramName) {
+		this.paramName = paramName;
+	}
+
+	public String getFilename() {
+		return filename;
+	}
+
+	public void setFilename(String filename) {
+		this.filename = filename;
+	}
+
+	public File getFile() {
+		return file;
+	}
+
+	public void setFile(File file) {
+		this.file = file;
+	}
+
+}

+ 29 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/exchange/FormRequest.java

@@ -0,0 +1,29 @@
+package cn.com.qmth.examcloud.api.commons.exchange;
+
+import java.util.List;
+
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 表单请求
+ *
+ * @author WANGWEI
+ * @date 2019年5月7日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class FormRequest extends BaseRequest {
+
+	private static final long serialVersionUID = 1201394717322230917L;
+
+	@ApiModelProperty(value = "文件参数集合", required = false)
+	private transient List<FormFilePart> formFilePartList;
+
+	public List<FormFilePart> getFormFilePartList() {
+		return formFilePartList;
+	}
+
+	public void setFormFilePartList(List<FormFilePart> formFilePartList) {
+		this.formFilePartList = formFilePartList;
+	}
+
+}

+ 16 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/exchange/JsonSerializable.java

@@ -0,0 +1,16 @@
+package cn.com.qmth.examcloud.api.commons.exchange;
+
+import java.io.Serializable;
+
+/**
+ * 可序列化为JSON<br>
+ * <p>
+ * 严重警告: 此接口为标识接口,禁止添加属性和方法. by wangwei
+ * </p>
+ * 
+ * @author WANGWEI
+ *
+ */
+public interface JsonSerializable extends Serializable {
+
+}

+ 136 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/exchange/PageInfo.java

@@ -0,0 +1,136 @@
+package cn.com.qmth.examcloud.api.commons.exchange;
+
+import java.io.Serializable;
+import java.util.List;
+
+import org.springframework.data.domain.Page;
+
+/**
+ * 分页
+ *
+ * @author WANGWEI
+ * @date 2018年6月25日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ * @param <T>
+ */
+public class PageInfo<T> implements Serializable {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 当前页码
+	 */
+	private long index = 1;
+
+	/**
+	 * 每页的数量限制
+	 */
+	private long limit = 10;
+
+	/**
+	 * 当前页的数量
+	 */
+	private long size;
+
+	/**
+	 * 总记录数
+	 */
+	private long total;
+
+	/**
+	 * 总页数
+	 */
+	private long pages;
+
+	/**
+	 * 结果集
+	 */
+	private List<T> list;
+
+	/**
+	 * 构造函数
+	 *
+	 */
+	public PageInfo() {
+
+	}
+
+	/**
+	 * 构造函数
+	 *
+	 * @param page
+	 */
+	public PageInfo(Page<T> page) {
+		this.total = page.getTotalElements();
+		this.pages = page.getTotalPages();
+		this.index = page.getNumber();
+		this.size = page.getNumberOfElements();
+		this.limit = page.getSize();
+
+		this.list = page.getContent();
+	}
+
+	/**
+	 * 构造函数
+	 *
+	 * @param page
+	 * @param list
+	 */
+	public PageInfo(Page<?> page, List<T> list) {
+		this.total = page.getTotalElements();
+		this.pages = page.getTotalPages();
+		this.index = page.getNumber();
+		this.size = page.getNumberOfElements();
+		this.limit = page.getSize();
+
+		this.list = list;
+	}
+
+	public long getIndex() {
+		return index;
+	}
+
+	public void setIndex(long index) {
+		this.index = index;
+	}
+
+	public long getLimit() {
+		return limit;
+	}
+
+	public void setLimit(long limit) {
+		this.limit = limit;
+	}
+
+	public long getSize() {
+		return size;
+	}
+
+	public void setSize(long size) {
+		this.size = size;
+	}
+
+	public long getTotal() {
+		return total;
+	}
+
+	public void setTotal(long total) {
+		this.total = total;
+	}
+
+	public long getPages() {
+		return pages;
+	}
+
+	public void setPages(long pages) {
+		this.pages = pages;
+	}
+
+	public List<T> getList() {
+		return list;
+	}
+
+	public void setList(List<T> list) {
+		this.list = list;
+	}
+
+}

+ 66 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/AccessApp.java

@@ -0,0 +1,66 @@
+package cn.com.qmth.examcloud.api.commons.security.bean;
+
+import cn.com.qmth.examcloud.api.commons.exchange.JsonSerializable;
+
+/**
+ * 接入的app
+ *
+ * @author WANGWEI
+ * @date 2019年1月28日
+ * @Copyright (c) 2018-2020 http://www.qmth.com.cn/ All Rights Reserved.
+ */
+public class AccessApp implements JsonSerializable {
+
+	private static final long serialVersionUID = 9193428318438074444L;
+
+	private Long appId;
+
+	private String appName;
+
+	private String appCode;
+
+	private String secretKey;
+
+	private Long timeRange;
+
+	public Long getAppId() {
+		return appId;
+	}
+
+	public void setAppId(Long appId) {
+		this.appId = appId;
+	}
+
+	public String getAppName() {
+		return appName;
+	}
+
+	public void setAppName(String appName) {
+		this.appName = appName;
+	}
+
+	public String getAppCode() {
+		return appCode;
+	}
+
+	public void setAppCode(String appCode) {
+		this.appCode = appCode;
+	}
+
+	public String getSecretKey() {
+		return secretKey;
+	}
+
+	public void setSecretKey(String secretKey) {
+		this.secretKey = secretKey;
+	}
+
+	public Long getTimeRange() {
+		return timeRange;
+	}
+
+	public void setTimeRange(Long timeRange) {
+		this.timeRange = timeRange;
+	}
+
+}

+ 64 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/Role.java

@@ -0,0 +1,64 @@
+package cn.com.qmth.examcloud.api.commons.security.bean;
+
+/**
+ * 角色
+ *
+ * @author WANGWEI
+ * @date 2018年5月23日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class Role {
+
+	private Long roleId;
+
+	private String roleCode;
+
+	private String roleName;
+
+	/**
+	 * 构造函数
+	 *
+	 */
+	public Role() {
+		super();
+	}
+
+	/**
+	 * 构造函数
+	 *
+	 * @param roleId
+	 * @param roleCode
+	 * @param roleName
+	 */
+	public Role(Long roleId, String roleCode, String roleName) {
+		super();
+		this.roleId = roleId;
+		this.roleCode = roleCode;
+		this.roleName = roleName;
+	}
+
+	public Long getRoleId() {
+		return roleId;
+	}
+
+	public void setRoleId(Long roleId) {
+		this.roleId = roleId;
+	}
+
+	public String getRoleCode() {
+		return roleCode;
+	}
+
+	public void setRoleCode(String roleCode) {
+		this.roleCode = roleCode;
+	}
+
+	public String getRoleName() {
+		return roleName;
+	}
+
+	public void setRoleName(String roleName) {
+		this.roleName = roleName;
+	}
+
+}

+ 187 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/User.java

@@ -0,0 +1,187 @@
+package cn.com.qmth.examcloud.api.commons.security.bean;
+
+import java.util.Date;
+import java.util.List;
+
+import cn.com.qmth.examcloud.api.commons.exchange.JsonSerializable;
+
+/**
+ * 用户
+ *
+ * @author WANGWEI
+ * @date 2018年5月22日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class User implements JsonSerializable {
+
+	private static final long serialVersionUID = 8766713125414955078L;
+
+	/**
+	 * 全局唯一用户标识符
+	 */
+	private String key;
+
+	/**
+	 * 用户类型
+	 */
+	private UserType userType;
+
+	/**
+	 * 用户ID(包含普通用户ID,学生用户ID)
+	 */
+	private Long userId;
+
+	/**
+	 * 显示名
+	 */
+	private String displayName;
+
+	/**
+	 * 顶级机构ID
+	 */
+	private Long rootOrgId;
+
+	/**
+	 * 顶级机构名称
+	 */
+	private String rootOrgName;
+
+	/**
+	 * 顶级机构域名
+	 */
+	private String rootOrgDomain;
+
+	/**
+	 * 创建时间
+	 */
+	private Date creationTime;
+
+	/**
+	 * 角色集合
+	 */
+	private List<Role> roleList;
+
+	/**
+	 * 客户端IP
+	 */
+	private String clientIp;
+
+	/**
+	 * 鉴权token
+	 */
+	private String token;
+
+	/**
+	 * 会话失效时长
+	 */
+	private Integer sessionTimeout;
+
+	/**
+	 * 构建key
+	 *
+	 * @author WANGWEI
+	 * @return
+	 */
+	public String buildKey() {
+		this.key = new StringBuilder().append("U_").append(userType.getCode()).append("_")
+				.append(rootOrgId).append("_").append(userId).toString();
+		return this.key;
+	}
+
+	public String getKey() {
+		return key;
+	}
+
+	public void setKey(String key) {
+		this.key = key;
+	}
+
+	public UserType getUserType() {
+		return userType;
+	}
+
+	public void setUserType(UserType userType) {
+		this.userType = userType;
+	}
+
+	public Long getUserId() {
+		return userId;
+	}
+
+	public void setUserId(Long userId) {
+		this.userId = userId;
+	}
+
+	public String getDisplayName() {
+		return displayName;
+	}
+
+	public void setDisplayName(String displayName) {
+		this.displayName = displayName;
+	}
+
+	public Long getRootOrgId() {
+		return rootOrgId;
+	}
+
+	public void setRootOrgId(Long rootOrgId) {
+		this.rootOrgId = rootOrgId;
+	}
+
+	public String getRootOrgName() {
+		return rootOrgName;
+	}
+
+	public void setRootOrgName(String rootOrgName) {
+		this.rootOrgName = rootOrgName;
+	}
+
+	public String getRootOrgDomain() {
+		return rootOrgDomain;
+	}
+
+	public void setRootOrgDomain(String rootOrgDomain) {
+		this.rootOrgDomain = rootOrgDomain;
+	}
+
+	public Date getCreationTime() {
+		return creationTime;
+	}
+
+	public void setCreationTime(Date creationTime) {
+		this.creationTime = creationTime;
+	}
+
+	public List<Role> getRoleList() {
+		return roleList;
+	}
+
+	public void setRoleList(List<Role> roleList) {
+		this.roleList = roleList;
+	}
+
+	public String getClientIp() {
+		return clientIp;
+	}
+
+	public void setClientIp(String clientIp) {
+		this.clientIp = clientIp;
+	}
+
+	public String getToken() {
+		return token;
+	}
+
+	public void setToken(String token) {
+		this.token = token;
+	}
+
+	public Integer getSessionTimeout() {
+		return sessionTimeout;
+	}
+
+	public void setSessionTimeout(Integer sessionTimeout) {
+		this.sessionTimeout = sessionTimeout;
+	}
+
+}

+ 59 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/UserType.java

@@ -0,0 +1,59 @@
+package cn.com.qmth.examcloud.api.commons.security.bean;
+
+/**
+ * 用户类型
+ *
+ * @author WANGWEI
+ * @date 2018年5月25日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public enum UserType {
+
+	/**
+	 * 学生
+	 */
+	STUDENT("S", "学生"),
+
+	/**
+	 * 常规用户
+	 */
+	COMMON("C", "常规用户");
+
+	// ===========================================================================
+
+	/**
+	 * 码
+	 */
+	private String code;
+
+	/**
+	 * 描述
+	 */
+	private String desc;
+
+	/**
+	 * 构造函数
+	 *
+	 * @param code
+	 * @param desc
+	 */
+	private UserType(String code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	/**
+	 * @return the code
+	 */
+	public String getCode() {
+		return code;
+	}
+
+	/**
+	 * @return the desc
+	 */
+	public String getDesc() {
+		return desc;
+	}
+
+}

+ 81 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/WebSocketSession.java

@@ -0,0 +1,81 @@
+package cn.com.qmth.examcloud.api.commons.security.bean;
+
+import cn.com.qmth.examcloud.api.commons.exchange.JsonSerializable;
+
+/**
+ * WebSocket Session
+ *
+ * @author WANGWEI
+ * @date 2019年11月22日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class WebSocketSession implements JsonSerializable {
+
+	private static final long serialVersionUID = 6657113738382557514L;
+
+	/**
+	 * session ID
+	 */
+	private String sessionId;
+
+	/**
+	 * 全局唯一用户标识符
+	 */
+	private String key;
+
+	/**
+	 * 鉴权token
+	 */
+	private String token;
+
+	/**
+	 * 应用名称
+	 */
+	private String appName;
+
+	/**
+	 * 会话失效时长
+	 */
+	private Integer sessionTimeout;
+
+	public String getSessionId() {
+		return sessionId;
+	}
+
+	public void setSessionId(String sessionId) {
+		this.sessionId = sessionId;
+	}
+
+	public String getKey() {
+		return key;
+	}
+
+	public void setKey(String key) {
+		this.key = key;
+	}
+
+	public String getToken() {
+		return token;
+	}
+
+	public void setToken(String token) {
+		this.token = token;
+	}
+
+	public String getAppName() {
+		return appName;
+	}
+
+	public void setAppName(String appName) {
+		this.appName = appName;
+	}
+
+	public Integer getSessionTimeout() {
+		return sessionTimeout;
+	}
+
+	public void setSessionTimeout(Integer sessionTimeout) {
+		this.sessionTimeout = sessionTimeout;
+	}
+
+}

+ 49 - 0
src/main/java/cn/com/qmth/examcloud/api/commons/security/enums/RoleMeta.java

@@ -0,0 +1,49 @@
+package cn.com.qmth.examcloud.api.commons.security.enums;
+
+/**
+ * Created by songyue on 17/2/24.
+ */
+public enum RoleMeta {
+
+	SUPER_ADMIN("超级管理员"),
+
+	ORG_ADMIN("机构管理员"),
+
+	LC_USER("学习中心用户"),
+
+	MARKING_ADMIN("阅卷管理员"),
+
+	MARKER("评卷员"),
+
+	QUESTION_ADMIN("题库管理员"),
+
+	OE_ADMIN("网考管理员"),
+
+	PRINT_SUPPLIER("印刷供应商"),
+
+	PRINT_SCHOOL_LEADER("印刷学校管理员"),
+
+	PRINT_SUPER_LEADER("印刷总负责人"),
+
+	PRINT_PROJECT_LEADER("项目经理"),
+
+	PRINT_LOCALE_LEADER("印刷现场负责人"),
+
+	PRINT_SALE_LEADER("销售负责人"),
+
+	PRINT_FINANCE_LEADER("财务负责人");
+
+	/**
+	 * 角色名
+	 */
+	private String name;
+
+	RoleMeta(String name) {
+		this.name = name;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+}