调试调用工作流。

This commit is contained in:
wangzhijiang
2022-02-28 18:41:59 +08:00
parent 516f98a922
commit 3a2be3a42d
6 changed files with 79 additions and 4 deletions
+5
View File
@@ -102,6 +102,11 @@
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/pageoffice4.5.0.9.jar</systemPath>
</dependency>
<!-- feign调用 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,33 @@
package com.jero.modules.wkflow.controller;
import com.alibaba.fastjson.JSONObject;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.modules.wkflow.feginClient.impl.WorkFlowFeignClientImpl;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Api(tags="测试调用工作流接口")
@RestController
@RequestMapping("/test")
@Slf4j
public class TestController {
@Autowired
private WorkFlowFeignClientImpl workFlowFeignClient;
@AutoLog(value = "测试Get请求")
@GetMapping("/testGet")
public String testGet(@RequestParam("param") String param){
return workFlowFeignClient.testGet(param);
}
@AutoLog(value = "测试Post请求")
@PostMapping("/testPost")
public JSONObject testPost(@RequestBody JSONObject jsonObject){
return workFlowFeignClient.testPost(jsonObject);
}
}
@@ -0,0 +1,16 @@
package com.jero.modules.wkflow.feginClient;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
@FeignClient(value = "weilai-wkflow")
public interface WorkFlowFeignClient {
@RequestMapping(value = "/bat-wkflow/task/testGet",method = RequestMethod.GET)
String testGet(@RequestParam("param") String param);
@RequestMapping(value = "/bat-wkflow/task/testPost",method = RequestMethod.POST,headers = {"content-type=application/json"})
JSONObject testPost(String jsonObject);
}
@@ -0,0 +1,21 @@
package com.jero.modules.wkflow.feginClient.impl;
import com.alibaba.fastjson.JSONObject;
import com.jero.modules.wkflow.feginClient.WorkFlowFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class WorkFlowFeignClientImpl{
@Autowired
private WorkFlowFeignClient workFlowFeignClient;
public String testGet(String param) {
return workFlowFeignClient.testGet(param);
}
public JSONObject testPost(JSONObject jsonObject) {
return workFlowFeignClient.testPost(jsonObject.toString());
}
}
@@ -21,8 +21,8 @@ import java.net.UnknownHostException;
**/
@Slf4j
@SpringBootApplication
//@EnableEurekaClient
//@EnableFeignClients
@EnableEurekaClient
@EnableFeignClients
public class LawNioApplication extends SpringBootServletInitializer {
@Override
@@ -320,9 +320,9 @@ OCR:
eureka:
client:
#是否将自己注册到Eureka Server上,默认为true
register-with-eureka: false
register-with-eureka: true
##是否从Eureka Server上获取注册信息,默认为true
fetch-registry: false
fetch-registry: true
service-url:
defaultZone: http://127.0.0.1:8123/eureka/
## people 2.0