|
@@ -6,7 +6,6 @@ import com.dingtalk.api.DefaultDingTalkClient;
|
|
|
import com.dingtalk.api.request.OapiGettokenRequest;
|
|
import com.dingtalk.api.request.OapiGettokenRequest;
|
|
|
import com.dingtalk.api.response.OapiGettokenResponse;
|
|
import com.dingtalk.api.response.OapiGettokenResponse;
|
|
|
import com.google.common.collect.Maps;
|
|
import com.google.common.collect.Maps;
|
|
|
-import com.muzhi.baiqueling.common.EnvironmentVariables;
|
|
|
|
|
import com.muzhi.baiqueling.service.AccessTokenService;
|
|
import com.muzhi.baiqueling.service.AccessTokenService;
|
|
|
import com.taobao.api.ApiException;
|
|
import com.taobao.api.ApiException;
|
|
|
import okhttp3.*;
|
|
import okhttp3.*;
|
|
@@ -26,6 +25,14 @@ import java.util.Map;
|
|
|
@Service
|
|
@Service
|
|
|
public class AccessTokenServiceImpl implements AccessTokenService {
|
|
public class AccessTokenServiceImpl implements AccessTokenService {
|
|
|
|
|
|
|
|
|
|
+ /**钉钉应用_云璞POC*/
|
|
|
|
|
+ //APPKEY
|
|
|
|
|
+ private static String APPKEY_YunpuPOC = "ding8qyulwwmad6j7k6c";
|
|
|
|
|
+ //APPSECRET
|
|
|
|
|
+ private static String APPSECRET_YunpuPOC = "e_hRHuubw-Xi0OuPJOYdXSElVzOC0IPgMrHQTBuAM9BqW-DFnrcsSyBHi7Me3xSv";
|
|
|
|
|
+ //AgenthId:1963716187
|
|
|
|
|
+ //corpId:
|
|
|
|
|
+
|
|
|
public static String DingtalkAccessToken_YunpuPOC = null;
|
|
public static String DingtalkAccessToken_YunpuPOC = null;
|
|
|
|
|
|
|
|
//获取dingtalk授权码(钉钉应用)
|
|
//获取dingtalk授权码(钉钉应用)
|
|
@@ -33,8 +40,8 @@ public class AccessTokenServiceImpl implements AccessTokenService {
|
|
|
public String getAccessToken_YunpuPOC() {
|
|
public String getAccessToken_YunpuPOC() {
|
|
|
DefaultDingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken");
|
|
DefaultDingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken");
|
|
|
OapiGettokenRequest request = new OapiGettokenRequest();
|
|
OapiGettokenRequest request = new OapiGettokenRequest();
|
|
|
- request.setAppkey(EnvironmentVariables.require("DINGTALK_YUNPU_APP_KEY"));
|
|
|
|
|
- request.setAppsecret(EnvironmentVariables.require("DINGTALK_YUNPU_APP_SECRET"));
|
|
|
|
|
|
|
+ request.setAppkey(APPKEY_YunpuPOC);
|
|
|
|
|
+ request.setAppsecret(APPSECRET_YunpuPOC);
|
|
|
request.setHttpMethod("GET");
|
|
request.setHttpMethod("GET");
|
|
|
try {
|
|
try {
|
|
|
OapiGettokenResponse response = client.execute(request);
|
|
OapiGettokenResponse response = client.execute(request);
|
|
@@ -45,6 +52,14 @@ public class AccessTokenServiceImpl implements AccessTokenService {
|
|
|
return DingtalkAccessToken_YunpuPOC;
|
|
return DingtalkAccessToken_YunpuPOC;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**钉钉应用*/
|
|
|
|
|
+ //APPKEY
|
|
|
|
|
+ private static String APPKEY = "dingd93y9mnocx0byxbu";
|
|
|
|
|
+ //APPSECRET
|
|
|
|
|
+ private static String APPSECRET = "W04eACqPupjyEGKuYuGo_Z0fRjdLKL034Sb-gDogoE4QQVFK725SBUFnwcXE6FfQ";
|
|
|
|
|
+ //AgenthId:3153704771
|
|
|
|
|
+ //corpId:
|
|
|
|
|
+
|
|
|
public static String DingtalkAccessToken = null;
|
|
public static String DingtalkAccessToken = null;
|
|
|
|
|
|
|
|
//获取dingtalk授权码(钉钉应用)
|
|
//获取dingtalk授权码(钉钉应用)
|
|
@@ -52,8 +67,8 @@ public class AccessTokenServiceImpl implements AccessTokenService {
|
|
|
public String getAccessToken() {
|
|
public String getAccessToken() {
|
|
|
DefaultDingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken");
|
|
DefaultDingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken");
|
|
|
OapiGettokenRequest request = new OapiGettokenRequest();
|
|
OapiGettokenRequest request = new OapiGettokenRequest();
|
|
|
- request.setAppkey(EnvironmentVariables.require("DINGTALK_APP_KEY"));
|
|
|
|
|
- request.setAppsecret(EnvironmentVariables.require("DINGTALK_APP_SECRET"));
|
|
|
|
|
|
|
+ request.setAppkey(APPKEY);
|
|
|
|
|
+ request.setAppsecret(APPSECRET);
|
|
|
request.setHttpMethod("GET");
|
|
request.setHttpMethod("GET");
|
|
|
try {
|
|
try {
|
|
|
OapiGettokenResponse response = client.execute(request);
|
|
OapiGettokenResponse response = client.execute(request);
|
|
@@ -75,8 +90,8 @@ public class AccessTokenServiceImpl implements AccessTokenService {
|
|
|
@Override
|
|
@Override
|
|
|
public JSONObject getAccessToken_meike() {
|
|
public JSONObject getAccessToken_meike() {
|
|
|
//appCode和appSecret请联系每刻工作人员
|
|
//appCode和appSecret请联系每刻工作人员
|
|
|
- String appCode = EnvironmentVariables.require("MAYCUR_APP_CODE");
|
|
|
|
|
- String appSecret = EnvironmentVariables.require("MAYCUR_APP_SECRET");
|
|
|
|
|
|
|
+ String appCode = "AP4PID3GWDJ391";
|
|
|
|
|
+ String appSecret = "wZ4iAHvF6e4edBv2uAqY1zCAYAx5ud1M";
|
|
|
|
|
|
|
|
long timeMillis = System.currentTimeMillis();
|
|
long timeMillis = System.currentTimeMillis();
|
|
|
System.out.println("timeMillis:" + timeMillis);
|
|
System.out.println("timeMillis:" + timeMillis);
|
|
@@ -97,7 +112,7 @@ public class AccessTokenServiceImpl implements AccessTokenService {
|
|
|
.url(HTTP_HOST +"/api/openapi/auth/login")
|
|
.url(HTTP_HOST +"/api/openapi/auth/login")
|
|
|
.method("POST", body)
|
|
.method("POST", body)
|
|
|
.addHeader("Content-Type", "application/json")
|
|
.addHeader("Content-Type", "application/json")
|
|
|
- .addHeader("Cookie", EnvironmentVariables.require("MAYCUR_COOKIE"))
|
|
|
|
|
|
|
+ .addHeader("Cookie", "acw_tc=3ccdc14717471251482292289e64b099ab9dc4d8fb4debb3229faf307c47f7")
|
|
|
.build();
|
|
.build();
|
|
|
String code = "";
|
|
String code = "";
|
|
|
String message = "";
|
|
String message = "";
|
|
@@ -139,10 +154,10 @@ public class AccessTokenServiceImpl implements AccessTokenService {
|
|
|
@Override
|
|
@Override
|
|
|
public String getAccessToken_dms() {
|
|
public String getAccessToken_dms() {
|
|
|
//密钥参数由DMS侧提供
|
|
//密钥参数由DMS侧提供
|
|
|
- String accountinfocode = EnvironmentVariables.require("DMS_ACCOUNT_INFO_CODE");
|
|
|
|
|
- String opentypecode = EnvironmentVariables.require("DMS_OPEN_TYPE_CODE");
|
|
|
|
|
- String opentypesecret = EnvironmentVariables.require("DMS_OPEN_TYPE_SECRET");
|
|
|
|
|
- String clienttypecode = EnvironmentVariables.require("DMS_CLIENT_TYPE_CODE");
|
|
|
|
|
|
|
+ String accountinfocode = "1711679187993104384";
|
|
|
|
|
+ String opentypecode = "baiqueling-data-server";
|
|
|
|
|
+ String opentypesecret = "123456";
|
|
|
|
|
+ String clienttypecode = "1";
|
|
|
|
|
|
|
|
Map map = new HashMap<>();
|
|
Map map = new HashMap<>();
|
|
|
map.put("accountinfocode", accountinfocode);
|
|
map.put("accountinfocode", accountinfocode);
|