Browse Source

刷新密钥

tags/24080901
PoffyZhang 1 year ago
parent
commit
f985fadd75
7 changed files with 65 additions and 3 deletions
  1. +35
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java
  2. +5
    -0
      pmapi/src/main/resources/application-dev.yml
  3. +5
    -0
      pmapi/src/main/resources/application-pre.yml
  4. +5
    -0
      pmapi/src/main/resources/application-prod.yml
  5. +5
    -0
      pmapi/src/test/resources/application-dev.yml
  6. +5
    -0
      pmapi/src/test/resources/application-pre.yml
  7. +5
    -0
      pmapi/src/test/resources/application-prod.yml

+ 35
- 3
pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java View File

@@ -49,6 +49,11 @@ public class DingInfoPullController {
@Value("${irs.interface-local-refresh.refresh-token-url}")
private String refreshTokenUrl;

@Value("${irs.interface-refresh.request-token-url}")
private String govRequestTokenUrl;
@Value("${irs.interface-refresh.refresh-token-url}")
private String govRefreshTokenUrl;

@GetMapping("/employee")
public void employeeBatchGet() {
employeeBatchGetTask.batchGetEmployeeTask();
@@ -106,15 +111,15 @@ public class DingInfoPullController {
return procDefManage.initByArea(areaCode);
}

@ApiOperation(value = "系统流程配置初始化", notes = "系统流程配置初始化")
@ApiOperation(value = "省级主管接口测试", notes = "省级主管接口测试")
@GetMapping("/test-org")
public String testOrg() throws NoSuchAlgorithmException {
long timestamp = System.currentTimeMillis();
String appSecret = "496f0f2a19994f76b4fd9dae087366c7";
String appKey = "A331101453557202109017383";
String dataName = "大数据管理局";
String secret = refreshTokenService.refreshToken(appKey,appSecret,requestTokenUrl,refreshTokenUrl);
String method = "GET";
String secret = refreshTokenService.refreshToken(appKey,appSecret,requestTokenUrl,refreshTokenUrl,method);
String sign = CryptUtils.MD5Encode(appKey + secret + timestamp);
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory();
RestTemplate restTemplate;
@@ -132,4 +137,31 @@ public class DingInfoPullController {

return forEntity.getBody();
}

@ApiOperation(value = "测试项目归并", notes = "测试项目归并")
@GetMapping("/test-guibing")
public String testGuibing() throws NoSuchAlgorithmException {
long timestamp = System.currentTimeMillis();
String appSecret = "496f0f2a19994f76b4fd9dae087366c7";
String appKey = "A331101453557202109017383";
String dataName = "大数据管理局";
String method = "POST";
String secret = refreshTokenService.refreshToken(appKey,appSecret,requestTokenUrl,refreshTokenUrl,method);
String sign = CryptUtils.MD5Encode(appKey + secret + timestamp);
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory();
RestTemplate restTemplate;
if(Objects.nonNull(factory)){
restTemplate = new RestTemplate(factory);
}else{
restTemplate = new RestTemplate();
}

String url = "https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/" +
"dataSharing/5crv7i4727abLCv0.htm?requestTime=1494485467272&sign=11b39a2989f781d9a7eb50abeaeaac53&appKey=7520d721086111e7985b008cfaeb3d74&capCode=abc&appId=abc&capTime=abc";
log.info("url :{}",url);
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class);
log.info(forEntity.getBody());

return forEntity.getBody();
}
}

+ 5
- 0
pmapi/src/main/resources/application-dev.yml View File

@@ -223,7 +223,12 @@ irs:
url: https://interface.zjzwfw.gov.cn/gateway/api/001003001029/dataSharing/XS8daav3bcemZ3Ra.htm
appScret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383
interface-refresh:
method: POST
request-token-url: https://interface.zjzwfw.gov.cn/gateway/app/refreshTokenByKey.htm?appKey={appKey}&requestTime={requestTime}&sign={sign}
refresh-token-url: https://interface.zjzwfw.gov.cn/gateway/app/refreshTokenBySec.htm?appKey={appKey}&requestTime={requestTime}&sign={sign}
interface-local-refresh:
method: GET
request-token-url: https://interface.ls.local/a/api/requestTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign}
refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign}
hostname: iZbp13nwyvib53j4j1p2xoZ


+ 5
- 0
pmapi/src/main/resources/application-pre.yml View File

@@ -226,7 +226,12 @@ irs:
url: https://interface.zjzwfw.gov.cn/gateway/api/001003001029/dataSharing/XS8daav3bcemZ3Ra.htm
appScret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383
interface-refresh:
method: POST
request-token-url: https://interface.zjzwfw.gov.cn/gateway/app/refreshTokenByKey.htm?appKey={appKey}&requestTime={requestTime}&sign={sign}
refresh-token-url: https://interface.zjzwfw.gov.cn/gateway/app/refreshTokenBySec.htm?appKey={appKey}&requestTime={requestTime}&sign={sign}
interface-local-refresh:
method: GET
request-token-url: https://interface.ls.local/a/api/requestTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign}
refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign}
hostname: iZ6mx01asxnsmennpzoxooZ


+ 5
- 0
pmapi/src/main/resources/application-prod.yml View File

@@ -226,7 +226,12 @@ irs:
url: https://interface.zjzwfw.gov.cn/gateway/api/001003001029/dataSharing/XS8daav3bcemZ3Ra.htm
appScret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383
interface-refresh:
method: POST
request-token-url: https://interface.zjzwfw.gov.cn/gateway/app/refreshTokenByKey.htm?appKey={appKey}&requestTime={requestTime}&sign={sign}
refresh-token-url: https://interface.zjzwfw.gov.cn/gateway/app/refreshTokenBySec.htm?appKey={appKey}&requestTime={requestTime}&sign={sign}
interface-local-refresh:
method: GET
request-token-url: https://interface.ls.local/a/api/requestTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign}
refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign}
hostname: iZ6mx01gyeodd80imxd2gbZ


+ 5
- 0
pmapi/src/test/resources/application-dev.yml View File

@@ -222,7 +222,12 @@ irs:
url: https://interface.zjzwfw.gov.cn/gateway/api/001003001029/dataSharing/XS8daav3bcemZ3Ra.htm
appScret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383
interface-refresh:
method: POST
request-token-url: https://interface.zjzwfw.gov.cn/gateway/app/refreshTokenByKey.htm?appKey={appKey}&requestTime={requestTime}&sign={sign}
refresh-token-url: https://interface.zjzwfw.gov.cn/gateway/app/refreshTokenBySec.htm?appKey={appKey}&requestTime={requestTime}&sign={sign}
interface-local-refresh:
method: GET
request-token-url: https://interface.ls.local/a/api/requestTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign}
refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign}
hostname: iZbp13nwyvib53j4j1p2xoZ


+ 5
- 0
pmapi/src/test/resources/application-pre.yml View File

@@ -226,7 +226,12 @@ irs:
url: https://interface.zjzwfw.gov.cn/gateway/api/001003001029/dataSharing/XS8daav3bcemZ3Ra.htm
appScret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383
interface-refresh:
method: POST
request-token-url: https://interface.zjzwfw.gov.cn/gateway/app/refreshTokenByKey.htm?appKey={appKey}&requestTime={requestTime}&sign={sign}
refresh-token-url: https://interface.zjzwfw.gov.cn/gateway/app/refreshTokenBySec.htm?appKey={appKey}&requestTime={requestTime}&sign={sign}
interface-local-refresh:
method: GET
request-token-url: https://interface.ls.local/a/api/requestTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign}
refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign}
hostname: iZ6mx01asxnsmennpzoxooZ


+ 5
- 0
pmapi/src/test/resources/application-prod.yml View File

@@ -221,7 +221,12 @@ irs:
url: https://interface.zjzwfw.gov.cn/gateway/api/001003001029/dataSharing/XS8daav3bcemZ3Ra.htm
appScret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383
interface-refresh:
method: POST
request-token-url: https://interface.zjzwfw.gov.cn/gateway/app/refreshTokenByKey.htm?appKey={appKey}&requestTime={requestTime}&sign={sign}
refresh-token-url: https://interface.zjzwfw.gov.cn/gateway/app/refreshTokenBySec.htm?appKey={appKey}&requestTime={requestTime}&sign={sign}
interface-local-refresh:
method: GET
request-token-url: https://interface.ls.local/a/api/requestTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign}
refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey?appKey={appKey}&requestTime={requestTime}&sign={sign}
hostname: iZ6mx01gyeodd80imxd2gbZ


Loading…
Cancel
Save