|
|
@@ -0,0 +1,34 @@
|
|
|
+package cn.seecoder.seecoderportalserver.serviceImpl.subsystem;
|
|
|
+
|
|
|
+import cn.seecoder.seecoderportalserver.service.subsystem.DevcloudService;
|
|
|
+import cn.seecoder.seecoderportalserver.service.HttpService;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import org.apache.http.NameValuePair;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@Service
|
|
|
+public class DevcloudServiceImpl implements DevcloudService {
|
|
|
+ private final String devcloudUri = "https://devcloud-server.seec.seecoder.cn";
|
|
|
+ private final HttpService httpService;
|
|
|
+
|
|
|
+ public DevcloudServiceImpl(HttpService httpService) {this.httpService = httpService;}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ // todo
|
|
|
+ public JSONObject findAllProjects() {
|
|
|
+ String uri = devcloudUri + "/project/listByUser";
|
|
|
+ List<NameValuePair> params = new ArrayList<>();
|
|
|
+ String token = httpService.getToken();
|
|
|
+ String result = null;
|
|
|
+ try {
|
|
|
+ result = httpService.sendGet(uri, params, token);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return JSON.parseObject(result);
|
|
|
+ }
|
|
|
+}
|