|
@@ -12,7 +12,6 @@ import com.muzhi.chuangqi.service.AccessTokenService;
|
|
|
import com.taobao.api.ApiException;
|
|
import com.taobao.api.ApiException;
|
|
|
import okhttp3.*;
|
|
import okhttp3.*;
|
|
|
import org.apache.commons.codec.digest.DigestUtils;
|
|
import org.apache.commons.codec.digest.DigestUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.StringUtils;
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
@@ -30,11 +29,13 @@ import java.util.Map;
|
|
|
@Service
|
|
@Service
|
|
|
public class AccessTokenServiceImpl implements AccessTokenService {
|
|
public class AccessTokenServiceImpl implements AccessTokenService {
|
|
|
|
|
|
|
|
- @Value("${dingtalk.app-key}")
|
|
|
|
|
- private String appKey;
|
|
|
|
|
-
|
|
|
|
|
- @Value("${dingtalk.app-secret}")
|
|
|
|
|
- private String dingtalkAppSecret;
|
|
|
|
|
|
|
+ /**钉钉应用*/
|
|
|
|
|
+ //APPKEY
|
|
|
|
|
+ private static String APPKEY = "dingyftn3awxy2jdpmdb";
|
|
|
|
|
+ //APPSECRET
|
|
|
|
|
+ private static String APPSECRET = "gtZtjDEE07WkfDPvOnPc_KF6Q32vkvpoaGr73uK2OA5z_BB6Afs5Fxli6nzBT7nz";
|
|
|
|
|
+ //AgenthId:3999410686
|
|
|
|
|
+ //corpId:
|
|
|
|
|
|
|
|
public static String DingtalkAccessToken = null;
|
|
public static String DingtalkAccessToken = null;
|
|
|
|
|
|
|
@@ -43,8 +44,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(appKey);
|
|
|
|
|
- request.setAppsecret(dingtalkAppSecret);
|
|
|
|
|
|
|
+ request.setAppkey(APPKEY);
|
|
|
|
|
+ request.setAppsecret(APPSECRET);
|
|
|
request.setHttpMethod("GET");
|
|
request.setHttpMethod("GET");
|
|
|
try {
|
|
try {
|
|
|
OapiGettokenResponse response = client.execute(request);
|
|
OapiGettokenResponse response = client.execute(request);
|
|
@@ -58,11 +59,8 @@ public class AccessTokenServiceImpl implements AccessTokenService {
|
|
|
public static final Long EXPIRES_IN = 1 * 3600 * 1000L;
|
|
public static final Long EXPIRES_IN = 1 * 3600 * 1000L;
|
|
|
public static final String TOKEN_APPID = "_appId";
|
|
public static final String TOKEN_APPID = "_appId";
|
|
|
|
|
|
|
|
- @Value("${teambition.app-id}")
|
|
|
|
|
- private String appId;
|
|
|
|
|
-
|
|
|
|
|
- @Value("${teambition.app-secret}")
|
|
|
|
|
- private String appSecret;
|
|
|
|
|
|
|
+ public static String appId = "68c7b5f1e4110b38ef834c7d";
|
|
|
|
|
+ public static String appSecret = "gRxU3cRNvIMaxVX8lUnPz0MXxHCm3hy7";
|
|
|
//获取access_token的方法(创崎TB应用)
|
|
//获取access_token的方法(创崎TB应用)
|
|
|
@Override
|
|
@Override
|
|
|
public String getAppToken() {
|
|
public String getAppToken() {
|