package com.ruoyi.web.controller.system;
|
|
import com.alibaba.fastjson2.JSONObject;
|
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.signature.AESUtils;
|
import com.ruoyi.framework.web.domain.threeAccess.req.AccessReqDTO;
|
import com.ruoyi.framework.web.service.ThreeInstitutionService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
@RestController
|
public class ThreeAccessController extends BaseController {
|
@Autowired
|
private ThreeInstitutionService threeInstitutionService;
|
|
@PostMapping("/gov-server/token")
|
public AjaxResult getToken(@RequestBody JSONObject jsonObject){
|
|
return ok(threeInstitutionService.getToken(jsonObject));
|
}
|
|
public static void main(String[] args) {
|
AccessReqDTO accessReqDTO = new AccessReqDTO();
|
/* accessReqDTO.setAccessKey("Opq98lRKQ0NbBR59Ddi0");
|
accessReqDTO.setSecretKey("AKKYCSZCYGCxCmxR7bsO");*/
|
accessReqDTO.setAccessKey("lJyzhvt87v3o7M0Ic6cT");
|
accessReqDTO.setSecretKey("93ED9pfi8fuk8ZVmxSNQ");
|
String jsonString = JSONObject.toJSONString(accessReqDTO);
|
String encrypt = AESUtils.encrypt(jsonString);
|
System.out.println(encrypt);
|
String decrypt = AESUtils.decrypt("BhSazFtvofCRelDGgefpPJ5ObweXFr5qU7vhnjZvhGwK1LuCX1ErNvERLfOx1WKbIIYqHe8ZmpwnfTf6k6eaRZtIJ2HJJMspNDWQUdxPKAqETJRfIm/H+u7awqB6IE//e7YEwlIvp/DWqhsmQH5b/g==");
|
System.out.println(decrypt);
|
}
|
|
/*public static void main(String[] args) {
|
|
String jsonString = "{\"uuid\":\"1edb2886-fc5e-6519-8210-1b89dd2c32b8\",\"batchName\":\"自动推荐二\",\"haveExam\":1,\"status\":2,\"trainOrgName\":\"吉林省安金环境安全技术有限公司\",\"courseList\":[{\"courseUuid\":\"f3386e2c-4c44-11ec-ac7c-00ff07067ec4\",\"courseLessonNum\":50.80,\"delFlag\":0}],\"chapterList\":[{\"chapterUuid\":\"7b251404-4c51-11ec-ac7c-00ff07067ec4\",\"chapterLessonNum\":2.05,\"delFlag\":0,\"children\":[{\"chapterUuid\":\"7b255c0a-4c51-11ec-ac7c-00ff07067ec4\",\"chapterLessonNum\":0.74,\"delFlag\":0,\"children\":null},{\"chapterUuid\":\"7b2570f5-4c51-11ec-ac7c-00ff07067ec4\",\"chapterLessonNum\":0.50,\"delFlag\":0,\"children\":null},{\"chapterUuid\":\"0bb6506a-ac46-11ed-b08c-00ff07067ec4\",\"chapterLessonNum\":0.81,\"delFlag\":0,\"children\":null}]}],\"batchLessonNum\":2.05,\"delFlag\":0}";
|
String encrypt = AESUtils.encrypt(jsonString);
|
System.out.println(encrypt);
|
String decrypt = AESUtils.decrypt("BhSazFtvofCRelDGgefpPEG4F49MgY8G3hs3mGPsaE8LO964ZGizG/MUov8g8W1rm+CBYy3WdWaWDOrglO6vitPeC+q4gCeIUHFSfEmic1pshDf6TcvHd0DTa5mMvmPKK8RH9e0EGUo/PggbziF3NQ==");
|
System.out.println(decrypt);
|
}*/
|
|
}
|