|
@@ -8,7 +8,6 @@ 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.enums.RoleTypeEnum;
|
|
|
import com.qmth.teachcloud.common.service.CommonCacheService;
|
|
|
import com.qmth.teachcloud.common.util.*;
|
|
|
import io.swagger.annotations.*;
|
|
@@ -125,55 +124,50 @@ public class TSAuthController {
|
|
|
// 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);
|
|
|
+// String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, dictionaryConfig.reportOpenDomain().getCourseEditApi(), timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
|
|
|
+// String result = HttpUtil.postJson(dictionaryConfig.reportOpenDomain().getHostUrl() + dictionaryConfig.reportOpenDomain().getCourseEditApi(), JacksonUtil.parseJson(map), accessToken, timestamp);
|
|
|
+// if (Objects.nonNull(result)) {
|
|
|
+// log.info("result:{}", JacksonUtil.parseJson(result));
|
|
|
+// }
|
|
|
+
|
|
|
+// /**
|
|
|
+// * 测试单点登录
|
|
|
+// */
|
|
|
+// Map<String, Object> map = new HashMap<>();
|
|
|
+// map.computeIfAbsent("loginName", v -> "admin");
|
|
|
+// map.computeIfAbsent("role", v -> RoleTypeEnum.OFFICE_TEACHER);
|
|
|
+// map.computeIfAbsent("orgName", v -> "本科生院");
|
|
|
+// map.computeIfAbsent("realName", v -> "admin");
|
|
|
+// map.computeIfAbsent("mobileNumber", v -> "18008659001");
|
|
|
+// map.computeIfAbsent("returnUrl", v -> "https://www.baidu.com");
|
|
|
+// String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, dictionaryConfig.reportOpenDomain().getSsoLoginApi(), timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
|
|
|
+// String result = HttpUtil.postJson(dictionaryConfig.reportOpenDomain().getHostUrl() + dictionaryConfig.reportOpenDomain().getSsoLoginApi(), JacksonUtil.parseJson(map), accessToken, timestamp);
|
|
|
// if (Objects.nonNull(result)) {
|
|
|
// log.info("result:{}", JacksonUtil.parseJson(result));
|
|
|
// }
|
|
|
|
|
|
/**
|
|
|
- * 测试单点登录
|
|
|
+ * 测试生成课程(试卷)分析报告接口
|
|
|
*/
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
- map.computeIfAbsent("loginName", v -> "admin");
|
|
|
- map.computeIfAbsent("role", v -> RoleTypeEnum.OFFICE_TEACHER);
|
|
|
- map.computeIfAbsent("orgName", v -> "本科生院");
|
|
|
- map.computeIfAbsent("realName", v -> "admin");
|
|
|
- map.computeIfAbsent("mobileNumber", v -> "18008659001");
|
|
|
- map.computeIfAbsent("returnUrl", v -> "https://www.baidu.com");
|
|
|
- String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, dictionaryConfig.reportOpenDomain().getSsoLoginApi(), timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
|
|
|
- String result = HttpUtil.postJson(dictionaryConfig.reportOpenDomain().getHostUrl() + dictionaryConfig.reportOpenDomain().getSsoLoginApi(), JacksonUtil.parseJson(map), accessToken, timestamp);
|
|
|
+ map.computeIfAbsent("examId", v -> 262946761763454976L);
|
|
|
+ map.computeIfAbsent("courseCode", v -> 2022052700001L + "A");//试卷编号+卷型
|
|
|
+ String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, dictionaryConfig.reportOpenDomain().getCalculateApi(), timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
|
|
|
+ String result = HttpUtil.postJson(dictionaryConfig.reportOpenDomain().getHostUrl() + dictionaryConfig.reportOpenDomain().getCalculateApi(), JacksonUtil.parseJson(map), accessToken, timestamp);
|
|
|
if (Objects.nonNull(result)) {
|
|
|
log.info("result:{}", JacksonUtil.parseJson(result));
|
|
|
}
|
|
|
|
|
|
-// SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
-// Long schoolId = SystemConstant.getHeadOrUserSchoolId();
|
|
|
-// BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
|
|
|
-// JSONObject jsonObject = new JSONObject();
|
|
|
-// jsonObject.put("orgId", basicSchool.getId());
|
|
|
-// jsonObject.put("orgCode", basicSchool.getCode());
|
|
|
-// jsonObject.put("accessKey", basicSchool.getAccessKey());
|
|
|
-// jsonObject.put("accessSecret", basicSchool.getAccessSecret());
|
|
|
-// jsonObject.put("createId", sysUser.getId());
|
|
|
-// jsonObject.put("createUserName", sysUser.getRealName());
|
|
|
-// jsonObject.put("callbackUrl", "/api/admin/auth/test/callback");
|
|
|
-// Long timestamp = System.currentTimeMillis();
|
|
|
-// String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, "/api/report/open/basic/examination/data", timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
|
|
|
-// String result = HttpUtil.post("http://127.0.0.1:7004/api/report/open/basic/examination/data", jsonObject.toJSONString(), accessToken, timestamp);
|
|
|
+// /**
|
|
|
+// * 测试删除分析课程(试卷)
|
|
|
+// */
|
|
|
+// Map<String, Object> map = new HashMap<>();
|
|
|
+// map.computeIfAbsent("examId", v -> 262946761763454976L);
|
|
|
+// map.computeIfAbsent("courseCode", v -> 2022052700001L + "A");//试卷编号+卷型
|
|
|
+// String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, dictionaryConfig.reportOpenDomain().getCourseDelApi(), timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
|
|
|
+// String result = HttpUtil.postJson(dictionaryConfig.reportOpenDomain().getHostUrl() + dictionaryConfig.reportOpenDomain().getCourseDelApi(), JacksonUtil.parseJson(map), accessToken, timestamp);
|
|
|
// if (Objects.nonNull(result)) {
|
|
|
// log.info("result:{}", JacksonUtil.parseJson(result));
|
|
|
-// }
|
|
|
+// }
|
|
|
}
|
|
|
-
|
|
|
-// @ApiOperation(value = "测试教研分析回调接口")
|
|
|
-// @ApiResponses({@ApiResponse(code = 200, message = "测试教研分析回调接口", response = Objects.class)})
|
|
|
-// @RequestMapping(value = "/test/callback", method = RequestMethod.POST)
|
|
|
-// @Aac(auth = BOOL.FALSE)
|
|
|
-// public Result testCallback(@ApiParam(value = "接收教研分析回调数据", required = true) @RequestBody String result) throws IOException {
|
|
|
-// log.info("testCallback,result:{}", result);
|
|
|
-// String decodeJson = URLDecoder.decode(result, SystemConstant.CHARSET_NAME);
|
|
|
-// log.info("testCallback decodeJson:{}", decodeJson);
|
|
|
-// return ResultUtil.ok(System.currentTimeMillis());
|
|
|
-// }
|
|
|
}
|