初始代码
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package com.yunzhupaas;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 启动类
|
||||
*
|
||||
* @author YUNZHUPAAS FlowableYUNZHUPAAS开发组
|
||||
* @version 1.0.0
|
||||
* @since 2024/4/2 17:55
|
||||
**/
|
||||
@SpringBootApplication
|
||||
public class FlowableApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(FlowableApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.yunzhupaas.workflow.admin.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import com.yunzhupaas.workflow.admin.result.Result;
|
||||
import com.yunzhupaas.workflow.common.exception.ResultCode;
|
||||
import com.yunzhupaas.workflow.common.model.fo.DefinitionDeleteFo;
|
||||
import com.yunzhupaas.workflow.common.model.fo.DefinitionDeployFo;
|
||||
import com.yunzhupaas.workflow.common.model.vo.DefinitionVo;
|
||||
import com.yunzhupaas.workflow.common.model.vo.DeploymentVo;
|
||||
import com.yunzhupaas.workflow.common.service.IDefinitionService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程定义控制层
|
||||
*
|
||||
* @author YUNZHUPAAS FlowableYUNZHUPAAS开发组
|
||||
* @version 1.0.0
|
||||
* @since 2024/4/7 10:36
|
||||
*/
|
||||
@Slf4j
|
||||
@Tag(name = "流程定义控制层", description = "DefinitionController")
|
||||
@RestController
|
||||
@RequestMapping("/api/Flow/definition")
|
||||
@RequiredArgsConstructor
|
||||
public class DefinitionController {
|
||||
private final IDefinitionService definitionService;
|
||||
|
||||
/**
|
||||
* 部署流程定义
|
||||
*
|
||||
* @param fo {@link DefinitionDeployFo}
|
||||
* @return {@link Result<DeploymentVo>}
|
||||
* @since 2024/4/7 13:39
|
||||
**/
|
||||
@Operation(summary = "deploy", description = "部署流程定义")
|
||||
@PostMapping("/deploy")
|
||||
public Result<DeploymentVo> deploy(@RequestBody @Valid DefinitionDeployFo fo) {
|
||||
DeploymentVo vo = definitionService.deployDefinition(fo);
|
||||
if (null != vo) {
|
||||
return Result.success(vo);
|
||||
}
|
||||
return Result.failed(ResultCode.DEPLOY_FAILURE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询流程定义
|
||||
*
|
||||
* @return {@link Result<List<DefinitionVo>>}
|
||||
* @since 2024/4/7 13:39
|
||||
**/
|
||||
@Operation(summary = "list", description = "列表查询流程定义")
|
||||
@GetMapping("/list")
|
||||
public Result<List<DefinitionVo>> list() {
|
||||
return Result.success(definitionService.listDefinition());
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程定义
|
||||
*
|
||||
* @param fo {@link DefinitionDeleteFo}
|
||||
* @return {@link Result<Boolean>}
|
||||
* @since 2024/4/7 13:39
|
||||
**/
|
||||
@Operation(summary = "delete", description = "删除流程定义")
|
||||
@DeleteMapping
|
||||
public Result<Boolean> delete(@Valid DefinitionDeleteFo fo) {
|
||||
if (definitionService.deleteDefinition(fo)) {
|
||||
return Result.success(ResultCode.DELETE_SUCCESS);
|
||||
}
|
||||
return Result.failed(ResultCode.DELETE_FAILURE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流程元素
|
||||
*
|
||||
* @param deploymentId 部署ID
|
||||
*/
|
||||
@Operation(summary = "get", description = "获取流程元素")
|
||||
@GetMapping("/{deploymentId}")
|
||||
public Result getStructure(@PathVariable("deploymentId") String deploymentId) {
|
||||
return Result.success(definitionService.getStructure(deploymentId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.yunzhupaas.workflow.admin.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import com.yunzhupaas.workflow.admin.result.Result;
|
||||
import com.yunzhupaas.workflow.common.exception.ResultCode;
|
||||
import com.yunzhupaas.workflow.common.model.fo.InstanceDeleteFo;
|
||||
import com.yunzhupaas.workflow.common.model.fo.InstanceStartFo;
|
||||
import com.yunzhupaas.workflow.common.model.vo.HistoricInstanceVo;
|
||||
import com.yunzhupaas.workflow.common.model.vo.InstanceVo;
|
||||
import com.yunzhupaas.workflow.common.service.IInstanceService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 流程实例控制层
|
||||
*
|
||||
* @author YUNZHUPAAS FlowableYUNZHUPAAS开发组
|
||||
* @version 1.0.0
|
||||
* @since 2024/4/7 16:29
|
||||
*/
|
||||
@Slf4j
|
||||
@Tag(name = "流程实例控制层", description = "InstanceController")
|
||||
@RestController
|
||||
@RequestMapping("/api/Flow/instance")
|
||||
@RequiredArgsConstructor
|
||||
public class InstanceController {
|
||||
private final IInstanceService instanceService;
|
||||
|
||||
/**
|
||||
* 启动流程实例
|
||||
*
|
||||
* @param fo {@link InstanceStartFo}
|
||||
* @return {@link Result<InstanceVo>}
|
||||
* @since 2024/4/7 17:35
|
||||
**/
|
||||
@Operation(summary = "start", description = "启动流程实例")
|
||||
@PostMapping("/start")
|
||||
public Result<InstanceVo> start(@RequestBody @Valid InstanceStartFo fo) {
|
||||
InstanceVo vo = instanceService.startById(fo);
|
||||
if (null != vo) {
|
||||
return Result.success(vo);
|
||||
}
|
||||
return Result.failed(ResultCode.START_FAILURE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流程实例
|
||||
*
|
||||
* @param instanceId {@link String}
|
||||
* @return {@link Result<HistoricInstanceVo>}
|
||||
* @since 2024/4/7 18:17
|
||||
**/
|
||||
@Operation(summary = "get", description = "获取流程实例")
|
||||
@GetMapping("/{instanceId}")
|
||||
public Result<HistoricInstanceVo> getInstance(@PathVariable("instanceId") String instanceId) {
|
||||
return Result.success(instanceService.getHistoricProcessInstance(instanceId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程实例
|
||||
*
|
||||
* @param fo {@link InstanceDeleteFo}
|
||||
* @return {@link Result<Boolean>}
|
||||
* @since 2024/4/7 17:35
|
||||
**/
|
||||
@Operation(summary = "delete", description = "删除流程实例")
|
||||
@DeleteMapping
|
||||
public Result<Boolean> delete(InstanceDeleteFo fo) {
|
||||
if (instanceService.deleteInstance(fo)) {
|
||||
return Result.success(ResultCode.DELETE_SUCCESS);
|
||||
}
|
||||
return Result.failed(ResultCode.DELETE_FAILURE);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,298 @@
|
||||
package com.yunzhupaas.workflow.admin.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import com.yunzhupaas.workflow.admin.result.Result;
|
||||
import com.yunzhupaas.workflow.common.exception.ResultCode;
|
||||
import com.yunzhupaas.workflow.common.model.fo.*;
|
||||
import com.yunzhupaas.workflow.common.model.vo.HistoricNodeVo;
|
||||
import com.yunzhupaas.workflow.common.model.vo.NodeElementVo;
|
||||
import com.yunzhupaas.workflow.common.model.vo.TaskVo;
|
||||
import com.yunzhupaas.workflow.common.service.ITaskService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程任务控制层
|
||||
*
|
||||
* @author YUNZHUPAAS FlowableYUNZHUPAAS开发组
|
||||
* @version 1.0.0
|
||||
* @since 2024/4/8 14:17
|
||||
*/
|
||||
@Slf4j
|
||||
@Tag(name = "流程任务控制层", description = "TaskController")
|
||||
@RestController
|
||||
@RequestMapping("/api/Flow/task")
|
||||
@RequiredArgsConstructor
|
||||
public class TaskController {
|
||||
private final ITaskService taskService;
|
||||
|
||||
/**
|
||||
* 根据流程实例ID获取任务
|
||||
*
|
||||
* @param instanceId {@link String}
|
||||
* @return {@link Result<List<TaskVo>>}
|
||||
* @since 2024/4/8 15:10
|
||||
**/
|
||||
@Operation(summary = "list", description = "根据流程实例ID获取任务")
|
||||
@GetMapping("/list/{instanceId}")
|
||||
public Result<List<TaskVo>> list(@PathVariable("instanceId") String instanceId) {
|
||||
return Result.success(taskService.getTask(instanceId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成任务
|
||||
*
|
||||
* @param fo {@link TaskCompleteFo}
|
||||
* @return {@link Result<Boolean>}
|
||||
* @since 2024/4/8 15:10
|
||||
**/
|
||||
@Operation(summary = "complete", description = "完成任务")
|
||||
@PostMapping("/complete")
|
||||
public Result<Boolean> complete(@RequestBody @Valid TaskCompleteFo fo) {
|
||||
if (taskService.complete(fo)) {
|
||||
return Result.success(ResultCode.COMPLETE_SUCCESS);
|
||||
}
|
||||
return Result.failed(ResultCode.COMPLETE_FAILURE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 单节点跳转多节点
|
||||
*
|
||||
* @param fo {@link MoveSingleToMultiFo}
|
||||
* @return {@link Result<Boolean>}
|
||||
* @since 2024/4/10 10:30
|
||||
**/
|
||||
@Operation(summary = "moveSingleToMulti", description = "单节点跳转多节点")
|
||||
@PostMapping("/move/single/to/multi")
|
||||
public Result<Boolean> moveSingleToMulti(@RequestBody @Valid MoveSingleToMultiFo fo) {
|
||||
if (taskService.moveSingleToMulti(fo)) {
|
||||
return Result.success(ResultCode.JUMP_SUCCESS);
|
||||
}
|
||||
return Result.failed(ResultCode.JUMP_FAILURE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 多节点跳转单节点
|
||||
*
|
||||
* @param fo {@link MoveMultiToSingleFo}
|
||||
* @return {@link Result<Boolean>}
|
||||
* @since 2024/4/10 10:30
|
||||
**/
|
||||
@Operation(summary = "moveMultiToSingle", description = "多节点跳转单节点")
|
||||
@PostMapping("/move/multi/to/single")
|
||||
public Result<Boolean> moveMultiToSingle(@RequestBody @Valid MoveMultiToSingleFo fo) {
|
||||
if (taskService.moveMultiToSingle(fo)) {
|
||||
return Result.success(ResultCode.JUMP_SUCCESS);
|
||||
}
|
||||
return Result.failed(ResultCode.JUMP_FAILURE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 节点跳转
|
||||
*
|
||||
* @param fo {@link JumpFo}
|
||||
* @return {@link Result<Boolean>}
|
||||
* @since 2024/4/10 11:50
|
||||
**/
|
||||
@Operation(summary = "jump", description = "节点跳转")
|
||||
@PostMapping("/jump")
|
||||
public Result<Boolean> jump(@RequestBody JumpFo fo) {
|
||||
if (taskService.jump(fo)) {
|
||||
return Result.success(ResultCode.JUMP_SUCCESS);
|
||||
}
|
||||
return Result.failed(ResultCode.JUMP_FAILURE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取可回退的节点ID
|
||||
*
|
||||
* @param taskId {@link String}
|
||||
* @return {@link Result<List<String>>}
|
||||
* @since 2024/4/8 16:03
|
||||
**/
|
||||
@Operation(summary = "fallbacks", description = "获取可回退的节点ID")
|
||||
@GetMapping("/fallbacks/{taskId}")
|
||||
public Result<List<String>> fallbacks(@PathVariable("taskId") String taskId) {
|
||||
return Result.success(taskService.getFallbacks(taskId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 退回
|
||||
*
|
||||
* @param fo {@link TaskBackFo}
|
||||
* @return {@link Result<List<String>>}
|
||||
* @since 2024/4/9 9:27
|
||||
**/
|
||||
@Operation(summary = "back", description = "退回")
|
||||
@PostMapping("/back")
|
||||
public Result<List<String>> back(@RequestBody @Valid TaskBackFo fo) {
|
||||
return Result.success(taskService.back(fo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取上一级任务节点ID集合
|
||||
*
|
||||
* @param fo {@link TaskPrevFo}
|
||||
* @return {@link Result<List<String>>}
|
||||
* @since 2024/4/9 9:27
|
||||
**/
|
||||
@Operation(summary = "get", description = "获取上一级任务节点ID集合")
|
||||
@GetMapping("/prev")
|
||||
public Result<List<String>> getPrev(TaskPrevFo fo) {
|
||||
return Result.success(taskService.getPrevUserTask(fo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取下一级任务节点集合
|
||||
*
|
||||
* @param fo {@link TaskNextFo}
|
||||
* @return {@link Result<List< NodeElementVo >>}
|
||||
* @since 2024/4/9 9:27
|
||||
**/
|
||||
@Operation(summary = "get", description = "获取下一级任务节点集合")
|
||||
@GetMapping("/next")
|
||||
public Result<List<NodeElementVo>> getNext(TaskNextFo fo) {
|
||||
return Result.success(taskService.getNextUserTask(fo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回
|
||||
*
|
||||
* @param taskId {@link String}
|
||||
* @return {@link Result<Boolean>}
|
||||
* @since 2024/4/9 11:08
|
||||
**/
|
||||
@Operation(summary = "retract", description = "撤回")
|
||||
@PostMapping("/retract/{taskId}")
|
||||
public Result<Boolean> retract(@PathVariable("taskId") String taskId) {
|
||||
if (taskService.retract(taskId)) {
|
||||
return Result.success(ResultCode.RETRACT_SUCCESS);
|
||||
}
|
||||
return Result.failed(ResultCode.RETRACT_FAILURE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取出线Key集合(若出线的出口为网关,则一并获取网关的出线)
|
||||
*
|
||||
* @param fo {@link TaskOutgoingFo}
|
||||
* @return {@link Result<List<String>>}
|
||||
* @since 2024/4/9 11:08
|
||||
**/
|
||||
@Operation(summary = "outgoingFlows", description = "获取出线Key集合(若出线的出口为网关,则一并获取网关的出线)")
|
||||
@GetMapping("/outgoing/flows")
|
||||
public Result<List<String>> getOutgoingFlows(TaskOutgoingFo fo) {
|
||||
return Result.success(taskService.getOutgoingFlows(fo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取完成的节点Key
|
||||
*
|
||||
* @param instanceId {@link String}
|
||||
* @return {@link Result<List<String>>}
|
||||
* @since 2024/4/9 13:54
|
||||
**/
|
||||
@Operation(summary = "get", description = "获取完成的节点Key")
|
||||
@GetMapping("/finished/keys/{instanceId}")
|
||||
public Result<List<String>> getKeysOfFinished(@PathVariable("instanceId") String instanceId) {
|
||||
return Result.success(taskService.getKeysOfFinished(instanceId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取进线的Key
|
||||
*
|
||||
* @param taskId {@link String}
|
||||
* @return {@link Result<List<String>>}
|
||||
* @since 2024/4/9 13:58
|
||||
**/
|
||||
@Operation(summary = "get", description = "获取进线的Key")
|
||||
@GetMapping("/incoming/flows/{taskId}")
|
||||
public Result<List<String>> getIncomingFlows(@PathVariable("taskId") String taskId) {
|
||||
return Result.success(taskService.getIncomingFlows(taskId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取线之后的任务节点
|
||||
*
|
||||
* @param fo {@link FlowTargetTaskFo}
|
||||
* @return {@link Result<String>}
|
||||
* @since 2024/4/17 17:48
|
||||
**/
|
||||
@Operation(summary = "get", description = "获取线之后的任务节点")
|
||||
@GetMapping("/flow/target")
|
||||
public Result<List<String>> getTaskKeyAfterFlow(FlowTargetTaskFo fo) {
|
||||
return Result.success(taskService.getTaskKeyAfterFlow(fo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取未经过的节点
|
||||
*
|
||||
* @param instanceId {@link String}
|
||||
* @return {@link Result<List<String>>}
|
||||
* @since 2024/4/29 10:08
|
||||
**/
|
||||
@Operation(summary = "get", description = "获取未经过的节点")
|
||||
@GetMapping("/tobe/pass/{instanceId}")
|
||||
public Result<List<String>> getToBePass(@PathVariable("instanceId") String instanceId) {
|
||||
return Result.success(taskService.getToBePass(instanceId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取节点的后续节点
|
||||
*
|
||||
* @param fo 参数
|
||||
*/
|
||||
@Operation(summary = "get", description = "获取节点的后续节点")
|
||||
@PostMapping("/after")
|
||||
public Result<List<String>> getAfter(@RequestBody TaskAfterFo fo) {
|
||||
return Result.success(taskService.getAfter(fo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 异常补偿
|
||||
*
|
||||
* @param fo 参数
|
||||
*/
|
||||
@Operation(summary = "compensate", description = "异常补偿")
|
||||
@PostMapping("/compensate")
|
||||
public Result<List<TaskVo>> compensate(@RequestBody CompensateFo fo) {
|
||||
return Result.success(taskService.compensate(fo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取历史节点
|
||||
*
|
||||
* @param instanceId 实例主键
|
||||
*/
|
||||
@Operation(summary = "historic", description = "获取历史节点")
|
||||
@GetMapping("/historic/{instanceId}")
|
||||
public Result<List<HistoricNodeVo>> getHistoric(@PathVariable("instanceId") String instanceId) {
|
||||
return Result.success(taskService.getHistoric(instanceId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取历史结束节点
|
||||
*
|
||||
* @param instanceId 实例主键
|
||||
*/
|
||||
@Operation(summary = "historicEnd", description = "获取历史结束节点")
|
||||
@GetMapping("/historic/end/{instanceId}")
|
||||
public Result<List<String>> getHistoricEnd(@PathVariable("instanceId") String instanceId) {
|
||||
return Result.success(taskService.getHistoricEnd(instanceId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取元素信息
|
||||
*
|
||||
* @param model 参数
|
||||
*/
|
||||
@Operation(summary = "elementInfo", description = "获取元素信息")
|
||||
@GetMapping("/element/info")
|
||||
public Result getElementInfo(InfoModel model) {
|
||||
return Result.success(taskService.getElementInfo(model));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.yunzhupaas.workflow.admin.handle;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import com.yunzhupaas.workflow.admin.result.Result;
|
||||
import com.yunzhupaas.workflow.common.exception.BizException;
|
||||
import com.yunzhupaas.workflow.common.exception.ResultCode;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.support.DefaultMessageSourceResolvable;
|
||||
import org.springframework.validation.BindException;
|
||||
import org.springframework.validation.FieldError;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 全局异常处理
|
||||
*
|
||||
* @author YUNZHUPAAS FlowableYUNZHUPAAS开发组
|
||||
* @version 1.0.0
|
||||
* @since 2024/4/3 15:33
|
||||
*/
|
||||
@Slf4j
|
||||
@RestControllerAdvice
|
||||
public class GlobalExceptionHandler {
|
||||
@ExceptionHandler(BindException.class)
|
||||
public Result<?> bindExceptionHandler(BindException e) {
|
||||
log.error("接口校验失败!原因是:{}", e.getMessage(), e);
|
||||
List<FieldError> fieldErrors = e.getBindingResult().getFieldErrors();
|
||||
List<String> collect = fieldErrors.stream()
|
||||
.map(DefaultMessageSourceResolvable::getDefaultMessage)
|
||||
.collect(Collectors.toList());
|
||||
String msg = String.join(",", collect);
|
||||
return Result.failed(ResultCode.REQUEST_PARAM_IS_NULL, msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理空指针的异常
|
||||
*/
|
||||
@ExceptionHandler(value = NullPointerException.class)
|
||||
public Result<?> exceptionHandler(HttpServletRequest req, NullPointerException e) {
|
||||
log.error("发生空指针异常!原因是:{}", e.getMessage(), e);
|
||||
return Result.failed(ResultCode.SYSTEM_EXECUTION_ERROR);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理自定义异常
|
||||
*/
|
||||
@ExceptionHandler(value = BizException.class)
|
||||
public Result<?> exceptionHandler(HttpServletRequest req, BizException e) {
|
||||
log.error("BizException!原因是:{}", e.getMessage(), e);
|
||||
return Result.failed(e.getResultCode(), e.getMessage());
|
||||
}
|
||||
|
||||
@ExceptionHandler(Exception.class)
|
||||
public Result<?> exceptionHandler(HttpServletRequest req, Exception e) {
|
||||
log.error("未知异常!原因是:{}", e.getMessage(), e);
|
||||
return Result.failed(e.getMessage());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.yunzhupaas.workflow.admin.result;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.yunzhupaas.workflow.common.exception.ResultCode;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 统一返回结果类
|
||||
*
|
||||
* @author YUNZHUPAAS FlowableYUNZHUPAAS开发组
|
||||
* @version 1.0.0
|
||||
* @since 2024/4/3 15:00
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class Result<T> implements Serializable {
|
||||
private Boolean success;
|
||||
private String code;
|
||||
private String msg;
|
||||
private T data;
|
||||
|
||||
public static <T> Result<T> result(Boolean success, String code, String msg, T data) {
|
||||
Result<T> result = new Result<>();
|
||||
result.setSuccess(success);
|
||||
result.setCode(code);
|
||||
result.setMsg(msg);
|
||||
result.setData(data);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static <T> Result<T> result(Boolean success, ResultCode resultCode, T data) {
|
||||
return result(success, resultCode.getCode(), resultCode.getMsg(), data);
|
||||
}
|
||||
|
||||
public static <T> boolean isSuccess(Result<T> result) {
|
||||
return result != null && ResultCode.SUCCESS.getCode().equals(result.getCode());
|
||||
}
|
||||
|
||||
public static <T> Result<T> success() {
|
||||
return result(true, ResultCode.SUCCESS, null);
|
||||
}
|
||||
|
||||
public static <T> Result<T> success(T data) {
|
||||
return result(true, ResultCode.SUCCESS, data);
|
||||
}
|
||||
|
||||
public static <T> Result<T> success(ResultCode resultCode, T data) {
|
||||
return result(true, resultCode, data);
|
||||
}
|
||||
|
||||
public static <T> Result<T> success(ResultCode resultCode) {
|
||||
return result(true, resultCode, null);
|
||||
}
|
||||
|
||||
public static <T> Result<T> success(String code, String msg, T data) {
|
||||
return result(true, code, msg, data);
|
||||
}
|
||||
|
||||
public static <T> Result<T> success(String msg) {
|
||||
return result(true, ResultCode.SUCCESS.getCode(), msg, null);
|
||||
}
|
||||
|
||||
public static <T> Result<T> failed() {
|
||||
return result(false, ResultCode.FAILURE.getCode(), ResultCode.FAILURE.getMsg(), null);
|
||||
}
|
||||
|
||||
public static <T> Result<T> failed(T data) {
|
||||
return result(false, ResultCode.FAILURE.getCode(), ResultCode.FAILURE.getMsg(), data);
|
||||
}
|
||||
|
||||
public static <T> Result<T> failed(String msg) {
|
||||
return result(false, ResultCode.FAILURE.getCode(), msg, null);
|
||||
}
|
||||
|
||||
public static <T> Result<T> failed(String msg, T data) {
|
||||
return result(false, ResultCode.FAILURE.getCode(), msg, data);
|
||||
}
|
||||
|
||||
public static <T> Result<T> failed(ResultCode resultCode) {
|
||||
return result(false, resultCode.getCode(), resultCode.getMsg(), null);
|
||||
}
|
||||
|
||||
public static <T> Result<T> failed(ResultCode resultCode, T data) {
|
||||
return result(false, resultCode.getCode(), resultCode.getMsg(), data);
|
||||
}
|
||||
|
||||
public static <T> Result<T> failed(ResultCode resultCode, String msg) {
|
||||
return result(false, resultCode.getCode(), msg, null);
|
||||
}
|
||||
|
||||
public static <T> Result<T> failed(ResultCode resultCode, String msg, T data) {
|
||||
return result(false, resultCode.getCode(), msg, data);
|
||||
}
|
||||
}
|
||||
101
yunzhupaas-workflow-admin/src/main/resources/application-dev.yml
Normal file
101
yunzhupaas-workflow-admin/src/main/resources/application-dev.yml
Normal file
@@ -0,0 +1,101 @@
|
||||
server:
|
||||
port: 31000
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: info
|
||||
org.flowable.engine.impl.persistence.entity.*: debug
|
||||
org.flowable.task.service.impl.persistence.entity.*: debug
|
||||
|
||||
# 注意:
|
||||
# 若使用 Oracle 或 达梦 数据库必需配置模式名称
|
||||
# 若使用 PostgreSQL 和 人大金仓KingbaseES 数据库, 默认public模式无需配置模式名称, 若指定模式需要配置模式名称
|
||||
# 若使用 MySQL 和 SQLServer 无需配置模式名称
|
||||
#flowable:
|
||||
# database-schema: YUNZHUPAAS_FLOW
|
||||
|
||||
# ===================== 1 若使用MySQL数据库-Start =====================
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
type: com.mysql.cj.jdbc.MysqlDataSource
|
||||
url: jdbc:mysql://mysql.szlecheng.cn:13306/jnpfsoft_flow?yunzhupaasDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
|
||||
username: jnpfsoft_flow
|
||||
password: C6J7BiD2bskYAwtZ
|
||||
# ===================== 1 若使用MySQL数据库-End =======================
|
||||
# ===================== 2 若使用SQLServer数据库-Start =====================
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
# type: com.microsoft.sqlserver.jdbc.SQLServerDataSource
|
||||
# url: jdbc:sqlserver://127.0.0.1:1433;databaseName=yunzhupaas_flow;trustServerCertificate=true
|
||||
# username: sa
|
||||
# password: 123456
|
||||
# ===================== 2 若使用SQLServer数据库-End =======================
|
||||
# ===================== 3 若使用Oracle数据库-Start =====================
|
||||
#flowable:
|
||||
# database-schema: YUNZHUPAAS_FLOW
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: oracle.jdbc.OracleDriver
|
||||
# type: oracle.jdbc.datasource.impl.OracleDataSource
|
||||
# url: jdbc:oracle:thin:@127.0.0.1:1521:ORCL
|
||||
# username: YUNZHUPAAS_FLOW
|
||||
# password: dbpasswd
|
||||
# ===================== 3 若使用Oracle数据库-End =======================
|
||||
# ===================== 4 若使用PostgreSQL数据库-Start =====================
|
||||
# ========== 4.1 若使用默认public模式-Start ==========
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
# type: org.postgresql.ds.PGSimpleDataSource
|
||||
# url: jdbc:postgresql://127.0.0.1:5432/yunzhupaas_flow
|
||||
# username: dbuser
|
||||
# password: dbpasswd
|
||||
# ========== 4.1 若使用默认public模式-End ==========
|
||||
# ========== 4.2 若使用其他模式-Start ==========
|
||||
#flowable:
|
||||
# database-schema: yunzhupaas_flow
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
# type: org.postgresql.ds.PGSimpleDataSource
|
||||
# url: jdbc:postgresql://127.0.0.1:5432/yunzhupaas_flow
|
||||
# username: dbuser
|
||||
# password: dbpasswd
|
||||
# ========== 4.2 若使用其他模式-End ==========
|
||||
# ===================== 4 若使用PostgreSQL数据库-End =======================
|
||||
# ===================== 5 若使用达梦dm8数据库-Start =====================
|
||||
#flowable:
|
||||
# database-schema: YUNZHUPAAS_FLOW
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: dm.jdbc.driver.DmDriver
|
||||
# type: dm.jdbc.driver.DmdbDataSource
|
||||
# # 连接后面需要添加参数 ?compatibleMode=oracle
|
||||
# url: jdbc:dm://127.0.0.1:5236/YUNZHUPAAS_FLOW?compatibleMode=oracle
|
||||
# username: dbuser
|
||||
# password: dbpasswd
|
||||
# ===================== 5 若使用达梦dm8数据库-End =======================
|
||||
# ===================== 6 若使用人大金仓KingbaseES数据库-Start =====================
|
||||
# ========== 6.1 若使用默认public模式-Start ==========
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
# type: org.postgresql.ds.PGSimpleDataSource
|
||||
# url: jdbc:postgresql://127.0.0.1:5432/yunzhupaas_flow
|
||||
# username: dbuser
|
||||
# password: dbpasswd
|
||||
# ========== 6.1 若使用默认public模式-End ==========
|
||||
# ========== 6.2 若使用其他模式-Start ==========
|
||||
#flowable:
|
||||
# database-schema: yunzhupaas_flow
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
# type: org.postgresql.ds.PGSimpleDataSource
|
||||
# url: jdbc:postgresql://127.0.0.1:5432/yunzhupaas_flow
|
||||
# username: dbuser
|
||||
# password: dbpasswd
|
||||
# ========== 6.2 若使用其他模式-End ==========
|
||||
# ===================== 6 若使用人大金仓KingbaseES数据库-End =======================
|
||||
@@ -0,0 +1,101 @@
|
||||
server:
|
||||
port: 31000
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: info
|
||||
org.flowable.engine.impl.persistence.entity.*: debug
|
||||
org.flowable.task.service.impl.persistence.entity.*: debug
|
||||
|
||||
# 注意:
|
||||
# 若使用 Oracle 或 达梦 数据库必需配置模式名称
|
||||
# 若使用 PostgreSQL 和 人大金仓KingbaseES 数据库, 默认public模式无需配置模式名称, 若指定模式需要配置模式名称
|
||||
# 若使用 MySQL 和 SQLServer 无需配置模式名称
|
||||
#flowable:
|
||||
# database-schema: YUNZHUPAAS_FLOW
|
||||
|
||||
# ===================== 1 若使用MySQL数据库-Start =====================
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
type: com.mysql.cj.jdbc.MysqlDataSource
|
||||
url: jdbc:mysql://127.0.0.1:3306/yunzhupaas_flow?yunzhupaasDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true
|
||||
username: root
|
||||
password: 123456
|
||||
# ===================== 1 若使用MySQL数据库-End =======================
|
||||
# ===================== 2 若使用SQLServer数据库-Start =====================
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
# type: com.microsoft.sqlserver.jdbc.SQLServerDataSource
|
||||
# url: jdbc:sqlserver://127.0.0.1:1433;databaseName=yunzhupaas_flow;trustServerCertificate=true
|
||||
# username: sa
|
||||
# password: 123456
|
||||
# ===================== 2 若使用SQLServer数据库-End =======================
|
||||
# ===================== 3 若使用Oracle数据库-Start =====================
|
||||
#flowable:
|
||||
# database-schema: YUNZHUPAAS_FLOW
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: oracle.jdbc.OracleDriver
|
||||
# type: oracle.jdbc.datasource.impl.OracleDataSource
|
||||
# url: jdbc:oracle:thin:@127.0.0.1:1521:ORCL
|
||||
# username: YUNZHUPAAS_FLOW
|
||||
# password: dbpasswd
|
||||
# ===================== 3 若使用Oracle数据库-End =======================
|
||||
# ===================== 4 若使用PostgreSQL数据库-Start =====================
|
||||
# ========== 4.1 若使用默认public模式-Start ==========
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
# type: org.postgresql.ds.PGSimpleDataSource
|
||||
# url: jdbc:postgresql://127.0.0.1:5432/yunzhupaas_flow
|
||||
# username: dbuser
|
||||
# password: dbpasswd
|
||||
# ========== 4.1 若使用默认public模式-End ==========
|
||||
# ========== 4.2 若使用其他模式-Start ==========
|
||||
#flowable:
|
||||
# database-schema: yunzhupaas_flow
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
# type: org.postgresql.ds.PGSimpleDataSource
|
||||
# url: jdbc:postgresql://127.0.0.1:5432/yunzhupaas_flow
|
||||
# username: dbuser
|
||||
# password: dbpasswd
|
||||
# ========== 4.2 若使用其他模式-End ==========
|
||||
# ===================== 4 若使用PostgreSQL数据库-End =======================
|
||||
# ===================== 5 若使用达梦dm8数据库-Start =====================
|
||||
#flowable:
|
||||
# database-schema: YUNZHUPAAS_FLOW
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: dm.jdbc.driver.DmDriver
|
||||
# type: dm.jdbc.driver.DmdbDataSource
|
||||
# # 连接后面需要添加参数 ?compatibleMode=oracle
|
||||
# url: jdbc:dm://127.0.0.1:5236/YUNZHUPAAS_FLOW?compatibleMode=oracle
|
||||
# username: dbuser
|
||||
# password: dbpasswd
|
||||
# ===================== 5 若使用达梦dm8数据库-End =======================
|
||||
# ===================== 6 若使用人大金仓KingbaseES数据库-Start =====================
|
||||
# ========== 6.1 若使用默认public模式-Start ==========
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
# type: org.postgresql.ds.PGSimpleDataSource
|
||||
# url: jdbc:postgresql://127.0.0.1:5432/yunzhupaas_flow
|
||||
# username: dbuser
|
||||
# password: dbpasswd
|
||||
# ========== 6.1 若使用默认public模式-End ==========
|
||||
# ========== 6.2 若使用其他模式-Start ==========
|
||||
#flowable:
|
||||
# database-schema: yunzhupaas_flow
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
# type: org.postgresql.ds.PGSimpleDataSource
|
||||
# url: jdbc:postgresql://127.0.0.1:5432/yunzhupaas_flow
|
||||
# username: dbuser
|
||||
# password: dbpasswd
|
||||
# ========== 6.2 若使用其他模式-End ==========
|
||||
# ===================== 6 若使用人大金仓KingbaseES数据库-End =======================
|
||||
@@ -0,0 +1,101 @@
|
||||
server:
|
||||
port: 31000
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: info
|
||||
org.flowable.engine.impl.persistence.entity.*: debug
|
||||
org.flowable.task.service.impl.persistence.entity.*: debug
|
||||
|
||||
# 注意:
|
||||
# 若使用 Oracle 或 达梦 数据库必需配置模式名称
|
||||
# 若使用 PostgreSQL 和 人大金仓KingbaseES 数据库, 默认public模式无需配置模式名称, 若指定模式需要配置模式名称
|
||||
# 若使用 MySQL 和 SQLServer 无需配置模式名称
|
||||
#flowable:
|
||||
# database-schema: YUNZHUPAAS_FLOW
|
||||
|
||||
# ===================== 1 若使用MySQL数据库-Start =====================
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
type: com.mysql.cj.jdbc.MysqlDataSource
|
||||
url: jdbc:mysql://127.0.0.1:3306/yunzhupaas_flow?yunzhupaasDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true
|
||||
username: root
|
||||
password: 123456
|
||||
# ===================== 1 若使用MySQL数据库-End =======================
|
||||
# ===================== 2 若使用SQLServer数据库-Start =====================
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
# type: com.microsoft.sqlserver.jdbc.SQLServerDataSource
|
||||
# url: jdbc:sqlserver://127.0.0.1:1433;databaseName=yunzhupaas_flow;trustServerCertificate=true
|
||||
# username: sa
|
||||
# password: 123456
|
||||
# ===================== 2 若使用SQLServer数据库-End =======================
|
||||
# ===================== 3 若使用Oracle数据库-Start =====================
|
||||
#flowable:
|
||||
# database-schema: YUNZHUPAAS_FLOW
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: oracle.jdbc.OracleDriver
|
||||
# type: oracle.jdbc.datasource.impl.OracleDataSource
|
||||
# url: jdbc:oracle:thin:@127.0.0.1:1521:ORCL
|
||||
# username: YUNZHUPAAS_FLOW
|
||||
# password: dbpasswd
|
||||
# ===================== 3 若使用Oracle数据库-End =======================
|
||||
# ===================== 4 若使用PostgreSQL数据库-Start =====================
|
||||
# ========== 4.1 若使用默认public模式-Start ==========
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
# type: org.postgresql.ds.PGSimpleDataSource
|
||||
# url: jdbc:postgresql://127.0.0.1:5432/yunzhupaas_flow
|
||||
# username: dbuser
|
||||
# password: dbpasswd
|
||||
# ========== 4.1 若使用默认public模式-End ==========
|
||||
# ========== 4.2 若使用其他模式-Start ==========
|
||||
#flowable:
|
||||
# database-schema: yunzhupaas_flow
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
# type: org.postgresql.ds.PGSimpleDataSource
|
||||
# url: jdbc:postgresql://127.0.0.1:5432/yunzhupaas_flow
|
||||
# username: dbuser
|
||||
# password: dbpasswd
|
||||
# ========== 4.2 若使用其他模式-End ==========
|
||||
# ===================== 4 若使用PostgreSQL数据库-End =======================
|
||||
# ===================== 5 若使用达梦dm8数据库-Start =====================
|
||||
#flowable:
|
||||
# database-schema: YUNZHUPAAS_FLOW
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: dm.jdbc.driver.DmDriver
|
||||
# type: dm.jdbc.driver.DmdbDataSource
|
||||
# # 连接后面需要添加参数 ?compatibleMode=oracle
|
||||
# url: jdbc:dm://127.0.0.1:5236/YUNZHUPAAS_FLOW?compatibleMode=oracle
|
||||
# username: dbuser
|
||||
# password: dbpasswd
|
||||
# ===================== 5 若使用达梦dm8数据库-End =======================
|
||||
# ===================== 6 若使用人大金仓KingbaseES数据库-Start =====================
|
||||
# ========== 6.1 若使用默认public模式-Start ==========
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
# type: org.postgresql.ds.PGSimpleDataSource
|
||||
# url: jdbc:postgresql://127.0.0.1:5432/yunzhupaas_flow
|
||||
# username: dbuser
|
||||
# password: dbpasswd
|
||||
# ========== 6.1 若使用默认public模式-End ==========
|
||||
# ========== 6.2 若使用其他模式-Start ==========
|
||||
#flowable:
|
||||
# database-schema: yunzhupaas_flow
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
# type: org.postgresql.ds.PGSimpleDataSource
|
||||
# url: jdbc:postgresql://127.0.0.1:5432/yunzhupaas_flow
|
||||
# username: dbuser
|
||||
# password: dbpasswd
|
||||
# ========== 6.2 若使用其他模式-End ==========
|
||||
# ===================== 6 若使用人大金仓KingbaseES数据库-End =======================
|
||||
@@ -0,0 +1,101 @@
|
||||
server:
|
||||
port: 31000
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: info
|
||||
org.flowable.engine.impl.persistence.entity.*: debug
|
||||
org.flowable.task.service.impl.persistence.entity.*: debug
|
||||
|
||||
# 注意:
|
||||
# 若使用 Oracle 或 达梦 数据库必需配置模式名称
|
||||
# 若使用 PostgreSQL 和 人大金仓KingbaseES 数据库, 默认public模式无需配置模式名称, 若指定模式需要配置模式名称
|
||||
# 若使用 MySQL 和 SQLServer 无需配置模式名称
|
||||
#flowable:
|
||||
# database-schema: YUNZHUPAAS_FLOW
|
||||
|
||||
# ===================== 1 若使用MySQL数据库-Start =====================
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
type: com.mysql.cj.jdbc.MysqlDataSource
|
||||
url: jdbc:mysql://127.0.0.1:3306/yunzhupaas_flow?yunzhupaasDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&nullCatalogMeansCurrent=true
|
||||
username: root
|
||||
password: 123456
|
||||
# ===================== 1 若使用MySQL数据库-End =======================
|
||||
# ===================== 2 若使用SQLServer数据库-Start =====================
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
# type: com.microsoft.sqlserver.jdbc.SQLServerDataSource
|
||||
# url: jdbc:sqlserver://127.0.0.1:1433;databaseName=yunzhupaas_flow;trustServerCertificate=true
|
||||
# username: sa
|
||||
# password: 123456
|
||||
# ===================== 2 若使用SQLServer数据库-End =======================
|
||||
# ===================== 3 若使用Oracle数据库-Start =====================
|
||||
#flowable:
|
||||
# database-schema: YUNZHUPAAS_FLOW
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: oracle.jdbc.OracleDriver
|
||||
# type: oracle.jdbc.datasource.impl.OracleDataSource
|
||||
# url: jdbc:oracle:thin:@127.0.0.1:1521:ORCL
|
||||
# username: YUNZHUPAAS_FLOW
|
||||
# password: dbpasswd
|
||||
# ===================== 3 若使用Oracle数据库-End =======================
|
||||
# ===================== 4 若使用PostgreSQL数据库-Start =====================
|
||||
# ========== 4.1 若使用默认public模式-Start ==========
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
# type: org.postgresql.ds.PGSimpleDataSource
|
||||
# url: jdbc:postgresql://127.0.0.1:5432/yunzhupaas_flow
|
||||
# username: dbuser
|
||||
# password: dbpasswd
|
||||
# ========== 4.1 若使用默认public模式-End ==========
|
||||
# ========== 4.2 若使用其他模式-Start ==========
|
||||
#flowable:
|
||||
# database-schema: yunzhupaas_flow
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
# type: org.postgresql.ds.PGSimpleDataSource
|
||||
# url: jdbc:postgresql://127.0.0.1:5432/yunzhupaas_flow
|
||||
# username: dbuser
|
||||
# password: dbpasswd
|
||||
# ========== 4.2 若使用其他模式-End ==========
|
||||
# ===================== 4 若使用PostgreSQL数据库-End =======================
|
||||
# ===================== 5 若使用达梦dm8数据库-Start =====================
|
||||
#flowable:
|
||||
# database-schema: YUNZHUPAAS_FLOW
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: dm.jdbc.driver.DmDriver
|
||||
# type: dm.jdbc.driver.DmdbDataSource
|
||||
# # 连接后面需要添加参数 ?compatibleMode=oracle
|
||||
# url: jdbc:dm://127.0.0.1:5236/YUNZHUPAAS_FLOW?compatibleMode=oracle
|
||||
# username: dbuser
|
||||
# password: dbpasswd
|
||||
# ===================== 5 若使用达梦dm8数据库-End =======================
|
||||
# ===================== 6 若使用人大金仓KingbaseES数据库-Start =====================
|
||||
# ========== 6.1 若使用默认public模式-Start ==========
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
# type: org.postgresql.ds.PGSimpleDataSource
|
||||
# url: jdbc:postgresql://127.0.0.1:5432/yunzhupaas_flow
|
||||
# username: dbuser
|
||||
# password: dbpasswd
|
||||
# ========== 6.1 若使用默认public模式-End ==========
|
||||
# ========== 6.2 若使用其他模式-Start ==========
|
||||
#flowable:
|
||||
# database-schema: yunzhupaas_flow
|
||||
#spring:
|
||||
# datasource:
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
# type: org.postgresql.ds.PGSimpleDataSource
|
||||
# url: jdbc:postgresql://127.0.0.1:5432/yunzhupaas_flow
|
||||
# username: dbuser
|
||||
# password: dbpasswd
|
||||
# ========== 6.2 若使用其他模式-End ==========
|
||||
# ===================== 6 若使用人大金仓KingbaseES数据库-End =======================
|
||||
24
yunzhupaas-workflow-admin/src/main/resources/application.yml
Normal file
24
yunzhupaas-workflow-admin/src/main/resources/application.yml
Normal file
@@ -0,0 +1,24 @@
|
||||
spring:
|
||||
application:
|
||||
name: yunzhupaas-workflow
|
||||
profiles:
|
||||
# 指定环境配置 dev(开发环境-默认)、test(测试环境)、preview(预生产)、prod(生产环境)
|
||||
active: dev
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
allow-circular-references: true
|
||||
|
||||
logging:
|
||||
config: classpath:logback-spring.xml
|
||||
springdoc:
|
||||
default-flat-param-object: true
|
||||
api-docs:
|
||||
enabled: true
|
||||
|
||||
#SpringDoc增强
|
||||
#knife4j:
|
||||
# basic: #接口文档访问鉴权
|
||||
# enable: true
|
||||
# username: yunzhupaas
|
||||
# password: 123456
|
||||
# enable: true
|
||||
339
yunzhupaas-workflow-admin/src/main/resources/logback-spring.xml
Normal file
339
yunzhupaas-workflow-admin/src/main/resources/logback-spring.xml
Normal file
@@ -0,0 +1,339 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
|
||||
<!--日志格式应用spring boot默认的格式,也可以自己更改-->
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
|
||||
<property name="FILE_LOG_PATTERN" value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] [%thread] [%logger{50}] [%M] [%line] - %msg%n" />
|
||||
<springProperty scope="context" name="SERVICE_NAME" source="spring.application.name" defaultValue="yunzhupaas"/>
|
||||
|
||||
<!--定义日志存放的位置,默认存放在项目启动的相对路径的目录-->
|
||||
<springProperty scope="context" name="LOG_PATH" source="log.path" defaultValue="log/${SERVICE_NAME}"/>
|
||||
<!-- 全局日志等级 -->
|
||||
<springProperty scope="context" name="LOG_LEVEL_ROOT" source="log.level.root" defaultValue="INFO"/>
|
||||
<!-- 服务自定义等级 如需自定义服务日志等级 修改下方的【自定义服务名】与nacos上的log.level.自定义服务名=等级 -->
|
||||
<springProperty scope="context" name="LOG_LEVEL" source="log.level.yunzhupaas-boot" defaultValue="${LOG_LEVEL_ROOT}"/>
|
||||
|
||||
<!-- 日志记录器,日期滚动记录,level为 ERROR 日志 -->
|
||||
<appender name="FILE_ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
|
||||
<!-- 正在记录的日志文件的路径及文件名 -->
|
||||
<file>${LOG_PATH}/log_error.log</file>
|
||||
|
||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
|
||||
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
|
||||
<fileNamePattern>${LOG_PATH}/error/%d{yyyy-MM-dd,aux}/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<!--日志最大的历史7天-->
|
||||
<maxHistory>7</maxHistory>
|
||||
|
||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||
命名日志文件,例如log-error-2013-12-21.0.log -->
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>10MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
</rollingPolicy>
|
||||
|
||||
<!-- 追加方式记录日志 -->
|
||||
<append>true</append>
|
||||
|
||||
<!-- 日志文件的格式 -->
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>${FILE_LOG_PATTERN}</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
|
||||
<!-- 此日志文件只记录error级别的 -->
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>error</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
|
||||
<!-- 日志记录器,日期滚动记录,level为 INFO 日志 -->
|
||||
<appender name="FILE_INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
|
||||
<!-- 正在记录的日志文件的路径及文件名 -->
|
||||
<file>${LOG_PATH}/log_info.log</file>
|
||||
|
||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
|
||||
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
|
||||
<fileNamePattern>${LOG_PATH}/info/%d{yyyy-MM-dd,aux}/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<!--日志最大的历史7天-->
|
||||
<maxHistory>7</maxHistory>
|
||||
|
||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||
命名日志文件,例如log-error-2013-12-21.0.log -->
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>10MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
</rollingPolicy>
|
||||
|
||||
<!-- 追加方式记录日志 -->
|
||||
<append>true</append>
|
||||
|
||||
<!-- 日志文件的格式 -->
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>${FILE_LOG_PATTERN}</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
|
||||
<!-- 此日志文件只记录info级别的 -->
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>info</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
|
||||
<!-- 日志记录器,日期滚动记录,level为 WARN 日志 -->
|
||||
<appender name="FILE_WARN" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
|
||||
<!-- 正在记录的日志文件的路径及文件名 -->
|
||||
<file>${LOG_PATH}/log_warn.log</file>
|
||||
|
||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
|
||||
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
|
||||
<fileNamePattern>${LOG_PATH}/warn/%d{yyyy-MM-dd,aux}/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<!--日志最大的历史7天-->
|
||||
<maxHistory>7</maxHistory>
|
||||
|
||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||
命名日志文件,例如log-error-2013-12-21.0.log -->
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>10MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
</rollingPolicy>
|
||||
|
||||
<!-- 追加方式记录日志 -->
|
||||
<append>true</append>
|
||||
|
||||
<!-- 日志文件的格式 -->
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>${FILE_LOG_PATTERN}</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
|
||||
<!-- 此日志文件只记录warn级别的 -->
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>warn</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 日志记录器,日期滚动记录,level为 DEBUG 日志 -->
|
||||
<appender name="FILE_DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
|
||||
<!-- 正在记录的日志文件的路径及文件名 -->
|
||||
<file>${LOG_PATH}/log_debug.log</file>
|
||||
|
||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
|
||||
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
|
||||
<fileNamePattern>${LOG_PATH}/debug/%d{yyyy-MM-dd,aux}/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<!--日志最大的历史7天-->
|
||||
<maxHistory>7</maxHistory>
|
||||
|
||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||
命名日志文件,例如log-error-2013-12-21.0.log -->
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>10MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
</rollingPolicy>
|
||||
|
||||
<!-- 追加方式记录日志 -->
|
||||
<append>true</append>
|
||||
|
||||
<!-- 日志文件的格式 -->
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>${FILE_LOG_PATTERN}</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
|
||||
<!-- 此日志文件只记录debug级别的 -->
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>debug</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
|
||||
<!-- 日志记录器,日期滚动记录,所有日志 -->
|
||||
<appender name="FILE_ALL" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
|
||||
<!-- 正在记录的日志文件的路径及文件名 -->
|
||||
<file>${LOG_PATH}/log_total.log</file>
|
||||
|
||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
|
||||
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
|
||||
<fileNamePattern>${LOG_PATH}/total/%d{yyyy-MM-dd,aux}/log-total-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<!--日志最大的历史7天-->
|
||||
<maxHistory>7</maxHistory>
|
||||
|
||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||
命名日志文件,例如log-error-2013-12-21.0.log -->
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>10MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
</rollingPolicy>
|
||||
|
||||
<!-- 追加方式记录日志 -->
|
||||
<append>true</append>
|
||||
|
||||
<!-- 日志文件的格式 -->
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>${FILE_LOG_PATTERN}</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
|
||||
<!-- 日志记录器,日期滚动记录,level 根据配置动态输出日志 -->
|
||||
<appender name="FILE_RELEASE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
|
||||
<!-- 正在记录的日志文件的路径及文件名 -->
|
||||
<file>${LOG_PATH}/log_release.log</file>
|
||||
|
||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
|
||||
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
|
||||
<fileNamePattern>${LOG_PATH}/release/%d{yyyy-MM-dd,aux}/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<!--日志最大的历史7天-->
|
||||
<maxHistory>7</maxHistory>
|
||||
|
||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||
命名日志文件,例如log-error-2013-12-21.0.log -->
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>10MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
</rollingPolicy>
|
||||
|
||||
<!-- 追加方式记录日志 -->
|
||||
<append>true</append>
|
||||
|
||||
<!-- 日志文件的格式 -->
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>${FILE_LOG_PATTERN}</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
|
||||
<!-- 此日志文件只记录warn级别的 -->
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>${LOG_LEVEL}</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
<!-- 异步输出 DEBUG -->
|
||||
<appender name="ASYNC_FILE_DEBUG" class="ch.qos.logback.classic.AsyncAppender">
|
||||
<discardingThreshold>0</discardingThreshold>
|
||||
<queueSize>256</queueSize>
|
||||
<appender-ref ref="FILE_DEBUG"/>
|
||||
</appender>
|
||||
<!-- 异步输出 INFO -->
|
||||
<appender name="ASYNC_FILE_INFO" class="ch.qos.logback.classic.AsyncAppender">
|
||||
<discardingThreshold>0</discardingThreshold>
|
||||
<queueSize>256</queueSize>
|
||||
<appender-ref ref="FILE_INFO"/>
|
||||
</appender>
|
||||
<!-- 异步输出 WARN -->
|
||||
<appender name="ASYNC_FILE_WARN" class="ch.qos.logback.classic.AsyncAppender">
|
||||
<discardingThreshold>0</discardingThreshold>
|
||||
<queueSize>256</queueSize>
|
||||
<appender-ref ref="FILE_WARN"/>
|
||||
</appender>
|
||||
<!-- 异步输出 ERROR -->
|
||||
<appender name="ASYNC_FILE_ERROR" class="ch.qos.logback.classic.AsyncAppender">
|
||||
<discardingThreshold>0</discardingThreshold>
|
||||
<queueSize>256</queueSize>
|
||||
<appender-ref ref="FILE_ERROR"/>
|
||||
</appender>
|
||||
<!-- 异步输出 ALL -->
|
||||
<appender name="ASYNC_FILE_ALL" class="ch.qos.logback.classic.AsyncAppender">
|
||||
<discardingThreshold>0</discardingThreshold>
|
||||
<queueSize>256</queueSize>
|
||||
<appender-ref ref="FILE_ALL"/>
|
||||
</appender>
|
||||
|
||||
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
|
||||
<!-- 异步输出 控制台 -->
|
||||
<appender name="ASYNC_STDOUT" class="ch.qos.logback.classic.AsyncAppender">
|
||||
<discardingThreshold>0</discardingThreshold>
|
||||
<queueSize>256</queueSize>
|
||||
<appender-ref ref="STDOUT"/>
|
||||
</appender>
|
||||
|
||||
|
||||
<!--<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
|
||||
<!– 必填:目标:LogStash的 IP:Port –>
|
||||
<destination>192.168.0.50:50000</destination>
|
||||
<!– 可选:保持程序存活时间 –>
|
||||
<keepAliveDuration>5 minutes</keepAliveDuration>
|
||||
<!– 可选:重连延迟时长 –>
|
||||
<reconnectionDelay>10 second</reconnectionDelay>
|
||||
<!– 可选:等待策略 –>
|
||||
<waitStrategyType>sleeping</waitStrategyType>
|
||||
<!– ============ encoder必须配置,有多种可选 ============= –>
|
||||
<!– 编码器二:LoggingEventCompositeJsonEncoder –>
|
||||
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
|
||||
<providers>
|
||||
<!– 时间戳:时区 –>
|
||||
<timestamp>
|
||||
<timeZone>UTC</timeZone>
|
||||
</timestamp>
|
||||
<!– 模式 –>
|
||||
<pattern>
|
||||
<pattern>
|
||||
{
|
||||
"severity": "%level",
|
||||
"service": "${SERVICE_NAME:-}",
|
||||
"trace": "%X{X-B3-TraceId:-}",
|
||||
"span": "%X{X-B3-SpanId:-}",
|
||||
"exportable": "%X{X-Span-Export:-}",
|
||||
"pid": "${PID:-}",
|
||||
"thread": "%thread",
|
||||
"class": "%logger{40}",
|
||||
"msg": "%message"
|
||||
<!–"idx_pre": "elk-original-third-access",–>
|
||||
<!–"json": "#asJson{%message}" 这个asJson可以把对应的字符串作为json对象取出来,这样es可以对json里面的字段索引了–>
|
||||
}
|
||||
</pattern>
|
||||
</pattern>
|
||||
</providers>
|
||||
</encoder>
|
||||
</appender>-->
|
||||
|
||||
|
||||
<root level="${LOG_LEVEL}">
|
||||
<appender-ref ref="ASYNC_STDOUT"/>
|
||||
<appender-ref ref="ASYNC_FILE_ERROR"/>
|
||||
<appender-ref ref="ASYNC_FILE_INFO"/>
|
||||
<appender-ref ref="ASYNC_FILE_WARN"/>
|
||||
<appender-ref ref="ASYNC_FILE_DEBUG"/>
|
||||
<appender-ref ref="ASYNC_FILE_ALL"/>
|
||||
<!--<appender-ref ref="LOGSTASH"/>-->
|
||||
</root>
|
||||
|
||||
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user