feat(REQ-2924) - 调整代码生成的逻辑
This commit is contained in:
parent
26fc14cce9
commit
eb461cf05c
@ -63,6 +63,8 @@ import javax.validation.constraints.NotEmpty;
|
||||
* Workflow Engine Starter Core Service
|
||||
* <p>
|
||||
* 该类是根据 API 动态生成,不同版本可能会开放新的接口,或回收一些旧接口
|
||||
* <p>
|
||||
* Auto generation by workflow engine, It cannot be manually modified
|
||||
*/
|
||||
@org.springframework.cloud.openfeign.FeignClient(name = "workflow-engine-starter-core", url = "${axzo.service.workflow-engine.starter:http://workflow-engine:8080}", configuration = WorkflowEngineStarterFeignConfiguration.class)
|
||||
public interface WorkflowCoreService {
|
||||
@ -222,11 +224,11 @@ public interface WorkflowCoreService {
|
||||
BatchOperationResultVO batchApproveTask(@Validated @RequestBody List<BpmnTaskAuditDTO> dtos);
|
||||
|
||||
/**
|
||||
* 获取当前节点可退回节点选项列表
|
||||
* 获取当前节点可回退节点选项列表
|
||||
* @param taskId 当前任务id
|
||||
* @return 可以退回节点列表
|
||||
* @return 可以回退节点列表
|
||||
*/
|
||||
@Operation(summary = "获取当前节点可退回节点选项列表")
|
||||
@Operation(summary = "获取当前节点可回退节点选项列表")
|
||||
@GetMapping("/api/process/task/back/optional/nodes")
|
||||
List<BpmnOptionalNodeDTO> getBackOptionalNodes(@RequestParam @NotBlank(message = "任务id不能为空") String taskId);
|
||||
|
||||
|
||||
@ -83,6 +83,8 @@ import cn.axzo.workflow.common.model.response.bpmn.process.BpmnProcessDefinition
|
||||
* Workflow Engine Starter Management Service
|
||||
* <p>
|
||||
* 该类是根据 API 动态生成,不同版本可能会开放新的接口,或回收一些旧接口
|
||||
* <p>
|
||||
* Auto generation by workflow engine, It cannot be manually modified
|
||||
*/
|
||||
@org.springframework.cloud.openfeign.FeignClient(name = "workflow-engine-starter-manage", url = "${axzo.service.workflow-engine.starter:http://workflow-engine:8080}", configuration = WorkflowEngineStarterFeignConfiguration.class)
|
||||
public interface WorkflowManageService {
|
||||
|
||||
@ -8,7 +8,6 @@ import com.github.javaparser.ast.NodeList;
|
||||
import com.github.javaparser.ast.body.BodyDeclaration;
|
||||
import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration;
|
||||
import com.github.javaparser.ast.body.MethodDeclaration;
|
||||
import com.github.javaparser.ast.comments.BlockComment;
|
||||
import com.github.javaparser.ast.expr.ClassExpr;
|
||||
import com.github.javaparser.ast.expr.MethodCallExpr;
|
||||
import com.github.javaparser.ast.expr.NameExpr;
|
||||
@ -88,15 +87,15 @@ public class CoreServiceCodeGeneration {
|
||||
private static void addDefaultMethods(ClassOrInterfaceDeclaration interfaceDeclaration) {
|
||||
MethodDeclaration sync = createDefaultMethod("sync", interfaceDeclaration);
|
||||
sync.setJavadocComment("强制使用‘同步’模式调用该方法,请在调用真实方法前调用该方法\r\n" +
|
||||
"<pre>\r\n" +
|
||||
" workflowCoreService.sync().createProcessInstance();\r\n" +
|
||||
"</pre>");
|
||||
"<pre>\r\n" +
|
||||
" workflowCoreService.sync().createProcessInstance();\r\n" +
|
||||
"</pre>");
|
||||
|
||||
MethodDeclaration async = createDefaultMethod("async", interfaceDeclaration);
|
||||
sync.setJavadocComment("强制使用‘异步’模式调用该方法,请在调用真实方法前调用该方法\r\n" +
|
||||
"<pre>\r\n" +
|
||||
" workflowCoreService.async().createProcessInstance();\r\n" +
|
||||
"</pre>");
|
||||
"<pre>\r\n" +
|
||||
" workflowCoreService.async().createProcessInstance();\r\n" +
|
||||
"</pre>");
|
||||
}
|
||||
|
||||
private static MethodDeclaration createDefaultMethod(String methodName, ClassOrInterfaceDeclaration interfaceDeclaration) {
|
||||
@ -169,11 +168,12 @@ public class CoreServiceCodeGeneration {
|
||||
private static ClassOrInterfaceDeclaration setCommon(CompilationUnit cu, String newClassName) {
|
||||
ClassOrInterfaceDeclaration classOrInterfaceDeclaration = cu.addInterface(newClassName).setPublic(true);
|
||||
classOrInterfaceDeclaration.setJavadocComment("Workflow Engine Starter Core Service\r\n<p>\r\n" +
|
||||
"该类是根据 API 动态生成,不同版本可能会开放新的接口,或回收一些旧接口");
|
||||
"该类是根据 API 动态生成,不同版本可能会开放新的接口,或回收一些旧接口\r\n<p>\r\n" +
|
||||
"Auto generation by workflow engine, It cannot be manually modified");
|
||||
classOrInterfaceDeclaration.addAndGetAnnotation("org.springframework.cloud.openfeign.FeignClient")
|
||||
.addPair("name", new StringLiteralExpr("workflow-engine-starter-core"))
|
||||
.addPair("url", new StringLiteralExpr("${axzo.service.workflow-engine.starter:http://workflow-engine:8080}"))
|
||||
.addPair("configuration", new ClassExpr(new ClassOrInterfaceType("WorkflowEngineStarterFeignConfiguration")));
|
||||
.addPair("name", new StringLiteralExpr("workflow-engine-starter-core"))
|
||||
.addPair("url", new StringLiteralExpr("${axzo.service.workflow-engine.starter:http://workflow-engine:8080}"))
|
||||
.addPair("configuration", new ClassExpr(new ClassOrInterfaceType("WorkflowEngineStarterFeignConfiguration")));
|
||||
cu.addImport("cn.axzo.workflow.starter.feign.ext.WorkflowEngineStarterFeignConfiguration", false, false);
|
||||
cu.addImport("cn.axzo.workflow.common.util.ThreadUtil", false, false);
|
||||
cu.addImport("cn.axzo.workflow.common.enums.RpcInvokeModeEnum.ASYNC", true, false);
|
||||
|
||||
@ -66,15 +66,15 @@ public class ManageServiceCodeGeneration {
|
||||
private static void addDefaultMethods(ClassOrInterfaceDeclaration interfaceDeclaration) {
|
||||
MethodDeclaration sync = createDefaultMethod("sync", interfaceDeclaration);
|
||||
sync.setJavadocComment("强制使用‘同步’模式调用该方法,请在调用真实方法前调用该方法\r\n" +
|
||||
"<pre>\r\n" +
|
||||
" workflowManageService.sync().getTenantIds();\r\n" +
|
||||
"</pre>");
|
||||
"<pre>\r\n" +
|
||||
" workflowManageService.sync().getTenantIds();\r\n" +
|
||||
"</pre>");
|
||||
|
||||
MethodDeclaration async = createDefaultMethod("async", interfaceDeclaration);
|
||||
async.setJavadocComment("强制使用‘异步’模式调用该方法,请在调用真实方法前调用该方法\r\n" +
|
||||
"<pre>\r\n" +
|
||||
" workflowManageService.async().getTenantIds();\r\n" +
|
||||
"</pre>");
|
||||
"<pre>\r\n" +
|
||||
" workflowManageService.async().getTenantIds();\r\n" +
|
||||
"</pre>");
|
||||
}
|
||||
|
||||
private static MethodDeclaration createDefaultMethod(String methodName, ClassOrInterfaceDeclaration interfaceDeclaration) {
|
||||
@ -159,11 +159,12 @@ public class ManageServiceCodeGeneration {
|
||||
private static ClassOrInterfaceDeclaration setCommon(CompilationUnit cu, String newClassName) {
|
||||
ClassOrInterfaceDeclaration classOrInterfaceDeclaration = cu.addInterface(newClassName).setPublic(true);
|
||||
classOrInterfaceDeclaration.setJavadocComment("Workflow Engine Starter Management Service\r\n<p>\r\n" +
|
||||
"该类是根据 API 动态生成,不同版本可能会开放新的接口,或回收一些旧接口");
|
||||
"该类是根据 API 动态生成,不同版本可能会开放新的接口,或回收一些旧接口\r\n<p>\r\n" +
|
||||
"Auto generation by workflow engine, It cannot be manually modified");
|
||||
classOrInterfaceDeclaration.addAndGetAnnotation("org.springframework.cloud.openfeign.FeignClient")
|
||||
.addPair("name", new StringLiteralExpr("workflow-engine-starter-manage"))
|
||||
.addPair("url", new StringLiteralExpr("${axzo.service.workflow-engine.starter:http://workflow-engine:8080}"))
|
||||
.addPair("configuration", new ClassExpr(new ClassOrInterfaceType("WorkflowEngineStarterFeignConfiguration")));
|
||||
.addPair("name", new StringLiteralExpr("workflow-engine-starter-manage"))
|
||||
.addPair("url", new StringLiteralExpr("${axzo.service.workflow-engine.starter:http://workflow-engine:8080}"))
|
||||
.addPair("configuration", new ClassExpr(new ClassOrInterfaceType("WorkflowEngineStarterFeignConfiguration")));
|
||||
cu.addImport("cn.axzo.workflow.starter.feign.ext.WorkflowEngineStarterFeignConfiguration", false, false);
|
||||
cu.addImport("cn.axzo.workflow.common.util.ThreadUtil", false, false);
|
||||
cu.addImport("cn.axzo.workflow.common.enums.RpcInvokeModeEnum.ASYNC", true, false);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user