瀏覽代碼

调用知识库统一到一个类

gaodm 6 年之前
父節點
當前提交
47279396f4

+ 0 - 43
icssman-service/src/main/java/com/diagbot/client/KLMServiceClient.java

@@ -1,43 +0,0 @@
-package com.diagbot.client;
-
-import com.diagbot.dto.ConceptBaseDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.vo.ConceptSearchVO;
-import com.diagbot.vo.ConceptTypeVO;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-
-import java.util.List;
-import java.util.Map;
-
-
-/**
- * @Description: 调用知识库维护服务
- * @author: gaodm
- * @time: 2018/8/6 9:52
- */
-@FeignClient(value = "icssman-service", fallback = KLMServiceClient.class)
-public interface KLMServiceClient {
-	/**
-	 * 根据概念Id列表获取概念列表Map
-	 *
-	 * @param conceptSearchVO 搜索参数
-	 * @return 术语id和术语 Map
-	 */
-	@PostMapping("/concept/getConceptMap")
-	RespDTO<Map<Long, String>> getConceptMap(@RequestBody ConceptSearchVO conceptSearchVO);
-
-	/**
-	 * 根据类型获取术语列表(科室、辅检、慢病)
-	 *
-	 * @param conceptTypeVO 类型 type: 1:科室、2:辅检、3:慢病
-	 * @return 术语列表
-	 */
-	@PostMapping("/concept/getConceptListByType")
-	RespDTO<List<ConceptBaseDTO>> getConceptListByType(@RequestBody ConceptTypeVO conceptTypeVO);
-    
-}
-
-
-

+ 20 - 0
icssman-service/src/main/java/com/diagbot/client/KnowledgemanServiceClient.java

@@ -4,6 +4,8 @@ import com.diagbot.client.hystrix.KnowledgemanServiceHystrix;
 import com.diagbot.dto.ConceptBaseDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.vo.ConceptExistVO;
+import com.diagbot.vo.ConceptSearchVO;
+import com.diagbot.vo.ConceptTypeVO;
 import com.diagbot.vo.IndexVO;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -25,4 +27,22 @@ public interface KnowledgemanServiceClient {
 
     @PostMapping("/commonconcept/getConceptMapByNameAndType")
     RespDTO<Map<String, Long>> getConceptMap(@RequestBody ConceptExistVO conceptExistVO);
+
+    /**
+     * 根据概念Id列表获取概念列表Map
+     *
+     * @param conceptSearchVO 搜索参数
+     * @return 术语id和术语 Map
+     */
+    @PostMapping("/concept/getConceptMap")
+    RespDTO<Map<Long, String>> getConceptMap(@RequestBody ConceptSearchVO conceptSearchVO);
+
+    /**
+     * 根据类型获取术语列表(科室、辅检、慢病)
+     *
+     * @param conceptTypeVO 类型 type: 1:科室、2:辅检、3:慢病
+     * @return 术语列表
+     */
+    @PostMapping("/concept/getConceptListByType")
+    RespDTO<List<ConceptBaseDTO>> getConceptListByType(@RequestBody ConceptTypeVO conceptTypeVO);
 }

+ 0 - 49
icssman-service/src/main/java/com/diagbot/client/hystrix/KLMServiceHystrix.java

@@ -1,49 +0,0 @@
-package com.diagbot.client.hystrix;
-
-import com.diagbot.client.KLMServiceClient;
-import com.diagbot.dto.ConceptBaseDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.vo.ConceptSearchVO;
-import com.diagbot.vo.ConceptTypeVO;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-
-import java.util.List;
-import java.util.Map;
-
-
-/**
- * @Description: 调用知识库维护服务
- * @author: gaodm
- * @time: 2018/8/6 9:52
- */
-@Component
-@Slf4j
-public class KLMServiceHystrix implements KLMServiceClient {
-
-    /**
-     * 根据概念Id列表获取概念列表Map
-     *
-     * @param conceptSearchVO 搜索参数
-     * @return 术语id和术语 Map
-     */
-    @Override
-    public RespDTO<Map<Long, String>> getConceptMap(@RequestBody ConceptSearchVO conceptSearchVO) {
-        log.error("【hystrix】调用{}异常", "getConceptMap");
-        return null;
-    }
-
-    /**
-     * 根据类型获取术语列表(科室、辅检、慢病)
-     *
-     * @param conceptTypeVO 类型
-     * @return 术语列表
-     */
-    public RespDTO<List<ConceptBaseDTO>> getConceptListByType(@RequestBody ConceptTypeVO conceptTypeVO){
-        log.error("【hystrix】调用{}异常", "getConceptListByType");
-        return null;
-    }
-
-}

+ 28 - 0
icssman-service/src/main/java/com/diagbot/client/hystrix/KnowledgemanServiceHystrix.java

@@ -4,9 +4,13 @@ import com.diagbot.client.KnowledgemanServiceClient;
 import com.diagbot.dto.ConceptBaseDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.vo.ConceptExistVO;
+import com.diagbot.vo.ConceptSearchVO;
+import com.diagbot.vo.ConceptTypeVO;
 import com.diagbot.vo.IndexVO;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 
 import java.util.List;
 import java.util.Map;
@@ -31,4 +35,28 @@ public class KnowledgemanServiceHystrix implements KnowledgemanServiceClient {
         log.error("【hystrix】调用{}异常", "getConceptMap");
         return null;
     }
+
+    /**
+     * 根据概念Id列表获取概念列表Map
+     *
+     * @param conceptSearchVO 搜索参数
+     * @return 术语id和术语 Map
+     */
+    @Override
+    public RespDTO<Map<Long, String>> getConceptMap(@RequestBody ConceptSearchVO conceptSearchVO) {
+        log.error("【hystrix】调用{}异常", "getConceptMap");
+        return null;
+    }
+
+    /**
+     * 根据类型获取术语列表(科室、辅检、慢病)
+     *
+     * @param conceptTypeVO 类型
+     * @return 术语列表
+     */
+    public RespDTO<List<ConceptBaseDTO>> getConceptListByType(@RequestBody ConceptTypeVO conceptTypeVO){
+        log.error("【hystrix】调用{}异常", "getConceptListByType");
+        return null;
+    }
+
 }