|
@@ -1,17 +1,15 @@
|
|
-package module.service.impl;
|
|
|
|
|
|
+package cn.com.ctop.module.service.impl;
|
|
|
|
|
|
import cn.com.ctop.common.utils.Check;
|
|
import cn.com.ctop.common.utils.Check;
|
|
import cn.com.ctop.common.utils.HttpUtils;
|
|
import cn.com.ctop.common.utils.HttpUtils;
|
|
import cn.com.ctop.common.utils.PropertiesUtils;
|
|
import cn.com.ctop.common.utils.PropertiesUtils;
|
|
-import cn.com.ctop.toutiao.common.BytedanceInterfaceConstant;
|
|
|
|
|
|
+import cn.com.ctop.module.entity.CtopOauthToken;
|
|
|
|
+import cn.com.ctop.module.mapper.CtopOauthTokenMapper;
|
|
|
|
+import cn.com.ctop.module.service.ICtopOauthTokenService;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
-import constant.KuaishouInterfaceConstant;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
-import module.entity.CtopOauthToken;
|
|
|
|
-import module.mapper.CtopOauthTokenMapper;
|
|
|
|
-import module.service.ICtopOauthTokenService;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -55,7 +53,7 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
|
|
resultMap.put("code", -1);
|
|
resultMap.put("code", -1);
|
|
return resultMap;
|
|
return resultMap;
|
|
}
|
|
}
|
|
- String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + BytedanceInterfaceConstant.REFRESH_TOKEN;
|
|
|
|
|
|
+ String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + "/oauth2/refresh_token";
|
|
Map<String, Object> param = new HashMap<String, Object>();
|
|
Map<String, Object> param = new HashMap<String, Object>();
|
|
param.put("app_id", PropertiesUtils.getValue("bytedance_config", "bytedance_appid"));
|
|
param.put("app_id", PropertiesUtils.getValue("bytedance_config", "bytedance_appid"));
|
|
param.put("secret", PropertiesUtils.getValue("bytedance_config", "bytedance_secret"));
|
|
param.put("secret", PropertiesUtils.getValue("bytedance_config", "bytedance_secret"));
|
|
@@ -89,7 +87,7 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public Map<String, Object> getKuaiShouRefreshToken(Long accountId, String refreshToken) {
|
|
public Map<String, Object> getKuaiShouRefreshToken(Long accountId, String refreshToken) {
|
|
- String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.REFRESH_TOKEN;
|
|
|
|
|
|
+ String url = PropertiesUtils.getConfig("kuaishou_api_url") + "/rest/openapi/oauth2/authorize/refresh_token";
|
|
Map<String, String> headers = new HashMap<String, String>();
|
|
Map<String, String> headers = new HashMap<String, String>();
|
|
headers.put("Content-Type", " application/json");
|
|
headers.put("Content-Type", " application/json");
|
|
Map<String, Object> param = new HashMap<String, Object>();
|
|
Map<String, Object> param = new HashMap<String, Object>();
|