commit
						f180b8d7d3
					
				|  | @ -20,9 +20,10 @@ | |||
|         <spring.cloud.version>2021.0.5</spring.cloud.version> | ||||
|         <spring.cloud.alibaba.version>2021.0.4.0</spring.cloud.alibaba.version> | ||||
|         <!-- Web 相关 --> | ||||
|         <knife4j.version>4.0.0</knife4j.version> | ||||
|         <swagger-annotations.version>1.6.8</swagger-annotations.version> | ||||
|         <servlet.versoin>2.5</servlet.versoin> | ||||
|         <swagger.version>2.2.8</swagger.version> | ||||
|         <springdoc.version>1.6.14</springdoc.version> | ||||
|         <knife4j.version>4.0.0</knife4j.version> | ||||
|         <!-- DB 相关 --> | ||||
|         <druid.version>1.2.15</druid.version> | ||||
|         <mybatis-plus.version>3.5.3.1</mybatis-plus.version> | ||||
|  | @ -198,28 +199,44 @@ | |||
|             </dependency> | ||||
| 
 | ||||
|             <dependency> | ||||
|                 <groupId>com.github.xiaoymin</groupId> | ||||
|                 <artifactId>knife4j-openapi2-spring-boot-starter</artifactId> | ||||
|                 <version>${knife4j.version}</version> | ||||
|                 <exclusions> | ||||
|                     <exclusion> | ||||
|                         <artifactId>mapstruct</artifactId> | ||||
|                         <groupId>org.mapstruct</groupId> <!-- 避免冲突 --> | ||||
|                     </exclusion> | ||||
|                     <exclusion> | ||||
|                         <artifactId>guava</artifactId> | ||||
|                         <groupId>com.google.guava</groupId> | ||||
|                     </exclusion> | ||||
|                     <exclusion> | ||||
|                         <artifactId>swagger-annotations</artifactId> | ||||
|                         <groupId>io.swagger</groupId> | ||||
|                     </exclusion> | ||||
|                 </exclusions> | ||||
|                 <groupId>io.swagger.core.v3</groupId> <!-- 接口文档:使用最新版本的 Swagger 模型 --> | ||||
|                 <artifactId>swagger-annotations</artifactId> | ||||
|                 <version>${swagger.version}</version> | ||||
|             </dependency> | ||||
|             <dependency> | ||||
|                 <groupId>io.swagger</groupId> | ||||
|                 <artifactId>swagger-annotations</artifactId> | ||||
|                 <version>${swagger-annotations.version}</version> | ||||
|                 <groupId>io.swagger.core.v3</groupId> <!-- 接口文档:使用最新版本的 Swagger 模型 --> | ||||
|                 <artifactId>swagger-models</artifactId> | ||||
|                 <version>${swagger.version}</version> | ||||
|             </dependency> | ||||
|             <dependency> | ||||
|                 <groupId>org.springdoc</groupId> <!-- 接口文档 UI:解决 knife4j 引入的 Spring Doc 版本太老 --> | ||||
|                 <artifactId>springdoc-openapi-common</artifactId> | ||||
|                 <version>${springdoc.version}</version> | ||||
|             </dependency> | ||||
|             <dependency> | ||||
|                 <groupId>org.springdoc</groupId> <!-- 接口文档 UI:解决 knife4j 引入的 Spring Doc 版本太老 --> | ||||
|                 <artifactId>springdoc-openapi-webmvc-core</artifactId> | ||||
|                 <version>${springdoc.version}</version> | ||||
|             </dependency> | ||||
|             <dependency> | ||||
|                 <groupId>org.springdoc</groupId> <!-- 接口文档 UI:解决 knife4j 引入的 Spring Doc 版本太老 --> | ||||
|                 <artifactId>springdoc-openapi-webflux-core</artifactId> | ||||
|                 <version>${springdoc.version}</version> | ||||
|             </dependency> | ||||
|             <dependency> | ||||
|                 <groupId>org.springdoc</groupId> <!-- 接口文档 UI:默认 --> | ||||
|                 <artifactId>springdoc-openapi-ui</artifactId> | ||||
|                 <version>${springdoc.version}</version> | ||||
|             </dependency> | ||||
|             <dependency> | ||||
|                 <groupId>com.github.xiaoymin</groupId> <!-- 接口文档 UI:knife4j --> | ||||
|                 <artifactId>knife4j-openapi3-spring-boot-starter</artifactId> | ||||
|                 <version>${knife4j.version}</version> | ||||
|             </dependency> | ||||
|             <dependency> | ||||
|                 <groupId>com.github.xiaoymin</groupId> <!-- 接口文档 UI:knife4j【网关专属】 --> | ||||
|                 <artifactId>knife4j-gateway-spring-boot-starter</artifactId> | ||||
|                 <version>${knife4j.version}</version> | ||||
|             </dependency> | ||||
| 
 | ||||
|             <!-- DB 相关 --> | ||||
|  | @ -228,6 +245,11 @@ | |||
|                 <artifactId>yudao-spring-boot-starter-mybatis</artifactId> | ||||
|                 <version>${revision}</version> | ||||
|             </dependency> | ||||
|             <dependency> <!-- TODO 芋艿:说不清楚 --> | ||||
|                 <groupId>org.springdoc</groupId> | ||||
|                 <artifactId>springdoc-openapi-webflux-ui</artifactId> | ||||
|                 <version>${springdoc.version}</version> | ||||
|             </dependency> | ||||
| 
 | ||||
|             <dependency> | ||||
|                 <groupId>com.alibaba</groupId> | ||||
|  |  | |||
|  | @ -59,9 +59,9 @@ | |||
|         </dependency> | ||||
| 
 | ||||
|         <dependency> | ||||
|             <groupId>io.swagger</groupId> | ||||
|             <groupId>io.swagger.core.v3</groupId> <!-- 接口文档:使用最新版本的 Swagger 模型 --> | ||||
|             <artifactId>swagger-annotations</artifactId> | ||||
|             <scope>provided</scope> <!-- 设置为 provided,主要是 PageParam 使用到 --> | ||||
|             <scope>provided</scope> | ||||
|         </dependency> | ||||
| 
 | ||||
|         <!-- 监控相关 --> | ||||
|  |  | |||
|  | @ -1,7 +1,6 @@ | |||
| package cn.iocoder.yudao.framework.common.pojo; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import javax.validation.constraints.Min; | ||||
|  | @ -9,19 +8,19 @@ import javax.validation.constraints.Max; | |||
| import javax.validation.constraints.NotNull; | ||||
| import java.io.Serializable; | ||||
| 
 | ||||
| @ApiModel("分页参数") | ||||
| @Schema(description = "分页参数") | ||||
| @Data | ||||
| public class PageParam implements Serializable { | ||||
| 
 | ||||
|     private static final Integer PAGE_NO = 1; | ||||
|     private static final Integer PAGE_SIZE = 10; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "页码,从 1 开始", required = true,example = "1") | ||||
|     @Schema(description = "页码,从 1 开始", required = true, example = "1") | ||||
|     @NotNull(message = "页码不能为空") | ||||
|     @Min(value = 1, message = "页码最小值为 1") | ||||
|     private Integer pageNo = PAGE_NO; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "每页条数,最大值为 100", required = true, example = "10") | ||||
|     @Schema(description = "每页条数,最大值为 100", required = true, example = "10") | ||||
|     @NotNull(message = "每页条数不能为空") | ||||
|     @Min(value = 1, message = "每页条数最小值为 1") | ||||
|     @Max(value = 100, message = "每页条数最大值为 100") | ||||
|  |  | |||
|  | @ -1,21 +1,20 @@ | |||
| package cn.iocoder.yudao.framework.common.pojo; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import java.io.Serializable; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @ApiModel("分页结果") | ||||
| @Schema(description = "分页结果") | ||||
| @Data | ||||
| public final class PageResult<T> implements Serializable { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "数据", required = true) | ||||
|     @Schema(description = "数据", required = true) | ||||
|     private List<T> list; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "总量", required = true) | ||||
|     @Schema(description = "总量", required = true) | ||||
|     private Long total; | ||||
| 
 | ||||
|     public PageResult() { | ||||
|  |  | |||
|  | @ -1,8 +1,8 @@ | |||
| package cn.iocoder.yudao.framework.operatelog.core.annotations; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
| 
 | ||||
| import java.lang.annotation.ElementType; | ||||
| import java.lang.annotation.Retention; | ||||
|  |  | |||
|  | @ -15,8 +15,8 @@ import cn.iocoder.yudao.framework.operatelog.core.service.OperateLog; | |||
| import cn.iocoder.yudao.framework.operatelog.core.service.OperateLogFrameworkService; | ||||
| import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; | ||||
| import com.google.common.collect.Maps; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.aspectj.lang.ProceedingJoinPoint; | ||||
| import org.aspectj.lang.annotation.Around; | ||||
|  | @ -71,15 +71,15 @@ public class OperateLogAspect { | |||
|     @Resource | ||||
|     private OperateLogFrameworkService operateLogFrameworkService; | ||||
| 
 | ||||
|     @Around("@annotation(apiOperation)") | ||||
|     public Object around(ProceedingJoinPoint joinPoint, ApiOperation apiOperation) throws Throwable { | ||||
|     @Around("@annotation(operation)") | ||||
|     public Object around(ProceedingJoinPoint joinPoint, Operation operation) throws Throwable { | ||||
|         // 可能也添加了 @ApiOperation 注解
 | ||||
|         cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog = getMethodAnnotation(joinPoint, | ||||
|                 cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog.class); | ||||
|         return around0(joinPoint, operateLog, apiOperation); | ||||
|         return around0(joinPoint, operateLog, operation); | ||||
|     } | ||||
| 
 | ||||
|     @Around("!@annotation(io.swagger.annotations.ApiOperation) && @annotation(operateLog)") | ||||
|     @Around("!@annotation(io.swagger.v3.oas.annotations.Operation) && @annotation(operateLog)") | ||||
|     // 兼容处理,只添加 @OperateLog 注解的情况
 | ||||
|     public Object around(ProceedingJoinPoint joinPoint, | ||||
|                          cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog) throws Throwable { | ||||
|  | @ -88,7 +88,7 @@ public class OperateLogAspect { | |||
| 
 | ||||
|     private Object around0(ProceedingJoinPoint joinPoint, | ||||
|                            cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, | ||||
|                            ApiOperation apiOperation) throws Throwable { | ||||
|                            Operation operation) throws Throwable { | ||||
|         // 目前,只有管理员,才记录操作日志!所以非管理员,直接调用,不进行记录
 | ||||
|         Integer userType = WebFrameworkUtils.getLoginUserType(); | ||||
|         if (!Objects.equals(userType, UserTypeEnum.ADMIN.getValue())) { | ||||
|  | @ -101,10 +101,10 @@ public class OperateLogAspect { | |||
|             // 执行原有方法
 | ||||
|             Object result = joinPoint.proceed(); | ||||
|             // 记录正常执行时的操作日志
 | ||||
|             this.log(joinPoint, operateLog, apiOperation, startTime, result, null); | ||||
|             this.log(joinPoint, operateLog, operation, startTime, result, null); | ||||
|             return result; | ||||
|         } catch (Throwable exception) { | ||||
|             this.log(joinPoint, operateLog, apiOperation, startTime, null, exception); | ||||
|             this.log(joinPoint, operateLog, operation, startTime, null, exception); | ||||
|             throw exception; | ||||
|         } finally { | ||||
|             clearThreadLocal(); | ||||
|  | @ -129,7 +129,7 @@ public class OperateLogAspect { | |||
| 
 | ||||
|     private void log(ProceedingJoinPoint joinPoint, | ||||
|                      cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, | ||||
|                      ApiOperation apiOperation, | ||||
|                      Operation operation, | ||||
|                      LocalDateTime startTime, Object result, Throwable exception) { | ||||
|         try { | ||||
|             // 判断不记录的情况
 | ||||
|  | @ -137,16 +137,16 @@ public class OperateLogAspect { | |||
|                 return; | ||||
|             } | ||||
|             // 真正记录操作日志
 | ||||
|             this.log0(joinPoint, operateLog, apiOperation, startTime, result, exception); | ||||
|             this.log0(joinPoint, operateLog, operation, startTime, result, exception); | ||||
|         } catch (Throwable ex) { | ||||
|             log.error("[log][记录操作日志时,发生异常,其中参数是 joinPoint({}) operateLog({}) apiOperation({}) result({}) exception({}) ]", | ||||
|                     joinPoint, operateLog, apiOperation, result, exception, ex); | ||||
|                     joinPoint, operateLog, operation, result, exception, ex); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     private void log0(ProceedingJoinPoint joinPoint, | ||||
|                       cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, | ||||
|                       ApiOperation apiOperation, | ||||
|                       Operation operation, | ||||
|                       LocalDateTime startTime, Object result, Throwable exception) { | ||||
|         OperateLog operateLogObj = new OperateLog(); | ||||
|         // 补全通用字段
 | ||||
|  | @ -155,7 +155,7 @@ public class OperateLogAspect { | |||
|         // 补充用户信息
 | ||||
|         fillUserFields(operateLogObj); | ||||
|         // 补全模块信息
 | ||||
|         fillModuleFields(operateLogObj, joinPoint, operateLog, apiOperation); | ||||
|         fillModuleFields(operateLogObj, joinPoint, operateLog, operation); | ||||
|         // 补全请求信息
 | ||||
|         fillRequestFields(operateLogObj); | ||||
|         // 补全方法信息
 | ||||
|  | @ -173,21 +173,21 @@ public class OperateLogAspect { | |||
|     private static void fillModuleFields(OperateLog operateLogObj, | ||||
|                                          ProceedingJoinPoint joinPoint, | ||||
|                                          cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, | ||||
|                                          ApiOperation apiOperation) { | ||||
|                                          Operation operation) { | ||||
|         // module 属性
 | ||||
|         if (operateLog != null) { | ||||
|             operateLogObj.setModule(operateLog.module()); | ||||
|         } | ||||
|         if (StrUtil.isEmpty(operateLogObj.getModule())) { | ||||
|             Api api = getClassAnnotation(joinPoint, Api.class); | ||||
|             if (api != null) { | ||||
|                 // 优先读取 @API 的 name 属性
 | ||||
|                 if (StrUtil.isNotEmpty(api.value())) { | ||||
|                     operateLogObj.setModule(api.value()); | ||||
|             Tag tag = getClassAnnotation(joinPoint, Tag.class); | ||||
|             if (tag != null) { | ||||
|                 // 优先读取 @Tag 的 name 属性
 | ||||
|                 if (StrUtil.isNotEmpty(tag.name())) { | ||||
|                     operateLogObj.setModule(tag.name()); | ||||
|                 } | ||||
|                 // 没有的话,读取 @API 的 tags 属性
 | ||||
|                 if (StrUtil.isEmpty(operateLogObj.getModule()) && ArrayUtil.isNotEmpty(api.tags())) { | ||||
|                     operateLogObj.setModule(api.tags()[0]); | ||||
|                 // 没有的话,读取 @API 的 description 属性
 | ||||
|                 if (StrUtil.isEmpty(operateLogObj.getModule()) && ArrayUtil.isNotEmpty(tag.description())) { | ||||
|                     operateLogObj.setModule(tag.description()); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | @ -195,8 +195,8 @@ public class OperateLogAspect { | |||
|         if (operateLog != null) { | ||||
|             operateLogObj.setName(operateLog.name()); | ||||
|         } | ||||
|         if (StrUtil.isEmpty(operateLogObj.getName()) && apiOperation != null) { | ||||
|             operateLogObj.setName(apiOperation.value()); | ||||
|         if (StrUtil.isEmpty(operateLogObj.getName()) && operation != null) { | ||||
|             operateLogObj.setName(operation.description()); | ||||
|         } | ||||
|         // type 属性
 | ||||
|         if (operateLog != null && ArrayUtil.isNotEmpty(operateLog.type())) { | ||||
|  | @ -268,9 +268,9 @@ public class OperateLogAspect { | |||
|             return null; | ||||
|         } | ||||
|         return Arrays.stream(requestMethods).filter(requestMethod -> | ||||
|                 requestMethod == RequestMethod.POST | ||||
|                         || requestMethod == RequestMethod.PUT | ||||
|                         || requestMethod == RequestMethod.DELETE) | ||||
|                         requestMethod == RequestMethod.POST | ||||
|                                 || requestMethod == RequestMethod.PUT | ||||
|                                 || requestMethod == RequestMethod.DELETE) | ||||
|                 .findFirst().orElse(null); | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
|  | @ -21,25 +21,17 @@ | |||
|             <artifactId>yudao-common</artifactId> | ||||
|         </dependency> | ||||
| 
 | ||||
|         <!-- Web 相关 --> | ||||
|         <dependency> | ||||
|             <groupId>org.springframework.boot</groupId> | ||||
|             <artifactId>spring-boot-starter-web</artifactId> | ||||
|         </dependency> | ||||
|         <!-- spring boot 配置所需依赖 --> | ||||
|         <!-- Spring Boot 配置所需依赖 --> | ||||
|         <dependency> | ||||
|             <groupId>org.springframework.boot</groupId> | ||||
|             <artifactId>spring-boot-configuration-processor</artifactId> | ||||
|             <optional>true</optional> | ||||
|         </dependency> | ||||
| 
 | ||||
|         <!-- Web 相关 --> | ||||
|         <dependency> | ||||
|             <groupId>com.github.xiaoymin</groupId> | ||||
|             <artifactId>knife4j-openapi2-spring-boot-starter</artifactId> | ||||
|         </dependency> | ||||
|         <dependency> | ||||
|             <groupId>io.swagger</groupId> | ||||
|             <artifactId>swagger-annotations</artifactId> | ||||
|             <groupId>org.springframework.boot</groupId> | ||||
|             <artifactId>spring-boot-starter-web</artifactId> | ||||
|         </dependency> | ||||
| 
 | ||||
|         <dependency> | ||||
|  | @ -53,6 +45,15 @@ | |||
|             <scope>provided</scope> <!-- 设置为 provided,主要是 GlobalExceptionHandler 使用 --> | ||||
|         </dependency> | ||||
| 
 | ||||
|         <dependency> | ||||
|             <groupId>com.github.xiaoymin</groupId> <!-- 接口文档 --> | ||||
|             <artifactId>knife4j-openapi3-spring-boot-starter</artifactId> | ||||
|         </dependency> | ||||
|         <dependency> | ||||
|             <groupId>org.springdoc</groupId>  <!-- 接口文档 --> | ||||
|             <artifactId>springdoc-openapi-ui</artifactId> | ||||
|         </dependency> | ||||
| 
 | ||||
|         <!-- RPC 远程调用相关 --> | ||||
|         <dependency> | ||||
|             <groupId>cn.iocoder.cloud</groupId> | ||||
|  |  | |||
|  | @ -35,9 +35,26 @@ public class SwaggerProperties { | |||
|     @NotEmpty(message = "版本不能为空") | ||||
|     private String version; | ||||
|     /** | ||||
|      * 扫描的包 | ||||
|      * url | ||||
|      */ | ||||
|     @NotEmpty(message = "扫描的 package 不能为空") | ||||
|     private String basePackage; | ||||
|     private String url; | ||||
|     /** | ||||
|      * email | ||||
|      */ | ||||
|     @NotEmpty(message = "扫描的 email 不能为空") | ||||
|     private String email; | ||||
| 
 | ||||
|     /** | ||||
|      * license | ||||
|      */ | ||||
|     @NotEmpty(message = "扫描的 license 不能为空") | ||||
|     private String license; | ||||
| 
 | ||||
|     /** | ||||
|      * license-url | ||||
|      */ | ||||
|     @NotEmpty(message = "扫描的 license-url 不能为空") | ||||
|     private String licenseUrl; | ||||
| 
 | ||||
| } | ||||
|  |  | |||
|  | @ -1,126 +1,155 @@ | |||
| package cn.iocoder.yudao.framework.swagger.config; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.swagger.core.SpringFoxHandlerProviderBeanPostProcessor; | ||||
| import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j; | ||||
| import io.swagger.v3.oas.models.Components; | ||||
| import io.swagger.v3.oas.models.OpenAPI; | ||||
| import io.swagger.v3.oas.models.info.Contact; | ||||
| import io.swagger.v3.oas.models.info.Info; | ||||
| import io.swagger.v3.oas.models.info.License; | ||||
| import io.swagger.v3.oas.models.media.IntegerSchema; | ||||
| import io.swagger.v3.oas.models.media.StringSchema; | ||||
| import io.swagger.v3.oas.models.parameters.Parameter; | ||||
| import io.swagger.v3.oas.models.security.SecurityRequirement; | ||||
| import io.swagger.v3.oas.models.security.SecurityScheme; | ||||
| import org.springdoc.core.*; | ||||
| import org.springdoc.core.customizers.OpenApiBuilderCustomizer; | ||||
| import org.springdoc.core.customizers.ServerBaseUrlCustomizer; | ||||
| import org.springdoc.core.providers.JavadocProvider; | ||||
| import org.springframework.boot.autoconfigure.AutoConfiguration; | ||||
| import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; | ||||
| import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||||
| import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||||
| import org.springframework.context.annotation.Bean; | ||||
| import org.springframework.http.HttpHeaders; | ||||
| import springfox.documentation.builders.ApiInfoBuilder; | ||||
| import springfox.documentation.builders.ParameterBuilder; | ||||
| import springfox.documentation.builders.PathSelectors; | ||||
| import springfox.documentation.schema.ModelRef; | ||||
| import springfox.documentation.service.*; | ||||
| import springfox.documentation.spi.DocumentationType; | ||||
| import springfox.documentation.spi.service.contexts.SecurityContext; | ||||
| import springfox.documentation.spring.web.plugins.Docket; | ||||
| import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| import java.util.Collections; | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.Optional; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.HEADER_TENANT_ID; | ||||
| import static springfox.documentation.builders.RequestHandlerSelectors.basePackage; | ||||
| 
 | ||||
| /** | ||||
|  * Swagger2 自动配置类 | ||||
|  * Swagger 自动配置类,基于 OpenAPI + Springdoc 实现。 | ||||
|  * | ||||
|  * 友情提示: | ||||
|  * 1. Springdoc 文档地址:<a href="https://github.com/springdoc/springdoc-openapi">仓库</a> | ||||
|  * 2. Swagger 规范,于 2015 更名为 OpenAPI 规范,本质是一个东西 | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @AutoConfiguration | ||||
| @EnableSwagger2WebMvc | ||||
| @EnableKnife4j | ||||
| @ConditionalOnClass({Docket.class, ApiInfoBuilder.class}) | ||||
| // 允许使用 swagger.enable=false 禁用 Swagger
 | ||||
| @ConditionalOnProperty(prefix = "yudao.swagger", value = "enable", matchIfMissing = true) | ||||
| @ConditionalOnClass({OpenAPI.class}) | ||||
| @EnableConfigurationProperties(SwaggerProperties.class) | ||||
| @ConditionalOnProperty(prefix = "springdoc.api-docs", name = "enabled", havingValue = "true", matchIfMissing = true) // 设置为 false 时,禁用
 | ||||
| public class YudaoSwaggerAutoConfiguration { | ||||
| 
 | ||||
|     @Bean | ||||
|     public SpringFoxHandlerProviderBeanPostProcessor springFoxHandlerProviderBeanPostProcessor() { | ||||
|         return new SpringFoxHandlerProviderBeanPostProcessor(); | ||||
|     } | ||||
|     // ========== 全局 OpenAPI 配置 ==========
 | ||||
| 
 | ||||
|     @Bean | ||||
|     public Docket createRestApi(SwaggerProperties properties) { | ||||
|         // 创建 Docket 对象
 | ||||
|         return new Docket(DocumentationType.SWAGGER_2) | ||||
|                 // ① 用来创建该 API 的基本信息,展示在文档的页面中(自定义展示的信息)
 | ||||
|                 .apiInfo(apiInfo(properties)) | ||||
|                 // ② 设置扫描指定 package 包下的
 | ||||
|                 .select() | ||||
|                 .apis(basePackage(properties.getBasePackage())) | ||||
| //                .apis(basePackage("cn.iocoder.yudao.module.system")) // 可用于 swagger 无法展示时使用
 | ||||
|                 .paths(PathSelectors.any()) | ||||
|                 .build() | ||||
|                 // ③ 安全上下文(认证)
 | ||||
|                 .securitySchemes(securitySchemes()) | ||||
|                 .securityContexts(securityContexts()) | ||||
|                 // ④ 全局参数(多租户 header)
 | ||||
|                 .globalOperationParameters(globalRequestParameters()); | ||||
|     public OpenAPI createApi(SwaggerProperties properties) { | ||||
|         Map<String, SecurityScheme> securitySchemas = buildSecuritySchemes(); | ||||
|         OpenAPI openAPI = new OpenAPI() | ||||
|                 // 接口信息
 | ||||
|                 .info(buildInfo(properties)) | ||||
|                 // 接口安全配置
 | ||||
|                 .components(new Components().securitySchemes(securitySchemas)) | ||||
|                 .addSecurityItem(new SecurityRequirement().addList(HttpHeaders.AUTHORIZATION)); | ||||
|         securitySchemas.keySet().forEach(key -> openAPI.addSecurityItem(new SecurityRequirement().addList(key))); | ||||
|         return openAPI; | ||||
|     } | ||||
| 
 | ||||
|     // ========== apiInfo ==========
 | ||||
| 
 | ||||
|     /** | ||||
|      * API 摘要信息 | ||||
|      */ | ||||
|     private static ApiInfo apiInfo(SwaggerProperties properties) { | ||||
|         return new ApiInfoBuilder() | ||||
|     private Info buildInfo(SwaggerProperties properties) { | ||||
|         return new Info() | ||||
|                 .title(properties.getTitle()) | ||||
|                 .description(properties.getDescription()) | ||||
|                 .contact(new Contact(properties.getAuthor(), null, null)) | ||||
|                 .version(properties.getVersion()) | ||||
|                 .build(); | ||||
|                 .contact(new Contact().name(properties.getAuthor()).url(properties.getUrl()).email(properties.getEmail())) | ||||
|                 .license(new License().name(properties.getLicense()).url(properties.getLicenseUrl())); | ||||
|     } | ||||
| 
 | ||||
|     // ========== securitySchemes ==========
 | ||||
| 
 | ||||
|     /** | ||||
|      * 安全模式,这里配置通过请求头 Authorization 传递 token 参数 | ||||
|      */ | ||||
|     private static List<SecurityScheme> securitySchemes() { | ||||
|         return Collections.singletonList(new ApiKey(HttpHeaders.AUTHORIZATION, "Authorization", "header")); | ||||
|     private Map<String, SecurityScheme> buildSecuritySchemes() { | ||||
|         Map<String, SecurityScheme> securitySchemes = new HashMap<>(); | ||||
|         SecurityScheme securityScheme = new SecurityScheme() | ||||
|                 .type(SecurityScheme.Type.APIKEY) // 类型
 | ||||
|                 .name(HttpHeaders.AUTHORIZATION) // 请求头的 name
 | ||||
|                 .in(SecurityScheme.In.HEADER); // token 所在位置
 | ||||
|         securitySchemes.put(HttpHeaders.AUTHORIZATION, securityScheme); | ||||
|         return securitySchemes; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 安全上下文 | ||||
|      * | ||||
|      * @see #securitySchemes() | ||||
|      * @see #authorizationScopes() | ||||
|      * 自定义 OpenAPI 处理器 | ||||
|      */ | ||||
|     private static List<SecurityContext> securityContexts() { | ||||
|         return Collections.singletonList(SecurityContext.builder() | ||||
|                 .securityReferences(securityReferences()) | ||||
|                 // 通过 PathSelectors.regex("^(?!auth).*$"),排除包含 "auth" 的接口不需要使用securitySchemes
 | ||||
|                 .forPaths(PathSelectors.regex("^(?!auth).*$")) | ||||
|                 .build()); | ||||
|     @Bean | ||||
|     public OpenAPIService openApiBuilder(Optional<OpenAPI> openAPI, | ||||
|                                          SecurityService securityParser, | ||||
|                                          SpringDocConfigProperties springDocConfigProperties, | ||||
|                                          PropertyResolverUtils propertyResolverUtils, | ||||
|                                          Optional<List<OpenApiBuilderCustomizer>> openApiBuilderCustomizers, | ||||
|                                          Optional<List<ServerBaseUrlCustomizer>> serverBaseUrlCustomizers, | ||||
|                                          Optional<JavadocProvider> javadocProvider) { | ||||
| 
 | ||||
|         return new OpenAPIService(openAPI, securityParser, springDocConfigProperties, | ||||
|                 propertyResolverUtils, openApiBuilderCustomizers, serverBaseUrlCustomizers, javadocProvider); | ||||
|     } | ||||
| 
 | ||||
|     private static List<SecurityReference> securityReferences() { | ||||
|         return Collections.singletonList(new SecurityReference(HttpHeaders.AUTHORIZATION, authorizationScopes())); | ||||
|     // ========== 分组 OpenAPI 配置 ==========
 | ||||
| 
 | ||||
|     /** | ||||
|      * 所有模块的 API 分组 | ||||
|      */ | ||||
|     @Bean | ||||
|     public GroupedOpenApi allGroupedOpenApi() { | ||||
|         return buildGroupedOpenApi("all", ""); | ||||
|     } | ||||
| 
 | ||||
|     private static AuthorizationScope[] authorizationScopes() { | ||||
|         return new AuthorizationScope[]{new AuthorizationScope("global", "accessEverything")}; | ||||
|     public static GroupedOpenApi buildGroupedOpenApi(String group) { | ||||
|         return buildGroupedOpenApi(group, group); | ||||
|     } | ||||
| 
 | ||||
|     // ========== globalRequestParameters ==========
 | ||||
|     public static GroupedOpenApi buildGroupedOpenApi(String group, String path) { | ||||
|         return GroupedOpenApi.builder() | ||||
|                 .group(group) | ||||
|                 .pathsToMatch("/admin-api/" + path + "/**", "/app-api/" + path + "/**") | ||||
|                 .addOperationCustomizer((operation, handlerMethod) -> operation | ||||
|                         .addParametersItem(buildTenantHeaderParameter()) | ||||
|                         .addParametersItem(buildSecurityHeaderParameter())) | ||||
|                 .build(); | ||||
|     } | ||||
| 
 | ||||
|     private static List<Parameter> globalRequestParameters() { | ||||
|         List<Parameter> tenantParameter = new ArrayList<>(); | ||||
|         tenantParameter.add(new ParameterBuilder() | ||||
|                 .name(HEADER_TENANT_ID) | ||||
|                 .description("租户编号") | ||||
|                 .modelRef(new ModelRef("long")) | ||||
|                 .defaultValue("1") | ||||
|                 .parameterType("header") | ||||
|                 .required(true) | ||||
|                 .build()); | ||||
|         return tenantParameter; | ||||
|     /** | ||||
|      * 构建 Tenant 租户编号请求头参数 | ||||
|      * | ||||
|      * @return 多租户参数 | ||||
|      */ | ||||
|     private static Parameter buildTenantHeaderParameter() { | ||||
|         return new Parameter() | ||||
|                 .name(HEADER_TENANT_ID) // header 名
 | ||||
|                 .description("租户编号") // 描述
 | ||||
|                 .in(String.valueOf(SecurityScheme.In.HEADER)) // 请求 header
 | ||||
|                 .schema(new IntegerSchema()._default(1L).name(HEADER_TENANT_ID).description("租户编号")); // 默认:使用租户编号为 1
 | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 构建 Authorization 认证请求头参数 | ||||
|      * | ||||
|      * 解决 Knife4j <a href="https://gitee.com/xiaoym/knife4j/issues/I69QBU">Authorize 未生效,请求header里未包含参数</a> | ||||
|      * | ||||
|      * @return 认证参数 | ||||
|      */ | ||||
|     private static Parameter buildSecurityHeaderParameter() { | ||||
|         return new Parameter() | ||||
|                 .name(HttpHeaders.AUTHORIZATION) // header 名
 | ||||
|                 .description("认证 Token") // 描述
 | ||||
|                 .in(String.valueOf(SecurityScheme.In.HEADER)) // 请求 header
 | ||||
|                 .schema(new StringSchema()._default("Bearer test1").name(HEADER_TENANT_ID).description("认证 Token")); // 默认:使用用户编号为 1
 | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,42 +1,42 @@ | |||
| package cn.iocoder.yudao.framework.swagger.core; | ||||
| 
 | ||||
| import cn.hutool.core.util.ReflectUtil; | ||||
| import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | ||||
| import org.springframework.beans.BeansException; | ||||
| import org.springframework.beans.factory.config.BeanPostProcessor; | ||||
| import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping; | ||||
| import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * 解决 SpringFox 与 SpringBoot 2.6.x 不兼容的问题 | ||||
|  * 该问题对应的 issue 为 https://github.com/springfox/springfox/issues/3462
 | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| public class SpringFoxHandlerProviderBeanPostProcessor implements BeanPostProcessor { | ||||
| 
 | ||||
|     @Override | ||||
|     public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { | ||||
|         if (bean instanceof WebMvcRequestHandlerProvider) { | ||||
|             customizeSpringfoxHandlerMappings(getHandlerMappings(bean)); | ||||
|         } | ||||
|         return bean; | ||||
|     } | ||||
| 
 | ||||
|     private <T extends RequestMappingInfoHandlerMapping> void customizeSpringfoxHandlerMappings(List<T> mappings) { | ||||
|         // 移除,只保留 patternParser
 | ||||
|         List<T> copy = CollectionUtils.filterList(mappings, mapping -> mapping.getPatternParser() == null); | ||||
|         // 添加到 mappings 中
 | ||||
|         mappings.clear(); | ||||
|         mappings.addAll(copy); | ||||
|     } | ||||
| 
 | ||||
|     @SuppressWarnings("unchecked") | ||||
|     private List<RequestMappingInfoHandlerMapping> getHandlerMappings(Object bean) { | ||||
|         return (List<RequestMappingInfoHandlerMapping>) | ||||
|                 ReflectUtil.getFieldValue(bean, "handlerMappings"); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| //package cn.iocoder.yudao.framework.swagger.core;
 | ||||
| //
 | ||||
| //import cn.hutool.core.util.ReflectUtil;
 | ||||
| //import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
 | ||||
| //import org.springframework.beans.BeansException;
 | ||||
| //import org.springframework.beans.factory.config.BeanPostProcessor;
 | ||||
| //import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping;
 | ||||
| //import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider;
 | ||||
| //
 | ||||
| //import java.util.List;
 | ||||
| //
 | ||||
| ///**
 | ||||
| // * 解决 SpringFox 与 SpringBoot 2.6.x 不兼容的问题
 | ||||
| // * 该问题对应的 issue 为 https://github.com/springfox/springfox/issues/3462
 | ||||
| // *
 | ||||
| // * @author 芋道源码
 | ||||
| // */
 | ||||
| //public class SpringFoxHandlerProviderBeanPostProcessor implements BeanPostProcessor {
 | ||||
| //
 | ||||
| //    @Override
 | ||||
| //    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
 | ||||
| //        if (bean instanceof WebMvcRequestHandlerProvider) {
 | ||||
| //            customizeSpringfoxHandlerMappings(getHandlerMappings(bean));
 | ||||
| //        }
 | ||||
| //        return bean;
 | ||||
| //    }
 | ||||
| //
 | ||||
| //    private <T extends RequestMappingInfoHandlerMapping> void customizeSpringfoxHandlerMappings(List<T> mappings) {
 | ||||
| //        // 移除,只保留 patternParser
 | ||||
| //        List<T> copy = CollectionUtils.filterList(mappings, mapping -> mapping.getPatternParser() == null);
 | ||||
| //        // 添加到 mappings 中
 | ||||
| //        mappings.clear();
 | ||||
| //        mappings.addAll(copy);
 | ||||
| //    }
 | ||||
| //
 | ||||
| //    @SuppressWarnings("unchecked")
 | ||||
| //    private List<RequestMappingInfoHandlerMapping> getHandlerMappings(Object bean) {
 | ||||
| //        return (List<RequestMappingInfoHandlerMapping>)
 | ||||
| //                ReflectUtil.getFieldValue(bean, "handlerMappings");
 | ||||
| //    }
 | ||||
| //
 | ||||
| //}
 | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| cn.iocoder.yudao.framework.apilog.config.YudaoApiLogRpcAutoConfiguration | ||||
| cn.iocoder.yudao.framework.apilog.config.YudaoApiLogAutoConfiguration | ||||
| cn.iocoder.yudao.framework.jackson.config.YudaoJacksonAutoConfiguration | ||||
| cn.iocoder.yudao.framework.swagger.config.YudaoSwaggerAutoConfiguration | ||||
| cn.iocoder.yudao.framework.web.config.YudaoWebAutoConfiguration | ||||
| cn.iocoder.yudao.framework.apilog.config.YudaoApiLogRpcAutoConfiguration | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||||
|         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||||
|         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||||
|          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||||
|          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||||
|     <parent> | ||||
|         <artifactId>yudao</artifactId> | ||||
|         <groupId>cn.iocoder.cloud</groupId> | ||||
|  | @ -26,11 +26,23 @@ | |||
|         <dependency> | ||||
|             <groupId>cn.iocoder.cloud</groupId> | ||||
|             <artifactId>yudao-spring-boot-starter-banner</artifactId> | ||||
|             <exclusions> | ||||
|                 <exclusion> | ||||
|                     <groupId>org.springdoc</groupId> | ||||
|                     <artifactId>springdoc-openapi-webmvc-core</artifactId> | ||||
|                 </exclusion> | ||||
|             </exclusions> | ||||
|         </dependency> | ||||
|         <dependency> | ||||
|             <groupId>cn.iocoder.cloud</groupId> | ||||
|             <artifactId>yudao-module-system-api</artifactId> | ||||
|             <version>${revision}</version> | ||||
|             <exclusions> | ||||
|                 <exclusion> | ||||
|                     <groupId>org.springdoc</groupId> | ||||
|                     <artifactId>springdoc-openapi-webmvc-core</artifactId> | ||||
|                 </exclusion> | ||||
|             </exclusions> | ||||
|         </dependency> | ||||
| 
 | ||||
|         <!-- Gateway 网关相关 --> | ||||
|  | @ -45,12 +57,8 @@ | |||
|         </dependency> | ||||
| 
 | ||||
|         <dependency> | ||||
|             <groupId>com.github.xiaoymin</groupId> | ||||
|             <artifactId>knife4j-openapi2-spring-boot-starter</artifactId> | ||||
|         </dependency> | ||||
|         <dependency> | ||||
|             <groupId>io.swagger</groupId> | ||||
|             <artifactId>swagger-annotations</artifactId> | ||||
|             <groupId>com.github.xiaoymin</groupId> <!-- 接口文档 --> | ||||
|             <artifactId>knife4j-gateway-spring-boot-starter</artifactId> | ||||
|         </dependency> | ||||
| 
 | ||||
|         <!-- RPC 远程调用相关 --> | ||||
|  | @ -76,7 +84,6 @@ | |||
|             <groupId>cn.iocoder.cloud</groupId> | ||||
|             <artifactId>yudao-spring-boot-starter-monitor</artifactId> | ||||
|         </dependency> | ||||
| 
 | ||||
|     </dependencies> | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,54 +0,0 @@ | |||
| package cn.iocoder.yudao.gateway.swagger; | ||||
| 
 | ||||
| 
 | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.http.HttpStatus; | ||||
| import org.springframework.http.ResponseEntity; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.RequestMapping; | ||||
| import org.springframework.web.bind.annotation.RestController; | ||||
| import reactor.core.publisher.Mono; | ||||
| import springfox.documentation.swagger.web.*; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.List; | ||||
| import java.util.Optional; | ||||
| 
 | ||||
| /** | ||||
|  * Swagger Controller | ||||
|  * | ||||
|  * @author zxliu | ||||
|  * @date 2022-10-25 11:24 | ||||
|  */ | ||||
| @RestController | ||||
| @RequestMapping("/swagger-resources") | ||||
| public class SwaggerHandler { | ||||
| 
 | ||||
|     @Resource | ||||
|     private SwaggerResourcesProvider swaggerResources; | ||||
| 
 | ||||
|     @SuppressWarnings("SpringJavaAutowiredFieldsWarningInspection") // 只有 @Autowired 可以实现可选注入
 | ||||
|     @Autowired(required = false) | ||||
|     private SecurityConfiguration securityConfiguration; | ||||
|     @SuppressWarnings("SpringJavaAutowiredFieldsWarningInspection") // 只有 @Autowired 可以实现可选注入
 | ||||
|     @Autowired(required = false) | ||||
|     private UiConfiguration uiConfiguration; | ||||
| 
 | ||||
|     @GetMapping("") | ||||
|     public Mono<ResponseEntity<List<SwaggerResource>>> swaggerResources() { | ||||
|         return Mono.just((new ResponseEntity<>(swaggerResources.get(), HttpStatus.OK))); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/configuration/security") | ||||
|     public Mono<ResponseEntity<SecurityConfiguration>> securityConfiguration() { | ||||
|         return Mono.just(new ResponseEntity<>(Optional.ofNullable(securityConfiguration) | ||||
|                 .orElse(SecurityConfigurationBuilder.builder().build()), HttpStatus.OK)); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/configuration/ui") | ||||
|     public Mono<ResponseEntity<UiConfiguration>> uiConfiguration() { | ||||
|         return Mono.just(new ResponseEntity<>(Optional.ofNullable(uiConfiguration) | ||||
|                 .orElse(UiConfigurationBuilder.builder().build()), HttpStatus.OK)); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  | @ -2,45 +2,47 @@ package cn.iocoder.yudao.gateway.swagger; | |||
| 
 | ||||
| import cn.hutool.core.collection.CollUtil; | ||||
| import cn.hutool.core.util.StrUtil; | ||||
| import lombok.RequiredArgsConstructor; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.springframework.cloud.gateway.config.GatewayProperties; | ||||
| import org.springframework.cloud.gateway.handler.predicate.PredicateDefinition; | ||||
| import org.springframework.cloud.gateway.route.RouteDefinition; | ||||
| import org.springframework.cloud.gateway.support.NameUtils; | ||||
| import org.springframework.context.annotation.Primary; | ||||
| import org.springframework.stereotype.Component; | ||||
| import springfox.documentation.swagger.web.SwaggerResource; | ||||
| import springfox.documentation.swagger.web.SwaggerResourcesProvider; | ||||
| import org.springframework.http.MediaType; | ||||
| import org.springframework.web.reactive.function.server.HandlerFunction; | ||||
| import org.springframework.web.reactive.function.server.ServerRequest; | ||||
| import org.springframework.web.reactive.function.server.ServerResponse; | ||||
| import reactor.core.publisher.Mono; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.ArrayList; | ||||
| import java.util.HashSet; | ||||
| import java.util.List; | ||||
| import java.util.Set; | ||||
| import java.util.*; | ||||
| 
 | ||||
| /** | ||||
|  * Swagger 资源的 Provider 实现类 | ||||
|  * 获得 Swagger 资源的 {@link HandlerFunction} 实现类 | ||||
|  * | ||||
|  * @author zxliu | ||||
|  * @date 2022-10-25 11:23 | ||||
|  * @since 2022-10-25 11:23 | ||||
|  */ | ||||
| @Component | ||||
| @Primary | ||||
| @RequiredArgsConstructor | ||||
| @Slf4j | ||||
| public class SwaggerProvider implements SwaggerResourcesProvider { | ||||
| public class SwaggerResourceHandlerFunction implements HandlerFunction<ServerResponse> { | ||||
| 
 | ||||
|     @Resource | ||||
|     private GatewayProperties gatewayProperties; | ||||
|     private final GatewayProperties gatewayProperties; | ||||
| 
 | ||||
|     @Override | ||||
|     public Mono<ServerResponse> handle(ServerRequest request) { | ||||
|         return ServerResponse.ok() | ||||
|                 .contentType(MediaType.APPLICATION_JSON) | ||||
|                 .bodyValue(getSwaggerResourceList()); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 获得 SwaggerResource 列表 | ||||
|      * | ||||
|      * @return SwaggerResource 列表 | ||||
|      */ | ||||
|     @Override | ||||
|     public List<SwaggerResource> get() { | ||||
|     public List<Map<String, String>> getSwaggerResourceList() { | ||||
|         // 将 RouteDefinition 转换成 SwaggerResource
 | ||||
|         List<SwaggerResource> resources = new ArrayList<>(); | ||||
|         List<Map<String, String>> resources = new ArrayList<>(); | ||||
|         Set<String> serviceNames = new HashSet<>(); // 已处理的服务名,避免重复
 | ||||
|         gatewayProperties.getRoutes().forEach(route -> { | ||||
|             // 已存在的服务,直接忽略
 | ||||
|  | @ -64,11 +66,12 @@ public class SwaggerProvider implements SwaggerResourcesProvider { | |||
|         return resources; | ||||
|     } | ||||
| 
 | ||||
|     private SwaggerResource buildSwaggerResource(String name, String location) { | ||||
|         SwaggerResource swaggerResource = new SwaggerResource(); | ||||
|         swaggerResource.setName(name); | ||||
|         swaggerResource.setLocation(location); | ||||
|         swaggerResource.setSwaggerVersion("2.0"); | ||||
|     private Map<String, String> buildSwaggerResource(String name, String location) { | ||||
|         Map<String, String> swaggerResource = new HashMap<>(); | ||||
|         swaggerResource.put("name", name); | ||||
|         swaggerResource.put("location", location); | ||||
|         swaggerResource.put("url", location); | ||||
|         swaggerResource.put("swaggerVersion", "3.0.3"); | ||||
|         return swaggerResource; | ||||
|     } | ||||
| 
 | ||||
|  | @ -79,7 +82,7 @@ public class SwaggerProvider implements SwaggerResourcesProvider { | |||
|      *  predicates: | ||||
|      *      - Path=/admin-api/system/** | ||||
|      * ② 输出: | ||||
|      *  /admin-api/system/v2/api-docs | ||||
|      *  /admin-api/system/v3/api-docs | ||||
|      * | ||||
|      * @param route 路由 | ||||
|      * @return 路由 | ||||
|  | @ -96,7 +99,7 @@ public class SwaggerProvider implements SwaggerResourcesProvider { | |||
|             log.info("[get][Route({}) Path 的值为空,忽略接口文档]", route.getId()); | ||||
|             return null; | ||||
|         } | ||||
|         return path.replace("/**", "/v2/api-docs"); | ||||
|         return path.replace("/**", "/v3/api-docs"); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  | @ -0,0 +1,42 @@ | |||
| package cn.iocoder.yudao.gateway.swagger; | ||||
| 
 | ||||
| import com.github.xiaoymin.knife4j.spring.gateway.configuration.Knife4jGatewayAutoConfiguration; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||||
| import org.springframework.cloud.gateway.config.GatewayProperties; | ||||
| import org.springframework.context.annotation.Bean; | ||||
| import org.springframework.context.annotation.Configuration; | ||||
| import org.springframework.web.reactive.function.server.RouterFunction; | ||||
| import org.springframework.web.reactive.function.server.RouterFunctions; | ||||
| import org.springframework.web.reactive.function.server.ServerResponse; | ||||
| 
 | ||||
| /** | ||||
|  * 网关 Swagger 接口文档的自动配置类 | ||||
|  * | ||||
|  * 参考 {@link Knife4jGatewayAutoConfiguration} 实现,进行功能的增强,核心实现在 {@link SwaggerResourceHandlerFunction} 类中 | ||||
|  * 它通过解析 spring.cloud.gateway.routes 配置,获得 Swagger 资源分组。 | ||||
|  * | ||||
|  * 另外,目前官方 Knif4j 网关的实现,不会通过注册中心加载对应的 URL 地址。等到他们完善了,就可以去掉自己的这个实现了。 | ||||
|  * | ||||
|  * @see <a href="https://doc.xiaominfo.com/docs/middleware-sources/spring-cloud-gateway/spring-gateway-introduction">Knife4j + Spring Cloud Gateway 网关聚合</a> | ||||
|  * | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @Configuration | ||||
| @ConditionalOnProperty(name = "knife4j.gateway.enable", havingValue = "true") | ||||
| @Slf4j | ||||
| public class YudaoSwaggerAutoConfiguration { | ||||
| 
 | ||||
|     /** | ||||
|      * Swagger 资源分组 URL | ||||
|      */ | ||||
|     public static final String GATEWAY_SWAGGER_GROUP_URL = "/swagger-resources"; | ||||
| 
 | ||||
|     @Bean | ||||
|     public RouterFunction<ServerResponse> swaggerResourceHandlerFunction(GatewayProperties gatewayProperties) { | ||||
|         log.info("[swaggerResourceHandlerFunction][初始化完成]"); | ||||
|         SwaggerResourceHandlerFunction handlerFunction = new SwaggerResourceHandlerFunction(gatewayProperties); | ||||
|         return RouterFunctions.route().GET(GATEWAY_SWAGGER_GROUP_URL, handlerFunction).build(); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  | @ -12,40 +12,45 @@ spring: | |||
|           predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组 | ||||
|             - Path=/admin-api/system/** | ||||
|           filters: | ||||
|               - RewritePath=/admin-api/system/v2/api-docs, /v2/api-docs # 配置,保证转发到 /v2/api-docs | ||||
|               - RewritePath=/admin-api/system/v3/api-docs, /v3/api-docs # 配置,保证转发到 /v3/api-docs | ||||
|         - id: system-app-api # 路由的编号 | ||||
|           uri: grayLb://system-server | ||||
|           predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组 | ||||
|             - Path=/app-api/system/** | ||||
|           filters: | ||||
|               - RewritePath=/app-api/system/v2/api-docs, /v2/api-docs | ||||
|               - RewritePath=/app-api/system/v3/api-docs, /v3/api-docs | ||||
|         - id: infra-admin-api # 路由的编号 | ||||
|           uri: grayLb://infra-server | ||||
|           predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组 | ||||
|             - Path=/admin-api/infra/** | ||||
|           filters: | ||||
|               - RewritePath=/admin-api/infra/v2/api-docs, /v2/api-docs | ||||
|               - RewritePath=/admin-api/infra/v3/api-docs, /v3/api-docs | ||||
|         - id: infra-app-api # 路由的编号 | ||||
|           uri: grayLb://infra-server | ||||
|           predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组 | ||||
|             - Path=/app-api/infra/** | ||||
|           filters: | ||||
|               - RewritePath=/app-api/infra/v2/api-docs, /v2/api-docs | ||||
|               - RewritePath=/app-api/infra/v3/api-docs, /v3/api-docs | ||||
|         - id: bpm-admin-api # 路由的编号 | ||||
|           uri: grayLb://bpm-server | ||||
|           predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组 | ||||
|             - Path=/admin-api/bpm/** | ||||
|           filters: | ||||
|               - RewritePath=/admin-api/bpm/v2/api-docs, /v2/api-docs | ||||
|               - RewritePath=/admin-api/bpm/v3/api-docs, /v3/api-docs | ||||
|         - id: report-admin-api # 路由的编号 | ||||
|           uri: grayLb://report-server | ||||
|           predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组 | ||||
|             - Path=/admin-api/report/** | ||||
|           filters: | ||||
|             - RewritePath=/admin-api/report/v2/api-docs, /v2/api-docs | ||||
|             - RewritePath=/admin-api/report/v3/api-docs, /v3/api-docs | ||||
|         - id: report-jmreport # 路由的编号(积木报表) | ||||
|           uri: grayLb://report-server | ||||
|           predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组 | ||||
|             - Path=/jmreport/** | ||||
|       x-forwarded: | ||||
|         prefix-enabled: false # 避免 Swagger 重复带上额外的 /admin-api/system 前缀 | ||||
| 
 | ||||
| knife4j: | ||||
|   # 聚合 Swagger 文档 | ||||
|   gateway: | ||||
|     enable: true | ||||
|  |  | |||
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 3.6 KiB | 
|  | @ -6,9 +6,9 @@ import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO; | |||
| import cn.iocoder.yudao.module.bpm.service.definition.BpmFormService; | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||||
| import io.swagger.v3.oas.annotations.Parameter; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
|  | @ -19,7 +19,7 @@ import java.util.List; | |||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| 
 | ||||
| @Api(tags = "管理后台 - 动态表单") | ||||
| @Tag(name =  "管理后台 - 动态表单") | ||||
| @RestController | ||||
| @RequestMapping("/bpm/form") | ||||
| @Validated | ||||
|  | @ -29,14 +29,14 @@ public class BpmFormController { | |||
|     private BpmFormService formService; | ||||
| 
 | ||||
|     @PostMapping("/create") | ||||
|     @ApiOperation("创建动态表单") | ||||
|     @Operation(summary = "创建动态表单") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:form:create')") | ||||
|     public CommonResult<Long> createForm(@Valid @RequestBody BpmFormCreateReqVO createReqVO) { | ||||
|         return success(formService.createForm(createReqVO)); | ||||
|     } | ||||
| 
 | ||||
|     @PutMapping("/update") | ||||
|     @ApiOperation("更新动态表单") | ||||
|     @Operation(summary = "更新动态表单") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:form:update')") | ||||
|     public CommonResult<Boolean> updateForm(@Valid @RequestBody BpmFormUpdateReqVO updateReqVO) { | ||||
|         formService.updateForm(updateReqVO); | ||||
|  | @ -44,8 +44,8 @@ public class BpmFormController { | |||
|     } | ||||
| 
 | ||||
|     @DeleteMapping("/delete") | ||||
|     @ApiOperation("删除动态表单") | ||||
|     @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) | ||||
|     @Operation(summary = "删除动态表单") | ||||
|     @Parameter(name = "id", description = "编号", required = true) | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:form:delete')") | ||||
|     public CommonResult<Boolean> deleteForm(@RequestParam("id") Long id) { | ||||
|         formService.deleteForm(id); | ||||
|  | @ -53,8 +53,8 @@ public class BpmFormController { | |||
|     } | ||||
| 
 | ||||
|     @GetMapping("/get") | ||||
|     @ApiOperation("获得动态表单") | ||||
|     @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | ||||
|     @Operation(summary = "获得动态表单") | ||||
|     @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:form:query')") | ||||
|     public CommonResult<BpmFormRespVO> getForm(@RequestParam("id") Long id) { | ||||
|         BpmFormDO form = formService.getForm(id); | ||||
|  | @ -62,18 +62,18 @@ public class BpmFormController { | |||
|     } | ||||
| 
 | ||||
|     @GetMapping("/list-all-simple") | ||||
|     @ApiOperation(value = "获得动态表单的精简列表", notes = "用于表单下拉框") | ||||
|     @Operation(summary = "获得动态表单的精简列表", description = "用于表单下拉框") | ||||
|     public CommonResult<List<BpmFormSimpleRespVO>> getSimpleForms() { | ||||
|         List<BpmFormDO> list = formService.getFormList(); | ||||
|         return success(BpmFormConvert.INSTANCE.convertList2(list)); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/page") | ||||
|     @ApiOperation("获得动态表单分页") | ||||
|     @Operation(summary = "获得动态表单分页") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:form:query')") | ||||
|     public CommonResult<PageResult<BpmFormRespVO>> getFormPage(@Valid BpmFormPageReqVO pageVO) { | ||||
|         PageResult<BpmFormDO> pageResult = formService.getFormPage(pageVO); | ||||
|         return success(BpmFormConvert.INSTANCE.convertPage(pageResult)); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -6,9 +6,9 @@ import cn.iocoder.yudao.framework.common.util.io.IoUtils; | |||
| import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.*; | ||||
| import cn.iocoder.yudao.module.bpm.convert.definition.BpmModelConvert; | ||||
| import cn.iocoder.yudao.module.bpm.service.definition.BpmModelService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||||
| import io.swagger.v3.oas.annotations.Parameter; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
|  | @ -20,7 +20,7 @@ import java.io.IOException; | |||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| 
 | ||||
| @Api(tags = "管理后台 - 流程模型") | ||||
| @Tag(name =  "管理后台 - 流程模型") | ||||
| @RestController | ||||
| @RequestMapping("/bpm/model") | ||||
| @Validated | ||||
|  | @ -30,14 +30,14 @@ public class BpmModelController { | |||
|     private BpmModelService modelService; | ||||
| 
 | ||||
|     @GetMapping("/page") | ||||
|     @ApiOperation(value = "获得模型分页") | ||||
|     @Operation(summary = "获得模型分页") | ||||
|     public CommonResult<PageResult<BpmModelPageItemRespVO>> getModelPage(BpmModelPageReqVO pageVO) { | ||||
|         return success(modelService.getModelPage(pageVO)); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/get") | ||||
|     @ApiOperation("获得模型") | ||||
|     @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = String.class) | ||||
|     @Operation(summary = "获得模型") | ||||
|     @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:model:query')") | ||||
|     public CommonResult<BpmModelRespVO> getModel(@RequestParam("id") String id) { | ||||
|         BpmModelRespVO model = modelService.getModel(id); | ||||
|  | @ -45,14 +45,14 @@ public class BpmModelController { | |||
|     } | ||||
| 
 | ||||
|     @PostMapping("/create") | ||||
|     @ApiOperation(value = "新建模型") | ||||
|     @Operation(summary = "新建模型") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:model:create')") | ||||
|     public CommonResult<String> createModel(@Valid @RequestBody BpmModelCreateReqVO createRetVO) { | ||||
|         return success(modelService.createModel(createRetVO, null)); | ||||
|     } | ||||
| 
 | ||||
|     @PutMapping("/update") | ||||
|     @ApiOperation(value = "修改模型") | ||||
|     @Operation(summary = "修改模型") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:model:update')") | ||||
|     public CommonResult<Boolean> updateModel(@Valid @RequestBody BpmModelUpdateReqVO modelVO) { | ||||
|         modelService.updateModel(modelVO); | ||||
|  | @ -60,7 +60,7 @@ public class BpmModelController { | |||
|     } | ||||
| 
 | ||||
|     @PostMapping("/import") | ||||
|     @ApiOperation(value = "导入模型") | ||||
|     @Operation(summary = "导入模型") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:model:import')") | ||||
|     public CommonResult<String> importModel(@Valid BpmModeImportReqVO importReqVO) throws IOException { | ||||
|         BpmModelCreateReqVO createReqVO = BpmModelConvert.INSTANCE.convert(importReqVO); | ||||
|  | @ -70,8 +70,8 @@ public class BpmModelController { | |||
|     } | ||||
| 
 | ||||
|     @PostMapping("/deploy") | ||||
|     @ApiOperation(value = "部署模型") | ||||
|     @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = String.class) | ||||
|     @Operation(summary = "部署模型") | ||||
|     @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:model:deploy')") | ||||
|     public CommonResult<Boolean> deployModel(@RequestParam("id") String id) { | ||||
|         modelService.deployModel(id); | ||||
|  | @ -79,7 +79,7 @@ public class BpmModelController { | |||
|     } | ||||
| 
 | ||||
|     @PutMapping("/update-state") | ||||
|     @ApiOperation(value = "修改模型的状态", notes = "实际更新的部署的流程定义的状态") | ||||
|     @Operation(summary = "修改模型的状态", description = "实际更新的部署的流程定义的状态") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:model:update')") | ||||
|     public CommonResult<Boolean> updateModelState(@Valid @RequestBody BpmModelUpdateStateReqVO reqVO) { | ||||
|         modelService.updateModelState(reqVO.getId(), reqVO.getState()); | ||||
|  | @ -87,11 +87,11 @@ public class BpmModelController { | |||
|     } | ||||
| 
 | ||||
|     @DeleteMapping("/delete") | ||||
|     @ApiOperation("删除模型") | ||||
|     @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = String.class) | ||||
|     @Operation(summary = "删除模型") | ||||
|     @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:model:delete')") | ||||
|     public CommonResult<Boolean> deleteModel(@RequestParam("id") String id) { | ||||
|         modelService.deleteModel(id); | ||||
|         return success(true); | ||||
|     } | ||||
| } | ||||
| } | ||||
|  | @ -7,9 +7,9 @@ import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmPro | |||
| import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionPageReqVO; | ||||
| import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionRespVO; | ||||
| import cn.iocoder.yudao.module.bpm.service.definition.BpmProcessDefinitionService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||||
| import io.swagger.v3.oas.annotations.Parameter; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | ||||
|  | @ -23,7 +23,7 @@ import java.util.List; | |||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| 
 | ||||
| @Api(tags = "管理后台 - 流程定义") | ||||
| @Tag(name =  "管理后台 - 流程定义") | ||||
| @RestController | ||||
| @RequestMapping("/bpm/process-definition") | ||||
| @Validated | ||||
|  | @ -33,7 +33,7 @@ public class BpmProcessDefinitionController { | |||
|     private BpmProcessDefinitionService bpmDefinitionService; | ||||
| 
 | ||||
|     @GetMapping("/page") | ||||
|     @ApiOperation(value = "获得流程定义分页") | ||||
|     @Operation(summary = "获得流程定义分页") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:process-definition:query')") | ||||
|     public CommonResult<PageResult<BpmProcessDefinitionPageItemRespVO>> getProcessDefinitionPage( | ||||
|             BpmProcessDefinitionPageReqVO pageReqVO) { | ||||
|  | @ -41,7 +41,7 @@ public class BpmProcessDefinitionController { | |||
|     } | ||||
| 
 | ||||
|     @GetMapping ("/list") | ||||
|     @ApiOperation(value = "获得流程定义列表") | ||||
|     @Operation(summary = "获得流程定义列表") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:process-definition:query')") | ||||
|     public CommonResult<List<BpmProcessDefinitionRespVO>> getProcessDefinitionList( | ||||
|             BpmProcessDefinitionListReqVO listReqVO) { | ||||
|  | @ -49,11 +49,11 @@ public class BpmProcessDefinitionController { | |||
|     } | ||||
| 
 | ||||
|     @GetMapping ("/get-bpmn-xml") | ||||
|     @ApiOperation(value = "获得流程定义的 BPMN XML") | ||||
|     @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = String.class) | ||||
|     @Operation(summary = "获得流程定义的 BPMN XML") | ||||
|     @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:process-definition:query')") | ||||
|     public CommonResult<String> getProcessDefinitionBpmnXML(@RequestParam("id") String id) { | ||||
|         String bpmnXML = bpmDefinitionService.getProcessDefinitionBpmnXML(id); | ||||
|         return success(bpmnXML); | ||||
|     } | ||||
| } | ||||
| } | ||||
|  | @ -5,10 +5,10 @@ import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule.BpmTaskAs | |||
| import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule.BpmTaskAssignRuleRespVO; | ||||
| import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule.BpmTaskAssignRuleUpdateReqVO; | ||||
| import cn.iocoder.yudao.module.bpm.service.definition.BpmTaskAssignRuleService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||||
| import io.swagger.v3.oas.annotations.Parameter; | ||||
| import io.swagger.v3.oas.annotations.Parameters; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
|  | @ -19,7 +19,7 @@ import java.util.List; | |||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| 
 | ||||
| @Api(tags = "管理后台 - 任务分配规则") | ||||
| @Tag(name =  "管理后台 - 任务分配规则") | ||||
| @RestController | ||||
| @RequestMapping("/bpm/task-assign-rule") | ||||
| @Validated | ||||
|  | @ -29,10 +29,10 @@ public class BpmTaskAssignRuleController { | |||
|     private BpmTaskAssignRuleService taskAssignRuleService; | ||||
| 
 | ||||
|     @GetMapping("/list") | ||||
|     @ApiOperation(value = "获得任务分配规则列表") | ||||
|     @ApiImplicitParams({ | ||||
|             @ApiImplicitParam(name = "modelId", value = "模型编号", example = "1024", dataTypeClass = String.class), | ||||
|             @ApiImplicitParam(name = "processDefinitionId", value = "流程定义的编号", example = "2048", dataTypeClass = String.class) | ||||
|     @Operation(summary = "获得任务分配规则列表") | ||||
|     @Parameters({ | ||||
|             @Parameter(name = "modelId", description = "模型编号", example = "1024"), | ||||
|             @Parameter(name = "processDefinitionId", description = "流程定义的编号", example = "2048") | ||||
|     }) | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:task-assign-rule:query')") | ||||
|     public CommonResult<List<BpmTaskAssignRuleRespVO>> getTaskAssignRuleList( | ||||
|  | @ -42,17 +42,17 @@ public class BpmTaskAssignRuleController { | |||
|     } | ||||
| 
 | ||||
|     @PostMapping("/create") | ||||
|     @ApiOperation(value = "创建任务分配规则") | ||||
|     @Operation(summary = "创建任务分配规则") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:task-assign-rule:create')") | ||||
|     public CommonResult<Long> createTaskAssignRule(@Valid @RequestBody BpmTaskAssignRuleCreateReqVO reqVO) { | ||||
|         return success(taskAssignRuleService.createTaskAssignRule(reqVO)); | ||||
|     } | ||||
| 
 | ||||
|     @PutMapping("/update") | ||||
|     @ApiOperation(value = "更新任务分配规则") | ||||
|     @Operation(summary = "更新任务分配规则") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:task-assign-rule:update')") | ||||
|     public CommonResult<Boolean> updateTaskAssignRule(@Valid @RequestBody BpmTaskAssignRuleUpdateReqVO reqVO) { | ||||
|         taskAssignRuleService.updateTaskAssignRule(reqVO); | ||||
|         return success(true); | ||||
|     } | ||||
| } | ||||
| } | ||||
|  | @ -10,9 +10,9 @@ import cn.iocoder.yudao.module.bpm.service.definition.BpmUserGroupService; | |||
| import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||||
| import io.swagger.v3.oas.annotations.Parameter; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
|  | @ -23,7 +23,7 @@ import java.util.List; | |||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| 
 | ||||
| @Api(tags = "管理后台 - 用户组") | ||||
| @Tag(name =  "管理后台 - 用户组") | ||||
| @RestController | ||||
| @RequestMapping("/bpm/user-group") | ||||
| @Validated | ||||
|  | @ -33,14 +33,14 @@ public class BpmUserGroupController { | |||
|     private BpmUserGroupService userGroupService; | ||||
| 
 | ||||
|     @PostMapping("/create") | ||||
|     @ApiOperation("创建用户组") | ||||
|     @Operation(summary = "创建用户组") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:user-group:create')") | ||||
|     public CommonResult<Long> createUserGroup(@Valid @RequestBody BpmUserGroupCreateReqVO createReqVO) { | ||||
|         return success(userGroupService.createUserGroup(createReqVO)); | ||||
|     } | ||||
| 
 | ||||
|     @PutMapping("/update") | ||||
|     @ApiOperation("更新用户组") | ||||
|     @Operation(summary = "更新用户组") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:user-group:update')") | ||||
|     public CommonResult<Boolean> updateUserGroup(@Valid @RequestBody BpmUserGroupUpdateReqVO updateReqVO) { | ||||
|         userGroupService.updateUserGroup(updateReqVO); | ||||
|  | @ -48,8 +48,8 @@ public class BpmUserGroupController { | |||
|     } | ||||
| 
 | ||||
|     @DeleteMapping("/delete") | ||||
|     @ApiOperation("删除用户组") | ||||
|     @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) | ||||
|     @Operation(summary = "删除用户组") | ||||
|     @Parameter(name = "id", description = "编号", required = true) | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:user-group:delete')") | ||||
|     public CommonResult<Boolean> deleteUserGroup(@RequestParam("id") Long id) { | ||||
|         userGroupService.deleteUserGroup(id); | ||||
|  | @ -57,8 +57,8 @@ public class BpmUserGroupController { | |||
|     } | ||||
| 
 | ||||
|     @GetMapping("/get") | ||||
|     @ApiOperation("获得用户组") | ||||
|     @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | ||||
|     @Operation(summary = "获得用户组") | ||||
|     @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:user-group:query')") | ||||
|     public CommonResult<BpmUserGroupRespVO> getUserGroup(@RequestParam("id") Long id) { | ||||
|         BpmUserGroupDO userGroup = userGroupService.getUserGroup(id); | ||||
|  | @ -66,7 +66,7 @@ public class BpmUserGroupController { | |||
|     } | ||||
| 
 | ||||
|     @GetMapping("/page") | ||||
|     @ApiOperation("获得用户组分页") | ||||
|     @Operation(summary = "获得用户组分页") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:user-group:query')") | ||||
|     public CommonResult<PageResult<BpmUserGroupRespVO>> getUserGroupPage(@Valid BpmUserGroupPageReqVO pageVO) { | ||||
|         PageResult<BpmUserGroupDO> pageResult = userGroupService.getUserGroupPage(pageVO); | ||||
|  | @ -74,7 +74,7 @@ public class BpmUserGroupController { | |||
|     } | ||||
| 
 | ||||
|     @GetMapping("/list-all-simple") | ||||
|     @ApiOperation(value = "获取用户组精简信息列表", notes = "只包含被开启的用户组,主要用于前端的下拉选项") | ||||
|     @Operation(summary = "获取用户组精简信息列表", description = "只包含被开启的用户组,主要用于前端的下拉选项") | ||||
|     public CommonResult<List<BpmUserGroupRespVO>> getSimpleUserGroups() { | ||||
|         // 获用户门列表,只要开启状态的
 | ||||
|         List<BpmUserGroupDO> list = userGroupService.getUserGroupListByStatus(CommonStatusEnum.ENABLE.getStatus()); | ||||
|  | @ -82,4 +82,4 @@ public class BpmUserGroupController { | |||
|         return success(BpmUserGroupConvert.INSTANCE.convertList2(list)); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,7 +1,7 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form; | ||||
| 
 | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.*; | ||||
| import io.swagger.annotations.*; | ||||
| import javax.validation.constraints.*; | ||||
| 
 | ||||
| /** | ||||
|  | @ -11,15 +11,15 @@ import javax.validation.constraints.*; | |||
| @Data | ||||
| public class BpmFormBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表单名称", required = true, example = "芋道") | ||||
|     @Schema(description = "表单名称", required = true, example = "芋道") | ||||
|     @NotNull(message = "表单名称不能为空") | ||||
|     private String name; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表单状态", required = true, notes = "参见 CommonStatusEnum 枚举", example = "1") | ||||
|     @Schema(description = "表单状态,参见 CommonStatusEnum 枚举", required = true, example = "1") | ||||
|     @NotNull(message = "表单状态不能为空") | ||||
|     private Integer status; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "备注", example = "我是备注") | ||||
|     @Schema(description = "备注", example = "我是备注") | ||||
|     private String remark; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,23 +1,23 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form; | ||||
| 
 | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.*; | ||||
| import io.swagger.annotations.*; | ||||
| 
 | ||||
| import javax.validation.constraints.NotNull; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 动态表单创建 Request VO") | ||||
| @Schema(description = "管理后台 - 动态表单创建 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmFormCreateReqVO extends BpmFormBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表单的配置", required = true, notes = "JSON 字符串") | ||||
|     @Schema(description = "表单的配置,JSON 字符串", required = true) | ||||
|     @NotNull(message = "表单的配置不能为空") | ||||
|     private String conf; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表单项的数组", required = true, notes = "JSON 字符串的数组") | ||||
|     @Schema(description = "表单项的数组,JSON 字符串的数组", required = true) | ||||
|     @NotNull(message = "表单项的数组不能为空") | ||||
|     private List<String> fields; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,19 +1,19 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 动态表单分页 Request VO") | ||||
| @Schema(description = "管理后台 - 动态表单分页 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmFormPageReqVO extends PageParam { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表单名称", example = "芋道") | ||||
|     @Schema(description = "表单名称", example = "芋道") | ||||
|     private String name; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,7 +1,7 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
|  | @ -10,24 +10,24 @@ import javax.validation.constraints.NotNull; | |||
| import java.time.LocalDateTime; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 动态表单 Response VO") | ||||
| @Schema(description = "管理后台 - 动态表单 Response VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmFormRespVO extends BpmFormBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表单编号", required = true, example = "1024") | ||||
|     @Schema(description = "表单编号", required = true, example = "1024") | ||||
|     private Long id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表单的配置", required = true, notes = "JSON 字符串") | ||||
|     @Schema(description = "表单的配置,JSON 字符串", required = true) | ||||
|     @NotNull(message = "表单的配置不能为空") | ||||
|     private String conf; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表单项的数组", required = true, notes = "JSON 字符串的数组") | ||||
|     @Schema(description = "表单项的数组,JSON 字符串的数组", required = true) | ||||
|     @NotNull(message = "表单项的数组不能为空") | ||||
|     private List<String> fields; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "创建时间", required = true) | ||||
|     @Schema(description = "创建时间", required = true) | ||||
|     private LocalDateTime createTime; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,17 +1,17 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程表单精简 Response VO") | ||||
| @Schema(description = "管理后台 - 流程表单精简 Response VO") | ||||
| @Data | ||||
| public class BpmFormSimpleRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表单编号", required = true, example = "1024") | ||||
|     @Schema(description = "表单编号", required = true, example = "1024") | ||||
|     private Long id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表单名称", required = true, example = "芋道") | ||||
|     @Schema(description = "表单名称", required = true, example = "芋道") | ||||
|     private String name; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,26 +1,26 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form; | ||||
| 
 | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.*; | ||||
| import io.swagger.annotations.*; | ||||
| import javax.validation.constraints.*; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 动态表单更新 Request VO") | ||||
| @Schema(description = "管理后台 - 动态表单更新 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmFormUpdateReqVO extends BpmFormBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表单编号", required = true, example = "1024") | ||||
|     @Schema(description = "表单编号", required = true, example = "1024") | ||||
|     @NotNull(message = "表单编号不能为空") | ||||
|     private Long id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表单的配置", required = true, notes = "JSON 字符串") | ||||
|     @Schema(description = "表单的配置,JSON 字符串", required = true) | ||||
|     @NotNull(message = "表单的配置不能为空") | ||||
|     private String conf; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表单项的数组", required = true, notes = "JSON 字符串的数组") | ||||
|     @Schema(description = "表单项的数组,JSON 字符串的数组", required = true) | ||||
|     @NotNull(message = "表单项的数组不能为空") | ||||
|     private List<String> fields; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,8 +1,8 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group; | ||||
| 
 | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.*; | ||||
| import java.util.*; | ||||
| import io.swagger.annotations.*; | ||||
| import javax.validation.constraints.*; | ||||
| 
 | ||||
| /** | ||||
|  | @ -12,20 +12,20 @@ import javax.validation.constraints.*; | |||
| @Data | ||||
| public class BpmUserGroupBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "组名", required = true, example = "芋道") | ||||
|     @Schema(description = "组名", required = true, example = "芋道") | ||||
|     @NotNull(message = "组名不能为空") | ||||
|     private String name; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "描述", required = true, example = "芋道源码") | ||||
|     @Schema(description = "描述", required = true, example = "芋道源码") | ||||
|     @NotNull(message = "描述不能为空") | ||||
|     private String description; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "成员编号数组", required = true, example = "1,2,3") | ||||
|     @Schema(description = "成员编号数组", required = true, example = "1,2,3") | ||||
|     @NotNull(message = "成员编号数组不能为空") | ||||
|     private Set<Long> memberUserIds; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "状态", required = true, example = "1") | ||||
|     @Schema(description = "状态", required = true, example = "1") | ||||
|     @NotNull(message = "状态不能为空") | ||||
|     private Integer status; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,12 +1,12 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group; | ||||
| 
 | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.*; | ||||
| import io.swagger.annotations.*; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 用户组创建 Request VO") | ||||
| @Schema(description = "管理后台 - 用户组创建 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmUserGroupCreateReqVO extends BpmUserGroupBaseVO { | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -2,8 +2,8 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group; | |||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import cn.iocoder.yudao.framework.common.util.date.DateUtils; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
|  | @ -11,20 +11,20 @@ import org.springframework.format.annotation.DateTimeFormat; | |||
| 
 | ||||
| import java.time.LocalDateTime; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 用户组分页 Request VO") | ||||
| @Schema(description = "管理后台 - 用户组分页 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmUserGroupPageReqVO extends PageParam { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "组名", example = "芋道") | ||||
|     @Schema(description = "组名", example = "芋道") | ||||
|     private String name; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "状态", example = "1") | ||||
|     @Schema(description = "状态", example = "1") | ||||
|     private Integer status; | ||||
| 
 | ||||
|     @DateTimeFormat(pattern = DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||||
|     @ApiModelProperty(value = "创建时间") | ||||
|     @Schema(description = "创建时间") | ||||
|     private LocalDateTime[] createTime; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,21 +1,20 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group; | ||||
| 
 | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.*; | ||||
| 
 | ||||
| import java.time.LocalDateTime; | ||||
| import java.util.*; | ||||
| import io.swagger.annotations.*; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 用户组 Response VO") | ||||
| @Schema(description = "管理后台 - 用户组 Response VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmUserGroupRespVO extends BpmUserGroupBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "编号", required = true, example = "1024") | ||||
|     @Schema(description = "编号", required = true, example = "1024") | ||||
|     private Long id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "创建时间", required = true) | ||||
|     @Schema(description = "创建时间", required = true) | ||||
|     private LocalDateTime createTime; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,21 +1,21 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 用户组精简信息 Response VO") | ||||
| @Schema(description = "管理后台 - 用户组精简信息 Response VO") | ||||
| @Data | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class BpmUserGroupSimpleRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "用户组编号", required = true, example = "1024") | ||||
|     @Schema(description = "用户组编号", required = true, example = "1024") | ||||
|     private Long id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "用户组名字", required = true, example = "芋道") | ||||
|     @Schema(description = "用户组名字", required = true, example = "芋道") | ||||
|     private String name; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,17 +1,17 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group; | ||||
| 
 | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.*; | ||||
| import io.swagger.annotations.*; | ||||
| import javax.validation.constraints.*; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 用户组更新 Request VO") | ||||
| @Schema(description = "管理后台 - 用户组更新 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmUserGroupUpdateReqVO extends BpmUserGroupBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "编号", required = true, example = "1024") | ||||
|     @Schema(description = "编号", required = true, example = "1024") | ||||
|     @NotNull(message = "编号不能为空") | ||||
|     private Long id; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,7 +1,7 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
|  | @ -9,14 +9,14 @@ import org.springframework.web.multipart.MultipartFile; | |||
| 
 | ||||
| import javax.validation.constraints.NotNull; | ||||
| 
 | ||||
| @ApiModel(value = "管理后台 - 流程模型的导入 Request VO", description = "相比流程模型的新建来说,只是多了一个 bpmnFile 文件") | ||||
| @Schema(description =  "管理后台 - 流程模型的导入 Request VO,相比流程模型的新建来说,只是多了一个 bpmnFile 文件") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmModeImportReqVO extends BpmModelCreateReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "BPMN 文件", required = true) | ||||
|     @Schema(description = "BPMN 文件", required = true) | ||||
|     @NotNull(message = "BPMN 文件不能为空") | ||||
|     private MultipartFile bpmnFile; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,6 +1,6 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import javax.validation.constraints.NotEmpty; | ||||
|  | @ -12,30 +12,28 @@ import javax.validation.constraints.NotEmpty; | |||
| @Data | ||||
| public class BpmModelBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程标识", required = true, example = "process_yudao") | ||||
|     @Schema(description = "流程标识", required = true, example = "process_yudao") | ||||
|     @NotEmpty(message = "流程标识不能为空") | ||||
|     private String key; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程名称", required = true, example = "芋道") | ||||
|     @Schema(description = "流程名称", required = true, example = "芋道") | ||||
|     @NotEmpty(message = "流程名称不能为空") | ||||
|     private String name; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程描述", example = "我是描述") | ||||
|     @Schema(description = "流程描述", example = "我是描述") | ||||
|     private String description; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1") | ||||
|     @Schema(description = "流程分类,参见 bpm_model_category 数据字典", example = "1") | ||||
|     @NotEmpty(message = "流程分类不能为空") | ||||
|     private String category; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表单类型", notes = "参见 bpm_model_form_type 数据字典", example = "1") | ||||
|     @Schema(description = "表单类型,参见 bpm_model_form_type 数据字典", example = "1") | ||||
|     private Integer formType; | ||||
|     @ApiModelProperty(value = "表单编号", example = "1024", notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") | ||||
|     @Schema(description = "表单编号,在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", example = "1024") | ||||
|     private Long formId; | ||||
|     @ApiModelProperty(value = "自定义表单的提交路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/create", | ||||
|             notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") | ||||
|     @Schema(description = "自定义表单的提交路径,使用 Vue 的路由地址,在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", example = "/bpm/oa/leave/create") | ||||
|     private String formCustomCreatePath; | ||||
|     @ApiModelProperty(value = "自定义表单的查看路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/view", | ||||
|             notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") | ||||
|     @Schema(description = "自定义表单的查看路径,使用 Vue 的路由地址,在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", example = "/bpm/oa/leave/view" ) | ||||
|     private String formCustomViewPath; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,26 +1,26 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
| 
 | ||||
| import javax.validation.constraints.NotEmpty; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程模型的创建 Request VO") | ||||
| @Schema(description = "管理后台 - 流程模型的创建 Request VO") | ||||
| @Data | ||||
| public class BpmModelCreateReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程标识", required = true, example = "process_yudao") | ||||
|     @Schema(description = "流程标识", required = true, example = "process_yudao") | ||||
|     @NotEmpty(message = "流程标识不能为空") | ||||
|     private String key; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程名称", required = true, example = "芋道") | ||||
|     @Schema(description = "流程名称", required = true, example = "芋道") | ||||
|     @NotEmpty(message = "流程名称不能为空") | ||||
|     private String name; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程描述", example = "我是描述") | ||||
|     @Schema(description = "流程描述", example = "我是描述") | ||||
|     private String description; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,26 +1,26 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
| 
 | ||||
| import java.time.LocalDateTime; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程模型的分页的每一项 Response VO") | ||||
| @Schema(description = "管理后台 - 流程模型的分页的每一项 Response VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmModelPageItemRespVO extends BpmModelBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "编号", required = true, example = "1024") | ||||
|     @Schema(description = "编号", required = true, example = "1024") | ||||
|     private String id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表单名字", example = "请假表单") | ||||
|     @Schema(description = "表单名字", example = "请假表单") | ||||
|     private String formName; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "创建时间", required = true) | ||||
|     @Schema(description = "创建时间", required = true) | ||||
|     private LocalDateTime createTime; | ||||
| 
 | ||||
|     /** | ||||
|  | @ -28,22 +28,22 @@ public class BpmModelPageItemRespVO extends BpmModelBaseVO { | |||
|      */ | ||||
|     private ProcessDefinition processDefinition; | ||||
| 
 | ||||
|     @ApiModel("流程定义") | ||||
|     @Schema(description = "流程定义") | ||||
|     @Data | ||||
|     public static class ProcessDefinition { | ||||
| 
 | ||||
|         @ApiModelProperty(value = "编号", required = true, example = "1024") | ||||
|         @Schema(description = "编号", required = true, example = "1024") | ||||
|         private String id; | ||||
| 
 | ||||
|         @ApiModelProperty(value = "版本", required = true, example = "1") | ||||
|         @Schema(description = "版本", required = true, example = "1") | ||||
|         private Integer version; | ||||
| 
 | ||||
|         @ApiModelProperty(value = "部署时间", required = true) | ||||
|         @Schema(description = "部署时间", required = true) | ||||
|         private LocalDateTime deploymentTime; | ||||
| 
 | ||||
|         @ApiModelProperty(value = "中断状态", required = true, example = "1", notes = "参见 SuspensionState 枚举") | ||||
|         @Schema(description = "中断状态,参见 SuspensionState 枚举", required = true, example = "1") | ||||
|         private Integer suspensionState; | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,26 +1,26 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
| 
 | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程模型分页 Request VO") | ||||
| @Schema(description = "管理后台 - 流程模型分页 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmModelPageReqVO extends PageParam { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "标识", example = "process1641042089407", notes = "精准匹配") | ||||
|     @Schema(description = "标识,精准匹配", example = "process1641042089407") | ||||
|     private String key; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "名字", example = "芋道", notes = "模糊匹配") | ||||
|     @Schema(description = "名字,精准匹配", example = "芋道") | ||||
|     private String name; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1") | ||||
|     @Schema(description = "流程分类,参见 bpm_model_category 数据字典", example = "1") | ||||
|     private String category; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,26 +1,26 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
| 
 | ||||
| import java.time.LocalDateTime; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程模型的创建 Request VO") | ||||
| @Schema(description = "管理后台 - 流程模型的创建 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmModelRespVO extends BpmModelBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "编号", required = true, example = "1024") | ||||
|     @Schema(description = "编号", required = true, example = "1024") | ||||
|     private String id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "BPMN XML", required = true) | ||||
|     @Schema(description = "BPMN XML", required = true) | ||||
|     private String bpmnXml; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "创建时间", required = true) | ||||
|     @Schema(description = "创建时间", required = true) | ||||
|     private LocalDateTime createTime; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,40 +1,38 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import javax.validation.constraints.NotEmpty; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程模型的更新 Request VO") | ||||
| @Schema(description = "管理后台 - 流程模型的更新 Request VO") | ||||
| @Data | ||||
| public class BpmModelUpdateReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "编号", required = true, example = "1024") | ||||
|     @Schema(description = "编号", required = true, example = "1024") | ||||
|     @NotEmpty(message = "编号不能为空") | ||||
|     private String id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程名称", example = "芋道") | ||||
|     @Schema(description = "流程名称", example = "芋道") | ||||
|     private String name; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程描述", example = "我是描述") | ||||
|     @Schema(description = "流程描述", example = "我是描述") | ||||
|     private String description; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1") | ||||
|     @Schema(description = "流程分类,参见 bpm_model_category 数据字典", example = "1") | ||||
|     private String category; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "BPMN XML", required = true) | ||||
|     @Schema(description = "BPMN XML", required = true) | ||||
|     private String bpmnXml; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表单类型", notes = "参见 bpm_model_form_type 数据字典", example = "1") | ||||
|     @Schema(description = "表单类型,参见 bpm_model_form_type 数据字典", example = "1") | ||||
|     private Integer formType; | ||||
|     @ApiModelProperty(value = "表单编号", example = "1024", notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") | ||||
|     @Schema(description = "表单编号,在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", example = "1024") | ||||
|     private Long formId; | ||||
|     @ApiModelProperty(value = "自定义表单的提交路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/create", | ||||
|             notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") | ||||
|     @Schema(description = "自定义表单的提交路径,使用 Vue 的路由地址,在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", example = "/bpm/oa/leave/create") | ||||
|     private String formCustomCreatePath; | ||||
|     @ApiModelProperty(value = "自定义表单的查看路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/view", | ||||
|             notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") | ||||
|     @Schema(description = "自定义表单的查看路径,使用 Vue 的路由地址,在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", example = "/bpm/oa/leave/view" ) | ||||
|     private String formCustomViewPath; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,21 +1,21 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import javax.validation.constraints.NotNull; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程模型更新状态 Request VO") | ||||
| @Schema(description = "管理后台 - 流程模型更新状态 Request VO") | ||||
| @Data | ||||
| public class BpmModelUpdateStateReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "编号", required = true, example = "1024") | ||||
|     @Schema(description = "编号", required = true, example = "1024") | ||||
|     @NotNull(message = "编号不能为空") | ||||
|     private String id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 SuspensionState 枚举") | ||||
|     @Schema(description = "状态,见 SuspensionState 枚举", required = true, example = "1") | ||||
|     @NotNull(message = "状态不能为空") | ||||
|     private Integer state; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,19 +1,19 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程定义列表 Request VO") | ||||
| @Schema(description = "管理后台 - 流程定义列表 Request VO") | ||||
| @Data | ||||
| @ToString(callSuper = true) | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class BpmProcessDefinitionListReqVO extends PageParam { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "中断状态", example = "1", notes = "参见 SuspensionState 枚举") | ||||
|     @Schema(description = "中断状态,参见 SuspensionState 枚举", example = "1") | ||||
|     private Integer suspensionState; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,23 +1,23 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
| 
 | ||||
| import java.time.LocalDateTime; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程定义的分页的每一项 Response VO") | ||||
| @Schema(description = "管理后台 - 流程定义的分页的每一项 Response VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmProcessDefinitionPageItemRespVO extends BpmProcessDefinitionRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表单名字", example = "请假表单") | ||||
|     @Schema(description = "表单名字", example = "请假表单") | ||||
|     private String formName; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "部署时间", required = true) | ||||
|     @Schema(description = "部署时间", required = true) | ||||
|     private LocalDateTime deploymentTime; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,19 +1,19 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程定义分页 Request VO") | ||||
| @Schema(description = "管理后台 - 流程定义分页 Request VO") | ||||
| @Data | ||||
| @ToString(callSuper = true) | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class BpmProcessDefinitionPageReqVO extends PageParam { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "标识", example = "process1641042089407", notes = "精准匹配") | ||||
|     @Schema(description = "标识,精准匹配", example = "process1641042089407") | ||||
|     private String key; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,52 +1,48 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import javax.validation.constraints.NotEmpty; | ||||
| import javax.validation.constraints.NotNull; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程定义 Response VO") | ||||
| @Schema(description = "管理后台 - 流程定义 Response VO") | ||||
| @Data | ||||
| public class BpmProcessDefinitionRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "编号", required = true, example = "1024") | ||||
|     @Schema(description = "编号", required = true, example = "1024") | ||||
|     private String id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "版本", required = true, example = "1") | ||||
|     @Schema(description = "版本", required = true, example = "1") | ||||
|     private Integer version; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程名称", required = true, example = "芋道") | ||||
|     @Schema(description = "流程名称", required = true, example = "芋道") | ||||
|     @NotEmpty(message = "流程名称不能为空") | ||||
|     private String name; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程描述", example = "我是描述") | ||||
|     @Schema(description = "流程描述", example = "我是描述") | ||||
|     private String description; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1") | ||||
|     @Schema(description = "流程分类,参见 bpm_model_category 数据字典", example = "1") | ||||
|     @NotEmpty(message = "流程分类不能为空") | ||||
|     private String category; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表单类型", notes = "参见 bpm_model_form_type 数据字典", example = "1") | ||||
|     @Schema(description = "表单类型,参见 bpm_model_form_type 数据字典", example = "1") | ||||
|     private Integer formType; | ||||
|     @ApiModelProperty(value = "表单编号", example = "1024", notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") | ||||
|     @Schema(description = "表单编号,在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", example = "1024") | ||||
|     private Long formId; | ||||
|     @ApiModelProperty(value = "表单的配置", required = true, | ||||
|             notes = "JSON 字符串。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") | ||||
|     @Schema(description = "表单的配置,JSON 字符串。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", required = true ) | ||||
|     private String formConf; | ||||
|     @ApiModelProperty(value = "表单项的数组", required = true, | ||||
|             notes = "JSON 字符串的数组。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") | ||||
|     @Schema(description = "表单项的数组,JSON 字符串的数组。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", required = true ) | ||||
|     private List<String> formFields; | ||||
|     @ApiModelProperty(value = "自定义表单的提交路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/create", | ||||
|             notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") | ||||
|     @Schema(description = "自定义表单的提交路径,使用 Vue 的路由地址,在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", example = "/bpm/oa/leave/create" ) | ||||
|     private String formCustomCreatePath; | ||||
|     @ApiModelProperty(value = "自定义表单的查看路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/view", | ||||
|             notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") | ||||
|     @Schema(description = "自定义表单的查看路径,使用 Vue 的路由地址,在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", example = "/bpm/oa/leave/view") | ||||
|     private String formCustomViewPath; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "中断状态", required = true, example = "1", notes = "参见 SuspensionState 枚举") | ||||
|     @Schema(description = "中断状态,参见 SuspensionState 枚举", required = true, example = "1") | ||||
|     private Integer suspensionState; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,6 +1,6 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import javax.validation.constraints.NotEmpty; | ||||
|  | @ -14,12 +14,12 @@ import java.util.Set; | |||
| @Data | ||||
| public class BpmTaskAssignRuleBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "规则类型", required = true, example = "bpm_task_assign_rule_type") | ||||
|     @Schema(description = "规则类型", required = true, example = "bpm_task_assign_rule_type") | ||||
|     @NotNull(message = "规则类型不能为空") | ||||
|     private Integer type; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "规则值数组", required = true, example = "1,2,3") | ||||
|     @Schema(description = "规则值数组", required = true, example = "1,2,3") | ||||
|     @NotNull(message = "规则值数组不能为空") | ||||
|     private Set<Long> options; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,25 +1,25 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
| 
 | ||||
| import javax.validation.constraints.NotEmpty; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程任务分配规则的创建 Request VO") | ||||
| @Schema(description = "管理后台 - 流程任务分配规则的创建 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmTaskAssignRuleCreateReqVO extends BpmTaskAssignRuleBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程模型的编号", required = true, example = "1024") | ||||
|     @Schema(description = "流程模型的编号", required = true, example = "1024") | ||||
|     @NotEmpty(message = "流程模型的编号不能为空") | ||||
|     private String modelId; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程任务定义的编号", required = true, example = "2048") | ||||
|     @Schema(description = "流程任务定义的编号", required = true, example = "2048") | ||||
|     @NotEmpty(message = "流程任务定义的编号不能为空") | ||||
|     private String taskDefinitionKey; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,29 +1,29 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程任务分配规则的 Response VO") | ||||
| @Schema(description = "管理后台 - 流程任务分配规则的 Response VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmTaskAssignRuleRespVO extends BpmTaskAssignRuleBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "任务分配规则的编号", required = true, example = "1024") | ||||
|     @Schema(description = "任务分配规则的编号", required = true, example = "1024") | ||||
|     private Long id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程模型的编号", required = true, example = "2048") | ||||
|     @Schema(description = "流程模型的编号", required = true, example = "2048") | ||||
|     private String modelId; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程定义的编号", required = true, example = "4096") | ||||
|     @Schema(description = "流程定义的编号", required = true, example = "4096") | ||||
|     private String processDefinitionId; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程任务定义的编号", required = true, example = "2048") | ||||
|     @Schema(description = "流程任务定义的编号", required = true, example = "2048") | ||||
|     private String taskDefinitionKey; | ||||
|     @ApiModelProperty(value = "流程任务定义的名字", required = true, example = "关注芋道") | ||||
|     @Schema(description = "流程任务定义的名字", required = true, example = "关注芋道") | ||||
|     private String taskDefinitionName; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,21 +1,21 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
| 
 | ||||
| import javax.validation.constraints.NotNull; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程任务分配规则的更新 Request VO") | ||||
| @Schema(description = "管理后台 - 流程任务分配规则的更新 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmTaskAssignRuleUpdateReqVO extends BpmTaskAssignRuleBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "任务分配规则的编号", required = true, example = "1024") | ||||
|     @Schema(description = "任务分配规则的编号", required = true, example = "1024") | ||||
|     @NotNull(message = "任务分配规则的编号不能为空") | ||||
|     private Long id; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -8,9 +8,9 @@ import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOALeaveDO; | |||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.module.bpm.service.oa.BpmOALeaveService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||||
| import io.swagger.v3.oas.annotations.Parameter; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
|  | @ -27,7 +27,7 @@ import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUti | |||
|  * @author jason | ||||
|  * @author 芋道源码 | ||||
|  */ | ||||
| @Api(tags = "管理后台 - OA 请假申请") | ||||
| @Tag(name =  "管理后台 - OA 请假申请") | ||||
| @RestController | ||||
| @RequestMapping("/bpm/oa/leave") | ||||
| @Validated | ||||
|  | @ -38,15 +38,15 @@ public class BpmOALeaveController { | |||
| 
 | ||||
|     @PostMapping("/create") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:oa-leave:create')") | ||||
|     @ApiOperation("创建请求申请") | ||||
|     @Operation(summary = "创建请求申请") | ||||
|     public CommonResult<Long> createLeave(@Valid @RequestBody BpmOALeaveCreateReqVO createReqVO) { | ||||
|         return success(leaveService.createLeave(getLoginUserId(), createReqVO)); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/get") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:oa-leave:query')") | ||||
|     @ApiOperation("获得请假申请") | ||||
|     @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | ||||
|     @Operation(summary = "获得请假申请") | ||||
|     @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||||
|     public CommonResult<BpmOALeaveRespVO> getLeave(@RequestParam("id") Long id) { | ||||
|         BpmOALeaveDO leave = leaveService.getLeave(id); | ||||
|         return success(BpmOALeaveConvert.INSTANCE.convert(leave)); | ||||
|  | @ -54,10 +54,10 @@ public class BpmOALeaveController { | |||
| 
 | ||||
|     @GetMapping("/page") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:oa-leave:query')") | ||||
|     @ApiOperation("获得请假申请分页") | ||||
|     @Operation(summary = "获得请假申请分页") | ||||
|     public CommonResult<PageResult<BpmOALeaveRespVO>> getLeavePage(@Valid BpmOALeavePageReqVO pageVO) { | ||||
|         PageResult<BpmOALeaveDO> pageResult = leaveService.getLeavePage(getLoginUserId(), pageVO); | ||||
|         return success(BpmOALeaveConvert.INSTANCE.convertPage(pageResult)); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,6 +1,6 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import org.springframework.format.annotation.DateTimeFormat; | ||||
| 
 | ||||
|  | @ -16,19 +16,19 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ | |||
| @Data | ||||
| public class BpmOALeaveBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "请假的开始时间", required = true) | ||||
|     @Schema(description = "请假的开始时间", required = true) | ||||
|     @NotNull(message = "开始时间不能为空") | ||||
|     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||||
|     private LocalDateTime startTime; | ||||
|     @ApiModelProperty(value = "请假的结束时间", required = true) | ||||
|     @Schema(description = "请假的结束时间", required = true) | ||||
|     @NotNull(message = "结束时间不能为空") | ||||
|     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||||
|     private LocalDateTime endTime; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "请假类型", required = true, example = "1", notes = "参见 bpm_oa_type 枚举") | ||||
|     @Schema(description = "请假类型,参见 bpm_oa_type 枚举", required = true, example = "1") | ||||
|     private Integer type; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "原因", required = true, example = "阅读芋道源码") | ||||
|     @Schema(description = "原因", required = true, example = "阅读芋道源码") | ||||
|     private String reason; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,13 +1,13 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
| 
 | ||||
| import javax.validation.constraints.AssertTrue; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 请假申请创建 Request VO") | ||||
| @Schema(description = "管理后台 - 请假申请创建 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
|  |  | |||
|  | @ -1,30 +1,30 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo; | ||||
| 
 | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.*; | ||||
| import java.util.*; | ||||
| import io.swagger.annotations.*; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import org.springframework.format.annotation.DateTimeFormat; | ||||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 请假申请分页 Request VO") | ||||
| @Schema(description = "管理后台 - 请假申请分页 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmOALeavePageReqVO extends PageParam { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "状态", example = "1", notes = "参见 bpm_process_instance_result 枚举") | ||||
|     @Schema(description = "状态,参见 bpm_process_instance_result 枚举", example = "1") | ||||
|     private Integer result; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "请假类型", example = "1", notes = "参见 bpm_oa_type") | ||||
|     @Schema(description = "请假类型,参见 bpm_oa_type", example = "1") | ||||
|     private Integer type; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "原因", example = "阅读芋道源码", notes = "模糊匹配") | ||||
|     @Schema(description = "原因,模糊匹配", example = "阅读芋道源码") | ||||
|     private String reason; | ||||
| 
 | ||||
|     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||||
|     @ApiModelProperty(value = "申请时间") | ||||
|     @Schema(description = "申请时间") | ||||
|     private Date[] createTime; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,7 +1,7 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo; | ||||
| 
 | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.*; | ||||
| import io.swagger.annotations.*; | ||||
| import org.springframework.format.annotation.DateTimeFormat; | ||||
| 
 | ||||
| import javax.validation.constraints.NotNull; | ||||
|  | @ -9,24 +9,24 @@ import java.time.LocalDateTime; | |||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 请假申请 Response VO") | ||||
| @Schema(description = "管理后台 - 请假申请 Response VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmOALeaveRespVO extends BpmOALeaveBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "请假表单主键", required = true, example = "1024") | ||||
|     @Schema(description = "请假表单主键", required = true, example = "1024") | ||||
|     private Long id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 bpm_process_instance_result 枚举") | ||||
|     @Schema(description = "状态,参见 bpm_process_instance_result 枚举", required = true, example = "1") | ||||
|     private Integer result; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "申请时间", required = true) | ||||
|     @Schema(description = "申请时间", required = true) | ||||
|     @NotNull(message = "申请时间不能为空") | ||||
|     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||||
|     private LocalDateTime createTime; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程id") | ||||
|     @Schema(description = "流程id") | ||||
|     private String processInstanceId; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -3,9 +3,9 @@ package cn.iocoder.yudao.module.bpm.controller.admin.task; | |||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.activity.BpmActivityRespVO; | ||||
| import cn.iocoder.yudao.module.bpm.service.task.BpmActivityService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||||
| import io.swagger.v3.oas.annotations.Parameter; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | ||||
|  | @ -18,7 +18,7 @@ import java.util.List; | |||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| 
 | ||||
| @Api(tags = "管理后台 - 流程活动实例") | ||||
| @Tag(name =  "管理后台 - 流程活动实例") | ||||
| @RestController | ||||
| @RequestMapping("/bpm/activity") | ||||
| @Validated | ||||
|  | @ -28,12 +28,11 @@ public class BpmActivityController { | |||
|     private BpmActivityService activityService; | ||||
| 
 | ||||
|     @GetMapping("/list") | ||||
|     @ApiOperation(value = "生成指定流程实例的高亮流程图", | ||||
|             notes = "只高亮进行中的任务。不过要注意,该接口暂时没用,通过前端的 ProcessViewer.vue 界面的 highlightDiagram 方法生成") | ||||
|     @ApiImplicitParam(name = "processInstanceId", value = "流程实例的编号", required = true, dataTypeClass = String.class) | ||||
|     @Operation(summary = "生成指定流程实例的高亮流程图,只高亮进行中的任务。不过要注意,该接口暂时没用,通过前端的 ProcessViewer.vue 界面的 highlightDiagram 方法生成") | ||||
|     @Parameter(name = "processInstanceId", description = "流程实例的编号", required = true) | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:task:query')") | ||||
|     public CommonResult<List<BpmActivityRespVO>> getActivityList( | ||||
|             @RequestParam("processInstanceId") String processInstanceId) { | ||||
|         return success(activityService.getActivityListByProcessInstanceId(processInstanceId)); | ||||
|     } | ||||
| } | ||||
| } | ||||
|  | @ -4,9 +4,9 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.*; | ||||
| import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||||
| import io.swagger.v3.oas.annotations.Parameter; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
|  | @ -17,7 +17,7 @@ import javax.validation.Valid; | |||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; | ||||
| 
 | ||||
| @Api(tags = "管理后台 - 流程实例") // 流程实例,通过流程定义创建的一次“申请”
 | ||||
| @Tag(name =  "管理后台 - 流程实例") // 流程实例,通过流程定义创建的一次“申请”
 | ||||
| @RestController | ||||
| @RequestMapping("/bpm/process-instance") | ||||
| @Validated | ||||
|  | @ -27,7 +27,7 @@ public class BpmProcessInstanceController { | |||
|     private BpmProcessInstanceService processInstanceService; | ||||
| 
 | ||||
|     @GetMapping("/my-page") | ||||
|     @ApiOperation(value = "获得我的实例分页列表", notes = "在【我的流程】菜单中,进行调用") | ||||
|     @Operation(summary = "获得我的实例分页列表", description = "在【我的流程】菜单中,进行调用") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:process-instance:query')") | ||||
|     public CommonResult<PageResult<BpmProcessInstancePageItemRespVO>> getMyProcessInstancePage( | ||||
|             @Valid BpmProcessInstanceMyPageReqVO pageReqVO) { | ||||
|  | @ -35,25 +35,25 @@ public class BpmProcessInstanceController { | |||
|     } | ||||
| 
 | ||||
|     @PostMapping("/create") | ||||
|     @ApiOperation("新建流程实例") | ||||
|     @Operation(summary = "新建流程实例") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:process-instance:query')") | ||||
|     public CommonResult<String> createProcessInstance(@Valid @RequestBody BpmProcessInstanceCreateReqVO createReqVO) { | ||||
|         return success(processInstanceService.createProcessInstance(getLoginUserId(), createReqVO)); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/get") | ||||
|     @ApiOperation(value = "获得指定流程实例", notes = "在【流程详细】界面中,进行调用") | ||||
|     @ApiImplicitParam(name = "id", value = "流程实例的编号", required = true, dataTypeClass = String.class) | ||||
|     @Operation(summary = "获得指定流程实例", description = "在【流程详细】界面中,进行调用") | ||||
|     @Parameter(name = "id", description = "流程实例的编号", required = true) | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:process-instance:query')") | ||||
|     public CommonResult<BpmProcessInstanceRespVO> getProcessInstance(@RequestParam("id") String id) { | ||||
|         return success(processInstanceService.getProcessInstanceVO(id)); | ||||
|     } | ||||
| 
 | ||||
|     @DeleteMapping("/cancel") | ||||
|     @ApiOperation(value = "取消流程实例", notes = "撤回发起的流程") | ||||
|     @Operation(summary = "取消流程实例", description = "撤回发起的流程") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:process-instance:cancel')") | ||||
|     public CommonResult<Boolean> cancelProcessInstance(@Valid @RequestBody BpmProcessInstanceCancelReqVO cancelReqVO) { | ||||
|         processInstanceService.cancelProcessInstance(getLoginUserId(), cancelReqVO); | ||||
|         return success(true); | ||||
|     } | ||||
| } | ||||
| } | ||||
|  | @ -4,9 +4,9 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.*; | ||||
| import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||||
| import io.swagger.v3.oas.annotations.Parameter; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
|  | @ -19,7 +19,7 @@ import java.util.List; | |||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId; | ||||
| 
 | ||||
| @Api(tags = "管理后台 - 流程任务实例") | ||||
| @Tag(name =  "管理后台 - 流程任务实例") | ||||
| @RestController | ||||
| @RequestMapping("/bpm/task") | ||||
| @Validated | ||||
|  | @ -29,22 +29,22 @@ public class BpmTaskController { | |||
|     private BpmTaskService taskService; | ||||
| 
 | ||||
|     @GetMapping("todo-page") | ||||
|     @ApiOperation("获取 Todo 待办任务分页") | ||||
|     @Operation(summary = "获取 Todo 待办任务分页") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:task:query')") | ||||
|     public CommonResult<PageResult<BpmTaskTodoPageItemRespVO>> getTodoTaskPage(@Valid BpmTaskTodoPageReqVO pageVO) { | ||||
|         return success(taskService.getTodoTaskPage(getLoginUserId(), pageVO)); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("done-page") | ||||
|     @ApiOperation("获取 Done 已办任务分页") | ||||
|     @Operation(summary = "获取 Done 已办任务分页") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:task:query')") | ||||
|     public CommonResult<PageResult<BpmTaskDonePageItemRespVO>> getDoneTaskPage(@Valid BpmTaskDonePageReqVO pageVO) { | ||||
|         return success(taskService.getDoneTaskPage(getLoginUserId(), pageVO)); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/list-by-process-instance-id") | ||||
|     @ApiOperation(value = "获得指定流程实例的任务列表", notes = "包括完成的、未完成的") | ||||
|     @ApiImplicitParam(name = "processInstanceId", value = "流程实例的编号", required = true, dataTypeClass = String.class) | ||||
|     @Operation(summary = "获得指定流程实例的任务列表", description = "包括完成的、未完成的") | ||||
|     @Parameter(name = "processInstanceId", description = "流程实例的编号", required = true) | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:task:query')") | ||||
|     public CommonResult<List<BpmTaskRespVO>> getTaskListByProcessInstanceId( | ||||
|         @RequestParam("processInstanceId") String processInstanceId) { | ||||
|  | @ -52,7 +52,7 @@ public class BpmTaskController { | |||
|     } | ||||
| 
 | ||||
|     @PutMapping("/approve") | ||||
|     @ApiOperation("通过任务") | ||||
|     @Operation(summary = "通过任务") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:task:update')") | ||||
|     public CommonResult<Boolean> approveTask(@Valid @RequestBody BpmTaskApproveReqVO reqVO) { | ||||
|         taskService.approveTask(getLoginUserId(), reqVO); | ||||
|  | @ -60,7 +60,7 @@ public class BpmTaskController { | |||
|     } | ||||
| 
 | ||||
|     @PutMapping("/reject") | ||||
|     @ApiOperation("不通过任务") | ||||
|     @Operation(summary = "不通过任务") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:task:update')") | ||||
|     public CommonResult<Boolean> rejectTask(@Valid @RequestBody BpmTaskRejectReqVO reqVO) { | ||||
|         taskService.rejectTask(getLoginUserId(), reqVO); | ||||
|  | @ -68,11 +68,11 @@ public class BpmTaskController { | |||
|     } | ||||
| 
 | ||||
|     @PutMapping("/update-assignee") | ||||
|     @ApiOperation(value = "更新任务的负责人", notes = "用于【流程详情】的【转派】按钮") | ||||
|     @Operation(summary = "更新任务的负责人", description = "用于【流程详情】的【转派】按钮") | ||||
|     @PreAuthorize("@ss.hasPermission('bpm:task:update')") | ||||
|     public CommonResult<Boolean> updateTaskAssignee(@Valid @RequestBody BpmTaskUpdateAssigneeReqVO reqVO) { | ||||
|         taskService.updateTaskAssignee(getLoginUserId(), reqVO); | ||||
|         return success(true); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,26 +1,26 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.activity; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import java.time.LocalDateTime; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程活动的 Response VO") | ||||
| @Schema(description = "管理后台 - 流程活动的 Response VO") | ||||
| @Data | ||||
| public class BpmActivityRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程活动的标识", required = true, example = "1024") | ||||
|     @Schema(description = "流程活动的标识", required = true, example = "1024") | ||||
|     private String key; | ||||
|     @ApiModelProperty(value = "流程活动的类型", required = true, example = "StartEvent") | ||||
|     @Schema(description = "流程活动的类型", required = true, example = "StartEvent") | ||||
|     private String type; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程活动的开始时间", required = true) | ||||
|     @Schema(description = "流程活动的开始时间", required = true) | ||||
|     private LocalDateTime startTime; | ||||
|     @ApiModelProperty(value = "流程活动的结束时间", required = true) | ||||
|     @Schema(description = "流程活动的结束时间", required = true) | ||||
|     private LocalDateTime endTime; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "关联的流程任务的编号", example = "2048", notes = "关联的流程任务,只有 UserTask 等类型才有") | ||||
|     @Schema(description = "关联的流程任务的编号,关联的流程任务,只有 UserTask 等类型才有", example = "2048") | ||||
|     private String taskId; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,23 +1,23 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import javax.validation.constraints.NotEmpty; | ||||
| import javax.validation.constraints.NotNull; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程实例的取消 Request VO") | ||||
| @Schema(description = "管理后台 - 流程实例的取消 Request VO") | ||||
| @Data | ||||
| public class BpmProcessInstanceCancelReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程实例的编号", required = true, example = "1024") | ||||
|     @Schema(description = "流程实例的编号", required = true, example = "1024") | ||||
|     @NotEmpty(message = "流程实例的编号不能为空") | ||||
|     private String id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "取消原因", required = true, example = "不请假了!") | ||||
|     @Schema(description = "取消原因", required = true, example = "不请假了!") | ||||
|     @NotEmpty(message = "取消原因不能为空") | ||||
|     private String reason; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,21 +1,21 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import javax.validation.constraints.NotEmpty; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程实例的创建 Request VO") | ||||
| @Schema(description = "管理后台 - 流程实例的创建 Request VO") | ||||
| @Data | ||||
| public class BpmProcessInstanceCreateReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程定义的编号", required = true, example = "1024") | ||||
|     @Schema(description = "流程定义的编号", required = true, example = "1024") | ||||
|     @NotEmpty(message = "流程定义编号不能为空") | ||||
|     private String processDefinitionId; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "变量实例") | ||||
|     @Schema(description = "变量实例") | ||||
|     private Map<String, Object> variables; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,8 +1,8 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
|  | @ -12,29 +12,29 @@ import java.time.LocalDateTime; | |||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程实例的分页 Item Response VO") | ||||
| @Schema(description = "管理后台 - 流程实例的分页 Item Response VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmProcessInstanceMyPageReqVO extends PageParam { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程名称", example = "芋道") | ||||
|     @Schema(description = "流程名称", example = "芋道") | ||||
|     private String name; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程定义的编号", example = "2048") | ||||
|     @Schema(description = "流程定义的编号", example = "2048") | ||||
|     private String processDefinitionId; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程实例的状态", notes = "参见 bpm_process_instance_status", example = "1") | ||||
|     @Schema(description = "流程实例的状态,参见 bpm_process_instance_status", example = "1") | ||||
|     private Integer status; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程实例的结果", notes = "参见 bpm_process_instance_result", example = "2") | ||||
|     @Schema(description = "流程实例的结果,参见 bpm_process_instance_result", example = "2") | ||||
|     private Integer result; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1") | ||||
|     @Schema(description = "流程分类,参见 bpm_model_category 数据字典", example = "1") | ||||
|     private String category; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "创建时间") | ||||
|     @Schema(description = "创建时间") | ||||
|     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||||
|     private LocalDateTime[] createTime; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,38 +1,38 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import java.time.LocalDateTime; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程实例的分页 Item Response VO") | ||||
| @Schema(description = "管理后台 - 流程实例的分页 Item Response VO") | ||||
| @Data | ||||
| public class BpmProcessInstancePageItemRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程实例的编号", required = true, example = "1024") | ||||
|     @Schema(description = "流程实例的编号", required = true, example = "1024") | ||||
|     private String id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程名称", required = true, example = "芋道") | ||||
|     @Schema(description = "流程名称", required = true, example = "芋道") | ||||
|     private String name; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程定义的编号", required = true, example = "2048") | ||||
|     @Schema(description = "流程定义的编号", required = true, example = "2048") | ||||
|     private String processDefinitionId; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程分类", required = true, notes = "参见 bpm_model_category 数据字典", example = "1") | ||||
|     @Schema(description = "流程分类,参见 bpm_model_category 数据字典", required = true, example = "1") | ||||
|     private String category; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程实例的状态", required = true, notes = "参见 bpm_process_instance_status", example = "1") | ||||
|     @Schema(description = "流程实例的状态,参见 bpm_process_instance_status", required = true, example = "1") | ||||
|     private Integer status; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程实例的结果", required = true, notes = "参见 bpm_process_instance_result", example = "2") | ||||
|     @Schema(description = "流程实例的结果,参见 bpm_process_instance_result", required = true, example = "2") | ||||
|     private Integer result; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "提交时间", required = true) | ||||
|     @Schema(description = "提交时间", required = true) | ||||
|     private LocalDateTime createTime; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "结束时间", required = true) | ||||
|     @Schema(description = "结束时间", required = true) | ||||
|     private LocalDateTime endTime; | ||||
| 
 | ||||
|     /** | ||||
|  | @ -40,16 +40,16 @@ public class BpmProcessInstancePageItemRespVO { | |||
|      */ | ||||
|     private List<Task> tasks; | ||||
| 
 | ||||
|     @ApiModel("流程任务") | ||||
|     @Schema(description = "流程任务") | ||||
|     @Data | ||||
|     public static class Task { | ||||
| 
 | ||||
|         @ApiModelProperty(value = "流程任务的编号", required = true, example = "1024") | ||||
|         @Schema(description = "流程任务的编号", required = true, example = "1024") | ||||
|         private String id; | ||||
| 
 | ||||
|         @ApiModelProperty(value = "任务名称", required = true, example = "芋道") | ||||
|         @Schema(description = "任务名称", required = true, example = "芋道") | ||||
|         private String name; | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,42 +1,42 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import java.time.LocalDateTime; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程实例的 Response VO") | ||||
| @Schema(description = "管理后台 - 流程实例的 Response VO") | ||||
| @Data | ||||
| public class BpmProcessInstanceRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程实例的编号", required = true, example = "1024") | ||||
|     @Schema(description = "流程实例的编号", required = true, example = "1024") | ||||
|     private String id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程名称", required = true, example = "芋道") | ||||
|     @Schema(description = "流程名称", required = true, example = "芋道") | ||||
|     private String name; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程分类", required = true, notes = "参见 bpm_model_category 数据字典", example = "1") | ||||
|     @Schema(description = "流程分类,参见 bpm_model_category 数据字典", required = true, example = "1") | ||||
|     private String category; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程实例的状态", required = true, notes = "参见 bpm_process_instance_status", example = "1") | ||||
|     @Schema(description = "流程实例的状态,参见 bpm_process_instance_status", required = true, example = "1") | ||||
|     private Integer status; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程实例的结果", required = true, notes = "参见 bpm_process_instance_result", example = "2") | ||||
|     @Schema(description = "流程实例的结果,参见 bpm_process_instance_result", required = true, example = "2") | ||||
|     private Integer result; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "提交时间", required = true) | ||||
|     @Schema(description = "提交时间", required = true) | ||||
|     private LocalDateTime createTime; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "结束时间", required = true) | ||||
|     @Schema(description = "结束时间", required = true) | ||||
|     private LocalDateTime endTime; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "提交的表单值", required = true) | ||||
|     @Schema(description = "提交的表单值", required = true) | ||||
|     private Map<String, Object> formVariables; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "业务的唯一标识", example = "1", notes = "例如说,请假申请的编号") | ||||
|     @Schema(description = "业务的唯一标识,例如说,请假申请的编号", example = "1") | ||||
|     private String businessKey; | ||||
| 
 | ||||
|     /** | ||||
|  | @ -49,49 +49,45 @@ public class BpmProcessInstanceRespVO { | |||
|      */ | ||||
|     private ProcessDefinition processDefinition; | ||||
| 
 | ||||
|     @ApiModel("用户信息") | ||||
|     @Schema(description = "用户信息") | ||||
|     @Data | ||||
|     public static class User { | ||||
| 
 | ||||
|         @ApiModelProperty(value = "用户编号", required = true, example = "1") | ||||
|         @Schema(description = "用户编号", required = true, example = "1") | ||||
|         private Long id; | ||||
|         @ApiModelProperty(value = "用户昵称", required = true, example = "芋艿") | ||||
|         @Schema(description = "用户昵称", required = true, example = "芋艿") | ||||
|         private String nickname; | ||||
| 
 | ||||
|         @ApiModelProperty(value = "部门编号", required = true, example = "1") | ||||
|         @Schema(description = "部门编号", required = true, example = "1") | ||||
|         private Long deptId; | ||||
|         @ApiModelProperty(value = "部门名称", required = true, example = "研发部") | ||||
|         @Schema(description = "部门名称", required = true, example = "研发部") | ||||
|         private String deptName; | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     @ApiModel("流程定义信息") | ||||
|     @Schema(description = "流程定义信息") | ||||
|     @Data | ||||
|     public static class ProcessDefinition { | ||||
| 
 | ||||
|         @ApiModelProperty(value = "编号", required = true, example = "1024") | ||||
|         @Schema(description = "编号", required = true, example = "1024") | ||||
|         private String id; | ||||
| 
 | ||||
|         @ApiModelProperty(value = "表单类型", notes = "参见 bpm_model_form_type 数据字典", example = "1") | ||||
|         @Schema(description = "表单类型,参见 bpm_model_form_type 数据字典", example = "1") | ||||
|         private Integer formType; | ||||
|         @ApiModelProperty(value = "表单编号", example = "1024", notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") | ||||
|         @Schema(description = "表单编号,在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", example = "1024") | ||||
|         private Long formId; | ||||
|         @ApiModelProperty(value = "表单的配置", required = true, | ||||
|                 notes = "JSON 字符串。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") | ||||
|         @Schema(description = "表单的配置,JSON 字符串。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", required = true) | ||||
|         private String formConf; | ||||
|         @ApiModelProperty(value = "表单项的数组", required = true, | ||||
|                 notes = "JSON 字符串的数组。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") | ||||
|         @Schema(description = "表单项的数组,JSON 字符串的数组。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", required = true) | ||||
|         private List<String> formFields; | ||||
|         @ApiModelProperty(value = "自定义表单的提交路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/create", | ||||
|                 notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") | ||||
|         @Schema(description = "自定义表单的提交路径,使用 Vue 的路由地址,在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", example = "/bpm/oa/leave/create") | ||||
|         private String formCustomCreatePath; | ||||
|         @ApiModelProperty(value = "自定义表单的查看路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/view", | ||||
|                 notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") | ||||
|         @Schema(description = "自定义表单的查看路径,使用 Vue 的路由地址,在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", example = "/bpm/oa/leave/view") | ||||
|         private String formCustomViewPath; | ||||
| 
 | ||||
|         @ApiModelProperty(value = "BPMN XML", required = true) | ||||
|         @Schema(description = "BPMN XML", required = true) | ||||
|         private String bpmnXml; | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,21 +1,21 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import javax.validation.constraints.NotEmpty; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 通过流程任务的 Request VO") | ||||
| @Schema(description = "管理后台 - 通过流程任务的 Request VO") | ||||
| @Data | ||||
| public class BpmTaskApproveReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "任务编号", required = true, example = "1024") | ||||
|     @Schema(description = "任务编号", required = true, example = "1024") | ||||
|     @NotEmpty(message = "任务编号不能为空") | ||||
|     private String id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "审批意见", required = true, example = "不错不错!") | ||||
|     @Schema(description = "审批意见", required = true, example = "不错不错!") | ||||
|     @NotEmpty(message = "审批意见不能为空") | ||||
|     private String reason; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,27 +1,27 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
| 
 | ||||
| import java.time.LocalDateTime; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程任务的 Done 已完成的分页项 Response VO") | ||||
| @Schema(description = "管理后台 - 流程任务的 Done 已完成的分页项 Response VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmTaskDonePageItemRespVO extends BpmTaskTodoPageItemRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "结束时间", required = true) | ||||
|     @Schema(description = "结束时间", required = true) | ||||
|     private LocalDateTime endTime; | ||||
|     @ApiModelProperty(value = "持续时间", required = true, example = "1000") | ||||
|     @Schema(description = "持续时间", required = true, example = "1000") | ||||
|     private Long durationInMillis; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "任务结果", required = true, notes = "参见 bpm_process_instance_result", example = "2") | ||||
|     @Schema(description = "任务结果,参见 bpm_process_instance_result", required = true, example = "2") | ||||
|     private Integer result; | ||||
|     @ApiModelProperty(value = "审批建议", required = true, example = "不请假了!") | ||||
|     @Schema(description = "审批建议", required = true, example = "不请假了!") | ||||
|     private String reason; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,8 +1,8 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
|  | @ -12,21 +12,21 @@ import java.time.LocalDateTime; | |||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程任务的 Done 已办的分页 Request VO") | ||||
| @Schema(description = "管理后台 - 流程任务的 Done 已办的分页 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmTaskDonePageReqVO extends PageParam { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程任务名", example = "芋道") | ||||
|     @Schema(description = "流程任务名", example = "芋道") | ||||
|     private String name; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "开始的创建收间") | ||||
|     @Schema(description = "开始的创建收间") | ||||
|     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||||
|     private LocalDateTime beginCreateTime; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "结束的创建时间") | ||||
|     @Schema(description = "结束的创建时间") | ||||
|     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||||
|     private LocalDateTime endCreateTime; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,21 +1,21 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import javax.validation.constraints.NotEmpty; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 不通过流程任务的 Request VO") | ||||
| @Schema(description = "管理后台 - 不通过流程任务的 Request VO") | ||||
| @Data | ||||
| public class BpmTaskRejectReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "任务编号", required = true, example = "1024") | ||||
|     @Schema(description = "任务编号", required = true, example = "1024") | ||||
|     @NotEmpty(message = "任务编号不能为空") | ||||
|     private String id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "审批意见", required = true, example = "不错不错!") | ||||
|     @Schema(description = "审批意见", required = true, example = "不错不错!") | ||||
|     @NotEmpty(message = "审批意见不能为空") | ||||
|     private String reason; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,18 +1,18 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程任务的 Response VO") | ||||
| @Schema(description = "管理后台 - 流程任务的 Response VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmTaskRespVO extends BpmTaskDonePageItemRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "任务定义的标识", required = true, example = "user-001") | ||||
|     @Schema(description = "任务定义的标识", required = true, example = "user-001") | ||||
|     private String definitionKey; | ||||
| 
 | ||||
|     /** | ||||
|  | @ -20,19 +20,19 @@ public class BpmTaskRespVO extends BpmTaskDonePageItemRespVO { | |||
|      */ | ||||
|     private User assigneeUser; | ||||
| 
 | ||||
|     @ApiModel("用户信息") | ||||
|     @Schema(description = "用户信息") | ||||
|     @Data | ||||
|     public static class User { | ||||
| 
 | ||||
|         @ApiModelProperty(value = "用户编号", required = true, example = "1") | ||||
|         @Schema(description = "用户编号", required = true, example = "1") | ||||
|         private Long id; | ||||
|         @ApiModelProperty(value = "用户昵称", required = true, example = "芋艿") | ||||
|         @Schema(description = "用户昵称", required = true, example = "芋艿") | ||||
|         private String nickname; | ||||
| 
 | ||||
|         @ApiModelProperty(value = "部门编号", required = true, example = "1") | ||||
|         @Schema(description = "部门编号", required = true, example = "1") | ||||
|         private Long deptId; | ||||
|         @ApiModelProperty(value = "部门名称", required = true, example = "研发部") | ||||
|         @Schema(description = "部门名称", required = true, example = "研发部") | ||||
|         private String deptName; | ||||
| 
 | ||||
|     } | ||||
| } | ||||
| } | ||||
|  | @ -1,28 +1,28 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import java.time.LocalDateTime; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程任务的 Running 进行中的分页项 Response VO") | ||||
| @Schema(description = "管理后台 - 流程任务的 Running 进行中的分页项 Response VO") | ||||
| @Data | ||||
| public class BpmTaskTodoPageItemRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "任务编号", required = true, example = "1024") | ||||
|     @Schema(description = "任务编号", required = true, example = "1024") | ||||
|     private String id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "任务名字", required = true, example = "芋道") | ||||
|     @Schema(description = "任务名字", required = true, example = "芋道") | ||||
|     private String name; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "接收时间", required = true) | ||||
|     @Schema(description = "接收时间", required = true) | ||||
|     private LocalDateTime claimTime; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "创建时间", required = true) | ||||
|     @Schema(description = "创建时间", required = true) | ||||
|     private LocalDateTime createTime; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "激活状态", required = true, example = "1", notes = "参见 SuspensionState 枚举") | ||||
|     @Schema(description = "激活状态,参见 SuspensionState 枚举", required = true, example = "1") | ||||
|     private Integer suspensionState; | ||||
| 
 | ||||
|     /** | ||||
|  | @ -31,24 +31,24 @@ public class BpmTaskTodoPageItemRespVO { | |||
|     private ProcessInstance processInstance; | ||||
| 
 | ||||
|     @Data | ||||
|     @ApiModel("流程实例") | ||||
|     @Schema(description = "流程实例") | ||||
|     public static class ProcessInstance { | ||||
| 
 | ||||
|         @ApiModelProperty(value = "流程实例编号", required = true, example = "1024") | ||||
|         @Schema(description = "流程实例编号", required = true, example = "1024") | ||||
|         private String id; | ||||
| 
 | ||||
|         @ApiModelProperty(value = "流程实例名称", required = true, example = "芋道") | ||||
|         @Schema(description = "流程实例名称", required = true, example = "芋道") | ||||
|         private String name; | ||||
| 
 | ||||
|         @ApiModelProperty(value = "发起人的用户编号", required = true, example = "1024") | ||||
|         @Schema(description = "发起人的用户编号", required = true, example = "1024") | ||||
|         private Long startUserId; | ||||
| 
 | ||||
|         @ApiModelProperty(value = "发起人的用户昵称", required = true, example = "芋艿") | ||||
|         @Schema(description = "发起人的用户昵称", required = true, example = "芋艿") | ||||
|         private String startUserNickname; | ||||
| 
 | ||||
|         @ApiModelProperty(value = "流程定义的编号", required = true, example = "2048") | ||||
|         @Schema(description = "流程定义的编号", required = true, example = "2048") | ||||
|         private String processDefinitionId; | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,8 +1,8 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import cn.iocoder.yudao.framework.common.util.date.DateUtils; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
|  | @ -12,17 +12,17 @@ import java.time.LocalDateTime; | |||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程任务的 TODO 待办的分页 Request VO") | ||||
| @Schema(description = "管理后台 - 流程任务的 TODO 待办的分页 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class BpmTaskTodoPageReqVO extends PageParam { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "流程任务名", example = "芋道") | ||||
|     @Schema(description = "流程任务名", example = "芋道") | ||||
|     private String name; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "创建收间") | ||||
|     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||||
|     @Schema(description = "创建时间") | ||||
|     @DateTimeFormat(pattern = DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||||
|     private LocalDateTime[] createTime; | ||||
| 
 | ||||
| } | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
|  | @ -10,16 +10,16 @@ import net.bytebuddy.implementation.bind.annotation.Empty; | |||
| import javax.validation.constraints.NotEmpty; | ||||
| import javax.validation.constraints.NotNull; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 流程任务的更新负责人的 Request VO") | ||||
| @Schema(description = "管理后台 - 流程任务的更新负责人的 Request VO") | ||||
| @Data | ||||
| public class BpmTaskUpdateAssigneeReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "任务编号", required = true, example = "1024") | ||||
|     @Schema(description = "任务编号", required = true, example = "1024") | ||||
|     @NotEmpty(message = "任务编号不能为空") | ||||
|     private String id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "新审批人的用户编号", required = true, example = "2048") | ||||
|     @Schema(description = "新审批人的用户编号", required = true, example = "2048") | ||||
|     @NotNull(message = "新审批人的用户编号不能为空") | ||||
|     private Long assigneeUserId; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,28 +0,0 @@ | |||
| package cn.iocoder.yudao.module.bpm.framework.bpm.config; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.security.config.AuthorizeRequestsCustomizer; | ||||
| import org.springframework.context.annotation.Bean; | ||||
| import org.springframework.context.annotation.Configuration; | ||||
| import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||||
| import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer; | ||||
| 
 | ||||
| /** | ||||
|  * @author kemengkai | ||||
|  * @create 2022-05-07 08:15 | ||||
|  */ | ||||
| @Configuration(proxyBeanMethods = false, value = "bpmSecurityConfiguration") | ||||
| public class BpmSecurityConfiguration { | ||||
| 
 | ||||
|     @Bean("bpmAuthorizeRequestsCustomizer") | ||||
|     public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() { | ||||
|         return new AuthorizeRequestsCustomizer() { | ||||
| 
 | ||||
|             @Override | ||||
|             public void customize(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry) { | ||||
|                 // 任务回退接口
 | ||||
|                 registry.antMatchers(buildAdminApi("/bpm/task/back")).permitAll(); | ||||
|             } | ||||
| 
 | ||||
|         }; | ||||
|     } | ||||
| } | ||||
|  | @ -21,10 +21,8 @@ public class SecurityConfiguration { | |||
|             public void customize(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry) { | ||||
|                 // TODO 芋艿:这个每个项目都需要重复配置,得捉摸有没通用的方案
 | ||||
|                 // Swagger 接口文档
 | ||||
|                 registry.antMatchers("/swagger-ui.html").anonymous() | ||||
|                         .antMatchers("/swagger-resources/**").anonymous() | ||||
|                         .antMatchers("/webjars/**").anonymous() | ||||
|                         .antMatchers("/*/api-docs").anonymous(); | ||||
|                 registry.antMatchers("/v3/api-docs/**").permitAll() // 元数据
 | ||||
|                         .antMatchers("/swagger-ui.html").permitAll(); // Swagger UI
 | ||||
|                 // Druid 监控
 | ||||
|                 registry.antMatchers("/druid/**").anonymous(); | ||||
|                 // Spring Boot Actuator 的安全配置
 | ||||
|  |  | |||
|  | @ -27,6 +27,21 @@ spring: | |||
|     redis: | ||||
|       time-to-live: 1h # 设置过期时间为 1 小时 | ||||
| 
 | ||||
| --- #################### 接口文档配置 #################### | ||||
| 
 | ||||
| springdoc: | ||||
|   api-docs: | ||||
|     enabled: true # 1. 是否开启 Swagger 接文档的元数据 | ||||
|     path: /v3/api-docs | ||||
|   swagger-ui: | ||||
|     enabled: true # 2.1 是否开启 Swagger 文档的官方 UI 界面 | ||||
|     path: /swagger-ui.html | ||||
| 
 | ||||
| knife4j: | ||||
|   enable: true # 2.2 是否开启 Swagger 文档的 Knife4j UI 界面 | ||||
|   setting: | ||||
|     language: zh_cn | ||||
| 
 | ||||
| # 工作流 Flowable 配置 | ||||
| flowable: | ||||
|   # 1. false: 默认值,Flowable 启动时,对比数据库表中保存的版本,如果不匹配。将抛出异常 | ||||
|  |  | |||
|  | @ -24,9 +24,9 @@ | |||
| 
 | ||||
|         <!-- Web 相关 --> | ||||
|         <dependency> | ||||
|             <groupId>io.swagger</groupId> | ||||
|             <groupId>io.swagger.core.v3</groupId> <!-- 接口文档:使用最新版本的 Swagger 模型 --> | ||||
|             <artifactId>swagger-annotations</artifactId> | ||||
|             <optional>true</optional> | ||||
|             <scope>provided</scope> | ||||
|         </dependency> | ||||
| 
 | ||||
|         <!-- 参数校验 --> | ||||
|  |  | |||
|  | @ -3,8 +3,8 @@ package cn.iocoder.yudao.module.infra.api.file; | |||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.module.infra.api.file.dto.FileCreateReqDTO; | ||||
| import cn.iocoder.yudao.module.infra.enums.ApiConstants; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
| import org.springframework.cloud.openfeign.FeignClient; | ||||
| import org.springframework.web.bind.annotation.PostMapping; | ||||
| import org.springframework.web.bind.annotation.RequestBody; | ||||
|  | @ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestParam; | |||
| import javax.validation.Valid; | ||||
| 
 | ||||
| @FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
 | ||||
| @Api(tags = "RPC 服务 - 文件") | ||||
| @Tag(name =  "RPC 服务 - 文件") | ||||
| public interface FileApi { | ||||
| 
 | ||||
|     String PREFIX = ApiConstants.PREFIX + "/file"; | ||||
|  | @ -54,7 +54,7 @@ public interface FileApi { | |||
|     } | ||||
| 
 | ||||
|     @PostMapping(PREFIX + "/create") | ||||
|     @ApiOperation("保存文件,并返回文件的访问路径") | ||||
|     @Operation(summary = "保存文件,并返回文件的访问路径") | ||||
|     CommonResult<String> createFile(@Valid @RequestBody FileCreateReqDTO createReqDTO); | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,23 +1,23 @@ | |||
| package cn.iocoder.yudao.module.infra.api.file.dto; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import javax.validation.constraints.NotEmpty; | ||||
| 
 | ||||
| @ApiModel("RPC 服务 - 文件创建 Request DTO") | ||||
| @Schema(description = "RPC 服务 - 文件创建 Request DTO") | ||||
| @Data | ||||
| public class FileCreateReqDTO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "原文件名称", example = "xxx.png") | ||||
|     @Schema(description = "原文件名称", example = "xxx.png") | ||||
|     private String name; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "文件路径", example = "xxx.png") | ||||
|     @Schema(description = "文件路径", example = "xxx.png") | ||||
|     private String path; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "文件内容", required = true) | ||||
|     @Schema(description = "文件内容", required = true) | ||||
|     @NotEmpty(message = "文件内容不能为空") | ||||
|     private byte[] content; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -3,8 +3,8 @@ package cn.iocoder.yudao.module.infra.api.logger; | |||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.module.infra.api.logger.dto.ApiAccessLogCreateReqDTO; | ||||
| import cn.iocoder.yudao.module.infra.enums.ApiConstants; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
| import org.springframework.cloud.openfeign.FeignClient; | ||||
| import org.springframework.web.bind.annotation.PostMapping; | ||||
| import org.springframework.web.bind.annotation.RequestBody; | ||||
|  | @ -12,13 +12,13 @@ import org.springframework.web.bind.annotation.RequestBody; | |||
| import javax.validation.Valid; | ||||
| 
 | ||||
| @FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
 | ||||
| @Api(tags = "RPC 服务 - API 访问日志") | ||||
| @Tag(name =  "RPC 服务 - API 访问日志") | ||||
| public interface ApiAccessLogApi { | ||||
| 
 | ||||
|     String PREFIX = ApiConstants.PREFIX + "/api-access-log"; | ||||
| 
 | ||||
|     @PostMapping(PREFIX + "/create") | ||||
|     @ApiOperation("创建 API 访问日志") | ||||
|     @Operation(summary = "创建 API 访问日志") | ||||
|     CommonResult<Boolean> createApiAccessLog(@Valid @RequestBody ApiAccessLogCreateReqDTO createDTO); | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -3,8 +3,8 @@ package cn.iocoder.yudao.module.infra.api.logger; | |||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.module.infra.api.logger.dto.ApiErrorLogCreateReqDTO; | ||||
| import cn.iocoder.yudao.module.infra.enums.ApiConstants; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
| import org.springframework.cloud.openfeign.FeignClient; | ||||
| import org.springframework.web.bind.annotation.PostMapping; | ||||
| import org.springframework.web.bind.annotation.RequestBody; | ||||
|  | @ -12,13 +12,13 @@ import org.springframework.web.bind.annotation.RequestBody; | |||
| import javax.validation.Valid; | ||||
| 
 | ||||
| @FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
 | ||||
| @Api(tags = "RPC 服务 - API 异常日志") | ||||
| @Tag(name =  "RPC 服务 - API 异常日志") | ||||
| public interface ApiErrorLogApi { | ||||
| 
 | ||||
|     String PREFIX = ApiConstants.PREFIX + "/api-error-log"; | ||||
| 
 | ||||
|     @PostMapping(PREFIX + "/create") | ||||
|     @ApiOperation("创建 API 异常日志") | ||||
|     @Operation(summary = "创建 API 异常日志") | ||||
|     CommonResult<Boolean> createApiErrorLog(@Valid @RequestBody ApiErrorLogCreateReqDTO createDTO); | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,56 +1,56 @@ | |||
| package cn.iocoder.yudao.module.infra.api.logger.dto; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import javax.validation.constraints.NotNull; | ||||
| import java.time.LocalDateTime; | ||||
| 
 | ||||
| @ApiModel("RPC 服务 - API 访问日志创建 Request DTO") | ||||
| @Schema(description = "RPC 服务 - API 访问日志创建 Request DTO") | ||||
| @Data | ||||
| public class ApiAccessLogCreateReqDTO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "链路追踪编号", example = "89aca178-a370-411c-ae02-3f0d672be4ab") | ||||
|     @Schema(description = "链路追踪编号", example = "89aca178-a370-411c-ae02-3f0d672be4ab") | ||||
|     private String traceId; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "用户编号", required = true, example = "1024") | ||||
|     @Schema(description = "用户编号", required = true, example = "1024") | ||||
|     private Long userId; | ||||
|     @ApiModelProperty(value = "用户类型", required = true, example = "1") | ||||
|     @Schema(description = "用户类型", required = true, example = "1") | ||||
|     private Integer userType; | ||||
|     @ApiModelProperty(value = "应用名", required = true, example = "system-server") | ||||
|     @Schema(description = "应用名", required = true, example = "system-server") | ||||
|     @NotNull(message = "应用名不能为空") | ||||
|     private String applicationName; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "请求方法名", required = true, example = "GET") | ||||
|     @Schema(description = "请求方法名", required = true, example = "GET") | ||||
|     @NotNull(message = "http 请求方法不能为空") | ||||
|     private String requestMethod; | ||||
|     @ApiModelProperty(value = "请求地址", required = true, example = "/xxx/yyy") | ||||
|     @Schema(description = "请求地址", required = true, example = "/xxx/yyy") | ||||
|     @NotNull(message = "访问地址不能为空") | ||||
|     private String requestUrl; | ||||
|     @ApiModelProperty(value = "请求参数", required = true) | ||||
|     @Schema(description = "请求参数", required = true) | ||||
|     @NotNull(message = "请求参数不能为空") | ||||
|     private String requestParams; | ||||
|     @ApiModelProperty(value = "用户 IP", required = true, example = "127.0.0.1") | ||||
|     @Schema(description = "用户 IP", required = true, example = "127.0.0.1") | ||||
|     @NotNull(message = "ip 不能为空") | ||||
|     private String userIp; | ||||
|     @ApiModelProperty(value = "浏览器 UserAgent", required = true, example = "Mozilla/5.0") | ||||
|     @Schema(description = "浏览器 UserAgent", required = true, example = "Mozilla/5.0") | ||||
|     @NotNull(message = "User-Agent 不能为空") | ||||
|     private String userAgent; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "开始时间", required = true) | ||||
|     @Schema(description = "开始时间", required = true) | ||||
|     @NotNull(message = "开始请求时间不能为空") | ||||
|     private LocalDateTime beginTime; | ||||
|     @ApiModelProperty(value = "结束时间", required = true) | ||||
|     @Schema(description = "结束时间", required = true) | ||||
|     @NotNull(message = "结束请求时间不能为空") | ||||
|     private LocalDateTime endTime; | ||||
|     @ApiModelProperty(value = "执行时长,单位:毫秒", required = true) | ||||
|     @Schema(description = "执行时长,单位:毫秒", required = true) | ||||
|     @NotNull(message = "执行时长不能为空") | ||||
|     private Integer duration; | ||||
|     @ApiModelProperty(value = "结果码", required = true) | ||||
|     @Schema(description = "结果码", required = true) | ||||
|     @NotNull(message = "错误码不能为空") | ||||
|     private Integer resultCode; | ||||
|     @ApiModelProperty(value = "结果提示") | ||||
|     @Schema(description = "结果提示") | ||||
|     private String resultMsg; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,69 +1,69 @@ | |||
| package cn.iocoder.yudao.module.infra.api.logger.dto; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import javax.validation.constraints.NotNull; | ||||
| import java.time.LocalDateTime; | ||||
| 
 | ||||
| @ApiModel("RPC 服务 - API 错误日志创建 Request DTO") | ||||
| @Schema(description = "RPC 服务 - API 错误日志创建 Request DTO") | ||||
| @Data | ||||
| public class ApiErrorLogCreateReqDTO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "链路追踪编号", example = "89aca178-a370-411c-ae02-3f0d672be4ab") | ||||
|     @Schema(description = "链路追踪编号", example = "89aca178-a370-411c-ae02-3f0d672be4ab") | ||||
|     private String traceId; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "用户编号", required = true, example = "1024") | ||||
|     @Schema(description = "用户编号", required = true, example = "1024") | ||||
|     private Long userId; | ||||
|     @ApiModelProperty(value = "用户类型", required = true, example = "1") | ||||
|     @Schema(description = "用户类型", required = true, example = "1") | ||||
|     private Integer userType; | ||||
|     @ApiModelProperty(value = "应用名", required = true, example = "system-server") | ||||
|     @Schema(description = "应用名", required = true, example = "system-server") | ||||
|     @NotNull(message = "应用名不能为空") | ||||
|     private String applicationName; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "请求方法名", required = true, example = "GET") | ||||
|     @Schema(description = "请求方法名", required = true, example = "GET") | ||||
|     @NotNull(message = "http 请求方法不能为空") | ||||
|     private String requestMethod; | ||||
|     @ApiModelProperty(value = "请求地址", required = true, example = "/xxx/yyy") | ||||
|     @Schema(description = "请求地址", required = true, example = "/xxx/yyy") | ||||
|     @NotNull(message = "访问地址不能为空") | ||||
|     private String requestUrl; | ||||
|     @ApiModelProperty(value = "请求参数", required = true) | ||||
|     @Schema(description = "请求参数", required = true) | ||||
|     @NotNull(message = "请求参数不能为空") | ||||
|     private String requestParams; | ||||
|     @ApiModelProperty(value = "用户 IP", required = true, example = "127.0.0.1") | ||||
|     @Schema(description = "用户 IP", required = true, example = "127.0.0.1") | ||||
|     @NotNull(message = "ip 不能为空") | ||||
|     private String userIp; | ||||
|     @ApiModelProperty(value = "浏览器 UserAgent", required = true, example = "Mozilla/5.0") | ||||
|     @Schema(description = "浏览器 UserAgent", required = true, example = "Mozilla/5.0") | ||||
|     @NotNull(message = "User-Agent 不能为空") | ||||
|     private String userAgent; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "异常时间", required = true) | ||||
|     @Schema(description = "异常时间", required = true) | ||||
|     @NotNull(message = "异常时间不能为空") | ||||
|     private LocalDateTime exceptionTime; | ||||
|     @ApiModelProperty(value = "异常名", required = true) | ||||
|     @Schema(description = "异常名", required = true) | ||||
|     @NotNull(message = "异常名不能为空") | ||||
|     private String exceptionName; | ||||
|     @ApiModelProperty(value = "异常发生的类全名", required = true) | ||||
|     @Schema(description = "异常发生的类全名", required = true) | ||||
|     @NotNull(message = "异常发生的类全名不能为空") | ||||
|     private String exceptionClassName; | ||||
|     @ApiModelProperty(value = "异常发生的类文件", required = true) | ||||
|     @Schema(description = "异常发生的类文件", required = true) | ||||
|     @NotNull(message = "异常发生的类文件不能为空") | ||||
|     private String exceptionFileName; | ||||
|     @ApiModelProperty(value = "异常发生的方法名", required = true) | ||||
|     @Schema(description = "异常发生的方法名", required = true) | ||||
|     @NotNull(message = "异常发生的方法名不能为空") | ||||
|     private String exceptionMethodName; | ||||
|     @ApiModelProperty(value = "异常发生的方法所在行", required = true) | ||||
|     @Schema(description = "异常发生的方法所在行", required = true) | ||||
|     @NotNull(message = "异常发生的方法所在行不能为空") | ||||
|     private Integer exceptionLineNumber; | ||||
|     @ApiModelProperty(value = "异常的栈轨迹异常的栈轨迹", required = true) | ||||
|     @Schema(description = "异常的栈轨迹异常的栈轨迹", required = true) | ||||
|     @NotNull(message = "异常的栈轨迹不能为空") | ||||
|     private String exceptionStackTrace; | ||||
|     @ApiModelProperty(value = "异常导致的根消息", required = true) | ||||
|     @Schema(description = "异常导致的根消息", required = true) | ||||
|     @NotNull(message = "异常导致的根消息不能为空") | ||||
|     private String exceptionRootCauseMessage; | ||||
|     @ApiModelProperty(value = "异常导致的消息", required = true) | ||||
|     @Schema(description = "异常导致的消息", required = true) | ||||
|     @NotNull(message = "异常导致的消息不能为空") | ||||
|     private String exceptionMessage; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -5,7 +5,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; | |||
| 
 | ||||
| /** | ||||
|  * 项目的启动类 | ||||
|  * | ||||
|  * <p> | ||||
|  * 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
 | ||||
|  * 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
 | ||||
|  * 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
 | ||||
|  |  | |||
|  | @ -16,10 +16,10 @@ import cn.iocoder.yudao.module.infra.convert.codegen.CodegenConvert; | |||
| import cn.iocoder.yudao.module.infra.dal.dataobject.codegen.CodegenColumnDO; | ||||
| import cn.iocoder.yudao.module.infra.dal.dataobject.codegen.CodegenTableDO; | ||||
| import cn.iocoder.yudao.module.infra.service.codegen.CodegenService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||||
| import io.swagger.v3.oas.annotations.Parameter; | ||||
| import io.swagger.v3.oas.annotations.Parameters; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
|  | @ -36,7 +36,7 @@ import java.util.Map; | |||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; | ||||
| 
 | ||||
| @Api(tags = "管理后台 - 代码生成器") | ||||
| @Tag(name =  "管理后台 - 代码生成器") | ||||
| @RestController | ||||
| @RequestMapping("/infra/codegen") | ||||
| @Validated | ||||
|  | @ -46,11 +46,11 @@ public class CodegenController { | |||
|     private CodegenService codegenService; | ||||
| 
 | ||||
|     @GetMapping("/db/table/list") | ||||
|     @ApiOperation(value = "获得数据库自带的表定义列表", notes = "会过滤掉已经导入 Codegen 的表") | ||||
|     @ApiImplicitParams({ | ||||
|             @ApiImplicitParam(name = "dataSourceConfigId", value = "数据源配置的编号", required = true, example = "1", dataTypeClass = Long.class), | ||||
|             @ApiImplicitParam(name = "name", value = "表名,模糊匹配", example = "yudao", dataTypeClass = String.class), | ||||
|             @ApiImplicitParam(name = "comment", value = "描述,模糊匹配", example = "芋道", dataTypeClass = String.class) | ||||
|     @Operation(summary = "获得数据库自带的表定义列表", description = "会过滤掉已经导入 Codegen 的表") | ||||
|     @Parameters({ | ||||
|             @Parameter(name = "dataSourceConfigId", description = "数据源配置的编号", required = true, example = "1"), | ||||
|             @Parameter(name = "name", description = "表名,模糊匹配", example = "yudao"), | ||||
|             @Parameter(name = "comment", description = "描述,模糊匹配", example = "芋道") | ||||
|     }) | ||||
|     @PreAuthorize("@ss.hasPermission('infra:codegen:query')") | ||||
|     public CommonResult<List<DatabaseTableRespVO>> getDatabaseTableList( | ||||
|  | @ -61,7 +61,7 @@ public class CodegenController { | |||
|     } | ||||
| 
 | ||||
|     @GetMapping("/table/page") | ||||
|     @ApiOperation("获得表定义分页") | ||||
|     @Operation(summary = "获得表定义分页") | ||||
|     @PreAuthorize("@ss.hasPermission('infra:codegen:query')") | ||||
|     public CommonResult<PageResult<CodegenTableRespVO>> getCodeGenTablePage(@Valid CodegenTablePageReqVO pageReqVO) { | ||||
|         PageResult<CodegenTableDO> pageResult = codegenService.getCodegenTablePage(pageReqVO); | ||||
|  | @ -69,8 +69,8 @@ public class CodegenController { | |||
|     } | ||||
| 
 | ||||
|     @GetMapping("/detail") | ||||
|     @ApiOperation("获得表和字段的明细") | ||||
|     @ApiImplicitParam(name = "tableId", value = "表编号", required = true, example = "1024", dataTypeClass = Long.class) | ||||
|     @Operation(summary = "获得表和字段的明细") | ||||
|     @Parameter(name = "tableId", description = "表编号", required = true, example = "1024") | ||||
|     @PreAuthorize("@ss.hasPermission('infra:codegen:query')") | ||||
|     public CommonResult<CodegenDetailRespVO> getCodegenDetail(@RequestParam("tableId") Long tableId) { | ||||
|         CodegenTableDO table = codegenService.getCodegenTablePage(tableId); | ||||
|  | @ -79,14 +79,14 @@ public class CodegenController { | |||
|         return success(CodegenConvert.INSTANCE.convert(table, columns)); | ||||
|     } | ||||
| 
 | ||||
|     @ApiOperation("基于数据库的表结构,创建代码生成器的表和字段定义") | ||||
|     @Operation(summary = "基于数据库的表结构,创建代码生成器的表和字段定义") | ||||
|     @PostMapping("/create-list") | ||||
|     @PreAuthorize("@ss.hasPermission('infra:codegen:create')") | ||||
|     public CommonResult<List<Long>> createCodegenList(@Valid @RequestBody CodegenCreateListReqVO reqVO) { | ||||
|         return success(codegenService.createCodegenList(getLoginUserId(), reqVO)); | ||||
|     } | ||||
| 
 | ||||
|     @ApiOperation("更新数据库的表和字段定义") | ||||
|     @Operation(summary = "更新数据库的表和字段定义") | ||||
|     @PutMapping("/update") | ||||
|     @PreAuthorize("@ss.hasPermission('infra:codegen:update')") | ||||
|     public CommonResult<Boolean> updateCodegen(@Valid @RequestBody CodegenUpdateReqVO updateReqVO) { | ||||
|  | @ -94,36 +94,36 @@ public class CodegenController { | |||
|         return success(true); | ||||
|     } | ||||
| 
 | ||||
|     @ApiOperation("基于数据库的表结构,同步数据库的表和字段定义") | ||||
|     @Operation(summary = "基于数据库的表结构,同步数据库的表和字段定义") | ||||
|     @PutMapping("/sync-from-db") | ||||
|     @ApiImplicitParam(name = "tableId", value = "表编号", required = true, example = "1024", dataTypeClass = Long.class) | ||||
|     @Parameter(name = "tableId", description = "表编号", required = true, example = "1024") | ||||
|     @PreAuthorize("@ss.hasPermission('infra:codegen:update')") | ||||
|     public CommonResult<Boolean> syncCodegenFromDB(@RequestParam("tableId") Long tableId) { | ||||
|         codegenService.syncCodegenFromDB(tableId); | ||||
|         return success(true); | ||||
|     } | ||||
| 
 | ||||
|     @ApiOperation("删除数据库的表和字段定义") | ||||
|     @Operation(summary = "删除数据库的表和字段定义") | ||||
|     @DeleteMapping("/delete") | ||||
|     @ApiImplicitParam(name = "tableId", value = "表编号", required = true, example = "1024", dataTypeClass = Long.class) | ||||
|     @Parameter(name = "tableId", description = "表编号", required = true, example = "1024") | ||||
|     @PreAuthorize("@ss.hasPermission('infra:codegen:delete')") | ||||
|     public CommonResult<Boolean> deleteCodegen(@RequestParam("tableId") Long tableId) { | ||||
|         codegenService.deleteCodegen(tableId); | ||||
|         return success(true); | ||||
|     } | ||||
| 
 | ||||
|     @ApiOperation("预览生成代码") | ||||
|     @Operation(summary = "预览生成代码") | ||||
|     @GetMapping("/preview") | ||||
|     @ApiImplicitParam(name = "tableId", value = "表编号", required = true, example = "1024", dataTypeClass = Long.class) | ||||
|     @Parameter(name = "tableId", description = "表编号", required = true, example = "1024") | ||||
|     @PreAuthorize("@ss.hasPermission('infra:codegen:preview')") | ||||
|     public CommonResult<List<CodegenPreviewRespVO>> previewCodegen(@RequestParam("tableId") Long tableId) { | ||||
|         Map<String, String> codes = codegenService.generationCodes(tableId); | ||||
|         return success(CodegenConvert.INSTANCE.convert(codes)); | ||||
|     } | ||||
| 
 | ||||
|     @ApiOperation("下载生成代码") | ||||
|     @Operation(summary = "下载生成代码") | ||||
|     @GetMapping("/download") | ||||
|     @ApiImplicitParam(name = "tableId", value = "表编号", required = true, example = "1024", dataTypeClass = Long.class) | ||||
|     @Parameter(name = "tableId", description = "表编号", required = true, example = "1024") | ||||
|     @PreAuthorize("@ss.hasPermission('infra:codegen:download')") | ||||
|     public void downloadCodegen(@RequestParam("tableId") Long tableId, | ||||
|                                 HttpServletResponse response) throws IOException { | ||||
|  | @ -138,4 +138,4 @@ public class CodegenController { | |||
|         ServletUtils.writeAttachment(response, "codegen.zip", outputStream.toByteArray()); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,22 +1,22 @@ | |||
| package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import javax.validation.constraints.NotNull; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 基于数据库的表结构,创建代码生成器的表和字段定义 Request VO") | ||||
| @Schema(description = "管理后台 - 基于数据库的表结构,创建代码生成器的表和字段定义 Request VO") | ||||
| @Data | ||||
| public class CodegenCreateListReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "数据源配置的编号", required = true, example = "1") | ||||
|     @Schema(description = "数据源配置的编号", required = true, example = "1") | ||||
|     @NotNull(message = "数据源配置的编号不能为空") | ||||
|     private Long dataSourceConfigId; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表名数组", required = true, example = "[1, 2, 3]") | ||||
|     @Schema(description = "表名数组", required = true, example = "[1, 2, 3]") | ||||
|     @NotNull(message = "表名数组不能为空") | ||||
|     private List<String> tableNames; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -2,20 +2,20 @@ package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo; | |||
| 
 | ||||
| import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column.CodegenColumnRespVO; | ||||
| import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table.CodegenTableRespVO; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 代码生成表和字段的明细 Response VO") | ||||
| @Schema(description = "管理后台 - 代码生成表和字段的明细 Response VO") | ||||
| @Data | ||||
| public class CodegenDetailRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty("表定义") | ||||
|     @Schema(description = "表定义") | ||||
|     private CodegenTableRespVO table; | ||||
| 
 | ||||
|     @ApiModelProperty("字段定义") | ||||
|     @Schema(description = "字段定义") | ||||
|     private List<CodegenColumnRespVO> columns; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,17 +1,17 @@ | |||
| package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| @ApiModel(value = "管理后台 - 代码生成预览 Response VO", description ="注意,每个文件都是一个该对象") | ||||
| @Schema(description = "管理后台 - 代码生成预览 Response VO,注意,每个文件都是一个该对象") | ||||
| @Data | ||||
| public class CodegenPreviewRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "文件路径", required = true, example = "java/cn/iocoder/yudao/adminserver/modules/system/controller/test/SysTestDemoController.java") | ||||
|     @Schema(description = "文件路径", required = true, example = "java/cn/iocoder/yudao/adminserver/modules/system/controller/test/SysTestDemoController.java") | ||||
|     private String filePath; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "代码", required = true, example = "Hello World") | ||||
|     @Schema(description = "代码", required = true, example = "Hello World") | ||||
|     private String code; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -4,8 +4,8 @@ import cn.hutool.core.util.ObjectUtil; | |||
| import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column.CodegenColumnBaseVO; | ||||
| import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table.CodegenTableBaseVO; | ||||
| import cn.iocoder.yudao.module.infra.enums.codegen.CodegenSceneEnum; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
|  | @ -15,7 +15,7 @@ import javax.validation.constraints.AssertTrue; | |||
| import javax.validation.constraints.NotNull; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 代码生成表和字段的修改 Request VO") | ||||
| @Schema(description = "管理后台 - 代码生成表和字段的修改 Request VO") | ||||
| @Data | ||||
| public class CodegenUpdateReqVO { | ||||
| 
 | ||||
|  | @ -27,14 +27,14 @@ public class CodegenUpdateReqVO { | |||
|     @NotNull(message = "字段定义不能为空") | ||||
|     private List<Column> columns; | ||||
| 
 | ||||
|     @ApiModel("更新表定义") | ||||
|     @Schema(description = "更新表定义") | ||||
|     @Data | ||||
|     @EqualsAndHashCode(callSuper = true) | ||||
|     @ToString(callSuper = true) | ||||
|     @Valid | ||||
|     public static class Table extends CodegenTableBaseVO { | ||||
| 
 | ||||
|         @ApiModelProperty(value = "编号", required = true, example = "1") | ||||
|         @Schema(description = "编号", required = true, example = "1") | ||||
|         private Long id; | ||||
| 
 | ||||
|         @AssertTrue(message = "上级菜单不能为空") | ||||
|  | @ -46,15 +46,15 @@ public class CodegenUpdateReqVO { | |||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     @ApiModel("更新表定义") | ||||
|     @Schema(description = "更新表定义") | ||||
|     @Data | ||||
|     @EqualsAndHashCode(callSuper = true) | ||||
|     @ToString(callSuper = true) | ||||
|     public static class Column extends CodegenColumnBaseVO { | ||||
| 
 | ||||
|         @ApiModelProperty(value = "编号", required = true, example = "1") | ||||
|         @Schema(description = "编号", required = true, example = "1") | ||||
|         private Long id; | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,6 +1,6 @@ | |||
| package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import javax.validation.constraints.NotNull; | ||||
|  | @ -12,74 +12,74 @@ import javax.validation.constraints.NotNull; | |||
| @Data | ||||
| public class CodegenColumnBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表编号", required = true, example = "1") | ||||
|     @Schema(description = "表编号", required = true, example = "1") | ||||
|     @NotNull(message = "表编号不能为空") | ||||
|     private Long tableId; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "字段名", required = true, example = "user_age") | ||||
|     @Schema(description = "字段名", required = true, example = "user_age") | ||||
|     @NotNull(message = "字段名不能为空") | ||||
|     private String columnName; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "字段类型", required = true, example = "int(11)") | ||||
|     @Schema(description = "字段类型", required = true, example = "int(11)") | ||||
|     @NotNull(message = "字段类型不能为空") | ||||
|     private String dataType; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "字段描述", required = true, example = "年龄") | ||||
|     @Schema(description = "字段描述", required = true, example = "年龄") | ||||
|     @NotNull(message = "字段描述不能为空") | ||||
|     private String columnComment; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "是否允许为空", required = true, example = "true") | ||||
|     @Schema(description = "是否允许为空", required = true, example = "true") | ||||
|     @NotNull(message = "是否允许为空不能为空") | ||||
|     private Boolean nullable; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "是否主键", required = true, example = "false") | ||||
|     @Schema(description = "是否主键", required = true, example = "false") | ||||
|     @NotNull(message = "是否主键不能为空") | ||||
|     private Boolean primaryKey; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "是否自增", required = true, example = "true") | ||||
|     @Schema(description = "是否自增", required = true, example = "true") | ||||
|     @NotNull(message = "是否自增不能为空") | ||||
|     private String autoIncrement; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "排序", required = true, example = "10") | ||||
|     @Schema(description = "排序", required = true, example = "10") | ||||
|     @NotNull(message = "排序不能为空") | ||||
|     private Integer ordinalPosition; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "Java 属性类型", required = true, example = "userAge") | ||||
|     @Schema(description = "Java 属性类型", required = true, example = "userAge") | ||||
|     @NotNull(message = "Java 属性类型不能为空") | ||||
|     private String javaType; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "Java 属性名", required = true, example = "Integer") | ||||
|     @Schema(description = "Java 属性名", required = true, example = "Integer") | ||||
|     @NotNull(message = "Java 属性名不能为空") | ||||
|     private String javaField; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "字典类型", example = "sys_gender") | ||||
|     @Schema(description = "字典类型", example = "sys_gender") | ||||
|     private String dictType; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "数据示例", example = "1024") | ||||
|     @Schema(description = "数据示例", example = "1024") | ||||
|     private String example; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "是否为 Create 创建操作的字段", required = true, example = "true") | ||||
|     @Schema(description = "是否为 Create 创建操作的字段", required = true, example = "true") | ||||
|     @NotNull(message = "是否为 Create 创建操作的字段不能为空") | ||||
|     private Boolean createOperation; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "是否为 Update 更新操作的字段", required = true, example = "false") | ||||
|     @Schema(description = "是否为 Update 更新操作的字段", required = true, example = "false") | ||||
|     @NotNull(message = "是否为 Update 更新操作的字段不能为空") | ||||
|     private Boolean updateOperation; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "是否为 List 查询操作的字段", required = true, example = "true") | ||||
|     @Schema(description = "是否为 List 查询操作的字段", required = true, example = "true") | ||||
|     @NotNull(message = "是否为 List 查询操作的字段不能为空") | ||||
|     private Boolean listOperation; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "List 查询操作的条件类型", required = true, example = "LIKE", notes = "参见 CodegenColumnListConditionEnum 枚举") | ||||
|     @Schema(description = "List 查询操作的条件类型,参见 CodegenColumnListConditionEnum 枚举", required = true, example = "LIKE") | ||||
|     @NotNull(message = "List 查询操作的条件类型不能为空") | ||||
|     private String listOperationCondition; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "是否为 List 查询操作的返回字段", required = true, example = "true") | ||||
|     @Schema(description = "是否为 List 查询操作的返回字段", required = true, example = "true") | ||||
|     @NotNull(message = "是否为 List 查询操作的返回字段不能为空") | ||||
|     private Boolean listOperationResult; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "显示类型", required = true, example = "input") | ||||
|     @Schema(description = "显示类型", required = true, example = "input") | ||||
|     @NotNull(message = "显示类型不能为空") | ||||
|     private String htmlType; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,23 +1,23 @@ | |||
| package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
| 
 | ||||
| import java.time.LocalDateTime; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 代码生成字段定义 Response VO") | ||||
| @Schema(description = "管理后台 - 代码生成字段定义 Response VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class CodegenColumnRespVO extends CodegenColumnBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "编号", required = true, example = "1") | ||||
|     @Schema(description = "编号", required = true, example = "1") | ||||
|     private Long id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "创建时间", required = true) | ||||
|     @Schema(description = "创建时间", required = true) | ||||
|     private LocalDateTime createTime; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,6 +1,6 @@ | |||
| package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import javax.validation.constraints.NotNull; | ||||
|  | @ -12,46 +12,46 @@ import javax.validation.constraints.NotNull; | |||
| @Data | ||||
| public class CodegenTableBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "生成场景", required = true, example = "1", notes = "参见 CodegenSceneEnum 枚举") | ||||
|     @Schema(description = "生成场景,参见 CodegenSceneEnum 枚举", required = true, example = "1") | ||||
|     @NotNull(message = "导入类型不能为空") | ||||
|     private Integer scene; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表名称", required = true, example = "yudao") | ||||
|     @Schema(description = "表名称", required = true, example = "yudao") | ||||
|     @NotNull(message = "表名称不能为空") | ||||
|     private String tableName; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表描述", required = true, example = "芋道") | ||||
|     @Schema(description = "表描述", required = true, example = "芋道") | ||||
|     @NotNull(message = "表描述不能为空") | ||||
|     private String tableComment; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "备注", example = "我是备注") | ||||
|     @Schema(description = "备注", example = "我是备注") | ||||
|     private String remark; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "模块名", required = true, example = "system") | ||||
|     @Schema(description = "模块名", required = true, example = "system") | ||||
|     @NotNull(message = "模块名不能为空") | ||||
|     private String moduleName; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "业务名", required = true, example = "codegen") | ||||
|     @Schema(description = "业务名", required = true, example = "codegen") | ||||
|     @NotNull(message = "业务名不能为空") | ||||
|     private String businessName; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "类名称", required = true, example = "CodegenTable") | ||||
|     @Schema(description = "类名称", required = true, example = "CodegenTable") | ||||
|     @NotNull(message = "类名称不能为空") | ||||
|     private String className; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "类描述", required = true, example = "代码生成器的表定义") | ||||
|     @Schema(description = "类描述", required = true, example = "代码生成器的表定义") | ||||
|     @NotNull(message = "类描述不能为空") | ||||
|     private String classComment; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "作者", required = true, example = "芋道源码") | ||||
|     @Schema(description = "作者", required = true, example = "芋道源码") | ||||
|     @NotNull(message = "作者不能为空") | ||||
|     private String author; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "模板类型", required = true, example = "1", notes = "参见 CodegenTemplateTypeEnum 枚举") | ||||
|     @Schema(description = "模板类型,参见 CodegenTemplateTypeEnum 枚举", required = true, example = "1") | ||||
|     @NotNull(message = "模板类型不能为空") | ||||
|     private Integer templateType; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "父菜单编号", example = "1024") | ||||
|     @Schema(description = "父菜单编号", example = "1024") | ||||
|     private Long parentMenuId; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,8 +1,8 @@ | |||
| package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
|  | @ -12,20 +12,20 @@ import java.time.LocalDateTime; | |||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 表定义分页 Request VO") | ||||
| @Schema(description = "管理后台 - 表定义分页 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class CodegenTablePageReqVO extends PageParam { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表名称", example = "yudao", notes = "模糊匹配") | ||||
|     @Schema(description = "表名称,模糊匹配", example = "yudao") | ||||
|     private String tableName; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表描述", example = "芋道", notes = "模糊匹配") | ||||
|     @Schema(description = "表描述,模糊匹配", example = "芋道") | ||||
|     private String tableComment; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "创建时间", example = "[2022-07-01 00:00:00, 2022-07-01 23:59:59]") | ||||
|     @Schema(description = "创建时间", example = "[2022-07-01 00:00:00, 2022-07-01 23:59:59]") | ||||
|     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||||
|     private LocalDateTime[] createTime; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,29 +1,29 @@ | |||
| package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
| 
 | ||||
| import java.time.LocalDateTime; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 代码生成表定义 Response VO") | ||||
| @Schema(description = "管理后台 - 代码生成表定义 Response VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class CodegenTableRespVO extends CodegenTableBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "编号", required = true, example = "1") | ||||
|     @Schema(description = "编号", required = true, example = "1") | ||||
|     private Long id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "主键编号", required = true, example = "1024") | ||||
|     @Schema(description = "主键编号", required = true, example = "1024") | ||||
|     private Integer dataSourceConfigId; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "创建时间", required = true) | ||||
|     @Schema(description = "创建时间", required = true) | ||||
|     private LocalDateTime createTime; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "更新时间", required = true) | ||||
|     @Schema(description = "更新时间", required = true) | ||||
|     private LocalDateTime updateTime; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,17 +1,17 @@ | |||
| package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 数据库的表定义 Response VO") | ||||
| @Schema(description = "管理后台 - 数据库的表定义 Response VO") | ||||
| @Data | ||||
| public class DatabaseTableRespVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表名称", required = true, example = "yuanma") | ||||
|     @Schema(description = "表名称", required = true, example = "yuanma") | ||||
|     private String name; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "表描述", required = true, example = "芋道源码") | ||||
|     @Schema(description = "表描述", required = true, example = "芋道源码") | ||||
|     private String comment; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -9,9 +9,9 @@ import cn.iocoder.yudao.module.infra.convert.config.ConfigConvert; | |||
| import cn.iocoder.yudao.module.infra.dal.dataobject.config.ConfigDO; | ||||
| import cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants; | ||||
| import cn.iocoder.yudao.module.infra.service.config.ConfigService; | ||||
| import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiOperation; | ||||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||||
| import io.swagger.v3.oas.annotations.Parameter; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
|  | @ -26,7 +26,7 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU | |||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; | ||||
| 
 | ||||
| @Api(tags = "管理后台 - 参数配置") | ||||
| @Tag(name =  "管理后台 - 参数配置") | ||||
| @RestController | ||||
| @RequestMapping("/infra/config") | ||||
| @Validated | ||||
|  | @ -36,14 +36,14 @@ public class ConfigController { | |||
|     private ConfigService configService; | ||||
| 
 | ||||
|     @PostMapping("/create") | ||||
|     @ApiOperation("创建参数配置") | ||||
|     @Operation(summary = "创建参数配置") | ||||
|     @PreAuthorize("@ss.hasPermission('infra:config:create')") | ||||
|     public CommonResult<Long> createConfig(@Valid @RequestBody ConfigCreateReqVO reqVO) { | ||||
|         return success(configService.createConfig(reqVO)); | ||||
|     } | ||||
| 
 | ||||
|     @PutMapping("/update") | ||||
|     @ApiOperation("修改参数配置") | ||||
|     @Operation(summary = "修改参数配置") | ||||
|     @PreAuthorize("@ss.hasPermission('infra:config:update')") | ||||
|     public CommonResult<Boolean> updateConfig(@Valid @RequestBody ConfigUpdateReqVO reqVO) { | ||||
|         configService.updateConfig(reqVO); | ||||
|  | @ -51,8 +51,8 @@ public class ConfigController { | |||
|     } | ||||
| 
 | ||||
|     @DeleteMapping("/delete") | ||||
|     @ApiOperation("删除参数配置") | ||||
|     @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | ||||
|     @Operation(summary = "删除参数配置") | ||||
|     @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||||
|     @PreAuthorize("@ss.hasPermission('infra:config:delete')") | ||||
|     public CommonResult<Boolean> deleteConfig(@RequestParam("id") Long id) { | ||||
|         configService.deleteConfig(id); | ||||
|  | @ -60,16 +60,16 @@ public class ConfigController { | |||
|     } | ||||
| 
 | ||||
|     @GetMapping(value = "/get") | ||||
|     @ApiOperation("获得参数配置") | ||||
|     @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | ||||
|     @Operation(summary = "获得参数配置") | ||||
|     @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||||
|     @PreAuthorize("@ss.hasPermission('infra:config:query')") | ||||
|     public CommonResult<ConfigRespVO> getConfig(@RequestParam("id") Long id) { | ||||
|         return success(ConfigConvert.INSTANCE.convert(configService.getConfig(id))); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping(value = "/get-value-by-key") | ||||
|     @ApiOperation(value = "根据参数键名查询参数值", notes = "不可见的配置,不允许返回给前端") | ||||
|     @ApiImplicitParam(name = "key", value = "参数键", required = true, example = "yunai.biz.username", dataTypeClass = String.class) | ||||
|     @Operation(summary = "根据参数键名查询参数值", description = "不可见的配置,不允许返回给前端") | ||||
|     @Parameter(name = "key", description = "参数键", required = true, example = "yunai.biz.username") | ||||
|     public CommonResult<String> getConfigKey(@RequestParam("key") String key) { | ||||
|         ConfigDO config = configService.getConfigByKey(key); | ||||
|         if (config == null) { | ||||
|  | @ -82,7 +82,7 @@ public class ConfigController { | |||
|     } | ||||
| 
 | ||||
|     @GetMapping("/page") | ||||
|     @ApiOperation("获取参数配置分页") | ||||
|     @Operation(summary = "获取参数配置分页") | ||||
|     @PreAuthorize("@ss.hasPermission('infra:config:query')") | ||||
|     public CommonResult<PageResult<ConfigRespVO>> getConfigPage(@Valid ConfigPageReqVO reqVO) { | ||||
|         PageResult<ConfigDO> page = configService.getConfigPage(reqVO); | ||||
|  | @ -90,7 +90,7 @@ public class ConfigController { | |||
|     } | ||||
| 
 | ||||
|     @GetMapping("/export") | ||||
|     @ApiOperation("导出参数配置") | ||||
|     @Operation(summary = "导出参数配置") | ||||
|     @PreAuthorize("@ss.hasPermission('infra:config:export')") | ||||
|     @OperateLog(type = EXPORT) | ||||
|     public void exportConfig(@Valid ConfigExportReqVO reqVO, | ||||
|  | @ -102,4 +102,4 @@ public class ConfigController { | |||
|         ExcelUtils.write(response, "参数配置.xls", "数据", ConfigExcelVO.class, datas); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,6 +1,6 @@ | |||
| package cn.iocoder.yudao.module.infra.controller.admin.config.vo; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import javax.validation.constraints.NotBlank; | ||||
|  | @ -15,26 +15,26 @@ import javax.validation.constraints.Size; | |||
| @Data | ||||
| public class ConfigBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "参数分组", required = true, example = "biz") | ||||
|     @Schema(description = "参数分组", required = true, example = "biz") | ||||
|     @NotEmpty(message = "参数分组不能为空") | ||||
|     @Size(max = 50, message = "参数名称不能超过50个字符") | ||||
|     private String category; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "参数名称", required = true, example = "数据库名") | ||||
|     @Schema(description = "参数名称", required = true, example = "数据库名") | ||||
|     @NotBlank(message = "参数名称不能为空") | ||||
|     @Size(max = 100, message = "参数名称不能超过100个字符") | ||||
|     private String name; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "参数键值", required = true, example = "1024") | ||||
|     @Schema(description = "参数键值", required = true, example = "1024") | ||||
|     @NotBlank(message = "参数键值不能为空") | ||||
|     @Size(max = 500, message = "参数键值长度不能超过500个字符") | ||||
|     private String value; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "是否敏感", required = true, example = "true") | ||||
|     @Schema(description = "是否敏感", required = true, example = "true") | ||||
|     @NotNull(message = "是否敏感不能为空") | ||||
|     private Boolean visible; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "备注", example = "备注一下很帅气!") | ||||
|     @Schema(description = "备注", example = "备注一下很帅气!") | ||||
|     private String remark; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,21 +1,21 @@ | |||
| package cn.iocoder.yudao.module.infra.controller.admin.config.vo; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| 
 | ||||
| import javax.validation.constraints.NotBlank; | ||||
| import javax.validation.constraints.Size; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 参数配置创建 Request VO") | ||||
| @Schema(description = "管理后台 - 参数配置创建 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class ConfigCreateReqVO extends ConfigBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "参数键名", required = true, example = "yunai.db.username") | ||||
|     @Schema(description = "参数键名", required = true, example = "yunai.db.username") | ||||
|     @NotBlank(message = "参数键名长度不能为空") | ||||
|     @Size(max = 100, message = "参数键名长度不能超过100个字符") | ||||
|     private String key; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,7 +1,7 @@ | |||
| package cn.iocoder.yudao.module.infra.controller.admin.config.vo; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import org.springframework.format.annotation.DateTimeFormat; | ||||
| 
 | ||||
|  | @ -9,21 +9,21 @@ import java.time.LocalDateTime; | |||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 参数配置导出 Request VO") | ||||
| @Schema(description = "管理后台 - 参数配置导出 Request VO") | ||||
| @Data | ||||
| public class ConfigExportReqVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "参数名称", example = "模糊匹配") | ||||
|     @Schema(description = "参数名称", example = "模糊匹配") | ||||
|     private String name; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "参数键名", example = "yunai.db.username", notes = "模糊匹配") | ||||
|     @Schema(description = "参数键名,模糊匹配", example = "yunai.db.username") | ||||
|     private String key; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "参数类型", example = "1", notes = "参见 SysConfigTypeEnum 枚举") | ||||
|     @Schema(description = "参数类型,参见 SysConfigTypeEnum 枚举", example = "1") | ||||
|     private Integer type; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") | ||||
|     @Schema(description = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") | ||||
|     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||||
|     private LocalDateTime[] createTime; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,8 +1,8 @@ | |||
| package cn.iocoder.yudao.module.infra.controller.admin.config.vo; | ||||
| 
 | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
|  | @ -12,23 +12,23 @@ import java.time.LocalDateTime; | |||
| 
 | ||||
| import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 参数配置分页 Request VO") | ||||
| @Schema(description = "管理后台 - 参数配置分页 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class ConfigPageReqVO extends PageParam { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "数据源名称", example = "模糊匹配") | ||||
|     @Schema(description = "数据源名称", example = "模糊匹配") | ||||
|     private String name; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "参数键名", example = "yunai.db.username", notes = "模糊匹配") | ||||
|     @Schema(description = "参数键名,模糊匹配", example = "yunai.db.username") | ||||
|     private String key; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "参数类型", example = "1", notes = "参见 SysConfigTypeEnum 枚举") | ||||
|     @Schema(description = "参数类型,参见 SysConfigTypeEnum 枚举", example = "1") | ||||
|     private Integer type; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") | ||||
|     @Schema(description = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") | ||||
|     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||||
|     private LocalDateTime[] createTime; | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | @ -1,7 +1,7 @@ | |||
| package cn.iocoder.yudao.module.infra.controller.admin.config.vo; | ||||
| 
 | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| 
 | ||||
|  | @ -9,23 +9,23 @@ import javax.validation.constraints.NotBlank; | |||
| import javax.validation.constraints.Size; | ||||
| import java.time.LocalDateTime; | ||||
| 
 | ||||
| @ApiModel("管理后台 - 参数配置信息 Response VO") | ||||
| @Schema(description = "管理后台 - 参数配置信息 Response VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| public class ConfigRespVO extends ConfigBaseVO { | ||||
| 
 | ||||
|     @ApiModelProperty(value = "参数配置序号", required = true, example = "1024") | ||||
|     @Schema(description = "参数配置序号", required = true, example = "1024") | ||||
|     private Long id; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "参数键名", required = true, example = "yunai.db.username") | ||||
|     @Schema(description = "参数键名", required = true, example = "yunai.db.username") | ||||
|     @NotBlank(message = "参数键名长度不能为空") | ||||
|     @Size(max = 100, message = "参数键名长度不能超过100个字符") | ||||
|     private String key; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "参数类型", required = true, example = "1", notes = "参见 SysConfigTypeEnum 枚举") | ||||
|     @Schema(description = "参数类型,参见 SysConfigTypeEnum 枚举", required = true, example = "1") | ||||
|     private Integer type; | ||||
| 
 | ||||
|     @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") | ||||
|     @Schema(description = "创建时间", required = true, example = "时间戳格式") | ||||
|     private LocalDateTime createTime; | ||||
| 
 | ||||
| } | ||||
| } | ||||
Some files were not shown because too many files have changed in this diff Show More
		Loading…
	
		Reference in New Issue
	
	 芋道源码
						芋道源码