|
|
@@ -1,12 +1,7 @@
|
|
|
package com.mokamrp.privates.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.mokamrp.privates.mapper.ChatToolMapper;
|
|
|
-import com.mokamrp.privates.mapper.pojo.ChatTool;
|
|
|
-import com.mokamrp.privates.service.ChatToolService;
|
|
|
import com.mokamrp.privates.service.CoralApiService;
|
|
|
import com.mokamrp.privates.utils.http.HttpUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -25,13 +20,13 @@ public class CoralApiServiceImpl implements CoralApiService {
|
|
|
* @param ghId
|
|
|
* @return
|
|
|
*/
|
|
|
- public String getBoxToken(String ghId){
|
|
|
+ public String getBoxToken(String ghId) {
|
|
|
String url = "/boxmanager/box/gettoken";
|
|
|
- String params = "gh_id="+ghId;
|
|
|
- String res = HttpUtils.sendGet(coralApi+url,params);
|
|
|
+ String params = "gh_id=" + ghId;
|
|
|
+ String res = HttpUtils.sendGet(coralApi + url, params);
|
|
|
System.out.println(res);
|
|
|
- Map<String,Object> tokenInfo = JSON.parseObject(res, HashMap.class);
|
|
|
- if (Integer.parseInt(tokenInfo.get("code").toString()) != 0){
|
|
|
+ Map<String, Object> tokenInfo = JSON.parseObject(res, HashMap.class);
|
|
|
+ if (Integer.parseInt(tokenInfo.get("code").toString()) != 0) {
|
|
|
return "";
|
|
|
}
|
|
|
return tokenInfo.get("data").toString();
|
|
|
@@ -42,15 +37,15 @@ public class CoralApiServiceImpl implements CoralApiService {
|
|
|
* @param ghId
|
|
|
* @return
|
|
|
*/
|
|
|
- public Object getBoxInfo(String ghId){
|
|
|
+ public Object getBoxInfo(String ghId) {
|
|
|
String newCoral = "https://moka-coral.mokamrp.com/coral";
|
|
|
String url = "/box/getBoxInfo";
|
|
|
- String params = "ghId="+ghId;
|
|
|
- String res = HttpUtils.sendGet(newCoral+url,params);
|
|
|
+ String params = "ghId=" + ghId;
|
|
|
+ String res = HttpUtils.sendGet(newCoral + url, params);
|
|
|
System.out.println(res);
|
|
|
JSONObject info = JSON.parseObject(res);
|
|
|
JSONObject data = JSON.parseObject(info.get("data").toString());
|
|
|
- if (Integer.parseInt(info.get("code").toString()) != 200){
|
|
|
+ if (Integer.parseInt(info.get("code").toString()) != 0) {
|
|
|
return "";
|
|
|
}
|
|
|
return data;
|