|
@@ -7,6 +7,7 @@ import com.qmth.boot.core.solar.crypto.AppLicenseUtil;
|
|
|
import com.qmth.boot.tools.signature.SignatureEntity;
|
|
|
import com.qmth.boot.tools.signature.SignatureType;
|
|
|
import com.qmth.distributed.print.business.service.AuthInfoService;
|
|
|
+import com.qmth.teachcloud.common.config.DictionaryConfig;
|
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
|
import com.qmth.teachcloud.common.entity.BasicSchool;
|
|
|
import com.qmth.teachcloud.common.service.CommonCacheService;
|
|
@@ -49,6 +50,9 @@ public class TSAuthController {
|
|
|
@Resource
|
|
|
CommonCacheService commonCacheService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ DictionaryConfig dictionaryConfig;
|
|
|
+
|
|
|
@ApiOperation(value = "导出硬件信息")
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "导出硬件信息", response = Object.class)})
|
|
|
@RequestMapping(value = "/export/device/info", method = RequestMethod.POST)
|
|
@@ -87,29 +91,41 @@ public class TSAuthController {
|
|
|
public void testPush() throws IOException {
|
|
|
Long schoolId = SystemConstant.getHeadOrUserSchoolId();
|
|
|
BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
|
|
|
+ Long timestamp = System.currentTimeMillis();
|
|
|
// /**
|
|
|
// * 测试推送学期
|
|
|
// */
|
|
|
-// String url = "/api/report/open/semester_edit";
|
|
|
// BasicSemesterParams basicSemesterParams = new BasicSemesterParams("测试学期1", System.currentTimeMillis(), System.currentTimeMillis() + 1L);
|
|
|
-// Long timestamp = System.currentTimeMillis();
|
|
|
-// String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, url, timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
|
|
|
-// String result = HttpUtil.postJson("http://127.0.0.1:7004" + url, JacksonUtil.parseJson(basicSemesterParams), accessToken, timestamp);
|
|
|
+// String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, dictionaryConfig.reportOpenDomain().getSemesterApi(), timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
|
|
|
+// String result = HttpUtil.postJson(dictionaryConfig.reportOpenDomain().getHostUrl() + dictionaryConfig.reportOpenDomain().getSemesterApi(), JacksonUtil.parseJson(basicSemesterParams), accessToken, timestamp);
|
|
|
+// if (Objects.nonNull(result)) {
|
|
|
+// log.info("result:{}", JacksonUtil.parseJson(result));
|
|
|
+// }
|
|
|
+
|
|
|
+// /**
|
|
|
+// * 测试推送考试
|
|
|
+// */
|
|
|
+// Map<String, Object> map = new HashMap<>();
|
|
|
+// map.computeIfAbsent("examName", v -> "测试考试1");
|
|
|
+// map.computeIfAbsent("examTime", v -> timestamp);
|
|
|
+// map.computeIfAbsent("semesterId", v -> 262908000564412416L);
|
|
|
+// String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, dictionaryConfig.reportOpenDomain().getExamApi(), timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
|
|
|
+// String result = HttpUtil.postJson(dictionaryConfig.reportOpenDomain().getHostUrl() + dictionaryConfig.reportOpenDomain().getExamApi(), JacksonUtil.parseJson(map), accessToken, timestamp);
|
|
|
// if (Objects.nonNull(result)) {
|
|
|
// log.info("result:{}", JacksonUtil.parseJson(result));
|
|
|
// }
|
|
|
|
|
|
/**
|
|
|
- * 测试推送考试
|
|
|
+ * 测试推送分析课程(试卷)
|
|
|
*/
|
|
|
- String url = "/api/report/open/exam_edit";
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
- Long timestamp = System.currentTimeMillis();
|
|
|
- map.computeIfAbsent("examName", v -> "测试考试1");
|
|
|
- map.computeIfAbsent("examTime", v -> timestamp);
|
|
|
- map.computeIfAbsent("semesterId", v -> 262908000564412416L);
|
|
|
- String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, url, timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
|
|
|
- String result = HttpUtil.postJson("http://127.0.0.1:7004" + url, JacksonUtil.parseJson(map), accessToken, timestamp);
|
|
|
+ map.computeIfAbsent("examId", v -> 262946761763454976L);
|
|
|
+ map.computeIfAbsent("courseCode", v -> 2022052700001L + "A");//试卷编号+卷型
|
|
|
+ map.computeIfAbsent("courseName", v -> "测试课程1");
|
|
|
+ map.computeIfAbsent("paperType", v -> "A");
|
|
|
+ map.computeIfAbsent("teachCollegeName", v -> "测试机构1");//机构名称
|
|
|
+ String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, dictionaryConfig.reportOpenDomain().getCourseApi(), timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
|
|
|
+ String result = HttpUtil.postJson(dictionaryConfig.reportOpenDomain().getHostUrl() + dictionaryConfig.reportOpenDomain().getCourseApi(), JacksonUtil.parseJson(map), accessToken, timestamp);
|
|
|
if (Objects.nonNull(result)) {
|
|
|
log.info("result:{}", JacksonUtil.parseJson(result));
|
|
|
}
|