feat: 修改部分 swagger 注解

pull/25/head
gaibu 2023-02-04 00:19:40 +08:00
parent 695014a6d1
commit 6f3e026f4c
337 changed files with 3024 additions and 2971 deletions

View File

@ -1,8 +1,8 @@
package cn.iocoder.yudao.framework.operatelog.core.annotations; package cn.iocoder.yudao.framework.operatelog.core.annotations;
import cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum; import cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.Operation;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;

View File

@ -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.operatelog.core.service.OperateLogFrameworkService;
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Around;
@ -71,15 +71,15 @@ public class OperateLogAspect {
@Resource @Resource
private OperateLogFrameworkService operateLogFrameworkService; private OperateLogFrameworkService operateLogFrameworkService;
@Around("@annotation(apiOperation)") @Around("@annotation(operation)")
public Object around(ProceedingJoinPoint joinPoint, ApiOperation apiOperation) throws Throwable { public Object around(ProceedingJoinPoint joinPoint, Operation operation) throws Throwable {
// 可能也添加了 @ApiOperation 注解 // 可能也添加了 @ApiOperation 注解
cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog = getMethodAnnotation(joinPoint, cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog = getMethodAnnotation(joinPoint,
cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog.class); 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 注解的情况 // 兼容处理,只添加 @OperateLog 注解的情况
public Object around(ProceedingJoinPoint joinPoint, public Object around(ProceedingJoinPoint joinPoint,
cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog) throws Throwable { cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog) throws Throwable {
@ -88,7 +88,7 @@ public class OperateLogAspect {
private Object around0(ProceedingJoinPoint joinPoint, private Object around0(ProceedingJoinPoint joinPoint,
cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog,
ApiOperation apiOperation) throws Throwable { Operation operation) throws Throwable {
// 目前,只有管理员,才记录操作日志!所以非管理员,直接调用,不进行记录 // 目前,只有管理员,才记录操作日志!所以非管理员,直接调用,不进行记录
Integer userType = WebFrameworkUtils.getLoginUserType(); Integer userType = WebFrameworkUtils.getLoginUserType();
if (!Objects.equals(userType, UserTypeEnum.ADMIN.getValue())) { if (!Objects.equals(userType, UserTypeEnum.ADMIN.getValue())) {
@ -101,10 +101,10 @@ public class OperateLogAspect {
// 执行原有方法 // 执行原有方法
Object result = joinPoint.proceed(); Object result = joinPoint.proceed();
// 记录正常执行时的操作日志 // 记录正常执行时的操作日志
this.log(joinPoint, operateLog, apiOperation, startTime, result, null); this.log(joinPoint, operateLog, operation, startTime, result, null);
return result; return result;
} catch (Throwable exception) { } catch (Throwable exception) {
this.log(joinPoint, operateLog, apiOperation, startTime, null, exception); this.log(joinPoint, operateLog, operation, startTime, null, exception);
throw exception; throw exception;
} finally { } finally {
clearThreadLocal(); clearThreadLocal();
@ -129,7 +129,7 @@ public class OperateLogAspect {
private void log(ProceedingJoinPoint joinPoint, private void log(ProceedingJoinPoint joinPoint,
cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog,
ApiOperation apiOperation, Operation operation,
LocalDateTime startTime, Object result, Throwable exception) { LocalDateTime startTime, Object result, Throwable exception) {
try { try {
// 判断不记录的情况 // 判断不记录的情况
@ -137,16 +137,16 @@ public class OperateLogAspect {
return; return;
} }
// 真正记录操作日志 // 真正记录操作日志
this.log0(joinPoint, operateLog, apiOperation, startTime, result, exception); this.log0(joinPoint, operateLog, operation, startTime, result, exception);
} catch (Throwable ex) { } catch (Throwable ex) {
log.error("[log][记录操作日志时,发生异常,其中参数是 joinPoint({}) operateLog({}) apiOperation({}) result({}) exception({}) ]", 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, private void log0(ProceedingJoinPoint joinPoint,
cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog,
ApiOperation apiOperation, Operation operation,
LocalDateTime startTime, Object result, Throwable exception) { LocalDateTime startTime, Object result, Throwable exception) {
OperateLog operateLogObj = new OperateLog(); OperateLog operateLogObj = new OperateLog();
// 补全通用字段 // 补全通用字段
@ -155,7 +155,7 @@ public class OperateLogAspect {
// 补充用户信息 // 补充用户信息
fillUserFields(operateLogObj); fillUserFields(operateLogObj);
// 补全模块信息 // 补全模块信息
fillModuleFields(operateLogObj, joinPoint, operateLog, apiOperation); fillModuleFields(operateLogObj, joinPoint, operateLog, operation);
// 补全请求信息 // 补全请求信息
fillRequestFields(operateLogObj); fillRequestFields(operateLogObj);
// 补全方法信息 // 补全方法信息
@ -173,21 +173,21 @@ public class OperateLogAspect {
private static void fillModuleFields(OperateLog operateLogObj, private static void fillModuleFields(OperateLog operateLogObj,
ProceedingJoinPoint joinPoint, ProceedingJoinPoint joinPoint,
cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog,
ApiOperation apiOperation) { Operation operation) {
// module 属性 // module 属性
if (operateLog != null) { if (operateLog != null) {
operateLogObj.setModule(operateLog.module()); operateLogObj.setModule(operateLog.module());
} }
if (StrUtil.isEmpty(operateLogObj.getModule())) { if (StrUtil.isEmpty(operateLogObj.getModule())) {
Api api = getClassAnnotation(joinPoint, Api.class); Tag tag = getClassAnnotation(joinPoint, Tag.class);
if (api != null) { if (tag != null) {
// 优先读取 @API 的 name 属性 // 优先读取 @Tag 的 name 属性
if (StrUtil.isNotEmpty(api.value())) { if (StrUtil.isNotEmpty(tag.name())) {
operateLogObj.setModule(api.value()); operateLogObj.setModule(tag.name());
} }
// 没有的话,读取 @API 的 tags 属性 // 没有的话,读取 @API 的 description 属性
if (StrUtil.isEmpty(operateLogObj.getModule()) && ArrayUtil.isNotEmpty(api.tags())) { if (StrUtil.isEmpty(operateLogObj.getModule()) && ArrayUtil.isNotEmpty(tag.description())) {
operateLogObj.setModule(api.tags()[0]); operateLogObj.setModule(tag.description());
} }
} }
} }
@ -195,8 +195,8 @@ public class OperateLogAspect {
if (operateLog != null) { if (operateLog != null) {
operateLogObj.setName(operateLog.name()); operateLogObj.setName(operateLog.name());
} }
if (StrUtil.isEmpty(operateLogObj.getName()) && apiOperation != null) { if (StrUtil.isEmpty(operateLogObj.getName()) && operation != null) {
operateLogObj.setName(apiOperation.value()); operateLogObj.setName(operation.description());
} }
// type 属性 // type 属性
if (operateLog != null && ArrayUtil.isNotEmpty(operateLog.type())) { if (operateLog != null && ArrayUtil.isNotEmpty(operateLog.type())) {

View File

@ -35,9 +35,26 @@ public class SwaggerProperties {
@NotEmpty(message = "版本不能为空") @NotEmpty(message = "版本不能为空")
private String version; private String version;
/** /**
* * url
*/ */
@NotEmpty(message = "扫描的 package 不能为空") @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;
} }

View File

@ -1,126 +1,155 @@
package cn.iocoder.yudao.framework.swagger.config; package cn.iocoder.yudao.framework.swagger.config;
import cn.iocoder.yudao.framework.swagger.core.SpringFoxHandlerProviderBeanPostProcessor; import io.swagger.v3.oas.models.Components;
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j; 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.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.http.HttpHeaders; 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.HashMap;
import java.util.Collections;
import java.util.List; 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 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 * @author
*/ */
@AutoConfiguration @AutoConfiguration
@EnableSwagger2WebMvc @ConditionalOnClass({OpenAPI.class})
@EnableKnife4j
@ConditionalOnClass({Docket.class, ApiInfoBuilder.class})
// 允许使用 swagger.enable=false 禁用 Swagger
@ConditionalOnProperty(prefix = "yudao.swagger", value = "enable", matchIfMissing = true)
@EnableConfigurationProperties(SwaggerProperties.class) @EnableConfigurationProperties(SwaggerProperties.class)
@ConditionalOnProperty(prefix = "springdoc.api-docs", name = "enabled", havingValue = "true", matchIfMissing = true) // 设置为 false 时,禁用
public class YudaoSwaggerAutoConfiguration { public class YudaoSwaggerAutoConfiguration {
@Bean // ========== 全局 OpenAPI 配置 ==========
public SpringFoxHandlerProviderBeanPostProcessor springFoxHandlerProviderBeanPostProcessor() {
return new SpringFoxHandlerProviderBeanPostProcessor();
}
@Bean @Bean
public Docket createRestApi(SwaggerProperties properties) { public OpenAPI createApi(SwaggerProperties properties) {
// 创建 Docket 对象 Map<String, SecurityScheme> securitySchemas = buildSecuritySchemes();
return new Docket(DocumentationType.SWAGGER_2) OpenAPI openAPI = new OpenAPI()
// ① 用来创建该 API 的基本信息,展示在文档的页面中(自定义展示的信息) // 接口信息
.apiInfo(apiInfo(properties)) .info(buildInfo(properties))
// ② 设置扫描指定 package 包下的 // 接口安全配置
.select() .components(new Components().securitySchemes(securitySchemas))
.apis(basePackage(properties.getBasePackage())) .addSecurityItem(new SecurityRequirement().addList(HttpHeaders.AUTHORIZATION));
// .apis(basePackage("cn.iocoder.yudao.module.system")) // 可用于 swagger 无法展示时使用 securitySchemas.keySet().forEach(key -> openAPI.addSecurityItem(new SecurityRequirement().addList(key)));
.paths(PathSelectors.any()) return openAPI;
.build()
// ③ 安全上下文(认证)
.securitySchemes(securitySchemes())
.securityContexts(securityContexts())
// ④ 全局参数(多租户 header
.globalOperationParameters(globalRequestParameters());
} }
// ========== apiInfo ==========
/** /**
* API * API
*/ */
private static ApiInfo apiInfo(SwaggerProperties properties) { private Info buildInfo(SwaggerProperties properties) {
return new ApiInfoBuilder() return new Info()
.title(properties.getTitle()) .title(properties.getTitle())
.description(properties.getDescription()) .description(properties.getDescription())
.contact(new Contact(properties.getAuthor(), null, null))
.version(properties.getVersion()) .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 * Authorization token
*/ */
private static List<SecurityScheme> securitySchemes() { private Map<String, SecurityScheme> buildSecuritySchemes() {
return Collections.singletonList(new ApiKey(HttpHeaders.AUTHORIZATION, "Authorization", "header")); 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;
} }
/** /**
* * OpenAPI
*
* @see #securitySchemes()
* @see #authorizationScopes()
*/ */
private static List<SecurityContext> securityContexts() { @Bean
return Collections.singletonList(SecurityContext.builder() public OpenAPIService openApiBuilder(Optional<OpenAPI> openAPI,
.securityReferences(securityReferences()) SecurityService securityParser,
// 通过 PathSelectors.regex("^(?!auth).*$"),排除包含 "auth" 的接口不需要使用securitySchemes SpringDocConfigProperties springDocConfigProperties,
.forPaths(PathSelectors.regex("^(?!auth).*$")) PropertyResolverUtils propertyResolverUtils,
.build()); 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() { // ========== 分组 OpenAPI 配置 ==========
return Collections.singletonList(new SecurityReference(HttpHeaders.AUTHORIZATION, authorizationScopes()));
/**
* API
*/
@Bean
public GroupedOpenApi allGroupedOpenApi() {
return buildGroupedOpenApi("all", "");
} }
private static AuthorizationScope[] authorizationScopes() { public static GroupedOpenApi buildGroupedOpenApi(String group) {
return new AuthorizationScope[]{new AuthorizationScope("global", "accessEverything")}; 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<>(); * Tenant
tenantParameter.add(new ParameterBuilder() *
.name(HEADER_TENANT_ID) * @return
.description("租户编号") */
.modelRef(new ModelRef("long")) private static Parameter buildTenantHeaderParameter() {
.defaultValue("1") return new Parameter()
.parameterType("header") .name(HEADER_TENANT_ID) // header 名
.required(true) .description("租户编号") // 描述
.build()); .in(String.valueOf(SecurityScheme.In.HEADER)) // 请求 header
return tenantParameter; .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
} }
} }

View File

@ -1,42 +1,42 @@
package cn.iocoder.yudao.framework.swagger.core; //package cn.iocoder.yudao.framework.swagger.core;
//
import cn.hutool.core.util.ReflectUtil; //import cn.hutool.core.util.ReflectUtil;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; //import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import org.springframework.beans.BeansException; //import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor; //import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping; //import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping;
import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider; //import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider;
//
import java.util.List; //import java.util.List;
//
/** ///**
* SpringFox SpringBoot 2.6.x // * 解决 SpringFox 与 SpringBoot 2.6.x 不兼容的问题
* issue https://github.com/springfox/springfox/issues/3462 // * 该问题对应的 issue 为 https://github.com/springfox/springfox/issues/3462
* // *
* @author // * @author 芋道源码
*/ // */
public class SpringFoxHandlerProviderBeanPostProcessor implements BeanPostProcessor { //public class SpringFoxHandlerProviderBeanPostProcessor implements BeanPostProcessor {
//
@Override // @Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { // public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
if (bean instanceof WebMvcRequestHandlerProvider) { // if (bean instanceof WebMvcRequestHandlerProvider) {
customizeSpringfoxHandlerMappings(getHandlerMappings(bean)); // customizeSpringfoxHandlerMappings(getHandlerMappings(bean));
} // }
return bean; // return bean;
} // }
//
private <T extends RequestMappingInfoHandlerMapping> void customizeSpringfoxHandlerMappings(List<T> mappings) { // private <T extends RequestMappingInfoHandlerMapping> void customizeSpringfoxHandlerMappings(List<T> mappings) {
// 移除,只保留 patternParser // // 移除,只保留 patternParser
List<T> copy = CollectionUtils.filterList(mappings, mapping -> mapping.getPatternParser() == null); // List<T> copy = CollectionUtils.filterList(mappings, mapping -> mapping.getPatternParser() == null);
// 添加到 mappings 中 // // 添加到 mappings 中
mappings.clear(); // mappings.clear();
mappings.addAll(copy); // mappings.addAll(copy);
} // }
//
@SuppressWarnings("unchecked") // @SuppressWarnings("unchecked")
private List<RequestMappingInfoHandlerMapping> getHandlerMappings(Object bean) { // private List<RequestMappingInfoHandlerMapping> getHandlerMappings(Object bean) {
return (List<RequestMappingInfoHandlerMapping>) // return (List<RequestMappingInfoHandlerMapping>)
ReflectUtil.getFieldValue(bean, "handlerMappings"); // ReflectUtil.getFieldValue(bean, "handlerMappings");
} // }
//
} //}

View File

@ -1,5 +1,6 @@
cn.iocoder.yudao.framework.apilog.config.YudaoApiLogRpcAutoConfiguration
cn.iocoder.yudao.framework.apilog.config.YudaoApiLogAutoConfiguration cn.iocoder.yudao.framework.apilog.config.YudaoApiLogAutoConfiguration
cn.iocoder.yudao.framework.jackson.config.YudaoJacksonAutoConfiguration cn.iocoder.yudao.framework.jackson.config.YudaoJacksonAutoConfiguration
com.github.xiaoymin.knife4j.spring.configuration.Knife4jAutoConfiguration
cn.iocoder.yudao.framework.swagger.config.YudaoSwaggerAutoConfiguration cn.iocoder.yudao.framework.swagger.config.YudaoSwaggerAutoConfiguration
cn.iocoder.yudao.framework.web.config.YudaoWebAutoConfiguration cn.iocoder.yudao.framework.web.config.YudaoWebAutoConfiguration
cn.iocoder.yudao.framework.xss.config.YudaoXssAutoConfiguration

View File

@ -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.module.bpm.service.definition.BpmFormService;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.Operation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; 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.common.pojo.CommonResult.success;
@Api(tags = "管理后台 - 动态表单") @Tag(name = "管理后台 - 动态表单")
@RestController @RestController
@RequestMapping("/bpm/form") @RequestMapping("/bpm/form")
@Validated @Validated
@ -29,14 +29,14 @@ public class BpmFormController {
private BpmFormService formService; private BpmFormService formService;
@PostMapping("/create") @PostMapping("/create")
@ApiOperation("创建动态表单") @Operation(summary = "创建动态表单")
@PreAuthorize("@ss.hasPermission('bpm:form:create')") @PreAuthorize("@ss.hasPermission('bpm:form:create')")
public CommonResult<Long> createForm(@Valid @RequestBody BpmFormCreateReqVO createReqVO) { public CommonResult<Long> createForm(@Valid @RequestBody BpmFormCreateReqVO createReqVO) {
return success(formService.createForm(createReqVO)); return success(formService.createForm(createReqVO));
} }
@PutMapping("/update") @PutMapping("/update")
@ApiOperation("更新动态表单") @Operation(summary = "更新动态表单")
@PreAuthorize("@ss.hasPermission('bpm:form:update')") @PreAuthorize("@ss.hasPermission('bpm:form:update')")
public CommonResult<Boolean> updateForm(@Valid @RequestBody BpmFormUpdateReqVO updateReqVO) { public CommonResult<Boolean> updateForm(@Valid @RequestBody BpmFormUpdateReqVO updateReqVO) {
formService.updateForm(updateReqVO); formService.updateForm(updateReqVO);
@ -44,8 +44,8 @@ public class BpmFormController {
} }
@DeleteMapping("/delete") @DeleteMapping("/delete")
@ApiOperation("删除动态表单") @Operation(summary = "删除动态表单")
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) @Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('bpm:form:delete')") @PreAuthorize("@ss.hasPermission('bpm:form:delete')")
public CommonResult<Boolean> deleteForm(@RequestParam("id") Long id) { public CommonResult<Boolean> deleteForm(@RequestParam("id") Long id) {
formService.deleteForm(id); formService.deleteForm(id);
@ -53,8 +53,8 @@ public class BpmFormController {
} }
@GetMapping("/get") @GetMapping("/get")
@ApiOperation("获得动态表单") @Operation(summary = "获得动态表单")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('bpm:form:query')") @PreAuthorize("@ss.hasPermission('bpm:form:query')")
public CommonResult<BpmFormRespVO> getForm(@RequestParam("id") Long id) { public CommonResult<BpmFormRespVO> getForm(@RequestParam("id") Long id) {
BpmFormDO form = formService.getForm(id); BpmFormDO form = formService.getForm(id);
@ -62,14 +62,14 @@ public class BpmFormController {
} }
@GetMapping("/list-all-simple") @GetMapping("/list-all-simple")
@ApiOperation(value = "获得动态表单的精简列表", notes = "用于表单下拉框") @Operation(summary = "获得动态表单的精简列表", description = "用于表单下拉框")
public CommonResult<List<BpmFormSimpleRespVO>> getSimpleForms() { public CommonResult<List<BpmFormSimpleRespVO>> getSimpleForms() {
List<BpmFormDO> list = formService.getFormList(); List<BpmFormDO> list = formService.getFormList();
return success(BpmFormConvert.INSTANCE.convertList2(list)); return success(BpmFormConvert.INSTANCE.convertList2(list));
} }
@GetMapping("/page") @GetMapping("/page")
@ApiOperation("获得动态表单分页") @Operation(summary = "获得动态表单分页")
@PreAuthorize("@ss.hasPermission('bpm:form:query')") @PreAuthorize("@ss.hasPermission('bpm:form:query')")
public CommonResult<PageResult<BpmFormRespVO>> getFormPage(@Valid BpmFormPageReqVO pageVO) { public CommonResult<PageResult<BpmFormRespVO>> getFormPage(@Valid BpmFormPageReqVO pageVO) {
PageResult<BpmFormDO> pageResult = formService.getFormPage(pageVO); PageResult<BpmFormDO> pageResult = formService.getFormPage(pageVO);

View File

@ -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.controller.admin.definition.vo.model.*;
import cn.iocoder.yudao.module.bpm.convert.definition.BpmModelConvert; import cn.iocoder.yudao.module.bpm.convert.definition.BpmModelConvert;
import cn.iocoder.yudao.module.bpm.service.definition.BpmModelService; import cn.iocoder.yudao.module.bpm.service.definition.BpmModelService;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.Operation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -20,7 +20,7 @@ import java.io.IOException;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Api(tags = "管理后台 - 流程模型") @Tag(name = "管理后台 - 流程模型")
@RestController @RestController
@RequestMapping("/bpm/model") @RequestMapping("/bpm/model")
@Validated @Validated
@ -30,14 +30,14 @@ public class BpmModelController {
private BpmModelService modelService; private BpmModelService modelService;
@GetMapping("/page") @GetMapping("/page")
@ApiOperation(value = "获得模型分页") @Operation(summary = "获得模型分页")
public CommonResult<PageResult<BpmModelPageItemRespVO>> getModelPage(BpmModelPageReqVO pageVO) { public CommonResult<PageResult<BpmModelPageItemRespVO>> getModelPage(BpmModelPageReqVO pageVO) {
return success(modelService.getModelPage(pageVO)); return success(modelService.getModelPage(pageVO));
} }
@GetMapping("/get") @GetMapping("/get")
@ApiOperation("获得模型") @Operation(summary = "获得模型")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = String.class) @Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('bpm:model:query')") @PreAuthorize("@ss.hasPermission('bpm:model:query')")
public CommonResult<BpmModelRespVO> getModel(@RequestParam("id") String id) { public CommonResult<BpmModelRespVO> getModel(@RequestParam("id") String id) {
BpmModelRespVO model = modelService.getModel(id); BpmModelRespVO model = modelService.getModel(id);
@ -45,14 +45,14 @@ public class BpmModelController {
} }
@PostMapping("/create") @PostMapping("/create")
@ApiOperation(value = "新建模型") @Operation(summary = "新建模型")
@PreAuthorize("@ss.hasPermission('bpm:model:create')") @PreAuthorize("@ss.hasPermission('bpm:model:create')")
public CommonResult<String> createModel(@Valid @RequestBody BpmModelCreateReqVO createRetVO) { public CommonResult<String> createModel(@Valid @RequestBody BpmModelCreateReqVO createRetVO) {
return success(modelService.createModel(createRetVO, null)); return success(modelService.createModel(createRetVO, null));
} }
@PutMapping("/update") @PutMapping("/update")
@ApiOperation(value = "修改模型") @Operation(summary = "修改模型")
@PreAuthorize("@ss.hasPermission('bpm:model:update')") @PreAuthorize("@ss.hasPermission('bpm:model:update')")
public CommonResult<Boolean> updateModel(@Valid @RequestBody BpmModelUpdateReqVO modelVO) { public CommonResult<Boolean> updateModel(@Valid @RequestBody BpmModelUpdateReqVO modelVO) {
modelService.updateModel(modelVO); modelService.updateModel(modelVO);
@ -60,7 +60,7 @@ public class BpmModelController {
} }
@PostMapping("/import") @PostMapping("/import")
@ApiOperation(value = "导入模型") @Operation(summary = "导入模型")
@PreAuthorize("@ss.hasPermission('bpm:model:import')") @PreAuthorize("@ss.hasPermission('bpm:model:import')")
public CommonResult<String> importModel(@Valid BpmModeImportReqVO importReqVO) throws IOException { public CommonResult<String> importModel(@Valid BpmModeImportReqVO importReqVO) throws IOException {
BpmModelCreateReqVO createReqVO = BpmModelConvert.INSTANCE.convert(importReqVO); BpmModelCreateReqVO createReqVO = BpmModelConvert.INSTANCE.convert(importReqVO);
@ -70,8 +70,8 @@ public class BpmModelController {
} }
@PostMapping("/deploy") @PostMapping("/deploy")
@ApiOperation(value = "部署模型") @Operation(summary = "部署模型")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = String.class) @Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('bpm:model:deploy')") @PreAuthorize("@ss.hasPermission('bpm:model:deploy')")
public CommonResult<Boolean> deployModel(@RequestParam("id") String id) { public CommonResult<Boolean> deployModel(@RequestParam("id") String id) {
modelService.deployModel(id); modelService.deployModel(id);
@ -79,7 +79,7 @@ public class BpmModelController {
} }
@PutMapping("/update-state") @PutMapping("/update-state")
@ApiOperation(value = "修改模型的状态", notes = "实际更新的部署的流程定义的状态") @Operation(summary = "修改模型的状态", description = "实际更新的部署的流程定义的状态")
@PreAuthorize("@ss.hasPermission('bpm:model:update')") @PreAuthorize("@ss.hasPermission('bpm:model:update')")
public CommonResult<Boolean> updateModelState(@Valid @RequestBody BpmModelUpdateStateReqVO reqVO) { public CommonResult<Boolean> updateModelState(@Valid @RequestBody BpmModelUpdateStateReqVO reqVO) {
modelService.updateModelState(reqVO.getId(), reqVO.getState()); modelService.updateModelState(reqVO.getId(), reqVO.getState());
@ -87,8 +87,8 @@ public class BpmModelController {
} }
@DeleteMapping("/delete") @DeleteMapping("/delete")
@ApiOperation("删除模型") @Operation(summary = "删除模型")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = String.class) @Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('bpm:model:delete')") @PreAuthorize("@ss.hasPermission('bpm:model:delete')")
public CommonResult<Boolean> deleteModel(@RequestParam("id") String id) { public CommonResult<Boolean> deleteModel(@RequestParam("id") String id) {
modelService.deleteModel(id); modelService.deleteModel(id);

View File

@ -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.BpmProcessDefinitionPageReqVO;
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionRespVO; import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionRespVO;
import cn.iocoder.yudao.module.bpm.service.definition.BpmProcessDefinitionService; import cn.iocoder.yudao.module.bpm.service.definition.BpmProcessDefinitionService;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.Operation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping; 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; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Api(tags = "管理后台 - 流程定义") @Tag(name = "管理后台 - 流程定义")
@RestController @RestController
@RequestMapping("/bpm/process-definition") @RequestMapping("/bpm/process-definition")
@Validated @Validated
@ -33,7 +33,7 @@ public class BpmProcessDefinitionController {
private BpmProcessDefinitionService bpmDefinitionService; private BpmProcessDefinitionService bpmDefinitionService;
@GetMapping("/page") @GetMapping("/page")
@ApiOperation(value = "获得流程定义分页") @Operation(summary = "获得流程定义分页")
@PreAuthorize("@ss.hasPermission('bpm:process-definition:query')") @PreAuthorize("@ss.hasPermission('bpm:process-definition:query')")
public CommonResult<PageResult<BpmProcessDefinitionPageItemRespVO>> getProcessDefinitionPage( public CommonResult<PageResult<BpmProcessDefinitionPageItemRespVO>> getProcessDefinitionPage(
BpmProcessDefinitionPageReqVO pageReqVO) { BpmProcessDefinitionPageReqVO pageReqVO) {
@ -41,7 +41,7 @@ public class BpmProcessDefinitionController {
} }
@GetMapping ("/list") @GetMapping ("/list")
@ApiOperation(value = "获得流程定义列表") @Operation(summary = "获得流程定义列表")
@PreAuthorize("@ss.hasPermission('bpm:process-definition:query')") @PreAuthorize("@ss.hasPermission('bpm:process-definition:query')")
public CommonResult<List<BpmProcessDefinitionRespVO>> getProcessDefinitionList( public CommonResult<List<BpmProcessDefinitionRespVO>> getProcessDefinitionList(
BpmProcessDefinitionListReqVO listReqVO) { BpmProcessDefinitionListReqVO listReqVO) {
@ -49,8 +49,8 @@ public class BpmProcessDefinitionController {
} }
@GetMapping ("/get-bpmn-xml") @GetMapping ("/get-bpmn-xml")
@ApiOperation(value = "获得流程定义的 BPMN XML") @Operation(summary = "获得流程定义的 BPMN XML")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = String.class) @Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('bpm:process-definition:query')") @PreAuthorize("@ss.hasPermission('bpm:process-definition:query')")
public CommonResult<String> getProcessDefinitionBpmnXML(@RequestParam("id") String id) { public CommonResult<String> getProcessDefinitionBpmnXML(@RequestParam("id") String id) {
String bpmnXML = bpmDefinitionService.getProcessDefinitionBpmnXML(id); String bpmnXML = bpmDefinitionService.getProcessDefinitionBpmnXML(id);

View File

@ -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.BpmTaskAssignRuleRespVO;
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule.BpmTaskAssignRuleUpdateReqVO; import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule.BpmTaskAssignRuleUpdateReqVO;
import cn.iocoder.yudao.module.bpm.service.definition.BpmTaskAssignRuleService; import cn.iocoder.yudao.module.bpm.service.definition.BpmTaskAssignRuleService;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.Operation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; 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.common.pojo.CommonResult.success;
@Api(tags = "管理后台 - 任务分配规则") @Tag(name = "管理后台 - 任务分配规则")
@RestController @RestController
@RequestMapping("/bpm/task-assign-rule") @RequestMapping("/bpm/task-assign-rule")
@Validated @Validated
@ -29,10 +29,10 @@ public class BpmTaskAssignRuleController {
private BpmTaskAssignRuleService taskAssignRuleService; private BpmTaskAssignRuleService taskAssignRuleService;
@GetMapping("/list") @GetMapping("/list")
@ApiOperation(value = "获得任务分配规则列表") @Operation(summary = "获得任务分配规则列表")
@ApiImplicitParams({ @Parameters({
@ApiImplicitParam(name = "modelId", value = "模型编号", example = "1024", dataTypeClass = String.class), @Parameter(name = "modelId", description = "模型编号", example = "1024"),
@ApiImplicitParam(name = "processDefinitionId", value = "流程定义的编号", example = "2048", dataTypeClass = String.class) @Parameter(name = "processDefinitionId", description = "流程定义的编号", example = "2048")
}) })
@PreAuthorize("@ss.hasPermission('bpm:task-assign-rule:query')") @PreAuthorize("@ss.hasPermission('bpm:task-assign-rule:query')")
public CommonResult<List<BpmTaskAssignRuleRespVO>> getTaskAssignRuleList( public CommonResult<List<BpmTaskAssignRuleRespVO>> getTaskAssignRuleList(
@ -42,14 +42,14 @@ public class BpmTaskAssignRuleController {
} }
@PostMapping("/create") @PostMapping("/create")
@ApiOperation(value = "创建任务分配规则") @Operation(summary = "创建任务分配规则")
@PreAuthorize("@ss.hasPermission('bpm:task-assign-rule:create')") @PreAuthorize("@ss.hasPermission('bpm:task-assign-rule:create')")
public CommonResult<Long> createTaskAssignRule(@Valid @RequestBody BpmTaskAssignRuleCreateReqVO reqVO) { public CommonResult<Long> createTaskAssignRule(@Valid @RequestBody BpmTaskAssignRuleCreateReqVO reqVO) {
return success(taskAssignRuleService.createTaskAssignRule(reqVO)); return success(taskAssignRuleService.createTaskAssignRule(reqVO));
} }
@PutMapping("/update") @PutMapping("/update")
@ApiOperation(value = "更新任务分配规则") @Operation(summary = "更新任务分配规则")
@PreAuthorize("@ss.hasPermission('bpm:task-assign-rule:update')") @PreAuthorize("@ss.hasPermission('bpm:task-assign-rule:update')")
public CommonResult<Boolean> updateTaskAssignRule(@Valid @RequestBody BpmTaskAssignRuleUpdateReqVO reqVO) { public CommonResult<Boolean> updateTaskAssignRule(@Valid @RequestBody BpmTaskAssignRuleUpdateReqVO reqVO) {
taskAssignRuleService.updateTaskAssignRule(reqVO); taskAssignRuleService.updateTaskAssignRule(reqVO);

View File

@ -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.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.Operation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -23,7 +23,7 @@ import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Api(tags = "管理后台 - 用户组") @Tag(name = "管理后台 - 用户组")
@RestController @RestController
@RequestMapping("/bpm/user-group") @RequestMapping("/bpm/user-group")
@Validated @Validated
@ -33,14 +33,14 @@ public class BpmUserGroupController {
private BpmUserGroupService userGroupService; private BpmUserGroupService userGroupService;
@PostMapping("/create") @PostMapping("/create")
@ApiOperation("创建用户组") @Operation(summary = "创建用户组")
@PreAuthorize("@ss.hasPermission('bpm:user-group:create')") @PreAuthorize("@ss.hasPermission('bpm:user-group:create')")
public CommonResult<Long> createUserGroup(@Valid @RequestBody BpmUserGroupCreateReqVO createReqVO) { public CommonResult<Long> createUserGroup(@Valid @RequestBody BpmUserGroupCreateReqVO createReqVO) {
return success(userGroupService.createUserGroup(createReqVO)); return success(userGroupService.createUserGroup(createReqVO));
} }
@PutMapping("/update") @PutMapping("/update")
@ApiOperation("更新用户组") @Operation(summary = "更新用户组")
@PreAuthorize("@ss.hasPermission('bpm:user-group:update')") @PreAuthorize("@ss.hasPermission('bpm:user-group:update')")
public CommonResult<Boolean> updateUserGroup(@Valid @RequestBody BpmUserGroupUpdateReqVO updateReqVO) { public CommonResult<Boolean> updateUserGroup(@Valid @RequestBody BpmUserGroupUpdateReqVO updateReqVO) {
userGroupService.updateUserGroup(updateReqVO); userGroupService.updateUserGroup(updateReqVO);
@ -48,8 +48,8 @@ public class BpmUserGroupController {
} }
@DeleteMapping("/delete") @DeleteMapping("/delete")
@ApiOperation("删除用户组") @Operation(summary = "删除用户组")
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) @Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('bpm:user-group:delete')") @PreAuthorize("@ss.hasPermission('bpm:user-group:delete')")
public CommonResult<Boolean> deleteUserGroup(@RequestParam("id") Long id) { public CommonResult<Boolean> deleteUserGroup(@RequestParam("id") Long id) {
userGroupService.deleteUserGroup(id); userGroupService.deleteUserGroup(id);
@ -57,8 +57,8 @@ public class BpmUserGroupController {
} }
@GetMapping("/get") @GetMapping("/get")
@ApiOperation("获得用户组") @Operation(summary = "获得用户组")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('bpm:user-group:query')") @PreAuthorize("@ss.hasPermission('bpm:user-group:query')")
public CommonResult<BpmUserGroupRespVO> getUserGroup(@RequestParam("id") Long id) { public CommonResult<BpmUserGroupRespVO> getUserGroup(@RequestParam("id") Long id) {
BpmUserGroupDO userGroup = userGroupService.getUserGroup(id); BpmUserGroupDO userGroup = userGroupService.getUserGroup(id);
@ -66,7 +66,7 @@ public class BpmUserGroupController {
} }
@GetMapping("/page") @GetMapping("/page")
@ApiOperation("获得用户组分页") @Operation(summary = "获得用户组分页")
@PreAuthorize("@ss.hasPermission('bpm:user-group:query')") @PreAuthorize("@ss.hasPermission('bpm:user-group:query')")
public CommonResult<PageResult<BpmUserGroupRespVO>> getUserGroupPage(@Valid BpmUserGroupPageReqVO pageVO) { public CommonResult<PageResult<BpmUserGroupRespVO>> getUserGroupPage(@Valid BpmUserGroupPageReqVO pageVO) {
PageResult<BpmUserGroupDO> pageResult = userGroupService.getUserGroupPage(pageVO); PageResult<BpmUserGroupDO> pageResult = userGroupService.getUserGroupPage(pageVO);
@ -74,7 +74,7 @@ public class BpmUserGroupController {
} }
@GetMapping("/list-all-simple") @GetMapping("/list-all-simple")
@ApiOperation(value = "获取用户组精简信息列表", notes = "只包含被开启的用户组,主要用于前端的下拉选项") @Operation(summary = "获取用户组精简信息列表", description = "只包含被开启的用户组,主要用于前端的下拉选项")
public CommonResult<List<BpmUserGroupRespVO>> getSimpleUserGroups() { public CommonResult<List<BpmUserGroupRespVO>> getSimpleUserGroups() {
// 获用户门列表,只要开启状态的 // 获用户门列表,只要开启状态的
List<BpmUserGroupDO> list = userGroupService.getUserGroupListByStatus(CommonStatusEnum.ENABLE.getStatus()); List<BpmUserGroupDO> list = userGroupService.getUserGroupListByStatus(CommonStatusEnum.ENABLE.getStatus());

View File

@ -11,15 +11,15 @@ import javax.validation.constraints.*;
@Data @Data
public class BpmFormBaseVO { public class BpmFormBaseVO {
@ApiModelProperty(value = "表单名称", required = true, example = "芋道") @Schema(description = "表单名称", required = true, example = "芋道")
@NotNull(message = "表单名称不能为空") @NotNull(message = "表单名称不能为空")
private String name; private String name;
@ApiModelProperty(value = "表单状态", required = true, notes = "参见 CommonStatusEnum 枚举", example = "1") @Schema(description = "表单状态", required = true, notes = "参见 CommonStatusEnum 枚举", example = "1")
@NotNull(message = "表单状态不能为空") @NotNull(message = "表单状态不能为空")
private Integer status; private Integer status;
@ApiModelProperty(value = "备注", example = "我是备注") @Schema(description = "备注", example = "我是备注")
private String remark; private String remark;
} }

View File

@ -6,17 +6,17 @@ import io.swagger.annotations.*;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
@ApiModel("管理后台 - 动态表单创建 Request VO") @Schema(description = "管理后台 - 动态表单创建 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmFormCreateReqVO extends BpmFormBaseVO { public class BpmFormCreateReqVO extends BpmFormBaseVO {
@ApiModelProperty(value = "表单的配置", required = true, notes = "JSON 字符串") @Schema(description = "表单的配置", required = true, notes = "JSON 字符串")
@NotNull(message = "表单的配置不能为空") @NotNull(message = "表单的配置不能为空")
private String conf; private String conf;
@ApiModelProperty(value = "表单项的数组", required = true, notes = "JSON 字符串的数组") @Schema(description = "表单项的数组", required = true, notes = "JSON 字符串的数组")
@NotNull(message = "表单项的数组不能为空") @NotNull(message = "表单项的数组不能为空")
private List<String> fields; private List<String> fields;

View File

@ -1,19 +1,19 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form; package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ApiModel("管理后台 - 动态表单分页 Request VO") @Schema(description = "管理后台 - 动态表单分页 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmFormPageReqVO extends PageParam { public class BpmFormPageReqVO extends PageParam {
@ApiModelProperty(value = "表单名称", example = "芋道") @Schema(description = "表单名称", example = "芋道")
private String name; private String name;
} }

View File

@ -1,7 +1,7 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form; package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ -10,24 +10,24 @@ import javax.validation.constraints.NotNull;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ApiModel("管理后台 - 动态表单 Response VO") @Schema(description = "管理后台 - 动态表单 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmFormRespVO extends BpmFormBaseVO { public class BpmFormRespVO extends BpmFormBaseVO {
@ApiModelProperty(value = "表单编号", required = true, example = "1024") @Schema(description = "表单编号", required = true, example = "1024")
private Long id; private Long id;
@ApiModelProperty(value = "表单的配置", required = true, notes = "JSON 字符串") @Schema(description = "表单的配置", required = true, notes = "JSON 字符串")
@NotNull(message = "表单的配置不能为空") @NotNull(message = "表单的配置不能为空")
private String conf; private String conf;
@ApiModelProperty(value = "表单项的数组", required = true, notes = "JSON 字符串的数组") @Schema(description = "表单项的数组", required = true, notes = "JSON 字符串的数组")
@NotNull(message = "表单项的数组不能为空") @NotNull(message = "表单项的数组不能为空")
private List<String> fields; private List<String> fields;
@ApiModelProperty(value = "创建时间", required = true) @Schema(description = "创建时间", required = true)
private LocalDateTime createTime; private LocalDateTime createTime;
} }

View File

@ -1,17 +1,17 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form; package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
@ApiModel("管理后台 - 流程表单精简 Response VO") @Schema(description = "管理后台 - 流程表单精简 Response VO")
@Data @Data
public class BpmFormSimpleRespVO { public class BpmFormSimpleRespVO {
@ApiModelProperty(value = "表单编号", required = true, example = "1024") @Schema(description = "表单编号", required = true, example = "1024")
private Long id; private Long id;
@ApiModelProperty(value = "表单名称", required = true, example = "芋道") @Schema(description = "表单名称", required = true, example = "芋道")
private String name; private String name;
} }

View File

@ -5,21 +5,21 @@ import io.swagger.annotations.*;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import java.util.List; import java.util.List;
@ApiModel("管理后台 - 动态表单更新 Request VO") @Schema(description = "管理后台 - 动态表单更新 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmFormUpdateReqVO extends BpmFormBaseVO { public class BpmFormUpdateReqVO extends BpmFormBaseVO {
@ApiModelProperty(value = "表单编号", required = true, example = "1024") @Schema(description = "表单编号", required = true, example = "1024")
@NotNull(message = "表单编号不能为空") @NotNull(message = "表单编号不能为空")
private Long id; private Long id;
@ApiModelProperty(value = "表单的配置", required = true, notes = "JSON 字符串") @Schema(description = "表单的配置", required = true, notes = "JSON 字符串")
@NotNull(message = "表单的配置不能为空") @NotNull(message = "表单的配置不能为空")
private String conf; private String conf;
@ApiModelProperty(value = "表单项的数组", required = true, notes = "JSON 字符串的数组") @Schema(description = "表单项的数组", required = true, notes = "JSON 字符串的数组")
@NotNull(message = "表单项的数组不能为空") @NotNull(message = "表单项的数组不能为空")
private List<String> fields; private List<String> fields;

View File

@ -12,19 +12,19 @@ import javax.validation.constraints.*;
@Data @Data
public class BpmUserGroupBaseVO { public class BpmUserGroupBaseVO {
@ApiModelProperty(value = "组名", required = true, example = "芋道") @Schema(description = "组名", required = true, example = "芋道")
@NotNull(message = "组名不能为空") @NotNull(message = "组名不能为空")
private String name; private String name;
@ApiModelProperty(value = "描述", required = true, example = "芋道源码") @Schema(description = "描述", required = true, example = "芋道源码")
@NotNull(message = "描述不能为空") @NotNull(message = "描述不能为空")
private String description; private String description;
@ApiModelProperty(value = "成员编号数组", required = true, example = "1,2,3") @Schema(description = "成员编号数组", required = true, example = "1,2,3")
@NotNull(message = "成员编号数组不能为空") @NotNull(message = "成员编号数组不能为空")
private Set<Long> memberUserIds; private Set<Long> memberUserIds;
@ApiModelProperty(value = "状态", required = true, example = "1") @Schema(description = "状态", required = true, example = "1")
@NotNull(message = "状态不能为空") @NotNull(message = "状态不能为空")
private Integer status; private Integer status;

View File

@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group;
import lombok.*; import lombok.*;
import io.swagger.annotations.*; import io.swagger.annotations.*;
@ApiModel("管理后台 - 用户组创建 Request VO") @Schema(description = "管理后台 - 用户组创建 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)

View File

@ -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.pojo.PageParam;
import cn.iocoder.yudao.framework.common.util.date.DateUtils; import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ -11,20 +11,20 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ApiModel("管理后台 - 用户组分页 Request VO") @Schema(description = "管理后台 - 用户组分页 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmUserGroupPageReqVO extends PageParam { public class BpmUserGroupPageReqVO extends PageParam {
@ApiModelProperty(value = "组名", example = "芋道") @Schema(description = "组名", example = "芋道")
private String name; private String name;
@ApiModelProperty(value = "状态", example = "1") @Schema(description = "状态", example = "1")
private Integer status; private Integer status;
@DateTimeFormat(pattern = DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "创建时间") @Schema(description = "创建时间")
private LocalDateTime[] createTime; private LocalDateTime[] createTime;
} }

View File

@ -6,16 +6,16 @@ import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import io.swagger.annotations.*; import io.swagger.annotations.*;
@ApiModel("管理后台 - 用户组 Response VO") @Schema(description = "管理后台 - 用户组 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmUserGroupRespVO extends BpmUserGroupBaseVO { public class BpmUserGroupRespVO extends BpmUserGroupBaseVO {
@ApiModelProperty(value = "编号", required = true, example = "1024") @Schema(description = "编号", required = true, example = "1024")
private Long id; private Long id;
@ApiModelProperty(value = "创建时间", required = true) @Schema(description = "创建时间", required = true)
private LocalDateTime createTime; private LocalDateTime createTime;
} }

View File

@ -1,21 +1,21 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group; package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@ApiModel("管理后台 - 用户组精简信息 Response VO") @Schema(description = "管理后台 - 用户组精简信息 Response VO")
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class BpmUserGroupSimpleRespVO { public class BpmUserGroupSimpleRespVO {
@ApiModelProperty(value = "用户组编号", required = true, example = "1024") @Schema(description = "用户组编号", required = true, example = "1024")
private Long id; private Long id;
@ApiModelProperty(value = "用户组名字", required = true, example = "芋道") @Schema(description = "用户组名字", required = true, example = "芋道")
private String name; private String name;
} }

View File

@ -4,13 +4,13 @@ import lombok.*;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import javax.validation.constraints.*; import javax.validation.constraints.*;
@ApiModel("管理后台 - 用户组更新 Request VO") @Schema(description = "管理后台 - 用户组更新 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmUserGroupUpdateReqVO extends BpmUserGroupBaseVO { public class BpmUserGroupUpdateReqVO extends BpmUserGroupBaseVO {
@ApiModelProperty(value = "编号", required = true, example = "1024") @Schema(description = "编号", required = true, example = "1024")
@NotNull(message = "编号不能为空") @NotNull(message = "编号不能为空")
private Long id; private Long id;

View File

@ -1,7 +1,7 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ -9,13 +9,13 @@ import org.springframework.web.multipart.MultipartFile;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
@ApiModel(value = "管理后台 - 流程模型的导入 Request VO", description = "相比流程模型的新建来说,只是多了一个 bpmnFile 文件") @Schema(description = value = "管理后台 - 流程模型的导入 Request VO", description = "相比流程模型的新建来说,只是多了一个 bpmnFile 文件")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmModeImportReqVO extends BpmModelCreateReqVO { public class BpmModeImportReqVO extends BpmModelCreateReqVO {
@ApiModelProperty(value = "BPMN 文件", required = true) @Schema(description = "BPMN 文件", required = true)
@NotNull(message = "BPMN 文件不能为空") @NotNull(message = "BPMN 文件不能为空")
private MultipartFile bpmnFile; private MultipartFile bpmnFile;

View File

@ -1,6 +1,6 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; 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 lombok.Data;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
@ -12,29 +12,29 @@ import javax.validation.constraints.NotEmpty;
@Data @Data
public class BpmModelBaseVO { public class BpmModelBaseVO {
@ApiModelProperty(value = "流程标识", required = true, example = "process_yudao") @Schema(description = "流程标识", required = true, example = "process_yudao")
@NotEmpty(message = "流程标识不能为空") @NotEmpty(message = "流程标识不能为空")
private String key; private String key;
@ApiModelProperty(value = "流程名称", required = true, example = "芋道") @Schema(description = "流程名称", required = true, example = "芋道")
@NotEmpty(message = "流程名称不能为空") @NotEmpty(message = "流程名称不能为空")
private String name; private String name;
@ApiModelProperty(value = "流程描述", example = "我是描述") @Schema(description = "流程描述", example = "我是描述")
private String description; private String description;
@ApiModelProperty(value = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1") @Schema(description = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1")
@NotEmpty(message = "流程分类不能为空") @NotEmpty(message = "流程分类不能为空")
private String category; private String category;
@ApiModelProperty(value = "表单类型", notes = "参见 bpm_model_form_type 数据字典", example = "1") @Schema(description = "表单类型", notes = "参见 bpm_model_form_type 数据字典", example = "1")
private Integer formType; private Integer formType;
@ApiModelProperty(value = "表单编号", example = "1024", notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") @Schema(description = "表单编号", example = "1024", notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空")
private Long formId; private Long formId;
@ApiModelProperty(value = "自定义表单的提交路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/create", @Schema(description = "自定义表单的提交路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/create",
notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空")
private String formCustomCreatePath; private String formCustomCreatePath;
@ApiModelProperty(value = "自定义表单的查看路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/view", @Schema(description = "自定义表单的查看路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/view",
notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空")
private String formCustomViewPath; private String formCustomViewPath;

View File

@ -1,26 +1,26 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
@ApiModel("管理后台 - 流程模型的创建 Request VO") @Schema(description = "管理后台 - 流程模型的创建 Request VO")
@Data @Data
public class BpmModelCreateReqVO { public class BpmModelCreateReqVO {
@ApiModelProperty(value = "流程标识", required = true, example = "process_yudao") @Schema(description = "流程标识", required = true, example = "process_yudao")
@NotEmpty(message = "流程标识不能为空") @NotEmpty(message = "流程标识不能为空")
private String key; private String key;
@ApiModelProperty(value = "流程名称", required = true, example = "芋道") @Schema(description = "流程名称", required = true, example = "芋道")
@NotEmpty(message = "流程名称不能为空") @NotEmpty(message = "流程名称不能为空")
private String name; private String name;
@ApiModelProperty(value = "流程描述", example = "我是描述") @Schema(description = "流程描述", example = "我是描述")
private String description; private String description;
} }

View File

@ -1,26 +1,26 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ApiModel("管理后台 - 流程模型的分页的每一项 Response VO") @Schema(description = "管理后台 - 流程模型的分页的每一项 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmModelPageItemRespVO extends BpmModelBaseVO { public class BpmModelPageItemRespVO extends BpmModelBaseVO {
@ApiModelProperty(value = "编号", required = true, example = "1024") @Schema(description = "编号", required = true, example = "1024")
private String id; private String id;
@ApiModelProperty(value = "表单名字", example = "请假表单") @Schema(description = "表单名字", example = "请假表单")
private String formName; private String formName;
@ApiModelProperty(value = "创建时间", required = true) @Schema(description = "创建时间", required = true)
private LocalDateTime createTime; private LocalDateTime createTime;
/** /**
@ -28,20 +28,20 @@ public class BpmModelPageItemRespVO extends BpmModelBaseVO {
*/ */
private ProcessDefinition processDefinition; private ProcessDefinition processDefinition;
@ApiModel("流程定义") @Schema(description = "流程定义")
@Data @Data
public static class ProcessDefinition { public static class ProcessDefinition {
@ApiModelProperty(value = "编号", required = true, example = "1024") @Schema(description = "编号", required = true, example = "1024")
private String id; private String id;
@ApiModelProperty(value = "版本", required = true, example = "1") @Schema(description = "版本", required = true, example = "1")
private Integer version; private Integer version;
@ApiModelProperty(value = "部署时间", required = true) @Schema(description = "部署时间", required = true)
private LocalDateTime deploymentTime; private LocalDateTime deploymentTime;
@ApiModelProperty(value = "中断状态", required = true, example = "1", notes = "参见 SuspensionState 枚举") @Schema(description = "中断状态", required = true, example = "1", notes = "参见 SuspensionState 枚举")
private Integer suspensionState; private Integer suspensionState;
} }

View File

@ -1,26 +1,26 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ApiModel("管理后台 - 流程模型分页 Request VO") @Schema(description = "管理后台 - 流程模型分页 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmModelPageReqVO extends PageParam { public class BpmModelPageReqVO extends PageParam {
@ApiModelProperty(value = "标识", example = "process1641042089407", notes = "精准匹配") @Schema(description = "标识", example = "process1641042089407", notes = "精准匹配")
private String key; private String key;
@ApiModelProperty(value = "名字", example = "芋道", notes = "模糊匹配") @Schema(description = "名字", example = "芋道", notes = "模糊匹配")
private String name; private String name;
@ApiModelProperty(value = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1") @Schema(description = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1")
private String category; private String category;
} }

View File

@ -1,26 +1,26 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ApiModel("管理后台 - 流程模型的创建 Request VO") @Schema(description = "管理后台 - 流程模型的创建 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmModelRespVO extends BpmModelBaseVO { public class BpmModelRespVO extends BpmModelBaseVO {
@ApiModelProperty(value = "编号", required = true, example = "1024") @Schema(description = "编号", required = true, example = "1024")
private String id; private String id;
@ApiModelProperty(value = "BPMN XML", required = true) @Schema(description = "BPMN XML", required = true)
private String bpmnXml; private String bpmnXml;
@ApiModelProperty(value = "创建时间", required = true) @Schema(description = "创建时间", required = true)
private LocalDateTime createTime; private LocalDateTime createTime;
} }

View File

@ -1,39 +1,39 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
@ApiModel("管理后台 - 流程模型的更新 Request VO") @Schema(description = "管理后台 - 流程模型的更新 Request VO")
@Data @Data
public class BpmModelUpdateReqVO { public class BpmModelUpdateReqVO {
@ApiModelProperty(value = "编号", required = true, example = "1024") @Schema(description = "编号", required = true, example = "1024")
@NotEmpty(message = "编号不能为空") @NotEmpty(message = "编号不能为空")
private String id; private String id;
@ApiModelProperty(value = "流程名称", example = "芋道") @Schema(description = "流程名称", example = "芋道")
private String name; private String name;
@ApiModelProperty(value = "流程描述", example = "我是描述") @Schema(description = "流程描述", example = "我是描述")
private String description; private String description;
@ApiModelProperty(value = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1") @Schema(description = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1")
private String category; private String category;
@ApiModelProperty(value = "BPMN XML", required = true) @Schema(description = "BPMN XML", required = true)
private String bpmnXml; private String bpmnXml;
@ApiModelProperty(value = "表单类型", notes = "参见 bpm_model_form_type 数据字典", example = "1") @Schema(description = "表单类型", notes = "参见 bpm_model_form_type 数据字典", example = "1")
private Integer formType; private Integer formType;
@ApiModelProperty(value = "表单编号", example = "1024", notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") @Schema(description = "表单编号", example = "1024", notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空")
private Long formId; private Long formId;
@ApiModelProperty(value = "自定义表单的提交路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/create", @Schema(description = "自定义表单的提交路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/create",
notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空")
private String formCustomCreatePath; private String formCustomCreatePath;
@ApiModelProperty(value = "自定义表单的查看路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/view", @Schema(description = "自定义表单的查看路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/view",
notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空")
private String formCustomViewPath; private String formCustomViewPath;

View File

@ -1,20 +1,20 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
@ApiModel("管理后台 - 流程模型更新状态 Request VO") @Schema(description = "管理后台 - 流程模型更新状态 Request VO")
@Data @Data
public class BpmModelUpdateStateReqVO { public class BpmModelUpdateStateReqVO {
@ApiModelProperty(value = "编号", required = true, example = "1024") @Schema(description = "编号", required = true, example = "1024")
@NotNull(message = "编号不能为空") @NotNull(message = "编号不能为空")
private String id; private String id;
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 SuspensionState 枚举") @Schema(description = "状态", required = true, example = "1", notes = "见 SuspensionState 枚举")
@NotNull(message = "状态不能为空") @NotNull(message = "状态不能为空")
private Integer state; private Integer state;

View File

@ -1,19 +1,19 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process; package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ApiModel("管理后台 - 流程定义列表 Request VO") @Schema(description = "管理后台 - 流程定义列表 Request VO")
@Data @Data
@ToString(callSuper = true) @ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public class BpmProcessDefinitionListReqVO extends PageParam { public class BpmProcessDefinitionListReqVO extends PageParam {
@ApiModelProperty(value = "中断状态", example = "1", notes = "参见 SuspensionState 枚举") @Schema(description = "中断状态", example = "1", notes = "参见 SuspensionState 枚举")
private Integer suspensionState; private Integer suspensionState;
} }

View File

@ -1,23 +1,23 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process; package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ApiModel("管理后台 - 流程定义的分页的每一项 Response VO") @Schema(description = "管理后台 - 流程定义的分页的每一项 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmProcessDefinitionPageItemRespVO extends BpmProcessDefinitionRespVO { public class BpmProcessDefinitionPageItemRespVO extends BpmProcessDefinitionRespVO {
@ApiModelProperty(value = "表单名字", example = "请假表单") @Schema(description = "表单名字", example = "请假表单")
private String formName; private String formName;
@ApiModelProperty(value = "部署时间", required = true) @Schema(description = "部署时间", required = true)
private LocalDateTime deploymentTime; private LocalDateTime deploymentTime;
} }

View File

@ -1,19 +1,19 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process; package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ApiModel("管理后台 - 流程定义分页 Request VO") @Schema(description = "管理后台 - 流程定义分页 Request VO")
@Data @Data
@ToString(callSuper = true) @ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public class BpmProcessDefinitionPageReqVO extends PageParam { public class BpmProcessDefinitionPageReqVO extends PageParam {
@ApiModelProperty(value = "标识", example = "process1641042089407", notes = "精准匹配") @Schema(description = "标识", example = "process1641042089407", notes = "精准匹配")
private String key; private String key;
} }

View File

@ -1,52 +1,52 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process; package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
@ApiModel("管理后台 - 流程定义 Response VO") @Schema(description = "管理后台 - 流程定义 Response VO")
@Data @Data
public class BpmProcessDefinitionRespVO { public class BpmProcessDefinitionRespVO {
@ApiModelProperty(value = "编号", required = true, example = "1024") @Schema(description = "编号", required = true, example = "1024")
private String id; private String id;
@ApiModelProperty(value = "版本", required = true, example = "1") @Schema(description = "版本", required = true, example = "1")
private Integer version; private Integer version;
@ApiModelProperty(value = "流程名称", required = true, example = "芋道") @Schema(description = "流程名称", required = true, example = "芋道")
@NotEmpty(message = "流程名称不能为空") @NotEmpty(message = "流程名称不能为空")
private String name; private String name;
@ApiModelProperty(value = "流程描述", example = "我是描述") @Schema(description = "流程描述", example = "我是描述")
private String description; private String description;
@ApiModelProperty(value = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1") @Schema(description = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1")
@NotEmpty(message = "流程分类不能为空") @NotEmpty(message = "流程分类不能为空")
private String category; private String category;
@ApiModelProperty(value = "表单类型", notes = "参见 bpm_model_form_type 数据字典", example = "1") @Schema(description = "表单类型", notes = "参见 bpm_model_form_type 数据字典", example = "1")
private Integer formType; private Integer formType;
@ApiModelProperty(value = "表单编号", example = "1024", notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") @Schema(description = "表单编号", example = "1024", notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空")
private Long formId; private Long formId;
@ApiModelProperty(value = "表单的配置", required = true, @Schema(description = "表单的配置", required = true,
notes = "JSON 字符串。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") notes = "JSON 字符串。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空")
private String formConf; private String formConf;
@ApiModelProperty(value = "表单项的数组", required = true, @Schema(description = "表单项的数组", required = true,
notes = "JSON 字符串的数组。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") notes = "JSON 字符串的数组。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空")
private List<String> formFields; private List<String> formFields;
@ApiModelProperty(value = "自定义表单的提交路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/create", @Schema(description = "自定义表单的提交路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/create",
notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空")
private String formCustomCreatePath; private String formCustomCreatePath;
@ApiModelProperty(value = "自定义表单的查看路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/view", @Schema(description = "自定义表单的查看路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/view",
notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空")
private String formCustomViewPath; private String formCustomViewPath;
@ApiModelProperty(value = "中断状态", required = true, example = "1", notes = "参见 SuspensionState 枚举") @Schema(description = "中断状态", required = true, example = "1", notes = "参见 SuspensionState 枚举")
private Integer suspensionState; private Integer suspensionState;
} }

View File

@ -1,6 +1,6 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule; 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 lombok.Data;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
@ -14,11 +14,11 @@ import java.util.Set;
@Data @Data
public class BpmTaskAssignRuleBaseVO { 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 = "规则类型不能为空") @NotNull(message = "规则类型不能为空")
private Integer type; private Integer type;
@ApiModelProperty(value = "规则值数组", required = true, example = "1,2,3") @Schema(description = "规则值数组", required = true, example = "1,2,3")
@NotNull(message = "规则值数组不能为空") @NotNull(message = "规则值数组不能为空")
private Set<Long> options; private Set<Long> options;

View File

@ -1,24 +1,24 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule; package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
@ApiModel("管理后台 - 流程任务分配规则的创建 Request VO") @Schema(description = "管理后台 - 流程任务分配规则的创建 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmTaskAssignRuleCreateReqVO extends BpmTaskAssignRuleBaseVO { public class BpmTaskAssignRuleCreateReqVO extends BpmTaskAssignRuleBaseVO {
@ApiModelProperty(value = "流程模型的编号", required = true, example = "1024") @Schema(description = "流程模型的编号", required = true, example = "1024")
@NotEmpty(message = "流程模型的编号不能为空") @NotEmpty(message = "流程模型的编号不能为空")
private String modelId; private String modelId;
@ApiModelProperty(value = "流程任务定义的编号", required = true, example = "2048") @Schema(description = "流程任务定义的编号", required = true, example = "2048")
@NotEmpty(message = "流程任务定义的编号不能为空") @NotEmpty(message = "流程任务定义的编号不能为空")
private String taskDefinitionKey; private String taskDefinitionKey;

View File

@ -1,29 +1,29 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule; package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ApiModel("管理后台 - 流程任务分配规则的 Response VO") @Schema(description = "管理后台 - 流程任务分配规则的 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmTaskAssignRuleRespVO extends BpmTaskAssignRuleBaseVO { public class BpmTaskAssignRuleRespVO extends BpmTaskAssignRuleBaseVO {
@ApiModelProperty(value = "任务分配规则的编号", required = true, example = "1024") @Schema(description = "任务分配规则的编号", required = true, example = "1024")
private Long id; private Long id;
@ApiModelProperty(value = "流程模型的编号", required = true, example = "2048") @Schema(description = "流程模型的编号", required = true, example = "2048")
private String modelId; private String modelId;
@ApiModelProperty(value = "流程定义的编号", required = true, example = "4096") @Schema(description = "流程定义的编号", required = true, example = "4096")
private String processDefinitionId; private String processDefinitionId;
@ApiModelProperty(value = "流程任务定义的编号", required = true, example = "2048") @Schema(description = "流程任务定义的编号", required = true, example = "2048")
private String taskDefinitionKey; private String taskDefinitionKey;
@ApiModelProperty(value = "流程任务定义的名字", required = true, example = "关注芋道") @Schema(description = "流程任务定义的名字", required = true, example = "关注芋道")
private String taskDefinitionName; private String taskDefinitionName;
} }

View File

@ -1,20 +1,20 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule; package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
@ApiModel("管理后台 - 流程任务分配规则的更新 Request VO") @Schema(description = "管理后台 - 流程任务分配规则的更新 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmTaskAssignRuleUpdateReqVO extends BpmTaskAssignRuleBaseVO { public class BpmTaskAssignRuleUpdateReqVO extends BpmTaskAssignRuleBaseVO {
@ApiModelProperty(value = "任务分配规则的编号", required = true, example = "1024") @Schema(description = "任务分配规则的编号", required = true, example = "1024")
@NotNull(message = "任务分配规则的编号不能为空") @NotNull(message = "任务分配规则的编号不能为空")
private Long id; private Long id;

View File

@ -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.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.bpm.service.oa.BpmOALeaveService; import cn.iocoder.yudao.module.bpm.service.oa.BpmOALeaveService;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.Operation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -27,7 +27,7 @@ import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUti
* @author jason * @author jason
* @author * @author
*/ */
@Api(tags = "管理后台 - OA 请假申请") @Tag(name = "管理后台 - OA 请假申请")
@RestController @RestController
@RequestMapping("/bpm/oa/leave") @RequestMapping("/bpm/oa/leave")
@Validated @Validated
@ -38,15 +38,15 @@ public class BpmOALeaveController {
@PostMapping("/create") @PostMapping("/create")
@PreAuthorize("@ss.hasPermission('bpm:oa-leave:create')") @PreAuthorize("@ss.hasPermission('bpm:oa-leave:create')")
@ApiOperation("创建请求申请") @Operation(summary = "创建请求申请")
public CommonResult<Long> createLeave(@Valid @RequestBody BpmOALeaveCreateReqVO createReqVO) { public CommonResult<Long> createLeave(@Valid @RequestBody BpmOALeaveCreateReqVO createReqVO) {
return success(leaveService.createLeave(getLoginUserId(), createReqVO)); return success(leaveService.createLeave(getLoginUserId(), createReqVO));
} }
@GetMapping("/get") @GetMapping("/get")
@PreAuthorize("@ss.hasPermission('bpm:oa-leave:query')") @PreAuthorize("@ss.hasPermission('bpm:oa-leave:query')")
@ApiOperation("获得请假申请") @Operation(summary = "获得请假申请")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @Parameter(name = "id", description = "编号", required = true, example = "1024")
public CommonResult<BpmOALeaveRespVO> getLeave(@RequestParam("id") Long id) { public CommonResult<BpmOALeaveRespVO> getLeave(@RequestParam("id") Long id) {
BpmOALeaveDO leave = leaveService.getLeave(id); BpmOALeaveDO leave = leaveService.getLeave(id);
return success(BpmOALeaveConvert.INSTANCE.convert(leave)); return success(BpmOALeaveConvert.INSTANCE.convert(leave));
@ -54,7 +54,7 @@ public class BpmOALeaveController {
@GetMapping("/page") @GetMapping("/page")
@PreAuthorize("@ss.hasPermission('bpm:oa-leave:query')") @PreAuthorize("@ss.hasPermission('bpm:oa-leave:query')")
@ApiOperation("获得请假申请分页") @Operation(summary = "获得请假申请分页")
public CommonResult<PageResult<BpmOALeaveRespVO>> getLeavePage(@Valid BpmOALeavePageReqVO pageVO) { public CommonResult<PageResult<BpmOALeaveRespVO>> getLeavePage(@Valid BpmOALeavePageReqVO pageVO) {
PageResult<BpmOALeaveDO> pageResult = leaveService.getLeavePage(getLoginUserId(), pageVO); PageResult<BpmOALeaveDO> pageResult = leaveService.getLeavePage(getLoginUserId(), pageVO);
return success(BpmOALeaveConvert.INSTANCE.convertPage(pageResult)); return success(BpmOALeaveConvert.INSTANCE.convertPage(pageResult));

View File

@ -1,6 +1,6 @@
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo; 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 lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@ -16,19 +16,19 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@Data @Data
public class BpmOALeaveBaseVO { public class BpmOALeaveBaseVO {
@ApiModelProperty(value = "请假的开始时间", required = true) @Schema(description = "请假的开始时间", required = true)
@NotNull(message = "开始时间不能为空") @NotNull(message = "开始时间不能为空")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime startTime; private LocalDateTime startTime;
@ApiModelProperty(value = "请假的结束时间", required = true) @Schema(description = "请假的结束时间", required = true)
@NotNull(message = "结束时间不能为空") @NotNull(message = "结束时间不能为空")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime endTime; private LocalDateTime endTime;
@ApiModelProperty(value = "请假类型", required = true, example = "1", notes = "参见 bpm_oa_type 枚举") @Schema(description = "请假类型", required = true, example = "1", notes = "参见 bpm_oa_type 枚举")
private Integer type; private Integer type;
@ApiModelProperty(value = "原因", required = true, example = "阅读芋道源码") @Schema(description = "原因", required = true, example = "阅读芋道源码")
private String reason; private String reason;
} }

View File

@ -8,23 +8,23 @@ import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; 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 @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmOALeavePageReqVO extends PageParam { public class BpmOALeavePageReqVO extends PageParam {
@ApiModelProperty(value = "状态", example = "1", notes = "参见 bpm_process_instance_result 枚举") @Schema(description = "状态", example = "1", notes = "参见 bpm_process_instance_result 枚举")
private Integer result; private Integer result;
@ApiModelProperty(value = "请假类型", example = "1", notes = "参见 bpm_oa_type") @Schema(description = "请假类型", example = "1", notes = "参见 bpm_oa_type")
private Integer type; private Integer type;
@ApiModelProperty(value = "原因", example = "阅读芋道源码", notes = "模糊匹配") @Schema(description = "原因", example = "阅读芋道源码", notes = "模糊匹配")
private String reason; private String reason;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "申请时间") @Schema(description = "申请时间")
private Date[] createTime; private Date[] createTime;
} }

View File

@ -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; 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 @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmOALeaveRespVO extends BpmOALeaveBaseVO { public class BpmOALeaveRespVO extends BpmOALeaveBaseVO {
@ApiModelProperty(value = "请假表单主键", required = true, example = "1024") @Schema(description = "请假表单主键", required = true, example = "1024")
private Long id; private Long id;
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 bpm_process_instance_result 枚举") @Schema(description = "状态", required = true, example = "1", notes = "参见 bpm_process_instance_result 枚举")
private Integer result; private Integer result;
@ApiModelProperty(value = "申请时间", required = true) @Schema(description = "申请时间", required = true)
@NotNull(message = "申请时间不能为空") @NotNull(message = "申请时间不能为空")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime createTime; private LocalDateTime createTime;
@ApiModelProperty(value = "流程id") @Schema(description = "流程id")
private String processInstanceId; private String processInstanceId;
} }

View File

@ -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.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.activity.BpmActivityRespVO; import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.activity.BpmActivityRespVO;
import cn.iocoder.yudao.module.bpm.service.task.BpmActivityService; import cn.iocoder.yudao.module.bpm.service.task.BpmActivityService;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.Operation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping; 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; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Api(tags = "管理后台 - 流程活动实例") @Tag(name = "管理后台 - 流程活动实例")
@RestController @RestController
@RequestMapping("/bpm/activity") @RequestMapping("/bpm/activity")
@Validated @Validated
@ -28,9 +28,9 @@ public class BpmActivityController {
private BpmActivityService activityService; private BpmActivityService activityService;
@GetMapping("/list") @GetMapping("/list")
@ApiOperation(value = "生成指定流程实例的高亮流程图", @Operation(summary = "生成指定流程实例的高亮流程图",
notes = "只高亮进行中的任务。不过要注意,该接口暂时没用,通过前端的 ProcessViewer.vue 界面的 highlightDiagram 方法生成") notes = "只高亮进行中的任务。不过要注意,该接口暂时没用,通过前端的 ProcessViewer.vue 界面的 highlightDiagram 方法生成")
@ApiImplicitParam(name = "processInstanceId", value = "流程实例的编号", required = true, dataTypeClass = String.class) @Parameter(name = "processInstanceId", description = "流程实例的编号", required = true)
@PreAuthorize("@ss.hasPermission('bpm:task:query')") @PreAuthorize("@ss.hasPermission('bpm:task:query')")
public CommonResult<List<BpmActivityRespVO>> getActivityList( public CommonResult<List<BpmActivityRespVO>> getActivityList(
@RequestParam("processInstanceId") String processInstanceId) { @RequestParam("processInstanceId") String processInstanceId) {

View File

@ -4,9 +4,9 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult; 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.controller.admin.task.vo.instance.*;
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService; import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.Operation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; 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.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
@Api(tags = "管理后台 - 流程实例") // 流程实例,通过流程定义创建的一次“申请” @Tag(name = "管理后台 - 流程实例") // 流程实例,通过流程定义创建的一次“申请”
@RestController @RestController
@RequestMapping("/bpm/process-instance") @RequestMapping("/bpm/process-instance")
@Validated @Validated
@ -27,7 +27,7 @@ public class BpmProcessInstanceController {
private BpmProcessInstanceService processInstanceService; private BpmProcessInstanceService processInstanceService;
@GetMapping("/my-page") @GetMapping("/my-page")
@ApiOperation(value = "获得我的实例分页列表", notes = "在【我的流程】菜单中,进行调用") @Operation(summary = "获得我的实例分页列表", description = "在【我的流程】菜单中,进行调用")
@PreAuthorize("@ss.hasPermission('bpm:process-instance:query')") @PreAuthorize("@ss.hasPermission('bpm:process-instance:query')")
public CommonResult<PageResult<BpmProcessInstancePageItemRespVO>> getMyProcessInstancePage( public CommonResult<PageResult<BpmProcessInstancePageItemRespVO>> getMyProcessInstancePage(
@Valid BpmProcessInstanceMyPageReqVO pageReqVO) { @Valid BpmProcessInstanceMyPageReqVO pageReqVO) {
@ -35,22 +35,22 @@ public class BpmProcessInstanceController {
} }
@PostMapping("/create") @PostMapping("/create")
@ApiOperation("新建流程实例") @Operation(summary = "新建流程实例")
@PreAuthorize("@ss.hasPermission('bpm:process-instance:query')") @PreAuthorize("@ss.hasPermission('bpm:process-instance:query')")
public CommonResult<String> createProcessInstance(@Valid @RequestBody BpmProcessInstanceCreateReqVO createReqVO) { public CommonResult<String> createProcessInstance(@Valid @RequestBody BpmProcessInstanceCreateReqVO createReqVO) {
return success(processInstanceService.createProcessInstance(getLoginUserId(), createReqVO)); return success(processInstanceService.createProcessInstance(getLoginUserId(), createReqVO));
} }
@GetMapping("/get") @GetMapping("/get")
@ApiOperation(value = "获得指定流程实例", notes = "在【流程详细】界面中,进行调用") @Operation(summary = "获得指定流程实例", description = "在【流程详细】界面中,进行调用")
@ApiImplicitParam(name = "id", value = "流程实例的编号", required = true, dataTypeClass = String.class) @Parameter(name = "id", description = "流程实例的编号", required = true)
@PreAuthorize("@ss.hasPermission('bpm:process-instance:query')") @PreAuthorize("@ss.hasPermission('bpm:process-instance:query')")
public CommonResult<BpmProcessInstanceRespVO> getProcessInstance(@RequestParam("id") String id) { public CommonResult<BpmProcessInstanceRespVO> getProcessInstance(@RequestParam("id") String id) {
return success(processInstanceService.getProcessInstanceVO(id)); return success(processInstanceService.getProcessInstanceVO(id));
} }
@DeleteMapping("/cancel") @DeleteMapping("/cancel")
@ApiOperation(value = "取消流程实例", notes = "撤回发起的流程") @Operation(summary = "取消流程实例", description = "撤回发起的流程")
@PreAuthorize("@ss.hasPermission('bpm:process-instance:cancel')") @PreAuthorize("@ss.hasPermission('bpm:process-instance:cancel')")
public CommonResult<Boolean> cancelProcessInstance(@Valid @RequestBody BpmProcessInstanceCancelReqVO cancelReqVO) { public CommonResult<Boolean> cancelProcessInstance(@Valid @RequestBody BpmProcessInstanceCancelReqVO cancelReqVO) {
processInstanceService.cancelProcessInstance(getLoginUserId(), cancelReqVO); processInstanceService.cancelProcessInstance(getLoginUserId(), cancelReqVO);

View File

@ -4,9 +4,9 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult; 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.controller.admin.task.vo.task.*;
import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService; import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.Operation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; 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.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId; import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId;
@Api(tags = "管理后台 - 流程任务实例") @Tag(name = "管理后台 - 流程任务实例")
@RestController @RestController
@RequestMapping("/bpm/task") @RequestMapping("/bpm/task")
@Validated @Validated
@ -29,22 +29,22 @@ public class BpmTaskController {
private BpmTaskService taskService; private BpmTaskService taskService;
@GetMapping("todo-page") @GetMapping("todo-page")
@ApiOperation("获取 Todo 待办任务分页") @Operation(summary = "获取 Todo 待办任务分页")
@PreAuthorize("@ss.hasPermission('bpm:task:query')") @PreAuthorize("@ss.hasPermission('bpm:task:query')")
public CommonResult<PageResult<BpmTaskTodoPageItemRespVO>> getTodoTaskPage(@Valid BpmTaskTodoPageReqVO pageVO) { public CommonResult<PageResult<BpmTaskTodoPageItemRespVO>> getTodoTaskPage(@Valid BpmTaskTodoPageReqVO pageVO) {
return success(taskService.getTodoTaskPage(getLoginUserId(), pageVO)); return success(taskService.getTodoTaskPage(getLoginUserId(), pageVO));
} }
@GetMapping("done-page") @GetMapping("done-page")
@ApiOperation("获取 Done 已办任务分页") @Operation(summary = "获取 Done 已办任务分页")
@PreAuthorize("@ss.hasPermission('bpm:task:query')") @PreAuthorize("@ss.hasPermission('bpm:task:query')")
public CommonResult<PageResult<BpmTaskDonePageItemRespVO>> getDoneTaskPage(@Valid BpmTaskDonePageReqVO pageVO) { public CommonResult<PageResult<BpmTaskDonePageItemRespVO>> getDoneTaskPage(@Valid BpmTaskDonePageReqVO pageVO) {
return success(taskService.getDoneTaskPage(getLoginUserId(), pageVO)); return success(taskService.getDoneTaskPage(getLoginUserId(), pageVO));
} }
@GetMapping("/list-by-process-instance-id") @GetMapping("/list-by-process-instance-id")
@ApiOperation(value = "获得指定流程实例的任务列表", notes = "包括完成的、未完成的") @Operation(summary = "获得指定流程实例的任务列表", description = "包括完成的、未完成的")
@ApiImplicitParam(name = "processInstanceId", value = "流程实例的编号", required = true, dataTypeClass = String.class) @Parameter(name = "processInstanceId", description = "流程实例的编号", required = true)
@PreAuthorize("@ss.hasPermission('bpm:task:query')") @PreAuthorize("@ss.hasPermission('bpm:task:query')")
public CommonResult<List<BpmTaskRespVO>> getTaskListByProcessInstanceId( public CommonResult<List<BpmTaskRespVO>> getTaskListByProcessInstanceId(
@RequestParam("processInstanceId") String processInstanceId) { @RequestParam("processInstanceId") String processInstanceId) {
@ -52,7 +52,7 @@ public class BpmTaskController {
} }
@PutMapping("/approve") @PutMapping("/approve")
@ApiOperation("通过任务") @Operation(summary = "通过任务")
@PreAuthorize("@ss.hasPermission('bpm:task:update')") @PreAuthorize("@ss.hasPermission('bpm:task:update')")
public CommonResult<Boolean> approveTask(@Valid @RequestBody BpmTaskApproveReqVO reqVO) { public CommonResult<Boolean> approveTask(@Valid @RequestBody BpmTaskApproveReqVO reqVO) {
taskService.approveTask(getLoginUserId(), reqVO); taskService.approveTask(getLoginUserId(), reqVO);
@ -60,7 +60,7 @@ public class BpmTaskController {
} }
@PutMapping("/reject") @PutMapping("/reject")
@ApiOperation("不通过任务") @Operation(summary = "不通过任务")
@PreAuthorize("@ss.hasPermission('bpm:task:update')") @PreAuthorize("@ss.hasPermission('bpm:task:update')")
public CommonResult<Boolean> rejectTask(@Valid @RequestBody BpmTaskRejectReqVO reqVO) { public CommonResult<Boolean> rejectTask(@Valid @RequestBody BpmTaskRejectReqVO reqVO) {
taskService.rejectTask(getLoginUserId(), reqVO); taskService.rejectTask(getLoginUserId(), reqVO);
@ -68,7 +68,7 @@ public class BpmTaskController {
} }
@PutMapping("/update-assignee") @PutMapping("/update-assignee")
@ApiOperation(value = "更新任务的负责人", notes = "用于【流程详情】的【转派】按钮") @Operation(summary = "更新任务的负责人", description = "用于【流程详情】的【转派】按钮")
@PreAuthorize("@ss.hasPermission('bpm:task:update')") @PreAuthorize("@ss.hasPermission('bpm:task:update')")
public CommonResult<Boolean> updateTaskAssignee(@Valid @RequestBody BpmTaskUpdateAssigneeReqVO reqVO) { public CommonResult<Boolean> updateTaskAssignee(@Valid @RequestBody BpmTaskUpdateAssigneeReqVO reqVO) {
taskService.updateTaskAssignee(getLoginUserId(), reqVO); taskService.updateTaskAssignee(getLoginUserId(), reqVO);

View File

@ -1,26 +1,26 @@
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.activity; package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.activity;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ApiModel("管理后台 - 流程活动的 Response VO") @Schema(description = "管理后台 - 流程活动的 Response VO")
@Data @Data
public class BpmActivityRespVO { public class BpmActivityRespVO {
@ApiModelProperty(value = "流程活动的标识", required = true, example = "1024") @Schema(description = "流程活动的标识", required = true, example = "1024")
private String key; private String key;
@ApiModelProperty(value = "流程活动的类型", required = true, example = "StartEvent") @Schema(description = "流程活动的类型", required = true, example = "StartEvent")
private String type; private String type;
@ApiModelProperty(value = "流程活动的开始时间", required = true) @Schema(description = "流程活动的开始时间", required = true)
private LocalDateTime startTime; private LocalDateTime startTime;
@ApiModelProperty(value = "流程活动的结束时间", required = true) @Schema(description = "流程活动的结束时间", required = true)
private LocalDateTime endTime; private LocalDateTime endTime;
@ApiModelProperty(value = "关联的流程任务的编号", example = "2048", notes = "关联的流程任务,只有 UserTask 等类型才有") @Schema(description = "关联的流程任务的编号", example = "2048", notes = "关联的流程任务,只有 UserTask 等类型才有")
private String taskId; private String taskId;
} }

View File

@ -1,22 +1,22 @@
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance; package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Map; import java.util.Map;
@ApiModel("管理后台 - 流程实例的取消 Request VO") @Schema(description = "管理后台 - 流程实例的取消 Request VO")
@Data @Data
public class BpmProcessInstanceCancelReqVO { public class BpmProcessInstanceCancelReqVO {
@ApiModelProperty(value = "流程实例的编号", required = true, example = "1024") @Schema(description = "流程实例的编号", required = true, example = "1024")
@NotEmpty(message = "流程实例的编号不能为空") @NotEmpty(message = "流程实例的编号不能为空")
private String id; private String id;
@ApiModelProperty(value = "取消原因", required = true, example = "不请假了!") @Schema(description = "取消原因", required = true, example = "不请假了!")
@NotEmpty(message = "取消原因不能为空") @NotEmpty(message = "取消原因不能为空")
private String reason; private String reason;

View File

@ -1,21 +1,21 @@
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance; package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import java.util.Map; import java.util.Map;
@ApiModel("管理后台 - 流程实例的创建 Request VO") @Schema(description = "管理后台 - 流程实例的创建 Request VO")
@Data @Data
public class BpmProcessInstanceCreateReqVO { public class BpmProcessInstanceCreateReqVO {
@ApiModelProperty(value = "流程定义的编号", required = true, example = "1024") @Schema(description = "流程定义的编号", required = true, example = "1024")
@NotEmpty(message = "流程定义编号不能为空") @NotEmpty(message = "流程定义编号不能为空")
private String processDefinitionId; private String processDefinitionId;
@ApiModelProperty(value = "变量实例") @Schema(description = "变量实例")
private Map<String, Object> variables; private Map<String, Object> variables;
} }

View File

@ -1,8 +1,8 @@
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance; package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ -12,28 +12,28 @@ import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; 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 @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmProcessInstanceMyPageReqVO extends PageParam { public class BpmProcessInstanceMyPageReqVO extends PageParam {
@ApiModelProperty(value = "流程名称", example = "芋道") @Schema(description = "流程名称", example = "芋道")
private String name; private String name;
@ApiModelProperty(value = "流程定义的编号", example = "2048") @Schema(description = "流程定义的编号", example = "2048")
private String processDefinitionId; private String processDefinitionId;
@ApiModelProperty(value = "流程实例的状态", notes = "参见 bpm_process_instance_status", example = "1") @Schema(description = "流程实例的状态", notes = "参见 bpm_process_instance_status", example = "1")
private Integer status; private Integer status;
@ApiModelProperty(value = "流程实例的结果", notes = "参见 bpm_process_instance_result", example = "2") @Schema(description = "流程实例的结果", notes = "参见 bpm_process_instance_result", example = "2")
private Integer result; private Integer result;
@ApiModelProperty(value = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1") @Schema(description = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1")
private String category; private String category;
@ApiModelProperty(value = "创建时间") @Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime; private LocalDateTime[] createTime;

View File

@ -1,38 +1,38 @@
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance; package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ApiModel("管理后台 - 流程实例的分页 Item Response VO") @Schema(description = "管理后台 - 流程实例的分页 Item Response VO")
@Data @Data
public class BpmProcessInstancePageItemRespVO { public class BpmProcessInstancePageItemRespVO {
@ApiModelProperty(value = "流程实例的编号", required = true, example = "1024") @Schema(description = "流程实例的编号", required = true, example = "1024")
private String id; private String id;
@ApiModelProperty(value = "流程名称", required = true, example = "芋道") @Schema(description = "流程名称", required = true, example = "芋道")
private String name; private String name;
@ApiModelProperty(value = "流程定义的编号", required = true, example = "2048") @Schema(description = "流程定义的编号", required = true, example = "2048")
private String processDefinitionId; private String processDefinitionId;
@ApiModelProperty(value = "流程分类", required = true, notes = "参见 bpm_model_category 数据字典", example = "1") @Schema(description = "流程分类", required = true, notes = "参见 bpm_model_category 数据字典", example = "1")
private String category; private String category;
@ApiModelProperty(value = "流程实例的状态", required = true, notes = "参见 bpm_process_instance_status", example = "1") @Schema(description = "流程实例的状态", required = true, notes = "参见 bpm_process_instance_status", example = "1")
private Integer status; private Integer status;
@ApiModelProperty(value = "流程实例的结果", required = true, notes = "参见 bpm_process_instance_result", example = "2") @Schema(description = "流程实例的结果", required = true, notes = "参见 bpm_process_instance_result", example = "2")
private Integer result; private Integer result;
@ApiModelProperty(value = "提交时间", required = true) @Schema(description = "提交时间", required = true)
private LocalDateTime createTime; private LocalDateTime createTime;
@ApiModelProperty(value = "结束时间", required = true) @Schema(description = "结束时间", required = true)
private LocalDateTime endTime; private LocalDateTime endTime;
/** /**
@ -40,14 +40,14 @@ public class BpmProcessInstancePageItemRespVO {
*/ */
private List<Task> tasks; private List<Task> tasks;
@ApiModel("流程任务") @Schema(description = "流程任务")
@Data @Data
public static class Task { public static class Task {
@ApiModelProperty(value = "流程任务的编号", required = true, example = "1024") @Schema(description = "流程任务的编号", required = true, example = "1024")
private String id; private String id;
@ApiModelProperty(value = "任务名称", required = true, example = "芋道") @Schema(description = "任务名称", required = true, example = "芋道")
private String name; private String name;
} }

View File

@ -1,42 +1,42 @@
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance; package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ApiModel("管理后台 - 流程实例的 Response VO") @Schema(description = "管理后台 - 流程实例的 Response VO")
@Data @Data
public class BpmProcessInstanceRespVO { public class BpmProcessInstanceRespVO {
@ApiModelProperty(value = "流程实例的编号", required = true, example = "1024") @Schema(description = "流程实例的编号", required = true, example = "1024")
private String id; private String id;
@ApiModelProperty(value = "流程名称", required = true, example = "芋道") @Schema(description = "流程名称", required = true, example = "芋道")
private String name; private String name;
@ApiModelProperty(value = "流程分类", required = true, notes = "参见 bpm_model_category 数据字典", example = "1") @Schema(description = "流程分类", required = true, notes = "参见 bpm_model_category 数据字典", example = "1")
private String category; private String category;
@ApiModelProperty(value = "流程实例的状态", required = true, notes = "参见 bpm_process_instance_status", example = "1") @Schema(description = "流程实例的状态", required = true, notes = "参见 bpm_process_instance_status", example = "1")
private Integer status; private Integer status;
@ApiModelProperty(value = "流程实例的结果", required = true, notes = "参见 bpm_process_instance_result", example = "2") @Schema(description = "流程实例的结果", required = true, notes = "参见 bpm_process_instance_result", example = "2")
private Integer result; private Integer result;
@ApiModelProperty(value = "提交时间", required = true) @Schema(description = "提交时间", required = true)
private LocalDateTime createTime; private LocalDateTime createTime;
@ApiModelProperty(value = "结束时间", required = true) @Schema(description = "结束时间", required = true)
private LocalDateTime endTime; private LocalDateTime endTime;
@ApiModelProperty(value = "提交的表单值", required = true) @Schema(description = "提交的表单值", required = true)
private Map<String, Object> formVariables; private Map<String, Object> formVariables;
@ApiModelProperty(value = "业务的唯一标识", example = "1", notes = "例如说,请假申请的编号") @Schema(description = "业务的唯一标识", example = "1", notes = "例如说,请假申请的编号")
private String businessKey; private String businessKey;
/** /**
@ -49,47 +49,47 @@ public class BpmProcessInstanceRespVO {
*/ */
private ProcessDefinition processDefinition; private ProcessDefinition processDefinition;
@ApiModel("用户信息") @Schema(description = "用户信息")
@Data @Data
public static class User { public static class User {
@ApiModelProperty(value = "用户编号", required = true, example = "1") @Schema(description = "用户编号", required = true, example = "1")
private Long id; private Long id;
@ApiModelProperty(value = "用户昵称", required = true, example = "芋艿") @Schema(description = "用户昵称", required = true, example = "芋艿")
private String nickname; private String nickname;
@ApiModelProperty(value = "部门编号", required = true, example = "1") @Schema(description = "部门编号", required = true, example = "1")
private Long deptId; private Long deptId;
@ApiModelProperty(value = "部门名称", required = true, example = "研发部") @Schema(description = "部门名称", required = true, example = "研发部")
private String deptName; private String deptName;
} }
@ApiModel("流程定义信息") @Schema(description = "流程定义信息")
@Data @Data
public static class ProcessDefinition { public static class ProcessDefinition {
@ApiModelProperty(value = "编号", required = true, example = "1024") @Schema(description = "编号", required = true, example = "1024")
private String id; private String id;
@ApiModelProperty(value = "表单类型", notes = "参见 bpm_model_form_type 数据字典", example = "1") @Schema(description = "表单类型", notes = "参见 bpm_model_form_type 数据字典", example = "1")
private Integer formType; private Integer formType;
@ApiModelProperty(value = "表单编号", example = "1024", notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") @Schema(description = "表单编号", example = "1024", notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空")
private Long formId; private Long formId;
@ApiModelProperty(value = "表单的配置", required = true, @Schema(description = "表单的配置", required = true,
notes = "JSON 字符串。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") notes = "JSON 字符串。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空")
private String formConf; private String formConf;
@ApiModelProperty(value = "表单项的数组", required = true, @Schema(description = "表单项的数组", required = true,
notes = "JSON 字符串的数组。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") notes = "JSON 字符串的数组。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空")
private List<String> formFields; private List<String> formFields;
@ApiModelProperty(value = "自定义表单的提交路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/create", @Schema(description = "自定义表单的提交路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/create",
notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空")
private String formCustomCreatePath; private String formCustomCreatePath;
@ApiModelProperty(value = "自定义表单的查看路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/view", @Schema(description = "自定义表单的查看路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/view",
notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空")
private String formCustomViewPath; private String formCustomViewPath;
@ApiModelProperty(value = "BPMN XML", required = true) @Schema(description = "BPMN XML", required = true)
private String bpmnXml; private String bpmnXml;
} }

View File

@ -1,20 +1,20 @@
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
@ApiModel("管理后台 - 通过流程任务的 Request VO") @Schema(description = "管理后台 - 通过流程任务的 Request VO")
@Data @Data
public class BpmTaskApproveReqVO { public class BpmTaskApproveReqVO {
@ApiModelProperty(value = "任务编号", required = true, example = "1024") @Schema(description = "任务编号", required = true, example = "1024")
@NotEmpty(message = "任务编号不能为空") @NotEmpty(message = "任务编号不能为空")
private String id; private String id;
@ApiModelProperty(value = "审批意见", required = true, example = "不错不错!") @Schema(description = "审批意见", required = true, example = "不错不错!")
@NotEmpty(message = "审批意见不能为空") @NotEmpty(message = "审批意见不能为空")
private String reason; private String reason;

View File

@ -1,27 +1,27 @@
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ApiModel("管理后台 - 流程任务的 Done 已完成的分页项 Response VO") @Schema(description = "管理后台 - 流程任务的 Done 已完成的分页项 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmTaskDonePageItemRespVO extends BpmTaskTodoPageItemRespVO { public class BpmTaskDonePageItemRespVO extends BpmTaskTodoPageItemRespVO {
@ApiModelProperty(value = "结束时间", required = true) @Schema(description = "结束时间", required = true)
private LocalDateTime endTime; private LocalDateTime endTime;
@ApiModelProperty(value = "持续时间", required = true, example = "1000") @Schema(description = "持续时间", required = true, example = "1000")
private Long durationInMillis; private Long durationInMillis;
@ApiModelProperty(value = "任务结果", required = true, notes = "参见 bpm_process_instance_result", example = "2") @Schema(description = "任务结果", required = true, notes = "参见 bpm_process_instance_result", example = "2")
private Integer result; private Integer result;
@ApiModelProperty(value = "审批建议", required = true, example = "不请假了!") @Schema(description = "审批建议", required = true, example = "不请假了!")
private String reason; private String reason;
} }

View File

@ -1,8 +1,8 @@
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; 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; 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 @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmTaskDonePageReqVO extends PageParam { public class BpmTaskDonePageReqVO extends PageParam {
@ApiModelProperty(value = "流程任务名", example = "芋道") @Schema(description = "流程任务名", example = "芋道")
private String name; private String name;
@ApiModelProperty(value = "开始的创建收间") @Schema(description = "开始的创建收间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime beginCreateTime; private LocalDateTime beginCreateTime;
@ApiModelProperty(value = "结束的创建时间") @Schema(description = "结束的创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime endCreateTime; private LocalDateTime endCreateTime;

View File

@ -1,20 +1,20 @@
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
@ApiModel("管理后台 - 不通过流程任务的 Request VO") @Schema(description = "管理后台 - 不通过流程任务的 Request VO")
@Data @Data
public class BpmTaskRejectReqVO { public class BpmTaskRejectReqVO {
@ApiModelProperty(value = "任务编号", required = true, example = "1024") @Schema(description = "任务编号", required = true, example = "1024")
@NotEmpty(message = "任务编号不能为空") @NotEmpty(message = "任务编号不能为空")
private String id; private String id;
@ApiModelProperty(value = "审批意见", required = true, example = "不错不错!") @Schema(description = "审批意见", required = true, example = "不错不错!")
@NotEmpty(message = "审批意见不能为空") @NotEmpty(message = "审批意见不能为空")
private String reason; private String reason;

View File

@ -1,18 +1,18 @@
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ApiModel("管理后台 - 流程任务的 Response VO") @Schema(description = "管理后台 - 流程任务的 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmTaskRespVO extends BpmTaskDonePageItemRespVO { public class BpmTaskRespVO extends BpmTaskDonePageItemRespVO {
@ApiModelProperty(value = "任务定义的标识", required = true, example = "user-001") @Schema(description = "任务定义的标识", required = true, example = "user-001")
private String definitionKey; private String definitionKey;
/** /**
@ -20,18 +20,18 @@ public class BpmTaskRespVO extends BpmTaskDonePageItemRespVO {
*/ */
private User assigneeUser; private User assigneeUser;
@ApiModel("用户信息") @Schema(description = "用户信息")
@Data @Data
public static class User { public static class User {
@ApiModelProperty(value = "用户编号", required = true, example = "1") @Schema(description = "用户编号", required = true, example = "1")
private Long id; private Long id;
@ApiModelProperty(value = "用户昵称", required = true, example = "芋艿") @Schema(description = "用户昵称", required = true, example = "芋艿")
private String nickname; private String nickname;
@ApiModelProperty(value = "部门编号", required = true, example = "1") @Schema(description = "部门编号", required = true, example = "1")
private Long deptId; private Long deptId;
@ApiModelProperty(value = "部门名称", required = true, example = "研发部") @Schema(description = "部门名称", required = true, example = "研发部")
private String deptName; private String deptName;
} }

View File

@ -1,28 +1,28 @@
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ApiModel("管理后台 - 流程任务的 Running 进行中的分页项 Response VO") @Schema(description = "管理后台 - 流程任务的 Running 进行中的分页项 Response VO")
@Data @Data
public class BpmTaskTodoPageItemRespVO { public class BpmTaskTodoPageItemRespVO {
@ApiModelProperty(value = "任务编号", required = true, example = "1024") @Schema(description = "任务编号", required = true, example = "1024")
private String id; private String id;
@ApiModelProperty(value = "任务名字", required = true, example = "芋道") @Schema(description = "任务名字", required = true, example = "芋道")
private String name; private String name;
@ApiModelProperty(value = "接收时间", required = true) @Schema(description = "接收时间", required = true)
private LocalDateTime claimTime; private LocalDateTime claimTime;
@ApiModelProperty(value = "创建时间", required = true) @Schema(description = "创建时间", required = true)
private LocalDateTime createTime; private LocalDateTime createTime;
@ApiModelProperty(value = "激活状态", required = true, example = "1", notes = "参见 SuspensionState 枚举") @Schema(description = "激活状态", required = true, example = "1", notes = "参见 SuspensionState 枚举")
private Integer suspensionState; private Integer suspensionState;
/** /**
@ -31,22 +31,22 @@ public class BpmTaskTodoPageItemRespVO {
private ProcessInstance processInstance; private ProcessInstance processInstance;
@Data @Data
@ApiModel("流程实例") @Schema(description = "流程实例")
public static class ProcessInstance { public static class ProcessInstance {
@ApiModelProperty(value = "流程实例编号", required = true, example = "1024") @Schema(description = "流程实例编号", required = true, example = "1024")
private String id; private String id;
@ApiModelProperty(value = "流程实例名称", required = true, example = "芋道") @Schema(description = "流程实例名称", required = true, example = "芋道")
private String name; private String name;
@ApiModelProperty(value = "发起人的用户编号", required = true, example = "1024") @Schema(description = "发起人的用户编号", required = true, example = "1024")
private Long startUserId; private Long startUserId;
@ApiModelProperty(value = "发起人的用户昵称", required = true, example = "芋艿") @Schema(description = "发起人的用户昵称", required = true, example = "芋艿")
private String startUserNickname; private String startUserNickname;
@ApiModelProperty(value = "流程定义的编号", required = true, example = "2048") @Schema(description = "流程定义的编号", required = true, example = "2048")
private String processDefinitionId; private String processDefinitionId;
} }

View File

@ -1,8 +1,8 @@
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; 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; 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 @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmTaskTodoPageReqVO extends PageParam { public class BpmTaskTodoPageReqVO extends PageParam {
@ApiModelProperty(value = "流程任务名", example = "芋道") @Schema(description = "流程任务名", example = "芋道")
private String name; private String name;
@ApiModelProperty(value = "开始的创建收间") @Schema(description = "开始的创建收间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime beginCreateTime; private LocalDateTime beginCreateTime;
@ApiModelProperty(value = "结束的创建时间") @Schema(description = "结束的创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime endCreateTime; private LocalDateTime endCreateTime;

View File

@ -1,7 +1,7 @@
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ -10,15 +10,15 @@ import net.bytebuddy.implementation.bind.annotation.Empty;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
@ApiModel("管理后台 - 流程任务的更新负责人的 Request VO") @Schema(description = "管理后台 - 流程任务的更新负责人的 Request VO")
@Data @Data
public class BpmTaskUpdateAssigneeReqVO { public class BpmTaskUpdateAssigneeReqVO {
@ApiModelProperty(value = "任务编号", required = true, example = "1024") @Schema(description = "任务编号", required = true, example = "1024")
@NotEmpty(message = "任务编号不能为空") @NotEmpty(message = "任务编号不能为空")
private String id; private String id;
@ApiModelProperty(value = "新审批人的用户编号", required = true, example = "2048") @Schema(description = "新审批人的用户编号", required = true, example = "2048")
@NotNull(message = "新审批人的用户编号不能为空") @NotNull(message = "新审批人的用户编号不能为空")
private Long assigneeUserId; private Long assigneeUserId;

View File

@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.infra.api.file;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.infra.api.file.dto.FileCreateReqDTO; import cn.iocoder.yudao.module.infra.api.file.dto.FileCreateReqDTO;
import cn.iocoder.yudao.module.infra.enums.ApiConstants; import cn.iocoder.yudao.module.infra.enums.ApiConstants;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import javax.validation.Valid; import javax.validation.Valid;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory = @FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@Api(tags = "RPC 服务 - 文件") @Tag(name = "RPC 服务 - 文件")
public interface FileApi { public interface FileApi {
String PREFIX = ApiConstants.PREFIX + "/file"; String PREFIX = ApiConstants.PREFIX + "/file";
@ -54,7 +54,7 @@ public interface FileApi {
} }
@PostMapping(PREFIX + "/create") @PostMapping(PREFIX + "/create")
@ApiOperation("保存文件,并返回文件的访问路径") @Operation(summary = "保存文件,并返回文件的访问路径")
CommonResult<String> createFile(@Valid @RequestBody FileCreateReqDTO createReqDTO); CommonResult<String> createFile(@Valid @RequestBody FileCreateReqDTO createReqDTO);
} }

View File

@ -1,22 +1,22 @@
package cn.iocoder.yudao.module.infra.api.file.dto; package cn.iocoder.yudao.module.infra.api.file.dto;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
@ApiModel("RPC 服务 - 文件创建 Request DTO") @Schema(description = "RPC 服务 - 文件创建 Request DTO")
@Data @Data
public class FileCreateReqDTO { public class FileCreateReqDTO {
@ApiModelProperty(value = "原文件名称", example = "xxx.png") @Schema(description = "原文件名称", example = "xxx.png")
private String name; private String name;
@ApiModelProperty(value = "文件路径", example = "xxx.png") @Schema(description = "文件路径", example = "xxx.png")
private String path; private String path;
@ApiModelProperty(value = "文件内容", required = true) @Schema(description = "文件内容", required = true)
@NotEmpty(message = "文件内容不能为空") @NotEmpty(message = "文件内容不能为空")
private byte[] content; private byte[] content;

View File

@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.infra.api.logger;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.infra.api.logger.dto.ApiAccessLogCreateReqDTO; import cn.iocoder.yudao.module.infra.api.logger.dto.ApiAccessLogCreateReqDTO;
import cn.iocoder.yudao.module.infra.enums.ApiConstants; import cn.iocoder.yudao.module.infra.enums.ApiConstants;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -12,13 +12,13 @@ import org.springframework.web.bind.annotation.RequestBody;
import javax.validation.Valid; import javax.validation.Valid;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory = @FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@Api(tags = "RPC 服务 - API 访问日志") @Tag(name = "RPC 服务 - API 访问日志")
public interface ApiAccessLogApi { public interface ApiAccessLogApi {
String PREFIX = ApiConstants.PREFIX + "/api-access-log"; String PREFIX = ApiConstants.PREFIX + "/api-access-log";
@PostMapping(PREFIX + "/create") @PostMapping(PREFIX + "/create")
@ApiOperation("创建 API 访问日志") @Operation(summary = "创建 API 访问日志")
CommonResult<Boolean> createApiAccessLog(@Valid @RequestBody ApiAccessLogCreateReqDTO createDTO); CommonResult<Boolean> createApiAccessLog(@Valid @RequestBody ApiAccessLogCreateReqDTO createDTO);
} }

View File

@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.infra.api.logger;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.infra.api.logger.dto.ApiErrorLogCreateReqDTO; import cn.iocoder.yudao.module.infra.api.logger.dto.ApiErrorLogCreateReqDTO;
import cn.iocoder.yudao.module.infra.enums.ApiConstants; import cn.iocoder.yudao.module.infra.enums.ApiConstants;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -12,13 +12,13 @@ import org.springframework.web.bind.annotation.RequestBody;
import javax.validation.Valid; import javax.validation.Valid;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory = @FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@Api(tags = "RPC 服务 - API 异常日志") @Tag(name = "RPC 服务 - API 异常日志")
public interface ApiErrorLogApi { public interface ApiErrorLogApi {
String PREFIX = ApiConstants.PREFIX + "/api-error-log"; String PREFIX = ApiConstants.PREFIX + "/api-error-log";
@PostMapping(PREFIX + "/create") @PostMapping(PREFIX + "/create")
@ApiOperation("创建 API 异常日志") @Operation(summary = "创建 API 异常日志")
CommonResult<Boolean> createApiErrorLog(@Valid @RequestBody ApiErrorLogCreateReqDTO createDTO); CommonResult<Boolean> createApiErrorLog(@Valid @RequestBody ApiErrorLogCreateReqDTO createDTO);
} }

View File

@ -1,56 +1,56 @@
package cn.iocoder.yudao.module.infra.api.logger.dto; package cn.iocoder.yudao.module.infra.api.logger.dto;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ApiModel("RPC 服务 - API 访问日志创建 Request DTO") @Schema(description = "RPC 服务 - API 访问日志创建 Request DTO")
@Data @Data
public class ApiAccessLogCreateReqDTO { public class ApiAccessLogCreateReqDTO {
@ApiModelProperty(value = "链路追踪编号", example = "89aca178-a370-411c-ae02-3f0d672be4ab") @Schema(description = "链路追踪编号", example = "89aca178-a370-411c-ae02-3f0d672be4ab")
private String traceId; private String traceId;
@ApiModelProperty(value = "用户编号", required = true, example = "1024") @Schema(description = "用户编号", required = true, example = "1024")
private Long userId; private Long userId;
@ApiModelProperty(value = "用户类型", required = true, example = "1") @Schema(description = "用户类型", required = true, example = "1")
private Integer userType; private Integer userType;
@ApiModelProperty(value = "应用名", required = true, example = "system-server") @Schema(description = "应用名", required = true, example = "system-server")
@NotNull(message = "应用名不能为空") @NotNull(message = "应用名不能为空")
private String applicationName; private String applicationName;
@ApiModelProperty(value = "请求方法名", required = true, example = "GET") @Schema(description = "请求方法名", required = true, example = "GET")
@NotNull(message = "http 请求方法不能为空") @NotNull(message = "http 请求方法不能为空")
private String requestMethod; private String requestMethod;
@ApiModelProperty(value = "请求地址", required = true, example = "/xxx/yyy") @Schema(description = "请求地址", required = true, example = "/xxx/yyy")
@NotNull(message = "访问地址不能为空") @NotNull(message = "访问地址不能为空")
private String requestUrl; private String requestUrl;
@ApiModelProperty(value = "请求参数", required = true) @Schema(description = "请求参数", required = true)
@NotNull(message = "请求参数不能为空") @NotNull(message = "请求参数不能为空")
private String requestParams; 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 不能为空") @NotNull(message = "ip 不能为空")
private String userIp; 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 不能为空") @NotNull(message = "User-Agent 不能为空")
private String userAgent; private String userAgent;
@ApiModelProperty(value = "开始时间", required = true) @Schema(description = "开始时间", required = true)
@NotNull(message = "开始请求时间不能为空") @NotNull(message = "开始请求时间不能为空")
private LocalDateTime beginTime; private LocalDateTime beginTime;
@ApiModelProperty(value = "结束时间", required = true) @Schema(description = "结束时间", required = true)
@NotNull(message = "结束请求时间不能为空") @NotNull(message = "结束请求时间不能为空")
private LocalDateTime endTime; private LocalDateTime endTime;
@ApiModelProperty(value = "执行时长,单位:毫秒", required = true) @Schema(description = "执行时长,单位:毫秒", required = true)
@NotNull(message = "执行时长不能为空") @NotNull(message = "执行时长不能为空")
private Integer duration; private Integer duration;
@ApiModelProperty(value = "结果码", required = true) @Schema(description = "结果码", required = true)
@NotNull(message = "错误码不能为空") @NotNull(message = "错误码不能为空")
private Integer resultCode; private Integer resultCode;
@ApiModelProperty(value = "结果提示") @Schema(description = "结果提示")
private String resultMsg; private String resultMsg;
} }

View File

@ -1,68 +1,68 @@
package cn.iocoder.yudao.module.infra.api.logger.dto; package cn.iocoder.yudao.module.infra.api.logger.dto;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ApiModel("RPC 服务 - API 错误日志创建 Request DTO") @Schema(description = "RPC 服务 - API 错误日志创建 Request DTO")
@Data @Data
public class ApiErrorLogCreateReqDTO { public class ApiErrorLogCreateReqDTO {
@ApiModelProperty(value = "链路追踪编号", example = "89aca178-a370-411c-ae02-3f0d672be4ab") @Schema(description = "链路追踪编号", example = "89aca178-a370-411c-ae02-3f0d672be4ab")
private String traceId; private String traceId;
@ApiModelProperty(value = "用户编号", required = true, example = "1024") @Schema(description = "用户编号", required = true, example = "1024")
private Long userId; private Long userId;
@ApiModelProperty(value = "用户类型", required = true, example = "1") @Schema(description = "用户类型", required = true, example = "1")
private Integer userType; private Integer userType;
@ApiModelProperty(value = "应用名", required = true, example = "system-server") @Schema(description = "应用名", required = true, example = "system-server")
@NotNull(message = "应用名不能为空") @NotNull(message = "应用名不能为空")
private String applicationName; private String applicationName;
@ApiModelProperty(value = "请求方法名", required = true, example = "GET") @Schema(description = "请求方法名", required = true, example = "GET")
@NotNull(message = "http 请求方法不能为空") @NotNull(message = "http 请求方法不能为空")
private String requestMethod; private String requestMethod;
@ApiModelProperty(value = "请求地址", required = true, example = "/xxx/yyy") @Schema(description = "请求地址", required = true, example = "/xxx/yyy")
@NotNull(message = "访问地址不能为空") @NotNull(message = "访问地址不能为空")
private String requestUrl; private String requestUrl;
@ApiModelProperty(value = "请求参数", required = true) @Schema(description = "请求参数", required = true)
@NotNull(message = "请求参数不能为空") @NotNull(message = "请求参数不能为空")
private String requestParams; 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 不能为空") @NotNull(message = "ip 不能为空")
private String userIp; 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 不能为空") @NotNull(message = "User-Agent 不能为空")
private String userAgent; private String userAgent;
@ApiModelProperty(value = "异常时间", required = true) @Schema(description = "异常时间", required = true)
@NotNull(message = "异常时间不能为空") @NotNull(message = "异常时间不能为空")
private LocalDateTime exceptionTime; private LocalDateTime exceptionTime;
@ApiModelProperty(value = "异常名", required = true) @Schema(description = "异常名", required = true)
@NotNull(message = "异常名不能为空") @NotNull(message = "异常名不能为空")
private String exceptionName; private String exceptionName;
@ApiModelProperty(value = "异常发生的类全名", required = true) @Schema(description = "异常发生的类全名", required = true)
@NotNull(message = "异常发生的类全名不能为空") @NotNull(message = "异常发生的类全名不能为空")
private String exceptionClassName; private String exceptionClassName;
@ApiModelProperty(value = "异常发生的类文件", required = true) @Schema(description = "异常发生的类文件", required = true)
@NotNull(message = "异常发生的类文件不能为空") @NotNull(message = "异常发生的类文件不能为空")
private String exceptionFileName; private String exceptionFileName;
@ApiModelProperty(value = "异常发生的方法名", required = true) @Schema(description = "异常发生的方法名", required = true)
@NotNull(message = "异常发生的方法名不能为空") @NotNull(message = "异常发生的方法名不能为空")
private String exceptionMethodName; private String exceptionMethodName;
@ApiModelProperty(value = "异常发生的方法所在行", required = true) @Schema(description = "异常发生的方法所在行", required = true)
@NotNull(message = "异常发生的方法所在行不能为空") @NotNull(message = "异常发生的方法所在行不能为空")
private Integer exceptionLineNumber; private Integer exceptionLineNumber;
@ApiModelProperty(value = "异常的栈轨迹异常的栈轨迹", required = true) @Schema(description = "异常的栈轨迹异常的栈轨迹", required = true)
@NotNull(message = "异常的栈轨迹不能为空") @NotNull(message = "异常的栈轨迹不能为空")
private String exceptionStackTrace; private String exceptionStackTrace;
@ApiModelProperty(value = "异常导致的根消息", required = true) @Schema(description = "异常导致的根消息", required = true)
@NotNull(message = "异常导致的根消息不能为空") @NotNull(message = "异常导致的根消息不能为空")
private String exceptionRootCauseMessage; private String exceptionRootCauseMessage;
@ApiModelProperty(value = "异常导致的消息", required = true) @Schema(description = "异常导致的消息", required = true)
@NotNull(message = "异常导致的消息不能为空") @NotNull(message = "异常导致的消息不能为空")
private String exceptionMessage; private String exceptionMessage;

View File

@ -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.CodegenColumnDO;
import cn.iocoder.yudao.module.infra.dal.dataobject.codegen.CodegenTableDO; import cn.iocoder.yudao.module.infra.dal.dataobject.codegen.CodegenTableDO;
import cn.iocoder.yudao.module.infra.service.codegen.CodegenService; import cn.iocoder.yudao.module.infra.service.codegen.CodegenService;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.Operation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; 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.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
@Api(tags = "管理后台 - 代码生成器") @Tag(name = "管理后台 - 代码生成器")
@RestController @RestController
@RequestMapping("/infra/codegen") @RequestMapping("/infra/codegen")
@Validated @Validated
@ -46,11 +46,11 @@ public class CodegenController {
private CodegenService codegenService; private CodegenService codegenService;
@GetMapping("/db/table/list") @GetMapping("/db/table/list")
@ApiOperation(value = "获得数据库自带的表定义列表", notes = "会过滤掉已经导入 Codegen 的表") @Operation(summary = "获得数据库自带的表定义列表", description = "会过滤掉已经导入 Codegen 的表")
@ApiImplicitParams({ @Parameters({
@ApiImplicitParam(name = "dataSourceConfigId", value = "数据源配置的编号", required = true, example = "1", dataTypeClass = Long.class), @Parameter(name = "dataSourceConfigId", description = "数据源配置的编号", required = true, example = "1"),
@ApiImplicitParam(name = "name", value = "表名,模糊匹配", example = "yudao", dataTypeClass = String.class), @Parameter(name = "name", description = "表名,模糊匹配", example = "yudao"),
@ApiImplicitParam(name = "comment", value = "描述,模糊匹配", example = "芋道", dataTypeClass = String.class) @Parameter(name = "comment", description = "描述,模糊匹配", example = "芋道")
}) })
@PreAuthorize("@ss.hasPermission('infra:codegen:query')") @PreAuthorize("@ss.hasPermission('infra:codegen:query')")
public CommonResult<List<DatabaseTableRespVO>> getDatabaseTableList( public CommonResult<List<DatabaseTableRespVO>> getDatabaseTableList(
@ -61,7 +61,7 @@ public class CodegenController {
} }
@GetMapping("/table/page") @GetMapping("/table/page")
@ApiOperation("获得表定义分页") @Operation(summary = "获得表定义分页")
@PreAuthorize("@ss.hasPermission('infra:codegen:query')") @PreAuthorize("@ss.hasPermission('infra:codegen:query')")
public CommonResult<PageResult<CodegenTableRespVO>> getCodeGenTablePage(@Valid CodegenTablePageReqVO pageReqVO) { public CommonResult<PageResult<CodegenTableRespVO>> getCodeGenTablePage(@Valid CodegenTablePageReqVO pageReqVO) {
PageResult<CodegenTableDO> pageResult = codegenService.getCodegenTablePage(pageReqVO); PageResult<CodegenTableDO> pageResult = codegenService.getCodegenTablePage(pageReqVO);
@ -69,8 +69,8 @@ public class CodegenController {
} }
@GetMapping("/detail") @GetMapping("/detail")
@ApiOperation("获得表和字段的明细") @Operation(summary = "获得表和字段的明细")
@ApiImplicitParam(name = "tableId", value = "表编号", required = true, example = "1024", dataTypeClass = Long.class) @Parameter(name = "tableId", description = "表编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('infra:codegen:query')") @PreAuthorize("@ss.hasPermission('infra:codegen:query')")
public CommonResult<CodegenDetailRespVO> getCodegenDetail(@RequestParam("tableId") Long tableId) { public CommonResult<CodegenDetailRespVO> getCodegenDetail(@RequestParam("tableId") Long tableId) {
CodegenTableDO table = codegenService.getCodegenTablePage(tableId); CodegenTableDO table = codegenService.getCodegenTablePage(tableId);
@ -79,14 +79,14 @@ public class CodegenController {
return success(CodegenConvert.INSTANCE.convert(table, columns)); return success(CodegenConvert.INSTANCE.convert(table, columns));
} }
@ApiOperation("基于数据库的表结构,创建代码生成器的表和字段定义") @Operation(summary = "基于数据库的表结构,创建代码生成器的表和字段定义")
@PostMapping("/create-list") @PostMapping("/create-list")
@PreAuthorize("@ss.hasPermission('infra:codegen:create')") @PreAuthorize("@ss.hasPermission('infra:codegen:create')")
public CommonResult<List<Long>> createCodegenList(@Valid @RequestBody CodegenCreateListReqVO reqVO) { public CommonResult<List<Long>> createCodegenList(@Valid @RequestBody CodegenCreateListReqVO reqVO) {
return success(codegenService.createCodegenList(getLoginUserId(), reqVO)); return success(codegenService.createCodegenList(getLoginUserId(), reqVO));
} }
@ApiOperation("更新数据库的表和字段定义") @Operation(summary = "更新数据库的表和字段定义")
@PutMapping("/update") @PutMapping("/update")
@PreAuthorize("@ss.hasPermission('infra:codegen:update')") @PreAuthorize("@ss.hasPermission('infra:codegen:update')")
public CommonResult<Boolean> updateCodegen(@Valid @RequestBody CodegenUpdateReqVO updateReqVO) { public CommonResult<Boolean> updateCodegen(@Valid @RequestBody CodegenUpdateReqVO updateReqVO) {
@ -94,36 +94,36 @@ public class CodegenController {
return success(true); return success(true);
} }
@ApiOperation("基于数据库的表结构,同步数据库的表和字段定义") @Operation(summary = "基于数据库的表结构,同步数据库的表和字段定义")
@PutMapping("/sync-from-db") @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')") @PreAuthorize("@ss.hasPermission('infra:codegen:update')")
public CommonResult<Boolean> syncCodegenFromDB(@RequestParam("tableId") Long tableId) { public CommonResult<Boolean> syncCodegenFromDB(@RequestParam("tableId") Long tableId) {
codegenService.syncCodegenFromDB(tableId); codegenService.syncCodegenFromDB(tableId);
return success(true); return success(true);
} }
@ApiOperation("删除数据库的表和字段定义") @Operation(summary = "删除数据库的表和字段定义")
@DeleteMapping("/delete") @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')") @PreAuthorize("@ss.hasPermission('infra:codegen:delete')")
public CommonResult<Boolean> deleteCodegen(@RequestParam("tableId") Long tableId) { public CommonResult<Boolean> deleteCodegen(@RequestParam("tableId") Long tableId) {
codegenService.deleteCodegen(tableId); codegenService.deleteCodegen(tableId);
return success(true); return success(true);
} }
@ApiOperation("预览生成代码") @Operation(summary = "预览生成代码")
@GetMapping("/preview") @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')") @PreAuthorize("@ss.hasPermission('infra:codegen:preview')")
public CommonResult<List<CodegenPreviewRespVO>> previewCodegen(@RequestParam("tableId") Long tableId) { public CommonResult<List<CodegenPreviewRespVO>> previewCodegen(@RequestParam("tableId") Long tableId) {
Map<String, String> codes = codegenService.generationCodes(tableId); Map<String, String> codes = codegenService.generationCodes(tableId);
return success(CodegenConvert.INSTANCE.convert(codes)); return success(CodegenConvert.INSTANCE.convert(codes));
} }
@ApiOperation("下载生成代码") @Operation(summary = "下载生成代码")
@GetMapping("/download") @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')") @PreAuthorize("@ss.hasPermission('infra:codegen:download')")
public void downloadCodegen(@RequestParam("tableId") Long tableId, public void downloadCodegen(@RequestParam("tableId") Long tableId,
HttpServletResponse response) throws IOException { HttpServletResponse response) throws IOException {

View File

@ -1,21 +1,21 @@
package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo; package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
@ApiModel("管理后台 - 基于数据库的表结构,创建代码生成器的表和字段定义 Request VO") @Schema(description = "管理后台 - 基于数据库的表结构,创建代码生成器的表和字段定义 Request VO")
@Data @Data
public class CodegenCreateListReqVO { public class CodegenCreateListReqVO {
@ApiModelProperty(value = "数据源配置的编号", required = true, example = "1") @Schema(description = "数据源配置的编号", required = true, example = "1")
@NotNull(message = "数据源配置的编号不能为空") @NotNull(message = "数据源配置的编号不能为空")
private Long dataSourceConfigId; private Long dataSourceConfigId;
@ApiModelProperty(value = "表名数组", required = true, example = "[1, 2, 3]") @Schema(description = "表名数组", required = true, example = "[1, 2, 3]")
@NotNull(message = "表名数组不能为空") @NotNull(message = "表名数组不能为空")
private List<String> tableNames; private List<String> tableNames;

View File

@ -2,13 +2,13 @@ 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.column.CodegenColumnRespVO;
import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table.CodegenTableRespVO; import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table.CodegenTableRespVO;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
@ApiModel("管理后台 - 代码生成表和字段的明细 Response VO") @Schema(description = "管理后台 - 代码生成表和字段的明细 Response VO")
@Data @Data
public class CodegenDetailRespVO { public class CodegenDetailRespVO {

View File

@ -1,17 +1,17 @@
package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo; package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
@ApiModel(value = "管理后台 - 代码生成预览 Response VO", description ="注意,每个文件都是一个该对象") @Schema(description = value = "管理后台 - 代码生成预览 Response VO", description ="注意,每个文件都是一个该对象")
@Data @Data
public class CodegenPreviewRespVO { 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; private String filePath;
@ApiModelProperty(value = "代码", required = true, example = "Hello World") @Schema(description = "代码", required = true, example = "Hello World")
private String code; private String code;
} }

View File

@ -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.column.CodegenColumnBaseVO;
import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table.CodegenTableBaseVO; import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table.CodegenTableBaseVO;
import cn.iocoder.yudao.module.infra.enums.codegen.CodegenSceneEnum; import cn.iocoder.yudao.module.infra.enums.codegen.CodegenSceneEnum;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ -15,7 +15,7 @@ import javax.validation.constraints.AssertTrue;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
@ApiModel("管理后台 - 代码生成表和字段的修改 Request VO") @Schema(description = "管理后台 - 代码生成表和字段的修改 Request VO")
@Data @Data
public class CodegenUpdateReqVO { public class CodegenUpdateReqVO {
@ -27,14 +27,14 @@ public class CodegenUpdateReqVO {
@NotNull(message = "字段定义不能为空") @NotNull(message = "字段定义不能为空")
private List<Column> columns; private List<Column> columns;
@ApiModel("更新表定义") @Schema(description = "更新表定义")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
@Valid @Valid
public static class Table extends CodegenTableBaseVO { public static class Table extends CodegenTableBaseVO {
@ApiModelProperty(value = "编号", required = true, example = "1") @Schema(description = "编号", required = true, example = "1")
private Long id; private Long id;
@AssertTrue(message = "上级菜单不能为空") @AssertTrue(message = "上级菜单不能为空")
@ -46,13 +46,13 @@ public class CodegenUpdateReqVO {
} }
@ApiModel("更新表定义") @Schema(description = "更新表定义")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public static class Column extends CodegenColumnBaseVO { public static class Column extends CodegenColumnBaseVO {
@ApiModelProperty(value = "编号", required = true, example = "1") @Schema(description = "编号", required = true, example = "1")
private Long id; private Long id;
} }

View File

@ -1,6 +1,6 @@
package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column; 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 lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
@ -12,73 +12,73 @@ import javax.validation.constraints.NotNull;
@Data @Data
public class CodegenColumnBaseVO { public class CodegenColumnBaseVO {
@ApiModelProperty(value = "表编号", required = true, example = "1") @Schema(description = "表编号", required = true, example = "1")
@NotNull(message = "表编号不能为空") @NotNull(message = "表编号不能为空")
private Long tableId; private Long tableId;
@ApiModelProperty(value = "字段名", required = true, example = "user_age") @Schema(description = "字段名", required = true, example = "user_age")
@NotNull(message = "字段名不能为空") @NotNull(message = "字段名不能为空")
private String columnName; private String columnName;
@ApiModelProperty(value = "字段类型", required = true, example = "int(11)") @Schema(description = "字段类型", required = true, example = "int(11)")
@NotNull(message = "字段类型不能为空") @NotNull(message = "字段类型不能为空")
private String dataType; private String dataType;
@ApiModelProperty(value = "字段描述", required = true, example = "年龄") @Schema(description = "字段描述", required = true, example = "年龄")
@NotNull(message = "字段描述不能为空") @NotNull(message = "字段描述不能为空")
private String columnComment; private String columnComment;
@ApiModelProperty(value = "是否允许为空", required = true, example = "true") @Schema(description = "是否允许为空", required = true, example = "true")
@NotNull(message = "是否允许为空不能为空") @NotNull(message = "是否允许为空不能为空")
private Boolean nullable; private Boolean nullable;
@ApiModelProperty(value = "是否主键", required = true, example = "false") @Schema(description = "是否主键", required = true, example = "false")
@NotNull(message = "是否主键不能为空") @NotNull(message = "是否主键不能为空")
private Boolean primaryKey; private Boolean primaryKey;
@ApiModelProperty(value = "是否自增", required = true, example = "true") @Schema(description = "是否自增", required = true, example = "true")
@NotNull(message = "是否自增不能为空") @NotNull(message = "是否自增不能为空")
private String autoIncrement; private String autoIncrement;
@ApiModelProperty(value = "排序", required = true, example = "10") @Schema(description = "排序", required = true, example = "10")
@NotNull(message = "排序不能为空") @NotNull(message = "排序不能为空")
private Integer ordinalPosition; private Integer ordinalPosition;
@ApiModelProperty(value = "Java 属性类型", required = true, example = "userAge") @Schema(description = "Java 属性类型", required = true, example = "userAge")
@NotNull(message = "Java 属性类型不能为空") @NotNull(message = "Java 属性类型不能为空")
private String javaType; private String javaType;
@ApiModelProperty(value = "Java 属性名", required = true, example = "Integer") @Schema(description = "Java 属性名", required = true, example = "Integer")
@NotNull(message = "Java 属性名不能为空") @NotNull(message = "Java 属性名不能为空")
private String javaField; private String javaField;
@ApiModelProperty(value = "字典类型", example = "sys_gender") @Schema(description = "字典类型", example = "sys_gender")
private String dictType; private String dictType;
@ApiModelProperty(value = "数据示例", example = "1024") @Schema(description = "数据示例", example = "1024")
private String example; private String example;
@ApiModelProperty(value = "是否为 Create 创建操作的字段", required = true, example = "true") @Schema(description = "是否为 Create 创建操作的字段", required = true, example = "true")
@NotNull(message = "是否为 Create 创建操作的字段不能为空") @NotNull(message = "是否为 Create 创建操作的字段不能为空")
private Boolean createOperation; private Boolean createOperation;
@ApiModelProperty(value = "是否为 Update 更新操作的字段", required = true, example = "false") @Schema(description = "是否为 Update 更新操作的字段", required = true, example = "false")
@NotNull(message = "是否为 Update 更新操作的字段不能为空") @NotNull(message = "是否为 Update 更新操作的字段不能为空")
private Boolean updateOperation; private Boolean updateOperation;
@ApiModelProperty(value = "是否为 List 查询操作的字段", required = true, example = "true") @Schema(description = "是否为 List 查询操作的字段", required = true, example = "true")
@NotNull(message = "是否为 List 查询操作的字段不能为空") @NotNull(message = "是否为 List 查询操作的字段不能为空")
private Boolean listOperation; private Boolean listOperation;
@ApiModelProperty(value = "List 查询操作的条件类型", required = true, example = "LIKE", notes = "参见 CodegenColumnListConditionEnum 枚举") @Schema(description = "List 查询操作的条件类型", required = true, example = "LIKE", notes = "参见 CodegenColumnListConditionEnum 枚举")
@NotNull(message = "List 查询操作的条件类型不能为空") @NotNull(message = "List 查询操作的条件类型不能为空")
private String listOperationCondition; private String listOperationCondition;
@ApiModelProperty(value = "是否为 List 查询操作的返回字段", required = true, example = "true") @Schema(description = "是否为 List 查询操作的返回字段", required = true, example = "true")
@NotNull(message = "是否为 List 查询操作的返回字段不能为空") @NotNull(message = "是否为 List 查询操作的返回字段不能为空")
private Boolean listOperationResult; private Boolean listOperationResult;
@ApiModelProperty(value = "显示类型", required = true, example = "input") @Schema(description = "显示类型", required = true, example = "input")
@NotNull(message = "显示类型不能为空") @NotNull(message = "显示类型不能为空")
private String htmlType; private String htmlType;

View File

@ -1,23 +1,23 @@
package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column; package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ApiModel("管理后台 - 代码生成字段定义 Response VO") @Schema(description = "管理后台 - 代码生成字段定义 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class CodegenColumnRespVO extends CodegenColumnBaseVO { public class CodegenColumnRespVO extends CodegenColumnBaseVO {
@ApiModelProperty(value = "编号", required = true, example = "1") @Schema(description = "编号", required = true, example = "1")
private Long id; private Long id;
@ApiModelProperty(value = "创建时间", required = true) @Schema(description = "创建时间", required = true)
private LocalDateTime createTime; private LocalDateTime createTime;
} }

View File

@ -1,6 +1,6 @@
package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table; 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 lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
@ -12,46 +12,46 @@ import javax.validation.constraints.NotNull;
@Data @Data
public class CodegenTableBaseVO { public class CodegenTableBaseVO {
@ApiModelProperty(value = "生成场景", required = true, example = "1", notes = "参见 CodegenSceneEnum 枚举") @Schema(description = "生成场景", required = true, example = "1", notes = "参见 CodegenSceneEnum 枚举")
@NotNull(message = "导入类型不能为空") @NotNull(message = "导入类型不能为空")
private Integer scene; private Integer scene;
@ApiModelProperty(value = "表名称", required = true, example = "yudao") @Schema(description = "表名称", required = true, example = "yudao")
@NotNull(message = "表名称不能为空") @NotNull(message = "表名称不能为空")
private String tableName; private String tableName;
@ApiModelProperty(value = "表描述", required = true, example = "芋道") @Schema(description = "表描述", required = true, example = "芋道")
@NotNull(message = "表描述不能为空") @NotNull(message = "表描述不能为空")
private String tableComment; private String tableComment;
@ApiModelProperty(value = "备注", example = "我是备注") @Schema(description = "备注", example = "我是备注")
private String remark; private String remark;
@ApiModelProperty(value = "模块名", required = true, example = "system") @Schema(description = "模块名", required = true, example = "system")
@NotNull(message = "模块名不能为空") @NotNull(message = "模块名不能为空")
private String moduleName; private String moduleName;
@ApiModelProperty(value = "业务名", required = true, example = "codegen") @Schema(description = "业务名", required = true, example = "codegen")
@NotNull(message = "业务名不能为空") @NotNull(message = "业务名不能为空")
private String businessName; private String businessName;
@ApiModelProperty(value = "类名称", required = true, example = "CodegenTable") @Schema(description = "类名称", required = true, example = "CodegenTable")
@NotNull(message = "类名称不能为空") @NotNull(message = "类名称不能为空")
private String className; private String className;
@ApiModelProperty(value = "类描述", required = true, example = "代码生成器的表定义") @Schema(description = "类描述", required = true, example = "代码生成器的表定义")
@NotNull(message = "类描述不能为空") @NotNull(message = "类描述不能为空")
private String classComment; private String classComment;
@ApiModelProperty(value = "作者", required = true, example = "芋道源码") @Schema(description = "作者", required = true, example = "芋道源码")
@NotNull(message = "作者不能为空") @NotNull(message = "作者不能为空")
private String author; private String author;
@ApiModelProperty(value = "模板类型", required = true, example = "1", notes = "参见 CodegenTemplateTypeEnum 枚举") @Schema(description = "模板类型", required = true, example = "1", notes = "参见 CodegenTemplateTypeEnum 枚举")
@NotNull(message = "模板类型不能为空") @NotNull(message = "模板类型不能为空")
private Integer templateType; private Integer templateType;
@ApiModelProperty(value = "父菜单编号", example = "1024") @Schema(description = "父菜单编号", example = "1024")
private Long parentMenuId; private Long parentMenuId;
} }

View File

@ -1,8 +1,8 @@
package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table; package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ -12,19 +12,19 @@ import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; 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 @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class CodegenTablePageReqVO extends PageParam { public class CodegenTablePageReqVO extends PageParam {
@ApiModelProperty(value = "表名称", example = "yudao", notes = "模糊匹配") @Schema(description = "表名称", example = "yudao", notes = "模糊匹配")
private String tableName; private String tableName;
@ApiModelProperty(value = "表描述", example = "芋道", notes = "模糊匹配") @Schema(description = "表描述", example = "芋道", notes = "模糊匹配")
private String tableComment; 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) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime; private LocalDateTime[] createTime;

View File

@ -1,29 +1,29 @@
package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table; package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ApiModel("管理后台 - 代码生成表定义 Response VO") @Schema(description = "管理后台 - 代码生成表定义 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class CodegenTableRespVO extends CodegenTableBaseVO { public class CodegenTableRespVO extends CodegenTableBaseVO {
@ApiModelProperty(value = "编号", required = true, example = "1") @Schema(description = "编号", required = true, example = "1")
private Long id; private Long id;
@ApiModelProperty(value = "主键编号", required = true, example = "1024") @Schema(description = "主键编号", required = true, example = "1024")
private Integer dataSourceConfigId; private Integer dataSourceConfigId;
@ApiModelProperty(value = "创建时间", required = true) @Schema(description = "创建时间", required = true)
private LocalDateTime createTime; private LocalDateTime createTime;
@ApiModelProperty(value = "更新时间", required = true) @Schema(description = "更新时间", required = true)
private LocalDateTime updateTime; private LocalDateTime updateTime;
} }

View File

@ -1,17 +1,17 @@
package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table; package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
@ApiModel("管理后台 - 数据库的表定义 Response VO") @Schema(description = "管理后台 - 数据库的表定义 Response VO")
@Data @Data
public class DatabaseTableRespVO { public class DatabaseTableRespVO {
@ApiModelProperty(value = "表名称", required = true, example = "yuanma") @Schema(description = "表名称", required = true, example = "yuanma")
private String name; private String name;
@ApiModelProperty(value = "表描述", required = true, example = "芋道源码") @Schema(description = "表描述", required = true, example = "芋道源码")
private String comment; private String comment;
} }

View File

@ -10,9 +10,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.dal.dataobject.config.ConfigDO;
import cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants; import cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants;
import cn.iocoder.yudao.module.infra.service.config.ConfigService; import cn.iocoder.yudao.module.infra.service.config.ConfigService;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.Operation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -26,7 +26,7 @@ import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
@Api(tags = "管理后台 - 参数配置") @Tag(name = "管理后台 - 参数配置")
@RestController @RestController
@RequestMapping("/infra/config") @RequestMapping("/infra/config")
@Validated @Validated
@ -36,14 +36,14 @@ public class ConfigController {
private ConfigService configService; private ConfigService configService;
@PostMapping("/create") @PostMapping("/create")
@ApiOperation("创建参数配置") @Operation(summary = "创建参数配置")
@PreAuthorize("@ss.hasPermission('infra:config:create')") @PreAuthorize("@ss.hasPermission('infra:config:create')")
public CommonResult<Long> createConfig(@Valid @RequestBody ConfigCreateReqVO reqVO) { public CommonResult<Long> createConfig(@Valid @RequestBody ConfigCreateReqVO reqVO) {
return success(configService.createConfig(reqVO)); return success(configService.createConfig(reqVO));
} }
@PutMapping("/update") @PutMapping("/update")
@ApiOperation("修改参数配置") @Operation(summary = "修改参数配置")
@PreAuthorize("@ss.hasPermission('infra:config:update')") @PreAuthorize("@ss.hasPermission('infra:config:update')")
public CommonResult<Boolean> updateConfig(@Valid @RequestBody ConfigUpdateReqVO reqVO) { public CommonResult<Boolean> updateConfig(@Valid @RequestBody ConfigUpdateReqVO reqVO) {
configService.updateConfig(reqVO); configService.updateConfig(reqVO);
@ -51,8 +51,8 @@ public class ConfigController {
} }
@DeleteMapping("/delete") @DeleteMapping("/delete")
@ApiOperation("删除参数配置") @Operation(summary = "删除参数配置")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('infra:config:delete')") @PreAuthorize("@ss.hasPermission('infra:config:delete')")
public CommonResult<Boolean> deleteConfig(@RequestParam("id") Long id) { public CommonResult<Boolean> deleteConfig(@RequestParam("id") Long id) {
configService.deleteConfig(id); configService.deleteConfig(id);
@ -60,16 +60,16 @@ public class ConfigController {
} }
@GetMapping(value = "/get") @GetMapping(value = "/get")
@ApiOperation("获得参数配置") @Operation(summary = "获得参数配置")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('infra:config:query')") @PreAuthorize("@ss.hasPermission('infra:config:query')")
public CommonResult<ConfigRespVO> getConfig(@RequestParam("id") Long id) { public CommonResult<ConfigRespVO> getConfig(@RequestParam("id") Long id) {
return success(ConfigConvert.INSTANCE.convert(configService.getConfig(id))); return success(ConfigConvert.INSTANCE.convert(configService.getConfig(id)));
} }
@GetMapping(value = "/get-value-by-key") @GetMapping(value = "/get-value-by-key")
@ApiOperation(value = "根据参数键名查询参数值", notes = "不可见的配置,不允许返回给前端") @Operation(summary = "根据参数键名查询参数值", description = "不可见的配置,不允许返回给前端")
@ApiImplicitParam(name = "key", value = "参数键", required = true, example = "yunai.biz.username", dataTypeClass = String.class) @Parameter(name = "key", description = "参数键", required = true, example = "yunai.biz.username")
public CommonResult<String> getConfigKey(@RequestParam("key") String key) { public CommonResult<String> getConfigKey(@RequestParam("key") String key) {
ConfigDO config = configService.getConfigByKey(key); ConfigDO config = configService.getConfigByKey(key);
if (config == null) { if (config == null) {
@ -82,7 +82,7 @@ public class ConfigController {
} }
@GetMapping("/page") @GetMapping("/page")
@ApiOperation("获取参数配置分页") @Operation(summary = "获取参数配置分页")
@PreAuthorize("@ss.hasPermission('infra:config:query')") @PreAuthorize("@ss.hasPermission('infra:config:query')")
public CommonResult<PageResult<ConfigRespVO>> getConfigPage(@Valid ConfigPageReqVO reqVO) { public CommonResult<PageResult<ConfigRespVO>> getConfigPage(@Valid ConfigPageReqVO reqVO) {
PageResult<ConfigDO> page = configService.getConfigPage(reqVO); PageResult<ConfigDO> page = configService.getConfigPage(reqVO);
@ -90,7 +90,7 @@ public class ConfigController {
} }
@GetMapping("/export") @GetMapping("/export")
@ApiOperation("导出参数配置") @Operation(summary = "导出参数配置")
@PreAuthorize("@ss.hasPermission('infra:config:export')") @PreAuthorize("@ss.hasPermission('infra:config:export')")
@OperateLog(type = EXPORT) @OperateLog(type = EXPORT)
public void exportSysConfig(@Valid ConfigExportReqVO reqVO, public void exportSysConfig(@Valid ConfigExportReqVO reqVO,

View File

@ -1,6 +1,6 @@
package cn.iocoder.yudao.module.infra.controller.admin.config.vo; 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 lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
@ -15,26 +15,26 @@ import javax.validation.constraints.Size;
@Data @Data
public class ConfigBaseVO { public class ConfigBaseVO {
@ApiModelProperty(value = "参数分组", required = true, example = "biz") @Schema(description = "参数分组", required = true, example = "biz")
@NotEmpty(message = "参数分组不能为空") @NotEmpty(message = "参数分组不能为空")
@Size(max = 50, message = "参数名称不能超过50个字符") @Size(max = 50, message = "参数名称不能超过50个字符")
private String category; private String category;
@ApiModelProperty(value = "参数名称", required = true, example = "数据库名") @Schema(description = "参数名称", required = true, example = "数据库名")
@NotBlank(message = "参数名称不能为空") @NotBlank(message = "参数名称不能为空")
@Size(max = 100, message = "参数名称不能超过100个字符") @Size(max = 100, message = "参数名称不能超过100个字符")
private String name; private String name;
@ApiModelProperty(value = "参数键值", required = true, example = "1024") @Schema(description = "参数键值", required = true, example = "1024")
@NotBlank(message = "参数键值不能为空") @NotBlank(message = "参数键值不能为空")
@Size(max = 500, message = "参数键值长度不能超过500个字符") @Size(max = 500, message = "参数键值长度不能超过500个字符")
private String value; private String value;
@ApiModelProperty(value = "是否敏感", required = true, example = "true") @Schema(description = "是否敏感", required = true, example = "true")
@NotNull(message = "是否敏感不能为空") @NotNull(message = "是否敏感不能为空")
private Boolean visible; private Boolean visible;
@ApiModelProperty(value = "备注", example = "备注一下很帅气!") @Schema(description = "备注", example = "备注一下很帅气!")
private String remark; private String remark;
} }

View File

@ -1,19 +1,19 @@
package cn.iocoder.yudao.module.infra.controller.admin.config.vo; package cn.iocoder.yudao.module.infra.controller.admin.config.vo;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
@ApiModel("管理后台 - 参数配置创建 Request VO") @Schema(description = "管理后台 - 参数配置创建 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public class ConfigCreateReqVO extends ConfigBaseVO { public class ConfigCreateReqVO extends ConfigBaseVO {
@ApiModelProperty(value = "参数键名", required = true, example = "yunai.db.username") @Schema(description = "参数键名", required = true, example = "yunai.db.username")
@NotBlank(message = "参数键名长度不能为空") @NotBlank(message = "参数键名长度不能为空")
@Size(max = 100, message = "参数键名长度不能超过100个字符") @Size(max = 100, message = "参数键名长度不能超过100个字符")
private String key; private String key;

View File

@ -1,7 +1,7 @@
package cn.iocoder.yudao.module.infra.controller.admin.config.vo; package cn.iocoder.yudao.module.infra.controller.admin.config.vo;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@ -9,20 +9,20 @@ import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; 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 @Data
public class ConfigExportReqVO { public class ConfigExportReqVO {
@ApiModelProperty(value = "参数名称", example = "模糊匹配") @Schema(description = "参数名称", example = "模糊匹配")
private String name; private String name;
@ApiModelProperty(value = "参数键名", example = "yunai.db.username", notes = "模糊匹配") @Schema(description = "参数键名", example = "yunai.db.username", notes = "模糊匹配")
private String key; private String key;
@ApiModelProperty(value = "参数类型", example = "1", notes = "参见 SysConfigTypeEnum 枚举") @Schema(description = "参数类型", example = "1", notes = "参见 SysConfigTypeEnum 枚举")
private Integer type; 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) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime; private LocalDateTime[] createTime;

View File

@ -1,8 +1,8 @@
package cn.iocoder.yudao.module.infra.controller.admin.config.vo; package cn.iocoder.yudao.module.infra.controller.admin.config.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ -12,22 +12,22 @@ import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; 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 @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class ConfigPageReqVO extends PageParam { public class ConfigPageReqVO extends PageParam {
@ApiModelProperty(value = "数据源名称", example = "模糊匹配") @Schema(description = "数据源名称", example = "模糊匹配")
private String name; private String name;
@ApiModelProperty(value = "参数键名", example = "yunai.db.username", notes = "模糊匹配") @Schema(description = "参数键名", example = "yunai.db.username", notes = "模糊匹配")
private String key; private String key;
@ApiModelProperty(value = "参数类型", example = "1", notes = "参见 SysConfigTypeEnum 枚举") @Schema(description = "参数类型", example = "1", notes = "参见 SysConfigTypeEnum 枚举")
private Integer type; 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) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime; private LocalDateTime[] createTime;

View File

@ -1,7 +1,7 @@
package cn.iocoder.yudao.module.infra.controller.admin.config.vo; package cn.iocoder.yudao.module.infra.controller.admin.config.vo;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -9,23 +9,23 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ApiModel("管理后台 - 参数配置信息 Response VO") @Schema(description = "管理后台 - 参数配置信息 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public class ConfigRespVO extends ConfigBaseVO { public class ConfigRespVO extends ConfigBaseVO {
@ApiModelProperty(value = "参数配置序号", required = true, example = "1024") @Schema(description = "参数配置序号", required = true, example = "1024")
private Long id; private Long id;
@ApiModelProperty(value = "参数键名", required = true, example = "yunai.db.username") @Schema(description = "参数键名", required = true, example = "yunai.db.username")
@NotBlank(message = "参数键名长度不能为空") @NotBlank(message = "参数键名长度不能为空")
@Size(max = 100, message = "参数键名长度不能超过100个字符") @Size(max = 100, message = "参数键名长度不能超过100个字符")
private String key; private String key;
@ApiModelProperty(value = "参数类型", required = true, example = "1", notes = "参见 SysConfigTypeEnum 枚举") @Schema(description = "参数类型", required = true, example = "1", notes = "参见 SysConfigTypeEnum 枚举")
private Integer type; private Integer type;
@ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") @Schema(description = "创建时间", required = true, example = "时间戳格式")
private LocalDateTime createTime; private LocalDateTime createTime;
} }

View File

@ -1,20 +1,20 @@
package cn.iocoder.yudao.module.infra.controller.admin.config.vo; package cn.iocoder.yudao.module.infra.controller.admin.config.vo;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
@ApiModel("管理后台 - 参数配置创建 Request VO") @Schema(description = "管理后台 - 参数配置创建 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class ConfigUpdateReqVO extends ConfigBaseVO { public class ConfigUpdateReqVO extends ConfigBaseVO {
@ApiModelProperty(value = "参数配置序号", required = true, example = "1024") @Schema(description = "参数配置序号", required = true, example = "1024")
@NotNull(message = "参数配置编号不能为空") @NotNull(message = "参数配置编号不能为空")
private Long id; private Long id;

View File

@ -7,9 +7,9 @@ import cn.iocoder.yudao.module.infra.controller.admin.db.vo.DataSourceConfigUpda
import cn.iocoder.yudao.module.infra.convert.db.DataSourceConfigConvert; import cn.iocoder.yudao.module.infra.convert.db.DataSourceConfigConvert;
import cn.iocoder.yudao.module.infra.dal.dataobject.db.DataSourceConfigDO; import cn.iocoder.yudao.module.infra.dal.dataobject.db.DataSourceConfigDO;
import cn.iocoder.yudao.module.infra.service.db.DataSourceConfigService; import cn.iocoder.yudao.module.infra.service.db.DataSourceConfigService;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.Operation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -20,7 +20,7 @@ import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Api(tags = "管理后台 - 数据源配置") @Tag(name = "管理后台 - 数据源配置")
@RestController @RestController
@RequestMapping("/infra/data-source-config") @RequestMapping("/infra/data-source-config")
@Validated @Validated
@ -30,14 +30,14 @@ public class DataSourceConfigController {
private DataSourceConfigService dataSourceConfigService; private DataSourceConfigService dataSourceConfigService;
@PostMapping("/create") @PostMapping("/create")
@ApiOperation("创建数据源配置") @Operation(summary = "创建数据源配置")
@PreAuthorize("@ss.hasPermission('infra:data-source-config:create')") @PreAuthorize("@ss.hasPermission('infra:data-source-config:create')")
public CommonResult<Long> createDataSourceConfig(@Valid @RequestBody DataSourceConfigCreateReqVO createReqVO) { public CommonResult<Long> createDataSourceConfig(@Valid @RequestBody DataSourceConfigCreateReqVO createReqVO) {
return success(dataSourceConfigService.createDataSourceConfig(createReqVO)); return success(dataSourceConfigService.createDataSourceConfig(createReqVO));
} }
@PutMapping("/update") @PutMapping("/update")
@ApiOperation("更新数据源配置") @Operation(summary = "更新数据源配置")
@PreAuthorize("@ss.hasPermission('infra:data-source-config:update')") @PreAuthorize("@ss.hasPermission('infra:data-source-config:update')")
public CommonResult<Boolean> updateDataSourceConfig(@Valid @RequestBody DataSourceConfigUpdateReqVO updateReqVO) { public CommonResult<Boolean> updateDataSourceConfig(@Valid @RequestBody DataSourceConfigUpdateReqVO updateReqVO) {
dataSourceConfigService.updateDataSourceConfig(updateReqVO); dataSourceConfigService.updateDataSourceConfig(updateReqVO);
@ -45,8 +45,8 @@ public class DataSourceConfigController {
} }
@DeleteMapping("/delete") @DeleteMapping("/delete")
@ApiOperation("删除数据源配置") @Operation(summary = "删除数据源配置")
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) @Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('infra:data-source-config:delete')") @PreAuthorize("@ss.hasPermission('infra:data-source-config:delete')")
public CommonResult<Boolean> deleteDataSourceConfig(@RequestParam("id") Long id) { public CommonResult<Boolean> deleteDataSourceConfig(@RequestParam("id") Long id) {
dataSourceConfigService.deleteDataSourceConfig(id); dataSourceConfigService.deleteDataSourceConfig(id);
@ -54,8 +54,8 @@ public class DataSourceConfigController {
} }
@GetMapping("/get") @GetMapping("/get")
@ApiOperation("获得数据源配置") @Operation(summary = "获得数据源配置")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('infra:data-source-config:query')") @PreAuthorize("@ss.hasPermission('infra:data-source-config:query')")
public CommonResult<DataSourceConfigRespVO> getDataSourceConfig(@RequestParam("id") Long id) { public CommonResult<DataSourceConfigRespVO> getDataSourceConfig(@RequestParam("id") Long id) {
DataSourceConfigDO dataSourceConfig = dataSourceConfigService.getDataSourceConfig(id); DataSourceConfigDO dataSourceConfig = dataSourceConfigService.getDataSourceConfig(id);
@ -63,7 +63,7 @@ public class DataSourceConfigController {
} }
@GetMapping("/list") @GetMapping("/list")
@ApiOperation("获得数据源配置列表") @Operation(summary = "获得数据源配置列表")
@PreAuthorize("@ss.hasPermission('infra:data-source-config:query')") @PreAuthorize("@ss.hasPermission('infra:data-source-config:query')")
public CommonResult<List<DataSourceConfigRespVO>> getDataSourceConfigList() { public CommonResult<List<DataSourceConfigRespVO>> getDataSourceConfigList() {
List<DataSourceConfigDO> list = dataSourceConfigService.getDataSourceConfigList(); List<DataSourceConfigDO> list = dataSourceConfigService.getDataSourceConfigList();

View File

@ -13,9 +13,9 @@ import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourcePrope
import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties; import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties;
import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource; import com.zaxxer.hikari.HikariDataSource;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
@ -27,7 +27,7 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
@Api(tags = "管理后台 - 数据库文档") @Tag(name = "管理后台 - 数据库文档")
@RestController @RestController
@RequestMapping("/infra/db-doc") @RequestMapping("/infra/db-doc")
public class DatabaseDocController { public class DatabaseDocController {
@ -42,8 +42,8 @@ public class DatabaseDocController {
private static final String DOC_DESCRIPTION = "文档描述"; private static final String DOC_DESCRIPTION = "文档描述";
@GetMapping("/export-html") @GetMapping("/export-html")
@ApiOperation("导出 html 格式的数据文档") @Operation(summary = "导出 html 格式的数据文档")
@ApiImplicitParam(name = "deleteFile", value = "是否删除在服务器本地生成的数据库文档", example = "true", @Parameter(name = "deleteFile", description = "是否删除在服务器本地生成的数据库文档", example = "true",
dataTypeClass = Boolean.class) dataTypeClass = Boolean.class)
public void exportHtml(@RequestParam(defaultValue = "true") Boolean deleteFile, public void exportHtml(@RequestParam(defaultValue = "true") Boolean deleteFile,
HttpServletResponse response) throws IOException { HttpServletResponse response) throws IOException {
@ -51,8 +51,8 @@ public class DatabaseDocController {
} }
@GetMapping("/export-word") @GetMapping("/export-word")
@ApiOperation("导出 word 格式的数据文档") @Operation(summary = "导出 word 格式的数据文档")
@ApiImplicitParam(name = "deleteFile", value = "是否删除在服务器本地生成的数据库文档", example = "true", @Parameter(name = "deleteFile", description = "是否删除在服务器本地生成的数据库文档", example = "true",
dataTypeClass = Boolean.class) dataTypeClass = Boolean.class)
public void exportWord(@RequestParam(defaultValue = "true") Boolean deleteFile, public void exportWord(@RequestParam(defaultValue = "true") Boolean deleteFile,
HttpServletResponse response) throws IOException { HttpServletResponse response) throws IOException {
@ -60,8 +60,8 @@ public class DatabaseDocController {
} }
@GetMapping("/export-markdown") @GetMapping("/export-markdown")
@ApiOperation("导出 markdown 格式的数据文档") @Operation(summary = "导出 markdown 格式的数据文档")
@ApiImplicitParam(name = "deleteFile", value = "是否删除在服务器本地生成的数据库文档", example = "true", @Parameter(name = "deleteFile", description = "是否删除在服务器本地生成的数据库文档", example = "true",
dataTypeClass = Boolean.class) dataTypeClass = Boolean.class)
public void exportMarkdown(@RequestParam(defaultValue = "true") Boolean deleteFile, public void exportMarkdown(@RequestParam(defaultValue = "true") Boolean deleteFile,
HttpServletResponse response) throws IOException { HttpServletResponse response) throws IOException {

View File

@ -12,15 +12,15 @@ import javax.validation.constraints.*;
@Data @Data
public class DataSourceConfigBaseVO { public class DataSourceConfigBaseVO {
@ApiModelProperty(value = "数据源名称", required = true, example = "test") @Schema(description = "数据源名称", required = true, example = "test")
@NotNull(message = "数据源名称不能为空") @NotNull(message = "数据源名称不能为空")
private String name; private String name;
@ApiModelProperty(value = "数据源连接", required = true, example = "jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro") @Schema(description = "数据源连接", required = true, example = "jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro")
@NotNull(message = "数据源连接不能为空") @NotNull(message = "数据源连接不能为空")
private String url; private String url;
@ApiModelProperty(value = "用户名", required = true, example = "root") @Schema(description = "用户名", required = true, example = "root")
@NotNull(message = "用户名不能为空") @NotNull(message = "用户名不能为空")
private String username; private String username;

View File

@ -5,13 +5,13 @@ import java.util.*;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import javax.validation.constraints.*; import javax.validation.constraints.*;
@ApiModel("管理后台 - 数据源配置创建 Request VO") @Schema(description = "管理后台 - 数据源配置创建 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class DataSourceConfigCreateReqVO extends DataSourceConfigBaseVO { public class DataSourceConfigCreateReqVO extends DataSourceConfigBaseVO {
@ApiModelProperty(value = "密码", required = true, example = "123456") @Schema(description = "密码", required = true, example = "123456")
@NotNull(message = "密码不能为空") @NotNull(message = "密码不能为空")
private String password; private String password;

View File

@ -6,16 +6,16 @@ import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import io.swagger.annotations.*; import io.swagger.annotations.*;
@ApiModel("管理后台 - 数据源配置 Response VO") @Schema(description = "管理后台 - 数据源配置 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class DataSourceConfigRespVO extends DataSourceConfigBaseVO { public class DataSourceConfigRespVO extends DataSourceConfigBaseVO {
@ApiModelProperty(value = "主键编号", required = true, example = "1024") @Schema(description = "主键编号", required = true, example = "1024")
private Integer id; private Integer id;
@ApiModelProperty(value = "创建时间", required = true) @Schema(description = "创建时间", required = true)
private LocalDateTime createTime; private LocalDateTime createTime;
} }

View File

@ -5,17 +5,17 @@ import java.util.*;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import javax.validation.constraints.*; import javax.validation.constraints.*;
@ApiModel("管理后台 - 数据源配置更新 Request VO") @Schema(description = "管理后台 - 数据源配置更新 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class DataSourceConfigUpdateReqVO extends DataSourceConfigBaseVO { public class DataSourceConfigUpdateReqVO extends DataSourceConfigBaseVO {
@ApiModelProperty(value = "主键编号", required = true, example = "1024") @Schema(description = "主键编号", required = true, example = "1024")
@NotNull(message = "主键编号不能为空") @NotNull(message = "主键编号不能为空")
private Long id; private Long id;
@ApiModelProperty(value = "密码", required = true, example = "123456") @Schema(description = "密码", required = true, example = "123456")
@NotNull(message = "密码不能为空") @NotNull(message = "密码不能为空")
private String password; private String password;

View File

@ -9,9 +9,9 @@ import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigU
import cn.iocoder.yudao.module.infra.convert.file.FileConfigConvert; import cn.iocoder.yudao.module.infra.convert.file.FileConfigConvert;
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileConfigDO; import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileConfigDO;
import cn.iocoder.yudao.module.infra.service.file.FileConfigService; import cn.iocoder.yudao.module.infra.service.file.FileConfigService;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.Operation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -21,7 +21,7 @@ import javax.validation.Valid;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Api(tags = "管理后台 - 文件配置") @Tag(name = "管理后台 - 文件配置")
@RestController @RestController
@RequestMapping("/infra/file-config") @RequestMapping("/infra/file-config")
@Validated @Validated
@ -31,14 +31,14 @@ public class FileConfigController {
private FileConfigService fileConfigService; private FileConfigService fileConfigService;
@PostMapping("/create") @PostMapping("/create")
@ApiOperation("创建文件配置") @Operation(summary = "创建文件配置")
@PreAuthorize("@ss.hasPermission('infra:file-config:create')") @PreAuthorize("@ss.hasPermission('infra:file-config:create')")
public CommonResult<Long> createFileConfig(@Valid @RequestBody FileConfigCreateReqVO createReqVO) { public CommonResult<Long> createFileConfig(@Valid @RequestBody FileConfigCreateReqVO createReqVO) {
return success(fileConfigService.createFileConfig(createReqVO)); return success(fileConfigService.createFileConfig(createReqVO));
} }
@PutMapping("/update") @PutMapping("/update")
@ApiOperation("更新文件配置") @Operation(summary = "更新文件配置")
@PreAuthorize("@ss.hasPermission('infra:file-config:update')") @PreAuthorize("@ss.hasPermission('infra:file-config:update')")
public CommonResult<Boolean> updateFileConfig(@Valid @RequestBody FileConfigUpdateReqVO updateReqVO) { public CommonResult<Boolean> updateFileConfig(@Valid @RequestBody FileConfigUpdateReqVO updateReqVO) {
fileConfigService.updateFileConfig(updateReqVO); fileConfigService.updateFileConfig(updateReqVO);
@ -46,7 +46,7 @@ public class FileConfigController {
} }
@PutMapping("/update-master") @PutMapping("/update-master")
@ApiOperation("更新文件配置为 Master") @Operation(summary = "更新文件配置为 Master")
@PreAuthorize("@ss.hasPermission('infra:file-config:update')") @PreAuthorize("@ss.hasPermission('infra:file-config:update')")
public CommonResult<Boolean> updateFileConfigMaster(@RequestParam("id") Long id) { public CommonResult<Boolean> updateFileConfigMaster(@RequestParam("id") Long id) {
fileConfigService.updateFileConfigMaster(id); fileConfigService.updateFileConfigMaster(id);
@ -54,8 +54,8 @@ public class FileConfigController {
} }
@DeleteMapping("/delete") @DeleteMapping("/delete")
@ApiOperation("删除文件配置") @Operation(summary = "删除文件配置")
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) @Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('infra:file-config:delete')") @PreAuthorize("@ss.hasPermission('infra:file-config:delete')")
public CommonResult<Boolean> deleteFileConfig(@RequestParam("id") Long id) { public CommonResult<Boolean> deleteFileConfig(@RequestParam("id") Long id) {
fileConfigService.deleteFileConfig(id); fileConfigService.deleteFileConfig(id);
@ -63,8 +63,8 @@ public class FileConfigController {
} }
@GetMapping("/get") @GetMapping("/get")
@ApiOperation("获得文件配置") @Operation(summary = "获得文件配置")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('infra:file-config:query')") @PreAuthorize("@ss.hasPermission('infra:file-config:query')")
public CommonResult<FileConfigRespVO> getFileConfig(@RequestParam("id") Long id) { public CommonResult<FileConfigRespVO> getFileConfig(@RequestParam("id") Long id) {
FileConfigDO fileConfig = fileConfigService.getFileConfig(id); FileConfigDO fileConfig = fileConfigService.getFileConfig(id);
@ -72,7 +72,7 @@ public class FileConfigController {
} }
@GetMapping("/page") @GetMapping("/page")
@ApiOperation("获得文件配置分页") @Operation(summary = "获得文件配置分页")
@PreAuthorize("@ss.hasPermission('infra:file-config:query')") @PreAuthorize("@ss.hasPermission('infra:file-config:query')")
public CommonResult<PageResult<FileConfigRespVO>> getFileConfigPage(@Valid FileConfigPageReqVO pageVO) { public CommonResult<PageResult<FileConfigRespVO>> getFileConfigPage(@Valid FileConfigPageReqVO pageVO) {
PageResult<FileConfigDO> pageResult = fileConfigService.getFileConfigPage(pageVO); PageResult<FileConfigDO> pageResult = fileConfigService.getFileConfigPage(pageVO);
@ -80,7 +80,7 @@ public class FileConfigController {
} }
@GetMapping("/test") @GetMapping("/test")
@ApiOperation("测试文件配置是否正确") @Operation(summary = "测试文件配置是否正确")
@PreAuthorize("@ss.hasPermission('infra:file-config:query')") @PreAuthorize("@ss.hasPermission('infra:file-config:query')")
public CommonResult<String> testFileConfig(@RequestParam("id") Long id) throws Exception { public CommonResult<String> testFileConfig(@RequestParam("id") Long id) throws Exception {
String url = fileConfigService.testFileConfig(id); String url = fileConfigService.testFileConfig(id);

View File

@ -12,9 +12,9 @@ import cn.iocoder.yudao.module.infra.controller.admin.file.vo.file.FileUploadReq
import cn.iocoder.yudao.module.infra.convert.file.FileConvert; import cn.iocoder.yudao.module.infra.convert.file.FileConvert;
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO; import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
import cn.iocoder.yudao.module.infra.service.file.FileService; import cn.iocoder.yudao.module.infra.service.file.FileService;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
@ -30,7 +30,7 @@ import javax.validation.Valid;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Api(tags = "管理后台 - 文件存储") @Tag(name = "管理后台 - 文件存储")
@RestController @RestController
@RequestMapping("/infra/file") @RequestMapping("/infra/file")
@Validated @Validated
@ -41,7 +41,7 @@ public class FileController {
private FileService fileService; private FileService fileService;
@PostMapping("/upload") @PostMapping("/upload")
@ApiOperation("上传文件") @Operation(summary = "上传文件")
@OperateLog(logArgs = false) // 上传文件,没有记录操作日志的必要 @OperateLog(logArgs = false) // 上传文件,没有记录操作日志的必要
public CommonResult<String> uploadFile(FileUploadReqVO uploadReqVO) throws Exception { public CommonResult<String> uploadFile(FileUploadReqVO uploadReqVO) throws Exception {
MultipartFile file = uploadReqVO.getFile(); MultipartFile file = uploadReqVO.getFile();
@ -50,8 +50,8 @@ public class FileController {
} }
@DeleteMapping("/delete") @DeleteMapping("/delete")
@ApiOperation("删除文件") @Operation(summary = "删除文件")
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) @Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('infra:file:delete')") @PreAuthorize("@ss.hasPermission('infra:file:delete')")
public CommonResult<Boolean> deleteFile(@RequestParam("id") Long id) throws Exception { public CommonResult<Boolean> deleteFile(@RequestParam("id") Long id) throws Exception {
fileService.deleteFile(id); fileService.deleteFile(id);
@ -60,8 +60,8 @@ public class FileController {
@GetMapping("/{configId}/get/**") @GetMapping("/{configId}/get/**")
@PermitAll @PermitAll
@ApiOperation("下载文件") @Operation(summary = "下载文件")
@ApiImplicitParam(name = "configId", value = "配置编号", required = true, dataTypeClass = Long.class) @Parameter(name = "configId", description = "配置编号", required = true)
public void getFileContent(HttpServletRequest request, public void getFileContent(HttpServletRequest request,
HttpServletResponse response, HttpServletResponse response,
@PathVariable("configId") Long configId) throws Exception { @PathVariable("configId") Long configId) throws Exception {
@ -82,7 +82,7 @@ public class FileController {
} }
@GetMapping("/page") @GetMapping("/page")
@ApiOperation("获得文件分页") @Operation(summary = "获得文件分页")
@PreAuthorize("@ss.hasPermission('infra:file:query')") @PreAuthorize("@ss.hasPermission('infra:file:query')")
public CommonResult<PageResult<FileRespVO>> getFilePage(@Valid FilePageReqVO pageVO) { public CommonResult<PageResult<FileRespVO>> getFilePage(@Valid FilePageReqVO pageVO) {
PageResult<FileDO> pageResult = fileService.getFilePage(pageVO); PageResult<FileDO> pageResult = fileService.getFilePage(pageVO);

View File

@ -1,6 +1,6 @@
package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config; package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
@ -12,11 +12,11 @@ import javax.validation.constraints.NotNull;
@Data @Data
public class FileConfigBaseVO { public class FileConfigBaseVO {
@ApiModelProperty(value = "配置名", required = true, example = "S3 - 阿里云") @Schema(description = "配置名", required = true, example = "S3 - 阿里云")
@NotNull(message = "配置名不能为空") @NotNull(message = "配置名不能为空")
private String name; private String name;
@ApiModelProperty(value = "备注", example = "我是备注") @Schema(description = "备注", example = "我是备注")
private String remark; private String remark;
} }

View File

@ -1,7 +1,7 @@
package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config; package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ -9,17 +9,17 @@ import lombok.ToString;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Map; import java.util.Map;
@ApiModel("管理后台 - 文件配置创建 Request VO") @Schema(description = "管理后台 - 文件配置创建 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class FileConfigCreateReqVO extends FileConfigBaseVO { public class FileConfigCreateReqVO extends FileConfigBaseVO {
@ApiModelProperty(value = "存储器", required = true, example = "1", notes = "参见 FileStorageEnum 枚举类") @Schema(description = "存储器", required = true, example = "1", notes = "参见 FileStorageEnum 枚举类")
@NotNull(message = "存储器不能为空") @NotNull(message = "存储器不能为空")
private Integer storage; private Integer storage;
@ApiModelProperty(value = "存储配置", required = true, notes = "配置是动态参数,所以使用 Map 接收") @Schema(description = "存储配置", required = true, notes = "配置是动态参数,所以使用 Map 接收")
@NotNull(message = "存储配置不能为空") @NotNull(message = "存储配置不能为空")
private Map<String, Object> config; private Map<String, Object> config;

View File

@ -1,8 +1,8 @@
package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config; package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ -12,19 +12,19 @@ import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; 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 @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class FileConfigPageReqVO extends PageParam { public class FileConfigPageReqVO extends PageParam {
@ApiModelProperty(value = "配置名", example = "S3 - 阿里云") @Schema(description = "配置名", example = "S3 - 阿里云")
private String name; private String name;
@ApiModelProperty(value = "存储器", example = "1") @Schema(description = "存储器", example = "1")
private Integer storage; private Integer storage;
@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) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime; private LocalDateTime[] createTime;

View File

@ -1,8 +1,8 @@
package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config; package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config;
import cn.iocoder.yudao.framework.file.core.client.FileClientConfig; import cn.iocoder.yudao.framework.file.core.client.FileClientConfig;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ -10,27 +10,27 @@ import lombok.ToString;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ApiModel("管理后台 - 文件配置 Response VO") @Schema(description = "管理后台 - 文件配置 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class FileConfigRespVO extends FileConfigBaseVO { public class FileConfigRespVO extends FileConfigBaseVO {
@ApiModelProperty(value = "编号", required = true, example = "1") @Schema(description = "编号", required = true, example = "1")
private Long id; private Long id;
@ApiModelProperty(value = "存储器", required = true, example = "1", notes = "参见 FileStorageEnum 枚举类") @Schema(description = "存储器", required = true, example = "1", notes = "参见 FileStorageEnum 枚举类")
@NotNull(message = "存储器不能为空") @NotNull(message = "存储器不能为空")
private Integer storage; private Integer storage;
@ApiModelProperty(value = "是否为主配置", required = true, example = "true") @Schema(description = "是否为主配置", required = true, example = "true")
@NotNull(message = "是否为主配置不能为空") @NotNull(message = "是否为主配置不能为空")
private Boolean master; private Boolean master;
@ApiModelProperty(value = "存储配置", required = true) @Schema(description = "存储配置", required = true)
private FileClientConfig config; private FileClientConfig config;
@ApiModelProperty(value = "创建时间", required = true) @Schema(description = "创建时间", required = true)
private LocalDateTime createTime; private LocalDateTime createTime;
} }

View File

@ -1,7 +1,7 @@
package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config; package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ -9,17 +9,17 @@ import lombok.ToString;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Map; import java.util.Map;
@ApiModel("管理后台 - 文件配置更新 Request VO") @Schema(description = "管理后台 - 文件配置更新 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class FileConfigUpdateReqVO extends FileConfigBaseVO { public class FileConfigUpdateReqVO extends FileConfigBaseVO {
@ApiModelProperty(value = "编号", required = true, example = "1") @Schema(description = "编号", required = true, example = "1")
@NotNull(message = "编号不能为空") @NotNull(message = "编号不能为空")
private Long id; private Long id;
@ApiModelProperty(value = "存储配置", required = true, notes = "配置是动态参数,所以使用 Map 接收") @Schema(description = "存储配置", required = true, notes = "配置是动态参数,所以使用 Map 接收")
@NotNull(message = "存储配置不能为空") @NotNull(message = "存储配置不能为空")
private Map<String, Object> config; private Map<String, Object> config;

View File

@ -1,8 +1,8 @@
package cn.iocoder.yudao.module.infra.controller.admin.file.vo.file; package cn.iocoder.yudao.module.infra.controller.admin.file.vo.file;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ -12,19 +12,19 @@ import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; 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 @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class FilePageReqVO extends PageParam { public class FilePageReqVO extends PageParam {
@ApiModelProperty(value = "文件路径", example = "yudao", notes = "模糊匹配") @Schema(description = "文件路径", example = "yudao", notes = "模糊匹配")
private String path; private String path;
@ApiModelProperty(value = "文件类型", example = "jpg", notes = "模糊匹配") @Schema(description = "文件类型", example = "jpg", notes = "模糊匹配")
private String type; private String 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) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime; private LocalDateTime[] createTime;

View File

@ -1,31 +1,31 @@
package cn.iocoder.yudao.module.infra.controller.admin.file.vo.file; package cn.iocoder.yudao.module.infra.controller.admin.file.vo.file;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ApiModel(value = "管理后台 - 文件 Response VO", description = "不返回 content 字段,太大") @Schema(description = value = "管理后台 - 文件 Response VO", description = "不返回 content 字段,太大")
@Data @Data
public class FileRespVO { public class FileRespVO {
@ApiModelProperty(value = "文件编号", required = true, example = "1024") @Schema(description = "文件编号", required = true, example = "1024")
private Long id; private Long id;
@ApiModelProperty(value = "文件路径", required = true, example = "yudao.jpg") @Schema(description = "文件路径", required = true, example = "yudao.jpg")
private String path; private String path;
@ApiModelProperty(value = "文件 URL", required = true, example = "https://www.iocoder.cn/yudao.jpg") @Schema(description = "文件 URL", required = true, example = "https://www.iocoder.cn/yudao.jpg")
private String url; private String url;
@ApiModelProperty(value = "文件类型", example = "jpg") @Schema(description = "文件类型", example = "jpg")
private String type; private String type;
@ApiModelProperty(value = "文件大小", example = "2048", required = true) @Schema(description = "文件大小", example = "2048", required = true)
private Integer size; private Integer size;
@ApiModelProperty(value = "创建时间", required = true) @Schema(description = "创建时间", required = true)
private LocalDateTime createTime; private LocalDateTime createTime;
} }

View File

@ -1,21 +1,21 @@
package cn.iocoder.yudao.module.infra.controller.admin.file.vo.file; package cn.iocoder.yudao.module.infra.controller.admin.file.vo.file;
import io.swagger.annotations.ApiModel; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiModelProperty; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
@ApiModel(value = "管理后台 - 上传文件 Request VO") @Schema(description = value = "管理后台 - 上传文件 Request VO")
@Data @Data
public class FileUploadReqVO { public class FileUploadReqVO {
@ApiModelProperty(value = "文件附件", required = true) @Schema(description = "文件附件", required = true)
@NotNull(message = "文件附件不能为空") @NotNull(message = "文件附件不能为空")
private MultipartFile file; private MultipartFile file;
@ApiModelProperty(value = "文件附件", example = "yudaoyuanma.png") @Schema(description = "文件附件", example = "yudaoyuanma.png")
private String path; private String path;
} }

Some files were not shown because too many files have changed in this diff Show More