|
@@ -0,0 +1,36 @@
|
|
|
+package cn.com.qmth.examcloud.core.basic.api.client;
|
|
|
+
|
|
|
+import org.examcloud.core.basic.api.DemoProvider;
|
|
|
+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.web.client.RestTemplate;
|
|
|
+
|
|
|
+import com.google.common.collect.Lists;
|
|
|
+
|
|
|
+public class DemoProviderClient extends BasicClientSupport implements DemoProvider {
|
|
|
+
|
|
|
+ private static final long serialVersionUID = -7456923008162697199L;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ RestTemplate restTemplate;
|
|
|
+
|
|
|
+ @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;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected RestTemplate getRestTemplate() {
|
|
|
+ return restTemplate;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|