|
|
@@ -85,9 +85,6 @@ public class AppIrsManage { |
|
|
|
@Value("${irs.push-project-detail.url}") |
|
|
|
private String pushProjectUrl; |
|
|
|
|
|
|
|
@Value("${irs.push-project-detail.interfaceName}") |
|
|
|
private String pushProjectInterfaceName; |
|
|
|
|
|
|
|
@Value("${irs.push-project-detail.appKey}") |
|
|
|
private String pushProjectAppKey; |
|
|
|
|
|
|
@@ -134,7 +131,7 @@ public class AppIrsManage { |
|
|
|
long timestamp = System.currentTimeMillis(); |
|
|
|
String areaCode = project.getAreaCode(); |
|
|
|
String projectName = project.getProjectName(); |
|
|
|
String requestSecret = RefreshKeyUtil.getRequestSecret(pushAppKey, pushAppScret,timestamp); |
|
|
|
String requestSecret = refreshTokenService.refreshToken(pushAppKey, pushAppScret, govRequestTokenUrl, govRefreshTokenUrl, HttpMethod.POST.name()); |
|
|
|
String capCode = CryptUtils.encryptHMAC(timestamp + areaCode, "bcb4fc0f517fc168ee543fcf4d231f3b"); |
|
|
|
String capTime = String.valueOf(timestamp); |
|
|
|
String sign = CryptUtils.MD5Encode(pushAppKey + requestSecret + timestamp); |
|
|
@@ -195,7 +192,7 @@ public class AppIrsManage { |
|
|
|
public JSONObject searchApp(ApiApplyDTO apply) throws NoSuchAlgorithmException { |
|
|
|
long timestamp = System.currentTimeMillis(); |
|
|
|
String appCode = apply.getAppId(); |
|
|
|
String requestSecret = RefreshKeyUtil.getRequestSecret(searchAppKey, searchAppScret,timestamp); |
|
|
|
String requestSecret = refreshTokenService.refreshToken(searchAppKey, searchAppScret, govRequestTokenUrl, govRefreshTokenUrl, HttpMethod.POST.name()); |
|
|
|
String sign = CryptUtils.MD5Encode(searchAppKey + requestSecret + timestamp); |
|
|
|
String url = searchUrl + "?requestTime=" + timestamp + "&sign=" + sign + |
|
|
|
"&appKey=" + searchAppKey + "&" + |
|
|
@@ -231,7 +228,8 @@ public class AppIrsManage { |
|
|
|
long timestamp = System.currentTimeMillis(); |
|
|
|
String areaCode = StringUtils.isNotBlank(apply.getAreaCode()) ? |
|
|
|
convertAreaCode(apply.getAreaCode()) : null; |
|
|
|
String requestSecret = RefreshKeyUtil.getRequestSecret(searchAppKey, searchAppScret,timestamp); |
|
|
|
String requestSecret = refreshTokenService.refreshToken(searchAppKey, searchAppScret, govRequestTokenUrl, govRefreshTokenUrl, |
|
|
|
HttpMethod.POST.name()); |
|
|
|
String sign = CryptUtils.MD5Encode(searchAppKey + requestSecret + timestamp); |
|
|
|
String url = searchUrl + "?requestTime=" + timestamp + "&sign=" + sign + |
|
|
|
"&appKey=" + searchAppKey + "&pageSize=1000&" + |
|
|
@@ -240,7 +238,7 @@ public class AppIrsManage { |
|
|
|
RestTemplate restTemplate = new RestTemplate(); |
|
|
|
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class); |
|
|
|
|
|
|
|
log.info("查询应用目录 : {}", JSON.toJSONString(forEntity)); |
|
|
|
log.info("查询应用目录 : {}", forEntity.getStatusCode()); |
|
|
|
|
|
|
|
if (Objects.nonNull(forEntity.getBody())) { |
|
|
|
JSONObject body = JSON.parseObject(forEntity.getBody()); |
|
|
@@ -279,7 +277,7 @@ public class AppIrsManage { |
|
|
|
String appKey = "A331101453557202109017383"; |
|
|
|
String method = "POST"; |
|
|
|
String interfaceName = "5crv7i4727abLCv0"; |
|
|
|
String secret = refreshTokenService.refreshToken(appKey, appSecret, govRequestTokenUrl, govRefreshTokenUrl, interfaceName, method); |
|
|
|
String secret = refreshTokenService.refreshToken(appKey, appSecret, govRequestTokenUrl, govRefreshTokenUrl, method); |
|
|
|
log.info("secret :{}", secret); |
|
|
|
String sign = MD5.create().digestHex(appKey + secret + timestamp); |
|
|
|
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory(); |
|
|
@@ -312,8 +310,7 @@ public class AppIrsManage { |
|
|
|
String appSecret = pushProjectAppSecret; |
|
|
|
String appKey = pushProjectAppKey; |
|
|
|
String method = HttpMethod.POST.name(); |
|
|
|
String interfaceName = pushProjectInterfaceName; |
|
|
|
String secret = refreshTokenService.refreshToken(appKey, appSecret, govRequestTokenUrl, govRefreshTokenUrl, interfaceName, method); |
|
|
|
String secret = refreshTokenService.refreshToken(appKey, appSecret, govRequestTokenUrl, govRefreshTokenUrl, method); |
|
|
|
log.info("secret :{}", secret); |
|
|
|
String sign = MD5.create().digestHex(appKey + secret + timestamp); |
|
|
|
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory(); |
|
|
@@ -377,7 +374,7 @@ public class AppIrsManage { |
|
|
|
String appKey = driAppKey; |
|
|
|
String method = HttpMethod.POST.name(); |
|
|
|
String interfaceName = driInterfaceName; |
|
|
|
String secret = refreshTokenService.refreshToken(appKey, appSecret, govRequestTokenUrl, govRefreshTokenUrl, interfaceName, method); |
|
|
|
String secret = refreshTokenService.refreshToken(appKey, appSecret, govRequestTokenUrl, govRefreshTokenUrl, method); |
|
|
|
log.info("secret : {}", secret); |
|
|
|
String sign = MD5.create().digestHex(appKey + secret + timestamp); |
|
|
|
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory(); |
|
|
|