|
@@ -0,0 +1,43 @@
|
|
|
+package cn.com.qmth.examcloud.core.basic.api.client;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.web.client.RestTemplate;
|
|
|
+
|
|
|
+import cn.com.qmth.examcloud.commons.web.redis.RedisClient;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.UserCloudService;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.request.AddUserReq;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.request.GetUserReq;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.response.AddUserResp;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.response.GetUserResp;
|
|
|
+
|
|
|
+@Service
|
|
|
+public class UserCloudServiceClient extends BasicCloudClientSupport implements UserCloudService {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private RestTemplate restTemplate;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private RedisClient redisClient;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected RedisClient getRedisClient() {
|
|
|
+ return redisClient;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected RestTemplate getRestTemplate() {
|
|
|
+ return restTemplate;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AddUserResp addUser(AddUserReq req) {
|
|
|
+ return post("user/addUser", req, AddUserResp.class);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public GetUserResp getUser(GetUserReq req) {
|
|
|
+ return post("user/getUser", req, GetUserResp.class);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|