Browse Source

刷新密钥

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

+ 4
- 0
pmapi/pom.xml View File

@@ -207,6 +207,10 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.ningdatech</groupId> <groupId>com.ningdatech</groupId>
<artifactId>nd-irs-starter</artifactId>
</dependency>
<dependency>
<groupId>com.ningdatech</groupId>
<artifactId>nd-yxt-starter</artifactId> <artifactId>nd-yxt-starter</artifactId>
<version>1.0.0</version> <version>1.0.0</version>
</dependency> </dependency>


+ 10
- 0
pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java View File

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.ding.controller; package com.ningdatech.pmapi.ding.controller;


import com.ningdatech.irs.service.IRefreshTokenService;
import com.ningdatech.pmapi.common.util.CryptUtils; import com.ningdatech.pmapi.common.util.CryptUtils;
import com.ningdatech.pmapi.common.util.HttpUtil; import com.ningdatech.pmapi.common.util.HttpUtil;
import com.ningdatech.pmapi.ding.task.EmployeeBatchGetTask; import com.ningdatech.pmapi.ding.task.EmployeeBatchGetTask;
@@ -9,6 +10,7 @@ import com.ningdatech.pmapi.organization.manage.ProcDefManage;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -37,6 +39,12 @@ public class DingInfoPullController {


private final ProcDefManage procDefManage; private final ProcDefManage procDefManage;


private final IRefreshTokenService refreshTokenService;

@Value("${irs.interface-local-refresh.request-token-url}")
private String requestTokenUrl;
@Value("${irs.interface-local-refresh.refresh-token-url}")
private String refreshTokenUrl;


@GetMapping("/employee") @GetMapping("/employee")
public void employeeBatchGet() { public void employeeBatchGet() {
@@ -102,6 +110,8 @@ public class DingInfoPullController {
String appSecret = "496f0f2a19994f76b4fd9dae087366c7"; String appSecret = "496f0f2a19994f76b4fd9dae087366c7";
String appKey = "A331101453557202109017383"; String appKey = "A331101453557202109017383";
String dataName = "大数据管理局"; String dataName = "大数据管理局";

String secret = refreshTokenService.refreshToken(appKey,appSecret,requestTokenUrl,refreshTokenUrl);
String sign = CryptUtils.MD5Encode(appKey + appSecret + timestamp); String sign = CryptUtils.MD5Encode(appKey + appSecret + timestamp);
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory(); HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory();
RestTemplate restTemplate; RestTemplate restTemplate;


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

@@ -223,6 +223,9 @@ irs:
url: https://interface.zjzwfw.gov.cn/gateway/api/001003001029/dataSharing/XS8daav3bcemZ3Ra.htm url: https://interface.zjzwfw.gov.cn/gateway/api/001003001029/dataSharing/XS8daav3bcemZ3Ra.htm
appScret: 496f0f2a19994f76b4fd9dae087366c7 appScret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383 appKey: A331101453557202109017383
interface-local-refresh:
request-token-url: https://interface.ls.local/a/api/requestTokenKey
refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey
hostname: iZbp13nwyvib53j4j1p2xoZ hostname: iZbp13nwyvib53j4j1p2xoZ


login: login:


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

@@ -226,6 +226,9 @@ irs:
url: https://interface.zjzwfw.gov.cn/gateway/api/001003001029/dataSharing/XS8daav3bcemZ3Ra.htm url: https://interface.zjzwfw.gov.cn/gateway/api/001003001029/dataSharing/XS8daav3bcemZ3Ra.htm
appScret: 496f0f2a19994f76b4fd9dae087366c7 appScret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383 appKey: A331101453557202109017383
interface-local-refresh:
request-token-url: https://interface.ls.local/a/api/requestTokenKey
refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey
hostname: iZ6mx01asxnsmennpzoxooZ hostname: iZ6mx01asxnsmennpzoxooZ
login: login:
phone-verify-code: phone-verify-code:


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

@@ -226,6 +226,9 @@ irs:
url: https://interface.zjzwfw.gov.cn/gateway/api/001003001029/dataSharing/XS8daav3bcemZ3Ra.htm url: https://interface.zjzwfw.gov.cn/gateway/api/001003001029/dataSharing/XS8daav3bcemZ3Ra.htm
appScret: 496f0f2a19994f76b4fd9dae087366c7 appScret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383 appKey: A331101453557202109017383
interface-local-refresh:
request-token-url: https://interface.ls.local/a/api/requestTokenKey
refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey
hostname: iZ6mx01gyeodd80imxd2gbZ hostname: iZ6mx01gyeodd80imxd2gbZ
login: login:
phone-verify-code: phone-verify-code:


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

@@ -222,6 +222,9 @@ irs:
url: https://interface.zjzwfw.gov.cn/gateway/api/001003001029/dataSharing/XS8daav3bcemZ3Ra.htm url: https://interface.zjzwfw.gov.cn/gateway/api/001003001029/dataSharing/XS8daav3bcemZ3Ra.htm
appScret: 496f0f2a19994f76b4fd9dae087366c7 appScret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383 appKey: A331101453557202109017383
interface-local-refresh:
request-token-url: https://interface.ls.local/a/api/requestTokenKey
refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey
hostname: iZbp13nwyvib53j4j1p2xoZ hostname: iZbp13nwyvib53j4j1p2xoZ


login: login:


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

@@ -226,6 +226,9 @@ irs:
url: https://interface.zjzwfw.gov.cn/gateway/api/001003001029/dataSharing/XS8daav3bcemZ3Ra.htm url: https://interface.zjzwfw.gov.cn/gateway/api/001003001029/dataSharing/XS8daav3bcemZ3Ra.htm
appScret: 496f0f2a19994f76b4fd9dae087366c7 appScret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383 appKey: A331101453557202109017383
interface-local-refresh:
request-token-url: https://interface.ls.local/a/api/requestTokenKey
refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey
hostname: iZ6mx01asxnsmennpzoxooZ hostname: iZ6mx01asxnsmennpzoxooZ
login: login:
phone-verify-code: phone-verify-code:


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

@@ -221,6 +221,9 @@ irs:
url: https://interface.zjzwfw.gov.cn/gateway/api/001003001029/dataSharing/XS8daav3bcemZ3Ra.htm url: https://interface.zjzwfw.gov.cn/gateway/api/001003001029/dataSharing/XS8daav3bcemZ3Ra.htm
appScret: 496f0f2a19994f76b4fd9dae087366c7 appScret: 496f0f2a19994f76b4fd9dae087366c7
appKey: A331101453557202109017383 appKey: A331101453557202109017383
interface-local-refresh:
request-token-url: https://interface.ls.local/a/api/requestTokenKey
refresh-token-url: https://interface.ls.local/a/api/refreshTokenKey
hostname: iZ6mx01gyeodd80imxd2gbZ hostname: iZ6mx01gyeodd80imxd2gbZ
login: login:
phone-verify-code: phone-verify-code:


+ 5
- 0
pom.xml View File

@@ -138,6 +138,11 @@
<version>1.0.0</version> <version>1.0.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.ningdatech</groupId>
<artifactId>nd-irs-starter</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>joda-time</groupId> <groupId>joda-time</groupId>
<artifactId>joda-time</artifactId> <artifactId>joda-time</artifactId>
<version>2.10.6</version> <version>2.10.6</version>


Loading…
Cancel
Save