Browse Source

添加crf依赖

kongwz 5 years ago
parent
commit
4cb81bccee

+ 6 - 0
kernel/pom.xml

@@ -65,6 +65,12 @@
 			<artifactId>springfox-swagger-ui</artifactId>
 			<version>${swagger2.version}</version>
 		</dependency>
+		<!-- 开启feign-->
+		<dependency>
+			<groupId>org.springframework.cloud</groupId>
+			<artifactId>spring-cloud-starter-openfeign</artifactId>
+			<version>2.1.0.RELEASE</version>
+		</dependency>
 	</dependencies>
 
 	<build>

+ 24 - 0
kernel/src/main/java/com/lantone/qc/kernel/client/CRFServiceClient.java

@@ -0,0 +1,24 @@
+package com.lantone.qc.kernel.client;
+
+
+import com.lantone.qc.kernel.client.hystrix.CRFServiceHystrix;
+import com.lantone.qc.pub.model.vo.CRFVo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+
+/**
+ * @Description: 调用条件随机场服务
+ * @author: Mark Huang
+ * @time: 2019/12/13 9:52
+ */
+@FeignClient(value = "CRF-service", url="${CRF.url}", fallback = CRFServiceHystrix.class)
+public interface CRFServiceClient {
+
+    @PostMapping(value = "")
+    String getAnnotation(@RequestBody CRFVo crfVo);
+}
+
+
+

+ 19 - 0
kernel/src/main/java/com/lantone/qc/kernel/client/hystrix/CRFServiceHystrix.java

@@ -0,0 +1,19 @@
+package com.lantone.qc.kernel.client.hystrix;
+
+
+import com.lantone.qc.kernel.client.CRFServiceClient;
+
+import com.lantone.qc.pub.model.vo.CRFVo;
+import org.springframework.stereotype.Component;
+
+
+
+@Component
+public class CRFServiceHystrix implements CRFServiceClient{
+
+    @Override
+    public String getAnnotation(CRFVo crfVo) {
+        System.out.printf(crfVo.getData();
+        return null;
+    }
+}

+ 1 - 0
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/BeHospitalizedAI.java

@@ -9,4 +9,5 @@ import com.lantone.qc.kernel.catalogue.QCCatalogue;
  * @Date: 2020-03-03 18:58
  */
 public class BeHospitalizedAI extends QCCatalogue {
+
 }

+ 3 - 1
kernel/src/main/resources/application.yml

@@ -1,5 +1,5 @@
 server:
-  port: 5008 # 端口号
+  port: 5009 # 端口号
   servlet:
     context-path: ${spring.application.name}  # 访问路径,如果不配置,访问IP:端口号,配置后访问IP:端口号/${context-path}
 
@@ -11,6 +11,8 @@ spring:
       force: true
       charset: UTF-8
       enabled: true
+CRF:
+  url: http://192.168.3.150:5555/api/mr_info_ex/entity_predict
 
 logging:          # 日志
   config: classpath:logback-spring.xml