Преглед изворни кода

Merge remote-tracking branch 'origin/release_v5.0.1'

deason пре 1 година
родитељ
комит
6414950c22
100 измењених фајлова са 2080 додато и 3446 уклоњено
  1. 0 53
      examcloud-api-commons/pom.xml
  2. 0 91
      examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/enums/AdminOperateType.java
  3. 0 44
      examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/enums/BooleanSelect.java
  4. 0 37
      examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/enums/CURD.java
  5. 0 50
      examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/enums/CourseLevel.java
  6. 0 39
      examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/enums/ExamType.java
  7. 0 32
      examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/enums/NoticeReceiverRuleType.java
  8. 0 34
      examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/enums/NoticeStatus.java
  9. 0 29
      examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/exchange/BaseResponse.java
  10. 0 23
      examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/exchange/EnterpriseRequest.java
  11. 0 23
      examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/exchange/EnterpriseResponse.java
  12. 0 58
      examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/exchange/FormFilePart.java
  13. 0 29
      examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/exchange/FormRequest.java
  14. 0 136
      examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/exchange/PageInfo.java
  15. 0 66
      examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/AccessApp.java
  16. 0 64
      examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/Role.java
  17. 0 59
      examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/UserType.java
  18. 0 81
      examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/WebSocketSession.java
  19. 29 0
      examcloud-common-models/pom.xml
  20. 0 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/CloudService.java
  21. 0 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/EnterpriseService.java
  22. 91 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/AdminOperateType.java
  23. 1 1
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/BasicDataType.java
  24. 44 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/BooleanSelect.java
  25. 37 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/CURD.java
  26. 19 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/CallType.java
  27. 50 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/CourseLevel.java
  28. 0 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/DataRuleType.java
  29. 16 16
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/ExamSpecialSettingsType.java
  30. 8 8
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/ExamStageStartExamStatus.java
  31. 61 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/ExamType.java
  32. 0 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/FaceApiProvider.java
  33. 1 1
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/Gender.java
  34. 32 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/NoticeReceiverRuleType.java
  35. 34 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/NoticeStatus.java
  36. 16 16
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/PrivilegeGroupType.java
  37. 8 8
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/SubmitType.java
  38. 2 3
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/exchange/BaseRequest.java
  39. 28 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/exchange/BaseResponse.java
  40. 23 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/exchange/EnterpriseRequest.java
  41. 23 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/exchange/EnterpriseResponse.java
  42. 2 3
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/exchange/ExchangeBean.java
  43. 58 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/exchange/FormFilePart.java
  44. 29 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/exchange/FormRequest.java
  45. 1 2
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/exchange/JsonSerializable.java
  46. 103 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/exchange/PageInfo.java
  47. 66 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/AccessApp.java
  48. 63 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/Role.java
  49. 3 14
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/User.java
  50. 0 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/UserDataRule.java
  51. 59 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/UserType.java
  52. 81 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/WebSocketSession.java
  53. 0 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/security/enums/RoleMeta.java
  54. 68 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/question/commons/core/paper/DefaultPaper.java
  55. 56 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/question/commons/core/paper/DefaultQuestionGroup.java
  56. 109 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/question/commons/core/paper/DefaultQuestionStructureWrapper.java
  57. 71 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/question/commons/core/paper/DefaultQuestionUnitWrapper.java
  58. 57 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/question/commons/core/question/AnswerType.java
  59. 82 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/question/commons/core/question/DefaultQuestion.java
  60. 11 11
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/question/commons/core/question/DefaultQuestionOption.java
  61. 69 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/question/commons/core/question/DefaultQuestionStructure.java
  62. 82 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/question/commons/core/question/DefaultQuestionUnit.java
  63. 0 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/question/commons/core/question/QuestionType.java
  64. 407 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/CacheConstants.java
  65. 25 89
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/Constants.java
  66. 0 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/BlockType.java
  67. 0 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/DataCategory.java
  68. 0 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/DbType.java
  69. 6 2
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/ExamProcess.java
  70. 0 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/ExamProperties.java
  71. 1 1
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/ExamRecordStatus.java
  72. 0 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/FaceBiopsyScheme.java
  73. 0 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/FileAnswerAcknowledgeStatus.java
  74. 0 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/HandInExamType.java
  75. 48 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/IsSuccess.java
  76. 0 0
      examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/SyncStatus.java
  77. 0 216
      examcloud-commons/pom.xml
  78. 0 50
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/exception/ExamCloudRuntimeException.java
  79. 0 87
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/exception/StatusException.java
  80. 0 63
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/BlackHolePrintStreamBuilder.java
  81. 0 79
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/Counter.java
  82. 0 109
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/DynamicEnum.java
  83. 0 145
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/DynamicEnumManager.java
  84. 0 134
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/FileChangeWatchdog.java
  85. 0 58
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/FormFilePart.java
  86. 0 44
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/JsonHttpResponseHolder.java
  87. 0 52
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/KeyValuePair.java
  88. 0 46
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/ObjectHolder.java
  89. 0 98
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/XStreamBuilder.java
  90. 0 205
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/concurrency/simple/ConcurrentTask.java
  91. 0 27
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/concurrency/simple/WorkerController.java
  92. 0 43
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/pipeline/Counter.java
  93. 0 59
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/pipeline/Node.java
  94. 0 40
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/pipeline/Storer.java
  95. 0 34
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/pipeline/TaskContext.java
  96. 0 185
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/poi/ExcelReader.java
  97. 0 137
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/poi/ExcelWriter.java
  98. 0 224
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/poi/XlsxHandler.java
  99. 0 110
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/logging/ExamCloudLog.java
  100. 0 78
      examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/logging/ExamCloudLogFactory.java

+ 0 - 53
examcloud-api-commons/pom.xml

@@ -1,53 +0,0 @@
-<?xml version="1.0"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
-         xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>examcloud-api-commons</artifactId>
-    <packaging>jar</packaging>
-
-    <parent>
-        <groupId>cn.com.qmth.examcloud</groupId>
-        <artifactId>examcloud-components</artifactId>
-        <version>${revision}</version>
-    </parent>
-
-    <dependencies>
-        <dependency>
-            <groupId>io.swagger</groupId>
-            <artifactId>swagger-annotations</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>javax.validation</groupId>
-            <artifactId>validation-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.hibernate.validator</groupId>
-            <artifactId>hibernate-validator</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.google.code.gson</groupId>
-            <artifactId>gson</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.data</groupId>
-            <artifactId>spring-data-commons</artifactId>
-            <exclusions>
-                <exclusion>
-                    <groupId>*</groupId>
-                    <artifactId>*</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-web</artifactId>
-            <exclusions>
-                <exclusion>
-                    <groupId>*</groupId>
-                    <artifactId>*</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-    </dependencies>
-
-</project>

+ 0 - 91
examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/enums/AdminOperateType.java

@@ -1,91 +0,0 @@
-package cn.com.qmth.examcloud.api.commons.enums;
-
-public enum AdminOperateType {
-	TYPE1("考生端配置-保存考生端配置"),
-	TYPE2("考生端配置-上传学校logo"),
-	TYPE3("考生端配置-上传考生端登录界面图片"),
-	TYPE4("考生端配置-上传学校答题纸模板"),
-	TYPE5("考生端配置-上传菜单logo"),
-	
-	TYPE6("普通用户管理-新增用户"),
-	TYPE7("普通用户管理-修改用户"),
-	TYPE8("普通用户管理-重置用户密码"),
-	TYPE9("普通用户管理-批量重置用户密码"),
-	TYPE10("普通用户管理-启用用户"),
-	TYPE11("普通用户管理-禁用用户"),
-	TYPE12("普通用户管理-权限复制"),
-	
-	TYPE13("监考已审-导出"),
-	
-	TYPE14("监考待审-审核"),
-	TYPE15("监考待审-批量审核"),
-	
-	TYPE16("考试明细-重审"),
-	TYPE17("考试明细-导出"),
-	
-	TYPE18("成绩统计-导出"),
-	
-	TYPE19("考试进度详情-导出"),
-	
-	TYPE20("设置重考-设置重考"),
-	
-	TYPE21("考试进度详情-上传作答"),
-	
-	TYPE22("调卷规则-保存音频播放次数"),
-	TYPE23("调卷规则-新增调卷规则"),
-	TYPE24("调卷规则-修改调卷规则"),
-	
-	TYPE25("考试试卷管理-简易组卷"),
-	TYPE26("考试试卷管理-精细组卷"),
-	TYPE27("考试试卷管理-蓝图组卷"),
-	TYPE28("考试试卷管理-手动组卷"),
-	TYPE31("考试试卷管理-试卷审核"),
-	TYPE33("考试试卷管理-编辑试卷"),
-	TYPE36("考试试卷管理-下载"),
-	TYPE37("考试试卷管理-批量下载"),
-	TYPE39("考试试卷管理-修改大题名称"),
-	TYPE41("考试试卷管理-删除大题"),
-	TYPE42("考试试卷管理-移动大题"),
-	TYPE44("考试试卷管理-编辑小题"),
-	TYPE45("考试试卷管理-删除小题"),
-	TYPE47("考试试卷管理-删除试卷"),
-	TYPE49("考试试卷管理-选题"),
-	
-	TYPE29("导入试卷管理-导入试卷"),
-	TYPE30("导入试卷管理-复制试卷"),
-	TYPE32("导入试卷管理-编辑试卷"),
-	TYPE34("导入试卷管理-使用原卷"),
-	TYPE35("导入试卷管理-试卷答案导入"),
-	TYPE38("导入试卷管理-修改大题名称"),
-	TYPE40("导入试卷管理-删除大题"),
-	TYPE43("导入试卷管理-编辑小题"),
-	TYPE46("导入试卷管理-删除原卷"),
-	TYPE48("导入试卷管理-删除小题"),
-	
-	TYPE50("试卷检查-打回"),
-	TYPE51("试卷检查-批量打回"),
-	
-	TYPE52("创建评卷工作-设置任务数"),
-	TYPE53("创建评卷工作-设置给分间隔"),
-	TYPE54("创建评卷工作-导出评卷员"),
-	TYPE55("创建评卷工作-修改"),
-	TYPE56("创建评卷工作-删除评卷工作"),
-	TYPE57("创建评卷工作-结束评卷工作"),
-	TYPE58("创建评卷工作-开启评卷工作"),
-	TYPE59("创建评卷工作-成绩发布"),
-	TYPE60("创建评卷工作-设置评卷员"),
-	TYPE61("创建评卷工作-导入评卷员"),
-	TYPE62("创建评卷工作-新增"),
-	TYPE63("创建评卷工作-重试"),
-    ;
-
-	AdminOperateType(String desc) {
-        this.desc = desc;
-    }
-
-    private String desc;
-
-    public String getDesc() {
-        return desc;
-    }
-}

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

@@ -1,44 +0,0 @@
-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;
-		}
-	}
-
-}

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

@@ -1,37 +0,0 @@
-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
-
-}

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

@@ -1,50 +0,0 @@
-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");
-	}
-
-}

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

@@ -1,39 +0,0 @@
-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
-}

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

@@ -1,32 +0,0 @@
-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
-
-}

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

@@ -1,34 +0,0 @@
-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,
-	/**
-	 * 已撤回
-	 */
-	RECALLED
-
-}

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

@@ -1,29 +0,0 @@
-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;
-	}
-
-}

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

@@ -1,23 +0,0 @@
-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;
-	}
-
-}

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

@@ -1,23 +0,0 @@
-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;
-	}
-
-}

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

@@ -1,58 +0,0 @@
-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;
-	}
-
-}

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

@@ -1,29 +0,0 @@
-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;
-	}
-
-}

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

@@ -1,136 +0,0 @@
-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;
-	}
-
-}

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

@@ -1,66 +0,0 @@
-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;
-	}
-
-}

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

@@ -1,64 +0,0 @@
-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;
-	}
-
-}

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

@@ -1,59 +0,0 @@
-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;
-	}
-
-}

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

@@ -1,81 +0,0 @@
-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;
-	}
-
-}

+ 29 - 0
examcloud-common-models/pom.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+         xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>examcloud-common-models</artifactId>
+    <packaging>jar</packaging>
+
+    <parent>
+        <groupId>cn.com.qmth.examcloud</groupId>
+        <artifactId>examcloud-components</artifactId>
+        <version>${revision}</version>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-annotations</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.validation</groupId>
+            <artifactId>validation-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>

+ 0 - 0
examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/CloudService.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/CloudService.java


+ 0 - 0
examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/EnterpriseService.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/EnterpriseService.java


+ 91 - 0
examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/AdminOperateType.java

@@ -0,0 +1,91 @@
+package cn.com.qmth.examcloud.api.commons.enums;
+
+public enum AdminOperateType {
+    TYPE1("考生端配置-保存考生端配置"),
+    TYPE2("考生端配置-上传学校logo"),
+    TYPE3("考生端配置-上传考生端登录界面图片"),
+    TYPE4("考生端配置-上传学校答题纸模板"),
+    TYPE5("考生端配置-上传菜单logo"),
+
+    TYPE6("普通用户管理-新增用户"),
+    TYPE7("普通用户管理-修改用户"),
+    TYPE8("普通用户管理-重置用户密码"),
+    TYPE9("普通用户管理-批量重置用户密码"),
+    TYPE10("普通用户管理-启用用户"),
+    TYPE11("普通用户管理-禁用用户"),
+    TYPE12("普通用户管理-权限复制"),
+
+    TYPE13("监考已审-导出"),
+
+    TYPE14("监考待审-审核"),
+    TYPE15("监考待审-批量审核"),
+
+    TYPE16("考试明细-重审"),
+    TYPE17("考试明细-导出"),
+
+    TYPE18("成绩统计-导出"),
+
+    TYPE19("考试进度详情-导出"),
+
+    TYPE20("设置重考-设置重考"),
+
+    TYPE21("考试进度详情-上传作答"),
+
+    TYPE22("调卷规则-保存音频播放次数"),
+    TYPE23("调卷规则-新增调卷规则"),
+    TYPE24("调卷规则-修改调卷规则"),
+
+    TYPE25("考试试卷管理-简易组卷"),
+    TYPE26("考试试卷管理-精细组卷"),
+    TYPE27("考试试卷管理-蓝图组卷"),
+    TYPE28("考试试卷管理-手动组卷"),
+    TYPE31("考试试卷管理-试卷审核"),
+    TYPE33("考试试卷管理-编辑试卷"),
+    TYPE36("考试试卷管理-下载"),
+    TYPE37("考试试卷管理-批量下载"),
+    TYPE39("考试试卷管理-修改大题名称"),
+    TYPE41("考试试卷管理-删除大题"),
+    TYPE42("考试试卷管理-移动大题"),
+    TYPE44("考试试卷管理-编辑小题"),
+    TYPE45("考试试卷管理-删除小题"),
+    TYPE47("考试试卷管理-删除试卷"),
+    TYPE49("考试试卷管理-选题"),
+
+    TYPE29("导入试卷管理-导入试卷"),
+    TYPE30("导入试卷管理-复制试卷"),
+    TYPE32("导入试卷管理-编辑试卷"),
+    TYPE34("导入试卷管理-使用原卷"),
+    TYPE35("导入试卷管理-试卷答案导入"),
+    TYPE38("导入试卷管理-修改大题名称"),
+    TYPE40("导入试卷管理-删除大题"),
+    TYPE43("导入试卷管理-编辑小题"),
+    TYPE46("导入试卷管理-删除原卷"),
+    TYPE48("导入试卷管理-删除小题"),
+
+    TYPE50("试卷检查-打回"),
+    TYPE51("试卷检查-批量打回"),
+
+    TYPE52("创建评卷工作-设置任务数"),
+    TYPE53("创建评卷工作-设置给分间隔"),
+    TYPE54("创建评卷工作-导出评卷员"),
+    TYPE55("创建评卷工作-修改"),
+    TYPE56("创建评卷工作-删除评卷工作"),
+    TYPE57("创建评卷工作-结束评卷工作"),
+    TYPE58("创建评卷工作-开启评卷工作"),
+    TYPE59("创建评卷工作-成绩发布"),
+    TYPE60("创建评卷工作-设置评卷员"),
+    TYPE61("创建评卷工作-导入评卷员"),
+    TYPE62("创建评卷工作-新增"),
+    TYPE63("创建评卷工作-重试"),
+    ;
+
+    AdminOperateType(String desc) {
+        this.desc = desc;
+    }
+
+    private String desc;
+
+    public String getDesc() {
+        return desc;
+    }
+}

+ 1 - 1
examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/enums/BasicDataType.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/BasicDataType.java

@@ -9,6 +9,6 @@ package cn.com.qmth.examcloud.api.commons.enums;
  */
 public enum BasicDataType {
 
-	STRING, INTEGER, BOOLEAN, LONG, DATE;
+    STRING, INTEGER, BOOLEAN, LONG, DATE;
 
 }

+ 44 - 0
examcloud-common-models/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
+     *
+     * @param value
+     * @return
+     * @author WANGWEI
+     */
+    public Boolean getBoolean() {
+        if (UNDEFINED.equals(this)) {
+            return null;
+        } else if (TRUE.equals(this)) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+}

+ 37 - 0
examcloud-common-models/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
+
+}

+ 19 - 0
examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/CallType.java

@@ -0,0 +1,19 @@
+package cn.com.qmth.examcloud.api.commons.enums;
+
+public enum CallType {
+
+    WHOLE_SET("成套调用"),
+
+    RANDOM_PAPER("随机抽题");
+
+    private String name;
+
+    CallType(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+}

+ 50 - 0
examcloud-common-models/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;
+    }
+
+    /**
+     * 混合查询
+     *
+     * @param name
+     * @return
+     * @author WANGWEI
+     */
+    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");
+    }
+
+}

+ 0 - 0
examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/enums/DataRuleType.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/DataRuleType.java


+ 16 - 16
examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/enums/ExamSpecialSettingsType.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/ExamSpecialSettingsType.java

@@ -9,24 +9,24 @@ package cn.com.qmth.examcloud.api.commons.enums;
  */
 public enum ExamSpecialSettingsType {
 
-	/**
-	 * 机构维度
-	 */
-	ORG_BASED,
+    /**
+     * 机构维度
+     */
+    ORG_BASED,
 
-	/**
-	 * 学生维度
-	 */
-	STUDENT_BASED,
+    /**
+     * 学生维度
+     */
+    STUDENT_BASED,
 
-	/**
-	 * 课程维度
-	 */
-	COURSE_BASED,
+    /**
+     * 课程维度
+     */
+    COURSE_BASED,
 
-	/**
-	 * 场次维度
-	 */
-	STAGE_BASED
+    /**
+     * 场次维度
+     */
+    STAGE_BASED
 
 }

+ 8 - 8
examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/enums/ExamStageStartExamStatus.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/ExamStageStartExamStatus.java

@@ -7,13 +7,13 @@ package cn.com.qmth.examcloud.api.commons.enums;
  * @Version 1.0
  */
 public enum ExamStageStartExamStatus {
-	/**
-	 * 未开考
-	 */
-	NOT_START,
+    /**
+     * 未开考
+     */
+    NOT_START,
 
-	/**
-	 * 已开考
-	 */
-	STARTED
+    /**
+     * 已开考
+     */
+    STARTED
 }

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

@@ -0,0 +1,61 @@
+package cn.com.qmth.examcloud.api.commons.enums;
+
+/**
+ * @ClassName ExamType
+ * @Author nikang
+ * @Date 2018/9/21 17:56
+ * @Version 3.0
+ */
+public enum ExamType {
+    /**
+     * 传统考试
+     */
+    TRADITION("传统考试"),
+    /**
+     * 在线考试
+     */
+    ONLINE("在线考试"),
+    /**
+     * 在线练习
+     */
+    PRACTICE("练习"),
+
+    /**
+     * 离线考试
+     */
+    OFFLINE("离线考试"),
+
+    /**
+     * 分布式印刷考试
+     */
+    PRINT_EXAM("分布式印刷考试"),
+
+    /**
+     * 在线作业
+     */
+    ONLINE_HOMEWORK("在线作业");
+
+    private String title;
+
+    private ExamType(String title) {
+        this.title = title;
+    }
+
+    public static ExamType strToEnum(String str) {
+        for (ExamType examType : ExamType.values()) {
+            if (examType.name().equals(str)) {
+                return examType;
+            }
+        }
+        return null;
+    }
+
+    public static String getTitle(String name) {
+        for (ExamType examType : ExamType.values()) {
+            if (examType.name().equals(name)) {
+                return examType.title;
+            }
+        }
+        return null;
+    }
+}

+ 0 - 0
examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/enums/FaceApiProvider.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/FaceApiProvider.java


+ 1 - 1
examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/enums/Gender.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/Gender.java

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

+ 32 - 0
examcloud-common-models/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
+
+}

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

@@ -0,0 +1,34 @@
+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,
+    /**
+     * 已撤回
+     */
+    RECALLED
+
+}

+ 16 - 16
examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/enums/PrivilegeGroupType.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/PrivilegeGroupType.java

@@ -9,24 +9,24 @@ package cn.com.qmth.examcloud.api.commons.enums;
  */
 public enum PrivilegeGroupType {
 
-	/**
-	 * 菜单
-	 */
-	ADMIN_MENU,
+    /**
+     * 菜单
+     */
+    ADMIN_MENU,
 
-	/**
-	 * 功能
-	 */
-	FUNCTION,
+    /**
+     * 功能
+     */
+    FUNCTION,
 
-	/**
-	 * 数据权限
-	 */
-	DATA_ACCESS,
+    /**
+     * 数据权限
+     */
+    DATA_ACCESS,
 
-	/**
-	 * 学生端菜单
-	 */
-	STUDENT_CLIENT_MENU
+    /**
+     * 学生端菜单
+     */
+    STUDENT_CLIENT_MENU
 
 }

+ 8 - 8
examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/enums/SubmitType.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/enums/SubmitType.java

@@ -7,13 +7,13 @@ package cn.com.qmth.examcloud.api.commons.enums;
  * @Version 1.0
  */
 public enum SubmitType {
-	/**
-	 * 定点收卷
-	 */
-	TIMING_END,
+    /**
+     * 定点收卷
+     */
+    TIMING_END,
 
-	/**
-	 * 正常收卷
-	 */
-	NORMAL
+    /**
+     * 正常收卷
+     */
+    NORMAL
 }

+ 2 - 3
examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/exchange/BaseRequest.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/exchange/BaseRequest.java

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

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

@@ -0,0 +1,28 @@
+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
examcloud-common-models/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
examcloud-common-models/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;
+    }
+
+}

+ 2 - 3
examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/exchange/ExchangeBean.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/exchange/ExchangeBean.java

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

+ 58 - 0
examcloud-common-models/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
examcloud-common-models/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 io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+/**
+ * 表单请求
+ *
+ * @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;
+    }
+
+}

+ 1 - 2
examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/exchange/JsonSerializable.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/exchange/JsonSerializable.java

@@ -7,9 +7,8 @@ import java.io.Serializable;
  * <p>
  * 严重警告: 此接口为标识接口,禁止添加属性和方法. by wangwei
  * </p>
- * 
- * @author WANGWEI
  *
+ * @author WANGWEI
  */
 public interface JsonSerializable extends Serializable {
 

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

@@ -0,0 +1,103 @@
+package cn.com.qmth.examcloud.api.commons.exchange;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 分页
+ *
+ * @param <T>
+ * @author WANGWEI
+ * @date 2018年6月25日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+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() {
+
+    }
+
+    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
examcloud-common-models/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;
+    }
+
+}

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

@@ -0,0 +1,63 @@
+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;
+    }
+
+}

+ 3 - 14
examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/User.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/User.java

@@ -87,22 +87,11 @@ public class User implements JsonSerializable {
     private String salt;
 
     /**
-     * 构建key
-     *
-     * @return
-     * @author WANGWEI
+     * 构建用户Key(登录Session缓存KEY)
      */
-    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;
+        this.key = "$SS:" + (userType != null ? userType.getCode() : "") + "_" + rootOrgId + "_" + userId;
+        return this.key;
     }
 
     public void setKey(String key) {

+ 0 - 0
examcloud-api-commons/src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/UserDataRule.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/api/commons/security/bean/UserDataRule.java


+ 59 - 0
examcloud-common-models/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
examcloud-common-models/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;
+    }
+
+}

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


+ 68 - 0
examcloud-common-models/src/main/java/cn/com/qmth/examcloud/question/commons/core/paper/DefaultPaper.java

@@ -0,0 +1,68 @@
+package cn.com.qmth.examcloud.question.commons.core.paper;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 试卷结构
+ *
+ * @author WANGWEI
+ * @date 2018年8月15日
+ */
+public class DefaultPaper implements Serializable {
+
+    private static final long serialVersionUID = -5979287118960427883L;
+
+    /**
+     * 临时试卷ID(冗余字段,部分场景使用)
+     */
+    private String tempId;
+
+    /**
+     * 试卷名称
+     */
+    private String name;
+
+    /**
+     * 是否全是客观题
+     */
+    private Boolean fullyObjective;
+
+    /**
+     * 分组集合
+     */
+    private List<DefaultQuestionGroup> questionGroupList;
+
+    public String getTempId() {
+        return tempId;
+    }
+
+    public void setTempId(String tempId) {
+        this.tempId = tempId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Boolean getFullyObjective() {
+        return fullyObjective;
+    }
+
+    public void setFullyObjective(Boolean fullyObjective) {
+        this.fullyObjective = fullyObjective;
+    }
+
+    public List<DefaultQuestionGroup> getQuestionGroupList() {
+        return questionGroupList;
+    }
+
+    public void setQuestionGroupList(List<DefaultQuestionGroup> questionGroupList) {
+        this.questionGroupList = questionGroupList;
+    }
+
+}

+ 56 - 0
examcloud-common-models/src/main/java/cn/com/qmth/examcloud/question/commons/core/paper/DefaultQuestionGroup.java

@@ -0,0 +1,56 @@
+package cn.com.qmth.examcloud.question.commons.core.paper;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 题分组集合
+ *
+ * @author WANGWEI
+ * @date 2018年8月15日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class DefaultQuestionGroup implements Serializable {
+
+    private static final long serialVersionUID = 2149814711274942645L;
+
+    /**
+     * 题组名称
+     */
+    private String groupName;
+
+    /**
+     * 题包装器集合<br>
+     */
+    private List<DefaultQuestionStructureWrapper> questionWrapperList;
+
+    /**
+     * 题组总分
+     */
+    private Double groupScore;
+
+    public String getGroupName() {
+        return groupName;
+    }
+
+    public void setGroupName(String groupName) {
+        this.groupName = groupName;
+    }
+
+    public List<DefaultQuestionStructureWrapper> getQuestionWrapperList() {
+        return questionWrapperList;
+    }
+
+    public void setQuestionWrapperList(List<DefaultQuestionStructureWrapper> questionWrapperList) {
+        this.questionWrapperList = questionWrapperList;
+    }
+
+    public Double getGroupScore() {
+        return groupScore;
+    }
+
+    public void setGroupScore(Double groupScore) {
+        this.groupScore = groupScore;
+    }
+
+}

+ 109 - 0
examcloud-common-models/src/main/java/cn/com/qmth/examcloud/question/commons/core/paper/DefaultQuestionStructureWrapper.java

@@ -0,0 +1,109 @@
+package cn.com.qmth.examcloud.question.commons.core.paper;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 题结构包装器
+ *
+ * @author WANGWEI
+ * @date 2018年8月15日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class DefaultQuestionStructureWrapper implements Serializable {
+
+    private static final long serialVersionUID = 8423916951155451548L;
+
+    /**
+     * 题ID
+     */
+    private String questionId;
+
+    /**
+     * 版本号
+     */
+    private String version;
+
+    /**
+     * 题分数
+     */
+    private Double questionScore;
+
+    /**
+     * 限制播放次数
+     */
+    private Integer limitedPlayTimes;
+
+    /**
+     * 已播放次数
+     */
+    private Integer playedTimes;
+
+    /**
+     * 作答限时
+     */
+    private Long timeLimit;
+
+    /**
+     * 题单元包装器
+     */
+    private List<DefaultQuestionUnitWrapper> questionUnitWrapperList;
+
+    public String getQuestionId() {
+        return questionId;
+    }
+
+    public void setQuestionId(String questionId) {
+        this.questionId = questionId;
+    }
+
+    public String getVersion() {
+        return version;
+    }
+
+    public void setVersion(String version) {
+        this.version = version;
+    }
+
+    public Double getQuestionScore() {
+        return questionScore;
+    }
+
+    public void setQuestionScore(Double questionScore) {
+        this.questionScore = questionScore;
+    }
+
+    public Integer getLimitedPlayTimes() {
+        return limitedPlayTimes;
+    }
+
+    public void setLimitedPlayTimes(Integer limitedPlayTimes) {
+        this.limitedPlayTimes = limitedPlayTimes;
+    }
+
+    public Integer getPlayedTimes() {
+        return playedTimes;
+    }
+
+    public void setPlayedTimes(Integer playedTimes) {
+        this.playedTimes = playedTimes;
+    }
+
+    public Long getTimeLimit() {
+        return timeLimit;
+    }
+
+    public void setTimeLimit(Long timeLimit) {
+        this.timeLimit = timeLimit;
+    }
+
+    public List<DefaultQuestionUnitWrapper> getQuestionUnitWrapperList() {
+        return questionUnitWrapperList;
+    }
+
+    public void setQuestionUnitWrapperList(
+            List<DefaultQuestionUnitWrapper> questionUnitWrapperList) {
+        this.questionUnitWrapperList = questionUnitWrapperList;
+    }
+
+}

+ 71 - 0
examcloud-common-models/src/main/java/cn/com/qmth/examcloud/question/commons/core/paper/DefaultQuestionUnitWrapper.java

@@ -0,0 +1,71 @@
+package cn.com.qmth.examcloud.question.commons.core.paper;
+
+import cn.com.qmth.examcloud.question.commons.core.question.AnswerType;
+import cn.com.qmth.examcloud.question.commons.core.question.QuestionType;
+
+import java.io.Serializable;
+
+/**
+ * 题单元包装器
+ *
+ * @author WANGWEI
+ * @date 2018年8月16日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class DefaultQuestionUnitWrapper implements Serializable {
+
+    private static final long serialVersionUID = 7584275153456817959L;
+
+    /**
+     * 选项排序值
+     */
+    private Integer[] optionPermutation;
+
+    /**
+     * 题分数
+     */
+    private Double questionScore;
+
+    /**
+     * 题型
+     */
+    private QuestionType questionType;
+
+    /**
+     * 作答类型
+     */
+    private AnswerType answerType;
+
+    public Integer[] getOptionPermutation() {
+        return optionPermutation;
+    }
+
+    public void setOptionPermutation(Integer[] optionPermutation) {
+        this.optionPermutation = optionPermutation;
+    }
+
+    public Double getQuestionScore() {
+        return questionScore;
+    }
+
+    public void setQuestionScore(Double questionScore) {
+        this.questionScore = questionScore;
+    }
+
+    public QuestionType getQuestionType() {
+        return questionType;
+    }
+
+    public void setQuestionType(QuestionType questionType) {
+        this.questionType = questionType;
+    }
+
+    public AnswerType getAnswerType() {
+        return answerType;
+    }
+
+    public void setAnswerType(AnswerType answerType) {
+        this.answerType = answerType;
+    }
+
+}

+ 57 - 0
examcloud-common-models/src/main/java/cn/com/qmth/examcloud/question/commons/core/question/AnswerType.java

@@ -0,0 +1,57 @@
+package cn.com.qmth.examcloud.question.commons.core.question;
+
+/**
+ * 作答类型
+ *
+ * @author WANGWEI
+ * @date 2019年5月9日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public enum AnswerType {
+
+    STRICT("S", "严格作答(可程序判分.如判断,单选...)"),
+    //
+    DIVERSIFIED_TEXT("DT", "多元化文本(不可程序判分.如非严格填空,简答...)"),
+    //
+    SINGLE_VIDEO("SV", "单个视频"),
+    //
+    SINGLE_AUDIO("SA", "单个音频"),
+    //
+    SINGLE_FILE("SF", "单个文件"),
+    //
+    SINGLE_PICTURE("SP", "单个照片"),
+    //
+    MULTIPLE_PICTURES("MP", "多个照片");
+
+    // ===========================================================================
+
+    /**
+     * 简码
+     */
+    private String code;
+
+    /**
+     * 描述
+     */
+    private String desc;
+
+    /**
+     * 构造函数
+     *
+     * @param code
+     * @param desc
+     */
+    private AnswerType(String code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+}

+ 82 - 0
examcloud-common-models/src/main/java/cn/com/qmth/examcloud/question/commons/core/question/DefaultQuestion.java

@@ -0,0 +1,82 @@
+package cn.com.qmth.examcloud.question.commons.core.question;
+
+import java.io.Serializable;
+import java.util.Map;
+
+/**
+ * 题<完整题>
+ *
+ * @author WANGWEI
+ * @date 2018年8月15日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class DefaultQuestion implements Serializable {
+
+    private static final long serialVersionUID = 195811114083691548L;
+
+    /**
+     * 题ID
+     */
+    private String id;
+
+    /**
+     * 属性注释
+     */
+    private Long rootOrgId;
+
+    /**
+     * 是否脱离试卷存在
+     */
+    private Boolean isolated;
+
+    /**
+     * 主版本
+     */
+    private DefaultQuestionStructure masterVersion;
+
+    /**
+     * 扩展属性
+     */
+    private Map<String, String> properties;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public Long getRootOrgId() {
+        return rootOrgId;
+    }
+
+    public void setRootOrgId(Long rootOrgId) {
+        this.rootOrgId = rootOrgId;
+    }
+
+    public Boolean getIsolated() {
+        return isolated;
+    }
+
+    public void setIsolated(Boolean isolated) {
+        this.isolated = isolated;
+    }
+
+    public DefaultQuestionStructure getMasterVersion() {
+        return masterVersion;
+    }
+
+    public void setMasterVersion(DefaultQuestionStructure masterVersion) {
+        this.masterVersion = masterVersion;
+    }
+
+    public Map<String, String> getProperties() {
+        return properties;
+    }
+
+    public void setProperties(Map<String, String> properties) {
+        this.properties = properties;
+    }
+
+}

+ 11 - 11
examcloud-question-commons/src/main/java/cn/com/qmth/examcloud/question/commons/core/question/DefaultQuestionOption.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/question/commons/core/question/DefaultQuestionOption.java

@@ -11,19 +11,19 @@ import java.io.Serializable;
  */
 public class DefaultQuestionOption implements Serializable {
 
-	private static final long serialVersionUID = 8258548156850194710L;
+    private static final long serialVersionUID = 8258548156850194710L;
 
-	/**
-	 * 选项体
-	 */
-	private String body;
+    /**
+     * 选项体
+     */
+    private String body;
 
-	public String getBody() {
-		return body;
-	}
+    public String getBody() {
+        return body;
+    }
 
-	public void setBody(String body) {
-		this.body = body;
-	}
+    public void setBody(String body) {
+        this.body = body;
+    }
 
 }

+ 69 - 0
examcloud-common-models/src/main/java/cn/com/qmth/examcloud/question/commons/core/question/DefaultQuestionStructure.java

@@ -0,0 +1,69 @@
+package cn.com.qmth.examcloud.question.commons.core.question;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 题结构<完整题机构>
+ *
+ * @author WANGWEI
+ * @date 2018年8月15日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class DefaultQuestionStructure implements Serializable {
+
+    private static final long serialVersionUID = 4744728219699873386L;
+
+    /**
+     * 题结构体
+     */
+    private String body;
+
+    /**
+     * 版本号
+     */
+    private String version;
+
+    /**
+     * 是否有音频
+     */
+    private boolean hasAudios;
+
+    /**
+     * 体单元集合
+     */
+    private List<DefaultQuestionUnit> questionUnitList;
+
+    public String getBody() {
+        return body;
+    }
+
+    public void setBody(String body) {
+        this.body = body;
+    }
+
+    public String getVersion() {
+        return version;
+    }
+
+    public void setVersion(String version) {
+        this.version = version;
+    }
+
+    public boolean isHasAudios() {
+        return hasAudios;
+    }
+
+    public void setHasAudios(boolean hasAudios) {
+        this.hasAudios = hasAudios;
+    }
+
+    public List<DefaultQuestionUnit> getQuestionUnitList() {
+        return questionUnitList;
+    }
+
+    public void setQuestionUnitList(List<DefaultQuestionUnit> questionUnitList) {
+        this.questionUnitList = questionUnitList;
+    }
+
+}

+ 82 - 0
examcloud-common-models/src/main/java/cn/com/qmth/examcloud/question/commons/core/question/DefaultQuestionUnit.java

@@ -0,0 +1,82 @@
+package cn.com.qmth.examcloud.question.commons.core.question;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 题单元<最小作答单元>
+ *
+ * @author WANGWEI
+ * @date 2018年8月15日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class DefaultQuestionUnit implements Serializable {
+
+    private static final long serialVersionUID = 3092731472173574671L;
+
+    /**
+     * 题型
+     */
+    private QuestionType questionType;
+
+    /**
+     * 题干
+     */
+    private String body;
+
+    /**
+     * 选项集合
+     */
+    private List<DefaultQuestionOption> questionOptionList;
+
+    /**
+     * 正确答案
+     */
+    private String[] rightAnswer;
+
+    /**
+     * 作答类型
+     */
+    private AnswerType answerType;
+
+    public QuestionType getQuestionType() {
+        return questionType;
+    }
+
+    public void setQuestionType(QuestionType questionType) {
+        this.questionType = questionType;
+    }
+
+    public String getBody() {
+        return body;
+    }
+
+    public void setBody(String body) {
+        this.body = body;
+    }
+
+    public List<DefaultQuestionOption> getQuestionOptionList() {
+        return questionOptionList;
+    }
+
+    public void setQuestionOptionList(List<DefaultQuestionOption> questionOptionList) {
+        this.questionOptionList = questionOptionList;
+    }
+
+    public String[] getRightAnswer() {
+        return rightAnswer;
+    }
+
+    public void setRightAnswer(String[] rightAnswer) {
+        this.rightAnswer = rightAnswer;
+    }
+
+    public AnswerType getAnswerType() {
+        return answerType;
+    }
+
+    public void setAnswerType(AnswerType answerType) {
+        this.answerType = answerType;
+    }
+
+}

+ 0 - 0
examcloud-question-commons/src/main/java/cn/com/qmth/examcloud/question/commons/core/question/QuestionType.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/question/commons/core/question/QuestionType.java


+ 407 - 0
examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/CacheConstants.java

@@ -0,0 +1,407 @@
+package cn.com.qmth.examcloud.support;
+
+/**
+ * 缓存相关常量
+ * 注:cache key 命名规则
+ * $模块:关键字:参数1_参数2  示例:$OE:XXX:123_abc
+ */
+public interface CacheConstants {
+
+    /* #################### 登录会话、锁等KEY #################### */
+
+    /**
+     * 缓存 - 登录会话前缀:{userType}_{rootOrgId}_{userId}
+     */
+    String CACHE_LOGIN_SESSION = "$SS:";
+
+    /**
+     * 缓存 - APP登录会话前缀:{CACHE_LOGIN_SESSION}
+     */
+    String CACHE_APP_LOGIN_SESSION = "$APP:";
+
+    /**
+     * 缓存 - 异常状态:{cacheKey}
+     */
+    String CACHE_EXCEPTION = "$CACHE_EXCEPTION:";
+
+    /**
+     * 缓存 - 锁前缀
+     */
+    String LOCK_PREFIX = "$LOCK:";
+
+    /**
+     * 全局请求锁:{mapping}
+     */
+    String LOCK_REQUEST_GLOBAL = LOCK_PREFIX + "REQ_GLOBAL:";
+
+    /**
+     * 会话请求锁:{userKey}
+     */
+    String LOCK_REQUEST_SESSION = LOCK_PREFIX + "REQ_SESSION:";
+
+    /**
+     * 考试控制锁:{studentId}
+     */
+    String LOCK_EXAM_CONTROL = LOCK_PREFIX + "OE_EXAM_CONTROL:";
+
+    /**
+     * 考试交卷锁:{examRecordDataId}
+     */
+    String LOCK_HAND_IN_EXAM = LOCK_PREFIX + "OE_HAND_IN_EXAM:";
+
+    /**
+     * 人脸活体检测信息锁:{studentId}
+     */
+    String LOCK_GET_FACE_BIOPSY = LOCK_PREFIX + "OE_GET_FACE_BIOPSY:";
+
+    /**
+     * 人脸比对信息锁:{examRecordDataId}
+     */
+    String LOCK_FACE_COMPARE = LOCK_PREFIX + "OE_FACE_COMPARE:";
+
+    /**
+     * 考试记录清理锁
+     */
+    String LOCK_EXAM_DATA_CLEAN = LOCK_PREFIX + "OE_EXAM_DATA_CLEAN";
+
+    /**
+     * 网考导出任务锁:{exportTaskId}
+     */
+    String LOCK_OE_EXPORT_TASK = LOCK_PREFIX + "OE_EXPORT_TASK:";
+
+    /**
+     * 阅卷导出任务锁:{exportTaskId}
+     */
+    String LOCK_M_EXPORT_TASK = LOCK_PREFIX + "M_EXPORT_TASK:";
+
+    /**
+     * 考试更新锁:{rootOrgId}_{examCode}
+     */
+    String LOCK_E_EXAM_SAVE = LOCK_PREFIX + "E_EXAM_SAVE:";
+
+    /**
+     * 考试设置更新锁:{examId}_{orgId}_{courseId}_{studentId}
+     */
+    String LOCK_E_EXAM_SPECIAL_SETTINGS = LOCK_PREFIX + "E_EXAM_SPECIAL_SETTINGS:";
+
+
+
+    /* #################### 基础模块 #################### */
+
+    /**
+     * 缓存 - 应用模块信息:{appId}
+     */
+    String CACHE_B_APP = "$B:APP:";
+
+    /**
+     * 缓存 - 登录规则:{loginRuleType}
+     */
+    String CACHE_B_LOGIN_RULE = "$B:LOGIN_RULE:";
+
+    /**
+     * 缓存 - 加密组合配置
+     */
+    String CACHE_B_CRYPTO_CONFIG = "$B:CRYPTO_CONFIG";
+
+    /**
+     * 缓存 - 第三方接入信息:{rootOrgId}_{appId}
+     */
+    String CACHE_B_THIRD_PARTY_ACCESS = "$B:THIRD_PARTY_ACCESS:";
+
+    /**
+     * 缓存 - 机构拥有的权限信息:{rootOrgId}
+     */
+    String CACHE_B_ORG_PRIVILEGE = "$B:ORG_PRIVILEGE:";
+
+    /**
+     * 缓存 - 角色拥有的权限信息:{rootOrgId}_{roleId}
+     */
+    String CACHE_B_ROLE_PRIVILEGE = "$B:ROLE_PRIVILEGE:";
+
+    /**
+     * 缓存 - 权限关联的角色信息:{rootOrgId}_{privilegeCode}
+     */
+    String CACHE_B_PRIVILEGE_ROLES = "$B:PRIVILEGE_ROLES:";
+
+    /**
+     * 缓存 - 数据权限信息:{userId}_{dataRuleType}
+     */
+    String CACHE_B_DATA_RULE = "$B:DATA_RULE:";
+
+    /**
+     * 缓存 - 系统属性:{propKey}
+     */
+    String CACHE_B_SYS_PROP = "$B:SYS_PROP:";
+
+    /**
+     * 缓存 - 短信配置信息:{smsCode}
+     */
+    String CACHE_B_SMS_PROP = "$B:SMS_PROP:";
+
+    /**
+     * 缓存 - 顶级机构信息:{domain}
+     */
+    String CACHE_B_ROOT_ORG = "$B:ROOT_ORG:";
+
+    /**
+     * 缓存 - 机构信息:{orgId}
+     */
+    String CACHE_B_ORG = "$B:ORG:";
+
+    /**
+     * 缓存 - 机构属性信息:{orgId}_{key}
+     */
+    String CACHE_B_ORG_PROP = "$B:ORG_PROP:";
+
+    /**
+     * 缓存 - 机构属性列表信息:{orgId}_{propertyGroupId}
+     */
+    String CACHE_B_ORG_PROP_LIST = "$B:ORG_PROP_LIST:";
+
+    /**
+     * 缓存 - 课程信息:{courseId}
+     */
+    String CACHE_B_COURSE = "$B:COURSE:";
+
+    /**
+     * 缓存 - 考生信息:{studentId}
+     */
+    String CACHE_B_STUDENT = "$B:STUDENT:";
+
+    /**
+     * 缓存 - 学习中心安全策略IP:{orgId}
+     */
+    String CACHE_B_SECURITY_IP = "$B:SECURITY_IP:";
+
+    /**
+     * 缓存 - 登录错误信息:{accountType}_{account}_{ip}
+     */
+    String CACHE_B_LOGIN_ERR = "$B:LOGIN_ERR:";
+
+    /**
+     * 缓存 - 极验-验证码状态:{user_id}
+     */
+    String CACHE_B_GEETEST_STATUS = "$B:GEETEST_STATUS:UID_";
+
+    /**
+     * 缓存 - 数字公式-验证码信息:{rootOrgId}_{account}
+     */
+    String CACHE_B_VERIFY_CODE = "$B:VERIFY_CODE:";
+
+    /**
+     * 缓存 - 数字公式-验证码限流:{rootOrgId}_{account}
+     */
+    String CACHE_B_VERIFY_CODE_LIMIT = "$B:VERIFY_CODE_LIMIT:";
+
+    /**
+     * 缓存 - 数字公式-验证码资源标识:{uuid}
+     */
+    String CACHE_B_VERIFY_CODE_RESOURCE = "$B:VERIFY_CODE_RESOURCE:";
+
+
+
+    /* #################### 考务模块 #################### */
+
+    /**
+     * 缓存 - 考试设置信息:{examId}
+     */
+    String CACHE_E_EXAM = "$E:EXAM:";
+
+    /**
+     * 缓存 - 考试属性信息:{examId}_{key}
+     */
+    String CACHE_E_EXAM_PROP = "$E:EXAM_PROP:";
+
+    /**
+     * 缓存 - 考试场次信息:{examId}_{examStageId}
+     */
+    String CACHE_E_EXAM_STAGE = "$E:EXAM_STAGE:";
+
+    /**
+     * 缓存 - 考试场次集合信息:{examId}
+     */
+    String CACHE_E_EXAM_STAGES = "$E:EXAM_STAGES:";
+
+    /**
+     * 缓存 - 考试机构设置信息:{examId}_{orgId}
+     */
+    String CACHE_E_EXAM_ORG_SETTINGS = "$E:EXAM_ORG_SETTINGS:";
+
+    /**
+     * 缓存 - 考试机构属性信息:{examId}_{orgId}_{key}
+     */
+    String CACHE_E_EXAM_ORG_PROP = "$E:EXAM_ORG_PROP:";
+
+    /**
+     * 缓存 - 考试学生设置信息:{examId}_{studentId}
+     */
+    String CACHE_E_EXAM_STUDENT_SETTINGS = "$E:EXAM_STUDENT_SETTINGS:";
+
+    /**
+     * 缓存 - 考试学生属性信息:{examId}_{studentId}_{key}
+     */
+    String CACHE_E_EXAM_STUDENT_PROP = "$E:EXAM_STUDENT_PROP:";
+
+
+
+    /* #################### 题库模块 #################### */
+
+    /**
+     * 缓存 - 试卷结构:{paperStructId}
+     */
+    String CACHE_Q_PAPER_STRUCT = "$Q:PAPER_STRUCT:";
+
+    /**
+     * 缓存 - 调卷规则:{examId}_{courseCode}
+     */
+    String CACHE_Q_EXTRACT_CONFIG = "$Q:EXTRACT_CONFIG:";
+
+    /**
+     * 缓存 - 调卷规则的试卷结构:{examId}_{courseCode}_{groupCode}_{paperId}
+     */
+    String CACHE_Q_EXTRACT_CONFIG_PAPER = "$Q:EXTRACT_CONFIG_PAPER:";
+
+    /**
+     * 缓存 - 随机抽卷模板:{randomPaperId}
+     */
+    String CACHE_Q_RANDOM_PAPER = "$Q:RANDOM_PAPER:";
+
+    /**
+     * 缓存 - 试卷信息:{paperId}
+     */
+    String CACHE_Q_BASE_PAPER = "$Q:BASE_PAPER:";
+
+    /**
+     * 缓存 - 临时封装的试卷信息:{paperId}
+     */
+    String CACHE_Q_TEMP_PAPER = "$Q:TEMP_PAPER:";
+
+    /**
+     * 缓存 - 试题信息:{examId}_{courseCode}_{groupCode}_{questionId}
+     */
+    String CACHE_Q_QUESTION = "$Q:QUESTION:";
+
+    /**
+     * 缓存 - 试题答案信息:{questionId}
+     */
+    String CACHE_Q_QUESTION_ANSWER = "$Q:QUESTION_ANSWER:";
+
+
+
+    /* #################### 网考模块 #################### */
+
+    /**
+     * 缓存 - 网考考试会话:{studentId}
+     */
+    String CACHE_OE_SESSION = "$OE:SESSION:";
+
+    /**
+     * 缓存 - 考试次数控制:{examStudentId}
+     */
+    String CACHE_OE_BOSS = "$OE:BOSS:";
+
+    /**
+     * 缓存 - 网考考试记录:{examRecordDataId}
+     */
+    String CACHE_OE_RECORD = "$OE:RECORD:";
+
+    /**
+     * 缓存 - 考试心跳:{examRecordDataId}
+     */
+    String CACHE_OE_HEARTBEAT = "$OE:HEARTBEAT:";
+
+    /**
+     * 缓存 - 考试活动时间:{examRecordDataId}
+     */
+    String CACHE_OE_ACTIVE = "$OE:ACTIVE:";
+
+    /**
+     * 缓存 - 网考试卷结构:{examRecordDataId}
+     */
+    String CACHE_OE_PAPER = "$OE:PAPER:";
+
+    /**
+     * 缓存 - 网考作答:{examRecordDataId}_{order}
+     */
+    String CACHE_OE_ANSWER = "$OE:ANSWER:";
+
+    /**
+     * 缓存 - 网考文件作答:{examRecordDataId}_{order}
+     */
+    String CACHE_OE_FILE_ANSWER = "$OE:FILE_ANSWER:";
+
+    /**
+     * 缓存 - 网考考生信息:{examStudentId}
+     */
+    String CACHE_OE_EXAM_STUDENT = "$OE:EXAM_STUDENT:";
+
+    /**
+     * 缓存 - 考试成绩统计状态:{examId}
+     */
+    String CACHE_OE_SCORE_STATISTIC_STATUS = "$OE:SCORE_STATISTIC_STATUS:";
+
+    /**
+     * 缓存 - 违纪非法考生端应用:{examRecordDataId}
+     */
+    String CACHE_OE_DISCIPLINE_ILLEGAL_CLIENT = "$OE:DISCIPLINE_ILLEGAL_CLIENT:";
+
+    /**
+     * 缓存 - 违纪非法数据:{examRecordDataId}
+     */
+    String CACHE_OE_DISCIPLINE_ILLEGAL_DATA = "$OE:DISCIPLINE_ILLEGAL_DATA:";
+
+    /**
+     * 缓存 - 同步人脸比对结果:{studentId}
+     */
+    String CACHE_OE_SYNC_FACE_COMPARE_RESULT = "$OE:SYNC_FACE_COMPARE_RESULT:";
+
+    /**
+     * 缓存 - 又拍云图片存储签名:{userId}_{signIdentifier}
+     */
+    String CACHE_OE_UPYUN_IMAGE_SIGN = "$OE:UPYUN_IMAGE_SIGN:";
+
+    /**
+     * 缓存 - 人脸验证限流-秒级:{userKey}
+     */
+    String CACHE_OE_FACE_API_LIMIT_SECOND = "$OE:FACE_API_LIMIT:S_";
+
+    /**
+     * 缓存 - 人脸验证限流-分钟级:{userKey}
+     */
+    String CACHE_OE_FACE_API_LIMIT_MINUTE = "$OE:FACE_API_LIMIT:M_";
+
+    /**
+     * 缓存 - 旧版API黑名单:{rootOrgIds}
+     */
+    String CACHE_OE_OLD_API_BLACK_LIST = "$OE:OLD_API_BLACK_LIST";
+
+    /**
+     * 缓存 - 异步导出任务终止:{taskId}
+     */
+    String CACHE_OE_EXPORT_TASK_STOP = "$OE:EXPORT_TASK_STOP:";
+
+
+
+    /* #################### Exchange模块 #################### */
+
+    /**
+     * 缓存 - 课程组下课程列表:{rootOrgId}_{courseGroupName}
+     */
+    String CACHE_EX_COURSE_LIST = "$EX:COURSE_LIST:";
+
+    /**
+     * 缓存 - 短信验证码:{phone}
+     */
+    String CACHE_EX_SMS = "$EX:SMS:";
+
+
+
+    /* #################### APP模块 #################### */
+
+    /**
+     * 缓存 - 请求Trace:{threadTraceID}
+     */
+    String CACHE_APP_REQ_TRACE = "$APP:REQ_TRACE:";
+
+
+}

+ 25 - 89
examcloud-support/src/main/java/cn/com/qmth/examcloud/support/Constants.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/Constants.java

@@ -13,54 +13,12 @@ public interface Constants {
      */
     String OE_CODE_400 = "000400";
 
-    /**
-     * 考试控制锁_{studentId}
-     */
-    String EXAM_CONTROL_LOCK_PREFIX = "$oe_lock:student_id_";
-
-    /**
-     * 考试交卷锁前缀_{examRecordDataId}
-     */
-    String HAND_IN_EXAM_LOCK_PREFIX = "$oe_lock:hand_in_exam_";
-
-    /**
-     * 获取人脸活体检测基本信息前缀_{studentId}
-     */
-    String GET_FACE_BIOPSY_INFO_PREFIX = "$oe_lock:get_face_biopsy_info_";
-
-    /**
-     * 人脸比对控制锁_{examRecordDataId}
-     */
-    String FACE_COMPARE_LOCK_PREFIX = "$oe_lock:face_compare_";
-
-    /**
-     * 考试数据清理锁
-     */
-    String EXAM_DATA_CLEAN_LOCK_PREFIX = "$oe_lock:exam_data_clean";
-
     String ERROR_MSG = "error_message";
 
-    /**
-     * 学生考试session前缀
-     */
-    String OE_STUDENT_EXAM_SESSION_PREFIX = "oe_student:exam_session_";
-
     String isTrue = "true";
 
     String isFalse = "false";
 
-    /**
-     * 考试成绩通知路径前缀
-     */
-    String OE_EXAM_SCORE_NOTIFY_URL_PREFIX = "oe.examScoreNotify.url.";
-
-    /**
-     * 考试成绩通知路径传输方法前缀
-     */
-    String OE_EXAM_SCORE_NOTIFY_URL_HTTP_METHOD_PREFIX = "oe.examScoreNotify.url.httpMethod.";
-
-    // face++ 人脸比对相关错误详情
-
     /**
      * face++ 人脸比对API并发次数超过上限
      */
@@ -72,33 +30,6 @@ public interface Constants {
      */
     String FACE_COMPARE_AUTHORIZATION_ERROR = "AUTHORIZATION_ERROR";
 
-    /**
-     * face++ 下载图片超时
-     */
-    String FACE_COMPARE_IMAGE_DOWNLOAD_TIMEOUT = "IMAGE_DOWNLOAD_TIMEOUT";
-
-    // 百度活检错误码 http://ai.baidu.com/docs#/Face-Java-SDK/514d7ea4
-    String BAIDU_ERROR_CODE = "error_code";
-
-    String BAIDU_ERROR_MSG = "error_msg";
-
-    String BAIDU_SUCCESS_ERROR_CODE_VALUE = "0";
-
-    /**
-     * 连接超时或读取数据超时
-     */
-    String BAIDU_FACELIVENESS_CONNECTION_OR_READ_DATA_TIME_OUT_CODE = "SDK108";
-
-    /**
-     * 百度在线活体检测QPS超过上限的错误码
-     */
-    String BAIDU_FACELIVENESS_QPS_LIMIT_EXCEEDED_CODE = "18";
-
-    /**
-     * 抓拍照片又拍云签名前缀
-     */
-    String EXAM_CAPTURE_PHOTO_UPYUN_SIGN_PREFIX = "OE_EXAM_CAPTURE_PHOTO_UPYUN_SIGN_";
-
     // 抓拍照片的又拍云id
     String CAPTURE_PHOTO_UPYUN_SITEID = "capturePhoto";
 
@@ -107,11 +38,6 @@ public interface Constants {
      */
     String OE_SITEID = "oe";
 
-    /**
-     * 处理照片高优先级
-     */
-    int PROCESS_CAPTURE_HIGH_PRIORITY = 1;
-
     /**
      * 照片处理中状态码
      */
@@ -132,11 +58,6 @@ public interface Constants {
      */
     String COMMON_SUCCESS_CODE = "000000";
 
-    /**
-     * 同步人脸比对结果前缀
-     */
-    String FACE_SYNC_COMPARE_RESULT_PREFIX = "FACE_SYNC_COMPARE_RESULT_";
-
     /**
      * 活体检测方案key
      */
@@ -157,16 +78,6 @@ public interface Constants {
      */
     String ID_NUMBER_PRIVATE_MODE_KEY = "ID_NUMBER_PRIVATE_MODE";
 
-    /**
-     * 违纪-非法考生端应用 缓存Key前缀
-     */
-    String OE_DISCIPLINE_ILLEGAL_CLIENT = "OE_DISCIPLINE:ILLEGAL_CLIENT_";
-
-    /**
-     * 违纪-非法数据 缓存Key前缀
-     */
-    String OE_DISCIPLINE_ILLEGAL_DATA = "OE_DISCIPLINE:ILLEGAL_DATA_";
-
     /**
      * 客户端请求中User-Agent特征值
      */
@@ -202,4 +113,29 @@ public interface Constants {
      */
     String BAIDU_EXPECT_FACE_COMPARE_SCORE = "BAIDU_EXPECT_FACE_COMPARE_SCORE";
 
+    /**
+     * 网考-用于环境监测的考试记录ID
+     */
+    Long OE_ENV_CHECK_EXAM_RECORD_DATA_ID = 0L;
+
+    /**
+     * 网考-用于环境监测的题号
+     */
+    int OE_ENV_CHECK_QUESTION_ORDER = 1;
+
+    /**
+     * 网考-用于环境监测的考生ID
+     */
+    Long OE_ENV_CHECK_EXAM_STUDENT_ID = 0L;
+
+    /**
+     * 分数及格线(整数百分比)默认:60%
+     */
+    int OE_PASSS_CORE_LINE = 60;
+
+    /**
+     * 分数优秀线(整数百分比)默认:90%
+     */
+    int OE_GOOD_SCORE_LINE = 90;
+
 }

+ 0 - 0
examcloud-support/src/main/java/cn/com/qmth/examcloud/support/enums/BlockType.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/BlockType.java


+ 0 - 0
examcloud-support/src/main/java/cn/com/qmth/examcloud/support/enums/DataCategory.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/DataCategory.java


+ 0 - 0
examcloud-support/src/main/java/cn/com/qmth/examcloud/support/enums/DbType.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/DbType.java


+ 6 - 2
examcloud-support/src/main/java/cn/com/qmth/examcloud/support/enums/ExamProcess.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/ExamProcess.java

@@ -13,7 +13,9 @@ public enum ExamProcess {
     CONTINUE("CONTINUE", "断点续考"),
     AUTO_HAND_IN("AUTO_HAND_IN", "服务端交卷"),
     MANUAL_HAND_IN("MANUAL_HAND_IN", "考生端交卷");
+
     private String code;
+
     private String desc;
 
     ExamProcess(String code, String desc) {
@@ -23,17 +25,19 @@ public enum ExamProcess {
 
     /**
      * 考试过程代码
+     *
      * @return
      */
-    public String getCode(){
+    public String getCode() {
         return this.code;
     }
 
     /**
      * 考试过程描述
+     *
      * @return
      */
-    public String getDesc(){
+    public String getDesc() {
         return this.desc;
     }
 }

+ 0 - 0
examcloud-support/src/main/java/cn/com/qmth/examcloud/support/enums/ExamProperties.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/ExamProperties.java


+ 1 - 1
examcloud-support/src/main/java/cn/com/qmth/examcloud/support/enums/ExamRecordStatus.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/ExamRecordStatus.java

@@ -33,7 +33,7 @@ public enum ExamRecordStatus {
      * 考试无效/作废
      */
     EXAM_INVALID,
-    
+
     /**
      * 考试异常数据
      */

+ 0 - 0
examcloud-support/src/main/java/cn/com/qmth/examcloud/support/enums/FaceBiopsyScheme.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/FaceBiopsyScheme.java


+ 0 - 0
examcloud-support/src/main/java/cn/com/qmth/examcloud/support/enums/FileAnswerAcknowledgeStatus.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/FileAnswerAcknowledgeStatus.java


+ 0 - 0
examcloud-support/src/main/java/cn/com/qmth/examcloud/support/enums/HandInExamType.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/HandInExamType.java


+ 48 - 0
examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/IsSuccess.java

@@ -0,0 +1,48 @@
+package cn.com.qmth.examcloud.support.enums;
+
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * @author chenken
+ * @date 2018年2月26日 下午3:13:05
+ * @company QMTH
+ * @description 成功或失败
+ */
+public enum IsSuccess {
+    /**
+     * 成功
+     */
+    SUCCESS("成功"),
+    /**
+     * 失败
+     */
+    FAILED("失败");
+
+    private String desc;
+
+    public static IsSuccess strToEnum(String name) {
+        if (StringUtils.isBlank(name)) {
+            return null;
+        }
+        for (IsSuccess isSuccess : IsSuccess.values()) {
+            if (name.equals(isSuccess.name())) {
+                return isSuccess;
+            }
+        }
+
+        return null;
+    }
+
+    private IsSuccess(String desc) {
+        this.desc = desc;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+}
+

+ 0 - 0
examcloud-support/src/main/java/cn/com/qmth/examcloud/support/enums/SyncStatus.java → examcloud-common-models/src/main/java/cn/com/qmth/examcloud/support/enums/SyncStatus.java


+ 0 - 216
examcloud-commons/pom.xml

@@ -1,216 +0,0 @@
-<?xml version="1.0"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
-         xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>examcloud-commons</artifactId>
-    <packaging>jar</packaging>
-
-    <parent>
-        <groupId>cn.com.qmth.examcloud</groupId>
-        <artifactId>examcloud-components</artifactId>
-        <version>${revision}</version>
-    </parent>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter</artifactId>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.springframework.boot</groupId>
-                    <artifactId>spring-boot-starter-logging</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-mail</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-test</artifactId>
-            <scope>compile</scope>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.springframework.boot</groupId>
-                    <artifactId>spring-boot-starter</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-log4j2</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>jcl-over-slf4j</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.logging.log4j</groupId>
-            <artifactId>log4j-1.2-api</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-lang3</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>commons-lang</groupId>
-            <artifactId>commons-lang</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>commons-beanutils</groupId>
-            <artifactId>commons-beanutils</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>commons-net</groupId>
-            <artifactId>commons-net</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>commons-codec</groupId>
-            <artifactId>commons-codec</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>commons-collections</groupId>
-            <artifactId>commons-collections</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-pool2</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>commons-fileupload</groupId>
-            <artifactId>commons-fileupload</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-compress</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-text</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.httpcomponents</groupId>
-            <artifactId>httpclient</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.httpcomponents</groupId>
-            <artifactId>httpmime</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.squareup.okhttp3</groupId>
-            <artifactId>okhttp</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.poi</groupId>
-            <artifactId>poi</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.poi</groupId>
-            <artifactId>poi-ooxml</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>com.google.code.gson</groupId>
-            <artifactId>gson</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>fastjson</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>net.sf.json-lib</groupId>
-            <artifactId>json-lib</artifactId>
-            <classifier>jdk15</classifier>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.dataformat</groupId>
-            <artifactId>jackson-dataformat-yaml</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-annotations</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-databind</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>com.mchange</groupId>
-            <artifactId>c3p0</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>redis.clients</groupId>
-            <artifactId>jedis</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>dom4j</groupId>
-            <artifactId>dom4j</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.freemarker</groupId>
-            <artifactId>freemarker</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.quartz-scheduler</groupId>
-            <artifactId>quartz</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.jsoup</groupId>
-            <artifactId>jsoup</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.jcraft</groupId>
-            <artifactId>jsch</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.thoughtworks.xstream</groupId>
-            <artifactId>xstream</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>com.googlecode.aviator</groupId>
-            <artifactId>aviator</artifactId>
-            <exclusions>
-                <exclusion>
-                    <groupId>junit</groupId>
-                    <artifactId>junit</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>commons-beanutils</groupId>
-                    <artifactId>commons-beanutils</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.springframework</groupId>
-                    <artifactId>spring-context</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-    </dependencies>
-
-</project>

+ 0 - 50
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/exception/ExamCloudRuntimeException.java

@@ -1,50 +0,0 @@
-package cn.com.qmth.examcloud.commons.exception;
-
-/**
- * 通用异常类<br>
- *
- * @author WANG
- */
-public class ExamCloudRuntimeException extends RuntimeException {
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 7992796744711512927L;
-
-	/**
-	 * 构造函数
-	 */
-	public ExamCloudRuntimeException() {
-		super();
-	}
-
-	/**
-	 * 构造函数
-	 */
-	public ExamCloudRuntimeException(String message) {
-		super(message);
-	}
-
-	/**
-	 * 构造函数
-	 */
-	public ExamCloudRuntimeException(String message, Throwable cause) {
-		super(message, cause);
-	}
-
-	/**
-	 * 构造函数
-	 */
-	public ExamCloudRuntimeException(Throwable cause) {
-		super(cause);
-	}
-
-	/**
-	 * 构造函数
-	 */
-	protected ExamCloudRuntimeException(String message, Throwable cause, boolean enableSuppression,
-			boolean writableStackTrace) {
-		super(message, cause, enableSuppression, writableStackTrace);
-	}
-
-}

+ 0 - 87
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/exception/StatusException.java

@@ -1,87 +0,0 @@
-package cn.com.qmth.examcloud.commons.exception;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import cn.com.qmth.examcloud.commons.util.JsonUtil;
-
-/**
- * 状态异常类<br>
- *
- * @author WANG
- */
-public class StatusException extends RuntimeException {
-	private static final long serialVersionUID = 5003047488500388819L;
-
-	private static final String DEF_CODE="500";
-	/**
-	 * 追踪ID
-	 */
-	private String traceId;
-
-	/**
-	 * 状态码
-	 */
-	private String code;
-
-	/**
-	 * 状态描述
-	 */
-	private String desc;
-
-	/**
-	 * 构造函数
-	 */
-	public StatusException(String code, String desc) {
-		super("[code: " + code + "; desc: " + desc + "]");
-		this.code = code;
-		this.desc = desc;
-	}
-
-	/**
-	 * 构造函数
-	 */
-	public StatusException(String code, String desc, Throwable cause) {
-		super("[code: " + code + "; desc: " + desc + "]", cause);
-		this.code = code;
-		this.desc = desc;
-	}
-	
-	public StatusException( String desc) {
-		super("[code: " + DEF_CODE + "; desc: " + desc + "]");
-		this.code = DEF_CODE;
-		this.desc = desc;
-	}
-
-	public String getCode() {
-		return code;
-	}
-
-	public String getDesc() {
-		return desc;
-	}
-
-	public String getTraceId() {
-		return traceId;
-	}
-
-	public void setTraceId(String traceId) {
-		this.traceId = traceId;
-	}
-
-	/**
-	 * @return
-	 */
-	public String toJson() {
-		Map<String, Object> map = new HashMap<String, Object>();
-		map.put("code", code);
-		map.put("desc", desc);
-		return JsonUtil.toJson(map);
-	}
-
-	@Override
-	public String toString() {
-		return toJson();
-	}
-
-}

+ 0 - 63
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/BlackHolePrintStreamBuilder.java

@@ -1,63 +0,0 @@
-package cn.com.qmth.examcloud.commons.helpers;
-
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-
-/**
- * 黑洞(PrintStream)构建器
- *
- * @author WANGWEI
- * @date 2019年3月28日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class BlackHolePrintStreamBuilder {
-
-	/**
-	 * 创建BlackHolePrintStream
-	 *
-	 * @author WANGWEI
-	 * @return
-	 */
-	public static PrintStream build() {
-		return new BlackHolePrintStream(new ByteArrayOutputStream());
-	}
-
-	/**
-	 * 黑洞(PrintStream)
-	 *
-	 * @author WANGWEI
-	 * @date 2019年3月28日
-	 * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
-	 */
-	private static class BlackHolePrintStream extends PrintStream {
-
-		@Override
-		public void close() {
-			super.close();
-		}
-
-		ByteArrayOutputStream outputStream;
-
-		/**
-		 * 私有构造函数
-		 *
-		 * @param out
-		 */
-		private BlackHolePrintStream(ByteArrayOutputStream outputStream) {
-			super(outputStream);
-			this.outputStream = outputStream;
-		}
-
-		@Override
-		public void println(String x) {
-			outputStream.reset();
-		}
-
-		@Override
-		public void print(String x) {
-			outputStream.reset();
-		}
-
-	}
-
-}

+ 0 - 79
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/Counter.java

@@ -1,79 +0,0 @@
-package cn.com.qmth.examcloud.commons.helpers;
-
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * 计数器
- *
- * @author WANGWEI
- * @date 2018年1月26日
- * @Copyright (c) 2018-2020 http://www.qmth.com.cn/ All Rights Reserved.
- */
-public class Counter {
-
-	private AtomicLong counter;
-
-	/**
-	 * 最小值
-	 */
-	private long min;
-
-	/**
-	 * 最大值
-	 */
-	private long max;
-
-	/**
-	 * 循环计数回合数
-	 */
-	private int bout = 0;
-
-	/**
-	 * 构造函数
-	 *
-	 * @param min
-	 * @param max
-	 */
-	public Counter(long min, long max) {
-		this.min = min;
-		this.max = max;
-		bout();
-	}
-
-	/**
-	 * 初始化循环
-	 *
-	 * @author WANGWEI
-	 */
-	private void bout() {
-		int cur = bout;
-		synchronized (this) {
-			if (cur < bout) {
-				return;
-			}
-			counter = new AtomicLong(min);
-			bout++;
-		}
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @return
-	 */
-	public long next() {
-		long next = counter.getAndIncrement();
-
-		if (next > max) {
-			bout();
-			return next();
-		}
-
-		return next;
-	}
-
-	public long get() {
-		return counter.get();
-	}
-}

+ 0 - 109
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/DynamicEnum.java

@@ -1,109 +0,0 @@
-package cn.com.qmth.examcloud.commons.helpers;
-
-import java.io.Serializable;
-
-import org.apache.commons.lang3.StringUtils;
-
-import cn.com.qmth.examcloud.commons.util.StringUtil;
-
-/**
- * 动态枚举
- *
- * @author WANGWEI
- * @date 2018年8月23日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public final class DynamicEnum implements Serializable {
-
-	private static final long serialVersionUID = -694709140246715214L;
-
-	/**
-	 * ID
-	 */
-	private Long id;
-
-	/**
-	 * name
-	 */
-	private String name;
-
-	/**
-	 * 描述
-	 */
-	private String desc;
-
-	/**
-	 * 值类型
-	 */
-	private String valueType;
-
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public String getDesc() {
-		return desc;
-	}
-
-	public void setDesc(String desc) {
-		this.desc = desc;
-	}
-
-	public String getValueType() {
-		return valueType;
-	}
-
-	public void setValueType(String valueType) {
-		this.valueType = valueType;
-	}
-
-	/**
-	 * 是否合法
-	 *
-	 * @author WANGWEI
-	 * @param value
-	 * @return
-	 */
-	public Boolean isLegal(String value) {
-		if (StringUtils.isNotBlank(value) && null != valueType) {
-			BasicDataType dataType = BasicDataType.valueOf(valueType);
-			if (dataType.equals(BasicDataType.BOOLEAN)) {
-				try {
-					StringUtil.toBoolean(value);
-					return true;
-				} catch (Exception e) {
-					return false;
-				}
-			} else if (dataType.equals(BasicDataType.INTEGER)) {
-				try {
-					StringUtil.toInteger(value);
-					return true;
-				} catch (Exception e) {
-					return false;
-				}
-			} else if (dataType.equals(BasicDataType.LONG)) {
-				try {
-					StringUtil.toLong(value);
-					return true;
-				} catch (Exception e) {
-					return false;
-				}
-			}
-		}
-
-		return true;
-	}
-
-}

+ 0 - 145
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/DynamicEnumManager.java

@@ -1,145 +0,0 @@
-package cn.com.qmth.examcloud.commons.helpers;
-
-import java.io.File;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.google.common.collect.Maps;
-import com.thoughtworks.xstream.XStream;
-
-import cn.com.qmth.examcloud.commons.exception.ExamCloudRuntimeException;
-import cn.com.qmth.examcloud.commons.util.PathUtil;
-
-/**
- * 动态属性管理器
- *
- * @author WANGWEI
- * @date 2018年8月23日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class DynamicEnumManager {
-
-	private List<DynamicEnum> enums;
-
-	private Map<String, DynamicEnum> nameIndex;
-
-	private Map<Long, DynamicEnum> idIndex;
-
-	/**
-	 * 构造函数
-	 *
-	 */
-	private DynamicEnumManager() {
-		super();
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param xmlResourcePath
-	 * @return
-	 */
-	public static DynamicEnumManager newInstance(String xmlResourcePath) {
-		DynamicEnumManager manager = new DynamicEnumManager();
-
-		String resoucePath = PathUtil.getResoucePath(xmlResourcePath);
-		File file = new File(resoucePath);
-
-		XStream xStream = XStreamBuilder.newInstance().build();
-		xStream.allowTypes(new Class[]{DynamicEnum.class, List.class});
-		xStream.alias("enums", List.class);
-		xStream.alias("enum", DynamicEnum.class);
-
-		@SuppressWarnings("unchecked")
-		List<DynamicEnum> list = (List<DynamicEnum>) xStream.fromXML(file);
-		manager.enums = list;
-
-		manager.nameIndex = Maps.newHashMap();
-		manager.idIndex = Maps.newHashMap();
-
-		for (DynamicEnum cur : manager.enums) {
-			String valueTpye = cur.getValueType();
-			if (StringUtils.isBlank(valueTpye)) {
-				cur.setValueType(null);
-			} else {
-				try {
-					BasicDataType dataType = BasicDataType.valueOf(valueTpye);
-					cur.setValueType(dataType.name());
-				} catch (Exception e) {
-					throw new RuntimeException("valueTpye is wrong. valueTpye=" + valueTpye);
-				}
-
-			}
-			cur.setName(cur.getName().trim());
-			cur.setDesc(cur.getDesc().trim());
-			manager.nameIndex.put(cur.getName(), cur);
-			manager.idIndex.put(cur.getId(), cur);
-		}
-
-		return manager;
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param name
-	 * @return
-	 */
-	public DynamicEnum getByName(String name) {
-		DynamicEnum dynamicEnum = nameIndex.get(name);
-		if (null != dynamicEnum) {
-			return dynamicEnum;
-		}
-		throw new ExamCloudRuntimeException("动态枚举不存在. name=" + name);
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param name
-	 * @return
-	 */
-	public Long getIdByName(String name) {
-		DynamicEnum dynamicEnum = nameIndex.get(name);
-		if (null != dynamicEnum) {
-			return dynamicEnum.getId();
-		}
-		throw new ExamCloudRuntimeException("动态枚举不存在. name=" + name);
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param id
-	 * @return
-	 */
-	public DynamicEnum getById(Long id) {
-		DynamicEnum dynamicEnum = idIndex.get(id);
-		if (null != dynamicEnum) {
-			return dynamicEnum;
-		}
-		throw new ExamCloudRuntimeException("动态枚举不存在. id=" + id);
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param id
-	 * @return
-	 */
-	public String getNameById(Long id) {
-		DynamicEnum dynamicEnum = idIndex.get(id);
-		if (null != dynamicEnum) {
-			return dynamicEnum.getName();
-		}
-		throw new ExamCloudRuntimeException("动态枚举不存在. id=" + id);
-	}
-
-}

+ 0 - 134
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/FileChangeWatchdog.java

@@ -1,134 +0,0 @@
-package cn.com.qmth.examcloud.commons.helpers;
-
-import java.io.File;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * 文件变更监视器
- *
- * @author WANGWEI
- */
-public abstract class FileChangeWatchdog extends Thread {
-	/**
-	 * 属性注释
-	 */
-	private static final Logger LOG = LoggerFactory.getLogger(FileChangeWatchdog.class);
-
-	/**
-	 * 属性注释
-	 */
-	static final public long DEFAULT_DELAY = 60000;
-
-	/**
-	 * 属性注释
-	 */
-	protected String path;
-
-	/**
-	 * 属性注释
-	 */
-	protected long delay = DEFAULT_DELAY;
-
-	/**
-	 * 属性注释
-	 */
-	protected File file;
-
-	/**
-	 * 属性注释
-	 */
-	protected long lastModif = 0;
-
-	/**
-	 * 属性注释
-	 */
-	protected boolean warnedAlready = false;
-
-	/**
-	 * 属性注释
-	 */
-	protected boolean interrupted = false;
-
-	/**
-	 * 构造函数
-	 *
-	 * @param path
-	 */
-	protected FileChangeWatchdog(String path) {
-		super("FileChangeWatchdog");
-		LOG.info("new a FileChangeWatchdog. path=" + path);
-		this.path = path;
-		file = new File(path);
-		setDaemon(true);
-		checkAndConfigure();
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param delay
-	 */
-	public void setDelay(long delay) {
-		this.delay = delay;
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 */
-	abstract protected void doOnChange();
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 */
-	protected void checkAndConfigure() {
-		boolean fileExists;
-		try {
-			fileExists = file.exists();
-		} catch (SecurityException e) {
-			LOG.warn("Was not allowed to read check file existance, file:[" + path + "].");
-			interrupted = true;
-			return;
-		}
-
-		if (fileExists) {
-			long l = file.lastModified();
-
-			if (l > lastModif) {
-				lastModif = l;
-				doOnChange();
-				warnedAlready = false;
-			}
-		} else {
-			if (!warnedAlready) {
-				LOG.debug("[" + path + "] does not exist.");
-				warnedAlready = true;
-			}
-		}
-	}
-
-	/*
-	 * 实现
-	 *
-	 * @author WANGWEI
-	 * 
-	 * @see java.lang.Thread#run()
-	 */
-	@Override
-	public void run() {
-		while (!interrupted) {
-			try {
-				Thread.sleep(delay);
-			} catch (InterruptedException e) {
-				LOG.error("unexpected interruption.", e);
-			}
-			checkAndConfigure();
-		}
-	}
-}

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

@@ -1,58 +0,0 @@
-package cn.com.qmth.examcloud.commons.helpers;
-
-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;
-	}
-
-}

+ 0 - 44
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/JsonHttpResponseHolder.java

@@ -1,44 +0,0 @@
-package cn.com.qmth.examcloud.commons.helpers;
-
-import com.alibaba.fastjson.JSONObject;
-
-/**
- * http json 响应
- *
- * @author WANGWEI
- * @date 2019年9月16日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class JsonHttpResponseHolder {
-
-	private int statusCode;
-
-	private JSONObject respBody;
-
-	public JsonHttpResponseHolder() {
-		super();
-	}
-
-	public JsonHttpResponseHolder(int statusCode, JSONObject respBody) {
-		super();
-		this.statusCode = statusCode;
-		this.respBody = respBody;
-	}
-
-	public int getStatusCode() {
-		return statusCode;
-	}
-
-	public void setStatusCode(int statusCode) {
-		this.statusCode = statusCode;
-	}
-
-	public JSONObject getRespBody() {
-		return respBody;
-	}
-
-	public void setRespBody(JSONObject respBody) {
-		this.respBody = respBody;
-	}
-
-}

+ 0 - 52
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/KeyValuePair.java

@@ -1,52 +0,0 @@
-package cn.com.qmth.examcloud.commons.helpers;
-
-import java.io.Serializable;
-
-import com.alibaba.fastjson.JSONObject;
-
-/**
- * 键值对
- * 
- * @author WANGWEI
- *
- * @param <V>
- */
-public class KeyValuePair<K, V> implements Serializable {
-
-	private static final long serialVersionUID = 5140216132754119367L;
-
-	private K key;
-
-	private V value;
-
-	public KeyValuePair(K key, V value) {
-		super();
-		this.key = key;
-		this.value = value;
-
-	}
-
-	public JSONObject toJsonObject(String keyAlias, String valueAlias) {
-		JSONObject obj = new JSONObject();
-		obj.put(keyAlias, key);
-		obj.put(valueAlias, value);
-		return obj;
-	}
-
-	public K getKey() {
-		return key;
-	}
-
-	public void setKey(K key) {
-		this.key = key;
-	}
-
-	public V getValue() {
-		return value;
-	}
-
-	public void setValue(V value) {
-		this.value = value;
-	}
-
-}

+ 0 - 46
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/ObjectHolder.java

@@ -1,46 +0,0 @@
-package cn.com.qmth.examcloud.commons.helpers;
-
-/**
- * 基本类型对象化
- *
- * @author WANGWEI
- * @date 2019年1月16日
- * @Copyright (c) 2018-2020 http://www.qmth.com.cn/ All Rights Reserved.
- * @param <T>
- */
-public class ObjectHolder<T> {
-
-	private T t;
-
-	/**
-	 * 构造函数
-	 *
-	 * @param t
-	 */
-	public ObjectHolder(T t) {
-		super();
-		this.t = t;
-	}
-
-	public T get() {
-		return t;
-	}
-
-	public void set(T t) {
-		this.t = t;
-	}
-
-	public boolean isNull() {
-		return null == t;
-	}
-
-	@Override
-	public String toString() {
-		if (isNull()) {
-			return super.toString();
-		} else {
-			return t.toString();
-		}
-	}
-
-}

+ 0 - 98
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/XStreamBuilder.java

@@ -1,98 +0,0 @@
-package cn.com.qmth.examcloud.commons.helpers;
-
-import java.util.TimeZone;
-
-import com.thoughtworks.xstream.XStream;
-import com.thoughtworks.xstream.converters.basic.DateConverter;
-import com.thoughtworks.xstream.converters.basic.DoubleConverter;
-import com.thoughtworks.xstream.converters.basic.FloatConverter;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- */
-public class XStreamBuilder {
-
-	/**
-	 * 属性注释
-	 */
-	private XStream xs;
-
-	/**
-	 * 构造函数
-	 *
-	 */
-	private XStreamBuilder() {
-		this.xs = new XStream();
-		XStream.setupDefaultSecurity(this.xs);
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @return
-	 */
-	public static XStreamBuilder newInstance() {
-		XStreamBuilder builder = new XStreamBuilder();
-		return builder;
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param defaultFormat
-	 * @return
-	 */
-	public XStreamBuilder registerDateConverter(final String defaultFormat) {
-		xs.registerConverter(new DateConverter(defaultFormat, null, TimeZone.getTimeZone("GMT+8")));
-		return this;
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @return
-	 */
-	public XStreamBuilder registerNormalNumberConverter() {
-		xs.registerConverter(new NormalDoubleConverter());
-		xs.registerConverter(new NormalFloatConverter());
-		return this;
-	}
-
-	/**
-	 * 类注释
-	 *
-	 * @author WANGWEI
-	 */
-	private class NormalDoubleConverter extends DoubleConverter {
-		public String toString(Object obj) {
-			return String.valueOf(obj);
-		}
-	}
-
-	/**
-	 * 类注释
-	 *
-	 * @author WANGWEI
-	 */
-	private class NormalFloatConverter extends FloatConverter {
-		public String toString(Object obj) {
-			return String.valueOf(obj);
-		}
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @return
-	 */
-	public XStream build() {
-		return xs;
-	}
-
-}

+ 0 - 205
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/concurrency/simple/ConcurrentTask.java

@@ -1,205 +0,0 @@
-package cn.com.qmth.examcloud.commons.helpers.concurrency.simple;
-
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.Executors;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.ThreadPoolExecutor;
-
-import cn.com.qmth.examcloud.commons.util.Util;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * 并发任务
- *
- * @author WANGWEI
- * @date 2019年6月19日
- * @Copyright (c) 2018-2020 http://www.qmth.com.cn/ All Rights Reserved.
- */
-public class ConcurrentTask<T> {
-
-	private static final Logger LOG = LoggerFactory.getLogger(ConcurrentTask.class);
-
-	private BlockingQueue<T> queue = new LinkedBlockingQueue<T>(10000);
-
-	private BlockingQueue<Integer> workerMessages = new LinkedBlockingQueue<Integer>(10000);
-
-	private final WorkerController workerController = new WorkerController();
-
-	/**
-	 * 最大线程数
-	 */
-	private int maxActiveThreadSize = 5;
-
-	/**
-	 * 不死线程数
-	 */
-	private int minThreadSize = 2;
-
-	private ThreadPoolExecutor threadPoolExecutor;
-
-	/**
-	 * 处理者
-	 */
-	private Worker<T> worker;
-
-	/**
-	 * 巡检周期
-	 */
-	private int inspectionPeriod = 30;
-
-	/**
-	 * 任务名称
-	 */
-	private String taskName;
-
-	/**
-	 * 构造函数
-	 *
-	 * @param taskName
-	 */
-	public ConcurrentTask(String taskName) {
-		super();
-		this.taskName = taskName;
-	}
-
-	/**
-	 * 添加处理元素
-	 *
-	 * @author WANGWEI
-	 * @param e
-	 * @return
-	 */
-	public boolean offerElement(T e) {
-		boolean offer = queue.offer(e);
-		if (LOG.isDebugEnabled()) {
-			LOG.debug("offerElement. result=" + offer + ";element=" + e.toString());
-		}
-		return offer;
-	}
-
-	/**
-	 * 启动任务
-	 *
-	 * @author WANGWEI
-	 */
-	public void start() {
-		threadPoolExecutor = (ThreadPoolExecutor) Executors.newFixedThreadPool(maxActiveThreadSize);
-
-		// 创建不死线程
-		for (int i = 0; i < minThreadSize; i++) {
-			addWorkerThread(true);
-		}
-
-		// 巡检线程
-		Thread inspectionThread = new Thread() {
-
-			@Override
-			public void run() {
-				Util.sleep(inspectionPeriod);
-
-				while (true) {
-
-					int size = queue.size();
-					int activeCount = threadPoolExecutor.getActiveCount();
-					int warnCount = workerController.getWarnCount();
-
-					if (LOG.isInfoEnabled()) {
-						LOG.info("taskName [" + taskName + "]. activeCount = " + activeCount
-								+ "; warnCount = " + warnCount);
-					}
-
-					// 巡检周期内(因并发超出限制导致的)警告数量未超过100时,增加一个worker
-					if (warnCount <= 100) {
-						if (100 < size && maxActiveThreadSize > activeCount) {
-							addWorkerThread(false);
-						}
-					} else {
-						// 巡检周期内(因并发超出限制导致的)警告数量超过100时,减少一个worker
-						workerMessages.offer(warnCount);
-					}
-
-					workerController.resetWarnCount();
-					Util.sleep(inspectionPeriod);
-				}
-
-			};
-
-		};
-
-		inspectionThread.setDaemon(true);
-		inspectionThread.start();
-	}
-
-	/**
-	 * 添加处理线程
-	 *
-	 * @author WANGWEI
-	 * @param immortal
-	 */
-	private void addWorkerThread(final boolean immortal) {
-		LOG.info("create a new worker. immortal=" + immortal);
-		Thread thread = new Thread() {
-
-			long nullTimes = 0;
-
-			@Override
-			public void run() {
-				while (true) {
-					T el = queue.poll();
-					if (null == el) {
-						nullTimes++;
-						if (10 <= nullTimes) {
-							if (immortal) {
-								Util.sleep(2);
-								continue;
-							} else {
-								LOG.info("no element.worker exist.");
-								break;
-							}
-						} else {
-							Util.sleep(2);
-							continue;
-						}
-					} else {
-						nullTimes = 0;
-					}
-
-					try {
-						if (LOG.isDebugEnabled()) {
-							LOG.debug("process. element=" + el.toString());
-						}
-						worker.process(workerController, el);
-					} catch (Exception e) {
-						LOG.error("unexpected exception", e);
-					}
-
-					// 非不死线程在抢到终止消息时,结束线程
-					if (!immortal) {
-						Integer warnCount = workerMessages.poll();
-						if (null != warnCount) {
-							LOG.info("worker exist. warnCount=" + warnCount);
-							break;
-						}
-					}
-
-				}
-			}
-		};
-
-		threadPoolExecutor.execute(thread);
-	}
-
-	public void setMaxActiveThreadSize(int maxActiveThreadSize) {
-		this.maxActiveThreadSize = maxActiveThreadSize;
-	}
-
-	public void setMinThreadSize(int minThreadSize) {
-		this.minThreadSize = minThreadSize;
-	}
-
-	public void setWorker(Worker<T> worker) {
-		this.worker = worker;
-	}
-
-}

+ 0 - 27
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/concurrency/simple/WorkerController.java

@@ -1,27 +0,0 @@
-package cn.com.qmth.examcloud.commons.helpers.concurrency.simple;
-
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class WorkerController {
-
-	private static final Logger LOG = LoggerFactory.getLogger(WorkerController.class);
-
-	private AtomicInteger warnCount = new AtomicInteger(0);
-
-	public void addConcurrencyWarn() {
-		LOG.info("warn count ++");
-		this.warnCount.incrementAndGet();
-	}
-
-	public int getWarnCount() {
-		return this.warnCount.get();
-	}
-
-	public void resetWarnCount() {
-		warnCount.set(0);
-	}
-
-}

+ 0 - 43
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/pipeline/Counter.java

@@ -1,43 +0,0 @@
-package cn.com.qmth.examcloud.commons.helpers.pipeline;
-
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * 输出计数器
- *
- * @author WANGWEI
- * @date 2019年12月12日
- * @Copyright (c) 2018-2020 http://www.qmth.com.cn/ All Rights Reserved.
- */
-public class Counter {
-
-	private AtomicLong total = new AtomicLong(0);
-
-	private AtomicLong successAmount = new AtomicLong(0);
-
-	private AtomicLong failureAmount = new AtomicLong(0);
-
-	public long getTotal() {
-		return total.get();
-	}
-
-	public long getSuccessAmount() {
-		return successAmount.get();
-	}
-
-	public long getFailureAmount() {
-		return failureAmount.get();
-	}
-
-	public long incrementTotal() {
-		return this.total.incrementAndGet();
-	}
-
-	public long incrementSuccessAmount() {
-		return this.successAmount.incrementAndGet();
-	}
-
-	public long incrementFailureAmount() {
-		return this.failureAmount.incrementAndGet();
-	}
-}

+ 0 - 59
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/pipeline/Node.java

@@ -1,59 +0,0 @@
-package cn.com.qmth.examcloud.commons.helpers.pipeline;
-
-/**
- * 节点
- *
- * @author WANGWEI
- * @date 2019年12月12日
- * @Copyright (c) 2018-2020 http://www.qmth.com.cn/ All Rights Reserved.
- */
-public interface Node<KEYIN, VALUEIN, KEYOUT, VALUEOUT> {
-
-	/**
-	 * 启动
-	 *
-	 * @author WANGWEI
-	 */
-	void start();
-
-	/**
-	 * 设置下级节点
-	 *
-	 * @author WANGWEI
-	 * @param subNode
-	 */
-	void setLowerNode(Node<KEYOUT, VALUEOUT, ?, ?> lowerNode);
-
-	/**
-	 * 获取下级节点
-	 *
-	 * @author WANGWEI
-	 * @return
-	 */
-	Node<KEYOUT, VALUEOUT, ?, ?> getLowerNode();
-
-	/**
-	 * 获取存储器
-	 *
-	 * @author WANGWEI
-	 * @return
-	 */
-	Storer<KEYIN, VALUEIN> getStorer();
-
-	/**
-	 * 设置是否是首节点
-	 *
-	 * @author WANGWEI
-	 * @param first
-	 */
-	void setFirst(boolean first);
-
-	/**
-	 * 设置循环间隔
-	 *
-	 * @author WANGWEI
-	 * @param sleep
-	 */
-	void setSleep(int sleep);
-
-}

+ 0 - 40
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/pipeline/Storer.java

@@ -1,40 +0,0 @@
-package cn.com.qmth.examcloud.commons.helpers.pipeline;
-
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
-import com.google.common.collect.Maps;
-
-/**
- * 节点存储器
- *
- * @author WANGWEI
- * @date 2019年12月12日
- * @Copyright (c) 2018-2020 http://www.qmth.com.cn/ All Rights Reserved.
- */
-public class Storer<KEY, VALUE> {
-
-	private Map<KEY, VALUE> MAP = Maps.newConcurrentMap();
-
-	private Map<KEY, VALUE> BUFFER_MAP = Maps.newConcurrentMap();
-
-	public synchronized Set<Entry<KEY, VALUE>> getEntrySet() {
-		MAP.putAll(BUFFER_MAP);
-		BUFFER_MAP.clear();
-		return MAP.entrySet();
-	}
-
-	public synchronized void putElement(KEY key, VALUE value) {
-		BUFFER_MAP.put(key, value);
-	}
-
-	public synchronized boolean isEmpty() {
-		return MAP.isEmpty();
-	}
-
-	public synchronized void remove(KEY key) {
-		MAP.remove(key);
-	}
-
-}

+ 0 - 34
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/pipeline/TaskContext.java

@@ -1,34 +0,0 @@
-package cn.com.qmth.examcloud.commons.helpers.pipeline;
-
-import java.io.Serializable;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * 任务上下文(任务参数)
- *
- * @author WANGWEI
- * @date 2019年12月12日
- * @Copyright (c) 2018-2020 http://www.qmth.com.cn/ All Rights Reserved.
- */
-public class TaskContext implements Serializable {
-	private static final long serialVersionUID = 4979254175922604943L;
-
-	private final Map<String, Object> props = new ConcurrentHashMap<String, Object>();
-
-	public String get(String name) {
-		return get(name, String.class);
-	}
-
-	public <T> T get(String name, Class<T> t) {
-		Object value = props.get(name);
-		@SuppressWarnings("unchecked")
-		T ret = (T) value;
-		return ret;
-	}
-
-	public void put(String name, Object bean) {
-		props.put(name, bean);
-	}
-
-}

+ 0 - 185
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/poi/ExcelReader.java

@@ -1,185 +0,0 @@
-package cn.com.qmth.examcloud.commons.helpers.poi;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.util.List;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellType;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-
-import com.google.common.collect.Lists;
-
-/**
- * Excel解析器
- *
- * @author WANGWEI
- * @date 2018年3月30日
- * @Copyright (c) 2018-2020 http://www.qmth.com.cn/ All Rights Reserved.
- */
-public class ExcelReader {
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param sheet
-	 * @param columSize
-	 * @return
-	 */
-	public static List<String[]> readSheet(Sheet sheet, int columSize) {
-		List<String[]> list = Lists.newArrayList();
-		int firstRowNum = sheet.getFirstRowNum();
-		int lastRowNum = sheet.getLastRowNum();
-		for (int rowNum = firstRowNum; rowNum <= lastRowNum; rowNum++) {
-			Row row = sheet.getRow(rowNum);
-			if (row == null) {
-				continue;
-			}
-			String[] cells = new String[columSize];
-
-			for (int index = 0; index < columSize; index++) {
-				Cell cell = row.getCell(index);
-				cells[index] = getCellValue(cell);
-			}
-
-			list.add(cells);
-		}
-
-		return list;
-	}
-
-	/**
-	 * 获取sheet
-	 *
-	 * @author WANGWEI
-	 * @param workbook
-	 * @return
-	 */
-	public static List<Sheet> getSheet(Workbook workbook) {
-
-		List<Sheet> sheets = Lists.newArrayList();
-		for (int sheetNum = 0; sheetNum < workbook.getNumberOfSheets(); sheetNum++) {
-			Sheet sheet = workbook.getSheetAt(sheetNum);
-			sheets.add(sheet);
-		}
-		return sheets;
-	}
-
-	/**
-	 * 获取 Workbook 对象
-	 *
-	 * @author WANGWEI
-	 * @param file
-	 */
-	public static Workbook getWorkBook(File file) {
-
-		Workbook workbook = null;
-		try {
-			// 2007
-			workbook = new XSSFWorkbook(new FileInputStream(file));
-		} catch (Exception e) {
-			throw new RuntimeException(e);
-		}
-
-		return workbook;
-	}
-
-	/**
-	 * 获取单元格的字符串值
-	 *
-	 * @author WANGWEI
-	 * @param cell
-	 * @return
-	 */
-	public static String getCellValue(Cell cell) {
-		String value = "";
-		if (null == cell) {
-			return value;
-		}
-		cell.setCellType(CellType.STRING);
-		switch (cell.getCellTypeEnum()) {
-			case _NONE :
-				break;
-			case STRING :
-				value = cell.getStringCellValue();
-				break;
-			case NUMERIC :
-				// 待完善
-				value = String.valueOf(cell.getNumericCellValue());
-				break;
-			case BOOLEAN :
-				value = String.valueOf(cell.getBooleanCellValue());
-				break;
-			case BLANK :
-				value = "";
-				break;
-			default :
-				value = cell.toString();
-		}
-		return value.trim();
-	}
-
-	/**
-	 * 关闭资源
-	 *
-	 * @author WANGWEI
-	 * @param workbook
-	 */
-	public static void close(Workbook workbook) {
-		IOUtils.closeQuietly(workbook);
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param filePath
-	 * @param sheetId
-	 * @param columnSize
-	 * @return
-	 */
-	public static List<String[]> readSheetBySax(String filePath, int sheetId, int columnSize) {
-		List<String[]> list = Lists.newArrayList();
-
-		XlsxHandler xlsxHandler = new XlsxHandler(columnSize) {
-			@Override
-			public void optRows(int sheetIndex, int curRow, String[] row) {
-				list.add(row);
-			}
-		};
-
-		try {
-			xlsxHandler.processOneSheet(filePath, sheetId);
-		} catch (Exception e) {
-			throw new RuntimeException(e);
-		}
-
-		return list;
-	}
-	
-	public static List<String[]> readSheetBySax(InputStream is, int sheetId, int columnSize) {
-		List<String[]> list = Lists.newArrayList();
-
-		XlsxHandler xlsxHandler = new XlsxHandler(columnSize) {
-			@Override
-			public void optRows(int sheetIndex, int curRow, String[] row) {
-				list.add(row);
-			}
-		};
-
-		try {
-			xlsxHandler.processOneSheet(is, sheetId);
-		} catch (Exception e) {
-			throw new RuntimeException(e);
-		}
-
-		return list;
-	}
-
-}

+ 0 - 137
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/poi/ExcelWriter.java

@@ -1,137 +0,0 @@
-package cn.com.qmth.examcloud.commons.helpers.poi;
-
-import java.awt.Color;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.util.Date;
-import java.util.List;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.CellType;
-import org.apache.poi.ss.usermodel.FillPatternType;
-import org.apache.poi.util.IOUtils;
-import org.apache.poi.xssf.usermodel.XSSFCell;
-import org.apache.poi.xssf.usermodel.XSSFCellStyle;
-import org.apache.poi.xssf.usermodel.XSSFColor;
-import org.apache.poi.xssf.usermodel.XSSFDataFormat;
-import org.apache.poi.xssf.usermodel.XSSFRow;
-import org.apache.poi.xssf.usermodel.XSSFSheet;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-
-import cn.com.qmth.examcloud.commons.util.DateUtil.DatePatterns;
-
-/**
- * Excel 生成器
- *
- * @author WANGWEI
- * @date 2018年9月7日
- * @Copyright (c) 2018-2020 http://www.qmth.com.cn/ All Rights Reserved.
- */
-public class ExcelWriter {
-
-	/**
-	 * 写入excel文件
-	 *
-	 * @author WANGWEI
-	 * @param tableHeader
-	 * @param datas
-	 * @param file
-	 */
-	public static void write(String[] tableHeader, Class<?>[] types, List<Object[]> datas,
-			File file) {
-		// 2007
-		XSSFWorkbook workbook = null;
-		FileOutputStream out = null;
-		try {
-			// 2007
-			workbook = new XSSFWorkbook();
-
-			XSSFSheet sheet = workbook.createSheet();
-
-			XSSFCellStyle style = workbook.createCellStyle();
-			style.setFillForegroundColor(new XSSFColor(new Color(227, 239, 217)));
-			style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
-
-			XSSFRow firstRow = sheet.createRow(0);
-			for (int i = 0; i < tableHeader.length; i++) {
-				XSSFCell cell = firstRow.createCell(i);
-				cell.setCellStyle(style);
-				cell.setCellType(CellType.STRING);
-				cell.setCellValue(tableHeader[i]);
-			}
-
-			for (int k = 0; k < datas.size(); k++) {
-				XSSFRow nextRow = sheet.createRow(k + 1);
-				Object[] rowDatas = datas.get(k);
-
-				for (int j = 0; j < types.length; j++) {
-					Class<?> type = types[j];
-					Object value = rowDatas[j];
-
-					XSSFCell cell = nextRow.createCell(j);
-
-					if (type.equals(String.class)) {
-						cell.setCellType(CellType.STRING);
-						if (null != value) {
-							cell.setCellValue((String) value);
-						}
-					} else if (type.equals(Long.class)) {
-						cell.setCellType(CellType.NUMERIC);
-						if (null != value) {
-							cell.setCellValue((Long) value);
-						}
-					} else if (type.equals(Integer.class)) {
-						cell.setCellType(CellType.NUMERIC);
-						if (null != value) {
-							cell.setCellValue((Integer) value);
-						}
-					} else if (type.equals(Short.class)) {
-						cell.setCellType(CellType.NUMERIC);
-						if (null != value) {
-							cell.setCellValue((Short) value);
-						}
-					} else if (type.equals(Float.class)) {
-						cell.setCellType(CellType.NUMERIC);
-						if (null != value) {
-							cell.setCellValue((Float) value);
-						}
-					} else if (type.equals(Double.class)) {
-						cell.setCellType(CellType.NUMERIC);
-						if (null != value) {
-							cell.setCellValue((Double) value);
-						}
-					} else if (type.equals(Date.class)) {
-						CellStyle cs = workbook.createCellStyle();
-						XSSFDataFormat format = workbook.createDataFormat();
-						cs.setDataFormat(format.getFormat(DatePatterns.CHINA_DEFAULT));
-						cell.setCellStyle(cs);
-						cell.setCellType(CellType.NUMERIC);
-						if (null != value) {
-							cell.setCellValue((Date) value);
-						}
-					} else if (type.equals(Boolean.class)) {
-						cell.setCellType(CellType.BOOLEAN);
-						if (null != value) {
-							cell.setCellValue((Boolean) value);
-						}
-					} else {
-						IOUtils.closeQuietly(workbook);
-						throw new RuntimeException("cell type is wrong");
-					}
-				}
-			}
-
-			out = FileUtils.openOutputStream(file);
-			workbook.write(out);
-		} catch (RuntimeException e) {
-			throw e;
-		} catch (Throwable e) {
-			throw new RuntimeException(e);
-		} finally {
-			IOUtils.closeQuietly(out);
-			IOUtils.closeQuietly(workbook);
-		}
-	}
-
-}

+ 0 - 224
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/helpers/poi/XlsxHandler.java

@@ -1,224 +0,0 @@
-package cn.com.qmth.examcloud.commons.helpers.poi;
-
-import java.io.InputStream;
-import java.util.Iterator;
-
-import org.apache.commons.compress.utils.IOUtils;
-import org.apache.poi.openxml4j.opc.OPCPackage;
-import org.apache.poi.xssf.eventusermodel.XSSFReader;
-import org.apache.poi.xssf.model.SharedStringsTable;
-import org.apache.poi.xssf.usermodel.XSSFRichTextString;
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.DefaultHandler;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-/**
- * excel xlsx 文件解析
- *
- * @author WANGWEI
- * @date 2018年8月1日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public abstract class XlsxHandler extends DefaultHandler {
-
-	private String[] row;
-
-	private SharedStringsTable sst;
-
-	private String cellValue;
-
-	private boolean isString;
-
-	private int sheetIndex = -1;
-
-	private int curRow = 0;
-
-	private int curColumnIndex = 0;
-
-	private int columnSize = 0;
-
-	/**
-	 * 构造函数
-	 *
-	 * @param columnSize
-	 */
-	public XlsxHandler(int columnSize) {
-		super();
-		this.columnSize = columnSize;
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param sheetIndex
-	 * @param curRow
-	 * @param row
-	 */
-	public abstract void optRows(int sheetIndex, int curRow, String[] row);
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param filePath
-	 * @param sheetId
-	 * @throws Exception
-	 */
-	public void processOneSheet(String filePath, int sheetId) throws Exception {
-		OPCPackage pkg = null;
-		InputStream is = null;
-		try {
-			pkg = OPCPackage.open(filePath);
-			XSSFReader r = new XSSFReader(pkg);
-			SharedStringsTable sst = r.getSharedStringsTable();
-
-			XMLReader parser = XMLReaderFactory.createXMLReader();
-			this.sst = sst;
-			parser.setContentHandler(this);
-			is = r.getSheet("rId" + sheetId);
-			sheetIndex++;
-			InputSource sheetSource = new InputSource(is);
-			parser.parse(sheetSource);
-		} finally {
-			IOUtils.closeQuietly(is);
-			IOUtils.closeQuietly(pkg);
-		}
-	}
-	
-	public void processOneSheet(InputStream is, int sheetId) throws Exception {
-		OPCPackage pkg = null;
-		try {
-			pkg = OPCPackage.open(is);
-			XSSFReader r = new XSSFReader(pkg);
-			SharedStringsTable sst = r.getSharedStringsTable();
-
-			XMLReader parser = XMLReaderFactory.createXMLReader();
-			this.sst = sst;
-			parser.setContentHandler(this);
-			is = r.getSheet("rId" + sheetId);
-			sheetIndex++;
-			InputSource sheetSource = new InputSource(is);
-			parser.parse(sheetSource);
-		} finally {
-			IOUtils.closeQuietly(is);
-			IOUtils.closeQuietly(pkg);
-		}
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param filePath
-	 * @throws Exception
-	 */
-	public void process(String filePath) throws Exception {
-		OPCPackage pkg = null;
-		try {
-			pkg = OPCPackage.open(filePath);
-			XSSFReader r = new XSSFReader(pkg);
-			SharedStringsTable sst = r.getSharedStringsTable();
-
-			XMLReader parser = XMLReaderFactory.createXMLReader();
-			this.sst = sst;
-			parser.setContentHandler(this);
-
-			Iterator<InputStream> sheets = r.getSheetsData();
-			while (sheets.hasNext()) {
-				curRow = 0;
-				sheetIndex++;
-				InputStream sheet = null;
-				try {
-					sheet = sheets.next();
-					InputSource sheetSource = new InputSource(sheet);
-					parser.parse(sheetSource);
-				} finally {
-					IOUtils.closeQuietly(sheet);
-				}
-			}
-		} finally {
-			IOUtils.closeQuietly(pkg);
-		}
-	}
-
-	@Override
-	public void startElement(String uri, String localName, String name, Attributes attributes)
-			throws SAXException {
-		if (name.equals("c")) {
-			String cellType = attributes.getValue("t");
-			String x = attributes.getValue("r");
-			curColumnIndex = this.getColunmIndex(x);
-			if (cellType != null && cellType.equals("s")) {
-				isString = true;
-			} else {
-				isString = false;
-			}
-		}
-		cellValue = "";
-	}
-
-	@Override
-	public void characters(char[] ch, int start, int length) throws SAXException {
-		cellValue += new String(ch, start, length);
-	}
-
-	@Override
-	public void endElement(String uri, String localName, String name) throws SAXException {
-		if (isString) {
-			try {
-				int idx = Integer.parseInt(cellValue);
-				cellValue = new XSSFRichTextString(sst.getEntryAt(idx)).toString();
-			} catch (Exception e) {
-
-			}
-		}
-
-		if (null == row) {
-			row = new String[columnSize];
-		}
-
-		if (name.equals("v")) {
-			String value = cellValue.trim();
-			if (curColumnIndex - 1 < columnSize) {
-				row[curColumnIndex - 1] = value;
-			}
-		} else if (name.equals("row")) {
-			optRows(sheetIndex, curRow, row);
-			row = null;
-			curRow++;
-			curColumnIndex = 0;
-		}
-
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param x
-	 * @return
-	 */
-	private int getColunmIndex(String x) {
-		x = x.replaceAll("[^A-Z]", "");
-		byte[] bytes = x.getBytes();
-		int len = bytes.length;
-		float num = 0;
-		for (int i = 0; i < len; i++) {
-			num += (bytes[i] - 'A' + 1) * Math.pow(26, len - i - 1);
-		}
-		return (int) num;
-	}
-
-	public int getColumnSize() {
-		return columnSize;
-	}
-
-	public void setColumnSize(int columnSize) {
-		this.columnSize = columnSize;
-	}
-
-}

+ 0 - 110
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/logging/ExamCloudLog.java

@@ -1,110 +0,0 @@
-package cn.com.qmth.examcloud.commons.logging;
-
-/**
- * 通用日志写入器
- * 
- * @author WANGWEI
- */
-public interface ExamCloudLog {
-
-	/**
-	 * Is the logger instance enabled for the DEBUG level?
-	 *
-	 * @return True if this Logger is enabled for the DEBUG level, false otherwise.
-	 */
-	public boolean isDebugEnabled();
-
-	/**
-	 * Log a message at the DEBUG level.
-	 *
-	 * @param msg
-	 *            the message string to be logged
-	 */
-	public void debug(String msg);
-
-	/**
-	 * Log an exception (throwable) at the DEBUG level with an accompanying message.
-	 *
-	 * @param msg
-	 *            the message accompanying the exception
-	 * @param t
-	 *            the exception (throwable) to log
-	 */
-	public void debug(String msg, Throwable t);
-
-	/**
-	 * Is the logger instance enabled for the INFO level?
-	 *
-	 * @return True if this Logger is enabled for the INFO level, false otherwise.
-	 */
-	public boolean isInfoEnabled();
-
-	/**
-	 * Log a message at the INFO level.
-	 *
-	 * @param msg
-	 *            the message string to be logged
-	 */
-	public void info(String msg);
-
-	/**
-	 * Log an exception (throwable) at the INFO level with an accompanying message.
-	 *
-	 * @param msg
-	 *            the message accompanying the exception
-	 * @param t
-	 *            the exception (throwable) to log
-	 */
-	public void info(String msg, Throwable t);
-
-	/**
-	 * Is the logger instance enabled for the WARN level?
-	 *
-	 * @return True if this Logger is enabled for the WARN level, false otherwise.
-	 */
-	public boolean isWarnEnabled();
-
-	/**
-	 * Log a message at the WARN level.
-	 *
-	 * @param msg
-	 *            the message string to be logged
-	 */
-	public void warn(String msg);
-
-	/**
-	 * Log an exception (throwable) at the WARN level with an accompanying message.
-	 *
-	 * @param msg
-	 *            the message accompanying the exception
-	 * @param t
-	 *            the exception (throwable) to log
-	 */
-	public void warn(String msg, Throwable t);
-
-	/**
-	 * Is the logger instance enabled for the ERROR level?
-	 *
-	 * @return True if this Logger is enabled for the ERROR level, false otherwise.
-	 */
-	public boolean isErrorEnabled();
-
-	/**
-	 * Log a message at the ERROR level.
-	 *
-	 * @param msg
-	 *            the message string to be logged
-	 */
-	public void error(String msg);
-
-	/**
-	 * Log an exception (throwable) at the ERROR level with an accompanying message.
-	 *
-	 * @param msg
-	 *            the message accompanying the exception
-	 * @param t
-	 *            the exception (throwable) to log
-	 */
-	public void error(String msg, Throwable t);
-
-}

+ 0 - 78
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/logging/ExamCloudLogFactory.java

@@ -1,78 +0,0 @@
-package cn.com.qmth.examcloud.commons.logging;
-
-import java.lang.reflect.Constructor;
-
-/**
- * 通用日志写入器工厂
- * 
- * @author WANGWEI
- */
-public class ExamCloudLogFactory {
-
-	private static Constructor<?> logConstructor;
-
-	static {
-		tryImplementation("org.slf4j.Logger", SLF4JImpl.class.getName());
-
-		if (logConstructor == null) {
-			try {
-				logConstructor = NoLoggingImpl.class.getConstructor(String.class);
-			} catch (Exception e) {
-				throw new IllegalStateException(e.getMessage(), e);
-			}
-		}
-	}
-
-	/**
-	 * @param testClassName
-	 * @param implClassName
-	 */
-	private static void tryImplementation(String testClassName, String implClassName) {
-		if (logConstructor != null) {
-			return;
-		}
-
-		try {
-			Resources.classForName(testClassName);
-			Class<?> implClass = Resources.classForName(implClassName);
-			logConstructor = implClass.getConstructor(new Class[] { String.class });
-
-			Class<?> declareClass = logConstructor.getDeclaringClass();
-			if (!ExamCloudLog.class.isAssignableFrom(declareClass)) {
-				logConstructor = null;
-			}
-
-			try {
-				if (null != logConstructor) {
-					logConstructor.newInstance(ExamCloudLogFactory.class.getName());
-				}
-			} catch (Throwable t) {
-				logConstructor = null;
-			}
-
-		} catch (Throwable t) {
-			// skip
-		}
-	}
-
-	/**
-	 * @param clazz
-	 * @return
-	 */
-	public static ExamCloudLog getLog(Class<?> clazz) {
-		return getLog(clazz.getName());
-	}
-
-	/**
-	 * @param loggerName
-	 * @return
-	 */
-	public static ExamCloudLog getLog(String loggerName) {
-		try {
-			return (ExamCloudLog) logConstructor.newInstance(loggerName);
-		} catch (Throwable t) {
-			throw new RuntimeException("Error creating logger for logger '" + loggerName + "'.  Cause: " + t, t);
-		}
-	}
-
-}

Неке датотеке нису приказане због велике количине промена