|
@@ -1,15 +1,14 @@
|
|
|
package cn.com.qmth.examcloud.core.basic.api.client;
|
|
|
|
|
|
-import org.examcloud.core.basic.api.DemoProvider;
|
|
|
+import org.examcloud.core.basic.api.DemoServiceProvider;
|
|
|
import org.examcloud.core.basic.api.request.GetXxxReq;
|
|
|
import org.examcloud.core.basic.api.response.GetXxxResp;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.http.ResponseEntity;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
-import com.google.common.collect.Lists;
|
|
|
-
|
|
|
-public class DemoProviderClient extends BasicClientSupport implements DemoProvider {
|
|
|
+@Service
|
|
|
+public class DemoServiceClient extends BasicClientSupport implements DemoServiceProvider {
|
|
|
|
|
|
private static final long serialVersionUID = -7456923008162697199L;
|
|
|
|
|
@@ -18,14 +17,8 @@ public class DemoProviderClient extends BasicClientSupport implements DemoProvid
|
|
|
|
|
|
@Override
|
|
|
public GetXxxResp getXxx(GetXxxReq req) {
|
|
|
- ResponseEntity<GetXxxResp> respEntity = restTemplate.getForEntity("http://ExamCloud-service-core/demo/getXxx",
|
|
|
- GetXxxResp.class);
|
|
|
- GetXxxResp resp = respEntity.getBody();
|
|
|
- System.out.println(resp);
|
|
|
-
|
|
|
- Lists.newArrayList();
|
|
|
|
|
|
- return null;
|
|
|
+ return get("demo/getXxx", GetXxxResp.class);
|
|
|
}
|
|
|
|
|
|
@Override
|