diff --git a/README.md b/README.md index 875ca57d7..a64d9ffa8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -**严肃声明:现在、未来都不会有商业版本,所有代码全部开源!** +**严肃声明:现在、未来都不会有商业版本,所有代码全部开源!!** **「我喜欢写代码,乐此不疲」** **「我喜欢做开源,以此为乐」** @@ -229,7 +229,7 @@ ps:核心功能已经实现,正在对接微信小程序中... | 框架 | 说明 | 版本 | 学习指南 | |---------------------------------------------------------------------------------------------|------------------|-------------|----------------------------------------------------------------| -| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.7.7 | [文档](https://github.com/YunaiV/SpringBoot-Labs) | +| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.7.8 | [文档](https://github.com/YunaiV/SpringBoot-Labs) | | [MySQL](https://www.mysql.com/cn/) | 数据库服务器 | 5.7 / 8.0+ | | | [Druid](https://github.com/alibaba/druid) | JDBC 连接池、监控组件 | 1.2.15 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) | | [MyBatis Plus](https://mp.baomidou.com/) | MyBatis 增强工具包 | 3.5.3.1 | [文档](http://www.iocoder.cn/Spring-Boot/MyBatis/?yudao) | @@ -241,7 +241,7 @@ ps:核心功能已经实现,正在对接微信小程序中... | [Hibernate Validator](https://github.com/hibernate/hibernate-validator) | 参数校验组件 | 6.2.5 | [文档](http://www.iocoder.cn/Spring-Boot/Validation/?yudao) | | [Flowable](https://github.com/flowable/flowable-engine) | 工作流引擎 | 6.8.0 | [文档](https://doc.iocoder.cn/bpm/) | | [Quartz](https://github.com/quartz-scheduler) | 任务调度组件 | 2.3.2 | [文档](http://www.iocoder.cn/Spring-Boot/Job/?yudao) | -| [Knife4j](https://gitee.com/xiaoym/knife4j) | Swagger 增强 UI 实现 | 3.0.3 | [文档](http://www.iocoder.cn/Spring-Boot/Swagger/?yudao) | +| [Knife4j](https://gitee.com/xiaoym/knife4j) | Swagger 增强 UI 实现 | 4.0.0 | [文档](http://www.iocoder.cn/Spring-Boot/Swagger/?yudao) | | [Resilience4j](https://github.com/resilience4j/resilience4j) | 服务保障组件 | 1.7.1 | [文档](http://www.iocoder.cn/Spring-Boot/Resilience4j/?yudao) | | [SkyWalking](https://skywalking.apache.org/) | 分布式应用追踪系统 | 8.12.0 | [文档](http://www.iocoder.cn/Spring-Boot/SkyWalking/?yudao) | | [Spring Boot Admin](https://github.com/codecentric/spring-boot-admin) | Spring Boot 监控平台 | 2.7.10 | [文档](http://www.iocoder.cn/Spring-Boot/Admin/?yudao) | diff --git a/pom.xml b/pom.xml index 86eabaec7..9a2cf0e72 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ - + yudao-example diff --git a/sql/mysql/ruoyi-vue-pro.sql b/sql/mysql/ruoyi-vue-pro.sql index 905338a86..93a49a6a8 100644 --- a/sql/mysql/ruoyi-vue-pro.sql +++ b/sql/mysql/ruoyi-vue-pro.sql @@ -3251,7 +3251,7 @@ CREATE TABLE `system_tenant` ( `package_id` bigint NOT NULL COMMENT '租户套餐编号', `expire_time` datetime NOT NULL COMMENT '过期时间', `account_count` int NOT NULL COMMENT '账号数量', - `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建者', + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', @@ -3282,7 +3282,7 @@ CREATE TABLE `system_tenant_package` ( `status` tinyint NOT NULL DEFAULT 0 COMMENT '租户状态(0正常 1停用)', `remark` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '备注', `menu_ids` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '关联的菜单编号', - `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建者', + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', diff --git a/sql/postgresql/ruoyi-vue-pro.sql b/sql/postgresql/ruoyi-vue-pro.sql index 7484486c2..c16a51f75 100644 --- a/sql/postgresql/ruoyi-vue-pro.sql +++ b/sql/postgresql/ruoyi-vue-pro.sql @@ -3817,7 +3817,7 @@ CREATE TABLE "system_tenant" ( "package_id" int8 NOT NULL, "expire_time" timestamp(6) NOT NULL, "account_count" int4 NOT NULL, - "creator" varchar(64) COLLATE "pg_catalog"."default" NOT NULL, + "creator" varchar(64) COLLATE "pg_catalog"."default", "create_time" timestamp(6) NOT NULL, "updater" varchar(64) COLLATE "pg_catalog"."default", "update_time" timestamp(6) NOT NULL, @@ -3860,7 +3860,7 @@ CREATE TABLE "system_tenant_package" ( "status" int2 NOT NULL, "remark" varchar(256) COLLATE "pg_catalog"."default", "menu_ids" varchar(2048) COLLATE "pg_catalog"."default" NOT NULL, - "creator" varchar(64) COLLATE "pg_catalog"."default" NOT NULL, + "creator" varchar(64) COLLATE "pg_catalog"."default", "create_time" timestamp(6) NOT NULL, "updater" varchar(64) COLLATE "pg_catalog"."default", "update_time" timestamp(6) NOT NULL, diff --git a/sql/sqlserver/ruoyi-vue-pro.sql b/sql/sqlserver/ruoyi-vue-pro.sql index 386e9bd2e..dd728f2c7 100644 --- a/sql/sqlserver/ruoyi-vue-pro.sql +++ b/sql/sqlserver/ruoyi-vue-pro.sql @@ -10600,7 +10600,7 @@ CREATE TABLE [dbo].[system_tenant] ( [package_id] bigint NOT NULL, [expire_time] datetime2(7) NOT NULL, [account_count] int NOT NULL, - [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [create_time] datetime2(7) NOT NULL, [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [update_time] datetime2(7) NOT NULL, @@ -10761,7 +10761,7 @@ CREATE TABLE [dbo].[system_tenant_package] ( [status] tinyint NOT NULL, [remark] nvarchar(256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [menu_ids] nvarchar(2048) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, - [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [create_time] datetime2(7) NOT NULL, [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [update_time] datetime2(7) NOT NULL, diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index ec6e062ea..45c1ee999 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -18,8 +18,8 @@ 2.7.8 + 1.6.14 4.0.0 - 1.6.8 2.5 1.2.15 @@ -36,7 +36,7 @@ 0.33.0 7.2.11.RELEASE - 1.0.5 + 1.0.6 4.11.0 6.8.0 @@ -172,27 +172,13 @@ com.github.xiaoymin - knife4j-openapi2-spring-boot-starter + knife4j-openapi3-spring-boot-starter ${knife4j.version} - - - mapstruct - org.mapstruct - - - guava - com.google.guava - - - swagger-annotations - io.swagger - - - io.swagger - swagger-annotations - ${swagger-annotations.version} + org.springdoc + springdoc-openapi-ui + ${springdoc.version} @@ -235,8 +221,6 @@ ${redisson.version} - - cn.iocoder.boot @@ -302,16 +286,16 @@ org.apache.skywalking apm-toolkit-opentracing ${skywalking.version} - - - - - - - - - - + + + + + + + + + + io.opentracing @@ -474,7 +458,7 @@ org.freemarker freemarker - + com.alibaba fastjson diff --git a/yudao-framework/yudao-common/pom.xml b/yudao-framework/yudao-common/pom.xml index 2ad12ad87..760160330 100644 --- a/yudao-framework/yudao-common/pom.xml +++ b/yudao-framework/yudao-common/pom.xml @@ -59,8 +59,8 @@ - io.swagger - swagger-annotations + org.springdoc + springdoc-openapi-ui provided diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageParam.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageParam.java index 80029703b..9c553055a 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageParam.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageParam.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.framework.common.pojo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.Min; @@ -9,19 +8,19 @@ import javax.validation.constraints.Max; import javax.validation.constraints.NotNull; import java.io.Serializable; -@ApiModel("分页参数") +@Schema(description="分页参数") @Data public class PageParam implements Serializable { private static final Integer PAGE_NO = 1; private static final Integer PAGE_SIZE = 10; - @ApiModelProperty(value = "页码,从 1 开始", required = true,example = "1") + @Schema(description = "页码,从 1 开始", required = true,example = "1") @NotNull(message = "页码不能为空") @Min(value = 1, message = "页码最小值为 1") private Integer pageNo = PAGE_NO; - @ApiModelProperty(value = "每页条数,最大值为 100", required = true, example = "10") + @Schema(description = "每页条数,最大值为 100", required = true, example = "10") @NotNull(message = "每页条数不能为空") @Min(value = 1, message = "每页条数最小值为 1") @Max(value = 100, message = "每页条数最大值为 100") diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageResult.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageResult.java index dbdeb85ba..ff167d149 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageResult.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageResult.java @@ -1,21 +1,20 @@ package cn.iocoder.yudao.framework.common.pojo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.io.Serializable; import java.util.ArrayList; import java.util.List; -@ApiModel("分页结果") +@Schema(description = "分页结果") @Data public final class PageResult implements Serializable { - @ApiModelProperty(value = "数据", required = true) + @Schema(description = "数据", required = true) private List list; - @ApiModelProperty(value = "总量", required = true) + @Schema(description = "总量", required = true) private Long total; public PageResult() { diff --git a/yudao-framework/yudao-spring-boot-starter-banner/src/main/java/cn/iocoder/yudao/framework/banner/core/BannerApplicationRunner.java b/yudao-framework/yudao-spring-boot-starter-banner/src/main/java/cn/iocoder/yudao/framework/banner/core/BannerApplicationRunner.java index 645444e4f..c01d419f4 100644 --- a/yudao-framework/yudao-spring-boot-starter-banner/src/main/java/cn/iocoder/yudao/framework/banner/core/BannerApplicationRunner.java +++ b/yudao-framework/yudao-spring-boot-starter-banner/src/main/java/cn/iocoder/yudao/framework/banner/core/BannerApplicationRunner.java @@ -44,6 +44,10 @@ public class BannerApplicationRunner implements ApplicationRunner { if (isNotPresent("cn.iocoder.yudao.module.mp.framework.mp.config.MpConfiguration")) { System.out.println("[微信公众号 yudao-module-mp - 已禁用][参考 https://doc.iocoder.cn/mp/build/ 开启]"); } + // 微信公众号 + if (isNotPresent("cn.iocoder.yudao.module.trade.framework.web.config.TradeWebConfiguration")) { + System.out.println("[商城 yudao-module-mall - 已禁用][参考 https://doc.iocoder.cn/mall/build/ 开启]"); + } }); } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/util/DataPermissionUtils.java b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/util/DataPermissionUtils.java new file mode 100644 index 000000000..c154bd5f5 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/util/DataPermissionUtils.java @@ -0,0 +1,43 @@ +package cn.iocoder.yudao.framework.datapermission.core.util; + +import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission; +import cn.iocoder.yudao.framework.datapermission.core.aop.DataPermissionContextHolder; +import lombok.SneakyThrows; + +/** + * 数据权限 Util + * + * @author 芋道源码 + */ +public class DataPermissionUtils { + + private static DataPermission DATA_PERMISSION_DISABLE; + + @DataPermission(enable = false) + @SneakyThrows + private static DataPermission getDisableDataPermissionDisable() { + if (DATA_PERMISSION_DISABLE == null) { + DATA_PERMISSION_DISABLE = DataPermissionUtils.class + .getDeclaredMethod("getDisableDataPermissionDisable") + .getAnnotation(DataPermission.class); + } + return DATA_PERMISSION_DISABLE; + } + + /** + * 忽略数据权限,执行对应的逻辑 + * + * @param runnable 逻辑 + */ + public static void executeIgnore(Runnable runnable) { + DataPermission dataPermission = getDisableDataPermissionDisable(); + DataPermissionContextHolder.add(dataPermission); + try { + // 执行 runnable + runnable.run(); + } finally { + DataPermissionContextHolder.remove(); + } + } + +} diff --git a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/util/DataPermissionUtilsTest.java b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/util/DataPermissionUtilsTest.java new file mode 100644 index 000000000..1cc57c258 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/util/DataPermissionUtilsTest.java @@ -0,0 +1,15 @@ +package cn.iocoder.yudao.framework.datapermission.core.util; + +import cn.iocoder.yudao.framework.datapermission.core.aop.DataPermissionContextHolder; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +public class DataPermissionUtilsTest { + + @Test + public void testExecuteIgnore() { + DataPermissionUtils.executeIgnore(() -> assertFalse(DataPermissionContextHolder.get().enable())); + } + +} diff --git a/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/core/generator/ErrorCodeAutoGeneratorImpl.java b/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/core/generator/ErrorCodeAutoGeneratorImpl.java index a7f6c2835..d670c1829 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/core/generator/ErrorCodeAutoGeneratorImpl.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/core/generator/ErrorCodeAutoGeneratorImpl.java @@ -49,7 +49,7 @@ public class ErrorCodeAutoGeneratorImpl implements ErrorCodeAutoGenerator { log.info("[execute][解析到错误码数量为 ({}) 个]", autoGenerateDTOs.size()); // 第二步,写入到 system 服务 - errorCodeApi.autoGenerateErrorCodes(autoGenerateDTOs); + errorCodeApi.autoGenerateErrorCodeList(autoGenerateDTOs); log.info("[execute][写入到 system 组件完成]"); } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/annotations/OperateLog.java b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/annotations/OperateLog.java index 2f9ecaf8f..c9a117cb4 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/annotations/OperateLog.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/annotations/OperateLog.java @@ -1,8 +1,8 @@ package cn.iocoder.yudao.framework.operatelog.core.annotations; import cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/aop/OperateLogAspect.java b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/aop/OperateLogAspect.java index 75819cbe1..6bba573fb 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/aop/OperateLogAspect.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/aop/OperateLogAspect.java @@ -15,8 +15,8 @@ import cn.iocoder.yudao.framework.operatelog.core.service.OperateLog; import cn.iocoder.yudao.framework.operatelog.core.service.OperateLogFrameworkService; import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; import com.google.common.collect.Maps; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; import lombok.extern.slf4j.Slf4j; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; @@ -71,15 +71,15 @@ public class OperateLogAspect { @Resource private OperateLogFrameworkService operateLogFrameworkService; - @Around("@annotation(apiOperation)") - public Object around(ProceedingJoinPoint joinPoint, ApiOperation apiOperation) throws Throwable { + @Around("@annotation(operation)") + public Object around(ProceedingJoinPoint joinPoint, Operation operation) throws Throwable { // 可能也添加了 @ApiOperation 注解 cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog = getMethodAnnotation(joinPoint, cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog.class); - return around0(joinPoint, operateLog, apiOperation); + return around0(joinPoint, operateLog, operation); } - @Around("!@annotation(io.swagger.annotations.ApiOperation) && @annotation(operateLog)") + @Around("!@annotation(io.swagger.v3.oas.annotations.Operation) && @annotation(operateLog)") // 兼容处理,只添加 @OperateLog 注解的情况 public Object around(ProceedingJoinPoint joinPoint, cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog) throws Throwable { @@ -88,7 +88,7 @@ public class OperateLogAspect { private Object around0(ProceedingJoinPoint joinPoint, cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, - ApiOperation apiOperation) throws Throwable { + Operation operation) throws Throwable { // 目前,只有管理员,才记录操作日志!所以非管理员,直接调用,不进行记录 Integer userType = WebFrameworkUtils.getLoginUserType(); if (!Objects.equals(userType, UserTypeEnum.ADMIN.getValue())) { @@ -101,10 +101,10 @@ public class OperateLogAspect { // 执行原有方法 Object result = joinPoint.proceed(); // 记录正常执行时的操作日志 - this.log(joinPoint, operateLog, apiOperation, startTime, result, null); + this.log(joinPoint, operateLog, operation, startTime, result, null); return result; } catch (Throwable exception) { - this.log(joinPoint, operateLog, apiOperation, startTime, null, exception); + this.log(joinPoint, operateLog, operation, startTime, null, exception); throw exception; } finally { clearThreadLocal(); @@ -129,7 +129,7 @@ public class OperateLogAspect { private void log(ProceedingJoinPoint joinPoint, cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, - ApiOperation apiOperation, + Operation operation, LocalDateTime startTime, Object result, Throwable exception) { try { // 判断不记录的情况 @@ -137,16 +137,16 @@ public class OperateLogAspect { return; } // 真正记录操作日志 - this.log0(joinPoint, operateLog, apiOperation, startTime, result, exception); + this.log0(joinPoint, operateLog, operation, startTime, result, exception); } catch (Throwable ex) { log.error("[log][记录操作日志时,发生异常,其中参数是 joinPoint({}) operateLog({}) apiOperation({}) result({}) exception({}) ]", - joinPoint, operateLog, apiOperation, result, exception, ex); + joinPoint, operateLog, operation, result, exception, ex); } } private void log0(ProceedingJoinPoint joinPoint, cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, - ApiOperation apiOperation, + Operation operation, LocalDateTime startTime, Object result, Throwable exception) { OperateLog operateLogObj = new OperateLog(); // 补全通用字段 @@ -155,7 +155,7 @@ public class OperateLogAspect { // 补充用户信息 fillUserFields(operateLogObj); // 补全模块信息 - fillModuleFields(operateLogObj, joinPoint, operateLog, apiOperation); + fillModuleFields(operateLogObj, joinPoint, operateLog, operation); // 补全请求信息 fillRequestFields(operateLogObj); // 补全方法信息 @@ -173,21 +173,21 @@ public class OperateLogAspect { private static void fillModuleFields(OperateLog operateLogObj, ProceedingJoinPoint joinPoint, cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, - ApiOperation apiOperation) { + Operation operation) { // module 属性 if (operateLog != null) { operateLogObj.setModule(operateLog.module()); } if (StrUtil.isEmpty(operateLogObj.getModule())) { - Api api = getClassAnnotation(joinPoint, Api.class); - if (api != null) { - // 优先读取 @API 的 name 属性 - if (StrUtil.isNotEmpty(api.value())) { - operateLogObj.setModule(api.value()); + Tag tag = getClassAnnotation(joinPoint, Tag.class); + if (tag != null) { + // 优先读取 @Tag 的 name 属性 + if (StrUtil.isNotEmpty(tag.name())) { + operateLogObj.setModule(tag.name()); } - // 没有的话,读取 @API 的 tags 属性 - if (StrUtil.isEmpty(operateLogObj.getModule()) && ArrayUtil.isNotEmpty(api.tags())) { - operateLogObj.setModule(api.tags()[0]); + // 没有的话,读取 @API 的 description 属性 + if (StrUtil.isEmpty(operateLogObj.getModule()) && ArrayUtil.isNotEmpty(tag.description())) { + operateLogObj.setModule(tag.description()); } } } @@ -195,8 +195,8 @@ public class OperateLogAspect { if (operateLog != null) { operateLogObj.setName(operateLog.name()); } - if (StrUtil.isEmpty(operateLogObj.getName()) && apiOperation != null) { - operateLogObj.setName(apiOperation.value()); + if (StrUtil.isEmpty(operateLogObj.getName()) && operation != null) { + operateLogObj.setName(operation.summary()); } // type 属性 if (operateLog != null && ArrayUtil.isNotEmpty(operateLog.type())) { diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/service/TenantFrameworkServiceImpl.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/service/TenantFrameworkServiceImpl.java index 75d065e1e..f2b7b27a8 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/service/TenantFrameworkServiceImpl.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/service/TenantFrameworkServiceImpl.java @@ -32,7 +32,7 @@ public class TenantFrameworkServiceImpl implements TenantFrameworkService { @Override public List load(Object key) { - return tenantApi.getTenantIds(); + return tenantApi.getTenantIdList(); } }); @@ -47,7 +47,7 @@ public class TenantFrameworkServiceImpl implements TenantFrameworkService { @Override public ServiceException load(Long id) { try { - tenantApi.validTenant(id); + tenantApi.validateTenant(id); return SERVICE_EXCEPTION_NULL; } catch (ServiceException ex) { return ex; diff --git a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/RandomUtils.java b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/RandomUtils.java index 11a810cf1..7f114e5b1 100644 --- a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/RandomUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/RandomUtils.java @@ -50,7 +50,7 @@ public class RandomUtils { } // 如果是 type、status 结尾的字段,返回 tinyint 范围 if (StrUtil.endWithAnyIgnoreCase(attributeMetadata.getAttributeName(), - "type", "status", "category", "scope")) { + "type", "status", "category", "scope", "result")) { return RandomUtil.randomInt(0, TINYINT_MAX + 1); } return RandomUtil.randomInt(); diff --git a/yudao-framework/yudao-spring-boot-starter-web/pom.xml b/yudao-framework/yudao-spring-boot-starter-web/pom.xml index 05971ca16..e591cc329 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-web/pom.xml @@ -21,12 +21,6 @@ yudao-common - - org.apache.commons - commons-lang3 - provided - - org.springframework.boot @@ -41,16 +35,11 @@ com.github.xiaoymin - knife4j-openapi2-spring-boot-starter + knife4j-openapi3-spring-boot-starter - io.swagger - swagger-annotations - - - - org.springframework.boot - spring-boot-starter-validation + org.springdoc + springdoc-openapi-ui diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/SwaggerProperties.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/SwaggerProperties.java index d1008eddc..13a156881 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/SwaggerProperties.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/SwaggerProperties.java @@ -35,9 +35,26 @@ public class SwaggerProperties { @NotEmpty(message = "版本不能为空") private String version; /** - * 扫描的包 + * url */ @NotEmpty(message = "扫描的 package 不能为空") - private String basePackage; + private String url; + /** + * email + */ + @NotEmpty(message = "扫描的 email 不能为空") + private String email; + + /** + * license + */ + @NotEmpty(message = "扫描的 license 不能为空") + private String license; + + /** + * license-url + */ + @NotEmpty(message = "扫描的 license-url 不能为空") + private String licenseUrl; } diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java index 5ccbc06c4..2481d2b74 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java @@ -1,126 +1,155 @@ package cn.iocoder.yudao.framework.swagger.config; -import cn.iocoder.yudao.framework.swagger.core.SpringFoxHandlerProviderBeanPostProcessor; -import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j; +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Contact; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.media.IntegerSchema; +import io.swagger.v3.oas.models.media.StringSchema; +import io.swagger.v3.oas.models.parameters.Parameter; +import io.swagger.v3.oas.models.security.SecurityRequirement; +import io.swagger.v3.oas.models.security.SecurityScheme; +import org.springdoc.core.*; +import org.springdoc.core.customizers.OpenApiBuilderCustomizer; +import org.springdoc.core.customizers.ServerBaseUrlCustomizer; +import org.springdoc.core.providers.JavadocProvider; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.http.HttpHeaders; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.ParameterBuilder; -import springfox.documentation.builders.PathSelectors; -import springfox.documentation.schema.ModelRef; -import springfox.documentation.service.*; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spi.service.contexts.SecurityContext; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; -import java.util.ArrayList; -import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Optional; import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.HEADER_TENANT_ID; -import static springfox.documentation.builders.RequestHandlerSelectors.basePackage; /** - * Swagger2 自动配置类 + * Swagger 自动配置类,基于 OpenAPI + Springdoc 实现。 + * + * 友情提示: + * 1. Springdoc 文档地址:仓库 + * 2. Swagger 规范,于 2015 更名为 OpenAPI 规范,本质是一个东西 * * @author 芋道源码 */ @AutoConfiguration -@EnableSwagger2WebMvc -@EnableKnife4j -@ConditionalOnClass({Docket.class, ApiInfoBuilder.class}) -// 允许使用 swagger.enable=false 禁用 Swagger -@ConditionalOnProperty(prefix = "yudao.swagger", value = "enable", matchIfMissing = true) +@ConditionalOnClass({OpenAPI.class}) @EnableConfigurationProperties(SwaggerProperties.class) +@ConditionalOnProperty(prefix = "springdoc.api-docs", name = "enabled", havingValue = "true", matchIfMissing = true) // 设置为 false 时,禁用 public class YudaoSwaggerAutoConfiguration { - @Bean - public SpringFoxHandlerProviderBeanPostProcessor springFoxHandlerProviderBeanPostProcessor() { - return new SpringFoxHandlerProviderBeanPostProcessor(); - } + // ========== 全局 OpenAPI 配置 ========== @Bean - public Docket createRestApi(SwaggerProperties properties) { - // 创建 Docket 对象 - return new Docket(DocumentationType.SWAGGER_2) - // ① 用来创建该 API 的基本信息,展示在文档的页面中(自定义展示的信息) - .apiInfo(apiInfo(properties)) - // ② 设置扫描指定 package 包下的 - .select() - .apis(basePackage(properties.getBasePackage())) -// .apis(basePackage("cn.iocoder.yudao.module.system")) // 可用于 swagger 无法展示时使用 - .paths(PathSelectors.any()) - .build() - // ③ 安全上下文(认证) - .securitySchemes(securitySchemes()) - .securityContexts(securityContexts()) - // ④ 全局参数(多租户 header) - .globalOperationParameters(globalRequestParameters()); + public OpenAPI createApi(SwaggerProperties properties) { + Map securitySchemas = buildSecuritySchemes(); + OpenAPI openAPI = new OpenAPI() + // 接口信息 + .info(buildInfo(properties)) + // 接口安全配置 + .components(new Components().securitySchemes(securitySchemas)) + .addSecurityItem(new SecurityRequirement().addList(HttpHeaders.AUTHORIZATION)); + securitySchemas.keySet().forEach(key -> openAPI.addSecurityItem(new SecurityRequirement().addList(key))); + return openAPI; } - // ========== apiInfo ========== - /** * API 摘要信息 */ - private static ApiInfo apiInfo(SwaggerProperties properties) { - return new ApiInfoBuilder() + private Info buildInfo(SwaggerProperties properties) { + return new Info() .title(properties.getTitle()) .description(properties.getDescription()) - .contact(new Contact(properties.getAuthor(), null, null)) .version(properties.getVersion()) - .build(); + .contact(new Contact().name(properties.getAuthor()).url(properties.getUrl()).email(properties.getEmail())) + .license(new License().name(properties.getLicense()).url(properties.getLicenseUrl())); } - // ========== securitySchemes ========== - /** * 安全模式,这里配置通过请求头 Authorization 传递 token 参数 */ - private static List securitySchemes() { - return Collections.singletonList(new ApiKey(HttpHeaders.AUTHORIZATION, "Authorization", "header")); + private Map buildSecuritySchemes() { + Map securitySchemes = new HashMap<>(); + SecurityScheme securityScheme = new SecurityScheme() + .type(SecurityScheme.Type.APIKEY) // 类型 + .name(HttpHeaders.AUTHORIZATION) // 请求头的 name + .in(SecurityScheme.In.HEADER); // token 所在位置 + securitySchemes.put(HttpHeaders.AUTHORIZATION, securityScheme); + return securitySchemes; } /** - * 安全上下文 - * - * @see #securitySchemes() - * @see #authorizationScopes() + * 自定义 OpenAPI 处理器 */ - private static List securityContexts() { - return Collections.singletonList(SecurityContext.builder() - .securityReferences(securityReferences()) - // 通过 PathSelectors.regex("^(?!auth).*$"),排除包含 "auth" 的接口不需要使用securitySchemes - .forPaths(PathSelectors.regex("^(?!auth).*$")) - .build()); + @Bean + public OpenAPIService openApiBuilder(Optional openAPI, + SecurityService securityParser, + SpringDocConfigProperties springDocConfigProperties, + PropertyResolverUtils propertyResolverUtils, + Optional> openApiBuilderCustomizers, + Optional> serverBaseUrlCustomizers, + Optional javadocProvider) { + + return new OpenAPIService(openAPI, securityParser, springDocConfigProperties, + propertyResolverUtils, openApiBuilderCustomizers, serverBaseUrlCustomizers, javadocProvider); } - private static List securityReferences() { - return Collections.singletonList(new SecurityReference(HttpHeaders.AUTHORIZATION, authorizationScopes())); + // ========== 分组 OpenAPI 配置 ========== + + /** + * 所有模块的 API 分组 + */ + @Bean + public GroupedOpenApi allGroupedOpenApi() { + return buildGroupedOpenApi("all", ""); } - private static AuthorizationScope[] authorizationScopes() { - return new AuthorizationScope[]{new AuthorizationScope("global", "accessEverything")}; + public static GroupedOpenApi buildGroupedOpenApi(String group) { + return buildGroupedOpenApi(group, group); } - // ========== globalRequestParameters ========== + public static GroupedOpenApi buildGroupedOpenApi(String group, String path) { + return GroupedOpenApi.builder() + .group(group) + .pathsToMatch("/admin-api/" + path + "/**", "/app-api/" + path + "/**") + .addOperationCustomizer((operation, handlerMethod) -> operation + .addParametersItem(buildTenantHeaderParameter()) + .addParametersItem(buildSecurityHeaderParameter())) + .build(); + } - private static List globalRequestParameters() { - List tenantParameter = new ArrayList<>(); - tenantParameter.add(new ParameterBuilder() - .name(HEADER_TENANT_ID) - .description("租户编号") - .modelRef(new ModelRef("long")) - .defaultValue("1") - .parameterType("header") - .required(true) - .build()); - return tenantParameter; + /** + * 构建 Tenant 租户编号请求头参数 + * + * @return 多租户参数 + */ + private static Parameter buildTenantHeaderParameter() { + return new Parameter() + .name(HEADER_TENANT_ID) // header 名 + .description("租户编号") // 描述 + .in(String.valueOf(SecurityScheme.In.HEADER)) // 请求 header + .schema(new IntegerSchema()._default(1L).name(HEADER_TENANT_ID).description("租户编号")); // 默认:使用租户编号为 1 + } + + /** + * 构建 Authorization 认证请求头参数 + * + * 解决 Knife4j Authorize 未生效,请求header里未包含参数 + * + * @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 } } + diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/core/SpringFoxHandlerProviderBeanPostProcessor.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/core/SpringFoxHandlerProviderBeanPostProcessor.java deleted file mode 100644 index e43e2f0f8..000000000 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/core/SpringFoxHandlerProviderBeanPostProcessor.java +++ /dev/null @@ -1,42 +0,0 @@ -package cn.iocoder.yudao.framework.swagger.core; - -import cn.hutool.core.util.ReflectUtil; -import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.config.BeanPostProcessor; -import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping; -import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider; - -import java.util.List; - -/** - * 解决 SpringFox 与 SpringBoot 2.6.x 不兼容的问题 - * 该问题对应的 issue 为 https://github.com/springfox/springfox/issues/3462 - * - * @author 芋道源码 - */ -public class SpringFoxHandlerProviderBeanPostProcessor implements BeanPostProcessor { - - @Override - public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { - if (bean instanceof WebMvcRequestHandlerProvider) { - customizeSpringfoxHandlerMappings(getHandlerMappings(bean)); - } - return bean; - } - - private void customizeSpringfoxHandlerMappings(List mappings) { - // 移除,只保留 patternParser - List copy = CollectionUtils.filterList(mappings, mapping -> mapping.getPatternParser() == null); - // 添加到 mappings 中 - mappings.clear(); - mappings.addAll(copy); - } - - @SuppressWarnings("unchecked") - private List getHandlerMappings(Object bean) { - return (List) - ReflectUtil.getFieldValue(bean, "handlerMappings"); - } - -} diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/yudao-framework/yudao-spring-boot-starter-web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 818e33aa3..93b2afc3a 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1,5 +1,6 @@ cn.iocoder.yudao.framework.apilog.config.YudaoApiLogAutoConfiguration 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.web.config.YudaoWebAutoConfiguration cn.iocoder.yudao.framework.xss.config.YudaoXssAutoConfiguration diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmFormController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmFormController.java index 217067f31..e5b6f2ceb 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmFormController.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmFormController.java @@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO; import cn.iocoder.yudao.module.bpm.service.definition.BpmFormService; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -19,7 +19,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 动态表单") +@Tag(name = "管理后台 - 动态表单") @RestController @RequestMapping("/bpm/form") @Validated @@ -29,14 +29,14 @@ public class BpmFormController { private BpmFormService formService; @PostMapping("/create") - @ApiOperation("创建动态表单") + @Operation(summary = "创建动态表单") @PreAuthorize("@ss.hasPermission('bpm:form:create')") public CommonResult createForm(@Valid @RequestBody BpmFormCreateReqVO createReqVO) { return success(formService.createForm(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新动态表单") + @Operation(summary = "更新动态表单") @PreAuthorize("@ss.hasPermission('bpm:form:update')") public CommonResult updateForm(@Valid @RequestBody BpmFormUpdateReqVO updateReqVO) { formService.updateForm(updateReqVO); @@ -44,8 +44,8 @@ public class BpmFormController { } @DeleteMapping("/delete") - @ApiOperation("删除动态表单") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除动态表单") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('bpm:form:delete')") public CommonResult deleteForm(@RequestParam("id") Long id) { formService.deleteForm(id); @@ -53,8 +53,8 @@ public class BpmFormController { } @GetMapping("/get") - @ApiOperation("获得动态表单") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得动态表单") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('bpm:form:query')") public CommonResult getForm(@RequestParam("id") Long id) { BpmFormDO form = formService.getForm(id); @@ -62,14 +62,14 @@ public class BpmFormController { } @GetMapping("/list-all-simple") - @ApiOperation(value = "获得动态表单的精简列表", notes = "用于表单下拉框") + @Operation(summary = "获得动态表单的精简列表", description = "用于表单下拉框") public CommonResult> getSimpleForms() { List list = formService.getFormList(); return success(BpmFormConvert.INSTANCE.convertList2(list)); } @GetMapping("/page") - @ApiOperation("获得动态表单分页") + @Operation(summary = "获得动态表单分页") @PreAuthorize("@ss.hasPermission('bpm:form:query')") public CommonResult> getFormPage(@Valid BpmFormPageReqVO pageVO) { PageResult pageResult = formService.getFormPage(pageVO); diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmModelController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmModelController.java index 3dd0a0a4d..9156c4255 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmModelController.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmModelController.java @@ -6,9 +6,9 @@ import cn.iocoder.yudao.framework.common.util.io.IoUtils; import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.*; import cn.iocoder.yudao.module.bpm.convert.definition.BpmModelConvert; import cn.iocoder.yudao.module.bpm.service.definition.BpmModelService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -20,7 +20,7 @@ import java.io.IOException; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 流程模型") +@Tag(name = "管理后台 - 流程模型") @RestController @RequestMapping("/bpm/model") @Validated @@ -30,14 +30,14 @@ public class BpmModelController { private BpmModelService modelService; @GetMapping("/page") - @ApiOperation(value = "获得模型分页") + @Operation(summary = "获得模型分页") public CommonResult> getModelPage(BpmModelPageReqVO pageVO) { return success(modelService.getModelPage(pageVO)); } @GetMapping("/get") - @ApiOperation("获得模型") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = String.class) + @Operation(summary = "获得模型") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('bpm:model:query')") public CommonResult getModel(@RequestParam("id") String id) { BpmModelRespVO model = modelService.getModel(id); @@ -45,14 +45,14 @@ public class BpmModelController { } @PostMapping("/create") - @ApiOperation(value = "新建模型") + @Operation(summary = "新建模型") @PreAuthorize("@ss.hasPermission('bpm:model:create')") public CommonResult createModel(@Valid @RequestBody BpmModelCreateReqVO createRetVO) { return success(modelService.createModel(createRetVO, null)); } @PutMapping("/update") - @ApiOperation(value = "修改模型") + @Operation(summary = "修改模型") @PreAuthorize("@ss.hasPermission('bpm:model:update')") public CommonResult updateModel(@Valid @RequestBody BpmModelUpdateReqVO modelVO) { modelService.updateModel(modelVO); @@ -60,7 +60,7 @@ public class BpmModelController { } @PostMapping("/import") - @ApiOperation(value = "导入模型") + @Operation(summary = "导入模型") @PreAuthorize("@ss.hasPermission('bpm:model:import')") public CommonResult importModel(@Valid BpmModeImportReqVO importReqVO) throws IOException { BpmModelCreateReqVO createReqVO = BpmModelConvert.INSTANCE.convert(importReqVO); @@ -70,8 +70,8 @@ public class BpmModelController { } @PostMapping("/deploy") - @ApiOperation(value = "部署模型") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = String.class) + @Operation(summary = "部署模型") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('bpm:model:deploy')") public CommonResult deployModel(@RequestParam("id") String id) { modelService.deployModel(id); @@ -79,7 +79,7 @@ public class BpmModelController { } @PutMapping("/update-state") - @ApiOperation(value = "修改模型的状态", notes = "实际更新的部署的流程定义的状态") + @Operation(summary = "修改模型的状态", description = "实际更新的部署的流程定义的状态") @PreAuthorize("@ss.hasPermission('bpm:model:update')") public CommonResult updateModelState(@Valid @RequestBody BpmModelUpdateStateReqVO reqVO) { modelService.updateModelState(reqVO.getId(), reqVO.getState()); @@ -87,8 +87,8 @@ public class BpmModelController { } @DeleteMapping("/delete") - @ApiOperation("删除模型") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = String.class) + @Operation(summary = "删除模型") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('bpm:model:delete')") public CommonResult deleteModel(@RequestParam("id") String id) { modelService.deleteModel(id); diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmProcessDefinitionController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmProcessDefinitionController.java index ebcaad05b..e77e0bd6d 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmProcessDefinitionController.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmProcessDefinitionController.java @@ -7,9 +7,9 @@ import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmPro import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionPageReqVO; import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionRespVO; import cn.iocoder.yudao.module.bpm.service.definition.BpmProcessDefinitionService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; @@ -23,7 +23,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 流程定义") +@Tag(name = "管理后台 - 流程定义") @RestController @RequestMapping("/bpm/process-definition") @Validated @@ -33,7 +33,7 @@ public class BpmProcessDefinitionController { private BpmProcessDefinitionService bpmDefinitionService; @GetMapping("/page") - @ApiOperation(value = "获得流程定义分页") + @Operation(summary = "获得流程定义分页") @PreAuthorize("@ss.hasPermission('bpm:process-definition:query')") public CommonResult> getProcessDefinitionPage( BpmProcessDefinitionPageReqVO pageReqVO) { @@ -41,7 +41,7 @@ public class BpmProcessDefinitionController { } @GetMapping ("/list") - @ApiOperation(value = "获得流程定义列表") + @Operation(summary = "获得流程定义列表") @PreAuthorize("@ss.hasPermission('bpm:process-definition:query')") public CommonResult> getProcessDefinitionList( BpmProcessDefinitionListReqVO listReqVO) { @@ -49,8 +49,8 @@ public class BpmProcessDefinitionController { } @GetMapping ("/get-bpmn-xml") - @ApiOperation(value = "获得流程定义的 BPMN XML") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = String.class) + @Operation(summary = "获得流程定义的 BPMN XML") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('bpm:process-definition:query')") public CommonResult getProcessDefinitionBpmnXML(@RequestParam("id") String id) { String bpmnXML = bpmDefinitionService.getProcessDefinitionBpmnXML(id); diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmTaskAssignRuleController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmTaskAssignRuleController.java index 3e946707a..d730626a6 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmTaskAssignRuleController.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmTaskAssignRuleController.java @@ -5,10 +5,10 @@ import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule.BpmTaskAs import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule.BpmTaskAssignRuleRespVO; import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule.BpmTaskAssignRuleUpdateReqVO; import cn.iocoder.yudao.module.bpm.service.definition.BpmTaskAssignRuleService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -19,7 +19,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 任务分配规则") +@Tag(name = "管理后台 - 任务分配规则") @RestController @RequestMapping("/bpm/task-assign-rule") @Validated @@ -29,10 +29,10 @@ public class BpmTaskAssignRuleController { private BpmTaskAssignRuleService taskAssignRuleService; @GetMapping("/list") - @ApiOperation(value = "获得任务分配规则列表") - @ApiImplicitParams({ - @ApiImplicitParam(name = "modelId", value = "模型编号", example = "1024", dataTypeClass = String.class), - @ApiImplicitParam(name = "processDefinitionId", value = "流程定义的编号", example = "2048", dataTypeClass = String.class) + @Operation(summary = "获得任务分配规则列表") + @Parameters({ + @Parameter(name = "modelId", description = "模型编号", example = "1024"), + @Parameter(name = "processDefinitionId", description = "流程定义的编号", example = "2048") }) @PreAuthorize("@ss.hasPermission('bpm:task-assign-rule:query')") public CommonResult> getTaskAssignRuleList( @@ -42,14 +42,14 @@ public class BpmTaskAssignRuleController { } @PostMapping("/create") - @ApiOperation(value = "创建任务分配规则") + @Operation(summary = "创建任务分配规则") @PreAuthorize("@ss.hasPermission('bpm:task-assign-rule:create')") public CommonResult createTaskAssignRule(@Valid @RequestBody BpmTaskAssignRuleCreateReqVO reqVO) { return success(taskAssignRuleService.createTaskAssignRule(reqVO)); } @PutMapping("/update") - @ApiOperation(value = "更新任务分配规则") + @Operation(summary = "更新任务分配规则") @PreAuthorize("@ss.hasPermission('bpm:task-assign-rule:update')") public CommonResult updateTaskAssignRule(@Valid @RequestBody BpmTaskAssignRuleUpdateReqVO reqVO) { taskAssignRuleService.updateTaskAssignRule(reqVO); diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmUserGroupController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmUserGroupController.java index 4267f0902..5e7a54b85 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmUserGroupController.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmUserGroupController.java @@ -10,9 +10,9 @@ import cn.iocoder.yudao.module.bpm.service.definition.BpmUserGroupService; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -23,7 +23,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 用户组") +@Tag(name = "管理后台 - 用户组") @RestController @RequestMapping("/bpm/user-group") @Validated @@ -33,14 +33,14 @@ public class BpmUserGroupController { private BpmUserGroupService userGroupService; @PostMapping("/create") - @ApiOperation("创建用户组") + @Operation(summary = "创建用户组") @PreAuthorize("@ss.hasPermission('bpm:user-group:create')") public CommonResult createUserGroup(@Valid @RequestBody BpmUserGroupCreateReqVO createReqVO) { return success(userGroupService.createUserGroup(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新用户组") + @Operation(summary = "更新用户组") @PreAuthorize("@ss.hasPermission('bpm:user-group:update')") public CommonResult updateUserGroup(@Valid @RequestBody BpmUserGroupUpdateReqVO updateReqVO) { userGroupService.updateUserGroup(updateReqVO); @@ -48,8 +48,8 @@ public class BpmUserGroupController { } @DeleteMapping("/delete") - @ApiOperation("删除用户组") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除用户组") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('bpm:user-group:delete')") public CommonResult deleteUserGroup(@RequestParam("id") Long id) { userGroupService.deleteUserGroup(id); @@ -57,8 +57,8 @@ public class BpmUserGroupController { } @GetMapping("/get") - @ApiOperation("获得用户组") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得用户组") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('bpm:user-group:query')") public CommonResult getUserGroup(@RequestParam("id") Long id) { BpmUserGroupDO userGroup = userGroupService.getUserGroup(id); @@ -66,7 +66,7 @@ public class BpmUserGroupController { } @GetMapping("/page") - @ApiOperation("获得用户组分页") + @Operation(summary = "获得用户组分页") @PreAuthorize("@ss.hasPermission('bpm:user-group:query')") public CommonResult> getUserGroupPage(@Valid BpmUserGroupPageReqVO pageVO) { PageResult pageResult = userGroupService.getUserGroupPage(pageVO); @@ -74,7 +74,7 @@ public class BpmUserGroupController { } @GetMapping("/list-all-simple") - @ApiOperation(value = "获取用户组精简信息列表", notes = "只包含被开启的用户组,主要用于前端的下拉选项") + @Operation(summary = "获取用户组精简信息列表", description = "只包含被开启的用户组,主要用于前端的下拉选项") public CommonResult> getSimpleUserGroups() { // 获用户门列表,只要开启状态的 List list = userGroupService.getUserGroupListByStatus(CommonStatusEnum.ENABLE.getStatus()); diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormBaseVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormBaseVO.java index 11fee5c00..c51984f0c 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormBaseVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormBaseVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; import javax.validation.constraints.*; /** @@ -11,15 +10,15 @@ import javax.validation.constraints.*; @Data public class BpmFormBaseVO { - @ApiModelProperty(value = "表单名称", required = true, example = "芋道") + @Schema(description = "表单名称", required = true, example = "芋道") @NotNull(message = "表单名称不能为空") private String name; - @ApiModelProperty(value = "表单状态", required = true, notes = "参见 CommonStatusEnum 枚举", example = "1") + @Schema(description = "表单状态-参见 CommonStatusEnum 枚举", required = true, example = "1") @NotNull(message = "表单状态不能为空") private Integer status; - @ApiModelProperty(value = "备注", example = "我是备注") + @Schema(description = "备注", example = "我是备注") private String remark; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormCreateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormCreateReqVO.java index d9a628125..5a096667a 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormCreateReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormCreateReqVO.java @@ -1,22 +1,21 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; import javax.validation.constraints.NotNull; import java.util.List; -@ApiModel("管理后台 - 动态表单创建 Request VO") +@Schema(description = "管理后台 - 动态表单创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmFormCreateReqVO extends BpmFormBaseVO { - @ApiModelProperty(value = "表单的配置", required = true, notes = "JSON 字符串") + @Schema(description = "表单的配置-JSON 字符串", required = true) @NotNull(message = "表单的配置不能为空") private String conf; - @ApiModelProperty(value = "表单项的数组", required = true, notes = "JSON 字符串的数组") + @Schema(description = "表单项的数组-JSON 字符串的数组", required = true) @NotNull(message = "表单项的数组不能为空") private List fields; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormPageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormPageReqVO.java index a8097c437..0227e0ad9 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormPageReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormPageReqVO.java @@ -1,19 +1,18 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 动态表单分页 Request VO") +@Schema(description = "管理后台 - 动态表单分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmFormPageReqVO extends PageParam { - @ApiModelProperty(value = "表单名称", example = "芋道") + @Schema(description = "表单名称", example = "芋道") private String name; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormRespVO.java index e49f09879..5d7f4e765 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormRespVO.java @@ -1,7 +1,5 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -10,24 +8,24 @@ import javax.validation.constraints.NotNull; import java.time.LocalDateTime; import java.util.List; -@ApiModel("管理后台 - 动态表单 Response VO") +@Schema(description = "管理后台 - 动态表单 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmFormRespVO extends BpmFormBaseVO { - @ApiModelProperty(value = "表单编号", required = true, example = "1024") + @Schema(description = "表单编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "表单的配置", required = true, notes = "JSON 字符串") + @Schema(description = "表单的配置-JSON 字符串", required = true) @NotNull(message = "表单的配置不能为空") private String conf; - @ApiModelProperty(value = "表单项的数组", required = true, notes = "JSON 字符串的数组") + @Schema(description = "表单项的数组-JSON 字符串的数组", required = true) @NotNull(message = "表单项的数组不能为空") private List fields; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormSimpleRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormSimpleRespVO.java index 3a6b3c093..2e19f441c 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormSimpleRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormSimpleRespVO.java @@ -1,17 +1,16 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@ApiModel("管理后台 - 流程表单精简 Response VO") +@Schema(description = "管理后台 - 流程表单精简 Response VO") @Data public class BpmFormSimpleRespVO { - @ApiModelProperty(value = "表单编号", required = true, example = "1024") + @Schema(description = "表单编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "表单名称", required = true, example = "芋道") + @Schema(description = "表单名称", required = true, example = "芋道") private String name; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormUpdateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormUpdateReqVO.java index 55b997679..e315ef370 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormUpdateReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormUpdateReqVO.java @@ -1,25 +1,24 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; import javax.validation.constraints.*; import java.util.List; -@ApiModel("管理后台 - 动态表单更新 Request VO") +@Schema(description = "管理后台 - 动态表单更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmFormUpdateReqVO extends BpmFormBaseVO { - @ApiModelProperty(value = "表单编号", required = true, example = "1024") + @Schema(description = "表单编号", required = true, example = "1024") @NotNull(message = "表单编号不能为空") private Long id; - @ApiModelProperty(value = "表单的配置", required = true, notes = "JSON 字符串") + @Schema(description = "表单的配置-JSON 字符串", required = true) @NotNull(message = "表单的配置不能为空") private String conf; - @ApiModelProperty(value = "表单项的数组", required = true, notes = "JSON 字符串的数组") + @Schema(description = "表单项的数组-JSON 字符串的数组", required = true) @NotNull(message = "表单项的数组不能为空") private List fields; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupBaseVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupBaseVO.java index e0dfe568e..d78d3c02d 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupBaseVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupBaseVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; -import io.swagger.annotations.*; import javax.validation.constraints.*; /** @@ -12,19 +11,19 @@ import javax.validation.constraints.*; @Data public class BpmUserGroupBaseVO { - @ApiModelProperty(value = "组名", required = true, example = "芋道") + @Schema(description = "组名", required = true, example = "芋道") @NotNull(message = "组名不能为空") private String name; - @ApiModelProperty(value = "描述", required = true, example = "芋道源码") + @Schema(description = "描述", required = true, example = "芋道源码") @NotNull(message = "描述不能为空") private String description; - @ApiModelProperty(value = "成员编号数组", required = true, example = "1,2,3") + @Schema(description = "成员编号数组", required = true, example = "1,2,3") @NotNull(message = "成员编号数组不能为空") private Set memberUserIds; - @ApiModelProperty(value = "状态", required = true, example = "1") + @Schema(description = "状态", required = true, example = "1") @NotNull(message = "状态不能为空") private Integer status; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupCreateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupCreateReqVO.java index 48b44d38b..416c4793a 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupCreateReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupCreateReqVO.java @@ -1,9 +1,8 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; -@ApiModel("管理后台 - 用户组创建 Request VO") +@Schema(description = "管理后台 - 用户组创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupPageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupPageReqVO.java index 2608607bf..05f17788a 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupPageReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupPageReqVO.java @@ -2,8 +2,7 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group; import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.util.date.DateUtils; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -11,20 +10,20 @@ import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; -@ApiModel("管理后台 - 用户组分页 Request VO") +@Schema(description = "管理后台 - 用户组分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmUserGroupPageReqVO extends PageParam { - @ApiModelProperty(value = "组名", example = "芋道") + @Schema(description = "组名", example = "芋道") private String name; - @ApiModelProperty(value = "状态", example = "1") + @Schema(description = "状态", example = "1") private Integer status; @DateTimeFormat(pattern = DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupRespVO.java index b3d4693f3..2a390a9cf 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupRespVO.java @@ -1,21 +1,20 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDateTime; -import io.swagger.annotations.*; -@ApiModel("管理后台 - 用户组 Response VO") +@Schema(description = "管理后台 - 用户组 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmUserGroupRespVO extends BpmUserGroupBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupSimpleRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupSimpleRespVO.java index 0b47f447e..aedd100f3 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupSimpleRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupSimpleRespVO.java @@ -1,21 +1,20 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; -@ApiModel("管理后台 - 用户组精简信息 Response VO") +@Schema(description = "管理后台 - 用户组精简信息 Response VO") @Data @NoArgsConstructor @AllArgsConstructor public class BpmUserGroupSimpleRespVO { - @ApiModelProperty(value = "用户组编号", required = true, example = "1024") + @Schema(description = "用户组编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "用户组名字", required = true, example = "芋道") + @Schema(description = "用户组名字", required = true, example = "芋道") private String name; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupUpdateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupUpdateReqVO.java index 14aa25c5b..81db5649d 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupUpdateReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupUpdateReqVO.java @@ -1,16 +1,15 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; import javax.validation.constraints.*; -@ApiModel("管理后台 - 用户组更新 Request VO") +@Schema(description = "管理后台 - 用户组更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmUserGroupUpdateReqVO extends BpmUserGroupBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") @NotNull(message = "编号不能为空") private Long id; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModeImportReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModeImportReqVO.java index 7240ba15c..007cfed10 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModeImportReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModeImportReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -9,13 +8,13 @@ import org.springframework.web.multipart.MultipartFile; import javax.validation.constraints.NotNull; -@ApiModel(value = "管理后台 - 流程模型的导入 Request VO", description = "相比流程模型的新建来说,只是多了一个 bpmnFile 文件") +@Schema(description = "管理后台 - 流程模型的导入 Request VO 相比流程模型的新建来说,只是多了一个 bpmnFile 文件") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmModeImportReqVO extends BpmModelCreateReqVO { - @ApiModelProperty(value = "BPMN 文件", required = true) + @Schema(description = "BPMN 文件", required = true) @NotNull(message = "BPMN 文件不能为空") private MultipartFile bpmnFile; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelBaseVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelBaseVO.java index 542a177e4..8750ad913 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelBaseVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelBaseVO.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; - -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; @@ -12,30 +11,30 @@ import javax.validation.constraints.NotEmpty; @Data public class BpmModelBaseVO { - @ApiModelProperty(value = "流程标识", required = true, example = "process_yudao") + @Schema(description = "流程标识", required = true, example = "process_yudao") @NotEmpty(message = "流程标识不能为空") private String key; - @ApiModelProperty(value = "流程名称", required = true, example = "芋道") + @Schema(description = "流程名称", required = true, example = "芋道") @NotEmpty(message = "流程名称不能为空") private String name; - @ApiModelProperty(value = "流程描述", example = "我是描述") + @Schema(description = "流程描述", example = "我是描述") private String description; - @ApiModelProperty(value = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1") + @Schema(description = "流程分类-参见 bpm_model_category 数据字典", example = "1") @NotEmpty(message = "流程分类不能为空") private String category; - @ApiModelProperty(value = "表单类型", notes = "参见 bpm_model_form_type 数据字典", example = "1") + @Schema(description = "表单类型-参见 bpm_model_form_type 数据字典", example = "1") private Integer formType; - @ApiModelProperty(value = "表单编号", example = "1024", notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") + @Schema(description = "表单编号-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", example = "1024") private Long formId; - @ApiModelProperty(value = "自定义表单的提交路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/create", - notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") + @Schema(description = "自定义表单的提交路径,使用 Vue 的路由地址-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", + example = "/bpm/oa/leave/create") private String formCustomCreatePath; - @ApiModelProperty(value = "自定义表单的查看路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/view", - notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") + @Schema(description = "自定义表单的查看路径,使用 Vue 的路由地址-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", + example = "/bpm/oa/leave/view") private String formCustomViewPath; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelCreateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelCreateReqVO.java index c85ef3ae4..5b77bc2de 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelCreateReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelCreateReqVO.java @@ -1,26 +1,25 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotEmpty; -@ApiModel("管理后台 - 流程模型的创建 Request VO") +@Schema(description = "管理后台 - 流程模型的创建 Request VO") @Data public class BpmModelCreateReqVO { - @ApiModelProperty(value = "流程标识", required = true, example = "process_yudao") + @Schema(description = "流程标识", required = true, example = "process_yudao") @NotEmpty(message = "流程标识不能为空") private String key; - @ApiModelProperty(value = "流程名称", required = true, example = "芋道") + @Schema(description = "流程名称", required = true, example = "芋道") @NotEmpty(message = "流程名称不能为空") private String name; - @ApiModelProperty(value = "流程描述", example = "我是描述") + @Schema(description = "流程描述", example = "我是描述") private String description; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelPageItemRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelPageItemRespVO.java index 10d23892e..9edc119c9 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelPageItemRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelPageItemRespVO.java @@ -1,26 +1,25 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 流程模型的分页的每一项 Response VO") +@Schema(description = "管理后台 - 流程模型的分页的每一项 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmModelPageItemRespVO extends BpmModelBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") private String id; - @ApiModelProperty(value = "表单名字", example = "请假表单") + @Schema(description = "表单名字", example = "请假表单") private String formName; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; /** @@ -28,20 +27,20 @@ public class BpmModelPageItemRespVO extends BpmModelBaseVO { */ private ProcessDefinition processDefinition; - @ApiModel("流程定义") + @Schema(description = "流程定义") @Data public static class ProcessDefinition { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") private String id; - @ApiModelProperty(value = "版本", required = true, example = "1") + @Schema(description = "版本", required = true, example = "1") private Integer version; - @ApiModelProperty(value = "部署时间", required = true) + @Schema(description = "部署时间", required = true) private LocalDateTime deploymentTime; - @ApiModelProperty(value = "中断状态", required = true, example = "1", notes = "参见 SuspensionState 枚举") + @Schema(description = "中断状态-参见 SuspensionState 枚举", required = true, example = "1") private Integer suspensionState; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelPageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelPageReqVO.java index 945da139c..15283208e 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelPageReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelPageReqVO.java @@ -1,26 +1,25 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 流程模型分页 Request VO") +@Schema(description = "管理后台 - 流程模型分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmModelPageReqVO extends PageParam { - @ApiModelProperty(value = "标识", example = "process1641042089407", notes = "精准匹配") + @Schema(description = "标识-精准匹配", example = "process1641042089407") private String key; - @ApiModelProperty(value = "名字", example = "芋道", notes = "模糊匹配") + @Schema(description = "名字-模糊匹配", example = "芋道") private String name; - @ApiModelProperty(value = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1") + @Schema(description = "流程分类-参见 bpm_model_category 数据字典", example = "1") private String category; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelRespVO.java index 571850ff0..26bc2f9a6 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelRespVO.java @@ -1,26 +1,25 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 流程模型的创建 Request VO") +@Schema(description = "管理后台 - 流程模型的创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmModelRespVO extends BpmModelBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") private String id; - @ApiModelProperty(value = "BPMN XML", required = true) + @Schema(description = "BPMN XML", required = true) private String bpmnXml; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelUpdateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelUpdateReqVO.java index 972aa31bb..94271034b 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelUpdateReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelUpdateReqVO.java @@ -1,40 +1,39 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; -@ApiModel("管理后台 - 流程模型的更新 Request VO") +@Schema(description = "管理后台 - 流程模型的更新 Request VO") @Data public class BpmModelUpdateReqVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") @NotEmpty(message = "编号不能为空") private String id; - @ApiModelProperty(value = "流程名称", example = "芋道") + @Schema(description = "流程名称", example = "芋道") private String name; - @ApiModelProperty(value = "流程描述", example = "我是描述") + @Schema(description = "流程描述", example = "我是描述") private String description; - @ApiModelProperty(value = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1") + @Schema(description = "流程分类-参见 bpm_model_category 数据字典", example = "1") private String category; - @ApiModelProperty(value = "BPMN XML", required = true) + @Schema(description = "BPMN XML", required = true) private String bpmnXml; - @ApiModelProperty(value = "表单类型", notes = "参见 bpm_model_form_type 数据字典", example = "1") + @Schema(description = "表单类型-参见 bpm_model_form_type 数据字典", example = "1") private Integer formType; - @ApiModelProperty(value = "表单编号", example = "1024", notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") + @Schema(description = "表单编号-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", example = "1024") private Long formId; - @ApiModelProperty(value = "自定义表单的提交路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/create", - notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") + @Schema(description = "自定义表单的提交路径,使用 Vue 的路由地址-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", + example = "/bpm/oa/leave/create") private String formCustomCreatePath; - @ApiModelProperty(value = "自定义表单的查看路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/view", - notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") + @Schema(description = "自定义表单的查看路径,使用 Vue 的路由地址-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", + example = "/bpm/oa/leave/view") private String formCustomViewPath; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelUpdateStateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelUpdateStateReqVO.java index 9cfcebbdc..e59cc32fb 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelUpdateStateReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelUpdateStateReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 流程模型更新状态 Request VO") +@Schema(description = "管理后台 - 流程模型更新状态 Request VO") @Data public class BpmModelUpdateStateReqVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") @NotNull(message = "编号不能为空") private String id; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 SuspensionState 枚举") + @Schema(description = "状态-见 SuspensionState 枚举", required = true, example = "1") @NotNull(message = "状态不能为空") private Integer state; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionListReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionListReqVO.java index 5e45b8bde..35243d2ac 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionListReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionListReqVO.java @@ -1,19 +1,18 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 流程定义列表 Request VO") +@Schema(description = "管理后台 - 流程定义列表 Request VO") @Data @ToString(callSuper = true) @EqualsAndHashCode(callSuper = true) public class BpmProcessDefinitionListReqVO extends PageParam { - @ApiModelProperty(value = "中断状态", example = "1", notes = "参见 SuspensionState 枚举") + @Schema(description = "中断状态-参见 SuspensionState 枚举", example = "1") private Integer suspensionState; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionPageItemRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionPageItemRespVO.java index 1952e95a7..26bc79c80 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionPageItemRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionPageItemRespVO.java @@ -1,23 +1,22 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 流程定义的分页的每一项 Response VO") +@Schema(description = "管理后台 - 流程定义的分页的每一项 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmProcessDefinitionPageItemRespVO extends BpmProcessDefinitionRespVO { - @ApiModelProperty(value = "表单名字", example = "请假表单") + @Schema(description = "表单名字", example = "请假表单") private String formName; - @ApiModelProperty(value = "部署时间", required = true) + @Schema(description = "部署时间", required = true) private LocalDateTime deploymentTime; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionPageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionPageReqVO.java index a9657e9a2..f5c7f36d6 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionPageReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionPageReqVO.java @@ -1,19 +1,18 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 流程定义分页 Request VO") +@Schema(description = "管理后台 - 流程定义分页 Request VO") @Data @ToString(callSuper = true) @EqualsAndHashCode(callSuper = true) public class BpmProcessDefinitionPageReqVO extends PageParam { - @ApiModelProperty(value = "标识", example = "process1641042089407", notes = "精准匹配") + @Schema(description = "标识-精准匹配", example = "process1641042089407") private String key; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionRespVO.java index 6f8fd4e5b..5fee0dd4e 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionRespVO.java @@ -1,52 +1,49 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.util.List; -@ApiModel("管理后台 - 流程定义 Response VO") +@Schema(description = "管理后台 - 流程定义 Response VO") @Data public class BpmProcessDefinitionRespVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") private String id; - @ApiModelProperty(value = "版本", required = true, example = "1") + @Schema(description = "版本", required = true, example = "1") private Integer version; - @ApiModelProperty(value = "流程名称", required = true, example = "芋道") + @Schema(description = "流程名称", required = true, example = "芋道") @NotEmpty(message = "流程名称不能为空") private String name; - @ApiModelProperty(value = "流程描述", example = "我是描述") + @Schema(description = "流程描述", example = "我是描述") private String description; - @ApiModelProperty(value = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1") + @Schema(description = "流程分类-参见 bpm_model_category 数据字典", example = "1") @NotEmpty(message = "流程分类不能为空") private String category; - @ApiModelProperty(value = "表单类型", notes = "参见 bpm_model_form_type 数据字典", example = "1") + @Schema(description = "表单类型-参见 bpm_model_form_type 数据字典", example = "1") private Integer formType; - @ApiModelProperty(value = "表单编号", example = "1024", notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") + @Schema(description = "表单编号-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", example = "1024") private Long formId; - @ApiModelProperty(value = "表单的配置", required = true, - notes = "JSON 字符串。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") + @Schema(description = "表单的配置-JSON 字符串。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", required = true) private String formConf; - @ApiModelProperty(value = "表单项的数组", required = true, - notes = "JSON 字符串的数组。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") + @Schema(description = "表单项的数组-JSON 字符串的数组。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", required = true) private List formFields; - @ApiModelProperty(value = "自定义表单的提交路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/create", - notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") + @Schema(description = "自定义表单的提交路径,使用 Vue 的路由地址-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", + example = "/bpm/oa/leave/create") private String formCustomCreatePath; - @ApiModelProperty(value = "自定义表单的查看路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/view", - notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") + @Schema(description = "自定义表单的查看路径,使用 Vue 的路由地址-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", + example = "/bpm/oa/leave/view") private String formCustomViewPath; - @ApiModelProperty(value = "中断状态", required = true, example = "1", notes = "参见 SuspensionState 枚举") + @Schema(description = "中断状态-参见 SuspensionState 枚举", required = true, example = "1") private Integer suspensionState; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleBaseVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleBaseVO.java index bcb9fc0f0..7efb1c312 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleBaseVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleBaseVO.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule; - -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; @@ -14,11 +13,11 @@ import java.util.Set; @Data public class BpmTaskAssignRuleBaseVO { - @ApiModelProperty(value = "规则类型", required = true, example = "bpm_task_assign_rule_type") + @Schema(description = "规则类型", required = true, example = "bpm_task_assign_rule_type") @NotNull(message = "规则类型不能为空") private Integer type; - @ApiModelProperty(value = "规则值数组", required = true, example = "1,2,3") + @Schema(description = "规则值数组", required = true, example = "1,2,3") @NotNull(message = "规则值数组不能为空") private Set options; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleCreateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleCreateReqVO.java index cbbc108c0..97bb2de8f 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleCreateReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleCreateReqVO.java @@ -1,24 +1,23 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotEmpty; -@ApiModel("管理后台 - 流程任务分配规则的创建 Request VO") +@Schema(description = "管理后台 - 流程任务分配规则的创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmTaskAssignRuleCreateReqVO extends BpmTaskAssignRuleBaseVO { - @ApiModelProperty(value = "流程模型的编号", required = true, example = "1024") + @Schema(description = "流程模型的编号", required = true, example = "1024") @NotEmpty(message = "流程模型的编号不能为空") private String modelId; - @ApiModelProperty(value = "流程任务定义的编号", required = true, example = "2048") + @Schema(description = "流程任务定义的编号", required = true, example = "2048") @NotEmpty(message = "流程任务定义的编号不能为空") private String taskDefinitionKey; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleRespVO.java index c0786e52b..50626edc7 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleRespVO.java @@ -1,29 +1,28 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 流程任务分配规则的 Response VO") +@Schema(description = "管理后台 - 流程任务分配规则的 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmTaskAssignRuleRespVO extends BpmTaskAssignRuleBaseVO { - @ApiModelProperty(value = "任务分配规则的编号", required = true, example = "1024") + @Schema(description = "任务分配规则的编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "流程模型的编号", required = true, example = "2048") + @Schema(description = "流程模型的编号", required = true, example = "2048") private String modelId; - @ApiModelProperty(value = "流程定义的编号", required = true, example = "4096") + @Schema(description = "流程定义的编号", required = true, example = "4096") private String processDefinitionId; - @ApiModelProperty(value = "流程任务定义的编号", required = true, example = "2048") + @Schema(description = "流程任务定义的编号", required = true, example = "2048") private String taskDefinitionKey; - @ApiModelProperty(value = "流程任务定义的名字", required = true, example = "关注芋道") + @Schema(description = "流程任务定义的名字", required = true, example = "关注芋道") private String taskDefinitionName; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleUpdateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleUpdateReqVO.java index 8f1c12701..5799f139f 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleUpdateReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleUpdateReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 流程任务分配规则的更新 Request VO") +@Schema(description = "管理后台 - 流程任务分配规则的更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmTaskAssignRuleUpdateReqVO extends BpmTaskAssignRuleBaseVO { - @ApiModelProperty(value = "任务分配规则的编号", required = true, example = "1024") + @Schema(description = "任务分配规则的编号", required = true, example = "1024") @NotNull(message = "任务分配规则的编号不能为空") private Long id; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOALeaveController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOALeaveController.java index dd66580d3..770d465b6 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOALeaveController.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOALeaveController.java @@ -8,9 +8,9 @@ import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOALeaveDO; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.bpm.service.oa.BpmOALeaveService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -27,7 +27,7 @@ import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUti * @author jason * @author 芋道源码 */ -@Api(tags = "管理后台 - OA 请假申请") +@Tag(name = "管理后台 - OA 请假申请") @RestController @RequestMapping("/bpm/oa/leave") @Validated @@ -38,15 +38,15 @@ public class BpmOALeaveController { @PostMapping("/create") @PreAuthorize("@ss.hasPermission('bpm:oa-leave:create')") - @ApiOperation("创建请求申请") + @Operation(summary = "创建请求申请") public CommonResult createLeave(@Valid @RequestBody BpmOALeaveCreateReqVO createReqVO) { return success(leaveService.createLeave(getLoginUserId(), createReqVO)); } @GetMapping("/get") @PreAuthorize("@ss.hasPermission('bpm:oa-leave:query')") - @ApiOperation("获得请假申请") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得请假申请") + @Parameter(name = "id", description = "编号", required = true, example = "1024") public CommonResult getLeave(@RequestParam("id") Long id) { BpmOALeaveDO leave = leaveService.getLeave(id); return success(BpmOALeaveConvert.INSTANCE.convert(leave)); @@ -54,7 +54,7 @@ public class BpmOALeaveController { @GetMapping("/page") @PreAuthorize("@ss.hasPermission('bpm:oa-leave:query')") - @ApiOperation("获得请假申请分页") + @Operation(summary = "获得请假申请分页") public CommonResult> getLeavePage(@Valid BpmOALeavePageReqVO pageVO) { PageResult pageResult = leaveService.getLeavePage(getLoginUserId(), pageVO); return success(BpmOALeaveConvert.INSTANCE.convertPage(pageResult)); diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveBaseVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveBaseVO.java index b8b38c6f2..2ce0b1c52 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveBaseVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveBaseVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDateTime; -import io.swagger.annotations.*; import javax.validation.constraints.*; import org.springframework.format.annotation.DateTimeFormat; @@ -15,19 +14,19 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @Data public class BpmOALeaveBaseVO { - @ApiModelProperty(value = "请假的开始时间", required = true) + @Schema(description = "请假的开始时间", required = true) @NotNull(message = "开始时间不能为空") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime startTime; - @ApiModelProperty(value = "请假的结束时间", required = true) + @Schema(description = "请假的结束时间", required = true) @NotNull(message = "结束时间不能为空") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime endTime; - @ApiModelProperty(value = "请假类型", required = true, example = "1", notes = "参见 bpm_oa_type 枚举") + @Schema(description = "请假类型-参见 bpm_oa_type 枚举", required = true, example = "1") private Integer type; - @ApiModelProperty(value = "原因", required = true, example = "阅读芋道源码") + @Schema(description = "原因", required = true, example = "阅读芋道源码") private String reason; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveCreateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveCreateReqVO.java index 8ccb6807f..9bfd4488f 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveCreateReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveCreateReqVO.java @@ -1,13 +1,12 @@ package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo; - -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.AssertTrue; -@ApiModel("管理后台 - 请假申请创建 Request VO") +@Schema(description = "管理后台 - 请假申请创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeavePageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeavePageReqVO.java index 38dc5148f..903a0fcf2 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeavePageReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeavePageReqVO.java @@ -1,30 +1,29 @@ package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDateTime; -import io.swagger.annotations.*; import cn.iocoder.yudao.framework.common.pojo.PageParam; import org.springframework.format.annotation.DateTimeFormat; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 请假申请分页 Request VO") +@Schema(description = "管理后台 - 请假申请分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmOALeavePageReqVO extends PageParam { - @ApiModelProperty(value = "状态", example = "1", notes = "参见 bpm_process_instance_result 枚举") + @Schema(description = "状态-参见 bpm_process_instance_result 枚举", example = "1") private Integer result; - @ApiModelProperty(value = "请假类型", example = "1", notes = "参见 bpm_oa_type") + @Schema(description = "请假类型-参见 bpm_oa_type", example = "1") private Integer type; - @ApiModelProperty(value = "原因", example = "阅读芋道源码", notes = "模糊匹配") + @Schema(description = "原因-模糊匹配", example = "阅读芋道源码") private String reason; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "申请时间") + @Schema(description = "申请时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveRespVO.java index 42b3ec66c..d79dac7d3 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.NotNull; @@ -9,24 +8,24 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 请假申请 Response VO") +@Schema(description = "管理后台 - 请假申请 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmOALeaveRespVO extends BpmOALeaveBaseVO { - @ApiModelProperty(value = "请假表单主键", required = true, example = "1024") + @Schema(description = "请假表单主键", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 bpm_process_instance_result 枚举") + @Schema(description = "状态-参见 bpm_process_instance_result 枚举", required = true, example = "1") private Integer result; - @ApiModelProperty(value = "申请时间", required = true) + @Schema(description = "申请时间", required = true) @NotNull(message = "申请时间不能为空") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime createTime; - @ApiModelProperty(value = "流程id") + @Schema(description = "流程id") private String processInstanceId; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmActivityController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmActivityController.java index 24d89cd36..44d0373f1 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmActivityController.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmActivityController.java @@ -3,9 +3,9 @@ package cn.iocoder.yudao.module.bpm.controller.admin.task; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.activity.BpmActivityRespVO; import cn.iocoder.yudao.module.bpm.service.task.BpmActivityService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; @@ -18,7 +18,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 流程活动实例") +@Tag(name = "管理后台 - 流程活动实例") @RestController @RequestMapping("/bpm/activity") @Validated @@ -28,9 +28,9 @@ public class BpmActivityController { private BpmActivityService activityService; @GetMapping("/list") - @ApiOperation(value = "生成指定流程实例的高亮流程图", - notes = "只高亮进行中的任务。不过要注意,该接口暂时没用,通过前端的 ProcessViewer.vue 界面的 highlightDiagram 方法生成") - @ApiImplicitParam(name = "processInstanceId", value = "流程实例的编号", required = true, dataTypeClass = String.class) + @Operation(summary = "生成指定流程实例的高亮流程图", + description = "只高亮进行中的任务。不过要注意,该接口暂时没用,通过前端的 ProcessViewer.vue 界面的 highlightDiagram 方法生成") + @Parameter(name = "processInstanceId", description = "流程实例的编号", required = true) @PreAuthorize("@ss.hasPermission('bpm:task:query')") public CommonResult> getActivityList( @RequestParam("processInstanceId") String processInstanceId) { diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java index 31abf7de1..b8e8971f2 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java @@ -4,9 +4,9 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.*; import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -17,7 +17,7 @@ import javax.validation.Valid; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; -@Api(tags = "管理后台 - 流程实例") // 流程实例,通过流程定义创建的一次“申请” +@Tag(name = "管理后台 - 流程实例") // 流程实例,通过流程定义创建的一次“申请” @RestController @RequestMapping("/bpm/process-instance") @Validated @@ -27,7 +27,7 @@ public class BpmProcessInstanceController { private BpmProcessInstanceService processInstanceService; @GetMapping("/my-page") - @ApiOperation(value = "获得我的实例分页列表", notes = "在【我的流程】菜单中,进行调用") + @Operation(summary = "获得我的实例分页列表", description = "在【我的流程】菜单中,进行调用") @PreAuthorize("@ss.hasPermission('bpm:process-instance:query')") public CommonResult> getMyProcessInstancePage( @Valid BpmProcessInstanceMyPageReqVO pageReqVO) { @@ -35,22 +35,22 @@ public class BpmProcessInstanceController { } @PostMapping("/create") - @ApiOperation("新建流程实例") + @Operation(summary = "新建流程实例") @PreAuthorize("@ss.hasPermission('bpm:process-instance:query')") public CommonResult createProcessInstance(@Valid @RequestBody BpmProcessInstanceCreateReqVO createReqVO) { return success(processInstanceService.createProcessInstance(getLoginUserId(), createReqVO)); } @GetMapping("/get") - @ApiOperation(value = "获得指定流程实例", notes = "在【流程详细】界面中,进行调用") - @ApiImplicitParam(name = "id", value = "流程实例的编号", required = true, dataTypeClass = String.class) + @Operation(summary = "获得指定流程实例", description = "在【流程详细】界面中,进行调用") + @Parameter(name = "id", description = "流程实例的编号", required = true) @PreAuthorize("@ss.hasPermission('bpm:process-instance:query')") public CommonResult getProcessInstance(@RequestParam("id") String id) { return success(processInstanceService.getProcessInstanceVO(id)); } @DeleteMapping("/cancel") - @ApiOperation(value = "取消流程实例", notes = "撤回发起的流程") + @Operation(summary = "取消流程实例", description = "撤回发起的流程") @PreAuthorize("@ss.hasPermission('bpm:process-instance:cancel')") public CommonResult cancelProcessInstance(@Valid @RequestBody BpmProcessInstanceCancelReqVO cancelReqVO) { processInstanceService.cancelProcessInstance(getLoginUserId(), cancelReqVO); diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmTaskController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmTaskController.java index eaa991f55..885b03143 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmTaskController.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmTaskController.java @@ -4,9 +4,9 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.*; import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -19,7 +19,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId; -@Api(tags = "管理后台 - 流程任务实例") +@Tag(name = "管理后台 - 流程任务实例") @RestController @RequestMapping("/bpm/task") @Validated @@ -29,22 +29,22 @@ public class BpmTaskController { private BpmTaskService taskService; @GetMapping("todo-page") - @ApiOperation("获取 Todo 待办任务分页") + @Operation(summary = "获取 Todo 待办任务分页") @PreAuthorize("@ss.hasPermission('bpm:task:query')") public CommonResult> getTodoTaskPage(@Valid BpmTaskTodoPageReqVO pageVO) { return success(taskService.getTodoTaskPage(getLoginUserId(), pageVO)); } @GetMapping("done-page") - @ApiOperation("获取 Done 已办任务分页") + @Operation(summary = "获取 Done 已办任务分页") @PreAuthorize("@ss.hasPermission('bpm:task:query')") public CommonResult> getDoneTaskPage(@Valid BpmTaskDonePageReqVO pageVO) { return success(taskService.getDoneTaskPage(getLoginUserId(), pageVO)); } @GetMapping("/list-by-process-instance-id") - @ApiOperation(value = "获得指定流程实例的任务列表", notes = "包括完成的、未完成的") - @ApiImplicitParam(name = "processInstanceId", value = "流程实例的编号", required = true, dataTypeClass = String.class) + @Operation(summary = "获得指定流程实例的任务列表", description = "包括完成的、未完成的") + @Parameter(name = "processInstanceId", description = "流程实例的编号", required = true) @PreAuthorize("@ss.hasPermission('bpm:task:query')") public CommonResult> getTaskListByProcessInstanceId( @RequestParam("processInstanceId") String processInstanceId) { @@ -52,7 +52,7 @@ public class BpmTaskController { } @PutMapping("/approve") - @ApiOperation("通过任务") + @Operation(summary = "通过任务") @PreAuthorize("@ss.hasPermission('bpm:task:update')") public CommonResult approveTask(@Valid @RequestBody BpmTaskApproveReqVO reqVO) { taskService.approveTask(getLoginUserId(), reqVO); @@ -60,7 +60,7 @@ public class BpmTaskController { } @PutMapping("/reject") - @ApiOperation("不通过任务") + @Operation(summary = "不通过任务") @PreAuthorize("@ss.hasPermission('bpm:task:update')") public CommonResult rejectTask(@Valid @RequestBody BpmTaskRejectReqVO reqVO) { taskService.rejectTask(getLoginUserId(), reqVO); @@ -68,7 +68,7 @@ public class BpmTaskController { } @PutMapping("/update-assignee") - @ApiOperation(value = "更新任务的负责人", notes = "用于【流程详情】的【转派】按钮") + @Operation(summary = "更新任务的负责人", description = "用于【流程详情】的【转派】按钮") @PreAuthorize("@ss.hasPermission('bpm:task:update')") public CommonResult updateTaskAssignee(@Valid @RequestBody BpmTaskUpdateAssigneeReqVO reqVO) { taskService.updateTaskAssignee(getLoginUserId(), reqVO); diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/activity/BpmActivityRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/activity/BpmActivityRespVO.java index 7f183f50c..1958fc739 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/activity/BpmActivityRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/activity/BpmActivityRespVO.java @@ -1,26 +1,25 @@ package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.activity; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; -@ApiModel("管理后台 - 流程活动的 Response VO") +@Schema(description = "管理后台 - 流程活动的 Response VO") @Data public class BpmActivityRespVO { - @ApiModelProperty(value = "流程活动的标识", required = true, example = "1024") + @Schema(description = "流程活动的标识", required = true, example = "1024") private String key; - @ApiModelProperty(value = "流程活动的类型", required = true, example = "StartEvent") + @Schema(description = "流程活动的类型", required = true, example = "StartEvent") private String type; - @ApiModelProperty(value = "流程活动的开始时间", required = true) + @Schema(description = "流程活动的开始时间", required = true) private LocalDateTime startTime; - @ApiModelProperty(value = "流程活动的结束时间", required = true) + @Schema(description = "流程活动的结束时间", required = true) private LocalDateTime endTime; - @ApiModelProperty(value = "关联的流程任务的编号", example = "2048", notes = "关联的流程任务,只有 UserTask 等类型才有") + @Schema(description = "关联的流程任务的编号-关联的流程任务,只有 UserTask 等类型才有", example = "2048") private String taskId; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCancelReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCancelReqVO.java index 928f187e7..c0903279b 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCancelReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCancelReqVO.java @@ -1,22 +1,21 @@ package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.util.Map; -@ApiModel("管理后台 - 流程实例的取消 Request VO") +@Schema(description = "管理后台 - 流程实例的取消 Request VO") @Data public class BpmProcessInstanceCancelReqVO { - @ApiModelProperty(value = "流程实例的编号", required = true, example = "1024") + @Schema(description = "流程实例的编号", required = true, example = "1024") @NotEmpty(message = "流程实例的编号不能为空") private String id; - @ApiModelProperty(value = "取消原因", required = true, example = "不请假了!") + @Schema(description = "取消原因", required = true, example = "不请假了!") @NotEmpty(message = "取消原因不能为空") private String reason; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCreateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCreateReqVO.java index 2085253d3..48becaad2 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCreateReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCreateReqVO.java @@ -1,21 +1,20 @@ package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; import java.util.Map; -@ApiModel("管理后台 - 流程实例的创建 Request VO") +@Schema(description = "管理后台 - 流程实例的创建 Request VO") @Data public class BpmProcessInstanceCreateReqVO { - @ApiModelProperty(value = "流程定义的编号", required = true, example = "1024") + @Schema(description = "流程定义的编号", required = true, example = "1024") @NotEmpty(message = "流程定义编号不能为空") private String processDefinitionId; - @ApiModelProperty(value = "变量实例") + @Schema(description = "变量实例") private Map variables; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceMyPageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceMyPageReqVO.java index e52d45f44..5b5d9fb26 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceMyPageReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceMyPageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,28 +11,28 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 流程实例的分页 Item Response VO") +@Schema(description = "管理后台 - 流程实例的分页 Item Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmProcessInstanceMyPageReqVO extends PageParam { - @ApiModelProperty(value = "流程名称", example = "芋道") + @Schema(description = "流程名称", example = "芋道") private String name; - @ApiModelProperty(value = "流程定义的编号", example = "2048") + @Schema(description = "流程定义的编号", example = "2048") private String processDefinitionId; - @ApiModelProperty(value = "流程实例的状态", notes = "参见 bpm_process_instance_status", example = "1") + @Schema(description = "流程实例的状态-参见 bpm_process_instance_status", example = "1") private Integer status; - @ApiModelProperty(value = "流程实例的结果", notes = "参见 bpm_process_instance_result", example = "2") + @Schema(description = "流程实例的结果-参见 bpm_process_instance_result", example = "2") private Integer result; - @ApiModelProperty(value = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1") + @Schema(description = "流程分类-参见 bpm_model_category 数据字典", example = "1") private String category; - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstancePageItemRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstancePageItemRespVO.java index 0d2534b53..c38274138 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstancePageItemRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstancePageItemRespVO.java @@ -1,38 +1,37 @@ package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; import java.util.List; -@ApiModel("管理后台 - 流程实例的分页 Item Response VO") +@Schema(description = "管理后台 - 流程实例的分页 Item Response VO") @Data public class BpmProcessInstancePageItemRespVO { - @ApiModelProperty(value = "流程实例的编号", required = true, example = "1024") + @Schema(description = "流程实例的编号", required = true, example = "1024") private String id; - @ApiModelProperty(value = "流程名称", required = true, example = "芋道") + @Schema(description = "流程名称", required = true, example = "芋道") private String name; - @ApiModelProperty(value = "流程定义的编号", required = true, example = "2048") + @Schema(description = "流程定义的编号", required = true, example = "2048") private String processDefinitionId; - @ApiModelProperty(value = "流程分类", required = true, notes = "参见 bpm_model_category 数据字典", example = "1") + @Schema(description = "流程分类-参见 bpm_model_category 数据字典", required = true, example = "1") private String category; - @ApiModelProperty(value = "流程实例的状态", required = true, notes = "参见 bpm_process_instance_status", example = "1") + @Schema(description = "流程实例的状态-参见 bpm_process_instance_status", required = true, example = "1") private Integer status; - @ApiModelProperty(value = "流程实例的结果", required = true, notes = "参见 bpm_process_instance_result", example = "2") + @Schema(description = "流程实例的结果-参见 bpm_process_instance_result", required = true, example = "2") private Integer result; - @ApiModelProperty(value = "提交时间", required = true) + @Schema(description = "提交时间", required = true) private LocalDateTime createTime; - @ApiModelProperty(value = "结束时间", required = true) + @Schema(description = "结束时间", required = true) private LocalDateTime endTime; /** @@ -40,14 +39,14 @@ public class BpmProcessInstancePageItemRespVO { */ private List tasks; - @ApiModel("流程任务") + @Schema(description = "流程任务") @Data public static class Task { - @ApiModelProperty(value = "流程任务的编号", required = true, example = "1024") + @Schema(description = "流程任务的编号", required = true, example = "1024") private String id; - @ApiModelProperty(value = "任务名称", required = true, example = "芋道") + @Schema(description = "任务名称", required = true, example = "芋道") private String name; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceRespVO.java index 58374dae2..5c6d381a0 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceRespVO.java @@ -1,42 +1,41 @@ package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; import java.util.List; import java.util.Map; -@ApiModel("管理后台 - 流程实例的 Response VO") +@Schema(description = "管理后台 - 流程实例的 Response VO") @Data public class BpmProcessInstanceRespVO { - @ApiModelProperty(value = "流程实例的编号", required = true, example = "1024") + @Schema(description = "流程实例的编号", required = true, example = "1024") private String id; - @ApiModelProperty(value = "流程名称", required = true, example = "芋道") + @Schema(description = "流程名称", required = true, example = "芋道") private String name; - @ApiModelProperty(value = "流程分类", required = true, notes = "参见 bpm_model_category 数据字典", example = "1") + @Schema(description = "流程分类-参见 bpm_model_category 数据字典", required = true, example = "1") private String category; - @ApiModelProperty(value = "流程实例的状态", required = true, notes = "参见 bpm_process_instance_status", example = "1") + @Schema(description = "流程实例的状态-参见 bpm_process_instance_status", required = true, example = "1") private Integer status; - @ApiModelProperty(value = "流程实例的结果", required = true, notes = "参见 bpm_process_instance_result", example = "2") + @Schema(description = "流程实例的结果-参见 bpm_process_instance_result", required = true, example = "2") private Integer result; - @ApiModelProperty(value = "提交时间", required = true) + @Schema(description = "提交时间", required = true) private LocalDateTime createTime; - @ApiModelProperty(value = "结束时间", required = true) + @Schema(description = "结束时间", required = true) private LocalDateTime endTime; - @ApiModelProperty(value = "提交的表单值", required = true) + @Schema(description = "提交的表单值", required = true) private Map formVariables; - @ApiModelProperty(value = "业务的唯一标识", example = "1", notes = "例如说,请假申请的编号") + @Schema(description = "业务的唯一标识-例如说,请假申请的编号", example = "1") private String businessKey; /** @@ -49,47 +48,45 @@ public class BpmProcessInstanceRespVO { */ private ProcessDefinition processDefinition; - @ApiModel("用户信息") + @Schema(description = "用户信息") @Data public static class User { - @ApiModelProperty(value = "用户编号", required = true, example = "1") + @Schema(description = "用户编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "用户昵称", required = true, example = "芋艿") + @Schema(description = "用户昵称", required = true, example = "芋艿") private String nickname; - @ApiModelProperty(value = "部门编号", required = true, example = "1") + @Schema(description = "部门编号", required = true, example = "1") private Long deptId; - @ApiModelProperty(value = "部门名称", required = true, example = "研发部") + @Schema(description = "部门名称", required = true, example = "研发部") private String deptName; } - @ApiModel("流程定义信息") + @Schema(description = "流程定义信息") @Data public static class ProcessDefinition { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") private String id; - @ApiModelProperty(value = "表单类型", notes = "参见 bpm_model_form_type 数据字典", example = "1") + @Schema(description = "表单类型-参见 bpm_model_form_type 数据字典", example = "1") private Integer formType; - @ApiModelProperty(value = "表单编号", example = "1024", notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") + @Schema(description = "表单编号-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", example = "1024") private Long formId; - @ApiModelProperty(value = "表单的配置", required = true, - notes = "JSON 字符串。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") + @Schema(description = "表单的配置-JSON 字符串。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", required = true) private String formConf; - @ApiModelProperty(value = "表单项的数组", required = true, - notes = "JSON 字符串的数组。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") + @Schema(description = "表单项的数组-JSON 字符串的数组。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", required = true) private List formFields; - @ApiModelProperty(value = "自定义表单的提交路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/create", - notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") + @Schema(description = "自定义表单的提交路径,使用 Vue 的路由地址-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", + example = "/bpm/oa/leave/create") private String formCustomCreatePath; - @ApiModelProperty(value = "自定义表单的查看路径,使用 Vue 的路由地址", example = "/bpm/oa/leave/view", - notes = "在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空") + @Schema(description = "自定义表单的查看路径,使用 Vue 的路由地址-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", + example = "/bpm/oa/leave/view") private String formCustomViewPath; - @ApiModelProperty(value = "BPMN XML", required = true) + @Schema(description = "BPMN XML", required = true) private String bpmnXml; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskApproveReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskApproveReqVO.java index 1b6a69066..5214f4650 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskApproveReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskApproveReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; -@ApiModel("管理后台 - 通过流程任务的 Request VO") +@Schema(description = "管理后台 - 通过流程任务的 Request VO") @Data public class BpmTaskApproveReqVO { - @ApiModelProperty(value = "任务编号", required = true, example = "1024") + @Schema(description = "任务编号", required = true, example = "1024") @NotEmpty(message = "任务编号不能为空") private String id; - @ApiModelProperty(value = "审批意见", required = true, example = "不错不错!") + @Schema(description = "审批意见", required = true, example = "不错不错!") @NotEmpty(message = "审批意见不能为空") private String reason; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskDonePageItemRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskDonePageItemRespVO.java index a9bb93f9e..12fa019d9 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskDonePageItemRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskDonePageItemRespVO.java @@ -1,27 +1,26 @@ package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 流程任务的 Done 已完成的分页项 Response VO") +@Schema(description = "管理后台 - 流程任务的 Done 已完成的分页项 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmTaskDonePageItemRespVO extends BpmTaskTodoPageItemRespVO { - @ApiModelProperty(value = "结束时间", required = true) + @Schema(description = "结束时间", required = true) private LocalDateTime endTime; - @ApiModelProperty(value = "持续时间", required = true, example = "1000") + @Schema(description = "持续时间", required = true, example = "1000") private Long durationInMillis; - @ApiModelProperty(value = "任务结果", required = true, notes = "参见 bpm_process_instance_result", example = "2") + @Schema(description = "任务结果-参见 bpm_process_instance_result", required = true, example = "2") private Integer result; - @ApiModelProperty(value = "审批建议", required = true, example = "不请假了!") + @Schema(description = "审批建议", required = true, example = "不请假了!") private String reason; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskDonePageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskDonePageReqVO.java index a347d58fe..52daea445 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskDonePageReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskDonePageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,20 +11,20 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 流程任务的 Done 已办的分页 Request VO") +@Schema(description = "管理后台 - 流程任务的 Done 已办的分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmTaskDonePageReqVO extends PageParam { - @ApiModelProperty(value = "流程任务名", example = "芋道") + @Schema(description = "流程任务名", example = "芋道") private String name; - @ApiModelProperty(value = "开始的创建收间") + @Schema(description = "开始的创建收间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime beginCreateTime; - @ApiModelProperty(value = "结束的创建时间") + @Schema(description = "结束的创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime endCreateTime; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskRejectReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskRejectReqVO.java index 596a82f77..f51a69185 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskRejectReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskRejectReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; -@ApiModel("管理后台 - 不通过流程任务的 Request VO") +@Schema(description = "管理后台 - 不通过流程任务的 Request VO") @Data public class BpmTaskRejectReqVO { - @ApiModelProperty(value = "任务编号", required = true, example = "1024") + @Schema(description = "任务编号", required = true, example = "1024") @NotEmpty(message = "任务编号不能为空") private String id; - @ApiModelProperty(value = "审批意见", required = true, example = "不错不错!") + @Schema(description = "审批意见", required = true, example = "不错不错!") @NotEmpty(message = "审批意见不能为空") private String reason; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskRespVO.java index 1f7d2c7fa..9459c30c1 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskRespVO.java @@ -1,18 +1,17 @@ package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 流程任务的 Response VO") +@Schema(description = "管理后台 - 流程任务的 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmTaskRespVO extends BpmTaskDonePageItemRespVO { - @ApiModelProperty(value = "任务定义的标识", required = true, example = "user-001") + @Schema(description = "任务定义的标识", required = true, example = "user-001") private String definitionKey; /** @@ -20,18 +19,18 @@ public class BpmTaskRespVO extends BpmTaskDonePageItemRespVO { */ private User assigneeUser; - @ApiModel("用户信息") + @Schema(description = "用户信息") @Data public static class User { - @ApiModelProperty(value = "用户编号", required = true, example = "1") + @Schema(description = "用户编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "用户昵称", required = true, example = "芋艿") + @Schema(description = "用户昵称", required = true, example = "芋艿") private String nickname; - @ApiModelProperty(value = "部门编号", required = true, example = "1") + @Schema(description = "部门编号", required = true, example = "1") private Long deptId; - @ApiModelProperty(value = "部门名称", required = true, example = "研发部") + @Schema(description = "部门名称", required = true, example = "研发部") private String deptName; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskTodoPageItemRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskTodoPageItemRespVO.java index 5c2cbf26a..cc71e1b2f 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskTodoPageItemRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskTodoPageItemRespVO.java @@ -1,28 +1,27 @@ package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; -@ApiModel("管理后台 - 流程任务的 Running 进行中的分页项 Response VO") +@Schema(description = "管理后台 - 流程任务的 Running 进行中的分页项 Response VO") @Data public class BpmTaskTodoPageItemRespVO { - @ApiModelProperty(value = "任务编号", required = true, example = "1024") + @Schema(description = "任务编号", required = true, example = "1024") private String id; - @ApiModelProperty(value = "任务名字", required = true, example = "芋道") + @Schema(description = "任务名字", required = true, example = "芋道") private String name; - @ApiModelProperty(value = "接收时间", required = true) + @Schema(description = "接收时间", required = true) private LocalDateTime claimTime; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; - @ApiModelProperty(value = "激活状态", required = true, example = "1", notes = "参见 SuspensionState 枚举") + @Schema(description = "激活状态-参见 SuspensionState 枚举", required = true, example = "1") private Integer suspensionState; /** @@ -31,22 +30,22 @@ public class BpmTaskTodoPageItemRespVO { private ProcessInstance processInstance; @Data - @ApiModel("流程实例") + @Schema(description = "流程实例") public static class ProcessInstance { - @ApiModelProperty(value = "流程实例编号", required = true, example = "1024") + @Schema(description = "流程实例编号", required = true, example = "1024") private String id; - @ApiModelProperty(value = "流程实例名称", required = true, example = "芋道") + @Schema(description = "流程实例名称", required = true, example = "芋道") private String name; - @ApiModelProperty(value = "发起人的用户编号", required = true, example = "1024") + @Schema(description = "发起人的用户编号", required = true, example = "1024") private Long startUserId; - @ApiModelProperty(value = "发起人的用户昵称", required = true, example = "芋艿") + @Schema(description = "发起人的用户昵称", required = true, example = "芋艿") private String startUserNickname; - @ApiModelProperty(value = "流程定义的编号", required = true, example = "2048") + @Schema(description = "流程定义的编号", required = true, example = "2048") private String processDefinitionId; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskTodoPageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskTodoPageReqVO.java index 9d2ad18c2..605007ef5 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskTodoPageReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskTodoPageReqVO.java @@ -1,8 +1,8 @@ package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import cn.iocoder.yudao.framework.common.util.date.DateUtils; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,21 +12,17 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 流程任务的 TODO 待办的分页 Request VO") +@Schema(description = "管理后台 - 流程任务的 TODO 待办的分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BpmTaskTodoPageReqVO extends PageParam { - @ApiModelProperty(value = "流程任务名", example = "芋道") + @Schema(description = "流程任务名", example = "芋道") private String name; - @ApiModelProperty(value = "开始的创建收间") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime beginCreateTime; - - @ApiModelProperty(value = "结束的创建时间") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime endCreateTime; + @Schema(description = "创建时间") + @DateTimeFormat(pattern = DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskUpdateAssigneeReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskUpdateAssigneeReqVO.java index 0dd0ffed4..d0990a142 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskUpdateAssigneeReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskUpdateAssigneeReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -10,15 +9,15 @@ import net.bytebuddy.implementation.bind.annotation.Empty; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 流程任务的更新负责人的 Request VO") +@Schema(description = "管理后台 - 流程任务的更新负责人的 Request VO") @Data public class BpmTaskUpdateAssigneeReqVO { - @ApiModelProperty(value = "任务编号", required = true, example = "1024") + @Schema(description = "任务编号", required = true, example = "1024") @NotEmpty(message = "任务编号不能为空") private String id; - @ApiModelProperty(value = "新审批人的用户编号", required = true, example = "2048") + @Schema(description = "新审批人的用户编号", required = true, example = "2048") @NotNull(message = "新审批人的用户编号不能为空") private Long assigneeUserId; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/web/config/BpmWebConfiguration.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/web/config/BpmWebConfiguration.java new file mode 100644 index 000000000..036e8a12f --- /dev/null +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/web/config/BpmWebConfiguration.java @@ -0,0 +1,24 @@ +package cn.iocoder.yudao.module.bpm.framework.web.config; + +import cn.iocoder.yudao.framework.swagger.config.YudaoSwaggerAutoConfiguration; +import org.springdoc.core.GroupedOpenApi; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * bpm 模块的 web 组件的 Configuration + * + * @author 芋道源码 + */ +@Configuration(proxyBeanMethods = false) +public class BpmWebConfiguration { + + /** + * bpm 模块的 API 分组 + */ + @Bean + public GroupedOpenApi bpmGroupedOpenApi() { + return YudaoSwaggerAutoConfiguration.buildGroupedOpenApi("bpm"); + } + +} diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/web/package-info.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/web/package-info.java new file mode 100644 index 000000000..c01417081 --- /dev/null +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/web/package-info.java @@ -0,0 +1,4 @@ +/** + * bpm 模块的 web 配置 + */ +package cn.iocoder.yudao.module.bpm.framework.web; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmFormServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmFormServiceImpl.java index 967ab8f49..e68a6b489 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmFormServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmFormServiceImpl.java @@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.bpm.service.definition; import cn.hutool.core.lang.Assert; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.json.JsonUtils; -import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils; import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormCreateReqVO; import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormPageReqVO; import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormUpdateReqVO; @@ -107,17 +106,15 @@ public class BpmFormServiceImpl implements BpmFormService { return null; } - private void checkKeyNCName(String key) { - if (!ValidationUtils.isXmlNCName(key)) { - throw exception(MODEL_KEY_VALID); - } - } /** * 校验 Field,避免 field 重复 * * @param fields field 数组 */ private void checkFields(List fields) { + if (true) { // TODO 芋艿:兼容 Vue3 工作流:因为采用了新的表单设计器,所以暂时不校验 + return; + } Map fieldMap = new HashMap<>(); // key 是 vModel,value 是 label for (String field : fields) { BpmFormFieldRespDTO fieldDTO = JsonUtils.parseObject(field, BpmFormFieldRespDTO.class); diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmTaskAssignRuleServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmTaskAssignRuleServiceImpl.java index 49bfdac4e..508af962d 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmTaskAssignRuleServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmTaskAssignRuleServiceImpl.java @@ -213,18 +213,18 @@ public class BpmTaskAssignRuleServiceImpl implements BpmTaskAssignRuleService { private void validTaskAssignRuleOptions(Integer type, Set options) { if (Objects.equals(type, BpmTaskAssignRuleTypeEnum.ROLE.getType())) { - roleApi.validRoles(options); + roleApi.validRoleList(options); } else if (ObjectUtils.equalsAny(type, BpmTaskAssignRuleTypeEnum.DEPT_MEMBER.getType(), BpmTaskAssignRuleTypeEnum.DEPT_LEADER.getType())) { - deptApi.validDepts(options); + deptApi.validateDeptList(options); } else if (Objects.equals(type, BpmTaskAssignRuleTypeEnum.POST.getType())) { - postApi.validPosts(options); + postApi.validPostList(options); } else if (Objects.equals(type, BpmTaskAssignRuleTypeEnum.USER.getType())) { - adminUserApi.validUsers(options); + adminUserApi.validateUserList(options); } else if (Objects.equals(type, BpmTaskAssignRuleTypeEnum.USER_GROUP.getType())) { userGroupService.validUserGroups(options); } else if (Objects.equals(type, BpmTaskAssignRuleTypeEnum.SCRIPT.getType())) { - dictDataApi.validDictDatas(DictTypeConstants.TASK_ASSIGN_SCRIPT, + dictDataApi.validateDictDataList(DictTypeConstants.TASK_ASSIGN_SCRIPT, CollectionUtils.convertSet(options, String::valueOf)); } else { throw new IllegalArgumentException(format("未知的规则类型({})", type)); @@ -288,12 +288,12 @@ public class BpmTaskAssignRuleServiceImpl implements BpmTaskAssignRuleService { } private Set calculateTaskCandidateUsersByDeptMember(BpmTaskAssignRuleDO rule) { - List users = adminUserApi.getUsersByDeptIds(rule.getOptions()); + List users = adminUserApi.getUserListByDeptIds(rule.getOptions()); return convertSet(users, AdminUserRespDTO::getId); } private Set calculateTaskCandidateUsersByDeptLeader(BpmTaskAssignRuleDO rule) { - List depts = deptApi.getDepts(rule.getOptions()); + List depts = deptApi.getDeptList(rule.getOptions()); return convertSet(depts, DeptRespDTO::getLeaderUserId); } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java index 929eb0137..62b638f2e 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java @@ -1,6 +1,8 @@ package cn.iocoder.yudao.module.bpm.service.task; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.ListUtil; +import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.date.DateUtils; @@ -75,11 +77,11 @@ public class BpmTaskServiceImpl implements BpmTaskService { if (StrUtil.isNotBlank(pageVO.getName())) { taskQuery.taskNameLike("%" + pageVO.getName() + "%"); } - if (pageVO.getBeginCreateTime() != null) { - taskQuery.taskCreatedAfter(DateUtils.of(pageVO.getBeginCreateTime())); + if (ArrayUtil.get(pageVO.getCreateTime(), 0) != null) { + taskQuery.taskCreatedAfter(DateUtils.of(pageVO.getCreateTime()[0])); } - if (pageVO.getEndCreateTime() != null) { - taskQuery.taskCreatedBefore(DateUtils.of(pageVO.getEndCreateTime())); + if (ArrayUtil.get(pageVO.getCreateTime(), 1) != null) { + taskQuery.taskCreatedBefore(DateUtils.of(pageVO.getCreateTime()[1])); } // 执行查询 List tasks = taskQuery.listPage(PageUtils.getStart(pageVO), pageVO.getPageSize()); diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/test/java/cn/iocoder/yudao/module/bpm/service/definition/BpmTaskAssignRuleServiceImplTest.java b/yudao-module-bpm/yudao-module-bpm-biz/src/test/java/cn/iocoder/yudao/module/bpm/service/definition/BpmTaskAssignRuleServiceImplTest.java index ff163663d..7c1eb0f84 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/test/java/cn/iocoder/yudao/module/bpm/service/definition/BpmTaskAssignRuleServiceImplTest.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/test/java/cn/iocoder/yudao/module/bpm/service/definition/BpmTaskAssignRuleServiceImplTest.java @@ -86,7 +86,7 @@ public class BpmTaskAssignRuleServiceImplTest extends BaseDbUnitTest { // mock 方法 List users = CollectionUtils.convertList(asSet(11L, 22L), id -> new AdminUserRespDTO().setId(id)); - when(adminUserApi.getUsersByDeptIds(eq(rule.getOptions()))).thenReturn(users); + when(adminUserApi.getUserListByDeptIds(eq(rule.getOptions()))).thenReturn(users); mockGetUserMap(asSet(11L, 22L)); // 调用 diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/CodegenController.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/CodegenController.java index 9a0013b93..76e5b6a83 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/CodegenController.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/CodegenController.java @@ -16,10 +16,10 @@ import cn.iocoder.yudao.module.infra.convert.codegen.CodegenConvert; import cn.iocoder.yudao.module.infra.dal.dataobject.codegen.CodegenColumnDO; import cn.iocoder.yudao.module.infra.dal.dataobject.codegen.CodegenTableDO; import cn.iocoder.yudao.module.infra.service.codegen.CodegenService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -36,7 +36,7 @@ import java.util.Map; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; -@Api(tags = "管理后台 - 代码生成器") +@Tag(name = "管理后台 - 代码生成器") @RestController @RequestMapping("/infra/codegen") @Validated @@ -46,11 +46,11 @@ public class CodegenController { private CodegenService codegenService; @GetMapping("/db/table/list") - @ApiOperation(value = "获得数据库自带的表定义列表", notes = "会过滤掉已经导入 Codegen 的表") - @ApiImplicitParams({ - @ApiImplicitParam(name = "dataSourceConfigId", value = "数据源配置的编号", required = true, example = "1", dataTypeClass = Long.class), - @ApiImplicitParam(name = "name", value = "表名,模糊匹配", example = "yudao", dataTypeClass = String.class), - @ApiImplicitParam(name = "comment", value = "描述,模糊匹配", example = "芋道", dataTypeClass = String.class) + @Operation(summary = "获得数据库自带的表定义列表", description = "会过滤掉已经导入 Codegen 的表") + @Parameters({ + @Parameter(name = "dataSourceConfigId", description = "数据源配置的编号", required = true, example = "1"), + @Parameter(name = "name", description = "表名,模糊匹配", example = "yudao"), + @Parameter(name = "comment", description = "描述,模糊匹配", example = "芋道") }) @PreAuthorize("@ss.hasPermission('infra:codegen:query')") public CommonResult> getDatabaseTableList( @@ -61,7 +61,7 @@ public class CodegenController { } @GetMapping("/table/page") - @ApiOperation("获得表定义分页") + @Operation(summary = "获得表定义分页") @PreAuthorize("@ss.hasPermission('infra:codegen:query')") public CommonResult> getCodeGenTablePage(@Valid CodegenTablePageReqVO pageReqVO) { PageResult pageResult = codegenService.getCodegenTablePage(pageReqVO); @@ -69,8 +69,8 @@ public class CodegenController { } @GetMapping("/detail") - @ApiOperation("获得表和字段的明细") - @ApiImplicitParam(name = "tableId", value = "表编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得表和字段的明细") + @Parameter(name = "tableId", description = "表编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('infra:codegen:query')") public CommonResult getCodegenDetail(@RequestParam("tableId") Long tableId) { CodegenTableDO table = codegenService.getCodegenTablePage(tableId); @@ -79,14 +79,14 @@ public class CodegenController { return success(CodegenConvert.INSTANCE.convert(table, columns)); } - @ApiOperation("基于数据库的表结构,创建代码生成器的表和字段定义") + @Operation(summary = "基于数据库的表结构,创建代码生成器的表和字段定义") @PostMapping("/create-list") @PreAuthorize("@ss.hasPermission('infra:codegen:create')") public CommonResult> createCodegenList(@Valid @RequestBody CodegenCreateListReqVO reqVO) { return success(codegenService.createCodegenList(getLoginUserId(), reqVO)); } - @ApiOperation("更新数据库的表和字段定义") + @Operation(summary = "更新数据库的表和字段定义") @PutMapping("/update") @PreAuthorize("@ss.hasPermission('infra:codegen:update')") public CommonResult updateCodegen(@Valid @RequestBody CodegenUpdateReqVO updateReqVO) { @@ -94,36 +94,36 @@ public class CodegenController { return success(true); } - @ApiOperation("基于数据库的表结构,同步数据库的表和字段定义") + @Operation(summary = "基于数据库的表结构,同步数据库的表和字段定义") @PutMapping("/sync-from-db") - @ApiImplicitParam(name = "tableId", value = "表编号", required = true, example = "1024", dataTypeClass = Long.class) + @Parameter(name = "tableId", description = "表编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('infra:codegen:update')") public CommonResult syncCodegenFromDB(@RequestParam("tableId") Long tableId) { codegenService.syncCodegenFromDB(tableId); return success(true); } - @ApiOperation("删除数据库的表和字段定义") + @Operation(summary = "删除数据库的表和字段定义") @DeleteMapping("/delete") - @ApiImplicitParam(name = "tableId", value = "表编号", required = true, example = "1024", dataTypeClass = Long.class) + @Parameter(name = "tableId", description = "表编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('infra:codegen:delete')") public CommonResult deleteCodegen(@RequestParam("tableId") Long tableId) { codegenService.deleteCodegen(tableId); return success(true); } - @ApiOperation("预览生成代码") + @Operation(summary = "预览生成代码") @GetMapping("/preview") - @ApiImplicitParam(name = "tableId", value = "表编号", required = true, example = "1024", dataTypeClass = Long.class) + @Parameter(name = "tableId", description = "表编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('infra:codegen:preview')") public CommonResult> previewCodegen(@RequestParam("tableId") Long tableId) { Map codes = codegenService.generationCodes(tableId); return success(CodegenConvert.INSTANCE.convert(codes)); } - @ApiOperation("下载生成代码") + @Operation(summary = "下载生成代码") @GetMapping("/download") - @ApiImplicitParam(name = "tableId", value = "表编号", required = true, example = "1024", dataTypeClass = Long.class) + @Parameter(name = "tableId", description = "表编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('infra:codegen:download')") public void downloadCodegen(@RequestParam("tableId") Long tableId, HttpServletResponse response) throws IOException { diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenCreateListReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenCreateListReqVO.java index 965c5d2b9..da9e2c674 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenCreateListReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenCreateListReqVO.java @@ -1,21 +1,20 @@ package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; import java.util.List; -@ApiModel("管理后台 - 基于数据库的表结构,创建代码生成器的表和字段定义 Request VO") +@Schema(description = "管理后台 - 基于数据库的表结构,创建代码生成器的表和字段定义 Request VO") @Data public class CodegenCreateListReqVO { - @ApiModelProperty(value = "数据源配置的编号", required = true, example = "1") + @Schema(description = "数据源配置的编号", required = true, example = "1") @NotNull(message = "数据源配置的编号不能为空") private Long dataSourceConfigId; - @ApiModelProperty(value = "表名数组", required = true, example = "[1, 2, 3]") + @Schema(description = "表名数组", required = true, example = "[1, 2, 3]") @NotNull(message = "表名数组不能为空") private List tableNames; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenDetailRespVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenDetailRespVO.java index ad9c86812..f7d8a62a4 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenDetailRespVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenDetailRespVO.java @@ -2,20 +2,19 @@ package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo; import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column.CodegenColumnRespVO; import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table.CodegenTableRespVO; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.List; -@ApiModel("管理后台 - 代码生成表和字段的明细 Response VO") +@Schema(description = "管理后台 - 代码生成表和字段的明细 Response VO") @Data public class CodegenDetailRespVO { - @ApiModelProperty("表定义") + @Schema(description = "表定义") private CodegenTableRespVO table; - @ApiModelProperty("字段定义") + @Schema(description = "字段定义") private List columns; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenPreviewRespVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenPreviewRespVO.java index 662a2350c..89e98e6c0 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenPreviewRespVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenPreviewRespVO.java @@ -1,17 +1,16 @@ package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@ApiModel(value = "管理后台 - 代码生成预览 Response VO", description ="注意,每个文件都是一个该对象") +@Schema(description = "管理后台 - 代码生成预览 Response VO,注意,每个文件都是一个该对象") @Data public class CodegenPreviewRespVO { - @ApiModelProperty(value = "文件路径", required = true, example = "java/cn/iocoder/yudao/adminserver/modules/system/controller/test/SysTestDemoController.java") + @Schema(description = "文件路径", required = true, example = "java/cn/iocoder/yudao/adminserver/modules/system/controller/test/SysTestDemoController.java") private String filePath; - @ApiModelProperty(value = "代码", required = true, example = "Hello World") + @Schema(description = "代码", required = true, example = "Hello World") private String code; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenUpdateReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenUpdateReqVO.java index 2423da077..b10885868 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenUpdateReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenUpdateReqVO.java @@ -4,8 +4,7 @@ import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column.CodegenColumnBaseVO; import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table.CodegenTableBaseVO; import cn.iocoder.yudao.module.infra.enums.codegen.CodegenSceneEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -15,7 +14,7 @@ import javax.validation.constraints.AssertTrue; import javax.validation.constraints.NotNull; import java.util.List; -@ApiModel("管理后台 - 代码生成表和字段的修改 Request VO") +@Schema(description = "管理后台 - 代码生成表和字段的修改 Request VO") @Data public class CodegenUpdateReqVO { @@ -27,14 +26,14 @@ public class CodegenUpdateReqVO { @NotNull(message = "字段定义不能为空") private List columns; - @ApiModel("更新表定义") + @Schema(description = "更新表定义") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @Valid public static class Table extends CodegenTableBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1") + @Schema(description = "编号", required = true, example = "1") private Long id; @AssertTrue(message = "上级菜单不能为空") @@ -46,13 +45,13 @@ public class CodegenUpdateReqVO { } - @ApiModel("更新表定义") + @Schema(description = "更新表定义") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public static class Column extends CodegenColumnBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1") + @Schema(description = "编号", required = true, example = "1") private Long id; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/column/CodegenColumnBaseVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/column/CodegenColumnBaseVO.java index 770255185..abbb30983 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/column/CodegenColumnBaseVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/column/CodegenColumnBaseVO.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column; - -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; @@ -12,73 +11,73 @@ import javax.validation.constraints.NotNull; @Data public class CodegenColumnBaseVO { - @ApiModelProperty(value = "表编号", required = true, example = "1") + @Schema(description = "表编号", required = true, example = "1") @NotNull(message = "表编号不能为空") private Long tableId; - @ApiModelProperty(value = "字段名", required = true, example = "user_age") + @Schema(description = "字段名", required = true, example = "user_age") @NotNull(message = "字段名不能为空") private String columnName; - @ApiModelProperty(value = "字段类型", required = true, example = "int(11)") + @Schema(description = "字段类型", required = true, example = "int(11)") @NotNull(message = "字段类型不能为空") private String dataType; - @ApiModelProperty(value = "字段描述", required = true, example = "年龄") + @Schema(description = "字段描述", required = true, example = "年龄") @NotNull(message = "字段描述不能为空") private String columnComment; - @ApiModelProperty(value = "是否允许为空", required = true, example = "true") + @Schema(description = "是否允许为空", required = true, example = "true") @NotNull(message = "是否允许为空不能为空") private Boolean nullable; - @ApiModelProperty(value = "是否主键", required = true, example = "false") + @Schema(description = "是否主键", required = true, example = "false") @NotNull(message = "是否主键不能为空") private Boolean primaryKey; - @ApiModelProperty(value = "是否自增", required = true, example = "true") + @Schema(description = "是否自增", required = true, example = "true") @NotNull(message = "是否自增不能为空") private String autoIncrement; - @ApiModelProperty(value = "排序", required = true, example = "10") + @Schema(description = "排序", required = true, example = "10") @NotNull(message = "排序不能为空") private Integer ordinalPosition; - @ApiModelProperty(value = "Java 属性类型", required = true, example = "userAge") + @Schema(description = "Java 属性类型", required = true, example = "userAge") @NotNull(message = "Java 属性类型不能为空") private String javaType; - @ApiModelProperty(value = "Java 属性名", required = true, example = "Integer") + @Schema(description = "Java 属性名", required = true, example = "Integer") @NotNull(message = "Java 属性名不能为空") private String javaField; - @ApiModelProperty(value = "字典类型", example = "sys_gender") + @Schema(description = "字典类型", example = "sys_gender") private String dictType; - @ApiModelProperty(value = "数据示例", example = "1024") + @Schema(description = "数据示例", example = "1024") private String example; - @ApiModelProperty(value = "是否为 Create 创建操作的字段", required = true, example = "true") + @Schema(description = "是否为 Create 创建操作的字段", required = true, example = "true") @NotNull(message = "是否为 Create 创建操作的字段不能为空") private Boolean createOperation; - @ApiModelProperty(value = "是否为 Update 更新操作的字段", required = true, example = "false") + @Schema(description = "是否为 Update 更新操作的字段", required = true, example = "false") @NotNull(message = "是否为 Update 更新操作的字段不能为空") private Boolean updateOperation; - @ApiModelProperty(value = "是否为 List 查询操作的字段", required = true, example = "true") + @Schema(description = "是否为 List 查询操作的字段", required = true, example = "true") @NotNull(message = "是否为 List 查询操作的字段不能为空") private Boolean listOperation; - @ApiModelProperty(value = "List 查询操作的条件类型", required = true, example = "LIKE", notes = "参见 CodegenColumnListConditionEnum 枚举") + @Schema(description = "List 查询操作的条件类型,参见 CodegenColumnListConditionEnum 枚举", required = true, example = "LIKE") @NotNull(message = "List 查询操作的条件类型不能为空") private String listOperationCondition; - @ApiModelProperty(value = "是否为 List 查询操作的返回字段", required = true, example = "true") + @Schema(description = "是否为 List 查询操作的返回字段", required = true, example = "true") @NotNull(message = "是否为 List 查询操作的返回字段不能为空") private Boolean listOperationResult; - @ApiModelProperty(value = "显示类型", required = true, example = "input") + @Schema(description = "显示类型", required = true, example = "input") @NotNull(message = "显示类型不能为空") private String htmlType; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/column/CodegenColumnRespVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/column/CodegenColumnRespVO.java index 125b71801..1ef17b0ea 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/column/CodegenColumnRespVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/column/CodegenColumnRespVO.java @@ -1,23 +1,22 @@ package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 代码生成字段定义 Response VO") +@Schema(description = "管理后台 - 代码生成字段定义 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class CodegenColumnRespVO extends CodegenColumnBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1") + @Schema(description = "编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTableBaseVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTableBaseVO.java index ad69de7dd..11ed1144a 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTableBaseVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTableBaseVO.java @@ -1,57 +1,56 @@ package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table; - -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; /** -* 代码生成 Base VO,提供给添加、修改、详细的子 VO 使用 -* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 -*/ + * 代码生成 Base VO,提供给添加、修改、详细的子 VO 使用 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 + */ @Data public class CodegenTableBaseVO { - @ApiModelProperty(value = "生成场景", required = true, example = "1", notes = "参见 CodegenSceneEnum 枚举") + @Schema(description = "生成场景,参见 CodegenSceneEnum 枚举", required = true, example = "1") @NotNull(message = "导入类型不能为空") private Integer scene; - @ApiModelProperty(value = "表名称", required = true, example = "yudao") + @Schema(description = "表名称", required = true, example = "yudao") @NotNull(message = "表名称不能为空") private String tableName; - @ApiModelProperty(value = "表描述", required = true, example = "芋道") + @Schema(description = "表描述", required = true, example = "芋道") @NotNull(message = "表描述不能为空") private String tableComment; - @ApiModelProperty(value = "备注", example = "我是备注") + @Schema(description = "备注", example = "我是备注") private String remark; - @ApiModelProperty(value = "模块名", required = true, example = "system") + @Schema(description = "模块名", required = true, example = "system") @NotNull(message = "模块名不能为空") private String moduleName; - @ApiModelProperty(value = "业务名", required = true, example = "codegen") + @Schema(description = "业务名", required = true, example = "codegen") @NotNull(message = "业务名不能为空") private String businessName; - @ApiModelProperty(value = "类名称", required = true, example = "CodegenTable") + @Schema(description = "类名称", required = true, example = "CodegenTable") @NotNull(message = "类名称不能为空") private String className; - @ApiModelProperty(value = "类描述", required = true, example = "代码生成器的表定义") + @Schema(description = "类描述", required = true, example = "代码生成器的表定义") @NotNull(message = "类描述不能为空") private String classComment; - @ApiModelProperty(value = "作者", required = true, example = "芋道源码") + @Schema(description = "作者", required = true, example = "芋道源码") @NotNull(message = "作者不能为空") private String author; - @ApiModelProperty(value = "模板类型", required = true, example = "1", notes = "参见 CodegenTemplateTypeEnum 枚举") + @Schema(description = "模板类型,参见 CodegenTemplateTypeEnum 枚举", required = true, example = "1") @NotNull(message = "模板类型不能为空") private Integer templateType; - @ApiModelProperty(value = "父菜单编号", example = "1024") + @Schema(description = "父菜单编号", example = "1024") private Long parentMenuId; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTablePageReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTablePageReqVO.java index 7a8ff7f31..bc93e73ea 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTablePageReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTablePageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,19 +11,19 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 表定义分页 Request VO") +@Schema(description = "管理后台 - 表定义分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class CodegenTablePageReqVO extends PageParam { - @ApiModelProperty(value = "表名称", example = "yudao", notes = "模糊匹配") + @Schema(description = "表名称,模糊匹配", example = "yudao") private String tableName; - @ApiModelProperty(value = "表描述", example = "芋道", notes = "模糊匹配") + @Schema(description = "表描述,模糊匹配", example = "芋道") private String tableComment; - @ApiModelProperty(value = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") + @Schema(description = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTableRespVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTableRespVO.java index 7ef96b9a8..af45018bd 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTableRespVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTableRespVO.java @@ -1,29 +1,28 @@ package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 代码生成表定义 Response VO") +@Schema(description = "管理后台 - 代码生成表定义 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class CodegenTableRespVO extends CodegenTableBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1") + @Schema(description = "编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "主键编号", required = true, example = "1024") + @Schema(description = "主键编号", required = true, example = "1024") private Integer dataSourceConfigId; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; - @ApiModelProperty(value = "更新时间", required = true) + @Schema(description = "更新时间", required = true) private LocalDateTime updateTime; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/DatabaseTableRespVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/DatabaseTableRespVO.java index 1423d119e..61668db15 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/DatabaseTableRespVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/DatabaseTableRespVO.java @@ -1,17 +1,16 @@ package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@ApiModel("管理后台 - 数据库的表定义 Response VO") +@Schema(description = "管理后台 - 数据库的表定义 Response VO") @Data public class DatabaseTableRespVO { - @ApiModelProperty(value = "表名称", required = true, example = "yuanma") + @Schema(description = "表名称", required = true, example = "yuanma") private String name; - @ApiModelProperty(value = "表描述", required = true, example = "芋道源码") + @Schema(description = "表描述", required = true, example = "芋道源码") private String comment; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/ConfigController.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/ConfigController.java index 493b5faa6..afaee6fa4 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/ConfigController.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/ConfigController.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.infra.controller.admin.config; -import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; @@ -8,11 +7,11 @@ import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; import cn.iocoder.yudao.module.infra.controller.admin.config.vo.*; 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.service.config.ConfigService; import cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import cn.iocoder.yudao.module.infra.service.config.ConfigService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -23,10 +22,11 @@ import javax.validation.Valid; import java.io.IOException; import java.util.List; +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; -@Api(tags = "管理后台 - 参数配置") +@Tag(name = "管理后台 - 参数配置") @RestController @RequestMapping("/infra/config") @Validated @@ -36,14 +36,14 @@ public class ConfigController { private ConfigService configService; @PostMapping("/create") - @ApiOperation("创建参数配置") + @Operation(summary = "创建参数配置") @PreAuthorize("@ss.hasPermission('infra:config:create')") public CommonResult createConfig(@Valid @RequestBody ConfigCreateReqVO reqVO) { return success(configService.createConfig(reqVO)); } @PutMapping("/update") - @ApiOperation("修改参数配置") + @Operation(summary = "修改参数配置") @PreAuthorize("@ss.hasPermission('infra:config:update')") public CommonResult updateConfig(@Valid @RequestBody ConfigUpdateReqVO reqVO) { configService.updateConfig(reqVO); @@ -51,8 +51,8 @@ public class ConfigController { } @DeleteMapping("/delete") - @ApiOperation("删除参数配置") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "删除参数配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('infra:config:delete')") public CommonResult deleteConfig(@RequestParam("id") Long id) { configService.deleteConfig(id); @@ -60,29 +60,29 @@ public class ConfigController { } @GetMapping(value = "/get") - @ApiOperation("获得参数配置") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得参数配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('infra:config:query')") public CommonResult getConfig(@RequestParam("id") Long id) { return success(ConfigConvert.INSTANCE.convert(configService.getConfig(id))); } @GetMapping(value = "/get-value-by-key") - @ApiOperation(value = "根据参数键名查询参数值", notes = "不可见的配置,不允许返回给前端") - @ApiImplicitParam(name = "key", value = "参数键", required = true, example = "yunai.biz.username", dataTypeClass = String.class) + @Operation(summary = "根据参数键名查询参数值", description = "不可见的配置,不允许返回给前端") + @Parameter(name = "key", description = "参数键", required = true, example = "yunai.biz.username") public CommonResult getConfigKey(@RequestParam("key") String key) { ConfigDO config = configService.getConfigByKey(key); if (config == null) { return null; } if (!config.getVisible()) { - throw ServiceExceptionUtil.exception(ErrorCodeConstants.CONFIG_GET_VALUE_ERROR_IF_VISIBLE); + throw exception(ErrorCodeConstants.CONFIG_GET_VALUE_ERROR_IF_VISIBLE); } return success(config.getValue()); } @GetMapping("/page") - @ApiOperation("获取参数配置分页") + @Operation(summary = "获取参数配置分页") @PreAuthorize("@ss.hasPermission('infra:config:query')") public CommonResult> getConfigPage(@Valid ConfigPageReqVO reqVO) { PageResult page = configService.getConfigPage(reqVO); @@ -90,11 +90,11 @@ public class ConfigController { } @GetMapping("/export") - @ApiOperation("导出参数配置") + @Operation(summary = "导出参数配置") @PreAuthorize("@ss.hasPermission('infra:config:export')") @OperateLog(type = EXPORT) - public void exportSysConfig(@Valid ConfigExportReqVO reqVO, - HttpServletResponse response) throws IOException { + public void exportConfig(@Valid ConfigExportReqVO reqVO, + HttpServletResponse response) throws IOException { List list = configService.getConfigList(reqVO); // 拼接数据 List datas = ConfigConvert.INSTANCE.convertList(list); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigBaseVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigBaseVO.java index 774b0ac81..155b2da81 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigBaseVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigBaseVO.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.infra.controller.admin.config.vo; - -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -15,26 +14,26 @@ import javax.validation.constraints.Size; @Data public class ConfigBaseVO { - @ApiModelProperty(value = "参数分组", required = true, example = "biz") + @Schema(description = "参数分组", required = true, example = "biz") @NotEmpty(message = "参数分组不能为空") @Size(max = 50, message = "参数名称不能超过50个字符") private String category; - @ApiModelProperty(value = "参数名称", required = true, example = "数据库名") + @Schema(description = "参数名称", required = true, example = "数据库名") @NotBlank(message = "参数名称不能为空") @Size(max = 100, message = "参数名称不能超过100个字符") private String name; - @ApiModelProperty(value = "参数键值", required = true, example = "1024") + @Schema(description = "参数键值", required = true, example = "1024") @NotBlank(message = "参数键值不能为空") @Size(max = 500, message = "参数键值长度不能超过500个字符") private String value; - @ApiModelProperty(value = "是否敏感", required = true, example = "true") + @Schema(description = "是否敏感", required = true, example = "true") @NotNull(message = "是否敏感不能为空") private Boolean visible; - @ApiModelProperty(value = "备注", example = "备注一下很帅气!") + @Schema(description = "备注", example = "备注一下很帅气!") private String remark; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigCreateReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigCreateReqVO.java index 7a2118ae1..186629b0f 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigCreateReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigCreateReqVO.java @@ -1,19 +1,18 @@ package cn.iocoder.yudao.module.infra.controller.admin.config.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; -@ApiModel("管理后台 - 参数配置创建 Request VO") +@Schema(description = "管理后台 - 参数配置创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class ConfigCreateReqVO extends ConfigBaseVO { - @ApiModelProperty(value = "参数键名", required = true, example = "yunai.db.username") + @Schema(description = "参数键名", required = true, example = "yunai.db.username") @NotBlank(message = "参数键名长度不能为空") @Size(max = 100, message = "参数键名长度不能超过100个字符") private String key; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigExportReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigExportReqVO.java index 7c679e2d1..f0f4b4ff3 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigExportReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigExportReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.config.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -9,20 +8,20 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 参数配置导出 Request VO") +@Schema(description = "管理后台 - 参数配置导出 Request VO") @Data public class ConfigExportReqVO { - @ApiModelProperty(value = "参数名称", example = "模糊匹配") + @Schema(description = "参数名称", example = "模糊匹配") private String name; - @ApiModelProperty(value = "参数键名", example = "yunai.db.username", notes = "模糊匹配") + @Schema(description = "参数键名,模糊匹配", example = "yunai.db.username") private String key; - @ApiModelProperty(value = "参数类型", example = "1", notes = "参见 SysConfigTypeEnum 枚举") + @Schema(description = "参数类型,参见 SysConfigTypeEnum 枚举", example = "1") private Integer type; - @ApiModelProperty(value = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") + @Schema(description = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigPageReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigPageReqVO.java index 5ca206d46..8f87d6ee9 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigPageReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigPageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.infra.controller.admin.config.vo; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,22 +11,22 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 参数配置分页 Request VO") +@Schema(description = "管理后台 - 参数配置分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ConfigPageReqVO extends PageParam { - @ApiModelProperty(value = "数据源名称", example = "模糊匹配") + @Schema(description = "数据源名称,模糊匹配", example = "名称") private String name; - @ApiModelProperty(value = "参数键名", example = "yunai.db.username", notes = "模糊匹配") + @Schema(description = "参数键名,模糊匹配", example = "yunai.db.username") private String key; - @ApiModelProperty(value = "参数类型", example = "1", notes = "参见 SysConfigTypeEnum 枚举") + @Schema(description = "参数类型,参见 SysConfigTypeEnum 枚举", example = "1") private Integer type; - @ApiModelProperty(value = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") + @Schema(description = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigRespVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigRespVO.java index 0c952eecb..738cd6481 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigRespVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.config.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; @@ -9,23 +8,23 @@ import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; import java.time.LocalDateTime; -@ApiModel("管理后台 - 参数配置信息 Response VO") +@Schema(description = "管理后台 - 参数配置信息 Response VO") @Data @EqualsAndHashCode(callSuper = true) public class ConfigRespVO extends ConfigBaseVO { - @ApiModelProperty(value = "参数配置序号", required = true, example = "1024") + @Schema(description = "参数配置序号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "参数键名", required = true, example = "yunai.db.username") + @Schema(description = "参数键名", required = true, example = "yunai.db.username") @NotBlank(message = "参数键名长度不能为空") @Size(max = 100, message = "参数键名长度不能超过100个字符") private String key; - @ApiModelProperty(value = "参数类型", required = true, example = "1", notes = "参见 SysConfigTypeEnum 枚举") + @Schema(description = "参数类型,参见 SysConfigTypeEnum 枚举", required = true, example = "1") private Integer type; - @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") + @Schema(description = "创建时间", required = true, example = "时间戳格式") private LocalDateTime createTime; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigUpdateReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigUpdateReqVO.java index 2335d6169..efa689d42 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigUpdateReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigUpdateReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.infra.controller.admin.config.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 参数配置创建 Request VO") +@Schema(description = "管理后台 - 参数配置创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ConfigUpdateReqVO extends ConfigBaseVO { - @ApiModelProperty(value = "参数配置序号", required = true, example = "1024") + @Schema(description = "参数配置序号", required = true, example = "1024") @NotNull(message = "参数配置编号不能为空") private Long id; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/DataSourceConfigController.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/DataSourceConfigController.java index 6b535ae98..366f382d7 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/DataSourceConfigController.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/DataSourceConfigController.java @@ -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.dal.dataobject.db.DataSourceConfigDO; import cn.iocoder.yudao.module.infra.service.db.DataSourceConfigService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -20,7 +20,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 数据源配置") +@Tag(name = "管理后台 - 数据源配置") @RestController @RequestMapping("/infra/data-source-config") @Validated @@ -30,14 +30,14 @@ public class DataSourceConfigController { private DataSourceConfigService dataSourceConfigService; @PostMapping("/create") - @ApiOperation("创建数据源配置") + @Operation(summary = "创建数据源配置") @PreAuthorize("@ss.hasPermission('infra:data-source-config:create')") public CommonResult createDataSourceConfig(@Valid @RequestBody DataSourceConfigCreateReqVO createReqVO) { return success(dataSourceConfigService.createDataSourceConfig(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新数据源配置") + @Operation(summary = "更新数据源配置") @PreAuthorize("@ss.hasPermission('infra:data-source-config:update')") public CommonResult updateDataSourceConfig(@Valid @RequestBody DataSourceConfigUpdateReqVO updateReqVO) { dataSourceConfigService.updateDataSourceConfig(updateReqVO); @@ -45,8 +45,8 @@ public class DataSourceConfigController { } @DeleteMapping("/delete") - @ApiOperation("删除数据源配置") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除数据源配置") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('infra:data-source-config:delete')") public CommonResult deleteDataSourceConfig(@RequestParam("id") Long id) { dataSourceConfigService.deleteDataSourceConfig(id); @@ -54,8 +54,8 @@ public class DataSourceConfigController { } @GetMapping("/get") - @ApiOperation("获得数据源配置") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得数据源配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('infra:data-source-config:query')") public CommonResult getDataSourceConfig(@RequestParam("id") Long id) { DataSourceConfigDO dataSourceConfig = dataSourceConfigService.getDataSourceConfig(id); @@ -63,7 +63,7 @@ public class DataSourceConfigController { } @GetMapping("/list") - @ApiOperation("获得数据源配置列表") + @Operation(summary = "获得数据源配置列表") @PreAuthorize("@ss.hasPermission('infra:data-source-config:query')") public CommonResult> getDataSourceConfigList() { List list = dataSourceConfigService.getDataSourceConfigList(); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/DatabaseDocController.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/DatabaseDocController.java index eb35d4555..6e05844de 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/DatabaseDocController.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/DatabaseDocController.java @@ -13,9 +13,9 @@ import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourcePrope import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties; import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -27,7 +27,7 @@ import java.io.File; import java.io.IOException; import java.util.Arrays; -@Api(tags = "管理后台 - 数据库文档") +@Tag(name = "管理后台 - 数据库文档") @RestController @RequestMapping("/infra/db-doc") public class DatabaseDocController { @@ -42,27 +42,24 @@ public class DatabaseDocController { private static final String DOC_DESCRIPTION = "文档描述"; @GetMapping("/export-html") - @ApiOperation("导出 html 格式的数据文档") - @ApiImplicitParam(name = "deleteFile", value = "是否删除在服务器本地生成的数据库文档", example = "true", - dataTypeClass = Boolean.class) + @Operation(summary = "导出 html 格式的数据文档") + @Parameter(name = "deleteFile", description = "是否删除在服务器本地生成的数据库文档", example = "true") public void exportHtml(@RequestParam(defaultValue = "true") Boolean deleteFile, HttpServletResponse response) throws IOException { doExportFile(EngineFileType.HTML, deleteFile, response); } @GetMapping("/export-word") - @ApiOperation("导出 word 格式的数据文档") - @ApiImplicitParam(name = "deleteFile", value = "是否删除在服务器本地生成的数据库文档", example = "true", - dataTypeClass = Boolean.class) + @Operation(summary = "导出 word 格式的数据文档") + @Parameter(name = "deleteFile", description = "是否删除在服务器本地生成的数据库文档", example = "true") public void exportWord(@RequestParam(defaultValue = "true") Boolean deleteFile, HttpServletResponse response) throws IOException { doExportFile(EngineFileType.WORD, deleteFile, response); } @GetMapping("/export-markdown") - @ApiOperation("导出 markdown 格式的数据文档") - @ApiImplicitParam(name = "deleteFile", value = "是否删除在服务器本地生成的数据库文档", example = "true", - dataTypeClass = Boolean.class) + @Operation(summary = "导出 markdown 格式的数据文档") + @Parameter(name = "deleteFile", description = "是否删除在服务器本地生成的数据库文档", example = "true") public void exportMarkdown(@RequestParam(defaultValue = "true") Boolean deleteFile, HttpServletResponse response) throws IOException { doExportFile(EngineFileType.MD, deleteFile, response); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigBaseVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigBaseVO.java index dbf25b75c..a757b0882 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigBaseVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigBaseVO.java @@ -1,8 +1,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.db.vo; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import java.util.*; -import io.swagger.annotations.*; import javax.validation.constraints.*; /** @@ -12,15 +10,15 @@ import javax.validation.constraints.*; @Data public class DataSourceConfigBaseVO { - @ApiModelProperty(value = "数据源名称", required = true, example = "test") + @Schema(description = "数据源名称", required = true, example = "test") @NotNull(message = "数据源名称不能为空") 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 = "数据源连接不能为空") private String url; - @ApiModelProperty(value = "用户名", required = true, example = "root") + @Schema(description = "用户名", required = true, example = "root") @NotNull(message = "用户名不能为空") private String username; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigCreateReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigCreateReqVO.java index 13085f9b1..e8f4cc97d 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigCreateReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigCreateReqVO.java @@ -1,17 +1,15 @@ package cn.iocoder.yudao.module.infra.controller.admin.db.vo; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import java.util.*; -import io.swagger.annotations.*; import javax.validation.constraints.*; -@ApiModel("管理后台 - 数据源配置创建 Request VO") +@Schema(description = "管理后台 - 数据源配置创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class DataSourceConfigCreateReqVO extends DataSourceConfigBaseVO { - @ApiModelProperty(value = "密码", required = true, example = "123456") + @Schema(description = "密码", required = true, example = "123456") @NotNull(message = "密码不能为空") private String password; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigRespVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigRespVO.java index dea918764..02bdff415 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigRespVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigRespVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.infra.controller.admin.db.vo; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDateTime; -import io.swagger.annotations.*; -@ApiModel("管理后台 - 数据源配置 Response VO") +@Schema(description = "管理后台 - 数据源配置 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class DataSourceConfigRespVO extends DataSourceConfigBaseVO { - @ApiModelProperty(value = "主键编号", required = true, example = "1024") + @Schema(description = "主键编号", required = true, example = "1024") private Integer id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigUpdateReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigUpdateReqVO.java index 134f3e9df..5fac798ea 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigUpdateReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigUpdateReqVO.java @@ -1,21 +1,19 @@ package cn.iocoder.yudao.module.infra.controller.admin.db.vo; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import java.util.*; -import io.swagger.annotations.*; import javax.validation.constraints.*; -@ApiModel("管理后台 - 数据源配置更新 Request VO") +@Schema(description = "管理后台 - 数据源配置更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class DataSourceConfigUpdateReqVO extends DataSourceConfigBaseVO { - @ApiModelProperty(value = "主键编号", required = true, example = "1024") + @Schema(description = "主键编号", required = true, example = "1024") @NotNull(message = "主键编号不能为空") private Long id; - @ApiModelProperty(value = "密码", required = true, example = "123456") + @Schema(description = "密码", required = true, example = "123456") @NotNull(message = "密码不能为空") private String password; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileConfigController.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileConfigController.java index 8c355d627..1fbae0931 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileConfigController.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileConfigController.java @@ -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.dal.dataobject.file.FileConfigDO; import cn.iocoder.yudao.module.infra.service.file.FileConfigService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -21,7 +21,7 @@ import javax.validation.Valid; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 文件配置") +@Tag(name = "管理后台 - 文件配置") @RestController @RequestMapping("/infra/file-config") @Validated @@ -31,14 +31,14 @@ public class FileConfigController { private FileConfigService fileConfigService; @PostMapping("/create") - @ApiOperation("创建文件配置") + @Operation(summary = "创建文件配置") @PreAuthorize("@ss.hasPermission('infra:file-config:create')") public CommonResult createFileConfig(@Valid @RequestBody FileConfigCreateReqVO createReqVO) { return success(fileConfigService.createFileConfig(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新文件配置") + @Operation(summary = "更新文件配置") @PreAuthorize("@ss.hasPermission('infra:file-config:update')") public CommonResult updateFileConfig(@Valid @RequestBody FileConfigUpdateReqVO updateReqVO) { fileConfigService.updateFileConfig(updateReqVO); @@ -46,7 +46,7 @@ public class FileConfigController { } @PutMapping("/update-master") - @ApiOperation("更新文件配置为 Master") + @Operation(summary = "更新文件配置为 Master") @PreAuthorize("@ss.hasPermission('infra:file-config:update')") public CommonResult updateFileConfigMaster(@RequestParam("id") Long id) { fileConfigService.updateFileConfigMaster(id); @@ -54,8 +54,8 @@ public class FileConfigController { } @DeleteMapping("/delete") - @ApiOperation("删除文件配置") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除文件配置") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('infra:file-config:delete')") public CommonResult deleteFileConfig(@RequestParam("id") Long id) { fileConfigService.deleteFileConfig(id); @@ -63,8 +63,8 @@ public class FileConfigController { } @GetMapping("/get") - @ApiOperation("获得文件配置") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得文件配置") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('infra:file-config:query')") public CommonResult getFileConfig(@RequestParam("id") Long id) { FileConfigDO fileConfig = fileConfigService.getFileConfig(id); @@ -72,7 +72,7 @@ public class FileConfigController { } @GetMapping("/page") - @ApiOperation("获得文件配置分页") + @Operation(summary = "获得文件配置分页") @PreAuthorize("@ss.hasPermission('infra:file-config:query')") public CommonResult> getFileConfigPage(@Valid FileConfigPageReqVO pageVO) { PageResult pageResult = fileConfigService.getFileConfigPage(pageVO); @@ -80,7 +80,7 @@ public class FileConfigController { } @GetMapping("/test") - @ApiOperation("测试文件配置是否正确") + @Operation(summary = "测试文件配置是否正确") @PreAuthorize("@ss.hasPermission('infra:file-config:query')") public CommonResult testFileConfig(@RequestParam("id") Long id) throws Exception { String url = fileConfigService.testFileConfig(id); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java index 3719bc31b..acb9360b5 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java @@ -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.dal.dataobject.file.FileDO; import cn.iocoder.yudao.module.infra.service.file.FileService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; 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; -@Api(tags = "管理后台 - 文件存储") +@Tag(name = "管理后台 - 文件存储") @RestController @RequestMapping("/infra/file") @Validated @@ -41,7 +41,7 @@ public class FileController { private FileService fileService; @PostMapping("/upload") - @ApiOperation("上传文件") + @Operation(summary = "上传文件") @OperateLog(logArgs = false) // 上传文件,没有记录操作日志的必要 public CommonResult uploadFile(FileUploadReqVO uploadReqVO) throws Exception { MultipartFile file = uploadReqVO.getFile(); @@ -50,8 +50,8 @@ public class FileController { } @DeleteMapping("/delete") - @ApiOperation("删除文件") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除文件") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('infra:file:delete')") public CommonResult deleteFile(@RequestParam("id") Long id) throws Exception { fileService.deleteFile(id); @@ -60,8 +60,8 @@ public class FileController { @GetMapping("/{configId}/get/**") @PermitAll - @ApiOperation("下载文件") - @ApiImplicitParam(name = "configId", value = "配置编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "下载文件") + @Parameter(name = "configId", description = "配置编号", required = true) public void getFileContent(HttpServletRequest request, HttpServletResponse response, @PathVariable("configId") Long configId) throws Exception { @@ -82,7 +82,7 @@ public class FileController { } @GetMapping("/page") - @ApiOperation("获得文件分页") + @Operation(summary = "获得文件分页") @PreAuthorize("@ss.hasPermission('infra:file:query')") public CommonResult> getFilePage(@Valid FilePageReqVO pageVO) { PageResult pageResult = fileService.getFilePage(pageVO); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigBaseVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigBaseVO.java index 09faa645b..d7bc42d73 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigBaseVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigBaseVO.java @@ -1,6 +1,5 @@ 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 javax.validation.constraints.NotNull; @@ -12,11 +11,11 @@ import javax.validation.constraints.NotNull; @Data public class FileConfigBaseVO { - @ApiModelProperty(value = "配置名", required = true, example = "S3 - 阿里云") + @Schema(description = "配置名", required = true, example = "S3 - 阿里云") @NotNull(message = "配置名不能为空") private String name; - @ApiModelProperty(value = "备注", example = "我是备注") + @Schema(description = "备注", example = "我是备注") private String remark; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigCreateReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigCreateReqVO.java index 876757920..db64205f4 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigCreateReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigCreateReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -9,17 +8,17 @@ import lombok.ToString; import javax.validation.constraints.NotNull; import java.util.Map; -@ApiModel("管理后台 - 文件配置创建 Request VO") +@Schema(description = "管理后台 - 文件配置创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class FileConfigCreateReqVO extends FileConfigBaseVO { - @ApiModelProperty(value = "存储器", required = true, example = "1", notes = "参见 FileStorageEnum 枚举类") + @Schema(description = "存储器,参见 FileStorageEnum 枚举类参见 FileStorageEnum 枚举类", required = true, example = "1") @NotNull(message = "存储器不能为空") private Integer storage; - @ApiModelProperty(value = "存储配置", required = true, notes = "配置是动态参数,所以使用 Map 接收") + @Schema(description = "存储配置,配置是动态参数,所以使用 Map 接收", required = true) @NotNull(message = "存储配置不能为空") private Map config; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigPageReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigPageReqVO.java index 07104cba5..9d254adb1 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigPageReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigPageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,20 +11,20 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 文件配置分页 Request VO") +@Schema(description = "管理后台 - 文件配置分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class FileConfigPageReqVO extends PageParam { - @ApiModelProperty(value = "配置名", example = "S3 - 阿里云") + @Schema(description = "配置名", example = "S3 - 阿里云") private String name; - @ApiModelProperty(value = "存储器", example = "1") + @Schema(description = "存储器", example = "1") private Integer storage; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigRespVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigRespVO.java index c2341e486..ae194cd31 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigRespVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigRespVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config; import cn.iocoder.yudao.framework.file.core.client.FileClientConfig; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -10,27 +9,27 @@ import lombok.ToString; import javax.validation.constraints.NotNull; import java.time.LocalDateTime; -@ApiModel("管理后台 - 文件配置 Response VO") +@Schema(description = "管理后台 - 文件配置 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class FileConfigRespVO extends FileConfigBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1") + @Schema(description = "编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "存储器", required = true, example = "1", notes = "参见 FileStorageEnum 枚举类") + @Schema(description = "存储器,参见 FileStorageEnum 枚举类", required = true, example = "1") @NotNull(message = "存储器不能为空") private Integer storage; - @ApiModelProperty(value = "是否为主配置", required = true, example = "true") + @Schema(description = "是否为主配置", required = true, example = "true") @NotNull(message = "是否为主配置不能为空") private Boolean master; - @ApiModelProperty(value = "存储配置", required = true) + @Schema(description = "存储配置", required = true) private FileClientConfig config; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigUpdateReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigUpdateReqVO.java index 45f8f751a..cd0c10802 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigUpdateReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigUpdateReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -9,17 +8,17 @@ import lombok.ToString; import javax.validation.constraints.NotNull; import java.util.Map; -@ApiModel("管理后台 - 文件配置更新 Request VO") +@Schema(description = "管理后台 - 文件配置更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class FileConfigUpdateReqVO extends FileConfigBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1") + @Schema(description = "编号", required = true, example = "1") @NotNull(message = "编号不能为空") private Long id; - @ApiModelProperty(value = "存储配置", required = true, notes = "配置是动态参数,所以使用 Map 接收") + @Schema(description = "存储配置,配置是动态参数,所以使用 Map 接收", required = true) @NotNull(message = "存储配置不能为空") private Map config; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FilePageReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FilePageReqVO.java index 0f44f4fc7..fa8b84eef 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FilePageReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FilePageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.infra.controller.admin.file.vo.file; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,20 +11,20 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 文件分页 Request VO") +@Schema(description = "管理后台 - 文件分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class FilePageReqVO extends PageParam { - @ApiModelProperty(value = "文件路径", example = "yudao", notes = "模糊匹配") + @Schema(description = "文件路径,模糊匹配", example = "yudao") private String path; - @ApiModelProperty(value = "文件类型", example = "application/octet-stream", notes = "模糊匹配") + @Schema(description = "文件类型,模糊匹配", example = "application/octet-stream") private String type; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileRespVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileRespVO.java index 4d5cecc7a..80607d8d0 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileRespVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileRespVO.java @@ -1,37 +1,36 @@ package cn.iocoder.yudao.module.infra.controller.admin.file.vo.file; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; -@ApiModel(value = "管理后台 - 文件 Response VO", description = "不返回 content 字段,太大") +@Schema(description = "管理后台 - 文件 Response VO,不返回 content 字段,太大") @Data public class FileRespVO { - @ApiModelProperty(value = "文件编号", required = true, example = "1024") + @Schema(description = "文件编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "配置编号", required = true, example = "11") + @Schema(description = "配置编号", required = true, example = "11") private Long configId; - @ApiModelProperty(value = "文件路径", required = true, example = "yudao.jpg") + @Schema(description = "文件路径", required = true, example = "yudao.jpg") private String path; - @ApiModelProperty(value = "原文件名", required = true, example = "yudao.jpg") + @Schema(description = "原文件名", required = true, example = "yudao.jpg") private String name; - @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; - @ApiModelProperty(value = "文件MIME类型", example = "application/octet-stream") + @Schema(description = "文件MIME类型", example = "application/octet-stream") private String type; - @ApiModelProperty(value = "文件大小", example = "2048", required = true) + @Schema(description = "文件大小", example = "2048", required = true) private Integer size; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileUploadReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileUploadReqVO.java index 74e00a75a..7a4dcb1c2 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileUploadReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileUploadReqVO.java @@ -1,21 +1,20 @@ package cn.iocoder.yudao.module.infra.controller.admin.file.vo.file; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.web.multipart.MultipartFile; import javax.validation.constraints.NotNull; -@ApiModel(value = "管理后台 - 上传文件 Request VO") +@Schema(description = "管理后台 - 上传文件 Request VO") @Data public class FileUploadReqVO { - @ApiModelProperty(value = "文件附件", required = true) + @Schema(description = "文件附件", required = true) @NotNull(message = "文件附件不能为空") private MultipartFile file; - @ApiModelProperty(value = "文件附件", example = "yudaoyuanma.png") + @Schema(description = "文件附件", example = "yudaoyuanma.png") private String path; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobController.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobController.java index e3fd84eda..2574db968 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobController.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobController.java @@ -9,10 +9,10 @@ import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.*; import cn.iocoder.yudao.module.infra.convert.job.JobConvert; import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobDO; import cn.iocoder.yudao.module.infra.service.job.JobService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; import org.quartz.SchedulerException; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -30,7 +30,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; -@Api(tags = "管理后台 - 定时任务") +@Tag(name = "管理后台 - 定时任务") @RestController @RequestMapping("/infra/job") @Validated @@ -40,7 +40,7 @@ public class JobController { private JobService jobService; @PostMapping("/create") - @ApiOperation("创建定时任务") + @Operation(summary = "创建定时任务") @PreAuthorize("@ss.hasPermission('infra:job:create')") public CommonResult createJob(@Valid @RequestBody JobCreateReqVO createReqVO) throws SchedulerException { @@ -48,7 +48,7 @@ public class JobController { } @PutMapping("/update") - @ApiOperation("更新定时任务") + @Operation(summary = "更新定时任务") @PreAuthorize("@ss.hasPermission('infra:job:update')") public CommonResult updateJob(@Valid @RequestBody JobUpdateReqVO updateReqVO) throws SchedulerException { @@ -57,10 +57,10 @@ public class JobController { } @PutMapping("/update-status") - @ApiOperation("更新定时任务的状态") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class), - @ApiImplicitParam(name = "status", value = "状态", required = true, example = "1", dataTypeClass = Integer.class), + @Operation(summary = "更新定时任务的状态") + @Parameters({ + @Parameter(name = "id", description = "编号", required = true, example = "1024"), + @Parameter(name = "status", description = "状态", required = true, example = "1"), }) @PreAuthorize("@ss.hasPermission('infra:job:update')") public CommonResult updateJobStatus(@RequestParam(value = "id") Long id, @RequestParam("status") Integer status) @@ -70,8 +70,8 @@ public class JobController { } @DeleteMapping("/delete") - @ApiOperation("删除定时任务") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "删除定时任务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('infra:job:delete')") public CommonResult deleteJob(@RequestParam("id") Long id) throws SchedulerException { @@ -80,8 +80,8 @@ public class JobController { } @PutMapping("/trigger") - @ApiOperation("触发定时任务") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "触发定时任务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('infra:job:trigger')") public CommonResult triggerJob(@RequestParam("id") Long id) throws SchedulerException { jobService.triggerJob(id); @@ -89,8 +89,8 @@ public class JobController { } @GetMapping("/get") - @ApiOperation("获得定时任务") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得定时任务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('infra:job:query')") public CommonResult getJob(@RequestParam("id") Long id) { JobDO job = jobService.getJob(id); @@ -98,8 +98,8 @@ public class JobController { } @GetMapping("/list") - @ApiOperation("获得定时任务列表") - @ApiImplicitParam(name = "ids", value = "编号列表", required = true, dataTypeClass = List.class) + @Operation(summary = "获得定时任务列表") + @Parameter(name = "ids", description = "编号列表", required = true) @PreAuthorize("@ss.hasPermission('infra:job:query')") public CommonResult> getJobList(@RequestParam("ids") Collection ids) { List list = jobService.getJobList(ids); @@ -107,7 +107,7 @@ public class JobController { } @GetMapping("/page") - @ApiOperation("获得定时任务分页") + @Operation(summary = "获得定时任务分页") @PreAuthorize("@ss.hasPermission('infra:job:query')") public CommonResult> getJobPage(@Valid JobPageReqVO pageVO) { PageResult pageResult = jobService.getJobPage(pageVO); @@ -115,7 +115,7 @@ public class JobController { } @GetMapping("/export-excel") - @ApiOperation("导出定时任务 Excel") + @Operation(summary = "导出定时任务 Excel") @PreAuthorize("@ss.hasPermission('infra:job:export')") @OperateLog(type = EXPORT) public void exportJobExcel(@Valid JobExportReqVO exportReqVO, @@ -127,10 +127,10 @@ public class JobController { } @GetMapping("/get_next_times") - @ApiOperation("获得定时任务的下 n 次执行时间") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class), - @ApiImplicitParam(name = "count", value = "数量", example = "5", dataTypeClass = Long.class) + @Operation(summary = "获得定时任务的下 n 次执行时间") + @Parameters({ + @Parameter(name = "id", description = "编号", required = true, example = "1024"), + @Parameter(name = "count", description = "数量", example = "5") }) @PreAuthorize("@ss.hasPermission('infra:job:query')") public CommonResult> getJobNextTimes(@RequestParam("id") Long id, diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobLogController.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobLogController.java index 40de986cf..24f1f44b7 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobLogController.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobLogController.java @@ -11,9 +11,9 @@ import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.JobLogRespVO; import cn.iocoder.yudao.module.infra.convert.job.JobLogConvert; import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobLogDO; import cn.iocoder.yudao.module.infra.service.job.JobLogService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; @@ -31,7 +31,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; -@Api(tags = "管理后台 - 定时任务日志") +@Tag(name = "管理后台 - 定时任务日志") @RestController @RequestMapping("/infra/job-log") @Validated @@ -41,8 +41,8 @@ public class JobLogController { private JobLogService jobLogService; @GetMapping("/get") - @ApiOperation("获得定时任务日志") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得定时任务日志") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('infra:job:query')") public CommonResult getJobLog(@RequestParam("id") Long id) { JobLogDO jobLog = jobLogService.getJobLog(id); @@ -50,8 +50,8 @@ public class JobLogController { } @GetMapping("/list") - @ApiOperation("获得定时任务日志列表") - @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) + @Operation(summary = "获得定时任务日志列表") + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") @PreAuthorize("@ss.hasPermission('infra:job:query')") public CommonResult> getJobLogList(@RequestParam("ids") Collection ids) { List list = jobLogService.getJobLogList(ids); @@ -59,7 +59,7 @@ public class JobLogController { } @GetMapping("/page") - @ApiOperation("获得定时任务日志分页") + @Operation(summary = "获得定时任务日志分页") @PreAuthorize("@ss.hasPermission('infra:job:query')") public CommonResult> getJobLogPage(@Valid JobLogPageReqVO pageVO) { PageResult pageResult = jobLogService.getJobLogPage(pageVO); @@ -67,7 +67,7 @@ public class JobLogController { } @GetMapping("/export-excel") - @ApiOperation("导出定时任务日志 Excel") + @Operation(summary = "导出定时任务日志 Excel") @PreAuthorize("@ss.hasPermission('infra:job:export')") @OperateLog(type = EXPORT) public void exportJobLogExcel(@Valid JobLogExportReqVO exportReqVO, diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobBaseVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobBaseVO.java index db3fcac1d..e5927fe14 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobBaseVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobBaseVO.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.infra.controller.admin.job.vo.job; - -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; @@ -12,26 +11,26 @@ import javax.validation.constraints.NotNull; @Data public class JobBaseVO { - @ApiModelProperty(value = "任务名称", required = true, example = "测试任务") + @Schema(description = "任务名称", required = true, example = "测试任务") @NotNull(message = "任务名称不能为空") private String name; - @ApiModelProperty(value = "处理器的参数", example = "yudao") + @Schema(description = "处理器的参数", example = "yudao") private String handlerParam; - @ApiModelProperty(value = "CRON 表达式", required = true, example = "0/10 * * * * ? *") + @Schema(description = "CRON 表达式", required = true, example = "0/10 * * * * ? *") @NotNull(message = "CRON 表达式不能为空") private String cronExpression; - @ApiModelProperty(value = "重试次数", required = true, example = "3") + @Schema(description = "重试次数", required = true, example = "3") @NotNull(message = "重试次数不能为空") private Integer retryCount; - @ApiModelProperty(value = "重试间隔", required = true, example = "1000") + @Schema(description = "重试间隔", required = true, example = "1000") @NotNull(message = "重试间隔不能为空") private Integer retryInterval; - @ApiModelProperty(value = "监控超时时间", example = "1000") + @Schema(description = "监控超时时间", example = "1000") private Integer monitorTimeout; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobCreateReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobCreateReqVO.java index 0e9f45741..528392b52 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobCreateReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobCreateReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.infra.controller.admin.job.vo.job; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 定时任务创建 Request VO") +@Schema(description = "管理后台 - 定时任务创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class JobCreateReqVO extends JobBaseVO { - @ApiModelProperty(value = "处理器的名字", required = true, example = "sysUserSessionTimeoutJob") + @Schema(description = "处理器的名字", required = true, example = "sysUserSessionTimeoutJob") @NotNull(message = "处理器的名字不能为空") private String handlerName; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobExportReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobExportReqVO.java index ec393a604..49b7e83d3 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobExportReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobExportReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.infra.controller.admin.job.vo.job; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@ApiModel(value = "管理后台 - 定时任务 Excel 导出 Request VO", description = "参数和 JobPageReqVO 是一致的") +@Schema(description = "管理后台 - 定时任务 Excel 导出 Request VO-参数和 JobPageReqVO 是一致的") @Data public class JobExportReqVO { - @ApiModelProperty(value = "任务名称", example = "测试任务", notes = "模糊匹配") + @Schema(description = "任务名称-模糊匹配", example = "测试任务") private String name; - @ApiModelProperty(value = "任务状态", example = "1", notes = "参见 JobStatusEnum 枚举") + @Schema(description = "任务状态-参见 JobStatusEnum 枚举", example = "1") private Integer status; - @ApiModelProperty(value = "处理器的名字", example = "UserSessionTimeoutJob", notes = "模糊匹配") + @Schema(description = "处理器的名字-模糊匹配", example = "UserSessionTimeoutJob") private String handlerName; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobPageReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobPageReqVO.java index 02d3a7e2b..670c30f5c 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobPageReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobPageReqVO.java @@ -1,25 +1,24 @@ package cn.iocoder.yudao.module.infra.controller.admin.job.vo.job; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 定时任务分页 Request VO") +@Schema(description = "管理后台 - 定时任务分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class JobPageReqVO extends PageParam { - @ApiModelProperty(value = "任务名称", example = "测试任务", notes = "模糊匹配") + @Schema(description = "任务名称,模糊匹配", example = "测试任务") private String name; - @ApiModelProperty(value = "任务状态", example = "1", notes = "参见 JobStatusEnum 枚举") + @Schema(description = "任务状态,参见 JobStatusEnum 枚举", example = "1") private Integer status; - @ApiModelProperty(value = "处理器的名字", example = "sysUserSessionTimeoutJob", notes = "模糊匹配") + @Schema(description = "处理器的名字,模糊匹配", example = "sysUserSessionTimeoutJob") private String handlerName; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobRespVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobRespVO.java index 26d7f8d73..be73b1a06 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobRespVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.job.vo.job; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -9,23 +8,23 @@ import lombok.ToString; import javax.validation.constraints.NotNull; import java.time.LocalDateTime; -@ApiModel("管理后台 - 定时任务 Response VO") +@Schema(description = "管理后台 - 定时任务 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class JobRespVO extends JobBaseVO { - @ApiModelProperty(value = "任务编号", required = true, example = "1024") + @Schema(description = "任务编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "任务状态", required = true, example = "1") + @Schema(description = "任务状态", required = true, example = "1") private Integer status; - @ApiModelProperty(value = "处理器的名字", required = true, example = "sysUserSessionTimeoutJob") + @Schema(description = "处理器的名字", required = true, example = "sysUserSessionTimeoutJob") @NotNull(message = "处理器的名字不能为空") private String handlerName; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobUpdateReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobUpdateReqVO.java index f26cd226c..9587888b6 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobUpdateReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobUpdateReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.infra.controller.admin.job.vo.job; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 定时任务更新 Request VO") +@Schema(description = "管理后台 - 定时任务更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class JobUpdateReqVO extends JobBaseVO { - @ApiModelProperty(value = "任务编号", required = true, example = "1024") + @Schema(description = "任务编号", required = true, example = "1024") @NotNull(message = "任务编号不能为空") private Long id; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogBaseVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogBaseVO.java index 591c7a699..de95ca38d 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogBaseVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogBaseVO.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.infra.controller.admin.job.vo.log; - -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -16,38 +15,38 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @Data public class JobLogBaseVO { - @ApiModelProperty(value = "任务编号", required = true, example = "1024") + @Schema(description = "任务编号", required = true, example = "1024") @NotNull(message = "任务编号不能为空") private Long jobId; - @ApiModelProperty(value = "处理器的名字", required = true, example = "sysUserSessionTimeoutJob") + @Schema(description = "处理器的名字", required = true, example = "sysUserSessionTimeoutJob") @NotNull(message = "处理器的名字不能为空") private String handlerName; - @ApiModelProperty(value = "处理器的参数", example = "yudao") + @Schema(description = "处理器的参数", example = "yudao") private String handlerParam; - @ApiModelProperty(value = "第几次执行", required = true, example = "1") + @Schema(description = "第几次执行", required = true, example = "1") @NotNull(message = "第几次执行不能为空") private Integer executeIndex; - @ApiModelProperty(value = "开始执行时间", required = true) + @Schema(description = "开始执行时间", required = true) @NotNull(message = "开始执行时间不能为空") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime beginTime; - @ApiModelProperty(value = "结束执行时间") + @Schema(description = "结束执行时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime endTime; - @ApiModelProperty(value = "执行时长", example = "123") + @Schema(description = "执行时长", example = "123") private Integer duration; - @ApiModelProperty(value = "任务状态", required = true, example = "1", notes = "参见 JobLogStatusEnum 枚举") + @Schema(description = "任务状态,参见 JobLogStatusEnum 枚举", required = true, example = "1") @NotNull(message = "任务状态不能为空") private Integer status; - @ApiModelProperty(value = "结果数据", example = "执行成功") + @Schema(description = "结果数据", example = "执行成功") private String result; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogExportReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogExportReqVO.java index 62824739f..6f5c7f69f 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogExportReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogExportReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.job.vo.log; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -9,25 +8,25 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel(value = "管理后台 - 定时任务 Excel 导出 Request VO", description = "参数和 JobLogPageReqVO 是一致的") +@Schema(description = "管理后台 - 定时任务 Excel 导出 Request VO,参数和 JobLogPageReqVO 是一致的") @Data public class JobLogExportReqVO { - @ApiModelProperty(value = "任务编号", example = "10") + @Schema(description = "任务编号", example = "10") private Long jobId; - @ApiModelProperty(value = "处理器的名字", notes = "模糊匹配") + @Schema(description = "处理器的名字,模糊匹配") private String handlerName; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "开始执行时间") + @Schema(description = "开始执行时间") private LocalDateTime beginTime; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "结束执行时间") + @Schema(description = "结束执行时间") private LocalDateTime endTime; - @ApiModelProperty(value = "任务状态", notes = "参见 JobLogStatusEnum 枚举") + @Schema(description = "任务状态,参见 JobLogStatusEnum 枚举") private Integer status; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogPageReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogPageReqVO.java index 6a71c4d3e..84bf9ca34 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogPageReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogPageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.infra.controller.admin.job.vo.log; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,27 +11,27 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 定时任务日志分页 Request VO") +@Schema(description = "管理后台 - 定时任务日志分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class JobLogPageReqVO extends PageParam { - @ApiModelProperty(value = "任务编号", example = "10") + @Schema(description = "任务编号", example = "10") private Long jobId; - @ApiModelProperty(value = "处理器的名字", notes = "模糊匹配") + @Schema(description = "处理器的名字,模糊匹配") private String handlerName; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "开始执行时间") + @Schema(description = "开始执行时间") private LocalDateTime beginTime; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "结束执行时间") + @Schema(description = "结束执行时间") private LocalDateTime endTime; - @ApiModelProperty(value = "任务状态", notes = "参见 JobLogStatusEnum 枚举") + @Schema(description = "任务状态,参见 JobLogStatusEnum 枚举") private Integer status; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogRespVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogRespVO.java index 611c87b58..79cce519b 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogRespVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogRespVO.java @@ -1,23 +1,22 @@ package cn.iocoder.yudao.module.infra.controller.admin.job.vo.log; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 定时任务日志 Response VO") +@Schema(description = "管理后台 - 定时任务日志 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class JobLogRespVO extends JobLogBaseVO { - @ApiModelProperty(value = "日志编号", required = true, example = "1024") + @Schema(description = "日志编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiAccessLogController.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiAccessLogController.java index 5046ea5af..641e1c23b 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiAccessLogController.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiAccessLogController.java @@ -11,8 +11,8 @@ import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.Api import cn.iocoder.yudao.module.infra.convert.logger.ApiAccessLogConvert; import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiAccessLogDO; import cn.iocoder.yudao.module.infra.service.logger.ApiAccessLogService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; @@ -28,7 +28,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; -@Api(tags = "管理后台 - API 访问日志") +@Tag(name = "管理后台 - API 访问日志") @RestController @RequestMapping("/infra/api-access-log") @Validated @@ -38,7 +38,7 @@ public class ApiAccessLogController { private ApiAccessLogService apiAccessLogService; @GetMapping("/page") - @ApiOperation("获得API 访问日志分页") + @Operation(summary = "获得API 访问日志分页") @PreAuthorize("@ss.hasPermission('infra:api-access-log:query')") public CommonResult> getApiAccessLogPage(@Valid ApiAccessLogPageReqVO pageVO) { PageResult pageResult = apiAccessLogService.getApiAccessLogPage(pageVO); @@ -46,7 +46,7 @@ public class ApiAccessLogController { } @GetMapping("/export-excel") - @ApiOperation("导出API 访问日志 Excel") + @Operation(summary = "导出API 访问日志 Excel") @PreAuthorize("@ss.hasPermission('infra:api-access-log:export')") @OperateLog(type = EXPORT) public void exportApiAccessLogExcel(@Valid ApiAccessLogExportReqVO exportReqVO, diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiErrorLogController.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiErrorLogController.java index d592836b2..191bd94d0 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiErrorLogController.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiErrorLogController.java @@ -11,10 +11,10 @@ import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiE import cn.iocoder.yudao.module.infra.convert.logger.ApiErrorLogConvert; import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiErrorLogDO; import cn.iocoder.yudao.module.infra.service.logger.ApiErrorLogService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -29,7 +29,7 @@ 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.security.core.util.SecurityFrameworkUtils.getLoginUserId; -@Api(tags = "管理后台 - API 错误日志") +@Tag(name = "管理后台 - API 错误日志") @RestController @RequestMapping("/infra/api-error-log") @Validated @@ -39,10 +39,10 @@ public class ApiErrorLogController { private ApiErrorLogService apiErrorLogService; @PutMapping("/update-status") - @ApiOperation("更新 API 错误日志的状态") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class), - @ApiImplicitParam(name = "processStatus", value = "处理状态", required = true, example = "1", dataTypeClass = Integer.class) + @Operation(summary = "更新 API 错误日志的状态") + @Parameters({ + @Parameter(name = "id", description = "编号", required = true, example = "1024"), + @Parameter(name = "processStatus", description = "处理状态", required = true, example = "1") }) @PreAuthorize("@ss.hasPermission('infra:api-error-log:update-status')") public CommonResult updateApiErrorLogProcess(@RequestParam("id") Long id, @@ -52,7 +52,7 @@ public class ApiErrorLogController { } @GetMapping("/page") - @ApiOperation("获得 API 错误日志分页") + @Operation(summary = "获得 API 错误日志分页") @PreAuthorize("@ss.hasPermission('infra:api-error-log:query')") public CommonResult> getApiErrorLogPage(@Valid ApiErrorLogPageReqVO pageVO) { PageResult pageResult = apiErrorLogService.getApiErrorLogPage(pageVO); @@ -60,7 +60,7 @@ public class ApiErrorLogController { } @GetMapping("/export-excel") - @ApiOperation("导出 API 错误日志 Excel") + @Operation(summary = "导出 API 错误日志 Excel") @PreAuthorize("@ss.hasPermission('infra:api-error-log:export')") @OperateLog(type = EXPORT) public void exportApiErrorLogExcel(@Valid ApiErrorLogExportReqVO exportReqVO, diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogBaseVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogBaseVO.java index 077f26133..ec2a8e377 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogBaseVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogBaseVO.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog; - -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -16,60 +15,60 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @Data public class ApiAccessLogBaseVO { - @ApiModelProperty(value = "链路追踪编号", required = true, example = "66600cb6-7852-11eb-9439-0242ac130002") + @Schema(description = "链路追踪编号", required = true, example = "66600cb6-7852-11eb-9439-0242ac130002") @NotNull(message = "链路追踪编号不能为空") private String traceId; - @ApiModelProperty(value = "用户编号", required = true, example = "666") + @Schema(description = "用户编号", required = true, example = "666") @NotNull(message = "用户编号不能为空") private Long userId; - @ApiModelProperty(value = "用户类型", required = true, example = "2", notes = "参见 UserTypeEnum 枚举") + @Schema(description = "用户类型,参见 UserTypeEnum 枚举", required = true, example = "2") @NotNull(message = "用户类型不能为空") private Integer userType; - @ApiModelProperty(value = "应用名", required = true, example = "dashboard") + @Schema(description = "应用名", required = true, example = "dashboard") @NotNull(message = "应用名不能为空") private String applicationName; - @ApiModelProperty(value = "请求方法名", required = true, example = "GET") + @Schema(description = "请求方法名", required = true, example = "GET") @NotNull(message = "请求方法名不能为空") private String requestMethod; - @ApiModelProperty(value = "请求地址", required = true, example = "/xxx/yyy") + @Schema(description = "请求地址", required = true, example = "/xxx/yyy") @NotNull(message = "请求地址不能为空") private String requestUrl; - @ApiModelProperty(value = "请求参数") + @Schema(description = "请求参数") private String requestParams; - @ApiModelProperty(value = "用户 IP", required = true, example = "127.0.0.1") + @Schema(description = "用户 IP", required = true, example = "127.0.0.1") @NotNull(message = "用户 IP不能为空") private String userIp; - @ApiModelProperty(value = "浏览器 UA", required = true, example = "Mozilla/5.0") + @Schema(description = "浏览器 UA", required = true, example = "Mozilla/5.0") @NotNull(message = "浏览器 UA不能为空") private String userAgent; - @ApiModelProperty(value = "开始请求时间", required = true) + @Schema(description = "开始请求时间", required = true) @NotNull(message = "开始请求时间不能为空") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime beginTime; - @ApiModelProperty(value = "结束请求时间", required = true) + @Schema(description = "结束请求时间", required = true) @NotNull(message = "结束请求时间不能为空") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime endTime; - @ApiModelProperty(value = "执行时长", required = true, example = "100") + @Schema(description = "执行时长", required = true, example = "100") @NotNull(message = "执行时长不能为空") private Integer duration; - @ApiModelProperty(value = "结果码", required = true, example = "0") + @Schema(description = "结果码", required = true, example = "0") @NotNull(message = "结果码不能为空") private Integer resultCode; - @ApiModelProperty(value = "结果提示", example = "芋道源码,牛逼!") + @Schema(description = "结果提示", example = "芋道源码,牛逼!") private String resultMsg; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogExportReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogExportReqVO.java index 228ac3c86..8894b82f8 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogExportReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogExportReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -9,30 +8,30 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel(value = "管理后台 - API 访问日志 Excel 导出 Request VO", description = "参数和 ApiAccessLogPageReqVO 是一致的") +@Schema(description = "管理后台 - API 访问日志 Excel 导出 Request VO,参数和 ApiAccessLogPageReqVO 是一致的") @Data public class ApiAccessLogExportReqVO { - @ApiModelProperty(value = "用户编号", example = "666") + @Schema(description = "用户编号", example = "666") private Long userId; - @ApiModelProperty(value = "用户类型", example = "2") + @Schema(description = "用户类型", example = "2") private Integer userType; - @ApiModelProperty(value = "应用名", example = "dashboard") + @Schema(description = "应用名", example = "dashboard") private String applicationName; - @ApiModelProperty(value = "请求地址", example = "/xxx/yyy", notes = "模糊匹配") + @Schema(description = "请求地址,模糊匹配", example = "/xxx/yyy") private String requestUrl; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "开始请求时间") + @Schema(description = "开始请求时间") private LocalDateTime[] beginTime; - @ApiModelProperty(value = "执行时长", example = "100", notes = "大于等于,单位:毫秒") + @Schema(description = "执行时长,大于等于,单位:毫秒", example = "100") private Integer duration; - @ApiModelProperty(value = "结果码", example = "0") + @Schema(description = "结果码", example = "0") private Integer resultCode; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogPageReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogPageReqVO.java index 62b4eeea8..daf2c616e 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogPageReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogPageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,32 +11,32 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - API 访问日志分页 Request VO") +@Schema(description = "管理后台 - API 访问日志分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ApiAccessLogPageReqVO extends PageParam { - @ApiModelProperty(value = "用户编号", example = "666") + @Schema(description = "用户编号", example = "666") private Long userId; - @ApiModelProperty(value = "用户类型", example = "2") + @Schema(description = "用户类型", example = "2") private Integer userType; - @ApiModelProperty(value = "应用名", example = "dashboard") + @Schema(description = "应用名", example = "dashboard") private String applicationName; - @ApiModelProperty(value = "请求地址", example = "/xxx/yyy", notes = "模糊匹配") + @Schema(description = "请求地址,模糊匹配", example = "/xxx/yyy") private String requestUrl; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "开始请求时间") + @Schema(description = "开始请求时间") private LocalDateTime[] beginTime; - @ApiModelProperty(value = "执行时长", example = "100", notes = "大于等于,单位:毫秒") + @Schema(description = "执行时长,大于等于,单位:毫秒", example = "100") private Integer duration; - @ApiModelProperty(value = "结果码", example = "0") + @Schema(description = "结果码", example = "0") private Integer resultCode; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogRespVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogRespVO.java index 2a6125d38..52bbb3184 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogRespVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogRespVO.java @@ -1,23 +1,22 @@ package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - API 访问日志 Response VO") +@Schema(description = "管理后台 - API 访问日志 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ApiAccessLogRespVO extends ApiAccessLogBaseVO { - @ApiModelProperty(value = "日志主键", required = true, example = "1024") + @Schema(description = "日志主键", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogBaseVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogBaseVO.java index ad0b44368..6045e903e 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogBaseVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogBaseVO.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog; - -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -16,80 +15,80 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @Data public class ApiErrorLogBaseVO { - @ApiModelProperty(value = "链路追踪编号", required = true, example = "66600cb6-7852-11eb-9439-0242ac130002") + @Schema(description = "链路追踪编号", required = true, example = "66600cb6-7852-11eb-9439-0242ac130002") @NotNull(message = "链路追踪编号不能为空") private String traceId; - @ApiModelProperty(value = "用户编号", required = true, example = "666") + @Schema(description = "用户编号", required = true, example = "666") @NotNull(message = "用户编号不能为空") private Integer userId; - @ApiModelProperty(value = "用户类型", required = true, example = "1") + @Schema(description = "用户类型", required = true, example = "1") @NotNull(message = "用户类型不能为空") private Integer userType; - @ApiModelProperty(value = "应用名", required = true, example = "dashboard") + @Schema(description = "应用名", required = true, example = "dashboard") @NotNull(message = "应用名不能为空") private String applicationName; - @ApiModelProperty(value = "请求方法名", required = true, example = "GET") + @Schema(description = "请求方法名", required = true, example = "GET") @NotNull(message = "请求方法名不能为空") private String requestMethod; - @ApiModelProperty(value = "请求地址", required = true, example = "/xx/yy") + @Schema(description = "请求地址", required = true, example = "/xx/yy") @NotNull(message = "请求地址不能为空") private String requestUrl; - @ApiModelProperty(value = "请求参数", required = true) + @Schema(description = "请求参数", required = true) @NotNull(message = "请求参数不能为空") private String requestParams; - @ApiModelProperty(value = "用户 IP", required = true, example = "127.0.0.1") + @Schema(description = "用户 IP", required = true, example = "127.0.0.1") @NotNull(message = "用户 IP不能为空") private String userIp; - @ApiModelProperty(value = "浏览器 UA", required = true, example = "Mozilla/5.0") + @Schema(description = "浏览器 UA", required = true, example = "Mozilla/5.0") @NotNull(message = "浏览器 UA不能为空") private String userAgent; - @ApiModelProperty(value = "异常发生时间", required = true) + @Schema(description = "异常发生时间", required = true) @NotNull(message = "异常发生时间不能为空") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime exceptionTime; - @ApiModelProperty(value = "异常名", required = true) + @Schema(description = "异常名", required = true) @NotNull(message = "异常名不能为空") private String exceptionName; - @ApiModelProperty(value = "异常导致的消息", required = true) + @Schema(description = "异常导致的消息", required = true) @NotNull(message = "异常导致的消息不能为空") private String exceptionMessage; - @ApiModelProperty(value = "异常导致的根消息", required = true) + @Schema(description = "异常导致的根消息", required = true) @NotNull(message = "异常导致的根消息不能为空") private String exceptionRootCauseMessage; - @ApiModelProperty(value = "异常的栈轨迹", required = true) + @Schema(description = "异常的栈轨迹", required = true) @NotNull(message = "异常的栈轨迹不能为空") private String exceptionStackTrace; - @ApiModelProperty(value = "异常发生的类全名", required = true) + @Schema(description = "异常发生的类全名", required = true) @NotNull(message = "异常发生的类全名不能为空") private String exceptionClassName; - @ApiModelProperty(value = "异常发生的类文件", required = true) + @Schema(description = "异常发生的类文件", required = true) @NotNull(message = "异常发生的类文件不能为空") private String exceptionFileName; - @ApiModelProperty(value = "异常发生的方法名", required = true) + @Schema(description = "异常发生的方法名", required = true) @NotNull(message = "异常发生的方法名不能为空") private String exceptionMethodName; - @ApiModelProperty(value = "异常发生的方法所在行", required = true) + @Schema(description = "异常发生的方法所在行", required = true) @NotNull(message = "异常发生的方法所在行不能为空") private Integer exceptionLineNumber; - @ApiModelProperty(value = "处理状态", required = true, example = "0") + @Schema(description = "处理状态", required = true, example = "0") @NotNull(message = "处理状态不能为空") private Integer processStatus; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogExportReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogExportReqVO.java index e2c241138..dbc386729 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogExportReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogExportReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -9,27 +8,27 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel(value = "管理后台 - API 错误日志 Excel 导出 Request VO", description = "参数和 ApiErrorLogPageReqVO 是一致的") +@Schema(description = "管理后台 - API 错误日志 Excel 导出 Request VO,参数和 ApiErrorLogPageReqVO 是一致的") @Data public class ApiErrorLogExportReqVO { - @ApiModelProperty(value = "用户编号", example = "666") + @Schema(description = "用户编号", example = "666") private Long userId; - @ApiModelProperty(value = "用户类型", example = "1") + @Schema(description = "用户类型", example = "1") private Integer userType; - @ApiModelProperty(value = "应用名", example = "dashboard") + @Schema(description = "应用名", example = "dashboard") private String applicationName; - @ApiModelProperty(value = "请求地址", example = "/xx/yy") + @Schema(description = "请求地址", example = "/xx/yy") private String requestUrl; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "异常发生时间") + @Schema(description = "异常发生时间") private LocalDateTime[] exceptionTime; - @ApiModelProperty(value = "处理状态", example = "0") + @Schema(description = "处理状态", example = "0") private Integer processStatus; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogPageReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogPageReqVO.java index 56496325d..2ceb0d033 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogPageReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogPageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,29 +11,29 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - API 错误日志分页 Request VO") +@Schema(description = "管理后台 - API 错误日志分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ApiErrorLogPageReqVO extends PageParam { - @ApiModelProperty(value = "用户编号", example = "666") + @Schema(description = "用户编号", example = "666") private Long userId; - @ApiModelProperty(value = "用户类型", example = "1") + @Schema(description = "用户类型", example = "1") private Integer userType; - @ApiModelProperty(value = "应用名", example = "dashboard") + @Schema(description = "应用名", example = "dashboard") private String applicationName; - @ApiModelProperty(value = "请求地址", example = "/xx/yy") + @Schema(description = "请求地址", example = "/xx/yy") private String requestUrl; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "异常发生时间") + @Schema(description = "异常发生时间") private LocalDateTime[] exceptionTime; - @ApiModelProperty(value = "处理状态", example = "0") + @Schema(description = "处理状态", example = "0") private Integer processStatus; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogRespVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogRespVO.java index c108b548c..c4ce8faf6 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogRespVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogRespVO.java @@ -1,29 +1,28 @@ package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - API 错误日志 Response VO") +@Schema(description = "管理后台 - API 错误日志 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ApiErrorLogRespVO extends ApiErrorLogBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") private Integer id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; - @ApiModelProperty(value = "处理时间", required = true) + @Schema(description = "处理时间", required = true) private LocalDateTime processTime; - @ApiModelProperty(value = "处理用户编号", example = "233") + @Schema(description = "处理用户编号", example = "233") private Integer processUserId; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/RedisController.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/RedisController.java index 3e66b3348..c82b21cda 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/RedisController.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/RedisController.java @@ -9,9 +9,9 @@ import cn.iocoder.yudao.module.infra.controller.admin.redis.vo.RedisKeyDefineRes import cn.iocoder.yudao.module.infra.controller.admin.redis.vo.RedisKeyValueRespVO; import cn.iocoder.yudao.module.infra.controller.admin.redis.vo.RedisMonitorRespVO; import cn.iocoder.yudao.module.infra.convert.redis.RedisConvert; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.data.redis.connection.RedisServerCommands; import org.springframework.data.redis.core.Cursor; import org.springframework.data.redis.core.RedisCallback; @@ -25,7 +25,7 @@ import java.util.*; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - Redis 监控") +@Tag(name = "管理后台 - Redis 监控") @RestController @RequestMapping("/infra/redis") public class RedisController { @@ -34,7 +34,7 @@ public class RedisController { private StringRedisTemplate stringRedisTemplate; @GetMapping("/get-monitor-info") - @ApiOperation("获得 Redis 监控信息") + @Operation(summary = "获得 Redis 监控信息") @PreAuthorize("@ss.hasPermission('infra:redis:get-monitor-info')") public CommonResult getRedisMonitorInfo() { // 获得 Redis 统计信息 @@ -48,7 +48,7 @@ public class RedisController { } @GetMapping("/get-key-define-list") - @ApiOperation("获得 Redis Key 模板列表") + @Operation(summary = "获得 Redis Key 模板列表") @PreAuthorize("@ss.hasPermission('infra:redis:get-key-list')") public CommonResult> getKeyDefineList() { List keyDefines = RedisKeyRegistry.list(); @@ -56,8 +56,8 @@ public class RedisController { } @GetMapping("/get-key-list") - @ApiOperation("获得 Redis keys 键名列表") - @ApiImplicitParam(name = "keyTemplate", value = "Redis Key 定义", example = "true", dataTypeClass = String.class) + @Operation(summary = "获得 Redis keys 键名列表") + @Parameter(name = "keyTemplate", description = "Redis Key 定义", example = "true") @PreAuthorize("@ss.hasPermission('infra:redis:get-key-list')") public CommonResult> getKeyDefineList(@RequestParam("keyTemplate") String keyTemplate) { return success(getKeyDefineList0(keyTemplate)); @@ -80,8 +80,8 @@ public class RedisController { } @GetMapping("/get-key-value") - @ApiOperation("获得 Redis key 内容") - @ApiImplicitParam(name = "key", value = "Redis Key", example = "oauth2_access_token:233", dataTypeClass = String.class) + @Operation(summary = "获得 Redis key 内容") + @Parameter(name = "key", description = "Redis Key", example = "oauth2_access_token:233") @PreAuthorize("@ss.hasPermission('infra:redis:get-key-list')") public CommonResult getKeyValue(@RequestParam("key") String key) { String value = stringRedisTemplate.opsForValue().get(key); @@ -89,8 +89,8 @@ public class RedisController { } @DeleteMapping("/delete-key") - @ApiOperation("删除 Redis Key") - @ApiImplicitParam(name = "key", value = "Redis Key", example = "oauth2_access_token:233", dataTypeClass = String.class) + @Operation(summary = "删除 Redis Key") + @Parameter(name = "key", description = "Redis Key", example = "oauth2_access_token:233") @PreAuthorize("@ss.hasPermission('infra:redis:get-key-list')") public CommonResult deleteKey(@RequestParam("key") String key) { stringRedisTemplate.delete(key); @@ -98,8 +98,8 @@ public class RedisController { } @DeleteMapping("/delete-keys") - @ApiOperation("删除 Redis Key 根据模板") - @ApiImplicitParam(name = "keyTemplate", value = "Redis Key 定义", example = "true", dataTypeClass = String.class) + @Operation(summary = "删除 Redis Key 根据模板") + @Parameter(name = "keyTemplate", description = "Redis Key 定义", example = "true") @PreAuthorize("@ss.hasPermission('infra:redis:get-key-list')") public CommonResult deleteKeys(@RequestParam("keyTemplate") String keyTemplate) { Set keys = getKeyDefineList0(keyTemplate); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/vo/RedisKeyDefineRespVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/vo/RedisKeyDefineRespVO.java index 4c1b5acd8..f30ebb623 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/vo/RedisKeyDefineRespVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/vo/RedisKeyDefineRespVO.java @@ -1,36 +1,35 @@ package cn.iocoder.yudao.module.infra.controller.admin.redis.vo; import cn.iocoder.yudao.framework.redis.core.RedisKeyDefine; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import java.time.Duration; -@ApiModel("管理后台 - Redis Key 信息 Response VO") +@Schema(description = "管理后台 - Redis Key 信息 Response VO") @Data @Builder @AllArgsConstructor public class RedisKeyDefineRespVO { - @ApiModelProperty(value = "Key 模板", required = true, example = "login_user:%s") + @Schema(description = "Key 模板", required = true, example = "login_user:%s") private String keyTemplate; - @ApiModelProperty(value = "Key 类型的枚举", required = true, example = "String") + @Schema(description = "Key 类型的枚举", required = true, example = "String") private RedisKeyDefine.KeyTypeEnum keyType; - @ApiModelProperty(value = "Value 类型", required = true, example = "java.lang.String") + @Schema(description = "Value 类型", required = true, example = "java.lang.String") private Class valueType; - @ApiModelProperty(value = "超时类型", required = true, example = "1") + @Schema(description = "超时类型", required = true, example = "1") private RedisKeyDefine.TimeoutTypeEnum timeoutType; - @ApiModelProperty(value = "过期时间,单位:毫秒", required = true, example = "1024") + @Schema(description = "过期时间,单位:毫秒", required = true, example = "1024") private Duration timeout; - @ApiModelProperty(value = "备注", required = true, example = "啦啦啦啦~") + @Schema(description = "备注", required = true, example = "啦啦啦啦~") private String memo; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/vo/RedisKeyValueRespVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/vo/RedisKeyValueRespVO.java index 0f16f0640..9dc893da0 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/vo/RedisKeyValueRespVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/vo/RedisKeyValueRespVO.java @@ -1,19 +1,18 @@ package cn.iocoder.yudao.module.infra.controller.admin.redis.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; -@ApiModel("管理后台 - 单个 Redis Key Value Response VO") +@Schema(description = "管理后台 - 单个 Redis Key Value Response VO") @Data @AllArgsConstructor public class RedisKeyValueRespVO { - @ApiModelProperty(value = "c5f6990767804a928f4bb96ca249febf", required = true, example = "String") + @Schema(description = "c5f6990767804a928f4bb96ca249febf", required = true, example = "String") private String key; - @ApiModelProperty(required = true, example = "String") + @Schema(required = true, example = "String") private String value; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/vo/RedisMonitorRespVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/vo/RedisMonitorRespVO.java index 73b0cfc9f..15d054282 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/vo/RedisMonitorRespVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/vo/RedisMonitorRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.redis.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -9,34 +8,34 @@ import lombok.Data; import java.util.List; import java.util.Properties; -@ApiModel("管理后台 - Redis 监控信息 Response VO") +@Schema(description = "管理后台 - Redis 监控信息 Response VO") @Data @Builder @AllArgsConstructor public class RedisMonitorRespVO { - @ApiModelProperty(value = "Redis info 指令结果", required = true, notes = "具体字段,查看 Redis 文档") + @Schema(description = "Redis info 指令结果,具体字段,查看 Redis 文档", required = true) private Properties info; - @ApiModelProperty(value = "Redis key 数量", required = true, example = "1024") + @Schema(description = "Redis key 数量", required = true, example = "1024") private Long dbSize; - @ApiModelProperty(value = "CommandStat 数组", required = true) + @Schema(description = "CommandStat 数组", required = true) private List commandStats; - @ApiModel("Redis 命令统计结果") + @Schema(description = "Redis 命令统计结果") @Data @Builder @AllArgsConstructor public static class CommandStat { - @ApiModelProperty(value = "Redis 命令", required = true, example = "get") + @Schema(description = "Redis 命令", required = true, example = "get") private String command; - @ApiModelProperty(value = "调用次数", required = true, example = "1024") + @Schema(description = "调用次数", required = true, example = "1024") private Long calls; - @ApiModelProperty(value = "消耗 CPU 秒数", required = true, example = "666") + @Schema(description = "消耗 CPU 秒数", required = true, example = "666") private Long usec; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/TestDemoController.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/TestDemoController.java index a534b7daf..b64b49178 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/TestDemoController.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/TestDemoController.java @@ -8,9 +8,9 @@ import cn.iocoder.yudao.module.infra.controller.admin.test.vo.*; import cn.iocoder.yudao.module.infra.convert.test.TestDemoConvert; import cn.iocoder.yudao.module.infra.dal.dataobject.test.TestDemoDO; import cn.iocoder.yudao.module.infra.service.test.TestDemoService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -25,7 +25,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; -@Api(tags = "管理后台 - 字典类型") +@Tag(name = "管理后台 - 字典类型") @RestController @RequestMapping("/infra/test-demo") @Validated @@ -35,14 +35,14 @@ public class TestDemoController { private TestDemoService testDemoService; @PostMapping("/create") - @ApiOperation("创建字典类型") + @Operation(summary = "创建字典类型") @PreAuthorize("@ss.hasPermission('infra:test-demo:create')") public CommonResult createTestDemo(@Valid @RequestBody TestDemoCreateReqVO createReqVO) { return success(testDemoService.createTestDemo(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新字典类型") + @Operation(summary = "更新字典类型") @PreAuthorize("@ss.hasPermission('infra:test-demo:update')") public CommonResult updateTestDemo(@Valid @RequestBody TestDemoUpdateReqVO updateReqVO) { testDemoService.updateTestDemo(updateReqVO); @@ -50,8 +50,8 @@ public class TestDemoController { } @DeleteMapping("/delete") - @ApiOperation("删除字典类型") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除字典类型") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('infra:test-demo:delete')") public CommonResult deleteTestDemo(@RequestParam("id") Long id) { testDemoService.deleteTestDemo(id); @@ -59,8 +59,8 @@ public class TestDemoController { } @GetMapping("/get") - @ApiOperation("获得字典类型") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得字典类型") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('infra:test-demo:query')") public CommonResult getTestDemo(@RequestParam("id") Long id) { TestDemoDO testDemo = testDemoService.getTestDemo(id); @@ -68,8 +68,8 @@ public class TestDemoController { } @GetMapping("/list") - @ApiOperation("获得字典类型列表") - @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) + @Operation(summary = "获得字典类型列表") + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") @PreAuthorize("@ss.hasPermission('infra:test-demo:query')") public CommonResult> getTestDemoList(@RequestParam("ids") Collection ids) { List list = testDemoService.getTestDemoList(ids); @@ -77,14 +77,14 @@ public class TestDemoController { } @GetMapping("/page") - @ApiOperation("获得字典类型分页") + @Operation(summary = "获得字典类型分页") @PreAuthorize("@ss.hasPermission('infra:test-demo:query')") public CommonResult> getTestDemoPage(@Valid TestDemoPageReqVO pageVO) { PageResult pageResult = testDemoService.getTestDemoPage(pageVO); return success(TestDemoConvert.INSTANCE.convertPage(pageResult)); } @GetMapping("/export-excel") - @ApiOperation("导出字典类型 Excel") + @Operation(summary = "导出字典类型 Excel") @PreAuthorize("@ss.hasPermission('infra:test-demo:export')") @OperateLog(type = EXPORT) public void exportTestDemoExcel(@Valid TestDemoExportReqVO exportReqVO, HttpServletResponse response) throws IOException { diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoBaseVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoBaseVO.java index 1f657938e..a0216683d 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoBaseVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoBaseVO.java @@ -1,8 +1,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.test.vo; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import java.util.*; -import io.swagger.annotations.*; import javax.validation.constraints.*; /** @@ -12,23 +10,23 @@ import javax.validation.constraints.*; @Data public class TestDemoBaseVO { - @ApiModelProperty(value = "名字", required = true) + @Schema(description = "名字", required = true) @NotNull(message = "名字不能为空") private String name; - @ApiModelProperty(value = "状态", required = true) + @Schema(description = "状态", required = true) @NotNull(message = "状态不能为空") private Integer status; - @ApiModelProperty(value = "类型", required = true) + @Schema(description = "类型", required = true) @NotNull(message = "类型不能为空") private Integer type; - @ApiModelProperty(value = "分类", required = true) + @Schema(description = "分类", required = true) @NotNull(message = "分类不能为空") private Integer category; - @ApiModelProperty(value = "备注") + @Schema(description = "备注") private String remark; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoCreateReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoCreateReqVO.java index d932daac6..3b46fd1cd 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoCreateReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoCreateReqVO.java @@ -1,9 +1,8 @@ package cn.iocoder.yudao.module.infra.controller.admin.test.vo; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; -@ApiModel("管理后台 - 字典类型创建 Request VO") +@Schema(description = "管理后台 - 字典类型创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoExportReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoExportReqVO.java index 8c386d4c1..8e10484e3 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoExportReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoExportReqVO.java @@ -1,34 +1,33 @@ package cn.iocoder.yudao.module.infra.controller.admin.test.vo; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDateTime; -import io.swagger.annotations.*; import org.springframework.format.annotation.DateTimeFormat; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel(value = "管理后台 - 字典类型 Excel 导出 Request VO", description = "参数和 TestDemoPageReqVO 是一致的") +@Schema(description = "管理后台 - 字典类型 Excel 导出 Request VO,参数和 TestDemoPageReqVO 是一致的") @Data public class TestDemoExportReqVO { - @ApiModelProperty(value = "名字") + @Schema(description = "名字") private String name; - @ApiModelProperty(value = "状态") + @Schema(description = "状态") private Integer status; - @ApiModelProperty(value = "类型") + @Schema(description = "类型") private Integer type; - @ApiModelProperty(value = "分类") + @Schema(description = "分类") private Integer category; - @ApiModelProperty(value = "备注") + @Schema(description = "备注") private String remark; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoPageReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoPageReqVO.java index 56b14c3d4..abb5843db 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoPageReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoPageReqVO.java @@ -1,37 +1,36 @@ package cn.iocoder.yudao.module.infra.controller.admin.test.vo; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDateTime; -import io.swagger.annotations.*; import cn.iocoder.yudao.framework.common.pojo.PageParam; import org.springframework.format.annotation.DateTimeFormat; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 字典类型分页 Request VO") +@Schema(description = "管理后台 - 字典类型分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class TestDemoPageReqVO extends PageParam { - @ApiModelProperty(value = "名字") + @Schema(description = "名字") private String name; - @ApiModelProperty(value = "状态") + @Schema(description = "状态") private Integer status; - @ApiModelProperty(value = "类型") + @Schema(description = "类型") private Integer type; - @ApiModelProperty(value = "分类") + @Schema(description = "分类") private Integer category; - @ApiModelProperty(value = "备注") + @Schema(description = "备注") private String remark; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoRespVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoRespVO.java index 4b38ee401..312a5eb98 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoRespVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoRespVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.infra.controller.admin.test.vo; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDateTime; -import io.swagger.annotations.*; -@ApiModel("管理后台 - 字典类型 Response VO") +@Schema(description = "管理后台 - 字典类型 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class TestDemoRespVO extends TestDemoBaseVO { - @ApiModelProperty(value = "编号", required = true) + @Schema(description = "编号", required = true) private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoUpdateReqVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoUpdateReqVO.java index 59d56b4da..6df36addb 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoUpdateReqVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/test/vo/TestDemoUpdateReqVO.java @@ -1,16 +1,15 @@ package cn.iocoder.yudao.module.infra.controller.admin.test.vo; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; import javax.validation.constraints.*; -@ApiModel("管理后台 - 字典类型更新 Request VO") +@Schema(description = "管理后台 - 字典类型更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class TestDemoUpdateReqVO extends TestDemoBaseVO { - @ApiModelProperty(value = "编号", required = true) + @Schema(description = "编号", required = true) @NotNull(message = "编号不能为空") private Long id; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/codegen/CodegenColumnDO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/codegen/CodegenColumnDO.java index f1990f3fc..368162214 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/codegen/CodegenColumnDO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/codegen/CodegenColumnDO.java @@ -39,27 +39,38 @@ public class CodegenColumnDO extends BaseDO { /** * 字段名 + * + * 关联 {@link TableField#getName()} */ private String columnName; /** * 数据库字段类型 + * * 关联 {@link TableField.MetaInfo#getJdbcType()} */ private String dataType; /** * 字段描述 + * + * 关联 {@link TableField#getComment()} */ private String columnComment; /** * 是否允许为空 + * + * 关联 {@link TableField.MetaInfo#isNullable()} */ private Boolean nullable; /** * 是否主键 + * + * 关联 {@link TableField#isKeyFlag()} */ private Boolean primaryKey; /** * 是否自增 + * + * 关联 {@link TableField#isKeyIdentityFlag()} */ private Boolean autoIncrement; /** @@ -71,12 +82,16 @@ public class CodegenColumnDO extends BaseDO { /** * Java 属性类型 - *

+ * * 例如说 String、Boolean 等等 + * + * 关联 {@link TableField#getColumnType()} */ private String javaType; /** * Java 属性名 + * + * 关联 {@link TableField#getPropertyName()} */ private String javaField; /** diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/codegen/CodegenTableDO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/codegen/CodegenTableDO.java index b821d210c..4f4a644a7 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/codegen/CodegenTableDO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/codegen/CodegenTableDO.java @@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.infra.enums.codegen.CodegenSceneEnum; import cn.iocoder.yudao.module.infra.enums.codegen.CodegenTemplateTypeEnum; import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.generator.config.po.TableInfo; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -44,10 +45,14 @@ public class CodegenTableDO extends BaseDO { /** * 表名称 + * + * 关联 {@link TableInfo#getName()} */ private String tableName; /** * 表描述 + * + * 关联 {@link TableInfo#getComment()} */ private String tableComment; /** diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/job/JobLogMapper.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/job/JobLogMapper.java index fe196df35..c467498bf 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/job/JobLogMapper.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/job/JobLogMapper.java @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.infra.dal.mysql.job; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; -import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.JobLogExportReqVO; import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.JobLogPageReqVO; import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobLogDO; @@ -19,24 +19,24 @@ import java.util.List; public interface JobLogMapper extends BaseMapperX { default PageResult selectPage(JobLogPageReqVO reqVO) { - return selectPage(reqVO, new QueryWrapperX() - .eqIfPresent("job_id", reqVO.getJobId()) - .likeIfPresent("handler_name", reqVO.getHandlerName()) - .geIfPresent("begin_time", reqVO.getBeginTime()) - .leIfPresent("end_time", reqVO.getEndTime()) - .eqIfPresent("status", reqVO.getStatus()) - .orderByDesc("id") // ID 倒序 + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(JobLogDO::getJobId, reqVO.getJobId()) + .likeIfPresent(JobLogDO::getHandlerName, reqVO.getHandlerName()) + .geIfPresent(JobLogDO::getBeginTime, reqVO.getBeginTime()) + .leIfPresent(JobLogDO::getEndTime, reqVO.getEndTime()) + .eqIfPresent(JobLogDO::getStatus, reqVO.getStatus()) + .orderByDesc(JobLogDO::getId) // ID 倒序 ); } default List selectList(JobLogExportReqVO reqVO) { - return selectList(new QueryWrapperX() - .eqIfPresent("job_id", reqVO.getJobId()) - .likeIfPresent("handler_name", reqVO.getHandlerName()) - .geIfPresent("begin_time", reqVO.getBeginTime()) - .leIfPresent("end_time", reqVO.getEndTime()) - .eqIfPresent("status", reqVO.getStatus()) - .orderByDesc("id") // ID 倒序 + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(JobLogDO::getJobId, reqVO.getJobId()) + .likeIfPresent(JobLogDO::getHandlerName, reqVO.getHandlerName()) + .geIfPresent(JobLogDO::getBeginTime, reqVO.getBeginTime()) + .leIfPresent(JobLogDO::getEndTime, reqVO.getEndTime()) + .eqIfPresent(JobLogDO::getStatus, reqVO.getStatus()) + .orderByDesc(JobLogDO::getId) // ID 倒序 ); } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/security/config/SecurityConfiguration.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/security/config/SecurityConfiguration.java index c99cc1a8d..01b5714ba 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/security/config/SecurityConfiguration.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/security/config/SecurityConfiguration.java @@ -23,7 +23,9 @@ public class SecurityConfiguration { @Override public void customize(ExpressionUrlAuthorizationConfigurer.ExpressionInterceptUrlRegistry registry) { // Swagger 接口文档 - registry.antMatchers("/swagger-ui.html").anonymous() + registry.antMatchers("/v3/api-docs/**").permitAll() + .antMatchers("/swagger-ui.html").permitAll() + .antMatchers("/swagger-ui/**").permitAll() .antMatchers("/swagger-resources/**").anonymous() .antMatchers("/webjars/**").anonymous() .antMatchers("/*/api-docs").anonymous(); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/web/config/InfraWebConfiguration.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/web/config/InfraWebConfiguration.java new file mode 100644 index 000000000..09f2c2b3f --- /dev/null +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/web/config/InfraWebConfiguration.java @@ -0,0 +1,24 @@ +package cn.iocoder.yudao.module.infra.framework.web.config; + +import cn.iocoder.yudao.framework.swagger.config.YudaoSwaggerAutoConfiguration; +import org.springdoc.core.GroupedOpenApi; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * infra 模块的 web 组件的 Configuration + * + * @author 芋道源码 + */ +@Configuration(proxyBeanMethods = false) +public class InfraWebConfiguration { + + /** + * infra 模块的 API 分组 + */ + @Bean + public GroupedOpenApi infraGroupedOpenApi() { + return YudaoSwaggerAutoConfiguration.buildGroupedOpenApi("infra"); + } + +} diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/web/package-info.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/web/package-info.java new file mode 100644 index 000000000..6fb49bfde --- /dev/null +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/web/package-info.java @@ -0,0 +1,4 @@ +/** + * infra 模块的 web 配置 + */ +package cn.iocoder.yudao.module.infra.framework.web; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java index 3b693eb50..e3a352b8b 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java @@ -76,7 +76,7 @@ public class CodegenServiceImpl implements CodegenService { private Long createCodegen0(Long userId, Long dataSourceConfigId, TableInfo tableInfo) { // 校验导入的表和字段非空 - checkTableInfo(tableInfo); + validateTableInfo(tableInfo); // 校验是否已经存在 if (codegenTableMapper.selectByTableNameAndDataSourceConfigId(tableInfo.getName(), dataSourceConfigId) != null) { @@ -100,7 +100,7 @@ public class CodegenServiceImpl implements CodegenService { return table.getId(); } - private void checkTableInfo(TableInfo tableInfo) { + private void validateTableInfo(TableInfo tableInfo) { if (tableInfo == null) { throw exception(CODEGEN_IMPORT_TABLE_NULL); } @@ -149,7 +149,7 @@ public class CodegenServiceImpl implements CodegenService { private void syncCodegen0(Long tableId, TableInfo tableInfo) { // 校验导入的表和字段非空 - checkTableInfo(tableInfo); + validateTableInfo(tableInfo); List tableFields = tableInfo.getFields(); // 构建 CodegenColumnDO 数组,只同步新增的字段 diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/config/ConfigServiceImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/config/ConfigServiceImpl.java index 5c354c989..51c912be7 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/config/ConfigServiceImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/config/ConfigServiceImpl.java @@ -9,7 +9,6 @@ import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigUpdateReqV 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.mysql.config.ConfigMapper; -import cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants; import cn.iocoder.yudao.module.infra.enums.config.ConfigTypeEnum; import com.google.common.annotations.VisibleForTesting; import lombok.extern.slf4j.Slf4j; @@ -20,6 +19,7 @@ import javax.annotation.Resource; import java.util.List; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.*; /** * 参数配置 Service 实现类 @@ -35,7 +35,7 @@ public class ConfigServiceImpl implements ConfigService { @Override public Long createConfig(ConfigCreateReqVO reqVO) { // 校验正确性 - checkCreateOrUpdate(null, reqVO.getKey()); + validateConfigForCreateOrUpdate(null, reqVO.getKey()); // 插入参数配置 ConfigDO config = ConfigConvert.INSTANCE.convert(reqVO); config.setType(ConfigTypeEnum.CUSTOM.getType()); @@ -46,19 +46,19 @@ public class ConfigServiceImpl implements ConfigService { @Override public void updateConfig(ConfigUpdateReqVO reqVO) { // 校验正确性 - checkCreateOrUpdate(reqVO.getId(), null); // 不允许更新 key + validateConfigForCreateOrUpdate(reqVO.getId(), null); // 不允许更新 key // 更新参数配置 ConfigDO updateObj = ConfigConvert.INSTANCE.convert(reqVO); - configMapper.updateById(updateObj);; + configMapper.updateById(updateObj); } @Override public void deleteConfig(Long id) { // 校验配置存在 - ConfigDO config = checkConfigExists(id); + ConfigDO config = validateConfigExists(id); // 内置配置,不允许删除 if (ConfigTypeEnum.SYSTEM.getType().equals(config.getType())) { - throw exception(ErrorCodeConstants.CONFIG_CAN_NOT_DELETE_SYSTEM_TYPE); + throw exception(CONFIG_CAN_NOT_DELETE_SYSTEM_TYPE); } // 删除 configMapper.deleteById(id); @@ -84,39 +84,39 @@ public class ConfigServiceImpl implements ConfigService { return configMapper.selectList(reqVO); } - private void checkCreateOrUpdate(Long id, String key) { + private void validateConfigForCreateOrUpdate(Long id, String key) { // 校验自己存在 - checkConfigExists(id); + validateConfigExists(id); // 校验参数配置 key 的唯一性 if (StrUtil.isNotEmpty(key)) { - checkConfigKeyUnique(id, key); + validateConfigKeyUnique(id, key); } } @VisibleForTesting - public ConfigDO checkConfigExists(Long id) { + public ConfigDO validateConfigExists(Long id) { if (id == null) { return null; } ConfigDO config = configMapper.selectById(id); if (config == null) { - throw exception(ErrorCodeConstants.CONFIG_NOT_EXISTS); + throw exception(CONFIG_NOT_EXISTS); } return config; } @VisibleForTesting - public void checkConfigKeyUnique(Long id, String key) { + public void validateConfigKeyUnique(Long id, String key) { ConfigDO config = configMapper.selectByKey(key); if (config == null) { return; } // 如果 id 为空,说明不用比较是否为相同 id 的参数配置 if (id == null) { - throw exception(ErrorCodeConstants.CONFIG_KEY_DUPLICATE); + throw exception(CONFIG_KEY_DUPLICATE); } if (!config.getId().equals(id)) { - throw exception(ErrorCodeConstants.CONFIG_KEY_DUPLICATE); + throw exception(CONFIG_KEY_DUPLICATE); } } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigServiceImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigServiceImpl.java index f2fd0a408..e4365c205 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigServiceImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigServiceImpl.java @@ -37,7 +37,7 @@ public class DataSourceConfigServiceImpl implements DataSourceConfigService { @Override public Long createDataSourceConfig(DataSourceConfigCreateReqVO createReqVO) { DataSourceConfigDO dataSourceConfig = DataSourceConfigConvert.INSTANCE.convert(createReqVO); - checkConnectionOK(dataSourceConfig); + validateConnectionOK(dataSourceConfig); // 插入 dataSourceConfigMapper.insert(dataSourceConfig); @@ -50,7 +50,7 @@ public class DataSourceConfigServiceImpl implements DataSourceConfigService { // 校验存在 validateDataSourceConfigExists(updateReqVO.getId()); DataSourceConfigDO updateObj = DataSourceConfigConvert.INSTANCE.convert(updateReqVO); - checkConnectionOK(updateObj); + validateConnectionOK(updateObj); // 更新 dataSourceConfigMapper.updateById(updateObj); @@ -88,7 +88,7 @@ public class DataSourceConfigServiceImpl implements DataSourceConfigService { return result; } - private void checkConnectionOK(DataSourceConfigDO config) { + private void validateConnectionOK(DataSourceConfigDO config) { boolean success = JdbcUtils.isConnectionOK(config.getUrl(), config.getUsername(), config.getPassword()); if (!success) { throw exception(DATA_SOURCE_CONFIG_NOT_OK); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/db/DatabaseTableServiceImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/db/DatabaseTableServiceImpl.java index d0c80ba61..17fb5cea3 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/db/DatabaseTableServiceImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/db/DatabaseTableServiceImpl.java @@ -41,7 +41,7 @@ public class DatabaseTableServiceImpl implements DatabaseTableService { return CollUtil.getFirst(getTableList0(dataSourceConfigId, name)); } - public List getTableList0(Long dataSourceConfigId, String name) { + private List getTableList0(Long dataSourceConfigId, String name) { // 获得数据源配置 DataSourceConfigDO config = dataSourceConfigService.getDataSourceConfig(dataSourceConfigId); Assert.notNull(config, "数据源({}) 不存在!", dataSourceConfigId); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigService.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigService.java index b3fc6bad2..43ab5bc68 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigService.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigService.java @@ -8,8 +8,6 @@ import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigU import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileConfigDO; import javax.validation.Valid; -import java.util.Collection; -import java.util.List; /** * 文件配置 Service 接口 @@ -60,14 +58,6 @@ public interface FileConfigService { */ FileConfigDO getFileConfig(Long id); - /** - * 获得文件配置列表 - * - * @param ids 编号 - * @return 文件配置列表 - */ - List getFileConfigList(Collection ids); - /** * 获得文件配置分页 * diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImpl.java index 590ff8116..6236df6ff 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImpl.java @@ -27,7 +27,6 @@ import org.springframework.validation.annotation.Validated; import javax.annotation.PostConstruct; import javax.annotation.Resource; import javax.validation.Validator; -import java.util.Collection; import java.util.List; import java.util.Map; @@ -95,7 +94,7 @@ public class FileConfigServiceImpl implements FileConfigService { @Override public void updateFileConfig(FileConfigUpdateReqVO updateReqVO) { // 校验存在 - FileConfigDO config = this.validateFileConfigExists(updateReqVO.getId()); + FileConfigDO config = validateFileConfigExists(updateReqVO.getId()); // 更新 FileConfigDO updateObj = FileConfigConvert.INSTANCE.convert(updateReqVO) .setConfig(parseClientConfig(config.getStorage(), updateReqVO.getConfig())); @@ -108,7 +107,7 @@ public class FileConfigServiceImpl implements FileConfigService { @Transactional(rollbackFor = Exception.class) public void updateFileConfigMaster(Long id) { // 校验存在 - this.validateFileConfigExists(id); + validateFileConfigExists(id); // 更新其它为非 master fileConfigMapper.updateBatch(new FileConfigDO().setMaster(false)); // 更新 @@ -138,7 +137,7 @@ public class FileConfigServiceImpl implements FileConfigService { @Override public void deleteFileConfig(Long id) { // 校验存在 - FileConfigDO config = this.validateFileConfigExists(id); + FileConfigDO config = validateFileConfigExists(id); if (Boolean.TRUE.equals(config.getMaster())) { throw exception(FILE_CONFIG_DELETE_FAIL_MASTER); } @@ -161,11 +160,6 @@ public class FileConfigServiceImpl implements FileConfigService { return fileConfigMapper.selectById(id); } - @Override - public List getFileConfigList(Collection ids) { - return fileConfigMapper.selectBatchIds(ids); - } - @Override public PageResult getFileConfigPage(FileConfigPageReqVO pageReqVO) { return fileConfigMapper.selectPage(pageReqVO); @@ -174,7 +168,7 @@ public class FileConfigServiceImpl implements FileConfigService { @Override public String testFileConfig(Long id) throws Exception { // 校验存在 - this.validateFileConfigExists(id); + validateFileConfigExists(id); // 上传文件 byte[] content = ResourceUtil.readBytes("file/erweima.jpg"); return fileClientFactory.getFileClient(id).upload(content, IdUtil.fastSimpleUUID() + ".jpg", "image/jpeg"); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java index 2226e7bae..0732765d8 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java @@ -69,7 +69,7 @@ public class FileServiceImpl implements FileService { @Override public void deleteFile(Long id) throws Exception { // 校验存在 - FileDO file = this.validateFileExists(id); + FileDO file = validateFileExists(id); // 从文件存储器中删除 FileClient client = fileConfigService.getFileClient(file.getConfigId()); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobServiceImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobServiceImpl.java index e0a245750..498d816b8 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobServiceImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobServiceImpl.java @@ -69,7 +69,7 @@ public class JobServiceImpl implements JobService { public void updateJob(JobUpdateReqVO updateReqVO) throws SchedulerException { validateCronExpression(updateReqVO.getCronExpression()); // 校验存在 - JobDO job = this.validateJobExists(updateReqVO.getId()); + JobDO job = validateJobExists(updateReqVO.getId()); // 只有开启状态,才可以修改.原因是,如果出暂停状态,修改 Quartz Job 时,会导致任务又开始执行 if (!job.getStatus().equals(JobStatusEnum.NORMAL.getStatus())) { throw exception(JOB_UPDATE_ONLY_NORMAL_STATUS); @@ -92,7 +92,7 @@ public class JobServiceImpl implements JobService { throw exception(JOB_CHANGE_STATUS_INVALID); } // 校验存在 - JobDO job = this.validateJobExists(id); + JobDO job = validateJobExists(id); // 校验是否已经为当前状态 if (job.getStatus().equals(status)) { throw exception(JOB_CHANGE_STATUS_EQUALS); @@ -112,7 +112,7 @@ public class JobServiceImpl implements JobService { @Override public void triggerJob(Long id) throws SchedulerException { // 校验存在 - JobDO job = this.validateJobExists(id); + JobDO job = validateJobExists(id); // 触发 Quartz 中的 Job schedulerManager.triggerJob(job.getId(), job.getHandlerName(), job.getHandlerParam()); @@ -122,7 +122,7 @@ public class JobServiceImpl implements JobService { @Transactional(rollbackFor = Exception.class) public void deleteJob(Long id) throws SchedulerException { // 校验存在 - JobDO job = this.validateJobExists(id); + JobDO job = validateJobExists(id); // 更新 jobMapper.deleteById(id); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImpl.java index c1b129322..c0f9252af 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImpl.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.infra.service.logger; -import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.infra.api.logger.dto.ApiErrorLogCreateReqDTO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogExportReqVO; @@ -8,7 +7,6 @@ import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiE import cn.iocoder.yudao.module.infra.convert.logger.ApiErrorLogConvert; import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiErrorLogDO; import cn.iocoder.yudao.module.infra.dal.mysql.logger.ApiErrorLogMapper; -import cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants; import cn.iocoder.yudao.module.infra.enums.logger.ApiErrorLogProcessStatusEnum; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -17,6 +15,10 @@ import javax.annotation.Resource; import java.time.LocalDateTime; import java.util.List; +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.API_ERROR_LOG_NOT_FOUND; +import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.API_ERROR_LOG_PROCESSED; + /** * API 错误日志 Service 实现类 * @@ -31,8 +33,8 @@ public class ApiErrorLogServiceImpl implements ApiErrorLogService { @Override public void createApiErrorLog(ApiErrorLogCreateReqDTO createDTO) { - ApiErrorLogDO apiErrorLog = ApiErrorLogConvert.INSTANCE.convert(createDTO); - apiErrorLog.setProcessStatus(ApiErrorLogProcessStatusEnum.INIT.getStatus()); + ApiErrorLogDO apiErrorLog = ApiErrorLogConvert.INSTANCE.convert(createDTO) + .setProcessStatus(ApiErrorLogProcessStatusEnum.INIT.getStatus()); apiErrorLogMapper.insert(apiErrorLog); } @@ -50,10 +52,10 @@ public class ApiErrorLogServiceImpl implements ApiErrorLogService { public void updateApiErrorLogProcess(Long id, Integer processStatus, Long processUserId) { ApiErrorLogDO errorLog = apiErrorLogMapper.selectById(id); if (errorLog == null) { - throw ServiceExceptionUtil.exception(ErrorCodeConstants.API_ERROR_LOG_NOT_FOUND); + throw exception(API_ERROR_LOG_NOT_FOUND); } if (!ApiErrorLogProcessStatusEnum.INIT.getStatus().equals(errorLog.getProcessStatus())) { - throw ServiceExceptionUtil.exception(ErrorCodeConstants.API_ERROR_LOG_PROCESSED); + throw exception(API_ERROR_LOG_PROCESSED); } // 标记处理 apiErrorLogMapper.updateById(ApiErrorLogDO.builder().id(id).processStatus(processStatus) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/test/TestDemoServiceImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/test/TestDemoServiceImpl.java index 731a29ccc..70f2ebc5d 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/test/TestDemoServiceImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/test/TestDemoServiceImpl.java @@ -45,7 +45,7 @@ public class TestDemoServiceImpl implements TestDemoService { @CacheEvict(value = "test", key = "#updateReqVO.id") public void updateTestDemo(TestDemoUpdateReqVO updateReqVO) { // 校验存在 - this.validateTestDemoExists(updateReqVO.getId()); + validateTestDemoExists(updateReqVO.getId()); // 更新 TestDemoDO updateObj = TestDemoConvert.INSTANCE.convert(updateReqVO); testDemoMapper.updateById(updateObj); @@ -55,7 +55,7 @@ public class TestDemoServiceImpl implements TestDemoService { @CacheEvict(value = "test", key = "#id") public void deleteTestDemo(Long id) { // 校验存在 - this.validateTestDemoExists(id); + validateTestDemoExists(id); // 删除 testDemoMapper.deleteById(id); } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/controller.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/controller.vm index 5b0546777..a8c1f62c5 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/controller.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/controller.vm @@ -5,7 +5,9 @@ import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; #if ($sceneEnum.scene == 1)import org.springframework.security.access.prepost.PreAuthorize;#end -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import javax.validation.constraints.*; import javax.validation.*; @@ -27,7 +29,7 @@ import ${basePackage}.module.${table.moduleName}.dal.dataobject.${table.business import ${basePackage}.module.${table.moduleName}.convert.${table.businessName}.${table.className}Convert; import ${basePackage}.module.${table.moduleName}.service.${table.businessName}.${table.className}Service; -@Api(tags = "${sceneEnum.name} - ${table.classComment}") +@Tag(name = "${sceneEnum.name} - ${table.classComment}") @RestController ##二级的 businessName 暂时不算在 HTTP 路径上,可以根据需要写 @RequestMapping("/${table.moduleName}/${simpleClassName_strikeCase}") @@ -38,7 +40,7 @@ public class ${sceneEnum.prefixClass}${table.className}Controller { private ${table.className}Service ${classNameVar}Service; @PostMapping("/create") - @ApiOperation("创建${table.classComment}") + @Operation(summary = "创建${table.classComment}") #if ($sceneEnum.scene == 1) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:create')")#end public CommonResult<${primaryColumn.javaType}> create${simpleClassName}(@Valid @RequestBody ${sceneEnum.prefixClass}${table.className}CreateReqVO createReqVO) { @@ -46,7 +48,7 @@ public class ${sceneEnum.prefixClass}${table.className}Controller { } @PutMapping("/update") - @ApiOperation("更新${table.classComment}") + @Operation(summary = "更新${table.classComment}") #if ($sceneEnum.scene == 1) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:update')")#end public CommonResult update${simpleClassName}(@Valid @RequestBody ${sceneEnum.prefixClass}${table.className}UpdateReqVO updateReqVO) { @@ -55,8 +57,8 @@ public class ${sceneEnum.prefixClass}${table.className}Controller { } @DeleteMapping("/delete") - @ApiOperation("删除${table.classComment}") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = ${primaryColumn.javaType}.class) + @Operation(summary = "删除${table.classComment}") + @Parameter(name = "id", description = "编号", required = true) #if ($sceneEnum.scene == 1) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:delete')")#end public CommonResult delete${simpleClassName}(@RequestParam("id") ${primaryColumn.javaType} id) { @@ -65,8 +67,8 @@ public class ${sceneEnum.prefixClass}${table.className}Controller { } @GetMapping("/get") - @ApiOperation("获得${table.classComment}") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = ${primaryColumn.javaType}.class) + @Operation(summary = "获得${table.classComment}") + @Parameter(name = "id", description = "编号", required = true, example = "1024") #if ($sceneEnum.scene == 1) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:query')")#end public CommonResult<${sceneEnum.prefixClass}${table.className}RespVO> get${simpleClassName}(@RequestParam("id") ${primaryColumn.javaType} id) { @@ -75,8 +77,8 @@ public class ${sceneEnum.prefixClass}${table.className}Controller { } @GetMapping("/list") - @ApiOperation("获得${table.classComment}列表") - @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) + @Operation(summary = "获得${table.classComment}列表") + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") #if ($sceneEnum.scene == 1) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:query')")#end public CommonResult> get${simpleClassName}List(@RequestParam("ids") Collection<${primaryColumn.javaType}> ids) { @@ -85,7 +87,7 @@ public class ${sceneEnum.prefixClass}${table.className}Controller { } @GetMapping("/page") - @ApiOperation("获得${table.classComment}分页") + @Operation(summary = "获得${table.classComment}分页") #if ($sceneEnum.scene == 1) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:query')")#end public CommonResult> get${simpleClassName}Page(@Valid ${sceneEnum.prefixClass}${table.className}PageReqVO pageVO) { @@ -94,7 +96,7 @@ public class ${sceneEnum.prefixClass}${table.className}Controller { } @GetMapping("/export-excel") - @ApiOperation("导出${table.classComment} Excel") + @Operation(summary = "导出${table.classComment} Excel") #if ($sceneEnum.scene == 1) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:export')")#end @OperateLog(type = EXPORT) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/_column.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/_column.vm index 69477d433..89a8e348f 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/_column.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/_column.vm @@ -1,5 +1,5 @@ ## 提供给 baseVO、createVO、updateVO 生成字段 - @ApiModelProperty(value = "${column.columnComment}"#if (!${column.nullable}), required = true#end#if ("$!column.example" != ""), example = "${column.example}"#end) + @Schema(description = "${column.columnComment}"#if (!${column.nullable}), required = true#end#if ("$!column.example" != ""), example = "${column.example}"#end) #if (!${column.nullable})## 判断 @NotEmpty 和 @NotNull 注解 #if (${field.fieldType} == 'String') @NotEmpty(message = "${column.columnComment}不能为空") diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/baseVO.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/baseVO.vm index a0ad48d60..e2c1f0b39 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/baseVO.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/baseVO.vm @@ -1,5 +1,6 @@ package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; #foreach ($column in $columns) @@ -10,7 +11,6 @@ import java.math.BigDecimal; import java.time.LocalDateTime; #end #end -import io.swagger.annotations.*; import javax.validation.constraints.*; ## 处理 Date 字段的引入 #foreach ($column in $columns) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/createReqVO.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/createReqVO.vm index bf6408c9c..d4f6f8ea9 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/createReqVO.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/createReqVO.vm @@ -2,7 +2,7 @@ package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePac import lombok.*; import java.util.*; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.media.Schema; import javax.validation.constraints.*; ## 处理 Date 字段的引入 #foreach ($column in $columns) @@ -15,7 +15,7 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; #end #end -@ApiModel("${sceneEnum.name} - ${table.classComment}创建 Request VO") +@Schema(description = "${sceneEnum.name} - ${table.classComment}创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/excelVO.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/excelVO.vm index 8bfd92b69..15c6660c8 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/excelVO.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/excelVO.vm @@ -1,5 +1,6 @@ package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; #foreach ($column in $columns) @@ -10,7 +11,6 @@ import java.math.BigDecimal; import java.time.LocalDateTime; #end #end -import io.swagger.annotations.*; import com.alibaba.excel.annotation.ExcelProperty; #foreach ($column in $columns) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/exportReqVO.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/exportReqVO.vm index cd68dd82e..d3ef4aacd 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/exportReqVO.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/exportReqVO.vm @@ -2,7 +2,7 @@ package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePac import lombok.*; import java.util.*; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.media.Schema; import ${PageParamClassName}; ## 处理 Date 字段的引入 #foreach ($column in $columns) @@ -16,18 +16,18 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; #end ## 字段模板 #macro(columnTpl $prefix $prefixStr) - @ApiModelProperty(value = "${prefixStr}${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end) + @Schema(description = "${prefixStr}${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end) private ${column.javaType}#if ("$!prefix" != "") ${prefix}${JavaField}#else ${column.javaField}#end; #end -@ApiModel(value = "${sceneEnum.name} - ${table.classComment} Excel 导出 Request VO", description = "参数和 ${table.className}PageReqVO 是一致的") +@Schema(description = "${sceneEnum.name} - ${table.classComment} Excel 导出 Request VO,参数和 ${table.className}PageReqVO 是一致的") @Data public class ${sceneEnum.prefixClass}${table.className}ExportReqVO { #foreach ($column in $columns) #if (${column.listOperation})##查询操作 #if (${column.listOperationCondition} == "BETWEEN")## 情况一,Between 的时候 - @ApiModelProperty(value = "${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end) + @Schema(description = "${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private ${column.javaType}[] ${column.javaField}; #else##情况二,非 Between 的时间 diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/pageReqVO.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/pageReqVO.vm index f2664390a..6f9868da3 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/pageReqVO.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/pageReqVO.vm @@ -2,7 +2,7 @@ package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePac import lombok.*; import java.util.*; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.media.Schema; import ${PageParamClassName}; ## 处理 Date 字段的引入 #foreach ($column in $columns) @@ -16,11 +16,11 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; #end ## 字段模板 #macro(columnTpl $prefix $prefixStr) - @ApiModelProperty(value = "${prefixStr}${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end) + @Schema(description = "${prefixStr}${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end) private ${column.javaType}#if ("$!prefix" != "") ${prefix}${JavaField}#else ${column.javaField}#end; #end -@ApiModel("${sceneEnum.name} - ${table.classComment}分页 Request VO") +@Schema(description = "${sceneEnum.name} - ${table.classComment}分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @@ -29,7 +29,7 @@ public class ${sceneEnum.prefixClass}${table.className}PageReqVO extends PagePar #foreach ($column in $columns) #if (${column.listOperation})##查询操作 #if (${column.listOperationCondition} == "BETWEEN")## 情况一,Between 的时候 - @ApiModelProperty(value = "${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end) + @Schema(description = "${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private ${column.javaType}[] ${column.javaField}; #else##情况二,非 Between 的时间 diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/respVO.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/respVO.vm index 19bc32db6..2288ceee8 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/respVO.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/respVO.vm @@ -1,5 +1,6 @@ package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; #foreach ($column in $columns) #if (${column.javaType} == "LocalDateTime") @@ -7,9 +8,8 @@ import java.time.LocalDateTime; #break #end #end -import io.swagger.annotations.*; -@ApiModel("${sceneEnum.name} - ${table.classComment} Response VO") +@Schema(description = "${sceneEnum.name} - ${table.classComment} Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @@ -17,7 +17,7 @@ public class ${sceneEnum.prefixClass}${table.className}RespVO extends ${sceneEnu #foreach ($column in $columns) #if (${column.listOperationResult} && (!${column.createOperation} || !${column.updateOperation}))##不是通用字段 - @ApiModelProperty(value = "${column.columnComment}"#if (!${column.nullable}), required = true#end#if ("$!column.example" != ""), example = "${column.example}"#end) + @Schema(description = "${column.columnComment}"#if (!${column.nullable}), required = true#end#if ("$!column.example" != ""), example = "${column.example}"#end) private ${column.javaType} ${column.javaField}; #end diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/updateReqVO.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/updateReqVO.vm index 636991508..48d74321d 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/updateReqVO.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/controller/vo/updateReqVO.vm @@ -1,8 +1,8 @@ package ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; -import io.swagger.annotations.*; import javax.validation.constraints.*; ## 处理 Date 字段的引入 #foreach ($column in $columns) @@ -15,7 +15,7 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; #end #end -@ApiModel("${sceneEnum.name} - ${table.classComment}更新 Request VO") +@Schema(description = "${sceneEnum.name} - ${table.classComment}更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/service/serviceImpl.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/service/serviceImpl.vm index 85dfa0aab..a732039ce 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/service/serviceImpl.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/service/serviceImpl.vm @@ -39,7 +39,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service @Override public void update${simpleClassName}(${sceneEnum.prefixClass}${table.className}UpdateReqVO updateReqVO) { // 校验存在 - this.validate${simpleClassName}Exists(updateReqVO.getId()); + validate${simpleClassName}Exists(updateReqVO.getId()); // 更新 ${table.className}DO updateObj = ${table.className}Convert.INSTANCE.convert(updateReqVO); ${classNameVar}Mapper.updateById(updateObj); @@ -48,7 +48,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service @Override public void delete${simpleClassName}(${primaryColumn.javaType} id) { // 校验存在 - this.validate${simpleClassName}Exists(id); + validate${simpleClassName}Exists(id); // 删除 ${classNameVar}Mapper.deleteById(id); } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/test/serviceTest.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/test/serviceTest.vm index e97fbb275..67a44e989 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/test/serviceTest.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/java/test/serviceTest.vm @@ -52,7 +52,7 @@ import static org.mockito.Mockito.*; #if (${column.listOperation}) #set ($JavaField = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})##首字母大写 #if (${column.listOperationCondition} == "BETWEEN")## BETWEEN 的情况 - reqVO.set${JavaField}((new LocalDateTime[]{})); + reqVO.set${JavaField}(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); #else reqVO.set$JavaField(null); #end diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/config/ConfigServiceTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/config/ConfigServiceImplTest.java similarity index 75% rename from yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/config/ConfigServiceTest.java rename to yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/config/ConfigServiceImplTest.java index 5f29e79ec..428b20522 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/config/ConfigServiceTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/config/ConfigServiceImplTest.java @@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.infra.service.config; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.framework.test.core.util.RandomUtils; import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigCreateReqVO; @@ -12,17 +11,17 @@ import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigUpdateReqV import cn.iocoder.yudao.module.infra.dal.dataobject.config.ConfigDO; import cn.iocoder.yudao.module.infra.dal.mysql.config.ConfigMapper; import cn.iocoder.yudao.module.infra.enums.config.ConfigTypeEnum; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Import; import javax.annotation.Resource; -import java.time.LocalDateTime; import java.util.List; import java.util.function.Consumer; import static cn.hutool.core.util.RandomUtil.randomEle; +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; @@ -30,7 +29,7 @@ import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.*; import static org.junit.jupiter.api.Assertions.*; @Import(ConfigServiceImpl.class) -public class ConfigServiceTest extends BaseDbUnitTest { +public class ConfigServiceImplTest extends BaseDbUnitTest { @Resource private ConfigServiceImpl configService; @@ -50,7 +49,7 @@ public class ConfigServiceTest extends BaseDbUnitTest { // 校验记录的属性是否正确 ConfigDO config = configMapper.selectById(configId); assertPojoEquals(reqVO, config); - Assertions.assertEquals(ConfigTypeEnum.CUSTOM.getType(), config.getType()); + assertEquals(ConfigTypeEnum.CUSTOM.getType(), config.getType()); } @Test @@ -101,40 +100,40 @@ public class ConfigServiceTest extends BaseDbUnitTest { } @Test - public void testCheckConfigExists_success() { + public void testValidateConfigExists_success() { // mock 数据 ConfigDO dbConfigDO = randomConfigDO(); configMapper.insert(dbConfigDO);// @Sql: 先插入出一条存在的数据 // 调用成功 - configService.checkConfigExists(dbConfigDO.getId()); + configService.validateConfigExists(dbConfigDO.getId()); } @Test - public void testCheckConfigExist_notExists() { - assertServiceException(() -> configService.checkConfigExists(randomLongId()), CONFIG_NOT_EXISTS); + public void testValidateConfigExist_notExists() { + assertServiceException(() -> configService.validateConfigExists(randomLongId()), CONFIG_NOT_EXISTS); } @Test - public void testCheckConfigKeyUnique_success() { + public void testValidateConfigKeyUnique_success() { // 调用,成功 - configService.checkConfigKeyUnique(randomLongId(), randomString()); + configService.validateConfigKeyUnique(randomLongId(), randomString()); } @Test - public void testCheckConfigKeyUnique_keyDuplicateForCreate() { + public void testValidateConfigKeyUnique_keyDuplicateForCreate() { // 准备参数 String key = randomString(); // mock 数据 configMapper.insert(randomConfigDO(o -> o.setConfigKey(key))); // 调用,校验异常 - assertServiceException(() -> configService.checkConfigKeyUnique(null, key), + assertServiceException(() -> configService.validateConfigKeyUnique(null, key), CONFIG_KEY_DUPLICATE); } @Test - public void testCheckConfigKeyUnique_keyDuplicateForUpdate() { + public void testValidateConfigKeyUnique_keyDuplicateForUpdate() { // 准备参数 Long id = randomLongId(); String key = randomString(); @@ -142,7 +141,7 @@ public class ConfigServiceTest extends BaseDbUnitTest { configMapper.insert(randomConfigDO(o -> o.setConfigKey(key))); // 调用,校验异常 - assertServiceException(() -> configService.checkConfigKeyUnique(id, key), + assertServiceException(() -> configService.validateConfigKeyUnique(id, key), CONFIG_KEY_DUPLICATE); } @@ -157,19 +156,19 @@ public class ConfigServiceTest extends BaseDbUnitTest { }); configMapper.insert(dbConfig); // 测试 name 不匹配 - configMapper.insert(ObjectUtils.cloneIgnoreId(dbConfig, o -> o.setName("土豆"))); + configMapper.insert(cloneIgnoreId(dbConfig, o -> o.setName("土豆"))); // 测试 key 不匹配 - configMapper.insert(ObjectUtils.cloneIgnoreId(dbConfig, o -> o.setConfigKey("tudou"))); + configMapper.insert(cloneIgnoreId(dbConfig, o -> o.setConfigKey("tudou"))); // 测试 type 不匹配 - configMapper.insert(ObjectUtils.cloneIgnoreId(dbConfig, o -> o.setType(ConfigTypeEnum.CUSTOM.getType()))); + configMapper.insert(cloneIgnoreId(dbConfig, o -> o.setType(ConfigTypeEnum.CUSTOM.getType()))); // 测试 createTime 不匹配 - configMapper.insert(ObjectUtils.cloneIgnoreId(dbConfig, o -> o.setCreateTime(buildTime(2021, 1, 1)))); + configMapper.insert(cloneIgnoreId(dbConfig, o -> o.setCreateTime(buildTime(2021, 1, 1)))); // 准备参数 ConfigPageReqVO reqVO = new ConfigPageReqVO(); reqVO.setName("艿"); reqVO.setKey("nai"); reqVO.setType(ConfigTypeEnum.SYSTEM.getType()); - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2021, 1, 15),buildTime(2021, 2, 15)})); + reqVO.setCreateTime(buildBetweenTime(2021, 1, 15, 2021, 2, 15)); // 调用 PageResult pageResult = configService.getConfigPage(reqVO); @@ -190,19 +189,19 @@ public class ConfigServiceTest extends BaseDbUnitTest { }); configMapper.insert(dbConfig); // 测试 name 不匹配 - configMapper.insert(ObjectUtils.cloneIgnoreId(dbConfig, o -> o.setName("土豆"))); + configMapper.insert(cloneIgnoreId(dbConfig, o -> o.setName("土豆"))); // 测试 key 不匹配 - configMapper.insert(ObjectUtils.cloneIgnoreId(dbConfig, o -> o.setConfigKey("tudou"))); + configMapper.insert(cloneIgnoreId(dbConfig, o -> o.setConfigKey("tudou"))); // 测试 type 不匹配 - configMapper.insert(ObjectUtils.cloneIgnoreId(dbConfig, o -> o.setType(ConfigTypeEnum.CUSTOM.getType()))); + configMapper.insert(cloneIgnoreId(dbConfig, o -> o.setType(ConfigTypeEnum.CUSTOM.getType()))); // 测试 createTime 不匹配 - configMapper.insert(ObjectUtils.cloneIgnoreId(dbConfig, o -> o.setCreateTime(buildTime(2021, 1, 1)))); + configMapper.insert(cloneIgnoreId(dbConfig, o -> o.setCreateTime(buildTime(2021, 1, 1)))); // 准备参数 ConfigExportReqVO reqVO = new ConfigExportReqVO(); reqVO.setName("艿"); reqVO.setKey("nai"); reqVO.setType(ConfigTypeEnum.SYSTEM.getType()); - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2021, 1, 15),buildTime(2021, 2, 15)})); + reqVO.setCreateTime(buildBetweenTime(2021, 1, 15, 2021, 2, 15)); // 调用 List list = configService.getConfigList(reqVO); @@ -211,6 +210,21 @@ public class ConfigServiceTest extends BaseDbUnitTest { assertPojoEquals(dbConfig, list.get(0)); } + @Test + public void testGetConfig() { + // mock 数据 + ConfigDO dbConfig = randomConfigDO(); + configMapper.insert(dbConfig);// @Sql: 先插入出一条存在的数据 + // 准备参数 + Long id = dbConfig.getId(); + + // 调用 + ConfigDO config = configService.getConfig(id); + // 断言 + assertNotNull(config); + assertPojoEquals(dbConfig, config); + } + @Test public void testGetConfigByKey() { // mock 数据 diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigServiceImplTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigServiceImplTest.java index e1c997f7b..b5ef46c46 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigServiceImplTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigServiceImplTest.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.infra.service.db; +import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.ReflectUtil; import cn.hutool.crypto.symmetric.AES; import cn.iocoder.yudao.framework.mybatis.core.type.EncryptTypeHandler; @@ -9,6 +10,7 @@ import cn.iocoder.yudao.module.infra.controller.admin.db.vo.DataSourceConfigCrea import cn.iocoder.yudao.module.infra.controller.admin.db.vo.DataSourceConfigUpdateReqVO; import cn.iocoder.yudao.module.infra.dal.dataobject.db.DataSourceConfigDO; import cn.iocoder.yudao.module.infra.dal.mysql.db.DataSourceConfigMapper; +import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty; import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -18,14 +20,14 @@ import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import javax.annotation.Resource; +import java.util.List; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.DATA_SOURCE_CONFIG_NOT_EXISTS; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mockStatic; @@ -57,6 +59,11 @@ public class DataSourceConfigServiceImplTest extends BaseDbUnitTest { ReflectUtil.setFieldValue(EncryptTypeHandler.class, "aes", aes); when(aes.encryptBase64(anyString())).then((Answer) invocation -> invocation.getArgument(0)); when(aes.decryptStr(anyString())).then((Answer) invocation -> invocation.getArgument(0)); + + // mock DynamicDataSourceProperties + when(dynamicDataSourceProperties.getPrimary()).thenReturn("primary"); + when(dynamicDataSourceProperties.getDatasource()).thenReturn(MapUtil.of("primary", + new DataSourceProperty().setUrl("http://localhost:3306").setUsername("yunai").setPassword("tudou"))); } @Test @@ -89,7 +96,6 @@ public class DataSourceConfigServiceImplTest extends BaseDbUnitTest { o.setId(dbDataSourceConfig.getId()); // 设置更新的 ID }); // mock 方法 -// when(stringEncryptor.encrypt(eq(reqVO.getPassword()))).thenReturn("123456"); databaseUtilsMock.when(() -> JdbcUtils.isConnectionOK(eq(reqVO.getUrl()), eq(reqVO.getUsername()), eq(reqVO.getPassword()))).thenReturn(true); @@ -142,7 +148,58 @@ public class DataSourceConfigServiceImplTest extends BaseDbUnitTest { // 调用 DataSourceConfigDO result = dataSourceConfigMapper.selectOne(DataSourceConfigDO::getPassword, EncryptTypeHandler.encrypt(dbDataSourceConfig.getPassword())); - System.out.println(result); + assertPojoEquals(dbDataSourceConfig, result); + } + + @Test + public void testGetDataSourceConfig_master() { + // 准备参数 + Long id = 0L; + // mock 方法 + + // 调用 + DataSourceConfigDO dataSourceConfig = dataSourceConfigService.getDataSourceConfig(id); + // 断言 + assertEquals(id, dataSourceConfig.getId()); + assertEquals("primary", dataSourceConfig.getName()); + assertEquals("http://localhost:3306", dataSourceConfig.getUrl()); + assertEquals("yunai", dataSourceConfig.getUsername()); + assertEquals("tudou", dataSourceConfig.getPassword()); + } + + @Test + public void testGetDataSourceConfig_normal() { + // mock 数据 + DataSourceConfigDO dbDataSourceConfig = randomPojo(DataSourceConfigDO.class); + dataSourceConfigMapper.insert(dbDataSourceConfig);// @Sql: 先插入出一条存在的数据 + // 准备参数 + Long id = dbDataSourceConfig.getId(); + + // 调用 + DataSourceConfigDO dataSourceConfig = dataSourceConfigService.getDataSourceConfig(id); + // 断言 + assertPojoEquals(dbDataSourceConfig, dataSourceConfig); + } + + @Test + public void testGetDataSourceConfigList() { + // mock 数据 + DataSourceConfigDO dbDataSourceConfig = randomPojo(DataSourceConfigDO.class); + dataSourceConfigMapper.insert(dbDataSourceConfig);// @Sql: 先插入出一条存在的数据 + // 准备参数 + + // 调用 + List dataSourceConfigList = dataSourceConfigService.getDataSourceConfigList(); + // 断言 + assertEquals(2, dataSourceConfigList.size()); + // master + assertEquals(0L, dataSourceConfigList.get(0).getId()); + assertEquals("primary", dataSourceConfigList.get(0).getName()); + assertEquals("http://localhost:3306", dataSourceConfigList.get(0).getUrl()); + assertEquals("yunai", dataSourceConfigList.get(0).getUsername()); + assertEquals("tudou", dataSourceConfigList.get(0).getPassword()); + // normal + assertPojoEquals(dbDataSourceConfig, dataSourceConfigList.get(1)); } } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/db/DatabaseTableServiceImplTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/db/DatabaseTableServiceImplTest.java new file mode 100644 index 000000000..6ce8c7d41 --- /dev/null +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/db/DatabaseTableServiceImplTest.java @@ -0,0 +1,89 @@ +package cn.iocoder.yudao.module.infra.service.db; + +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; +import cn.iocoder.yudao.module.infra.dal.dataobject.db.DataSourceConfigDO; +import com.baomidou.mybatisplus.generator.config.po.TableField; +import com.baomidou.mybatisplus.generator.config.po.TableInfo; +import com.baomidou.mybatisplus.generator.config.rules.DbColumnType; +import org.apache.ibatis.type.JdbcType; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.context.annotation.Import; + +import javax.annotation.Resource; +import java.util.List; + +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.when; + +@Import(DatabaseTableServiceImpl.class) +public class DatabaseTableServiceImplTest extends BaseDbUnitTest { + + @Resource + private DatabaseTableServiceImpl databaseTableService; + + @MockBean + private DataSourceConfigService dataSourceConfigService; + + @Test + public void testGetTableList() { + // 准备参数 + Long dataSourceConfigId = randomLongId(); + // mock 方法 + DataSourceConfigDO dataSourceConfig = new DataSourceConfigDO().setUsername("sa").setPassword("") + .setUrl("jdbc:h2:mem:testdb"); + when(dataSourceConfigService.getDataSourceConfig(eq(dataSourceConfigId))) + .thenReturn(dataSourceConfig); + + // 调用 + List tables = databaseTableService.getTableList(dataSourceConfigId, + "config", "参数"); + // 断言 + assertEquals(1, tables.size()); + assertTableInfo(tables.get(0)); + } + + @Test + public void testGetTable() { + // 准备参数 + Long dataSourceConfigId = randomLongId(); + // mock 方法 + DataSourceConfigDO dataSourceConfig = new DataSourceConfigDO().setUsername("sa").setPassword("") + .setUrl("jdbc:h2:mem:testdb"); + when(dataSourceConfigService.getDataSourceConfig(eq(dataSourceConfigId))) + .thenReturn(dataSourceConfig); + + // 调用 + TableInfo tableInfo = databaseTableService.getTable(dataSourceConfigId, "infra_config"); + // 断言 + assertTableInfo(tableInfo); + } + + private void assertTableInfo(TableInfo tableInfo) { + assertEquals("infra_config", tableInfo.getName()); + assertEquals("参数配置表", tableInfo.getComment()); + assertEquals(13, tableInfo.getFields().size()); + // id 字段 + TableField idField = tableInfo.getFields().get(0); + assertEquals("id", idField.getName()); + assertEquals(JdbcType.BIGINT, idField.getMetaInfo().getJdbcType()); + assertEquals("编号", idField.getComment()); + assertFalse(idField.getMetaInfo().isNullable()); + assertTrue(idField.isKeyFlag()); + assertTrue(idField.isKeyIdentityFlag()); + assertEquals(DbColumnType.LONG, idField.getColumnType()); + assertEquals("id", idField.getPropertyName()); + // name 字段 + TableField nameField = tableInfo.getFields().get(3); + assertEquals("name", nameField.getName()); + assertEquals(JdbcType.VARCHAR, nameField.getMetaInfo().getJdbcType()); + assertEquals("名字", nameField.getComment()); + assertFalse(nameField.getMetaInfo().isNullable()); + assertFalse(nameField.isKeyFlag()); + assertFalse(nameField.isKeyIdentityFlag()); + assertEquals(DbColumnType.STRING, nameField.getColumnType()); + assertEquals("name", nameField.getPropertyName()); + } +} diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImplTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImplTest.java index 61c9827f6..656955194 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImplTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImplTest.java @@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.file.core.client.FileClient; import cn.iocoder.yudao.framework.file.core.client.FileClientConfig; import cn.iocoder.yudao.framework.file.core.client.FileClientFactory; +import cn.iocoder.yudao.framework.file.core.client.local.LocalFileClient; import cn.iocoder.yudao.framework.file.core.client.local.LocalFileClientConfig; import cn.iocoder.yudao.framework.file.core.enums.FileStorageEnum; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; @@ -242,6 +243,30 @@ public class FileConfigServiceImplTest extends BaseDbUnitTest { assertEquals("https://www.iocoder.cn", fileConfigService.testFileConfig(id)); } + @Test + public void testGetFileConfig() { + // mock 数据 + FileConfigDO dbFileConfig = randomFileConfigDO().setMaster(false); + fileConfigMapper.insert(dbFileConfig);// @Sql: 先插入出一条存在的数据 + // 准备参数 + Long id = dbFileConfig.getId(); + + // 调用,并断言 + assertPojoEquals(dbFileConfig, fileConfigService.getFileConfig(id)); + } + + @Test + public void testGetFileClient() { + // 准备参数 + Long id = randomLongId(); + // mock 获得 Client + FileClient fileClient = new LocalFileClient(id, new LocalFileClientConfig()); + when(fileClientFactory.getFileClient(eq(id))).thenReturn(fileClient); + + // 调用,并断言 + assertSame(fileClient, fileConfigService.getFileClient(id)); + } + private FileConfigDO randomFileConfigDO() { return randomPojo(FileConfigDO.class).setStorage(randomEle(FileStorageEnum.values()).getStorage()) .setConfig(new EmptyFileClientConfig()); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImplTest.java similarity index 98% rename from yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceTest.java rename to yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImplTest.java index 90bde8f4e..57cc4c476 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImplTest.java @@ -26,7 +26,7 @@ import static org.mockito.ArgumentMatchers.same; import static org.mockito.Mockito.*; @Import({FileServiceImpl.class}) -public class FileServiceTest extends BaseDbUnitTest { +public class FileServiceImplTest extends BaseDbUnitTest { @Resource private FileService fileService; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/job/JobLogServiceTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/job/JobLogServiceImplTest.java similarity index 52% rename from yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/job/JobLogServiceTest.java rename to yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/job/JobLogServiceImplTest.java index 665e9c509..efba0c0cf 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/job/JobLogServiceTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/job/JobLogServiceImplTest.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.infra.service.job; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.JobLogExportReqVO; import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.JobLogPageReqVO; @@ -12,18 +11,20 @@ import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Import; import javax.annotation.Resource; -import java.util.ArrayList; +import java.time.LocalDateTime; +import java.util.Collection; import java.util.List; -import static cn.hutool.core.util.RandomUtil.randomEle; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; +import static java.util.Collections.singleton; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @Import(JobLogServiceImpl.class) -public class JobLogServiceTest extends BaseDbUnitTest { +public class JobLogServiceImplTest extends BaseDbUnitTest { @Resource private JobLogServiceImpl jobLogService; @@ -31,66 +32,103 @@ public class JobLogServiceTest extends BaseDbUnitTest { private JobLogMapper jobLogMapper; @Test - public void testCreateJobLog_success() { + public void testCreateJobLog() { // 准备参数 - JobLogDO reqVO = randomPojo(JobLogDO.class, o -> { - o.setExecuteIndex(1); - }); + JobLogDO reqVO = randomPojo(JobLogDO.class, o -> o.setExecuteIndex(1)); + // 调用 - Long jobLogId = jobLogService.createJobLog(reqVO.getJobId(), reqVO.getBeginTime(), reqVO.getHandlerName(), reqVO.getHandlerParam(), reqVO.getExecuteIndex()); + Long id = jobLogService.createJobLog(reqVO.getJobId(), reqVO.getBeginTime(), + reqVO.getHandlerName(), reqVO.getHandlerParam(), reqVO.getExecuteIndex()); // 断言 - assertNotNull(jobLogId); + assertNotNull(id); // 校验记录的属性是否正确 - JobLogDO job = jobLogMapper.selectById(jobLogId); + JobLogDO job = jobLogMapper.selectById(id); assertEquals(JobLogStatusEnum.RUNNING.getStatus(), job.getStatus()); } @Test public void testUpdateJobLogResultAsync_success() { - // 准备参数 - JobLogDO reqVO = randomPojo(JobLogDO.class, o -> { + // mock 数据 + JobLogDO log = randomPojo(JobLogDO.class, o -> { o.setExecuteIndex(1); + o.setStatus(JobLogStatusEnum.RUNNING.getStatus()); }); - JobLogDO log = JobLogDO.builder().jobId(reqVO.getJobId()).handlerName(reqVO.getHandlerName()).handlerParam(reqVO.getHandlerParam()).executeIndex(reqVO.getExecuteIndex()) - .beginTime(reqVO.getBeginTime()).status(JobLogStatusEnum.RUNNING.getStatus()).build(); jobLogMapper.insert(log); - // 调用 - jobLogService.updateJobLogResultAsync(log.getId(), reqVO.getBeginTime(), reqVO.getDuration(), true,reqVO.getResult()); - // 校验记录的属性是否正确 - JobLogDO job = jobLogMapper.selectById(log.getId()); - assertEquals(JobLogStatusEnum.SUCCESS.getStatus(), job.getStatus()); + // 准备参数 + Long logId = log.getId(); + LocalDateTime endTime = randomLocalDateTime(); + Integer duration = randomInteger(); + boolean success = true; + String result = randomString(); // 调用 - jobLogService.updateJobLogResultAsync(log.getId(), reqVO.getBeginTime(), reqVO.getDuration(), false,reqVO.getResult()); + jobLogService.updateJobLogResultAsync(logId, endTime, duration, success, result); // 校验记录的属性是否正确 - JobLogDO job2 = jobLogMapper.selectById(log.getId()); - assertEquals(JobLogStatusEnum.FAILURE.getStatus(), job2.getStatus()); + JobLogDO dbLog = jobLogMapper.selectById(log.getId()); + assertEquals(endTime, dbLog.getEndTime()); + assertEquals(duration, dbLog.getDuration()); + assertEquals(JobLogStatusEnum.SUCCESS.getStatus(), dbLog.getStatus()); + assertEquals(result, dbLog.getResult()); } @Test - public void testGetJobLogListByIds_success() { + public void testUpdateJobLogResultAsync_failure() { // mock 数据 - JobLogDO dbJobLog = randomPojo(JobLogDO.class, o -> { + JobLogDO log = randomPojo(JobLogDO.class, o -> { o.setExecuteIndex(1); - o.setStatus(randomEle(JobLogStatusEnum.values()).getStatus()); // 保证 status 的范围 + o.setStatus(JobLogStatusEnum.RUNNING.getStatus()); }); - JobLogDO cloneJobLog = ObjectUtils.cloneIgnoreId(dbJobLog, o -> o.setHandlerName(randomString())); + jobLogMapper.insert(log); + // 准备参数 + Long logId = log.getId(); + LocalDateTime endTime = randomLocalDateTime(); + Integer duration = randomInteger(); + boolean success = false; + String result = randomString(); + + // 调用 + jobLogService.updateJobLogResultAsync(logId, endTime, duration, success, result); + // 校验记录的属性是否正确 + JobLogDO dbLog = jobLogMapper.selectById(log.getId()); + assertEquals(endTime, dbLog.getEndTime()); + assertEquals(duration, dbLog.getDuration()); + assertEquals(JobLogStatusEnum.FAILURE.getStatus(), dbLog.getStatus()); + assertEquals(result, dbLog.getResult()); + } + + @Test + public void testGetJobLog() { + // mock 数据 + JobLogDO dbJobLog = randomPojo(JobLogDO.class, o -> o.setExecuteIndex(1)); + jobLogMapper.insert(dbJobLog); + // 准备参数 + Long id = dbJobLog.getId(); + + // 调用 + JobLogDO jobLog = jobLogService.getJobLog(id); + // 断言 + assertPojoEquals(dbJobLog, jobLog); + } + + @Test + public void testGetJobLogList() { + // mock 数据 + JobLogDO dbJobLog = randomPojo(JobLogDO.class, o -> o.setExecuteIndex(1)); jobLogMapper.insert(dbJobLog); // 测试 handlerName 不匹配 - jobLogMapper.insert(cloneJobLog); + jobLogMapper.insert(cloneIgnoreId(dbJobLog, o -> {})); // 准备参数 - ArrayList ids = new ArrayList<>(); - ids.add(dbJobLog.getId()); - ids.add(cloneJobLog.getId()); + Collection ids = singleton(dbJobLog.getId()); + // 调用 List list = jobLogService.getJobLogList(ids); // 断言 - assertEquals(2, list.size()); + assertEquals(1, list.size()); assertPojoEquals(dbJobLog, list.get(0)); } @Test - public void testGetJobPage_success() { + public void testGetJobPage() { // mock 数据 JobLogDO dbJobLog = randomPojo(JobLogDO.class, o -> { o.setExecuteIndex(1); @@ -101,15 +139,15 @@ public class JobLogServiceTest extends BaseDbUnitTest { }); jobLogMapper.insert(dbJobLog); // 测试 jobId 不匹配 - jobLogMapper.insert(ObjectUtils.cloneIgnoreId(dbJobLog, o -> o.setJobId(randomLongId()))); + jobLogMapper.insert(cloneIgnoreId(dbJobLog, o -> o.setJobId(randomLongId()))); // 测试 handlerName 不匹配 - jobLogMapper.insert(ObjectUtils.cloneIgnoreId(dbJobLog, o -> o.setHandlerName(randomString()))); + jobLogMapper.insert(cloneIgnoreId(dbJobLog, o -> o.setHandlerName(randomString()))); // 测试 beginTime 不匹配 - jobLogMapper.insert(ObjectUtils.cloneIgnoreId(dbJobLog, o -> o.setBeginTime(buildTime(2021, 1, 7)))); + jobLogMapper.insert(cloneIgnoreId(dbJobLog, o -> o.setBeginTime(buildTime(2021, 1, 7)))); // 测试 endTime 不匹配 - jobLogMapper.insert(ObjectUtils.cloneIgnoreId(dbJobLog, o -> o.setEndTime(buildTime(2021, 1, 9)))); + jobLogMapper.insert(cloneIgnoreId(dbJobLog, o -> o.setEndTime(buildTime(2021, 1, 9)))); // 测试 status 不匹配 - jobLogMapper.insert(ObjectUtils.cloneIgnoreId(dbJobLog, o -> o.setStatus(JobLogStatusEnum.FAILURE.getStatus()))); + jobLogMapper.insert(cloneIgnoreId(dbJobLog, o -> o.setStatus(JobLogStatusEnum.FAILURE.getStatus()))); // 准备参数 JobLogPageReqVO reqVo = new JobLogPageReqVO(); reqVo.setJobId(dbJobLog.getJobId()); @@ -117,6 +155,7 @@ public class JobLogServiceTest extends BaseDbUnitTest { reqVo.setBeginTime(dbJobLog.getBeginTime()); reqVo.setEndTime(dbJobLog.getEndTime()); reqVo.setStatus(JobLogStatusEnum.SUCCESS.getStatus()); + // 调用 PageResult pageResult = jobLogService.getJobLogPage(reqVo); // 断言 @@ -126,7 +165,7 @@ public class JobLogServiceTest extends BaseDbUnitTest { } @Test - public void testGetJobListForExport_success() { + public void testGetJobList_export() { // mock 数据 JobLogDO dbJobLog = randomPojo(JobLogDO.class, o -> { o.setExecuteIndex(1); @@ -137,15 +176,15 @@ public class JobLogServiceTest extends BaseDbUnitTest { }); jobLogMapper.insert(dbJobLog); // 测试 jobId 不匹配 - jobLogMapper.insert(ObjectUtils.cloneIgnoreId(dbJobLog, o -> o.setJobId(randomLongId()))); + jobLogMapper.insert(cloneIgnoreId(dbJobLog, o -> o.setJobId(randomLongId()))); // 测试 handlerName 不匹配 - jobLogMapper.insert(ObjectUtils.cloneIgnoreId(dbJobLog, o -> o.setHandlerName(randomString()))); + jobLogMapper.insert(cloneIgnoreId(dbJobLog, o -> o.setHandlerName(randomString()))); // 测试 beginTime 不匹配 - jobLogMapper.insert(ObjectUtils.cloneIgnoreId(dbJobLog, o -> o.setBeginTime(buildTime(2021, 1, 7)))); + jobLogMapper.insert(cloneIgnoreId(dbJobLog, o -> o.setBeginTime(buildTime(2021, 1, 7)))); // 测试 endTime 不匹配 - jobLogMapper.insert(ObjectUtils.cloneIgnoreId(dbJobLog, o -> o.setEndTime(buildTime(2021, 1, 9)))); + jobLogMapper.insert(cloneIgnoreId(dbJobLog, o -> o.setEndTime(buildTime(2021, 1, 9)))); // 测试 status 不匹配 - jobLogMapper.insert(ObjectUtils.cloneIgnoreId(dbJobLog, o -> o.setStatus(JobLogStatusEnum.FAILURE.getStatus()))); + jobLogMapper.insert(cloneIgnoreId(dbJobLog, o -> o.setStatus(JobLogStatusEnum.FAILURE.getStatus()))); // 准备参数 JobLogExportReqVO reqVo = new JobLogExportReqVO(); reqVo.setJobId(dbJobLog.getJobId()); @@ -153,6 +192,7 @@ public class JobLogServiceTest extends BaseDbUnitTest { reqVo.setBeginTime(dbJobLog.getBeginTime()); reqVo.setEndTime(dbJobLog.getEndTime()); reqVo.setStatus(JobLogStatusEnum.SUCCESS.getStatus()); + // 调用 List list = jobLogService.getJobLogList(reqVo); // 断言 diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/job/JobServiceTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/job/JobServiceImplTest.java similarity index 60% rename from yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/job/JobServiceTest.java rename to yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/job/JobServiceImplTest.java index 1cfcae998..f10c40365 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/job/JobServiceTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/job/JobServiceImplTest.java @@ -1,14 +1,12 @@ package cn.iocoder.yudao.module.infra.service.job; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import cn.iocoder.yudao.framework.quartz.core.scheduler.SchedulerManager; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.JobCreateReqVO; import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.JobExportReqVO; import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.JobPageReqVO; import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.JobUpdateReqVO; -import cn.iocoder.yudao.module.infra.convert.job.JobConvert; import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobDO; import cn.iocoder.yudao.module.infra.dal.mysql.job.JobMapper; import cn.iocoder.yudao.module.infra.enums.job.JobStatusEnum; @@ -18,22 +16,23 @@ import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import javax.annotation.Resource; -import java.util.ArrayList; +import java.util.Collection; import java.util.List; import static cn.hutool.core.util.RandomUtil.randomEle; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomString; import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.*; +import static java.util.Collections.singletonList; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @Import(JobServiceImpl.class) -public class JobServiceTest extends BaseDbUnitTest { +public class JobServiceImplTest extends BaseDbUnitTest { @Resource private JobServiceImpl jobService; @@ -46,6 +45,7 @@ public class JobServiceTest extends BaseDbUnitTest { public void testCreateJob_cronExpressionValid() { // 准备参数。Cron 表达式为 String 类型,默认随机字符串。 JobCreateReqVO reqVO = randomPojo(JobCreateReqVO.class); + // 调用,并断言异常 assertServiceException(() -> jobService.createJob(reqVO), JOB_CRON_EXPRESSION_VALID); } @@ -54,6 +54,7 @@ public class JobServiceTest extends BaseDbUnitTest { public void testCreateJob_jobHandlerExists() throws SchedulerException { // 准备参数 指定 Cron 表达式 JobCreateReqVO reqVO = randomPojo(JobCreateReqVO.class, o -> o.setCronExpression("0 0/1 * * * ? *")); + // 调用 jobService.createJob(reqVO); // 调用,并断言异常 @@ -64,6 +65,7 @@ public class JobServiceTest extends BaseDbUnitTest { public void testCreateJob_success() throws SchedulerException { // 准备参数 指定 Cron 表达式 JobCreateReqVO reqVO = randomPojo(JobCreateReqVO.class, o -> o.setCronExpression("0 0/1 * * * ? *")); + // 调用 Long jobId = jobService.createJob(reqVO); // 断言 @@ -73,14 +75,15 @@ public class JobServiceTest extends BaseDbUnitTest { assertPojoEquals(reqVO, job); assertEquals(JobStatusEnum.NORMAL.getStatus(), job.getStatus()); // 校验调用 - verify(schedulerManager, times(1)).addJob(eq(job.getId()), eq(job.getHandlerName()), eq(job.getHandlerParam()), eq(job.getCronExpression()), - eq(reqVO.getRetryCount()), eq(reqVO.getRetryInterval())); + verify(schedulerManager).addJob(eq(job.getId()), eq(job.getHandlerName()), eq(job.getHandlerParam()), + eq(job.getCronExpression()), eq(reqVO.getRetryCount()), eq(reqVO.getRetryInterval())); } @Test public void testUpdateJob_jobNotExists(){ // 准备参数 JobUpdateReqVO reqVO = randomPojo(JobUpdateReqVO.class, o -> o.setCronExpression("0 0/1 * * * ? *")); + // 调用,并断言异常 assertServiceException(() -> jobService.updateJob(reqVO), JOB_NOT_EXISTS); } @@ -88,150 +91,136 @@ public class JobServiceTest extends BaseDbUnitTest { @Test public void testUpdateJob_onlyNormalStatus(){ // mock 数据 - JobCreateReqVO createReqVO = randomPojo(JobCreateReqVO.class, o -> o.setCronExpression("0 0/1 * * * ? *")); - JobDO job = JobConvert.INSTANCE.convert(createReqVO); - job.setStatus(JobStatusEnum.INIT.getStatus()); - fillJobMonitorTimeoutEmpty(job); + JobDO job = randomPojo(JobDO.class, o -> o.setStatus(JobStatusEnum.INIT.getStatus())); jobMapper.insert(job); // 准备参数 JobUpdateReqVO updateReqVO = randomPojo(JobUpdateReqVO.class, o -> { o.setId(job.getId()); - o.setName(createReqVO.getName()); - o.setCronExpression(createReqVO.getCronExpression()); + o.setCronExpression("0 0/1 * * * ? *"); }); + // 调用,并断言异常 - assertServiceException(() -> jobService.updateJob(updateReqVO), JOB_UPDATE_ONLY_NORMAL_STATUS); + assertServiceException(() -> jobService.updateJob(updateReqVO), + JOB_UPDATE_ONLY_NORMAL_STATUS); } @Test public void testUpdateJob_success() throws SchedulerException { // mock 数据 - JobCreateReqVO createReqVO = randomPojo(JobCreateReqVO.class, o -> o.setCronExpression("0 0/1 * * * ? *")); - JobDO job = JobConvert.INSTANCE.convert(createReqVO); - job.setStatus(JobStatusEnum.NORMAL.getStatus()); - fillJobMonitorTimeoutEmpty(job); + JobDO job = randomPojo(JobDO.class, o -> o.setStatus(JobStatusEnum.NORMAL.getStatus())); jobMapper.insert(job); // 准备参数 JobUpdateReqVO updateReqVO = randomPojo(JobUpdateReqVO.class, o -> { o.setId(job.getId()); - o.setName(createReqVO.getName()); - o.setCronExpression(createReqVO.getCronExpression()); + o.setCronExpression("0 0/1 * * * ? *"); }); + // 调用 jobService.updateJob(updateReqVO); // 校验记录的属性是否正确 JobDO updateJob = jobMapper.selectById(updateReqVO.getId()); assertPojoEquals(updateReqVO, updateJob); // 校验调用 - verify(schedulerManager, times(1)).updateJob(eq(job.getHandlerName()), eq(updateReqVO.getHandlerParam()), eq(updateReqVO.getCronExpression()), - eq(updateReqVO.getRetryCount()), eq(updateReqVO.getRetryInterval())); + verify(schedulerManager).updateJob(eq(job.getHandlerName()), eq(updateReqVO.getHandlerParam()), + eq(updateReqVO.getCronExpression()), eq(updateReqVO.getRetryCount()), eq(updateReqVO.getRetryInterval())); } @Test public void testUpdateJobStatus_changeStatusInvalid() { // 调用,并断言异常 - assertServiceException(() -> jobService.updateJobStatus(1L, JobStatusEnum.INIT.getStatus()), JOB_CHANGE_STATUS_INVALID); + assertServiceException(() -> jobService.updateJobStatus(1L, JobStatusEnum.INIT.getStatus()), + JOB_CHANGE_STATUS_INVALID); } @Test public void testUpdateJobStatus_changeStatusEquals() { // mock 数据 - JobCreateReqVO createReqVO = randomPojo(JobCreateReqVO.class, o -> o.setCronExpression("0 0/1 * * * ? *")); - JobDO job = JobConvert.INSTANCE.convert(createReqVO); - job.setStatus(JobStatusEnum.NORMAL.getStatus()); - fillJobMonitorTimeoutEmpty(job); + JobDO job = randomPojo(JobDO.class, o -> o.setStatus(JobStatusEnum.NORMAL.getStatus())); jobMapper.insert(job); + // 调用,并断言异常 - assertServiceException(() -> jobService.updateJobStatus(job.getId(), job.getStatus()), JOB_CHANGE_STATUS_EQUALS); + assertServiceException(() -> jobService.updateJobStatus(job.getId(), job.getStatus()), + JOB_CHANGE_STATUS_EQUALS); } @Test - public void testUpdateJobStatus_NormalToStop_success() throws SchedulerException { + public void testUpdateJobStatus_stopSuccess() throws SchedulerException { // mock 数据 - JobCreateReqVO createReqVO = randomPojo(JobCreateReqVO.class, o -> o.setCronExpression("0 0/1 * * * ? *")); - JobDO job = JobConvert.INSTANCE.convert(createReqVO); - job.setStatus(JobStatusEnum.NORMAL.getStatus()); - fillJobMonitorTimeoutEmpty(job); + JobDO job = randomPojo(JobDO.class, o -> o.setStatus(JobStatusEnum.NORMAL.getStatus())); jobMapper.insert(job); + // 调用 jobService.updateJobStatus(job.getId(), JobStatusEnum.STOP.getStatus()); // 校验记录的属性是否正确 - JobDO updateJob = jobMapper.selectById(job.getId()); - assertEquals(JobStatusEnum.STOP.getStatus(), updateJob.getStatus()); + JobDO dbJob = jobMapper.selectById(job.getId()); + assertEquals(JobStatusEnum.STOP.getStatus(), dbJob.getStatus()); // 校验调用 - verify(schedulerManager, times(1)).pauseJob(eq(job.getHandlerName())); + verify(schedulerManager).pauseJob(eq(job.getHandlerName())); } @Test - public void testUpdateJobStatus_StopToNormal_success() throws SchedulerException { + public void testUpdateJobStatus_normalSuccess() throws SchedulerException { // mock 数据 - JobCreateReqVO createReqVO = randomPojo(JobCreateReqVO.class, o -> o.setCronExpression("0 0/1 * * * ? *")); - JobDO job = JobConvert.INSTANCE.convert(createReqVO); - job.setStatus(JobStatusEnum.STOP.getStatus()); - fillJobMonitorTimeoutEmpty(job); + JobDO job = randomPojo(JobDO.class, o -> o.setStatus(JobStatusEnum.STOP.getStatus())); jobMapper.insert(job); + // 调用 jobService.updateJobStatus(job.getId(), JobStatusEnum.NORMAL.getStatus()); // 校验记录的属性是否正确 - JobDO updateJob = jobMapper.selectById(job.getId()); - assertEquals(JobStatusEnum.NORMAL.getStatus(), updateJob.getStatus()); + JobDO dbJob = jobMapper.selectById(job.getId()); + assertEquals(JobStatusEnum.NORMAL.getStatus(), dbJob.getStatus()); // 校验调用 - verify(schedulerManager, times(1)).resumeJob(eq(job.getHandlerName())); + verify(schedulerManager).resumeJob(eq(job.getHandlerName())); } @Test public void testTriggerJob_success() throws SchedulerException { // mock 数据 - JobCreateReqVO createReqVO = randomPojo(JobCreateReqVO.class, o -> o.setCronExpression("0 0/1 * * * ? *")); - JobDO job = JobConvert.INSTANCE.convert(createReqVO); - job.setStatus(JobStatusEnum.NORMAL.getStatus()); - fillJobMonitorTimeoutEmpty(job); + JobDO job = randomPojo(JobDO.class); jobMapper.insert(job); + // 调用 jobService.triggerJob(job.getId()); // 校验调用 - verify(schedulerManager, times(1)).triggerJob(eq(job.getId()), eq(job.getHandlerName()), eq(job.getHandlerParam())); + verify(schedulerManager).triggerJob(eq(job.getId()), + eq(job.getHandlerName()), eq(job.getHandlerParam())); } @Test public void testDeleteJob_success() throws SchedulerException { // mock 数据 - JobCreateReqVO createReqVO = randomPojo(JobCreateReqVO.class, o -> o.setCronExpression("0 0/1 * * * ? *")); - JobDO job = JobConvert.INSTANCE.convert(createReqVO); - job.setStatus(JobStatusEnum.NORMAL.getStatus()); - fillJobMonitorTimeoutEmpty(job); + JobDO job = randomPojo(JobDO.class); jobMapper.insert(job); - // 调用 UPDATE inf_job SET deleted=1 WHERE id=? AND deleted=0 + + // 调用 jobService.deleteJob(job.getId()); - // 校验数据不存在了 WHERE id=? AND deleted=0 查询为空正常 + // 校验不存在 assertNull(jobMapper.selectById(job.getId())); // 校验调用 - verify(schedulerManager, times(1)).deleteJob(eq(job.getHandlerName())); + verify(schedulerManager).deleteJob(eq(job.getHandlerName())); } @Test - public void testGetJobListByIds_success() { + public void testGetJobList() { // mock 数据 JobDO dbJob = randomPojo(JobDO.class, o -> { o.setStatus(randomEle(JobStatusEnum.values()).getStatus()); // 保证 status 的范围 }); - JobDO cloneJob = ObjectUtils.cloneIgnoreId(dbJob, o -> o.setHandlerName(randomString())); jobMapper.insert(dbJob); - // 测试 handlerName 不匹配 - jobMapper.insert(cloneJob); + // 测试 id 不匹配 + jobMapper.insert(cloneIgnoreId(dbJob, o -> {})); + // 准备参数 - ArrayList ids = new ArrayList<>(); - ids.add(dbJob.getId()); - ids.add(cloneJob.getId()); + Collection ids = singletonList(dbJob.getId()); // 调用 List list = jobService.getJobList(ids); // 断言 - assertEquals(2, list.size()); + assertEquals(1, list.size()); assertPojoEquals(dbJob, list.get(0)); } @Test - public void testGetJobPage_success() { + public void testGetJobPage() { // mock 数据 JobDO dbJob = randomPojo(JobDO.class, o -> { o.setName("定时任务测试"); @@ -240,16 +229,17 @@ public class JobServiceTest extends BaseDbUnitTest { }); jobMapper.insert(dbJob); // 测试 name 不匹配 - jobMapper.insert(ObjectUtils.cloneIgnoreId(dbJob, o -> o.setName("土豆"))); + jobMapper.insert(cloneIgnoreId(dbJob, o -> o.setName("土豆"))); // 测试 status 不匹配 - jobMapper.insert(ObjectUtils.cloneIgnoreId(dbJob, o -> o.setStatus(JobStatusEnum.NORMAL.getStatus()))); + jobMapper.insert(cloneIgnoreId(dbJob, o -> o.setStatus(JobStatusEnum.NORMAL.getStatus()))); // 测试 handlerName 不匹配 - jobMapper.insert(ObjectUtils.cloneIgnoreId(dbJob, o -> o.setHandlerName(randomString()))); + jobMapper.insert(cloneIgnoreId(dbJob, o -> o.setHandlerName(randomString()))); // 准备参数 JobPageReqVO reqVo = new JobPageReqVO(); reqVo.setName("定时"); reqVo.setStatus(JobStatusEnum.INIT.getStatus()); reqVo.setHandlerName("单元"); + // 调用 PageResult pageResult = jobService.getJobPage(reqVo); // 断言 @@ -259,7 +249,7 @@ public class JobServiceTest extends BaseDbUnitTest { } @Test - public void testGetJobListForExport_success() { + public void testGetJobList_export() { // mock 数据 JobDO dbJob = randomPojo(JobDO.class, o -> { o.setName("定时任务测试"); @@ -268,16 +258,17 @@ public class JobServiceTest extends BaseDbUnitTest { }); jobMapper.insert(dbJob); // 测试 name 不匹配 - jobMapper.insert(ObjectUtils.cloneIgnoreId(dbJob, o -> o.setName("土豆"))); + jobMapper.insert(cloneIgnoreId(dbJob, o -> o.setName("土豆"))); // 测试 status 不匹配 - jobMapper.insert(ObjectUtils.cloneIgnoreId(dbJob, o -> o.setStatus(JobStatusEnum.NORMAL.getStatus()))); + jobMapper.insert(cloneIgnoreId(dbJob, o -> o.setStatus(JobStatusEnum.NORMAL.getStatus()))); // 测试 handlerName 不匹配 - jobMapper.insert(ObjectUtils.cloneIgnoreId(dbJob, o -> o.setHandlerName(randomString()))); + jobMapper.insert(cloneIgnoreId(dbJob, o -> o.setHandlerName(randomString()))); // 准备参数 JobExportReqVO reqVo = new JobExportReqVO(); reqVo.setName("定时"); reqVo.setStatus(JobStatusEnum.INIT.getStatus()); reqVo.setHandlerName("单元"); + // 调用 List list = jobService.getJobList(reqVo); // 断言 @@ -285,10 +276,15 @@ public class JobServiceTest extends BaseDbUnitTest { assertPojoEquals(dbJob, list.get(0)); } - private static void fillJobMonitorTimeoutEmpty(JobDO job) { - if (job.getMonitorTimeout() == null) { - job.setMonitorTimeout(0); - } + @Test + public void testGetJob() { + // mock 数据 + JobDO dbJob = randomPojo(JobDO.class); + jobMapper.insert(dbJob); + // 调用 + JobDO job = jobService.getJob(dbJob.getId()); + // 断言 + assertPojoEquals(dbJob, job); } } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImplTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImplTest.java index b650fb603..8ff2dd9bf 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImplTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImplTest.java @@ -1,12 +1,9 @@ package cn.iocoder.yudao.module.infra.service.logger; -import cn.hutool.core.util.RandomUtil; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; -import cn.iocoder.yudao.framework.test.core.util.RandomUtils; import cn.iocoder.yudao.module.infra.api.logger.dto.ApiAccessLogCreateReqDTO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogExportReqVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog.ApiAccessLogPageReqVO; @@ -16,149 +13,121 @@ import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Import; import javax.annotation.Resource; -import java.time.LocalDateTime; import java.util.List; +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; @Import(ApiAccessLogServiceImpl.class) public class ApiAccessLogServiceImplTest extends BaseDbUnitTest { @Resource - private ApiAccessLogService apiAccessLogService; + private ApiAccessLogServiceImpl apiAccessLogService; @Resource private ApiAccessLogMapper apiAccessLogMapper; @Test public void testGetApiAccessLogPage() { - // 构造测试数据 - long userId = 2233L; - int userType = UserTypeEnum.ADMIN.getValue(); - String applicationName = "yudao-test"; - String requestUrl = "foo"; - LocalDateTime beginTime = buildTime(2021, 3, 13); - int duration = 1000; - int resultCode = GlobalErrorCodeConstants.SUCCESS.getCode(); - - ApiAccessLogDO infApiAccessLogDO = RandomUtils.randomPojo(ApiAccessLogDO.class, dto -> { - dto.setUserId(userId); - dto.setUserType(userType); - dto.setApplicationName(applicationName); - dto.setRequestUrl(requestUrl); - dto.setBeginTime(beginTime); - dto.setDuration(duration); - dto.setResultCode(resultCode); + ApiAccessLogDO apiAccessLogDO = randomPojo(ApiAccessLogDO.class, o -> { + o.setUserId(2233L); + o.setUserType(UserTypeEnum.ADMIN.getValue()); + o.setApplicationName("yudao-test"); + o.setRequestUrl("foo"); + o.setBeginTime(buildTime(2021, 3, 13)); + o.setDuration(1000); + o.setResultCode(GlobalErrorCodeConstants.SUCCESS.getCode()); }); - apiAccessLogMapper.insert(infApiAccessLogDO); - - // 下面几个都是不匹配的数据 - // userId 不同的 - apiAccessLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiAccessLogDO, logDO -> logDO.setUserId(3344L))); - // userType - apiAccessLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiAccessLogDO, logDO -> logDO.setUserType(UserTypeEnum.MEMBER.getValue()))); - // applicationName 不同的 - apiAccessLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiAccessLogDO, logDO -> logDO.setApplicationName("test"))); - // requestUrl 不同的 - apiAccessLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiAccessLogDO, logDO -> logDO.setRequestUrl("bar"))); - // 构造一个早期时间 2021-02-06 00:00:00 - apiAccessLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiAccessLogDO, logDO -> logDO.setBeginTime(buildTime(2021, 2, 6)))); - // duration 不同的 - apiAccessLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiAccessLogDO, logDO -> logDO.setDuration(100))); - // resultCode 不同的 - apiAccessLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiAccessLogDO, logDO -> logDO.setResultCode(2))); - - // 构造调用参数 + apiAccessLogMapper.insert(apiAccessLogDO); + // 测试 userId 不匹配 + apiAccessLogMapper.insert(cloneIgnoreId(apiAccessLogDO, o -> o.setUserId(3344L))); + // 测试 userType 不匹配 + apiAccessLogMapper.insert(cloneIgnoreId(apiAccessLogDO, o -> o.setUserType(UserTypeEnum.MEMBER.getValue()))); + // 测试 applicationName 不匹配 + apiAccessLogMapper.insert(cloneIgnoreId(apiAccessLogDO, o -> o.setApplicationName("test"))); + // 测试 requestUrl 不匹配 + apiAccessLogMapper.insert(cloneIgnoreId(apiAccessLogDO, o -> o.setRequestUrl("bar"))); + // 测试 beginTime 不匹配:构造一个早期时间 2021-02-06 00:00:00 + apiAccessLogMapper.insert(cloneIgnoreId(apiAccessLogDO, o -> o.setBeginTime(buildTime(2021, 2, 6)))); + // 测试 duration 不匹配 + apiAccessLogMapper.insert(cloneIgnoreId(apiAccessLogDO, o -> o.setDuration(100))); + // 测试 resultCode 不匹配 + apiAccessLogMapper.insert(cloneIgnoreId(apiAccessLogDO, o -> o.setResultCode(2))); + // 准备参数 ApiAccessLogPageReqVO reqVO = new ApiAccessLogPageReqVO(); - reqVO.setUserId(userId); - reqVO.setUserType(userType); - reqVO.setApplicationName(applicationName); - reqVO.setRequestUrl(requestUrl); - reqVO.setBeginTime((new LocalDateTime[]{buildTime(2021, 3, 12),buildTime(2021, 3, 14)})); - reqVO.setDuration(duration); - reqVO.setResultCode(resultCode); + reqVO.setUserId(2233L); + reqVO.setUserType(UserTypeEnum.ADMIN.getValue()); + reqVO.setApplicationName("yudao-test"); + reqVO.setRequestUrl("foo"); + reqVO.setBeginTime(buildBetweenTime(2021, 3, 13, 2021, 3, 13)); + reqVO.setDuration(1000); + reqVO.setResultCode(GlobalErrorCodeConstants.SUCCESS.getCode()); - // 调用service方法 + // 调用 PageResult pageResult = apiAccessLogService.getApiAccessLogPage(reqVO); - // 断言,只查到了一条符合条件的 assertEquals(1, pageResult.getTotal()); assertEquals(1, pageResult.getList().size()); - assertPojoEquals(infApiAccessLogDO, pageResult.getList().get(0)); + assertPojoEquals(apiAccessLogDO, pageResult.getList().get(0)); } @Test public void testGetApiAccessLogList() { - // 构造测试数据 - long userId = 2233L; - int userType = UserTypeEnum.ADMIN.getValue(); - String applicationName = "yudao-test"; - String requestUrl = "foo"; - LocalDateTime beginTime = buildTime(2021, 3, 13); - int duration = 1000; - int resultCode = GlobalErrorCodeConstants.SUCCESS.getCode(); - - ApiAccessLogDO infApiAccessLogDO = RandomUtils.randomPojo(ApiAccessLogDO.class, dto -> { - dto.setUserId(userId); - dto.setUserType(userType); - dto.setApplicationName(applicationName); - dto.setRequestUrl(requestUrl); - dto.setBeginTime(beginTime); - dto.setDuration(duration); - dto.setResultCode(resultCode); + ApiAccessLogDO apiAccessLogDO = randomPojo(ApiAccessLogDO.class, o -> { + o.setUserId(2233L); + o.setUserType(UserTypeEnum.ADMIN.getValue()); + o.setApplicationName("yudao-test"); + o.setRequestUrl("foo"); + o.setBeginTime(buildTime(2021, 3, 13)); + o.setDuration(1000); + o.setResultCode(GlobalErrorCodeConstants.SUCCESS.getCode()); }); - apiAccessLogMapper.insert(infApiAccessLogDO); - - // 下面几个都是不匹配的数据 - // userId 不同的 - apiAccessLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiAccessLogDO, logDO -> logDO.setUserId(3344L))); - // userType - apiAccessLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiAccessLogDO, logDO -> logDO.setUserType(UserTypeEnum.MEMBER.getValue()))); - // applicationName 不同的 - apiAccessLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiAccessLogDO, logDO -> logDO.setApplicationName("test"))); - // requestUrl 不同的 - apiAccessLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiAccessLogDO, logDO -> logDO.setRequestUrl("bar"))); - // 构造一个早期时间 2021-02-06 00:00:00 - apiAccessLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiAccessLogDO, logDO -> logDO.setBeginTime(buildTime(2021, 2, 6)))); - // duration 不同的 - apiAccessLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiAccessLogDO, logDO -> logDO.setDuration(100))); - // resultCode 不同的 - apiAccessLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiAccessLogDO, logDO -> logDO.setResultCode(2))); - - // 构造调用参数 + apiAccessLogMapper.insert(apiAccessLogDO); + // 测试 userId 不匹配 + apiAccessLogMapper.insert(cloneIgnoreId(apiAccessLogDO, o -> o.setUserId(3344L))); + // 测试 userType 不匹配 + apiAccessLogMapper.insert(cloneIgnoreId(apiAccessLogDO, o -> o.setUserType(UserTypeEnum.MEMBER.getValue()))); + // 测试 applicationName 不匹配 + apiAccessLogMapper.insert(cloneIgnoreId(apiAccessLogDO, o -> o.setApplicationName("test"))); + // 测试 requestUrl 不匹配 + apiAccessLogMapper.insert(cloneIgnoreId(apiAccessLogDO, o -> o.setRequestUrl("bar"))); + // 测试 beginTime 不匹配:构造一个早期时间 2021-02-06 00:00:00 + apiAccessLogMapper.insert(cloneIgnoreId(apiAccessLogDO, o -> o.setBeginTime(buildTime(2021, 2, 6)))); + // 测试 duration 不匹配 + apiAccessLogMapper.insert(cloneIgnoreId(apiAccessLogDO, o -> o.setDuration(100))); + // 测试 resultCode 不匹配 + apiAccessLogMapper.insert(cloneIgnoreId(apiAccessLogDO, o -> o.setResultCode(2))); + // 准备参数 ApiAccessLogExportReqVO reqVO = new ApiAccessLogExportReqVO(); - reqVO.setUserId(userId); - reqVO.setUserType(userType); - reqVO.setApplicationName(applicationName); - reqVO.setRequestUrl(requestUrl); - reqVO.setBeginTime((new LocalDateTime[]{buildTime(2021, 3, 12),buildTime(2021, 3, 14)})); - reqVO.setDuration(duration); - reqVO.setResultCode(resultCode); + reqVO.setUserId(2233L); + reqVO.setUserType(UserTypeEnum.ADMIN.getValue()); + reqVO.setApplicationName("yudao-test"); + reqVO.setRequestUrl("foo"); + reqVO.setBeginTime(buildBetweenTime(2021, 3, 13, 2021, 3, 13)); + reqVO.setDuration(1000); + reqVO.setResultCode(GlobalErrorCodeConstants.SUCCESS.getCode()); - // 调用service方法 + // 调用 List list = apiAccessLogService.getApiAccessLogList(reqVO); - // 断言,只查到了一条符合条件的 assertEquals(1, list.size()); - assertPojoEquals(infApiAccessLogDO, list.get(0)); + assertPojoEquals(apiAccessLogDO, list.get(0)); } @Test - public void testCreateApiAccessLogAsync() { + public void testCreateApiAccessLog() { // 准备参数 - ApiAccessLogCreateReqDTO createDTO = RandomUtils.randomPojo(ApiAccessLogCreateReqDTO.class, - dto -> dto.setUserType(RandomUtil.randomEle(UserTypeEnum.values()).getValue())); + ApiAccessLogCreateReqDTO createDTO = randomPojo(ApiAccessLogCreateReqDTO.class); // 调用 apiAccessLogService.createApiAccessLog(createDTO); // 断言 - ApiAccessLogDO infApiAccessLogDO = apiAccessLogMapper.selectOne(null); - assertNotNull(infApiAccessLogDO); - assertPojoEquals(createDTO, infApiAccessLogDO); + ApiAccessLogDO apiAccessLogDO = apiAccessLogMapper.selectOne(null); + assertPojoEquals(createDTO, apiAccessLogDO); } - } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImplTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImplTest.java index 4e35ba7ea..86e55f5d1 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImplTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImplTest.java @@ -1,28 +1,28 @@ package cn.iocoder.yudao.module.infra.service.logger; -import cn.hutool.core.util.RandomUtil; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; -import cn.iocoder.yudao.framework.test.core.util.RandomUtils; import cn.iocoder.yudao.module.infra.api.logger.dto.ApiErrorLogCreateReqDTO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogExportReqVO; import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogPageReqVO; import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiErrorLogDO; import cn.iocoder.yudao.module.infra.dal.mysql.logger.ApiErrorLogMapper; import cn.iocoder.yudao.module.infra.enums.logger.ApiErrorLogProcessStatusEnum; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Import; import javax.annotation.Resource; -import java.time.LocalDateTime; import java.util.List; +import static cn.hutool.core.util.RandomUtil.randomEle; +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.API_ERROR_LOG_NOT_FOUND; import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.API_ERROR_LOG_PROCESSED; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -35,161 +35,150 @@ public class ApiErrorLogServiceImplTest extends BaseDbUnitTest { private ApiErrorLogServiceImpl apiErrorLogService; @Resource - private ApiErrorLogMapper infApiErrorLogMapper; + private ApiErrorLogMapper apiErrorLogMapper; @Test public void testGetApiErrorLogPage() { - // 构造测试数据 - long userId = 2233L; - int userType = UserTypeEnum.ADMIN.getValue(); - String applicationName = "yudao-test"; - String requestUrl = "foo"; - LocalDateTime beginTime = buildTime(2021, 3, 13); - int progressStatus = ApiErrorLogProcessStatusEnum.INIT.getStatus(); - - ApiErrorLogDO infApiErrorLogDO = RandomUtils.randomPojo(ApiErrorLogDO.class, logDO -> { - logDO.setUserId(userId); - logDO.setUserType(userType); - logDO.setApplicationName(applicationName); - logDO.setRequestUrl(requestUrl); - logDO.setExceptionTime(beginTime); - logDO.setProcessStatus(progressStatus); + // mock 数据 + ApiErrorLogDO apiErrorLogDO = randomPojo(ApiErrorLogDO.class, o -> { + o.setUserId(2233L); + o.setUserType(UserTypeEnum.ADMIN.getValue()); + o.setApplicationName("yudao-test"); + o.setRequestUrl("foo"); + o.setExceptionTime(buildTime(2021, 3, 13)); + o.setProcessStatus(ApiErrorLogProcessStatusEnum.INIT.getStatus()); }); - infApiErrorLogMapper.insert(infApiErrorLogDO); - - // 下面几个都是不匹配的数据 - // userId 不同的 - infApiErrorLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiErrorLogDO, logDO -> logDO.setUserId(3344L))); - // userType - infApiErrorLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiErrorLogDO, logDO -> logDO.setUserType(UserTypeEnum.MEMBER.getValue()))); - // applicationName 不同的 - infApiErrorLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiErrorLogDO, logDO -> logDO.setApplicationName("test"))); - // requestUrl 不同的 - infApiErrorLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiErrorLogDO, logDO -> logDO.setRequestUrl("bar"))); - // 构造一个早期时间 2021-02-06 00:00:00 - infApiErrorLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiErrorLogDO, logDO -> logDO.setExceptionTime(buildTime(2021, 2, 6)))); - // progressStatus 不同的 - infApiErrorLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiErrorLogDO, logDO -> logDO.setProcessStatus(ApiErrorLogProcessStatusEnum.DONE.getStatus()))); - - // 构造调用参数 + apiErrorLogMapper.insert(apiErrorLogDO); + // 测试 userId 不匹配 + apiErrorLogMapper.insert(cloneIgnoreId(apiErrorLogDO, o -> o.setUserId(3344L))); + // 测试 userType 不匹配 + apiErrorLogMapper.insert(cloneIgnoreId(apiErrorLogDO, logDO -> logDO.setUserType(UserTypeEnum.MEMBER.getValue()))); + // 测试 applicationName 不匹配 + apiErrorLogMapper.insert(cloneIgnoreId(apiErrorLogDO, logDO -> logDO.setApplicationName("test"))); + // 测试 requestUrl 不匹配 + apiErrorLogMapper.insert(cloneIgnoreId(apiErrorLogDO, logDO -> logDO.setRequestUrl("bar"))); + // 测试 exceptionTime 不匹配:构造一个早期时间 2021-02-06 00:00:00 + apiErrorLogMapper.insert(cloneIgnoreId(apiErrorLogDO, logDO -> logDO.setExceptionTime(buildTime(2021, 2, 6)))); + // 测试 progressStatus 不匹配 + apiErrorLogMapper.insert(cloneIgnoreId(apiErrorLogDO, logDO -> logDO.setProcessStatus(ApiErrorLogProcessStatusEnum.DONE.getStatus()))); + // 准备参数 ApiErrorLogPageReqVO reqVO = new ApiErrorLogPageReqVO(); - reqVO.setUserId(userId); - reqVO.setUserType(userType); - reqVO.setApplicationName(applicationName); - reqVO.setRequestUrl(requestUrl); - reqVO.setExceptionTime((new LocalDateTime[]{buildTime(2021, 3, 12),buildTime(2021, 3, 14)})); - reqVO.setProcessStatus(progressStatus); + reqVO.setUserId(2233L); + reqVO.setUserType(UserTypeEnum.ADMIN.getValue()); + reqVO.setApplicationName("yudao-test"); + reqVO.setRequestUrl("foo"); + reqVO.setExceptionTime(buildBetweenTime(2021, 3, 1, 2021, 3, 31)); + reqVO.setProcessStatus(ApiErrorLogProcessStatusEnum.INIT.getStatus()); - // 调用service方法 + // 调用 PageResult pageResult = apiErrorLogService.getApiErrorLogPage(reqVO); - // 断言,只查到了一条符合条件的 assertEquals(1, pageResult.getTotal()); assertEquals(1, pageResult.getList().size()); - assertPojoEquals(infApiErrorLogDO, pageResult.getList().get(0)); + assertPojoEquals(apiErrorLogDO, pageResult.getList().get(0)); } @Test public void testGetApiErrorLogList() { - // 构造测试数据 - long userId = 2233L; - int userType = UserTypeEnum.ADMIN.getValue(); - String applicationName = "yudao-test"; - String requestUrl = "foo"; - LocalDateTime beginTime = buildTime(2021, 3, 13); - int progressStatus = ApiErrorLogProcessStatusEnum.INIT.getStatus(); - - ApiErrorLogDO infApiErrorLogDO = RandomUtils.randomPojo(ApiErrorLogDO.class, logDO -> { - logDO.setUserId(userId); - logDO.setUserType(userType); - logDO.setApplicationName(applicationName); - logDO.setRequestUrl(requestUrl); - logDO.setExceptionTime(beginTime); - logDO.setProcessStatus(progressStatus); + // mock 数据 + ApiErrorLogDO apiErrorLogDO = randomPojo(ApiErrorLogDO.class, o -> { + o.setUserId(2233L); + o.setUserType(UserTypeEnum.ADMIN.getValue()); + o.setApplicationName("yudao-test"); + o.setRequestUrl("foo"); + o.setExceptionTime(buildTime(2021, 3, 13)); + o.setProcessStatus(ApiErrorLogProcessStatusEnum.INIT.getStatus()); }); - infApiErrorLogMapper.insert(infApiErrorLogDO); - - // 下面几个都是不匹配的数据 - // userId 不同的 - infApiErrorLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiErrorLogDO, logDO -> logDO.setUserId(3344L))); - // userType - infApiErrorLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiErrorLogDO, logDO -> logDO.setUserType(UserTypeEnum.MEMBER.getValue()))); - // applicationName 不同的 - infApiErrorLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiErrorLogDO, logDO -> logDO.setApplicationName("test"))); - // requestUrl 不同的 - infApiErrorLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiErrorLogDO, logDO -> logDO.setRequestUrl("bar"))); - // 构造一个早期时间 2021-02-06 00:00:00 - infApiErrorLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiErrorLogDO, logDO -> logDO.setExceptionTime(buildTime(2021, 2, 6)))); - // progressStatus 不同的 - infApiErrorLogMapper.insert(ObjectUtils.cloneIgnoreId(infApiErrorLogDO, logDO -> logDO.setProcessStatus(ApiErrorLogProcessStatusEnum.DONE.getStatus()))); - - // 构造调用参数 + apiErrorLogMapper.insert(apiErrorLogDO); + // 测试 userId 不匹配 + apiErrorLogMapper.insert(cloneIgnoreId(apiErrorLogDO, o -> o.setUserId(3344L))); + // 测试 userType 不匹配 + apiErrorLogMapper.insert(cloneIgnoreId(apiErrorLogDO, logDO -> logDO.setUserType(UserTypeEnum.MEMBER.getValue()))); + // 测试 applicationName 不匹配 + apiErrorLogMapper.insert(cloneIgnoreId(apiErrorLogDO, logDO -> logDO.setApplicationName("test"))); + // 测试 requestUrl 不匹配 + apiErrorLogMapper.insert(cloneIgnoreId(apiErrorLogDO, logDO -> logDO.setRequestUrl("bar"))); + // 测试 exceptionTime 不匹配:构造一个早期时间 2021-02-06 00:00:00 + apiErrorLogMapper.insert(cloneIgnoreId(apiErrorLogDO, logDO -> logDO.setExceptionTime(buildTime(2021, 2, 6)))); + // 测试 progressStatus 不匹配 + apiErrorLogMapper.insert(cloneIgnoreId(apiErrorLogDO, logDO -> logDO.setProcessStatus(ApiErrorLogProcessStatusEnum.DONE.getStatus()))); + // 准备参数 ApiErrorLogExportReqVO reqVO = new ApiErrorLogExportReqVO(); - reqVO.setUserId(userId); - reqVO.setUserType(userType); - reqVO.setApplicationName(applicationName); - reqVO.setRequestUrl(requestUrl); - reqVO.setExceptionTime((new LocalDateTime[]{buildTime(2021, 3, 12),buildTime(2021, 3, 14)})); - reqVO.setProcessStatus(progressStatus); + reqVO.setUserId(2233L); + reqVO.setUserType(UserTypeEnum.ADMIN.getValue()); + reqVO.setApplicationName("yudao-test"); + reqVO.setRequestUrl("foo"); + reqVO.setExceptionTime(buildBetweenTime(2021, 3, 1, 2021, 3, 31)); + reqVO.setProcessStatus(ApiErrorLogProcessStatusEnum.INIT.getStatus()); - // 调用service方法 + // 调用 List list = apiErrorLogService.getApiErrorLogList(reqVO); - // 断言,只查到了一条符合条件的 assertEquals(1, list.size()); - assertPojoEquals(infApiErrorLogDO, list.get(0)); - } - - - // TODO 芋艿:单元测试,可以拆小一点 - @Test - public void testUpdateApiErrorLogProcess() { - // 先构造两条数据,第一条用于抛出异常,第二条用于正常的执行update操作 - Long processUserId = 2233L; - - ApiErrorLogDO first = RandomUtils.randomPojo(ApiErrorLogDO.class, logDO -> { - logDO.setProcessUserId(processUserId); - logDO.setUserType(UserTypeEnum.ADMIN.getValue()); - logDO.setProcessStatus(ApiErrorLogProcessStatusEnum.DONE.getStatus()); - }); - infApiErrorLogMapper.insert(first); - - ApiErrorLogDO second = RandomUtils.randomPojo(ApiErrorLogDO.class, logDO -> { - logDO.setProcessUserId(1122L); - logDO.setUserType(UserTypeEnum.ADMIN.getValue()); - logDO.setProcessStatus(ApiErrorLogProcessStatusEnum.INIT.getStatus()); - }); - infApiErrorLogMapper.insert(second); - - Long firstId = first.getId(); - Long secondId = second.getId(); - - // 执行正常的 update 操作 - apiErrorLogService.updateApiErrorLogProcess(secondId, ApiErrorLogProcessStatusEnum.DONE.getStatus(), processUserId); - ApiErrorLogDO secondSelect = infApiErrorLogMapper.selectOne("id", secondId); - - // id 为 0 查询不到,应该抛出异常 API_ERROR_LOG_NOT_FOUND - assertServiceException(() -> apiErrorLogService.updateApiErrorLogProcess(0L, ApiErrorLogProcessStatusEnum.DONE.getStatus(), processUserId), API_ERROR_LOG_NOT_FOUND); - // id 为 first 的 progressStatus 为 DONE ,应该抛出 API_ERROR_LOG_PROCESSED - assertServiceException(() -> apiErrorLogService.updateApiErrorLogProcess(firstId, ApiErrorLogProcessStatusEnum.DONE.getStatus(), processUserId), API_ERROR_LOG_PROCESSED); - // 验证 progressStatus 是否修改成功 - Assertions.assertEquals(ApiErrorLogProcessStatusEnum.DONE.getStatus(), secondSelect.getProcessStatus()); - // 验证 progressUserId 是否修改成功 - Assertions.assertEquals(processUserId, secondSelect.getProcessUserId()); + assertPojoEquals(apiErrorLogDO, list.get(0)); } @Test - public void testCreateApiErrorLogAsync() { + public void testCreateApiErrorLog() { // 准备参数 - ApiErrorLogCreateReqDTO createDTO = RandomUtils.randomPojo(ApiErrorLogCreateReqDTO.class, - dto -> dto.setUserType(RandomUtil.randomEle(UserTypeEnum.values()).getValue())); + ApiErrorLogCreateReqDTO createDTO = randomPojo(ApiErrorLogCreateReqDTO.class); // 调用 apiErrorLogService.createApiErrorLog(createDTO); // 断言 - ApiErrorLogDO infApiErrorLogDO = infApiErrorLogMapper.selectOne(null); - assertNotNull(infApiErrorLogDO); - assertPojoEquals(createDTO, infApiErrorLogDO); + ApiErrorLogDO apiErrorLogDO = apiErrorLogMapper.selectOne(null); + assertPojoEquals(createDTO, apiErrorLogDO); + assertEquals(ApiErrorLogProcessStatusEnum.INIT.getStatus(), apiErrorLogDO.getProcessStatus()); + } + + @Test + public void testUpdateApiErrorLogProcess_success() { + // 准备参数 + ApiErrorLogDO apiErrorLogDO = randomPojo(ApiErrorLogDO.class, + o -> o.setProcessStatus(ApiErrorLogProcessStatusEnum.INIT.getStatus())); + apiErrorLogMapper.insert(apiErrorLogDO); + // 准备参数 + Long id = apiErrorLogDO.getId(); + Integer processStatus = randomEle(ApiErrorLogProcessStatusEnum.values()).getStatus(); + Long processUserId = randomLongId(); + + // 调用 + apiErrorLogService.updateApiErrorLogProcess(id, processStatus, processUserId); + // 断言 + ApiErrorLogDO dbApiErrorLogDO = apiErrorLogMapper.selectById(apiErrorLogDO.getId()); + assertEquals(processStatus, dbApiErrorLogDO.getProcessStatus()); + assertEquals(processUserId, dbApiErrorLogDO.getProcessUserId()); + assertNotNull(dbApiErrorLogDO.getProcessTime()); + } + + @Test + public void testUpdateApiErrorLogProcess_processed() { + // 准备参数 + ApiErrorLogDO apiErrorLogDO = randomPojo(ApiErrorLogDO.class, + o -> o.setProcessStatus(ApiErrorLogProcessStatusEnum.DONE.getStatus())); + apiErrorLogMapper.insert(apiErrorLogDO); + // 准备参数 + Long id = apiErrorLogDO.getId(); + Integer processStatus = randomEle(ApiErrorLogProcessStatusEnum.values()).getStatus(); + Long processUserId = randomLongId(); + + // 调用,并断言异常 + assertServiceException(() -> + apiErrorLogService.updateApiErrorLogProcess(id, processStatus, processUserId), + API_ERROR_LOG_PROCESSED); + } + + @Test + public void testUpdateApiErrorLogProcess_notFound() { + // 准备参数 + Long id = randomLongId(); + Integer processStatus = randomEle(ApiErrorLogProcessStatusEnum.values()).getStatus(); + Long processUserId = randomLongId(); + + // 调用,并断言异常 + assertServiceException(() -> + apiErrorLogService.updateApiErrorLogProcess(id, processStatus, processUserId), + API_ERROR_LOG_NOT_FOUND); } } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/clean.sql b/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/clean.sql index eb05d3d5a..3dc20f7ba 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/clean.sql +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/clean.sql @@ -1,12 +1,10 @@ DELETE FROM "infra_config"; +DELETE FROM "infra_file_config"; DELETE FROM "infra_file"; DELETE FROM "infra_job"; DELETE FROM "infra_job_log"; DELETE FROM "infra_api_access_log"; DELETE FROM "infra_api_error_log"; -DELETE FROM "infra_api_access_log"; -DELETE FROM "infra_file"; -DELETE FROM "infra_api_error_log"; -DELETE FROM "infra_test_demo"; DELETE FROM "infra_file_config"; +DELETE FROM "infra_test_demo"; DELETE FROM "infra_data_source_config"; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/create_tables.sql b/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/create_tables.sql index 5825e0fef..e076ca895 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/create_tables.sql +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/create_tables.sql @@ -1,9 +1,9 @@ CREATE TABLE IF NOT EXISTS "infra_config" ( - "id" bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "id" bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY COMMENT '编号', "category" varchar(50) NOT NULL, "type" tinyint NOT NULL, - "name" varchar(100) NOT NULL DEFAULT '', + "name" varchar(100) NOT NULL DEFAULT '' COMMENT '名字', "config_key" varchar(100) NOT NULL DEFAULT '', "value" varchar(500) NOT NULL DEFAULT '', "visible" bit NOT NULL, @@ -85,19 +85,6 @@ CREATE TABLE IF NOT EXISTS "infra_job_log" ( PRIMARY KEY ("id") )COMMENT='定时任务日志表'; -CREATE TABLE IF NOT EXISTS "inf_file" ( - "id" varchar(188) NOT NULL, - "type" varchar(63) DEFAULT NULL, - "content" blob NOT NULL, - "creator" varchar(64) DEFAULT '', - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar(64) DEFAULT '', - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, - "tenant_id" bigint not null default '0', - PRIMARY KEY ("id") - ) COMMENT '文件表'; - CREATE TABLE IF NOT EXISTS "infra_api_access_log" ( "id" bigint not null GENERATED BY DEFAULT AS IDENTITY, "trace_id" varchar(64) not null default '', diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/ProductBrandController.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/ProductBrandController.java index 2227afeaf..0e6f7f3bc 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/ProductBrandController.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/ProductBrandController.java @@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.product.controller.admin.brand.vo.*; import cn.iocoder.yudao.module.product.convert.brand.ProductBrandConvert; import cn.iocoder.yudao.module.product.dal.dataobject.brand.ProductBrandDO; import cn.iocoder.yudao.module.product.service.brand.ProductBrandService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -20,7 +20,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 商品品牌") +@Tag(name = "管理后台 - 商品品牌") @RestController @RequestMapping("/product/brand") @Validated @@ -30,14 +30,14 @@ public class ProductBrandController { private ProductBrandService brandService; @PostMapping("/create") - @ApiOperation("创建品牌") + @Operation(summary = "创建品牌") @PreAuthorize("@ss.hasPermission('product:brand:create')") public CommonResult createBrand(@Valid @RequestBody ProductBrandCreateReqVO createReqVO) { return success(brandService.createBrand(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新品牌") + @Operation(summary = "更新品牌") @PreAuthorize("@ss.hasPermission('product:brand:update')") public CommonResult updateBrand(@Valid @RequestBody ProductBrandUpdateReqVO updateReqVO) { brandService.updateBrand(updateReqVO); @@ -45,8 +45,8 @@ public class ProductBrandController { } @DeleteMapping("/delete") - @ApiOperation("删除品牌") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除品牌") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('product:brand:delete')") public CommonResult deleteBrand(@RequestParam("id") Long id) { brandService.deleteBrand(id); @@ -54,8 +54,8 @@ public class ProductBrandController { } @GetMapping("/get") - @ApiOperation("获得品牌") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得品牌") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('product:brand:query')") public CommonResult getBrand(@RequestParam("id") Long id) { ProductBrandDO brand = brandService.getBrand(id); @@ -63,7 +63,7 @@ public class ProductBrandController { } @GetMapping("/page") - @ApiOperation("获得品牌分页") + @Operation(summary = "获得品牌分页") @PreAuthorize("@ss.hasPermission('product:brand:query')") public CommonResult> getBrandPage(@Valid ProductBrandPageReqVO pageVO) { PageResult pageResult = brandService.getBrandPage(pageVO); @@ -71,7 +71,7 @@ public class ProductBrandController { } @GetMapping("/list") - @ApiOperation("获得品牌列表") + @Operation(summary = "获得品牌列表") @PreAuthorize("@ss.hasPermission('product:brand:query')") public CommonResult> getBrandList(@Valid ProductBrandListReqVO listVO) { List list = brandService.getBrandList(listVO); diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandBaseVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandBaseVO.java index fa5ecd2d1..e8561fe07 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandBaseVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.product.controller.admin.brand.vo; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; @@ -12,22 +12,22 @@ import javax.validation.constraints.NotNull; @Data public class ProductBrandBaseVO { - @ApiModelProperty(value = "品牌名称", required = true, example = "芋道") + @Schema(description = "品牌名称", required = true, example = "芋道") @NotNull(message = "品牌名称不能为空") private String name; - @ApiModelProperty(value = "品牌图片", required = true) + @Schema(description = "品牌图片", required = true) @NotNull(message = "品牌图片不能为空") private String picUrl; - @ApiModelProperty(value = "品牌排序", required = true, example = "1") + @Schema(description = "品牌排序", required = true, example = "1") @NotNull(message = "品牌排序不能为空") private Integer sort; - @ApiModelProperty(value = "品牌描述", example = "描述") + @Schema(description = "品牌描述", example = "描述") private String description; - @ApiModelProperty(value = "状态", required = true, example = "0") + @Schema(description = "状态", required = true, example = "0") @NotNull(message = "状态不能为空") private Integer status; diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandCreateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandCreateReqVO.java index 74024929f..dc85a476b 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandCreateReqVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandCreateReqVO.java @@ -1,9 +1,11 @@ package cn.iocoder.yudao.module.product.controller.admin.brand.vo; -import lombok.*; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; -@ApiModel("管理后台 - 商品品牌创建 Request VO") +@Schema(description = "管理后台 - 商品品牌创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandListReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandListReqVO.java index 5367e2dfe..63305810c 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandListReqVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandListReqVO.java @@ -1,14 +1,13 @@ package cn.iocoder.yudao.module.product.controller.admin.brand.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@ApiModel(value = "管理后台 - 商品品牌分页 Request VO") +@Schema(description = "管理后台 - 商品品牌分页 Request VO") @Data public class ProductBrandListReqVO { - @ApiModelProperty(value = "品牌名称", example = "芋道") + @Schema(description = "品牌名称", example = "芋道") private String name; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandPageReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandPageReqVO.java index c5a7b0047..81d470b1b 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandPageReqVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandPageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.product.controller.admin.brand.vo; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,20 +11,20 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 商品品牌分页 Request VO") +@Schema(description = "管理后台 - 商品品牌分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ProductBrandPageReqVO extends PageParam { - @ApiModelProperty(value = "品牌名称", example = "芋道") + @Schema(description = "品牌名称", example = "芋道") private String name; - @ApiModelProperty(value = "状态", example = "0", notes = "参考 CommonStatusEnum 枚举") + @Schema(description = "状态", example = "0") private Integer status; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandRespVO.java index fb4ce0954..b68fbc5be 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandRespVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandRespVO.java @@ -1,23 +1,22 @@ package cn.iocoder.yudao.module.product.controller.admin.brand.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 品牌 Response VO") +@Schema(description = "管理后台 - 品牌 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ProductBrandRespVO extends ProductBrandBaseVO { - @ApiModelProperty(value = "品牌编号", required = true, example = "1") + @Schema(description = "品牌编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandUpdateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandUpdateReqVO.java index 54d610207..c01c3c4b7 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandUpdateReqVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/vo/ProductBrandUpdateReqVO.java @@ -1,16 +1,19 @@ package cn.iocoder.yudao.module.product.controller.admin.brand.vo; -import lombok.*; -import io.swagger.annotations.*; -import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; -@ApiModel("管理后台 - 商品品牌更新 Request VO") +import javax.validation.constraints.NotNull; + +@Schema(description = "管理后台 - 商品品牌更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ProductBrandUpdateReqVO extends ProductBrandBaseVO { - @ApiModelProperty(value = "品牌编号", required = true, example = "1") + @Schema(description = "品牌编号", required = true, example = "1") @NotNull(message = "品牌编号不能为空") private Long id; diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/ProductCategoryController.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/ProductCategoryController.java index 4144e6a57..dc3a57a38 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/ProductCategoryController.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/ProductCategoryController.java @@ -1,16 +1,16 @@ package cn.iocoder.yudao.module.product.controller.admin.category; import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import cn.iocoder.yudao.module.product.controller.admin.category.vo.ProductCategoryRespVO; -import cn.iocoder.yudao.module.product.controller.admin.category.vo.ProductCategoryListReqVO; import cn.iocoder.yudao.module.product.controller.admin.category.vo.ProductCategoryCreateReqVO; +import cn.iocoder.yudao.module.product.controller.admin.category.vo.ProductCategoryListReqVO; +import cn.iocoder.yudao.module.product.controller.admin.category.vo.ProductCategoryRespVO; import cn.iocoder.yudao.module.product.controller.admin.category.vo.ProductCategoryUpdateReqVO; import cn.iocoder.yudao.module.product.convert.category.ProductCategoryConvert; import cn.iocoder.yudao.module.product.dal.dataobject.category.ProductCategoryDO; import cn.iocoder.yudao.module.product.service.category.ProductCategoryService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -22,7 +22,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 商品分类") +@Tag(name = "管理后台 - 商品分类") @RestController @RequestMapping("/product/category") @Validated @@ -32,14 +32,14 @@ public class ProductCategoryController { private ProductCategoryService categoryService; @PostMapping("/create") - @ApiOperation("创建商品分类") + @Operation(summary = "创建商品分类") @PreAuthorize("@ss.hasPermission('product:category:create')") public CommonResult createCategory(@Valid @RequestBody ProductCategoryCreateReqVO createReqVO) { return success(categoryService.createCategory(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新商品分类") + @Operation(summary = "更新商品分类") @PreAuthorize("@ss.hasPermission('product:category:update')") public CommonResult updateCategory(@Valid @RequestBody ProductCategoryUpdateReqVO updateReqVO) { categoryService.updateCategory(updateReqVO); @@ -47,8 +47,8 @@ public class ProductCategoryController { } @DeleteMapping("/delete") - @ApiOperation("删除商品分类") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除商品分类") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('product:category:delete')") public CommonResult deleteCategory(@RequestParam("id") Long id) { categoryService.deleteCategory(id); @@ -56,8 +56,8 @@ public class ProductCategoryController { } @GetMapping("/get") - @ApiOperation("获得商品分类") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得商品分类") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('product:category:query')") public CommonResult getCategory(@RequestParam("id") Long id) { ProductCategoryDO category = categoryService.getCategory(id); @@ -65,7 +65,7 @@ public class ProductCategoryController { } @GetMapping("/list") - @ApiOperation("获得商品分类列表") + @Operation(summary = "获得商品分类列表") @PreAuthorize("@ss.hasPermission('product:category:query')") public CommonResult> getCategoryList(@Valid ProductCategoryListReqVO treeListReqVO) { List list = categoryService.getEnableCategoryList(treeListReqVO); diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/ProductCategoryBaseVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/ProductCategoryBaseVO.java index 9b9c77a08..5182bdadd 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/ProductCategoryBaseVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/ProductCategoryBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.product.controller.admin.category.vo; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -13,25 +13,25 @@ import javax.validation.constraints.NotNull; @Data public class ProductCategoryBaseVO { - @ApiModelProperty(value = "父分类编号", required = true, example = "1") + @Schema(description = "父分类编号", required = true, example = "1") @NotNull(message = "父分类编号不能为空") private Long parentId; - @ApiModelProperty(value = "分类名称", required = true, example = "办公文具") + @Schema(description = "分类名称", required = true, example = "办公文具") @NotBlank(message = "分类名称不能为空") private String name; - @ApiModelProperty(value = "分类图片", required = true) + @Schema(description = "分类图片", required = true) @NotBlank(message = "分类图片不能为空") private String picUrl; - @ApiModelProperty(value = "分类排序", required = true, example = "1") + @Schema(description = "分类排序", required = true, example = "1") private Integer sort; - @ApiModelProperty(value = "分类描述", required = true, example = "描述") + @Schema(description = "分类描述", required = true, example = "描述") private String description; - @ApiModelProperty(value = "开启状态", required = true, example = "0") + @Schema(description = "开启状态", required = true, example = "0") @NotNull(message = "开启状态不能为空") private Integer status; diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/ProductCategoryCreateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/ProductCategoryCreateReqVO.java index d35e1ad3c..f9b559776 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/ProductCategoryCreateReqVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/ProductCategoryCreateReqVO.java @@ -1,9 +1,11 @@ package cn.iocoder.yudao.module.product.controller.admin.category.vo; -import lombok.*; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; -@ApiModel("管理后台 - 商品分类创建 Request VO") +@Schema(description = "管理后台 - 商品分类创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/ProductCategoryListReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/ProductCategoryListReqVO.java index a487c16a4..9c9439d3e 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/ProductCategoryListReqVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/ProductCategoryListReqVO.java @@ -1,14 +1,13 @@ package cn.iocoder.yudao.module.product.controller.admin.category.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@ApiModel(value = "管理后台 - 商品分类列表查询 Request VO") +@Schema(description = "管理后台 - 商品分类列表查询 Request VO") @Data public class ProductCategoryListReqVO { - @ApiModelProperty(value = "分类名称", example = "办公文具") + @Schema(description = "分类名称", example = "办公文具") private String name; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/ProductCategoryRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/ProductCategoryRespVO.java index c6fdfcfe1..484e0e51e 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/ProductCategoryRespVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/ProductCategoryRespVO.java @@ -1,20 +1,22 @@ package cn.iocoder.yudao.module.product.controller.admin.category.vo; -import lombok.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; import java.time.LocalDateTime; -import io.swagger.annotations.*; -@ApiModel("管理后台 - 商品分类 Response VO") +@Schema(description = "管理后台 - 商品分类 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ProductCategoryRespVO extends ProductCategoryBaseVO { - @ApiModelProperty(value = "分类编号", required = true, example = "2") + @Schema(description = "分类编号", required = true, example = "2") private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/ProductCategoryUpdateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/ProductCategoryUpdateReqVO.java index b0c8fe57d..15f663761 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/ProductCategoryUpdateReqVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/vo/ProductCategoryUpdateReqVO.java @@ -1,16 +1,19 @@ package cn.iocoder.yudao.module.product.controller.admin.category.vo; -import lombok.*; -import io.swagger.annotations.*; -import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; -@ApiModel("管理后台 - 商品分类更新 Request VO") +import javax.validation.constraints.NotNull; + +@Schema(description = "管理后台 - 商品分类更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ProductCategoryUpdateReqVO extends ProductCategoryBaseVO { - @ApiModelProperty(value = "分类编号", required = true, example = "2") + @Schema(description = "分类编号", required = true, example = "2") @NotNull(message = "分类编号不能为空") private Long id; diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyController.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyController.java index 5efecd0c7..bd063e0ec 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyController.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyController.java @@ -9,9 +9,9 @@ import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyValueDO; import cn.iocoder.yudao.module.product.service.property.ProductPropertyService; import cn.iocoder.yudao.module.product.service.property.ProductPropertyValueService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -24,7 +24,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; -@Api(tags = "管理后台 - 商品属性项") +@Tag(name = "管理后台 - 商品属性项") @RestController @RequestMapping("/product/property") @Validated @@ -36,14 +36,14 @@ public class ProductPropertyController { private ProductPropertyValueService productPropertyValueService; @PostMapping("/create") - @ApiOperation("创建属性项") + @Operation(summary = "创建属性项") @PreAuthorize("@ss.hasPermission('product:property:create')") public CommonResult createProperty(@Valid @RequestBody ProductPropertyCreateReqVO createReqVO) { return success(productPropertyService.createProperty(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新属性项") + @Operation(summary = "更新属性项") @PreAuthorize("@ss.hasPermission('product:property:update')") public CommonResult updateProperty(@Valid @RequestBody ProductPropertyUpdateReqVO updateReqVO) { productPropertyService.updateProperty(updateReqVO); @@ -51,8 +51,8 @@ public class ProductPropertyController { } @DeleteMapping("/delete") - @ApiOperation("删除属性项") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除属性项") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('product:property:delete')") public CommonResult deleteProperty(@RequestParam("id") Long id) { productPropertyService.deleteProperty(id); @@ -60,29 +60,29 @@ public class ProductPropertyController { } @GetMapping("/get") - @ApiOperation("获得属性项") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得属性项") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('product:property:query')") public CommonResult getProperty(@RequestParam("id") Long id) { return success(ProductPropertyConvert.INSTANCE.convert(productPropertyService.getProperty(id))); } @GetMapping("/list") - @ApiOperation("获得属性项列表") + @Operation(summary = "获得属性项列表") @PreAuthorize("@ss.hasPermission('product:property:query')") public CommonResult> getPropertyList(@Valid ProductPropertyListReqVO listReqVO) { return success(ProductPropertyConvert.INSTANCE.convertList(productPropertyService.getPropertyList(listReqVO))); } @GetMapping("/page") - @ApiOperation("获得属性项分页") + @Operation(summary = "获得属性项分页") @PreAuthorize("@ss.hasPermission('product:property:query')") public CommonResult> getPropertyPage(@Valid ProductPropertyPageReqVO pageVO) { return success(ProductPropertyConvert.INSTANCE.convertPage(productPropertyService.getPropertyPage(pageVO))); } @GetMapping("/get-value-list") - @ApiOperation("获得属性项列表") + @Operation(summary = "获得属性项列表") @PreAuthorize("@ss.hasPermission('product:property:query')") public CommonResult> getPropertyAndValueList(@Valid ProductPropertyListReqVO listReqVO) { // 查询属性项 diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyValueController.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyValueController.java index fec327946..92ce6bee0 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyValueController.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyValueController.java @@ -8,9 +8,9 @@ import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.Produc import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueUpdateReqVO; import cn.iocoder.yudao.module.product.convert.propertyvalue.ProductPropertyValueConvert; import cn.iocoder.yudao.module.product.service.property.ProductPropertyValueService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -20,7 +20,7 @@ import javax.validation.Valid; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 商品属性值") +@Tag(name = "管理后台 - 商品属性值") @RestController @RequestMapping("/product/property/value") @Validated @@ -30,14 +30,14 @@ public class ProductPropertyValueController { private ProductPropertyValueService productPropertyValueService; @PostMapping("/create") - @ApiOperation("创建属性值") + @Operation(summary = "创建属性值") @PreAuthorize("@ss.hasPermission('product:property:create')") public CommonResult createProperty(@Valid @RequestBody ProductPropertyValueCreateReqVO createReqVO) { return success(productPropertyValueService.createPropertyValue(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新属性值") + @Operation(summary = "更新属性值") @PreAuthorize("@ss.hasPermission('product:property:update')") public CommonResult updateProperty(@Valid @RequestBody ProductPropertyValueUpdateReqVO updateReqVO) { productPropertyValueService.updatePropertyValue(updateReqVO); @@ -45,8 +45,8 @@ public class ProductPropertyValueController { } @DeleteMapping("/delete") - @ApiOperation("删除属性值") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除属性值") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('product:property:delete')") public CommonResult deleteProperty(@RequestParam("id") Long id) { productPropertyValueService.deletePropertyValue(id); @@ -54,15 +54,15 @@ public class ProductPropertyValueController { } @GetMapping("/get") - @ApiOperation("获得属性值") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得属性值") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('product:property:query')") public CommonResult getProperty(@RequestParam("id") Long id) { return success(ProductPropertyValueConvert.INSTANCE.convert(productPropertyValueService.getPropertyValue(id))); } @GetMapping("/page") - @ApiOperation("获得属性值分页") + @Operation(summary = "获得属性值分页") @PreAuthorize("@ss.hasPermission('product:property:query')") public CommonResult> getPropertyValuePage(@Valid ProductPropertyValuePageReqVO pageVO) { return success(ProductPropertyValueConvert.INSTANCE.convertPage(productPropertyValueService.getPropertyValuePage(pageVO))); diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyAndValueRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyAndValueRespVO.java index a739bc0f2..4be1bad18 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyAndValueRespVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyAndValueRespVO.java @@ -1,19 +1,18 @@ package cn.iocoder.yudao.module.product.controller.admin.property.vo.property; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.List; -@ApiModel("管理后台 - 商品属性项 + 属性值 Response VO") +@Schema(description = "管理后台 - 商品属性项 + 属性值 Response VO") @Data public class ProductPropertyAndValueRespVO { - @ApiModelProperty(value = "属性项的编号", required = true, example = "1024") + @Schema(description = "属性项的编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "属性项的名称", required = true, example = "颜色") + @Schema(description = "属性项的名称", required = true, example = "颜色") private String name; /** @@ -21,14 +20,14 @@ public class ProductPropertyAndValueRespVO { */ private List values; - @ApiModel("管理后台 - 属性值的简单 Response VO") + @Schema(description = "管理后台 - 属性值的简单 Response VO") @Data public static class Value { - @ApiModelProperty(value = "属性值的编号", required = true, example = "2048") + @Schema(description = "属性值的编号", required = true, example = "2048") private Long id; - @ApiModelProperty(value = "属性值的名称", required = true, example = "红色") + @Schema(description = "属性值的名称", required = true, example = "红色") private String name; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyBaseVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyBaseVO.java index fb089dce1..1f05af4b2 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyBaseVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.product.controller.admin.property.vo.property; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -12,11 +12,11 @@ import javax.validation.constraints.NotBlank; @Data public class ProductPropertyBaseVO { - @ApiModelProperty(value = "名称", required = true, example = "颜色") + @Schema(description = "名称", required = true, example = "颜色") @NotBlank(message = "名称不能为空") private String name; - @ApiModelProperty(value = "备注", example = "颜色") + @Schema(description = "备注", example = "颜色") private String remark; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyCreateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyCreateReqVO.java index 2e68f21e3..b854dd73c 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyCreateReqVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyCreateReqVO.java @@ -1,11 +1,11 @@ package cn.iocoder.yudao.module.product.controller.admin.property.vo.property; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 属性项创建 Request VO") +@Schema(description = "管理后台 - 属性项创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyListReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyListReqVO.java index 1233480d1..242caff84 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyListReqVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyListReqVO.java @@ -1,16 +1,15 @@ package cn.iocoder.yudao.module.product.controller.admin.property.vo.property; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.ToString; -@ApiModel("管理后台 - 属性项 List Request VO") +@Schema(description = "管理后台 - 属性项 List Request VO") @Data @ToString(callSuper = true) public class ProductPropertyListReqVO { - @ApiModelProperty(value = "名称", example = "颜色") + @Schema(description = "名称", example = "颜色") private String name; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyPageReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyPageReqVO.java index 60bd7db5b..d729880f0 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyPageReqVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyPageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.product.controller.admin.property.vo.property; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,20 +11,20 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 属性项 Request VO") +@Schema(description = "管理后台 - 属性项 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ProductPropertyPageReqVO extends PageParam { - @ApiModelProperty(value = "名称", example = "颜色") + @Schema(description = "名称", example = "颜色") private String name; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举") + @Schema(description = "状态", required = true, example = "1") private Integer status; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyRespVO.java index 299aa56e4..b33e615fc 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyRespVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyRespVO.java @@ -1,23 +1,22 @@ package cn.iocoder.yudao.module.product.controller.admin.property.vo.property; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 属性项 Response VO") +@Schema(description = "管理后台 - 属性项 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ProductPropertyRespVO extends ProductPropertyBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyUpdateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyUpdateReqVO.java index 4dfa48366..33ba8f2c1 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyUpdateReqVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyUpdateReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.product.controller.admin.property.vo.property; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 属性项更新 Request VO") +@Schema(description = "管理后台 - 属性项更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ProductPropertyUpdateReqVO extends ProductPropertyBaseVO { - @ApiModelProperty(value = "主键", required = true, example = "1") + @Schema(description = "主键", required = true, example = "1") @NotNull(message = "主键不能为空") private Long id; diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueBaseVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueBaseVO.java index 76b2f1a8b..da3bf5068 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueBaseVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.product.controller.admin.property.vo.value; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; @@ -13,15 +13,15 @@ import javax.validation.constraints.NotNull; @Data public class ProductPropertyValueBaseVO { - @ApiModelProperty(value = "属性项的编号", required = true, example = "1024") + @Schema(description = "属性项的编号", required = true, example = "1024") @NotNull(message = "属性项的编号不能为空") private Long propertyId; - @ApiModelProperty(value = "名称", required = true, example = "红色") + @Schema(description = "名称", required = true, example = "红色") @NotEmpty(message = "名称名字不能为空") private String name; - @ApiModelProperty(value = "备注", example = "颜色") + @Schema(description = "备注", example = "颜色") private String remark; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueCreateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueCreateReqVO.java index 8930f6ba3..d3fe4d0f1 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueCreateReqVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueCreateReqVO.java @@ -1,9 +1,11 @@ package cn.iocoder.yudao.module.product.controller.admin.property.vo.value; -import lombok.*; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; -@ApiModel("管理后台 - 商品属性值创建 Request VO") +@Schema(description = "管理后台 - 商品属性值创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueDetailRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueDetailRespVO.java index 55bae16df..56801cc7d 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueDetailRespVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueDetailRespVO.java @@ -1,23 +1,22 @@ package cn.iocoder.yudao.module.product.controller.admin.property.vo.value; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@ApiModel("管理后台 - 商品属性值的明细 Response VO") +@Schema(description = "管理后台 - 商品属性值的明细 Response VO") @Data public class ProductPropertyValueDetailRespVO { - @ApiModelProperty(value = "属性的编号", required = true, example = "1") + @Schema(description = "属性的编号", required = true, example = "1") private Long propertyId; - @ApiModelProperty(value = "属性的名称", required = true, example = "颜色") + @Schema(description = "属性的名称", required = true, example = "颜色") private String propertyName; - @ApiModelProperty(value = "属性值的编号", required = true, example = "1024") + @Schema(description = "属性值的编号", required = true, example = "1024") private Long valueId; - @ApiModelProperty(value = "属性值的名称", required = true, example = "红色") + @Schema(description = "属性值的名称", required = true, example = "红色") private String valueName; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValuePageReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValuePageReqVO.java index 3f5ffee3d..a6088deb9 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValuePageReqVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValuePageReqVO.java @@ -1,25 +1,24 @@ package cn.iocoder.yudao.module.product.controller.admin.property.vo.value; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 商品属性值分页 Request VO") +@Schema(description = "管理后台 - 商品属性值分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ProductPropertyValuePageReqVO extends PageParam { - @ApiModelProperty(value = "属性项的编号", example = "1024") + @Schema(description = "属性项的编号", example = "1024") private String propertyId; - @ApiModelProperty(value = "名称", example = "红色") + @Schema(description = "名称", example = "红色") private String name; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举") + @Schema(description = "状态", required = true, example = "1") private Integer status; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueRespVO.java index fb5ecead9..dac075b86 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueRespVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueRespVO.java @@ -1,23 +1,22 @@ package cn.iocoder.yudao.module.product.controller.admin.property.vo.value; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 商品属性值 Response VO") +@Schema(description = "管理后台 - 商品属性值 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ProductPropertyValueRespVO extends ProductPropertyValueBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "10") + @Schema(description = "编号", required = true, example = "10") private Long id; - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime createTime; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueUpdateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueUpdateReqVO.java index f13d434b3..474a980b8 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueUpdateReqVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueUpdateReqVO.java @@ -1,16 +1,19 @@ package cn.iocoder.yudao.module.product.controller.admin.property.vo.value; -import lombok.*; -import io.swagger.annotations.*; -import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; -@ApiModel("管理后台 - 商品属性值更新 Request VO") +import javax.validation.constraints.NotNull; + +@Schema(description = "管理后台 - 商品属性值更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ProductPropertyValueUpdateReqVO extends ProductPropertyValueBaseVO { - @ApiModelProperty(value = "主键", required = true, example = "1024") + @Schema(description = "主键", required = true, example = "1024") @NotNull(message = "主键不能为空") private Long id; diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/ProductSkuController.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/ProductSkuController.java index ac9713423..038642db1 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/ProductSkuController.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/ProductSkuController.java @@ -9,8 +9,8 @@ import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO; import cn.iocoder.yudao.module.product.service.sku.ProductSkuService; import cn.iocoder.yudao.module.product.service.spu.ProductSpuService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -24,7 +24,7 @@ import java.util.Map; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; -@Api(tags = "管理后台 - 商品 sku") +@Tag(name = "管理后台 - 商品 sku") @RestController @RequestMapping("/product/sku") @Validated @@ -36,7 +36,7 @@ public class ProductSkuController { private ProductSpuService productSpuService; @GetMapping("/get-option-list") - @ApiOperation("获得商品 SKU 选项的列表") + @Operation(summary = "获得商品 SKU 选项的列表") // @PreAuthorize("@ss.hasPermission('product:sku:query')") public CommonResult> getSkuOptionList() { // 获得 SKU 列表 diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuBaseVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuBaseVO.java index 1bb08ff32..f28220046 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuBaseVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuBaseVO.java @@ -2,8 +2,7 @@ package cn.iocoder.yudao.module.product.controller.admin.sku.vo; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.validation.InEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -18,56 +17,56 @@ import javax.validation.constraints.NotNull; @Data public class ProductSkuBaseVO { - @ApiModelProperty(value = "商品 SKU 名字", required = true, example = "芋道") + @Schema(description = "商品 SKU 名字", required = true, example = "芋道") @NotEmpty(message = "商品 SKU 名字不能为空") private String name; - @ApiModelProperty(value = "销售价格,单位:分", required = true, example = "1024", notes = "单位:分") + @Schema(description = "销售价格,单位:分", required = true, example = "1024") @NotNull(message = "销售价格,单位:分不能为空") private Integer price; - @ApiModelProperty(value = "市场价", example = "1024", notes = "单位:分") + @Schema(description = "市场价", example = "1024") private Integer marketPrice; - @ApiModelProperty(value = "成本价", example = "1024", notes = "单位:分") + @Schema(description = "成本价", example = "1024") private Integer costPrice; - @ApiModelProperty(value = "条形码", example = "haha") + @Schema(description = "条形码", example = "haha") private String barCode; - @ApiModelProperty(value = "图片地址", required = true, example = "https://www.iocoder.cn/xx.png") + @Schema(description = "图片地址", required = true, example = "https://www.iocoder.cn/xx.png") @NotNull(message = "图片地址不能为空") private String picUrl; - @ApiModelProperty(value = "SKU 状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举") + @Schema(description = "SKU 状态", required = true, example = "1") @NotNull(message = "SKU 状态不能为空") @InEnum(CommonStatusEnum.class) private Integer status; - @ApiModelProperty(value = "库存", required = true, example = "1") + @Schema(description = "库存", required = true, example = "1") @NotNull(message = "库存不能为空") private Integer stock; - @ApiModelProperty(value = "预警预存", example = "1") + @Schema(description = "预警预存", example = "1") private Integer warnStock; - @ApiModelProperty(value = "商品重量", example = "1", notes = "单位:kg 千克") + @Schema(description = "商品重量", example = "1") // 单位:kg 千克 private Double weight; - @ApiModelProperty(value = "商品体积", example = "1024", notes = "单位:m^3 平米") + @Schema(description = "商品体积", example = "1024") // 单位:m^3 平米 private Double volume; - @ApiModel("商品属性") + @Schema(description = "商品属性") @Data @AllArgsConstructor @NoArgsConstructor public static class Property { - @ApiModelProperty(value = "属性编号", required = true, example = "1") + @Schema(description = "属性编号", required = true, example = "1") @NotNull(message = "属性编号不能为空") private Long propertyId; - @ApiModelProperty(value = "属性值编号", required = true, example = "1024") + @Schema(description = "属性值编号", required = true, example = "1024") @NotNull(message = "属性值编号不能为空") private Long valueId; diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuCreateOrUpdateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuCreateOrUpdateReqVO.java index ab83eeeac..496475f99 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuCreateOrUpdateReqVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuCreateOrUpdateReqVO.java @@ -1,13 +1,13 @@ package cn.iocoder.yudao.module.product.controller.admin.sku.vo; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.util.List; -@ApiModel("管理后台 - 商品 SKU 创建/更新 Request VO") +@Schema(description = "管理后台 - 商品 SKU 创建/更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuOptionRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuOptionRespVO.java index 0324bdc8d..861454795 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuOptionRespVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuOptionRespVO.java @@ -1,31 +1,30 @@ package cn.iocoder.yudao.module.product.controller.admin.sku.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@ApiModel(value = "管理后台 - 商品 SKU 选项 Response VO", description = "用于前端 SELECT 选项") +@Schema(description = "管理后台 - 商品 SKU 选项 Response VO") // 用于前端 SELECT 选项 @Data public class ProductSkuOptionRespVO { - @ApiModelProperty(value = "主键", required = true, example = "1024") + @Schema(description = "主键", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "商品 SKU 名字", example = "红色") + @Schema(description = "商品 SKU 名字", example = "红色") private String name; - @ApiModelProperty(value = "销售价格", required = true, example = "100", notes = "单位:分") + @Schema(description = "销售价格", required = true, example = "100") private String price; - @ApiModelProperty(value = "库存", required = true, example = "100") + @Schema(description = "库存", required = true, example = "100") private Integer stock; // ========== 商品 SPU 信息 ========== - @ApiModelProperty(value = "商品 SPU 编号", required = true, example = "1") + @Schema(description = "商品 SPU 编号", required = true, example = "1") private Long spuId; - @ApiModelProperty(value = "商品 SPU 名字", required = true, example = "iPhone 11") + @Schema(description = "商品 SPU 名字", required = true, example = "iPhone 11") private String spuName; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuRespVO.java index 85f5903cc..95e394ada 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuRespVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.product.controller.admin.sku.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -9,16 +8,16 @@ import lombok.ToString; import java.time.LocalDateTime; import java.util.List; -@ApiModel("管理后台 - 商品 SKU Response VO") +@Schema(description = "管理后台 - 商品 SKU Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ProductSkuRespVO extends ProductSkuBaseVO { - @ApiModelProperty(value = "主键", required = true, example = "1024") + @Schema(description = "主键", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime createTime; /** diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/ProductSpuController.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/ProductSpuController.java index f19fde594..85fa93f8e 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/ProductSpuController.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/ProductSpuController.java @@ -11,9 +11,9 @@ import cn.iocoder.yudao.module.product.service.property.ProductPropertyValueServ import cn.iocoder.yudao.module.product.service.property.bo.ProductPropertyValueDetailRespBO; import cn.iocoder.yudao.module.product.service.sku.ProductSkuService; import cn.iocoder.yudao.module.product.service.spu.ProductSpuService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -26,7 +26,7 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.SPU_NOT_EXISTS; -@Api(tags = "管理后台 - 商品 SPU") +@Tag(name = "管理后台 - 商品 SPU") @RestController @RequestMapping("/product/spu") @Validated @@ -40,14 +40,14 @@ public class ProductSpuController { private ProductPropertyValueService productPropertyValueService; @PostMapping("/create") - @ApiOperation("创建商品 SPU") + @Operation(summary = "创建商品 SPU") @PreAuthorize("@ss.hasPermission('product:spu:create')") public CommonResult createProductSpu(@Valid @RequestBody ProductSpuCreateReqVO createReqVO) { return success(productSpuService.createSpu(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新商品 SPU") + @Operation(summary = "更新商品 SPU") @PreAuthorize("@ss.hasPermission('product:spu:update')") public CommonResult updateSpu(@Valid @RequestBody ProductSpuUpdateReqVO updateReqVO) { productSpuService.updateSpu(updateReqVO); @@ -55,8 +55,8 @@ public class ProductSpuController { } @DeleteMapping("/delete") - @ApiOperation("删除商品 SPU") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除商品 SPU") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('product:spu:delete')") public CommonResult deleteSpu(@RequestParam("id") Long id) { productSpuService.deleteSpu(id); @@ -64,8 +64,8 @@ public class ProductSpuController { } @GetMapping("/get-detail") - @ApiOperation("获得商品 SPU 明细") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得商品 SPU 明细") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('product:spu:query')") public CommonResult getSpuDetail(@RequestParam("id") Long id) { // 获得商品 SPU @@ -84,7 +84,7 @@ public class ProductSpuController { } @GetMapping("/get-simple-list") - @ApiOperation("获得商品 SPU 精简列表") + @Operation(summary = "获得商品 SPU 精简列表") @PreAuthorize("@ss.hasPermission('product:spu:query')") public CommonResult> getSpuSimpleList() { List list = productSpuService.getSpuList(); @@ -92,7 +92,7 @@ public class ProductSpuController { } @GetMapping("/page") - @ApiOperation("获得商品 SPU 分页") + @Operation(summary = "获得商品 SPU 分页") @PreAuthorize("@ss.hasPermission('product:spu:query')") public CommonResult> getSpuPage(@Valid ProductSpuPageReqVO pageVO) { return success(ProductSpuConvert.INSTANCE.convertPage(productSpuService.getSpuPage(pageVO))); diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuBaseVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuBaseVO.java index 5f9f8a24c..3f0c94a74 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuBaseVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuBaseVO.java @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.product.controller.admin.spu.vo; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.module.product.enums.spu.ProductSpuSpecTypeEnum; import cn.iocoder.yudao.module.product.enums.spu.ProductSpuStatusEnum; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; @@ -17,59 +17,59 @@ import java.util.List; @Data public class ProductSpuBaseVO { - @ApiModelProperty(value = "商品名称", required = true, example = "芋道") + @Schema(description = "商品名称", required = true, example = "芋道") @NotEmpty(message = "商品名称不能为空") private String name; - @ApiModelProperty(value = "商品编码", example = "yudaoyuanma") + @Schema(description = "商品编码", example = "yudaoyuanma") private String code; - @ApiModelProperty(value = "促销语", example = "好吃!") + @Schema(description = "促销语", example = "好吃!") private String sellPoint; - @ApiModelProperty(value = "商品详情", required = true, example = "我是商品描述") + @Schema(description = "商品详情", required = true, example = "我是商品描述") @NotNull(message = "商品详情不能为空") private String description; - @ApiModelProperty(value = "商品分类编号", required = true, example = "1") + @Schema(description = "商品分类编号", required = true, example = "1") @NotNull(message = "商品分类编号不能为空") private Long categoryId; - @ApiModelProperty(value = "商品品牌编号", example = "1") + @Schema(description = "商品品牌编号", example = "1") private Long brandId; - @ApiModelProperty(value = "商品图片的数组", required = true) + @Schema(description = "商品图片的数组", required = true) @NotNull(message = "商品图片的数组不能为空") private List picUrls; - @ApiModelProperty(value = "商品视频", required = true) + @Schema(description = "商品视频", required = true) private String videoUrl; - @ApiModelProperty(value = "排序字段", required = true, example = "1") + @Schema(description = "排序字段", required = true, example = "1") private Integer sort; - @ApiModelProperty(value = "商品状态", required = true, example = "1", notes = "参见 ProductSpuStatusEnum 枚举类") + @Schema(description = "商品状态", required = true, example = "1") @NotNull(message = "商品状态不能为空") @InEnum(ProductSpuStatusEnum.class) private Integer status; // ========== SKU 相关字段 ========= - @ApiModelProperty(value = "规格类型", required = true, example = "1", notes = "参见 ProductSpuSpecTypeEnum 枚举类") + @Schema(description = "规格类型", required = true, example = "1") @NotNull(message = "规格类型不能为空") @InEnum(ProductSpuSpecTypeEnum.class) private Integer specType; - @ApiModelProperty(value = "是否展示库存", required = true, example = "true") + @Schema(description = "是否展示库存", required = true, example = "true") @NotNull(message = "是否展示库存不能为空") private Boolean showStock; - @ApiModelProperty(value = "市场价", example = "1024") + @Schema(description = "市场价", example = "1024") private Integer marketPrice; // ========== 统计相关字段 ========= - @ApiModelProperty(value = "虚拟销量", required = true, example = "1024") + @Schema(description = "虚拟销量", required = true, example = "1024") @NotNull(message = "虚拟销量不能为空") private Integer virtualSalesCount; diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuCreateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuCreateReqVO.java index 87b0dd0b6..c75ed4d2e 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuCreateReqVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuCreateReqVO.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.module.product.controller.admin.spu.vo; import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuCreateOrUpdateReqVO; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -9,7 +9,7 @@ import lombok.ToString; import javax.validation.Valid; import java.util.List; -@ApiModel("管理后台 - 商品 SPU 创建 Request VO") +@Schema(description = "管理后台 - 商品 SPU 创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuDetailRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuDetailRespVO.java index 65cdd22a2..58f9565c8 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuDetailRespVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuDetailRespVO.java @@ -2,14 +2,14 @@ package cn.iocoder.yudao.module.product.controller.admin.spu.vo; import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueDetailRespVO; import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuBaseVO; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.util.List; -@ApiModel(value = "管理后台 - 商品 SPU 详细 Response VO", description = "包括关联的 SKU 等信息") +@Schema(description = "管理后台 - 商品 SPU 详细 Response VO") // 包括关联的 SKU 等信息 @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @@ -22,7 +22,7 @@ public class ProductSpuDetailRespVO extends ProductSpuRespVO { */ private List skus; - @ApiModel(value = "管理后台 - 商品 SKU 详细 Response VO") + @Schema(description = "管理后台 - 商品 SKU 详细 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuPageReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuPageReqVO.java index 3d74dc80c..0bfefb8d4 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuPageReqVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuPageReqVO.java @@ -1,46 +1,45 @@ package cn.iocoder.yudao.module.product.controller.admin.spu.vo; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 商品 SPU 分页 Request VO") +@Schema(description = "管理后台 - 商品 SPU 分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ProductSpuPageReqVO extends PageParam { - @ApiModelProperty(value = "商品名称", example = "yutou") + @Schema(description = "商品名称", example = "yutou") private String name; - @ApiModelProperty(value = "商品编码", example = "yudaoyuanma") + @Schema(description = "商品编码", example = "yudaoyuanma") private String code; - @ApiModelProperty(value = "分类编号", example = "1") + @Schema(description = "分类编号", example = "1") private Long categoryId; - @ApiModelProperty(value = "商品品牌编号", example = "1") + @Schema(description = "商品品牌编号", example = "1") private Long brandId; - @ApiModelProperty(value = "上下架状态", example = "1", notes = "参见 ProductSpuStatusEnum 枚举值") + @Schema(description = "上下架状态", example = "1") private Integer status; - @ApiModelProperty(value = "销量最小值", example = "1") + @Schema(description = "销量最小值", example = "1") private Integer salesCountMin; - @ApiModelProperty(value = "销量最大值", example = "1024") + @Schema(description = "销量最大值", example = "1024") private Integer salesCountMax; - @ApiModelProperty(value = "市场价最小值", example = "1") + @Schema(description = "市场价最小值", example = "1") private Integer marketPriceMin; - @ApiModelProperty(value = "市场价最大值", example = "1024") + @Schema(description = "市场价最大值", example = "1024") private Integer marketPriceMax; - @ApiModelProperty(value = "是否库存告警", example = "true") + @Schema(description = "是否库存告警", example = "true") private Boolean alarmStock; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuRespVO.java index 66b86e0a5..5f088b74b 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuRespVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuRespVO.java @@ -1,41 +1,40 @@ package cn.iocoder.yudao.module.product.controller.admin.spu.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 商品 SPU Response VO") +@Schema(description = "管理后台 - 商品 SPU Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ProductSpuRespVO extends ProductSpuBaseVO { - @ApiModelProperty(value = "主键", required = true, example = "1") + @Schema(description = "主键", required = true, example = "1") private Long id; - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime createTime; // ========== SKU 相关字段 ========= - @ApiModelProperty(value = "库存", required = true, example = "true") + @Schema(description = "库存", required = true, example = "true") private Integer totalStock; - @ApiModelProperty(value = " 最小价格,单位使用:分", required = true, example = "1024") + @Schema(description = " 最小价格,单位使用:分", required = true, example = "1024") private Integer minPrice; - @ApiModelProperty(value = "最大价格,单位使用:分", required = true, example = "1024") + @Schema(description = "最大价格,单位使用:分", required = true, example = "1024") private Integer maxPrice; - @ApiModelProperty(value = "商品销量", example = "1024") + @Schema(description = "商品销量", example = "1024") private Integer salesCount; // ========== 统计相关字段 ========= - @ApiModelProperty(value = "点击量", example = "1024") + @Schema(description = "点击量", example = "1024") private Integer clickCount; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuSimpleRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuSimpleRespVO.java index ea2811f8b..9cc7bf169 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuSimpleRespVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuSimpleRespVO.java @@ -1,27 +1,26 @@ package cn.iocoder.yudao.module.product.controller.admin.spu.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 商品 SPU 精简 Response VO") +@Schema(description = "管理后台 - 商品 SPU 精简 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ProductSpuSimpleRespVO extends ProductSpuBaseVO { - @ApiModelProperty(value = "主键", required = true, example = "1") + @Schema(description = "主键", required = true, example = "1") private Long id; - @ApiModelProperty(value = "商品名称", required = true, example = "芋道") + @Schema(description = "商品名称", required = true, example = "芋道") private String name; - @ApiModelProperty(value = " 最小价格,单位使用:分", required = true, example = "1024") + @Schema(description = " 最小价格,单位使用:分", required = true, example = "1024") private Integer minPrice; - @ApiModelProperty(value = "最大价格,单位使用:分", required = true, example = "1024") + @Schema(description = "最大价格,单位使用:分", required = true, example = "1024") private Integer maxPrice; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuUpdateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuUpdateReqVO.java index 378a98dc6..6ea84fb9e 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuUpdateReqVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuUpdateReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.product.controller.admin.spu.vo; import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuCreateOrUpdateReqVO; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -11,13 +10,13 @@ import javax.validation.Valid; import javax.validation.constraints.NotNull; import java.util.List; -@ApiModel("管理后台 - 商品 SPU 更新 Request VO") +@Schema(description = "管理后台 - 商品 SPU 更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ProductSpuUpdateReqVO extends ProductSpuBaseVO { - @ApiModelProperty(value = "商品编号", required = true, example = "1") + @Schema(description = "商品编号", required = true, example = "1") @NotNull(message = "商品编号不能为空") private Long id; diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/category/AppCategoryController.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/category/AppCategoryController.java index fec882c48..e484498b8 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/category/AppCategoryController.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/category/AppCategoryController.java @@ -5,8 +5,8 @@ import cn.iocoder.yudao.module.product.controller.app.category.vo.AppCategoryRes import cn.iocoder.yudao.module.product.convert.category.ProductCategoryConvert; import cn.iocoder.yudao.module.product.dal.dataobject.category.ProductCategoryDO; import cn.iocoder.yudao.module.product.service.category.ProductCategoryService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -18,7 +18,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "用户 APP - 商品分类") +@Tag(name = "用户 APP - 商品分类") @RestController @RequestMapping("/product/category") @Validated @@ -28,7 +28,7 @@ public class AppCategoryController { private ProductCategoryService categoryService; @GetMapping("/list") - @ApiOperation("获得商品分类列表") + @Operation(summary = "获得商品分类列表") public CommonResult> getProductCategoryList() { List list = categoryService.getEnableCategoryList(); list.sort(Comparator.comparing(ProductCategoryDO::getSort)); diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/category/vo/AppCategoryRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/category/vo/AppCategoryRespVO.java index e46a50cd3..1dca05a3a 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/category/vo/AppCategoryRespVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/category/vo/AppCategoryRespVO.java @@ -1,28 +1,27 @@ package cn.iocoder.yudao.module.product.controller.app.category.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @Data -@ApiModel(value = "用户 APP - 商品分类 Response VO") +@Schema(description = "用户 APP - 商品分类 Response VO") public class AppCategoryRespVO { - @ApiModelProperty(value = "分类编号", required = true, example = "2") + @Schema(description = "分类编号", required = true, example = "2") private Long id; - @ApiModelProperty(value = "父分类编号", required = true, example = "1") + @Schema(description = "父分类编号", required = true, example = "1") @NotNull(message = "父分类编号不能为空") private Long parentId; - @ApiModelProperty(value = "分类名称", required = true, example = "办公文具") + @Schema(description = "分类名称", required = true, example = "办公文具") @NotBlank(message = "分类名称不能为空") private String name; - @ApiModelProperty(value = "分类图片", required = true) + @Schema(description = "分类图片", required = true) @NotBlank(message = "分类图片不能为空") private String picUrl; diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/property/vo/value/AppProductPropertyValueDetailRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/property/vo/value/AppProductPropertyValueDetailRespVO.java index 516dd077f..ac687e547 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/property/vo/value/AppProductPropertyValueDetailRespVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/property/vo/value/AppProductPropertyValueDetailRespVO.java @@ -1,23 +1,22 @@ package cn.iocoder.yudao.module.product.controller.app.property.vo.value; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@ApiModel("用户 App - 商品属性值的明细 Response VO") +@Schema(description = "用户 App - 商品属性值的明细 Response VO") @Data public class AppProductPropertyValueDetailRespVO { - @ApiModelProperty(value = "属性的编号", required = true, example = "1") + @Schema(description = "属性的编号", required = true, example = "1") private Long propertyId; - @ApiModelProperty(value = "属性的名称", required = true, example = "颜色") + @Schema(description = "属性的名称", required = true, example = "颜色") private String propertyName; - @ApiModelProperty(value = "属性值的编号", required = true, example = "1024") + @Schema(description = "属性值的编号", required = true, example = "1024") private Long valueId; - @ApiModelProperty(value = "属性值的名称", required = true, example = "红色") + @Schema(description = "属性值的名称", required = true, example = "红色") private String valueName; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/AppProductSpuController.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/AppProductSpuController.java index 9116f29cf..d9ab87c72 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/AppProductSpuController.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/AppProductSpuController.java @@ -3,9 +3,9 @@ package cn.iocoder.yudao.module.product.controller.app.spu; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuPageReqVO; import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuDetailRespVO; import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuPageItemRespVO; +import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuPageReqVO; import cn.iocoder.yudao.module.product.convert.sku.ProductSkuConvert; import cn.iocoder.yudao.module.product.convert.spu.ProductSpuConvert; import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; @@ -15,9 +15,9 @@ import cn.iocoder.yudao.module.product.service.property.ProductPropertyValueServ import cn.iocoder.yudao.module.product.service.property.bo.ProductPropertyValueDetailRespBO; import cn.iocoder.yudao.module.product.service.sku.ProductSkuService; import cn.iocoder.yudao.module.product.service.spu.ProductSpuService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -33,7 +33,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.SPU_NOT_ENABLE; import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.SPU_NOT_EXISTS; -@Api(tags = "用户 APP - 商品 SPU") +@Tag(name = "用户 APP - 商品 SPU") @RestController @RequestMapping("/product/spu") @Validated @@ -47,15 +47,15 @@ public class AppProductSpuController { private ProductPropertyValueService productPropertyValueService; @GetMapping("/page") - @ApiOperation("获得商品 SPU 分页") + @Operation(summary = "获得商品 SPU 分页") public CommonResult> getSpuPage(@Valid AppProductSpuPageReqVO pageVO) { PageResult pageResult = productSpuService.getSpuPage(pageVO, ProductSpuStatusEnum.ENABLE.getStatus()); return success(ProductSpuConvert.INSTANCE.convertPage02(pageResult)); } @GetMapping("/get-detail") - @ApiOperation("获得商品 SPU 明细") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "获得商品 SPU 明细") + @Parameter(name = "id", description = "编号", required = true) public CommonResult getSpuDetail(@RequestParam("id") Long id) { // 获得商品 SPU ProductSpuDO spu = productSpuService.getSpu(id); diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuDetailRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuDetailRespVO.java index 699ca1caa..cf5471cba 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuDetailRespVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuDetailRespVO.java @@ -1,51 +1,50 @@ package cn.iocoder.yudao.module.product.controller.app.spu.vo; import cn.iocoder.yudao.module.product.controller.app.property.vo.value.AppProductPropertyValueDetailRespVO; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.List; -@ApiModel("用户 App - 商品 SPU 明细 Response VO") +@Schema(description = "用户 App - 商品 SPU 明细 Response VO") @Data public class AppProductSpuDetailRespVO { - @ApiModelProperty(value = "商品 SPU 编号", required = true, example = "1") + @Schema(description = "商品 SPU 编号", required = true, example = "1") private Long id; // ========== 基本信息 ========= - @ApiModelProperty(value = "商品名称", required = true, example = "芋道") + @Schema(description = "商品名称", required = true, example = "芋道") private String name; - @ApiModelProperty(value = "促销语", example = "好吃!") + @Schema(description = "促销语", example = "好吃!") private String sellPoint; - @ApiModelProperty(value = "商品详情", required = true, example = "我是商品描述") + @Schema(description = "商品详情", required = true, example = "我是商品描述") private String description; - @ApiModelProperty(value = "商品分类编号", required = true, example = "1") + @Schema(description = "商品分类编号", required = true, example = "1") private Long categoryId; - @ApiModelProperty(value = "商品图片的数组", required = true) + @Schema(description = "商品图片的数组", required = true) private List picUrls; - @ApiModelProperty(value = "商品视频", required = true) + @Schema(description = "商品视频", required = true) private String videoUrl; // ========== SKU 相关字段 ========= - @ApiModelProperty(value = "规格类型", required = true, example = "1", notes = "参见 ProductSpuSpecTypeEnum 枚举类") + @Schema(description = "规格类型", required = true, example = "1") private Integer specType; - @ApiModelProperty(value = "是否展示库存", required = true, example = "true") + @Schema(description = "是否展示库存", required = true, example = "true") private Boolean showStock; - @ApiModelProperty(value = " 最小价格,单位使用:分", required = true, example = "1024") + @Schema(description = " 最小价格,单位使用:分", required = true, example = "1024") private Integer minPrice; - @ApiModelProperty(value = "最大价格,单位使用:分", required = true, example = "1024") + @Schema(description = "最大价格,单位使用:分", required = true, example = "1024") private Integer maxPrice; /** @@ -55,14 +54,14 @@ public class AppProductSpuDetailRespVO { // ========== 统计相关字段 ========= - @ApiModelProperty(value = "商品销量", required = true, example = "1024") + @Schema(description = "商品销量", required = true, example = "1024") private Integer salesCount; - @ApiModel("用户 App - 商品 SPU 明细的 SKU 信息") + @Schema(description = "用户 App - 商品 SPU 明细的 SKU 信息") @Data public static class Sku { - @ApiModelProperty(value = "商品 SKU 编号", example = "1") + @Schema(description = "商品 SKU 编号", example = "1") private Long id; /** @@ -70,22 +69,22 @@ public class AppProductSpuDetailRespVO { */ private List properties; - @ApiModelProperty(value = "销售价格,单位:分", required = true, example = "1024", notes = "单位:分") + @Schema(description = "销售价格,单位:分", required = true, example = "1024") private Integer price; - @ApiModelProperty(value = "市场价", example = "1024", notes = "单位:分") + @Schema(description = "市场价", example = "1024") private Integer marketPrice; - @ApiModelProperty(value = "图片地址", required = true, example = "https://www.iocoder.cn/xx.png") + @Schema(description = "图片地址", required = true, example = "https://www.iocoder.cn/xx.png") private String picUrl; - @ApiModelProperty(value = "库存", required = true, example = "1") + @Schema(description = "库存", required = true, example = "1") private Integer stock; - @ApiModelProperty(value = "商品重量", example = "1", notes = "单位:kg 千克") + @Schema(description = "商品重量", example = "1") // 单位:kg 千克 private Double weight; - @ApiModelProperty(value = "商品体积", example = "1024", notes = "单位:m^3 平米") + @Schema(description = "商品体积", example = "1024") // 单位:m^3 平米 private Double volume; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuPageItemRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuPageItemRespVO.java index 60fc9235e..d826900a6 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuPageItemRespVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuPageItemRespVO.java @@ -1,40 +1,39 @@ package cn.iocoder.yudao.module.product.controller.app.spu.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.util.List; -@ApiModel("用户 App - 商品 SPU 分页项 Response VO") +@Schema(description = "用户 App - 商品 SPU 分页项 Response VO") @Data public class AppProductSpuPageItemRespVO { - @ApiModelProperty(value = "商品 SPU 编号", required = true, example = "1") + @Schema(description = "商品 SPU 编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "商品名称", required = true, example = "芋道") + @Schema(description = "商品名称", required = true, example = "芋道") @NotEmpty(message = "商品名称不能为空") private String name; - @ApiModelProperty(value = "分类编号", required = true) + @Schema(description = "分类编号", required = true) @NotNull(message = "分类编号不能为空") private Long categoryId; - @ApiModelProperty(value = "商品图片的数组", required = true) + @Schema(description = "商品图片的数组", required = true) private List picUrls; - @ApiModelProperty(value = " 最小价格,单位使用:分", required = true, example = "1024") + @Schema(description = " 最小价格,单位使用:分", required = true, example = "1024") private Integer minPrice; - @ApiModelProperty(value = "最大价格,单位使用:分", required = true, example = "1024") + @Schema(description = "最大价格,单位使用:分", required = true, example = "1024") private Integer maxPrice; // ========== 统计相关字段 ========= - @ApiModelProperty(value = "商品销量", example = "1024") + @Schema(description = "商品销量", example = "1024") private Integer salesCount; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuPageReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuPageReqVO.java index f19a7c21a..dcbd1e190 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuPageReqVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuPageReqVO.java @@ -3,15 +3,14 @@ package cn.iocoder.yudao.module.product.controller.app.spu.vo; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.pojo.PageParam; import com.fasterxml.jackson.annotation.JsonIgnore; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.AssertTrue; -@ApiModel("用户 App - 商品 SPU 分页 Request VO") +@Schema(description = "用户 App - 商品 SPU 分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @@ -20,16 +19,16 @@ public class AppProductSpuPageReqVO extends PageParam { public static final String SORT_FIELD_PRICE = "price"; public static final String SORT_FIELD_SALES_COUNT = "salesCount"; - @ApiModelProperty(value = "分类编号", example = "1") + @Schema(description = "分类编号", example = "1") private Long categoryId; - @ApiModelProperty(value = "关键字", example = "好看") + @Schema(description = "关键字", example = "好看") private String keyword; - @ApiModelProperty(value = "排序字段", example = "price", notes = "参见 AppSpuPageReqVO.SORT_FIELD_XXX 常量") + @Schema(description = "排序字段", example = "price") // 参见 AppSpuPageReqVO.SORT_FIELD_XXX 常量 private String sortField; - @ApiModelProperty(value = "排序方式", example = "true", notes = "true - 升序;false - 降序") + @Schema(description = "排序方式", example = "true") private Boolean sortAsc; @AssertTrue(message = "排序字段不合法") diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/framework/package-info.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/framework/package-info.java new file mode 100644 index 000000000..d2e1c934a --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/framework/package-info.java @@ -0,0 +1,6 @@ +/** + * 属于 product 模块的 framework 封装 + * + * @author 芋道源码 + */ +package cn.iocoder.yudao.module.product.framework; diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/framework/web/config/ProductWebConfiguration.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/framework/web/config/ProductWebConfiguration.java new file mode 100644 index 000000000..9d1bf7db9 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/framework/web/config/ProductWebConfiguration.java @@ -0,0 +1,24 @@ +package cn.iocoder.yudao.module.product.framework.web.config; + +import cn.iocoder.yudao.framework.swagger.config.YudaoSwaggerAutoConfiguration; +import org.springdoc.core.GroupedOpenApi; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * product 模块的 web 组件的 Configuration + * + * @author 芋道源码 + */ +@Configuration(proxyBeanMethods = false) +public class ProductWebConfiguration { + + /** + * product 模块的 API 分组 + */ + @Bean + public GroupedOpenApi productGroupedOpenApi() { + return YudaoSwaggerAutoConfiguration.buildGroupedOpenApi("product"); + } + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/framework/web/package-info.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/framework/web/package-info.java new file mode 100644 index 000000000..f4adb2d76 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/framework/web/package-info.java @@ -0,0 +1,4 @@ +/** + * product 模块的 web 配置 + */ +package cn.iocoder.yudao.module.product.framework.web; diff --git a/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/clean.sql b/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/clean.sql index aad191337..48079766a 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/clean.sql +++ b/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/clean.sql @@ -1,3 +1,4 @@ DELETE FROM "product_sku"; - -DELETE FROM "product_spu"; \ No newline at end of file +DELETE FROM "product_spu"; +DELETE FROM "product_brand"; +DELETE FROM "product_category"; diff --git a/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/create_tables.sql b/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/create_tables.sql index 9d26cc733..8f53ba72f 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/create_tables.sql +++ b/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/create_tables.sql @@ -67,3 +67,18 @@ CREATE TABLE IF NOT EXISTS `product_category` ( `deleted` bit(1) NOT NULL DEFAULT 0 COMMENT '是否删除', PRIMARY KEY (`id`) ) COMMENT '商品分类'; + +CREATE TABLE IF NOT EXISTS `product_brand` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '品牌编号', + `name` varchar(128) NOT NULL COMMENT '品牌名称', + `pic_url` varchar DEFAULT NULL COMMENT '品牌图片', + `sort` int NOT NULL DEFAULT '0' COMMENT '排序字段', + `description` varchar(256) NOT NULL DEFAULT '0' COMMENT '品牌描述', + `status` bit(1) DEFAULT NULL COMMENT '状态', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `creator` varchar DEFAULT NULL COMMENT '创建人', + `updater` varchar DEFAULT NULL COMMENT '更新人', + `deleted` bit(1) NOT NULL DEFAULT 0 COMMENT '是否删除', + PRIMARY KEY (`id`) +) COMMENT '商品品牌'; diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/BannerController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/BannerController.java index 0fbef12d5..0bf2b2c33 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/BannerController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/BannerController.java @@ -2,13 +2,16 @@ package cn.iocoder.yudao.module.promotion.controller.admin.banner; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.promotion.controller.admin.banner.vo.*; +import cn.iocoder.yudao.module.promotion.controller.admin.banner.vo.BannerCreateReqVO; +import cn.iocoder.yudao.module.promotion.controller.admin.banner.vo.BannerPageReqVO; +import cn.iocoder.yudao.module.promotion.controller.admin.banner.vo.BannerRespVO; +import cn.iocoder.yudao.module.promotion.controller.admin.banner.vo.BannerUpdateReqVO; import cn.iocoder.yudao.module.promotion.convert.banner.BannerConvert; import cn.iocoder.yudao.module.promotion.dal.dataobject.banner.BannerDO; import cn.iocoder.yudao.module.promotion.service.banner.BannerService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -18,7 +21,7 @@ import javax.validation.Valid; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - Banner 管理") +@Tag(name = "管理后台 - Banner 管理") @RestController @RequestMapping("/market/banner") @Validated @@ -28,14 +31,14 @@ public class BannerController { private BannerService bannerService; @PostMapping("/create") - @ApiOperation("创建 Banner") + @Operation(summary = "创建 Banner") @PreAuthorize("@ss.hasPermission('market:banner:create')") public CommonResult createBanner(@Valid @RequestBody BannerCreateReqVO createReqVO) { return success(bannerService.createBanner(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新 Banner") + @Operation(summary = "更新 Banner") @PreAuthorize("@ss.hasPermission('market:banner:update')") public CommonResult updateBanner(@Valid @RequestBody BannerUpdateReqVO updateReqVO) { bannerService.updateBanner(updateReqVO); @@ -43,8 +46,8 @@ public class BannerController { } @DeleteMapping("/delete") - @ApiOperation("删除 Banner") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除 Banner") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('market:banner:delete')") public CommonResult deleteBanner(@RequestParam("id") Long id) { bannerService.deleteBanner(id); @@ -52,8 +55,8 @@ public class BannerController { } @GetMapping("/get") - @ApiOperation("获得 Banner") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得 Banner") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('market:banner:query')") public CommonResult getBanner(@RequestParam("id") Long id) { BannerDO banner = bannerService.getBanner(id); @@ -61,7 +64,7 @@ public class BannerController { } @GetMapping("/page") - @ApiOperation("获得 Banner 分页") + @Operation(summary = "获得 Banner 分页") @PreAuthorize("@ss.hasPermission('market:banner:query')") public CommonResult> getBannerPage(@Valid BannerPageReqVO pageVO) { PageResult pageResult = bannerService.getBannerPage(pageVO); diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerBaseVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerBaseVO.java index 3083856f5..6c72155f4 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerBaseVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerBaseVO.java @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.promotion.controller.admin.banner.vo; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.validation.InEnum; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; @@ -15,28 +15,28 @@ import javax.validation.constraints.NotNull; @Data public class BannerBaseVO { - @ApiModelProperty(value = "标题", required = true) + @Schema(description = "标题", required = true) @NotNull(message = "标题不能为空") private String title; - @ApiModelProperty(value = "跳转链接", required = true) + @Schema(description = "跳转链接", required = true) @NotNull(message = "跳转链接不能为空") private String url; - @ApiModelProperty(value = "图片地址", required = true) + @Schema(description = "图片地址", required = true) @NotNull(message = "图片地址不能为空") private String picUrl; - @ApiModelProperty(value = "排序", required = true) + @Schema(description = "排序", required = true) @NotNull(message = "排序不能为空") private Integer sort; - @ApiModelProperty(value = "状态", required = true) + @Schema(description = "状态", required = true) @NotNull(message = "状态不能为空") @InEnum(CommonStatusEnum.class) private Integer status; - @ApiModelProperty(value = "备注") + @Schema(description = "备注") private String memo; } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerCreateReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerCreateReqVO.java index c058fd8c2..180cdfe87 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerCreateReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerCreateReqVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.promotion.controller.admin.banner.vo; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -8,12 +8,10 @@ import lombok.ToString; /** * @author xia */ -@ApiModel("管理后台 - Banner 创建 Request VO") +@Schema(description = "管理后台 - Banner 创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BannerCreateReqVO extends BannerBaseVO { - - } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerPageReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerPageReqVO.java index 5b7bd5f31..b97008ccd 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerPageReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerPageReqVO.java @@ -3,8 +3,7 @@ package cn.iocoder.yudao.module.promotion.controller.admin.banner.vo; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.validation.InEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -17,22 +16,22 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ /** * @author xia */ -@ApiModel("管理后台 - Banner 分页 Request VO") +@Schema(description = "管理后台 - Banner 分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BannerPageReqVO extends PageParam { - @ApiModelProperty(value = "标题") + @Schema(description = "标题") private String title; - @ApiModelProperty(value = "状态") + @Schema(description = "状态") @InEnum(CommonStatusEnum.class) private Integer status; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerRespVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerRespVO.java index 6b50110e8..fb0010669 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerRespVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.promotion.controller.admin.banner.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.ToString; @@ -11,16 +10,16 @@ import java.time.LocalDateTime; /** * @author xia */ -@ApiModel("管理后台 - Banner Response VO") +@Schema(description = "管理后台 - Banner Response VO") @Data @ToString(callSuper = true) public class BannerRespVO extends BannerBaseVO { - @ApiModelProperty(value = "banner编号", required = true) + @Schema(description = "banner编号", required = true) @NotNull(message = "banner编号不能为空") private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerUpdateReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerUpdateReqVO.java index 971a87353..033b6054d 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerUpdateReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerUpdateReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.promotion.controller.admin.banner.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -11,13 +10,13 @@ import javax.validation.constraints.NotNull; /** * @author xia */ -@ApiModel("管理后台 - Banner更新 Request VO") +@Schema(description = "管理后台 - Banner更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class BannerUpdateReqVO extends BannerBaseVO { - @ApiModelProperty(value = "banner 编号", required = true) + @Schema(description = "banner 编号", required = true) @NotNull(message = "banner 编号不能为空") private Long id; diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/CouponController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/CouponController.java index 6b086f748..e7780ca2a 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/CouponController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/CouponController.java @@ -11,9 +11,9 @@ import cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.coupon.Coupo import cn.iocoder.yudao.module.promotion.convert.coupon.CouponConvert; import cn.iocoder.yudao.module.promotion.dal.dataobject.coupon.CouponDO; import cn.iocoder.yudao.module.promotion.service.coupon.CouponService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -26,7 +26,7 @@ import java.util.Set; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; -@Api(tags = "管理后台 - 优惠劵") +@Tag(name = "管理后台 - 优惠劵") @RestController @RequestMapping("/promotion/coupon") @Validated @@ -38,8 +38,8 @@ public class CouponController { private MemberUserApi memberUserApi; // @GetMapping("/get") -// @ApiOperation("获得优惠劵") -// @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) +// @Operation(summary = "获得优惠劵") +// @Parameter(name = "id", description = "编号", required = true, example = "1024") // @PreAuthorize("@ss.hasPermission('promotion:coupon:query')") // public CommonResult getCoupon(@RequestParam("id") Long id) { // CouponDO coupon = couponService.getCoupon(id); @@ -47,8 +47,8 @@ public class CouponController { // } @DeleteMapping("/delete") - @ApiOperation("回收优惠劵") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "回收优惠劵") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('promotion:coupon:delete')") public CommonResult deleteCoupon(@RequestParam("id") Long id) { couponService.deleteCoupon(id); @@ -56,7 +56,7 @@ public class CouponController { } @GetMapping("/page") - @ApiOperation("获得优惠劵分页") + @Operation(summary = "获得优惠劵分页") @PreAuthorize("@ss.hasPermission('promotion:coupon:query')") public CommonResult> getCouponPage(@Valid CouponPageReqVO pageVO) { PageResult pageResult = couponService.getCouponPage(pageVO); diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/CouponTemplateController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/CouponTemplateController.java index 76efd2daa..1b1ae505c 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/CouponTemplateController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/CouponTemplateController.java @@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.template.*; import cn.iocoder.yudao.module.promotion.convert.coupon.CouponTemplateConvert; import cn.iocoder.yudao.module.promotion.dal.dataobject.coupon.CouponTemplateDO; import cn.iocoder.yudao.module.promotion.service.coupon.CouponTemplateService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -18,7 +18,7 @@ import javax.validation.Valid; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 优惠劵模板") +@Tag(name = "管理后台 - 优惠劵模板") @RestController @RequestMapping("/promotion/coupon-template") @Validated @@ -28,14 +28,14 @@ public class CouponTemplateController { private CouponTemplateService couponTemplateService; @PostMapping("/create") - @ApiOperation("创建优惠劵模板") + @Operation(summary = "创建优惠劵模板") @PreAuthorize("@ss.hasPermission('promotion:coupon-template:create')") public CommonResult createCouponTemplate(@Valid @RequestBody CouponTemplateCreateReqVO createReqVO) { return success(couponTemplateService.createCouponTemplate(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新优惠劵模板") + @Operation(summary = "更新优惠劵模板") @PreAuthorize("@ss.hasPermission('promotion:coupon-template:update')") public CommonResult updateCouponTemplate(@Valid @RequestBody CouponTemplateUpdateReqVO updateReqVO) { couponTemplateService.updateCouponTemplate(updateReqVO); @@ -43,7 +43,7 @@ public class CouponTemplateController { } @PutMapping("/update-status") - @ApiOperation("更新优惠劵模板状态") + @Operation(summary = "更新优惠劵模板状态") @PreAuthorize("@ss.hasPermission('promotion:coupon-template:update')") public CommonResult updateCouponTemplateStatus(@Valid @RequestBody CouponTemplateUpdateStatusReqVO reqVO) { couponTemplateService.updateCouponTemplateStatus(reqVO.getId(), reqVO.getStatus()); @@ -51,8 +51,8 @@ public class CouponTemplateController { } @DeleteMapping("/delete") - @ApiOperation("删除优惠劵模板") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除优惠劵模板") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('promotion:coupon-template:delete')") public CommonResult deleteCouponTemplate(@RequestParam("id") Long id) { couponTemplateService.deleteCouponTemplate(id); @@ -60,8 +60,8 @@ public class CouponTemplateController { } @GetMapping("/get") - @ApiOperation("获得优惠劵模板") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得优惠劵模板") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('promotion:coupon-template:query')") public CommonResult getCouponTemplate(@RequestParam("id") Long id) { CouponTemplateDO couponTemplate = couponTemplateService.getCouponTemplate(id); @@ -69,7 +69,7 @@ public class CouponTemplateController { } @GetMapping("/page") - @ApiOperation("获得优惠劵模板分页") + @Operation(summary = "获得优惠劵模板分页") @PreAuthorize("@ss.hasPermission('promotion:coupon-template:query')") public CommonResult> getCouponTemplatePage(@Valid CouponTemplatePageReqVO pageVO) { PageResult pageResult = couponTemplateService.getCouponTemplatePage(pageVO); diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/coupon/CouponBaseVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/coupon/CouponBaseVO.java index 269b2b2ca..2609c0a2c 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/coupon/CouponBaseVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/coupon/CouponBaseVO.java @@ -4,7 +4,7 @@ import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.module.promotion.enums.common.PromotionDiscountTypeEnum; import cn.iocoder.yudao.module.promotion.enums.common.PromotionProductScopeEnum; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -24,76 +24,76 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.TIME_ZONE_DE public class CouponBaseVO { // ========== 基本信息 BEGIN ========== - @ApiModelProperty(value = "优惠劵模板编号", required = true, example = "1024") + @Schema(description = "优惠劵模板编号", required = true, example = "1024") @NotNull(message = "优惠劵模板编号不能为空") private Integer templateId; - @ApiModelProperty(value = "优惠劵名", required = true, example = "春节送送送") + @Schema(description = "优惠劵名", required = true, example = "春节送送送") @NotNull(message = "优惠劵名不能为空") private String name; - @ApiModelProperty(value = "优惠码状态", required = true, example = "1", notes = "参见 CouponStatusEnum 枚举") + @Schema(description = "优惠码状态", required = true, example = "1") private Integer status; // ========== 基本信息 END ========== // ========== 领取情况 BEGIN ========== - @ApiModelProperty(value = "用户编号", required = true, example = "1") + @Schema(description = "用户编号", required = true, example = "1") @NotNull(message = "用户编号不能为空") private Long userId; - @ApiModelProperty(value = "领取方式", required = true, example = "1", notes = "参见 CouponTakeTypeEnum 枚举类") + @Schema(description = "领取方式", required = true, example = "1") @NotNull(message = "领取方式不能为空") private Integer takeType; // ========== 领取情况 END ========== // ========== 使用规则 BEGIN ========== - @ApiModelProperty(value = "是否设置满多少金额可用", required = true, example = "100", notes = "单位:分;0 - 不限制") + @Schema(description = "是否设置满多少金额可用", required = true, example = "100") // 单位:分;0 - 不限制 @NotNull(message = "是否设置满多少金额可用不能为空") private Integer usePrice; - @ApiModelProperty(value = "固定日期 - 生效开始时间") + @Schema(description = "固定日期 - 生效开始时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) private LocalDateTime validStartTime; - @ApiModelProperty(value = "固定日期 - 生效结束时间") + @Schema(description = "固定日期 - 生效结束时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) private LocalDateTime validEndTime; - @ApiModelProperty(value = "商品范围", required = true, example = "1", notes = "参见 PromotionProductScopeEnum 枚举类") + @Schema(description = "商品范围", required = true, example = "1") @NotNull(message = "商品范围不能为空") @InEnum(PromotionProductScopeEnum.class) private Integer productScope; - @ApiModelProperty(value = "商品 SPU 编号的数组", example = "1,3") + @Schema(description = "商品 SPU 编号的数组", example = "1,3") private List productSpuIds; // ========== 使用规则 END ========== // ========== 使用效果 BEGIN ========== - @ApiModelProperty(value = "优惠类型", required = true, example = "1", notes = "参见 PromotionDiscountTypeEnum 枚举") + @Schema(description = "优惠类型", required = true, example = "1") @NotNull(message = "优惠类型不能为空") @InEnum(PromotionDiscountTypeEnum.class) private Integer discountType; - @ApiModelProperty(value = "折扣百分比", example = "80", notes = "例如说,80% 为 80") + @Schema(description = "折扣百分比", example = "80") // 例如说,80% 为 80 private Integer discountPercent; - @ApiModelProperty(value = "优惠金额", example = "10", notes = "单位:分") + @Schema(description = "优惠金额", example = "10") @Min(value = 0, message = "优惠金额需要大于等于 0") private Integer discountPrice; - @ApiModelProperty(value = "折扣上限", example = "100", notes = "单位:分,仅在 discountType 为 PERCENT 使用") + @Schema(description = "折扣上限", example = "100") // 单位:分,仅在 discountType 为 PERCENT 使用 private Integer discountLimitPrice; // ========== 使用效果 END ========== // ========== 使用情况 BEGIN ========== - @ApiModelProperty(value = "使用订单号", example = "4096") + @Schema(description = "使用订单号", example = "4096") private Long useOrderId; - @ApiModelProperty(value = "使用时间") + @Schema(description = "使用时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) private LocalDateTime useTime; diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/coupon/CouponPageItemRespVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/coupon/CouponPageItemRespVO.java index 88bc364bd..118736ef6 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/coupon/CouponPageItemRespVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/coupon/CouponPageItemRespVO.java @@ -1,18 +1,17 @@ package cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.coupon; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 优惠劵分页的每一项 Response VO") +@Schema(description = "管理后台 - 优惠劵分页的每一项 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class CouponPageItemRespVO extends CouponRespVO { - @ApiModelProperty(value = "用户昵称", example = "老芋艿") + @Schema(description = "用户昵称", example = "老芋艿") private String nickname; } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/coupon/CouponPageReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/coupon/CouponPageReqVO.java index 78ef1039f..11d61a518 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/coupon/CouponPageReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/coupon/CouponPageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.coupon; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,23 +11,23 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 优惠劵分页 Request VO") +@Schema(description = "管理后台 - 优惠劵分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class CouponPageReqVO extends PageParam { - @ApiModelProperty(value = "优惠劵模板编号", example = "2048") + @Schema(description = "优惠劵模板编号", example = "2048") private Long templateId; - @ApiModelProperty(value = "优惠码状态", example = "1", notes = "参见 CouponStatusEnum 枚举") + @Schema(description = "优惠码状态", example = "1") private Integer status; - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; - @ApiModelProperty(value = "用户昵称", example = "芋艿", notes = "模糊匹配") + @Schema(description = "用户昵称", example = "芋艿") private String nickname; } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/coupon/CouponRespVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/coupon/CouponRespVO.java index 76e075883..68f0bc44e 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/coupon/CouponRespVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/coupon/CouponRespVO.java @@ -1,23 +1,22 @@ package cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.coupon; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 优惠劵 Response VO") +@Schema(description = "管理后台 - 优惠劵 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class CouponRespVO extends CouponBaseVO { - @ApiModelProperty(value = "优惠劵编号", required = true, example = "1024") + @Schema(description = "优惠劵编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateBaseVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateBaseVO.java index e54a33ce0..d63d447cc 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateBaseVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateBaseVO.java @@ -8,7 +8,7 @@ import cn.iocoder.yudao.module.promotion.enums.common.PromotionProductScopeEnum; import cn.iocoder.yudao.module.promotion.enums.coupon.CouponTemplateValidityTypeEnum; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -29,70 +29,70 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.TIME_ZONE_DE @Data public class CouponTemplateBaseVO { - @ApiModelProperty(value = "优惠劵名", required = true, example = "春节送送送") + @Schema(description = "优惠劵名", required = true, example = "春节送送送") @NotNull(message = "优惠劵名不能为空") private String name; - @ApiModelProperty(value = "发行总量", required = true, example = "1024", notes = "-1 - 则表示不限制发放数量") + @Schema(description = "发行总量", required = true, example = "1024") // -1 - 则表示不限制发放数量 @NotNull(message = "发行总量不能为空") private Integer totalCount; - @ApiModelProperty(value = "每人限领个数", required = true, example = "66", notes = "-1 - 则表示不限制") + @Schema(description = "每人限领个数", required = true, example = "66") // -1 - 则表示不限制 @NotNull(message = "每人限领个数不能为空") private Integer takeLimitCount; - @ApiModelProperty(value = "领取方式", required = true, example = "1", notes = "参见 CouponTakeTypeEnum 枚举类") + @Schema(description = "领取方式", required = true, example = "1") @NotNull(message = "领取方式不能为空") private Integer takeType; - @ApiModelProperty(value = "是否设置满多少金额可用", required = true, example = "100", notes = "单位:分;0 - 不限制") + @Schema(description = "是否设置满多少金额可用", required = true, example = "100") // 单位:分;0 - 不限制 @NotNull(message = "是否设置满多少金额可用不能为空") private Integer usePrice; - @ApiModelProperty(value = "商品范围", required = true, example = "1", notes = "参见 PromotionProductScopeEnum 枚举类") + @Schema(description = "商品范围", required = true, example = "1") @NotNull(message = "商品范围不能为空") @InEnum(PromotionProductScopeEnum.class) private Integer productScope; - @ApiModelProperty(value = "商品 SPU 编号的数组", example = "1,3") + @Schema(description = "商品 SPU 编号的数组", example = "1,3") private List productSpuIds; - @ApiModelProperty(value = "生效日期类型", required = true, example = "1") + @Schema(description = "生效日期类型", required = true, example = "1") @NotNull(message = "生效日期类型不能为空") @InEnum(CouponTemplateValidityTypeEnum.class) private Integer validityType; - @ApiModelProperty(value = "固定日期 - 生效开始时间") + @Schema(description = "固定日期 - 生效开始时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) private LocalDateTime validStartTime; - @ApiModelProperty(value = "固定日期 - 生效结束时间") + @Schema(description = "固定日期 - 生效结束时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) private LocalDateTime validEndTime; - @ApiModelProperty(value = "领取日期 - 开始天数") + @Schema(description = "领取日期 - 开始天数") @Min(value = 0L, message = "开始天数必须大于 0") private Integer fixedStartTerm; - @ApiModelProperty(value = "领取日期 - 结束天数") + @Schema(description = "领取日期 - 结束天数") @Min(value = 1L, message = "开始天数必须大于 1") private Integer fixedEndTerm; - @ApiModelProperty(value = "优惠类型", required = true, example = "1", notes = "参见 PromotionDiscountTypeEnum 枚举") + @Schema(description = "优惠类型", required = true, example = "1") @NotNull(message = "优惠类型不能为空") @InEnum(PromotionDiscountTypeEnum.class) private Integer discountType; - @ApiModelProperty(value = "折扣百分比", example = "80", notes = "例如说,80% 为 80") + @Schema(description = "折扣百分比", example = "80") // 例如说,80% 为 80 private Integer discountPercent; - @ApiModelProperty(value = "优惠金额", example = "10", notes = "单位:分") + @Schema(description = "优惠金额", example = "10") @Min(value = 0, message = "优惠金额需要大于等于 0") private Integer discountPrice; - @ApiModelProperty(value = "折扣上限", example = "100", notes = "单位:分,仅在 discountType 为 PERCENT 使用") + @Schema(description = "折扣上限", example = "100") // 单位:分,仅在 discountType 为 PERCENT 使用 private Integer discountLimitPrice; @AssertTrue(message = "商品 SPU 编号的数组不能为空") diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateCreateReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateCreateReqVO.java index 91bfb0a5f..d9c5c326d 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateCreateReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateCreateReqVO.java @@ -1,11 +1,11 @@ package cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.template; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 优惠劵模板创建 Request VO") +@Schema(description = "管理后台 - 优惠劵模板创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplatePageReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplatePageReqVO.java index 8fffe4db0..e78d0140f 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplatePageReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplatePageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.template; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,22 +11,22 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 优惠劵模板分页 Request VO") +@Schema(description = "管理后台 - 优惠劵模板分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class CouponTemplatePageReqVO extends PageParam { - @ApiModelProperty(value = "优惠劵名", example = "你好") + @Schema(description = "优惠劵名", example = "你好") private String name; - @ApiModelProperty(value = "状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "状态", example = "1") private Integer status; - @ApiModelProperty(value = "优惠类型", example = "1", notes = "参见 PromotionDiscountTypeEnum 枚举") + @Schema(description = "优惠类型", example = "1") private Integer discountType; - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateRespVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateRespVO.java index 7182733e7..b90407b43 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateRespVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateRespVO.java @@ -2,34 +2,33 @@ package cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.template; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.validation.InEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 优惠劵模板 Response VO") +@Schema(description = "管理后台 - 优惠劵模板 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class CouponTemplateRespVO extends CouponTemplateBaseVO { - @ApiModelProperty(value = "模板编号", required = true, example = "1024") + @Schema(description = "模板编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "状态", required = true, example = "1") + @Schema(description = "状态", required = true, example = "1") @InEnum(CommonStatusEnum.class) private Integer status; - @ApiModelProperty(value = "领取优惠券的数量", required = true, example = "1024") + @Schema(description = "领取优惠券的数量", required = true, example = "1024") private Integer takeCount; - @ApiModelProperty(value = "使用优惠券的次数", required = true, example = "2048") + @Schema(description = "使用优惠券的次数", required = true, example = "2048") private Integer useCount; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateUpdateReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateUpdateReqVO.java index 8e5e8723a..922e4f057 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateUpdateReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateUpdateReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.template; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 优惠劵模板更新 Request VO") +@Schema(description = "管理后台 - 优惠劵模板更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class CouponTemplateUpdateReqVO extends CouponTemplateBaseVO { - @ApiModelProperty(value = "模板编号", required = true, example = "1024") + @Schema(description = "模板编号", required = true, example = "1024") @NotNull(message = "模板编号不能为空") private Long id; diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateUpdateStatusReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateUpdateStatusReqVO.java index 32e020637..630f91fea 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateUpdateStatusReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/coupon/vo/template/CouponTemplateUpdateStatusReqVO.java @@ -2,21 +2,20 @@ package cn.iocoder.yudao.module.promotion.controller.admin.coupon.vo.template; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.validation.InEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 优惠劵模板更新状态 Request VO") +@Schema(description = "管理后台 - 优惠劵模板更新状态 Request VO") @Data public class CouponTemplateUpdateStatusReqVO { - @ApiModelProperty(value = "优惠劵模板编号", required = true, example = "1024") + @Schema(description = "优惠劵模板编号", required = true, example = "1024") @NotNull(message = "优惠劵模板编号不能为空") private Long id; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举") + @Schema(description = "状态", required = true, example = "1") @NotNull(message = "状态不能为空") @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") private Integer status; diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/DiscountActivityController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/DiscountActivityController.java index 332a1b822..b3b1810fc 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/DiscountActivityController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/DiscountActivityController.java @@ -7,9 +7,9 @@ import cn.iocoder.yudao.module.promotion.convert.discount.DiscountActivityConver import cn.iocoder.yudao.module.promotion.dal.dataobject.discount.DiscountActivityDO; import cn.iocoder.yudao.module.promotion.dal.dataobject.discount.DiscountProductDO; import cn.iocoder.yudao.module.promotion.service.discount.DiscountActivityService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -20,7 +20,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 限时折扣活动") +@Tag(name = "管理后台 - 限时折扣活动") @RestController @RequestMapping("/promotion/discount-activity") @Validated @@ -30,14 +30,14 @@ public class DiscountActivityController { private DiscountActivityService discountActivityService; @PostMapping("/create") - @ApiOperation("创建限时折扣活动") + @Operation(summary = "创建限时折扣活动") @PreAuthorize("@ss.hasPermission('promotion:discount-activity:create')") public CommonResult createDiscountActivity(@Valid @RequestBody DiscountActivityCreateReqVO createReqVO) { return success(discountActivityService.createDiscountActivity(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新限时折扣活动") + @Operation(summary = "更新限时折扣活动") @PreAuthorize("@ss.hasPermission('promotion:discount-activity:update')") public CommonResult updateDiscountActivity(@Valid @RequestBody DiscountActivityUpdateReqVO updateReqVO) { discountActivityService.updateDiscountActivity(updateReqVO); @@ -45,8 +45,8 @@ public class DiscountActivityController { } @PutMapping("/close") - @ApiOperation("关闭限时折扣活动") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "关闭限时折扣活动") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('promotion:discount-activity:close')") public CommonResult closeRewardActivity(@RequestParam("id") Long id) { discountActivityService.closeRewardActivity(id); @@ -54,8 +54,8 @@ public class DiscountActivityController { } @DeleteMapping("/delete") - @ApiOperation("删除限时折扣活动") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除限时折扣活动") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('promotion:discount-activity:delete')") public CommonResult deleteDiscountActivity(@RequestParam("id") Long id) { discountActivityService.deleteDiscountActivity(id); @@ -63,8 +63,8 @@ public class DiscountActivityController { } @GetMapping("/get") - @ApiOperation("获得限时折扣活动") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得限时折扣活动") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('promotion:discount-activity:query')") public CommonResult getDiscountActivity(@RequestParam("id") Long id) { DiscountActivityDO discountActivity = discountActivityService.getDiscountActivity(id); @@ -77,7 +77,7 @@ public class DiscountActivityController { } @GetMapping("/page") - @ApiOperation("获得限时折扣活动分页") + @Operation(summary = "获得限时折扣活动分页") @PreAuthorize("@ss.hasPermission('promotion:discount-activity:query')") public CommonResult> getDiscountActivityPage(@Valid DiscountActivityPageReqVO pageVO) { PageResult pageResult = discountActivityService.getDiscountActivityPage(pageVO); diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityBaseVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityBaseVO.java index 60a65ec59..1f0d6e066 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityBaseVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityBaseVO.java @@ -4,8 +4,7 @@ import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.module.promotion.enums.common.PromotionDiscountTypeEnum; import com.fasterxml.jackson.annotation.JsonIgnore; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -23,44 +22,44 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @Data public class DiscountActivityBaseVO { - @ApiModelProperty(value = "活动标题", required = true, example = "一个标题") + @Schema(description = "活动标题", required = true, example = "一个标题") @NotNull(message = "活动标题不能为空") private String name; - @ApiModelProperty(value = "开始时间", required = true) + @Schema(description = "开始时间", required = true) @NotNull(message = "开始时间不能为空") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime startTime; - @ApiModelProperty(value = "结束时间", required = true) + @Schema(description = "结束时间", required = true) @NotNull(message = "结束时间不能为空") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime endTime; - @ApiModelProperty(value = "备注", example = "我是备注") + @Schema(description = "备注", example = "我是备注") private String remark; - @ApiModel("商品") + @Schema(description = "商品") @Data public static class Product { - @ApiModelProperty(value = "商品 SPU 编号", required = true, example = "1") + @Schema(description = "商品 SPU 编号", required = true, example = "1") @NotNull(message = "商品 SPU 编号不能为空") private Long spuId; - @ApiModelProperty(value = "商品 SKU 编号", required = true, example = "1") + @Schema(description = "商品 SKU 编号", required = true, example = "1") @NotNull(message = "商品 SKU 编号不能为空") private Long skuId; - @ApiModelProperty(value = "优惠类型", required = true, example = "1", notes = "参见 PromotionDiscountTypeEnum 枚举") + @Schema(description = "优惠类型", required = true, example = "1") @NotNull(message = "优惠类型不能为空") @InEnum(PromotionDiscountTypeEnum.class) private Integer discountType; - @ApiModelProperty(value = "折扣百分比", example = "80", notes = "例如说,80% 为 80") + @Schema(description = "折扣百分比", example = "80") // 例如说,80% 为 80 private Integer discountPercent; - @ApiModelProperty(value = "优惠金额", example = "10", notes = "单位:分") + @Schema(description = "优惠金额", example = "10") @Min(value = 0, message = "优惠金额需要大于等于 0") private Integer discountPrice; diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityCreateReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityCreateReqVO.java index 35de6faf2..4da80a1b9 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityCreateReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityCreateReqVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.promotion.controller.admin.discount.vo; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -9,7 +9,7 @@ import javax.validation.Valid; import javax.validation.constraints.NotEmpty; import java.util.List; -@ApiModel("管理后台 - 限时折扣活动创建 Request VO") +@Schema(description = "管理后台 - 限时折扣活动创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityDetailRespVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityDetailRespVO.java index 1dfdeec18..85a989c05 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityDetailRespVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityDetailRespVO.java @@ -1,13 +1,13 @@ package cn.iocoder.yudao.module.promotion.controller.admin.discount.vo; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.util.List; -@ApiModel("管理后台 - 限时折扣活动的详细 Response VO") +@Schema(description = "管理后台 - 限时折扣活动的详细 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityPageReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityPageReqVO.java index 0e3406f07..4463555ea 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityPageReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityPageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.promotion.controller.admin.discount.vo; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,19 +11,19 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 限时折扣活动分页 Request VO") +@Schema(description = "管理后台 - 限时折扣活动分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class DiscountActivityPageReqVO extends PageParam { - @ApiModelProperty(value = "活动标题", example = "一个标题") + @Schema(description = "活动标题", example = "一个标题") private String name; - @ApiModelProperty(value = "活动状态", example = "1") + @Schema(description = "活动状态", example = "1") private Integer status; - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityRespVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityRespVO.java index 0422908b5..b552c56ed 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityRespVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.promotion.controller.admin.discount.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -9,20 +8,20 @@ import lombok.ToString; import javax.validation.constraints.NotNull; import java.time.LocalDateTime; -@ApiModel("管理后台 - 限时折扣活动 Response VO") +@Schema(description = "管理后台 - 限时折扣活动 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class DiscountActivityRespVO extends DiscountActivityBaseVO { - @ApiModelProperty(value = "活动编号", required = true, example = "1024") + @Schema(description = "活动编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "活动状态", required = true, example = "1") + @Schema(description = "活动状态", required = true, example = "1") @NotNull(message = "活动状态不能为空") private Integer status; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityUpdateReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityUpdateReqVO.java index 0f3b6e435..f9bf48c06 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityUpdateReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/discount/vo/DiscountActivityUpdateReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.promotion.controller.admin.discount.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -11,13 +10,13 @@ import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.util.List; -@ApiModel("管理后台 - 限时折扣活动更新 Request VO") +@Schema(description = "管理后台 - 限时折扣活动更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class DiscountActivityUpdateReqVO extends DiscountActivityBaseVO { - @ApiModelProperty(value = "活动编号", required = true, example = "1024") + @Schema(description = "活动编号", required = true, example = "1024") @NotNull(message = "活动编号不能为空") private Long id; diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/RewardActivityController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/RewardActivityController.java index 043571e5e..7827fd114 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/RewardActivityController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/RewardActivityController.java @@ -9,9 +9,9 @@ import cn.iocoder.yudao.module.promotion.controller.admin.reward.vo.RewardActivi import cn.iocoder.yudao.module.promotion.convert.reward.RewardActivityConvert; import cn.iocoder.yudao.module.promotion.dal.dataobject.reward.RewardActivityDO; import cn.iocoder.yudao.module.promotion.service.reward.RewardActivityService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -21,7 +21,7 @@ import javax.validation.Valid; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 满减送活动") +@Tag(name = "管理后台 - 满减送活动") @RestController @RequestMapping("/promotion/reward-activity") @Validated @@ -31,14 +31,14 @@ public class RewardActivityController { private RewardActivityService rewardActivityService; @PostMapping("/create") - @ApiOperation("创建满减送活动") + @Operation(summary = "创建满减送活动") @PreAuthorize("@ss.hasPermission('promotion:reward-activity:create')") public CommonResult createRewardActivity(@Valid @RequestBody RewardActivityCreateReqVO createReqVO) { return success(rewardActivityService.createRewardActivity(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新满减送活动") + @Operation(summary = "更新满减送活动") @PreAuthorize("@ss.hasPermission('promotion:reward-activity:update')") public CommonResult updateRewardActivity(@Valid @RequestBody RewardActivityUpdateReqVO updateReqVO) { rewardActivityService.updateRewardActivity(updateReqVO); @@ -46,8 +46,8 @@ public class RewardActivityController { } @PutMapping("/close") - @ApiOperation("关闭满减送活动") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "关闭满减送活动") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('promotion:reward-activity:close')") public CommonResult closeRewardActivity(@RequestParam("id") Long id) { rewardActivityService.closeRewardActivity(id); @@ -55,8 +55,8 @@ public class RewardActivityController { } @DeleteMapping("/delete") - @ApiOperation("删除满减送活动") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除满减送活动") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('promotion:reward-activity:delete')") public CommonResult deleteRewardActivity(@RequestParam("id") Long id) { rewardActivityService.deleteRewardActivity(id); @@ -64,8 +64,8 @@ public class RewardActivityController { } @GetMapping("/get") - @ApiOperation("获得满减送活动") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得满减送活动") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('promotion:reward-activity:query')") public CommonResult getRewardActivity(@RequestParam("id") Long id) { RewardActivityDO rewardActivity = rewardActivityService.getRewardActivity(id); @@ -73,7 +73,7 @@ public class RewardActivityController { } @GetMapping("/page") - @ApiOperation("获得满减送活动分页") + @Operation(summary = "获得满减送活动分页") @PreAuthorize("@ss.hasPermission('promotion:reward-activity:query')") public CommonResult> getRewardActivityPage(@Valid RewardActivityPageReqVO pageVO) { PageResult pageResult = rewardActivityService.getRewardActivityPage(pageVO); diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/vo/RewardActivityBaseVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/vo/RewardActivityBaseVO.java index ed2802124..2cd7c7240 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/vo/RewardActivityBaseVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/vo/RewardActivityBaseVO.java @@ -4,8 +4,7 @@ import cn.hutool.core.collection.CollUtil; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.module.promotion.enums.common.PromotionConditionTypeEnum; import com.fasterxml.jackson.annotation.JsonIgnore; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -26,35 +25,35 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @Data public class RewardActivityBaseVO { - @ApiModelProperty(value = "活动标题", required = true, example = "满啦满啦") + @Schema(description = "活动标题", required = true, example = "满啦满啦") @NotNull(message = "活动标题不能为空") private String name; - @ApiModelProperty(value = "开始时间", required = true) + @Schema(description = "开始时间", required = true) @NotNull(message = "开始时间不能为空") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime startTime; - @ApiModelProperty(value = "结束时间", required = true) + @Schema(description = "结束时间", required = true) @NotNull(message = "结束时间不能为空") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @Future(message = "结束时间必须大于当前时间") private LocalDateTime endTime; - @ApiModelProperty(value = "备注", example = "biubiubiu") + @Schema(description = "备注", example = "biubiubiu") private String remark; - @ApiModelProperty(value = "条件类型", required = true, example = "1") + @Schema(description = "条件类型", required = true, example = "1") @NotNull(message = "条件类型不能为空") @InEnum(value = PromotionConditionTypeEnum.class, message = "条件类型必须是 {value}") private Integer conditionType; - @ApiModelProperty(value = "商品范围", required = true, example = "1") + @Schema(description = "商品范围", required = true, example = "1") @NotNull(message = "商品范围不能为空") @InEnum(value = PromotionConditionTypeEnum.class, message = "商品范围必须是 {value}") private Integer productScope; - @ApiModelProperty(value = "商品 SPU 编号的数组", example = "1,2,3") + @Schema(description = "商品 SPU 编号的数组", example = "1,2,3") private List productSpuIds; /** @@ -63,29 +62,29 @@ public class RewardActivityBaseVO { @Valid // 校验下子对象 private List rules; - @ApiModel("优惠规则") + @Schema(description = "优惠规则") @Data public static class Rule { - @ApiModelProperty(value = "优惠门槛", required = true, example = "100", notes = "1. 满 N 元,单位:分; 2. 满 N 件") + @Schema(description = "优惠门槛", required = true, example = "100") // 1. 满 N 元,单位:分; 2. 满 N 件 @Min(value = 1L, message = "优惠门槛必须大于等于 1") private Integer limit; - @ApiModelProperty(value = "优惠价格", required = true, example = "100", notes = "单位:分") + @Schema(description = "优惠价格", required = true, example = "100") @Min(value = 1L, message = "优惠价格必须大于等于 1") private Integer discountPrice; - @ApiModelProperty(value = "是否包邮", required = true, example = "true") + @Schema(description = "是否包邮", required = true, example = "true") private Boolean freeDelivery; - @ApiModelProperty(value = "赠送的积分", required = true, example = "100") + @Schema(description = "赠送的积分", required = true, example = "100") @Min(value = 1L, message = "赠送的积分必须大于等于 1") private Integer point; - @ApiModelProperty(value = "赠送的优惠劵编号的数组", example = "1,2,3") + @Schema(description = "赠送的优惠劵编号的数组", example = "1,2,3") private List couponIds; - @ApiModelProperty(value = "赠送的优惠卷数量的数组", example = "1,2,3") + @Schema(description = "赠送的优惠卷数量的数组", example = "1,2,3") private List couponCounts; @AssertTrue(message = "优惠劵和数量必须一一对应") diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/vo/RewardActivityCreateReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/vo/RewardActivityCreateReqVO.java index 6a7251021..0710e46a4 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/vo/RewardActivityCreateReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/vo/RewardActivityCreateReqVO.java @@ -1,9 +1,11 @@ package cn.iocoder.yudao.module.promotion.controller.admin.reward.vo; -import lombok.*; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; -@ApiModel("管理后台 - 满减送活动创建 Request VO") +@Schema(description = "管理后台 - 满减送活动创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/vo/RewardActivityPageReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/vo/RewardActivityPageReqVO.java index 5a8d2ba6d..7052c9c66 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/vo/RewardActivityPageReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/vo/RewardActivityPageReqVO.java @@ -1,19 +1,21 @@ package cn.iocoder.yudao.module.promotion.controller.admin.reward.vo; -import lombok.*; -import io.swagger.annotations.*; import cn.iocoder.yudao.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; -@ApiModel("管理后台 - 满减送活动分页 Request VO") +@Schema(description = "管理后台 - 满减送活动分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class RewardActivityPageReqVO extends PageParam { - @ApiModelProperty(value = "活动标题", example = "满啦满啦") + @Schema(description = "活动标题", example = "满啦满啦") private String name; - @ApiModelProperty(value = "活动状态", example = "1") + @Schema(description = "活动状态", example = "1") private Integer status; } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/vo/RewardActivityRespVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/vo/RewardActivityRespVO.java index cb90e21cb..8ad93cb59 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/vo/RewardActivityRespVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/vo/RewardActivityRespVO.java @@ -1,26 +1,25 @@ package cn.iocoder.yudao.module.promotion.controller.admin.reward.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 满减送活动 Response VO") +@Schema(description = "管理后台 - 满减送活动 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class RewardActivityRespVO extends RewardActivityBaseVO { - @ApiModelProperty(value = "活动编号", required = true, example = "1024") + @Schema(description = "活动编号", required = true, example = "1024") private Integer id; - @ApiModelProperty(value = "活动状态", required = true, example = "1") + @Schema(description = "活动状态", required = true, example = "1") private Integer status; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/vo/RewardActivityUpdateReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/vo/RewardActivityUpdateReqVO.java index 659deee3d..66d9c02ba 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/vo/RewardActivityUpdateReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/reward/vo/RewardActivityUpdateReqVO.java @@ -1,16 +1,19 @@ package cn.iocoder.yudao.module.promotion.controller.admin.reward.vo; -import lombok.*; -import io.swagger.annotations.*; -import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; -@ApiModel("管理后台 - 满减送活动更新 Request VO") +import javax.validation.constraints.NotNull; + +@Schema(description = "管理后台 - 满减送活动更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class RewardActivityUpdateReqVO extends RewardActivityBaseVO { - @ApiModelProperty(value = "活动编号", required = true, example = "1024") + @Schema(description = "活动编号", required = true, example = "1024") @NotNull(message = "活动编号不能为空") private Long id; diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/SeckillActivityController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/SeckillActivityController.java index 5acaf7cf0..ba750b296 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/SeckillActivityController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/SeckillActivityController.java @@ -7,9 +7,9 @@ import cn.iocoder.yudao.module.promotion.convert.seckill.seckillactivity.Seckill import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.seckillactivity.SeckillActivityDO; import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.seckillactivity.SeckillProductDO; import cn.iocoder.yudao.module.promotion.service.seckill.seckillactivity.SeckillActivityService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -21,7 +21,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 秒杀活动") +@Tag(name = "管理后台 - 秒杀活动") @RestController @RequestMapping("/promotion/seckill-activity") @Validated @@ -31,14 +31,14 @@ public class SeckillActivityController { private SeckillActivityService seckillActivityService; @PostMapping("/create") - @ApiOperation("创建秒杀活动") + @Operation(summary = "创建秒杀活动") @PreAuthorize("@ss.hasPermission('promotion:seckill-activity:create')") public CommonResult createSeckillActivity(@Valid @RequestBody SeckillActivityCreateReqVO createReqVO) { return success(seckillActivityService.createSeckillActivity(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新秒杀活动") + @Operation(summary = "更新秒杀活动") @PreAuthorize("@ss.hasPermission('promotion:seckill-activity:update')") public CommonResult updateSeckillActivity(@Valid @RequestBody SeckillActivityUpdateReqVO updateReqVO) { seckillActivityService.updateSeckillActivity(updateReqVO); @@ -46,8 +46,8 @@ public class SeckillActivityController { } @PutMapping("/close") - @ApiOperation("关闭秒杀活动") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "关闭秒杀活动") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('promotion:seckill-activity:close')") public CommonResult closeSeckillActivity(@RequestParam("id") Long id) { seckillActivityService.closeSeckillActivity(id); @@ -55,8 +55,8 @@ public class SeckillActivityController { } @DeleteMapping("/delete") - @ApiOperation("删除秒杀活动") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除秒杀活动") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('promotion:seckill-activity:delete')") public CommonResult deleteSeckillActivity(@RequestParam("id") Long id) { seckillActivityService.deleteSeckillActivity(id); @@ -64,8 +64,8 @@ public class SeckillActivityController { } @GetMapping("/get") - @ApiOperation("获得秒杀活动") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得秒杀活动") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('promotion:seckill-activity:query')") public CommonResult getSeckillActivity(@RequestParam("id") Long id) { SeckillActivityDO seckillActivity = seckillActivityService.getSeckillActivity(id); @@ -77,8 +77,8 @@ public class SeckillActivityController { } @GetMapping("/list") - @ApiOperation("获得秒杀活动列表") - @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) + @Operation(summary = "获得秒杀活动列表") + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") @PreAuthorize("@ss.hasPermission('promotion:seckill-activity:query')") public CommonResult> getSeckillActivityList(@RequestParam("ids") Collection ids) { List list = seckillActivityService.getSeckillActivityList(ids); @@ -86,7 +86,7 @@ public class SeckillActivityController { } @GetMapping("/page") - @ApiOperation("获得秒杀活动分页") + @Operation(summary = "获得秒杀活动分页") @PreAuthorize("@ss.hasPermission('promotion:seckill-activity:query')") public CommonResult> getSeckillActivityPage(@Valid SeckillActivityPageReqVO pageVO) { PageResult pageResult = seckillActivityService.getSeckillActivityPage(pageVO); diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/SeckillTimeController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/SeckillTimeController.java index 3cb6d4ca6..992f34ab9 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/SeckillTimeController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/SeckillTimeController.java @@ -7,9 +7,9 @@ import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time.Seckil import cn.iocoder.yudao.module.promotion.convert.seckill.seckilltime.SeckillTimeConvert; import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.seckilltime.SeckillTimeDO; import cn.iocoder.yudao.module.promotion.service.seckill.seckilltime.SeckillTimeService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -20,7 +20,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 秒杀时段") +@Tag(name = "管理后台 - 秒杀时段") @RestController @RequestMapping("/promotion/seckill-time") @Validated @@ -30,14 +30,14 @@ public class SeckillTimeController { private SeckillTimeService seckillTimeService; @PostMapping("/create") - @ApiOperation("创建秒杀时段") + @Operation(summary = "创建秒杀时段") @PreAuthorize("@ss.hasPermission('promotion:seckill-time:create')") public CommonResult createSeckillTime(@Valid @RequestBody SeckillTimeCreateReqVO createReqVO) { return success(seckillTimeService.createSeckillTime(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新秒杀时段") + @Operation(summary = "更新秒杀时段") @PreAuthorize("@ss.hasPermission('promotion:seckill-time:update')") public CommonResult updateSeckillTime(@Valid @RequestBody SeckillTimeUpdateReqVO updateReqVO) { seckillTimeService.updateSeckillTime(updateReqVO); @@ -45,8 +45,8 @@ public class SeckillTimeController { } @DeleteMapping("/delete") - @ApiOperation("删除秒杀时段") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除秒杀时段") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('promotion:seckill-time:delete')") public CommonResult deleteSeckillTime(@RequestParam("id") Long id) { seckillTimeService.deleteSeckillTime(id); @@ -54,8 +54,8 @@ public class SeckillTimeController { } @GetMapping("/get") - @ApiOperation("获得秒杀时段") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得秒杀时段") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('promotion:seckill-time:query')") public CommonResult getSeckillTime(@RequestParam("id") Long id) { SeckillTimeDO seckillTime = seckillTimeService.getSeckillTime(id); @@ -63,7 +63,7 @@ public class SeckillTimeController { } @GetMapping("/list") - @ApiOperation("获得所有秒杀时段列表") + @Operation(summary = "获得所有秒杀时段列表") @PreAuthorize("@ss.hasPermission('promotion:seckill-time:query')") public CommonResult> getSeckillTimeList() { List list = seckillTimeService.getSeckillTimeList(); diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityBaseVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityBaseVO.java index 877e7553a..1fa803f71 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityBaseVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityBaseVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.activity; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -20,44 +19,44 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.TIME_ZONE_DE @Data public class SeckillActivityBaseVO { - @ApiModelProperty(value = "秒杀活动名称", required = true, example = "晚九点限时秒杀") + @Schema(description = "秒杀活动名称", required = true, example = "晚九点限时秒杀") @NotNull(message = "秒杀活动名称不能为空") private String name; - @ApiModelProperty(value = "活动开始时间", required = true) + @Schema(description = "活动开始时间", required = true) @NotNull(message = "活动开始时间不能为空") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) private LocalDateTime startTime; - @ApiModelProperty(value = "活动结束时间", required = true) + @Schema(description = "活动结束时间", required = true) @NotNull(message = "活动结束时间不能为空") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) private LocalDateTime endTime; - @ApiModel("商品") + @Schema(description = "商品") @Data public static class Product { - @ApiModelProperty(value = "商品 SPU 编号", required = true, example = "1") + @Schema(description = "商品 SPU 编号", required = true, example = "1") @NotNull(message = "商品 SPU 编号不能为空") private Long spuId; - @ApiModelProperty(value = "商品 SKU 编号", required = true, example = "1") + @Schema(description = "商品 SKU 编号", required = true, example = "1") @NotNull(message = "商品 SKU 编号不能为空") private Long skuId; - @ApiModelProperty(value = "秒杀金额", required = true, example = "12.00") + @Schema(description = "秒杀金额", required = true, example = "12.00") @NotNull(message = "秒杀金额不能为空") private Integer seckillPrice; - @ApiModelProperty(value = "秒杀库存", example = "80") + @Schema(description = "秒杀库存", example = "80") @Min(value = 0, message = "秒杀库存需要大于等于 0") private Integer stock; - @ApiModelProperty(value = "每人限购", example = "10", notes = "如果为0则不限购") + @Schema(description = "每人限购", example = "10") // 如果为 0 则不限购 @Min(value = 0, message = "每人限购需要大于等于 0") private Integer limitBuyCount; diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityCreateReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityCreateReqVO.java index 58dbd0dd9..37adfc7e4 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityCreateReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityCreateReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.activity; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -11,20 +10,20 @@ import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.util.List; -@ApiModel("管理后台 - 秒杀活动创建 Request VO") +@Schema(description = "管理后台 - 秒杀活动创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class SeckillActivityCreateReqVO extends SeckillActivityBaseVO { - @ApiModelProperty(value = "备注", example = "限时秒杀活动") + @Schema(description = "备注", example = "限时秒杀活动") private String remark; - @ApiModelProperty(value = "排序", required = true, example = "1") + @Schema(description = "排序", required = true, example = "1") @NotNull(message = "排序不能为空") private Integer sort; - @ApiModelProperty(value = "秒杀时段id", required = true, example = "1,3") + @Schema(description = "秒杀时段id", required = true, example = "1,3") @NotEmpty(message = "参与场次不能为空") private List timeIds; diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityDetailRespVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityDetailRespVO.java index a8a079abf..14b32c324 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityDetailRespVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityDetailRespVO.java @@ -1,13 +1,13 @@ package cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.activity; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.util.List; -@ApiModel("管理后台 - 秒杀活动的详细 Response VO") +@Schema(description = "管理后台 - 秒杀活动的详细 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityPageReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityPageReqVO.java index 34808d523..f0299377d 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityPageReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityPageReqVO.java @@ -2,8 +2,7 @@ package cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.activity; import cn.iocoder.yudao.framework.common.pojo.PageParam; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -14,22 +13,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.TIME_ZONE_DEFAULT; -@ApiModel("管理后台 - 秒杀活动分页 Request VO") +@Schema(description = "管理后台 - 秒杀活动分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class SeckillActivityPageReqVO extends PageParam { - @ApiModelProperty(value = "秒杀活动名称", example = "晚九点限时秒杀") + @Schema(description = "秒杀活动名称", example = "晚九点限时秒杀") private String name; - @ApiModelProperty(value = "活动状态", example = "进行中") + @Schema(description = "活动状态", example = "进行中") private Integer status; - @ApiModelProperty(value = "秒杀时段id", example = "1") + @Schema(description = "秒杀时段id", example = "1") private Long timeId; - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) private LocalDateTime[] createTime; diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityRespVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityRespVO.java index 50055f8b0..e898a0d4f 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityRespVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.activity; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -9,34 +8,34 @@ import lombok.ToString; import java.time.LocalDateTime; import java.util.List; -@ApiModel("管理后台 - 秒杀活动 Response VO") +@Schema(description = "管理后台 - 秒杀活动 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class SeckillActivityRespVO extends SeckillActivityBaseVO { - @ApiModelProperty(value = "秒杀活动id", required = true, example = "1") + @Schema(description = "秒杀活动id", required = true, example = "1") private Long id; - @ApiModelProperty(value = "付款订单数", required = true, example = "1") + @Schema(description = "付款订单数", required = true, example = "1") private Integer orderCount; - @ApiModelProperty(value = "付款人数", required = true, example = "1") + @Schema(description = "付款人数", required = true, example = "1") private Integer userCount; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; - @ApiModelProperty(value = "秒杀时段id", required = true, example = "1,3") + @Schema(description = "秒杀时段id", required = true, example = "1,3") private List timeIds; - @ApiModelProperty(value = "排序", required = true, example = "1") + @Schema(description = "排序", required = true, example = "1") private Integer sort; - @ApiModelProperty(value = "备注", example = "限时秒杀活动") + @Schema(description = "备注", example = "限时秒杀活动") private String remark; - @ApiModelProperty(value = "活动状态", example = "进行中") + @Schema(description = "活动状态", example = "进行中") private Integer status; } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityUpdateReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityUpdateReqVO.java index e55739a4b..3787d619c 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityUpdateReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/activity/SeckillActivityUpdateReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.activity; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -11,24 +10,24 @@ import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.util.List; -@ApiModel("管理后台 - 秒杀活动更新 Request VO") +@Schema(description = "管理后台 - 秒杀活动更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class SeckillActivityUpdateReqVO extends SeckillActivityBaseVO { - @ApiModelProperty(value = "秒杀活动编号", required = true, example = "224") + @Schema(description = "秒杀活动编号", required = true, example = "224") @NotNull(message = "秒杀活动编号不能为空") private Long id; - @ApiModelProperty(value = "备注", example = "限时秒杀活动") + @Schema(description = "备注", example = "限时秒杀活动") private String remark; - @ApiModelProperty(value = "排序", required = true, example = "1") + @Schema(description = "排序", required = true, example = "1") @NotNull(message = "排序不能为空") private Integer sort; - @ApiModelProperty(value = "秒杀时段id", required = true, example = "1,3") + @Schema(description = "秒杀时段id", required = true, example = "1,3") @NotEmpty(message = "秒杀时段id不能为空") private List timeIds; diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/time/SeckillTimeBaseVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/time/SeckillTimeBaseVO.java index 4fc8c8f3c..c15854da6 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/time/SeckillTimeBaseVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/time/SeckillTimeBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; @@ -13,15 +13,15 @@ import java.time.LocalTime; @Data public class SeckillTimeBaseVO { - @ApiModelProperty(value = "秒杀时段名称", required = true, example = "上午场") + @Schema(description = "秒杀时段名称", required = true, example = "上午场") @NotNull(message = "秒杀时段名称不能为空") private String name; - @ApiModelProperty(value = "开始时间点", required = true, example = "16:30:40") + @Schema(description = "开始时间点", required = true, example = "16:30:40") @NotNull(message = "开始时间点不能为空") private LocalTime startTime; - @ApiModelProperty(value = "结束时间点", required = true, example = "16:30:40") + @Schema(description = "结束时间点", required = true, example = "16:30:40") @NotNull(message = "结束时间点不能为空") private LocalTime endTime; diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/time/SeckillTimeCreateReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/time/SeckillTimeCreateReqVO.java index 197fb8a68..4d3ccd092 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/time/SeckillTimeCreateReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/time/SeckillTimeCreateReqVO.java @@ -1,9 +1,11 @@ package cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time; -import lombok.*; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; -@ApiModel("管理后台 - 秒杀时段创建 Request VO") +@Schema(description = "管理后台 - 秒杀时段创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/time/SeckillTimePageReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/time/SeckillTimePageReqVO.java index b482ca34e..36853a0e0 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/time/SeckillTimePageReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/time/SeckillTimePageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -10,20 +9,20 @@ import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalTime; -@ApiModel("管理后台 - 秒杀时段分页 Request VO") +@Schema(description = "管理后台 - 秒杀时段分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class SeckillTimePageReqVO extends PageParam { - @ApiModelProperty(value = "秒杀时段名称", example = "上午场") + @Schema(description = "秒杀时段名称", example = "上午场") private String name; - @ApiModelProperty(value = "开始时间点", example = "16:30:40") + @Schema(description = "开始时间点", example = "16:30:40") @DateTimeFormat(pattern = "HH:mm:ss") private LocalTime startTime; - @ApiModelProperty(value = "结束时间点", example = "16:30:40") + @Schema(description = "结束时间点", example = "16:30:40") @DateTimeFormat(pattern = "HH:mm:ss") private LocalTime endTime; diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/time/SeckillTimeRespVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/time/SeckillTimeRespVO.java index 632020191..8e8c41406 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/time/SeckillTimeRespVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/time/SeckillTimeRespVO.java @@ -1,26 +1,25 @@ package cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 秒杀时段 Response VO") +@Schema(description = "管理后台 - 秒杀时段 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class SeckillTimeRespVO extends SeckillTimeBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1") + @Schema(description = "编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "秒杀活动数量", required = true, example = "1") + @Schema(description = "秒杀活动数量", required = true, example = "1") private Integer seckillActivityCount; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/time/SeckillTimeUpdateReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/time/SeckillTimeUpdateReqVO.java index 72931938d..3ef8db3e3 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/time/SeckillTimeUpdateReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/seckill/vo/time/SeckillTimeUpdateReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.time; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 秒杀时段更新 Request VO") +@Schema(description = "管理后台 - 秒杀时段更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class SeckillTimeUpdateReqVO extends SeckillTimeBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1") + @Schema(description = "编号", required = true, example = "1") @NotNull(message = "编号不能为空") private Long id; diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/AppMarketTestController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/AppMarketTestController.java index d6d6689ef..cafddecf5 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/AppMarketTestController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/AppMarketTestController.java @@ -1,8 +1,8 @@ package cn.iocoder.yudao.module.promotion.controller.app; import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -10,14 +10,14 @@ import org.springframework.web.bind.annotation.RestController; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "用户 App - 营销") +@Tag(name = "用户 App - 营销") @RestController @RequestMapping("/market/test") @Validated public class AppMarketTestController { @GetMapping("/get") - @ApiOperation("获取 market 信息") + @Operation(summary = "获取 market 信息") public CommonResult get() { return success("true"); } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/banner/AppBannerController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/banner/AppBannerController.java index 4edd1ed04..4bc094598 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/banner/AppBannerController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/banner/AppBannerController.java @@ -5,8 +5,8 @@ import cn.iocoder.yudao.module.promotion.controller.admin.banner.vo.BannerRespVO import cn.iocoder.yudao.module.promotion.convert.banner.BannerConvert; import cn.iocoder.yudao.module.promotion.dal.dataobject.banner.BannerDO; import cn.iocoder.yudao.module.promotion.service.banner.BannerService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; @@ -23,7 +23,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; */ @RestController @RequestMapping("/market/banner") -@Api(tags = "用户APP- 首页Banner") +@Tag(name = "用户APP- 首页Banner") @Validated public class AppBannerController { @@ -32,7 +32,7 @@ public class AppBannerController { // TODO @xia:新建一个 AppBannerRespVO,只返回必要的字段。status 要过滤下。然后 sort 下结果 @GetMapping("/list") - @ApiOperation("获得banner列表") + @Operation(summary = "获得banner列表") @PreAuthorize("@ss.hasPermission('market:banner:query')") public CommonResult> getBannerList() { List list = bannerService.getBannerList(); diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/banner/BannerConvert.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/banner/BannerConvert.java index 87d2da187..3e2afeb49 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/banner/BannerConvert.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/banner/BannerConvert.java @@ -10,17 +10,11 @@ import org.mapstruct.factory.Mappers; import java.util.List; -/** - * Banner Convert - * - * @author xia - */ @Mapper public interface BannerConvert { BannerConvert INSTANCE = Mappers.getMapper(BannerConvert.class); - List convertList(List list); PageResult convertPage(PageResult pageResult); diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/framework/package-info.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/framework/package-info.java new file mode 100644 index 000000000..b2131910d --- /dev/null +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/framework/package-info.java @@ -0,0 +1,6 @@ +/** + * 属于 promotion 模块的 framework 封装 + * + * @author 芋道源码 + */ +package cn.iocoder.yudao.module.promotion.framework; diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/framework/web/config/PromotionWebConfiguration.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/framework/web/config/PromotionWebConfiguration.java new file mode 100644 index 000000000..37945474d --- /dev/null +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/framework/web/config/PromotionWebConfiguration.java @@ -0,0 +1,24 @@ +package cn.iocoder.yudao.module.promotion.framework.web.config; + +import cn.iocoder.yudao.framework.swagger.config.YudaoSwaggerAutoConfiguration; +import org.springdoc.core.GroupedOpenApi; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * promotion 模块的 web 组件的 Configuration + * + * @author 芋道源码 + */ +@Configuration(proxyBeanMethods = false) +public class PromotionWebConfiguration { + + /** + * promotion 模块的 API 分组 + */ + @Bean + public GroupedOpenApi promotionGroupedOpenApi() { + return YudaoSwaggerAutoConfiguration.buildGroupedOpenApi("promotion"); + } + +} diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/framework/web/package-info.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/framework/web/package-info.java new file mode 100644 index 000000000..8359130d4 --- /dev/null +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/framework/web/package-info.java @@ -0,0 +1,4 @@ +/** + * promotion 模块的 web 配置 + */ +package cn.iocoder.yudao.module.promotion.framework.web; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/TradeAfterSaleController.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/TradeAfterSaleController.java index f2c7b1cc1..a1bf5d544 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/TradeAfterSaleController.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/TradeAfterSaleController.java @@ -14,9 +14,9 @@ import cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo.TradeAfterSal import cn.iocoder.yudao.module.trade.convert.aftersale.TradeAfterSaleConvert; import cn.iocoder.yudao.module.trade.dal.dataobject.aftersale.TradeAfterSaleDO; import cn.iocoder.yudao.module.trade.service.aftersale.TradeAfterSaleService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import lombok.extern.slf4j.Slf4j; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -32,7 +32,7 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils. import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; -@Api(tags = "管理后台 - 交易售后") +@Tag(name = "管理后台 - 交易售后") @RestController @RequestMapping("/trade/after-sale") @Validated @@ -48,7 +48,7 @@ public class TradeAfterSaleController { private ProductPropertyValueApi productPropertyValueApi; @GetMapping("/page") - @ApiOperation("获得交易售后分页") + @Operation(summary = "获得交易售后分页") @PreAuthorize("@ss.hasPermission('trade:after-sale:query')") public CommonResult> getAfterSalePage(@Valid TradeAfterSalePageReqVO pageVO) { // 查询售后 @@ -67,8 +67,8 @@ public class TradeAfterSaleController { } @PutMapping("/agree") - @ApiOperation("同意售后") - @ApiImplicitParam(name = "id", value = "售后编号", required = true, example = "1") + @Operation(summary = "同意售后") + @Parameter(name = "id", description = "售后编号", required = true, example = "1") @PreAuthorize("@ss.hasPermission('trade:after-sale:agree')") public CommonResult agreeAfterSale(@RequestParam("id") Long id) { afterSaleService.agreeAfterSale(getLoginUserId(), id); @@ -76,7 +76,7 @@ public class TradeAfterSaleController { } @PutMapping("/disagree") - @ApiOperation("拒绝售后") + @Operation(summary = "拒绝售后") @PreAuthorize("@ss.hasPermission('trade:after-sale:disagree')") public CommonResult disagreeAfterSale(@RequestBody TradeAfterSaleDisagreeReqVO confirmReqVO) { afterSaleService.disagreeAfterSale(getLoginUserId(), confirmReqVO); @@ -84,8 +84,8 @@ public class TradeAfterSaleController { } @PutMapping("/receive") - @ApiOperation("确认收货") - @ApiImplicitParam(name = "id", value = "售后编号", required = true, example = "1") + @Operation(summary = "确认收货") + @Parameter(name = "id", description = "售后编号", required = true, example = "1") @PreAuthorize("@ss.hasPermission('trade:after-sale:receive')") public CommonResult receiveAfterSale(@RequestParam("id") Long id) { afterSaleService.receiveAfterSale(getLoginUserId(), id); @@ -93,8 +93,8 @@ public class TradeAfterSaleController { } @PutMapping("/refuse") - @ApiOperation("确认收货") - @ApiImplicitParam(name = "id", value = "售后编号", required = true, example = "1") + @Operation(summary = "确认收货") + @Parameter(name = "id", description = "售后编号", required = true, example = "1") @PreAuthorize("@ss.hasPermission('trade:after-sale:receive')") public CommonResult refuseAfterSale(TradeAfterSaleRefuseReqVO refuseReqVO) { afterSaleService.refuseAfterSale(getLoginUserId(), refuseReqVO); @@ -102,8 +102,8 @@ public class TradeAfterSaleController { } @PostMapping("/refund") - @ApiOperation(value = "确认退款") - @ApiImplicitParam(name = "id", value = "售后编号", required = true, example = "1") + @Operation(summary = "确认退款") + @Parameter(name = "id", description = "售后编号", required = true, example = "1") @PreAuthorize("@ss.hasPermission('trade:after-sale:refund')") public CommonResult refundAfterSale(@RequestParam("id") Long id) { afterSaleService.refundAfterSale(getLoginUserId(), getClientIP(), id); diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleBaseVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleBaseVO.java index 4277fadd3..a008619a0 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleBaseVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -17,103 +17,103 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @Data public class TradeAfterSaleBaseVO { - @ApiModelProperty(value = "售后流水号", required = true, example = "202211190847450020500077") + @Schema(description = "售后流水号", required = true, example = "202211190847450020500077") @NotNull(message = "售后流水号不能为空") private String no; - @ApiModelProperty(value = "售后状态", required = true, example = "10", notes = "参见 TradeAfterSaleStatusEnum 枚举") + @Schema(description = "售后状态", required = true, example = "10") @NotNull(message = "售后状态不能为空") private Integer status; - @ApiModelProperty(value = "售后类型", required = true, example = "20", notes = "参见 TradeAfterSaleTypeEnum 枚举") + @Schema(description = "售后类型", required = true, example = "20") @NotNull(message = "售后类型不能为空") private Integer type; - @ApiModelProperty(value = "售后方式", required = true, example = "10", notes = "参见 TradeAfterSaleWayEnum 枚举") + @Schema(description = "售后方式", required = true, example = "10") @NotNull(message = "售后方式不能为空") private Integer way; - @ApiModelProperty(value = "用户编号", required = true, example = "30337") + @Schema(description = "用户编号", required = true, example = "30337") @NotNull(message = "用户编号不能为空") private Long userId; - @ApiModelProperty(value = "申请原因", required = true, example = "不喜欢") + @Schema(description = "申请原因", required = true, example = "不喜欢") @NotNull(message = "申请原因不能为空") private String applyReason; - @ApiModelProperty(value = "补充描述", example = "你说的对") + @Schema(description = "补充描述", example = "你说的对") private String applyDescription; - @ApiModelProperty(value = "补充凭证图片", example = "https://www.iocoder.cn/1.png") + @Schema(description = "补充凭证图片", example = "https://www.iocoder.cn/1.png") private List applyPicUrls; - @ApiModelProperty(value = "订单编号", required = true, example = "18078") + @Schema(description = "订单编号", required = true, example = "18078") @NotNull(message = "订单编号不能为空") private Long orderId; - @ApiModelProperty(value = "订单流水号", required = true, example = "2022111917190001") + @Schema(description = "订单流水号", required = true, example = "2022111917190001") @NotNull(message = "订单流水号不能为空") private Long orderNo; - @ApiModelProperty(value = "订单项编号", required = true, example = "572") + @Schema(description = "订单项编号", required = true, example = "572") @NotNull(message = "订单项编号不能为空") private Long orderItemId; - @ApiModelProperty(value = "商品 SPU 编号", required = true, example = "2888") + @Schema(description = "商品 SPU 编号", required = true, example = "2888") @NotNull(message = "商品 SPU 编号不能为空") private Long spuId; - @ApiModelProperty(value = "商品 SPU 名称", required = true, example = "李四") + @Schema(description = "商品 SPU 名称", required = true, example = "李四") @NotNull(message = "商品 SPU 名称不能为空") private String spuName; - @ApiModelProperty(value = "商品 SKU 编号", required = true, example = "15657") + @Schema(description = "商品 SKU 编号", required = true, example = "15657") @NotNull(message = "商品 SKU 编号不能为空") private Long skuId; - @ApiModelProperty(value = "商品图片", example = "https://www.iocoder.cn/2.png") + @Schema(description = "商品图片", example = "https://www.iocoder.cn/2.png") private String picUrl; - @ApiModelProperty(value = "购买数量", required = true, example = "20012") + @Schema(description = "购买数量", required = true, example = "20012") @NotNull(message = "购买数量不能为空") private Integer count; - @ApiModelProperty(value = "审批时间") + @Schema(description = "审批时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime auditTime; - @ApiModelProperty(value = "审批人", example = "30835") + @Schema(description = "审批人", example = "30835") private Long auditUserId; - @ApiModelProperty(value = "审批备注", example = "不香") + @Schema(description = "审批备注", example = "不香") private String auditReason; - @ApiModelProperty(value = "退款金额,单位:分", required = true, example = "18077") + @Schema(description = "退款金额,单位:分", required = true, example = "18077") @NotNull(message = "退款金额,单位:分不能为空") private Integer refundPrice; - @ApiModelProperty(value = "支付退款编号", example = "10271") + @Schema(description = "支付退款编号", example = "10271") private Long payRefundId; - @ApiModelProperty(value = "退款时间") + @Schema(description = "退款时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime refundTime; - @ApiModelProperty(value = "退货物流公司编号", example = "10") + @Schema(description = "退货物流公司编号", example = "10") private Long logisticsId; - @ApiModelProperty(value = "退货物流单号", example = "610003952009") + @Schema(description = "退货物流单号", example = "610003952009") private String logisticsNo; - @ApiModelProperty(value = "退货时间") + @Schema(description = "退货时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime deliveryTime; - @ApiModelProperty(value = "收货时间") + @Schema(description = "收货时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime receiveTime; - @ApiModelProperty(value = "收货备注", example = "不喜欢") + @Schema(description = "收货备注", example = "不喜欢") private String receiveReason; } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleDisagreeReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleDisagreeReqVO.java index 67baca3b7..2ef43f4ce 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleDisagreeReqVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleDisagreeReqVO.java @@ -1,21 +1,20 @@ package cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 交易售后拒绝 Request VO") +@Schema(description = "管理后台 - 交易售后拒绝 Request VO") @Data public class TradeAfterSaleDisagreeReqVO { - @ApiModelProperty(value = "售后编号", required = true, example = "1024") + @Schema(description = "售后编号", required = true, example = "1024") @NotNull(message = "售后编号不能为空") private Long id; - @ApiModelProperty(value = "审批备注", required = true, example = "你猜") + @Schema(description = "审批备注", required = true, example = "你猜") @NotEmpty(message = "审批备注不能为空") private String auditReason; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSalePageReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSalePageReqVO.java index 628b8bc56..4c9431b5b 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSalePageReqVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSalePageReqVO.java @@ -5,8 +5,7 @@ import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.module.trade.enums.aftersale.TradeAfterSaleStatusEnum; import cn.iocoder.yudao.module.trade.enums.aftersale.TradeAfterSaleTypeEnum; import cn.iocoder.yudao.module.trade.enums.aftersale.TradeAfterSaleWayEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -16,34 +15,34 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 交易售后分页 Request VO") +@Schema(description = "管理后台 - 交易售后分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class TradeAfterSalePageReqVO extends PageParam { - @ApiModelProperty(value = "售后流水号", example = "202211190847450020500077", notes = "模糊匹配") + @Schema(description = "售后流水号", example = "202211190847450020500077") private String no; - @ApiModelProperty(value = "售后状态", example = "10", notes = "参见 TradeAfterSaleStatusEnum 枚举") + @Schema(description = "售后状态", example = "10") @InEnum(value = TradeAfterSaleStatusEnum.class, message = "售后状态必须是 {value}") private Integer status; - @ApiModelProperty(value = "售后类型", example = "20", notes = "参见 TradeAfterSaleTypeEnum 枚举") + @Schema(description = "售后类型", example = "20") @InEnum(value = TradeAfterSaleTypeEnum.class, message = "售后类型必须是 {value}") private Integer type; - @ApiModelProperty(value = "售后方式", example = "10", notes = "参见 TradeAfterSaleWayEnum 枚举") + @Schema(description = "售后方式", example = "10") @InEnum(value = TradeAfterSaleWayEnum.class, message = "售后方式必须是 {value}") private Integer way; - @ApiModelProperty(value = "订单编号", example = "18078", notes = "模糊匹配") + @Schema(description = "订单编号", example = "18078") private String orderNo; - @ApiModelProperty(value = "商品 SPU 名称", example = "李四", notes = "模糊匹配") + @Schema(description = "商品 SPU 名称", example = "李四") private String spuName; - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleRefuseReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleRefuseReqVO.java index b74d73c7c..a9db6a1a5 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleRefuseReqVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleRefuseReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 交易售后拒绝收货 Request VO") +@Schema(description = "管理后台 - 交易售后拒绝收货 Request VO") @Data public class TradeAfterSaleRefuseReqVO { - @ApiModelProperty(value = "售后编号", required = true, example = "1024") + @Schema(description = "售后编号", required = true, example = "1024") @NotNull(message = "售后编号不能为空") private Long id; - @ApiModelProperty(value = "收货备注", required = true, example = "你猜") + @Schema(description = "收货备注", required = true, example = "你猜") @NotNull(message = "收货备注不能为空") private String refuseMemo; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleRespPageItemVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleRespPageItemVO.java index f57676bdc..29180dcaf 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleRespPageItemVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleRespPageItemVO.java @@ -2,8 +2,7 @@ package cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo; import cn.iocoder.yudao.module.trade.controller.admin.base.member.user.MemberUserRespVO; import cn.iocoder.yudao.module.trade.controller.admin.base.product.property.ProductPropertyValueDetailRespVO; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -11,16 +10,16 @@ import lombok.ToString; import java.time.LocalDateTime; import java.util.List; -@ApiModel("管理后台 - 交易售后分页的每一条记录 Response VO") +@Schema(description = "管理后台 - 交易售后分页的每一条记录 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class TradeAfterSaleRespPageItemVO extends TradeAfterSaleBaseVO { - @ApiModelProperty(value = "售后编号", required = true, example = "27630") + @Schema(description = "售后编号", required = true, example = "27630") private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; /** diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/log/TradeAfterSaleLogRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/log/TradeAfterSaleLogRespVO.java index 990182499..10b3cecbb 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/log/TradeAfterSaleLogRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/log/TradeAfterSaleLogRespVO.java @@ -1,51 +1,50 @@ package cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo.log; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; import java.time.LocalDateTime; -@ApiModel("管理后台 - 交易售后日志 Response VO") +@Schema(description = "管理后台 - 交易售后日志 Response VO") @Data public class TradeAfterSaleLogRespVO { - @ApiModelProperty(value = "编号", required = true, example = "20669") + @Schema(description = "编号", required = true, example = "20669") private Long id; - @ApiModelProperty(value = "用户编号", required = true, example = "22634") + @Schema(description = "用户编号", required = true, example = "22634") @NotNull(message = "用户编号不能为空") private Long userId; - @ApiModelProperty(value = "用户类型", required = true, example = "2") + @Schema(description = "用户类型", required = true, example = "2") @NotNull(message = "用户类型不能为空") private Integer userType; - @ApiModelProperty(value = "售后编号", required = true, example = "3023") + @Schema(description = "售后编号", required = true, example = "3023") @NotNull(message = "售后编号不能为空") private Long afterSaleId; - @ApiModelProperty(value = "订单编号", required = true, example = "25870") + @Schema(description = "订单编号", required = true, example = "25870") @NotNull(message = "订单编号不能为空") private Long orderId; - @ApiModelProperty(value = "订单项编号", required = true, example = "23154") + @Schema(description = "订单项编号", required = true, example = "23154") @NotNull(message = "订单项编号不能为空") private Long orderItemId; - @ApiModelProperty(value = "售后状态(之前)", example = "2", notes = "参见 TradeAfterSaleStatusEnum 枚举") + @Schema(description = "售后状态(之前)", example = "2") private Integer beforeStatus; - @ApiModelProperty(value = "售后状态(之后)", required = true, example = "1", notes = "参见 TradeAfterSaleStatusEnum 枚举") + @Schema(description = "售后状态(之后)", required = true, example = "1") @NotNull(message = "售后状态(之后)不能为空") private Integer afterStatus; - @ApiModelProperty(value = "操作明细", required = true, example = "维权完成,退款金额:¥37776.00") + @Schema(description = "操作明细", required = true, example = "维权完成,退款金额:¥37776.00") @NotNull(message = "操作明细不能为空") private String content; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/member/user/MemberUserRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/member/user/MemberUserRespVO.java index 4f3545a91..4177b1c01 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/member/user/MemberUserRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/member/user/MemberUserRespVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.trade.controller.admin.base.member.user; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@ApiModel("管理后台 - 会员用户 Response VO") +@Schema(description = "管理后台 - 会员用户 Response VO") @Data public class MemberUserRespVO { - @ApiModelProperty(value = "用户 ID", required = true, example = "1") + @Schema(description = "用户 ID", required = true, example = "1") private Long id; - @ApiModelProperty(value = "用户昵称", required = true, example = "芋道源码") + @Schema(description = "用户昵称", required = true, example = "芋道源码") private String nickname; - @ApiModelProperty(value = "用户头像", example = "https://www.iocoder.cn/xxx.png") + @Schema(description = "用户头像", example = "https://www.iocoder.cn/xxx.png") private String avatar; } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/product/property/ProductPropertyValueDetailRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/product/property/ProductPropertyValueDetailRespVO.java index b9978770c..9b8fe88eb 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/product/property/ProductPropertyValueDetailRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/product/property/ProductPropertyValueDetailRespVO.java @@ -1,23 +1,22 @@ package cn.iocoder.yudao.module.trade.controller.admin.base.product.property; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@ApiModel("管理后台 - 商品属性值的明细 Response VO") +@Schema(description = "管理后台 - 商品属性值的明细 Response VO") @Data public class ProductPropertyValueDetailRespVO { - @ApiModelProperty(value = "属性的编号", required = true, example = "1") + @Schema(description = "属性的编号", required = true, example = "1") private Long propertyId; - @ApiModelProperty(value = "属性的名称", required = true, example = "颜色") + @Schema(description = "属性的名称", required = true, example = "颜色") private String propertyName; - @ApiModelProperty(value = "属性值的编号", required = true, example = "1024") + @Schema(description = "属性值的编号", required = true, example = "1024") private Long valueId; - @ApiModelProperty(value = "属性值的名称", required = true, example = "红色") + @Schema(description = "属性值的名称", required = true, example = "红色") private String valueName; } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/TradeOrderController.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/TradeOrderController.java index 58f3bf318..75f05ff86 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/TradeOrderController.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/TradeOrderController.java @@ -15,9 +15,9 @@ import cn.iocoder.yudao.module.trade.convert.order.TradeOrderConvert; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO; import cn.iocoder.yudao.module.trade.service.order.TradeOrderService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import lombok.extern.slf4j.Slf4j; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -30,7 +30,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; -@Api(tags = "管理后台 - 交易订单") +@Tag(name = "管理后台 - 交易订单") @RestController @RequestMapping("/trade/order") @Validated @@ -46,7 +46,7 @@ public class TradeOrderController { private MemberUserApi memberUserApi; @GetMapping("/page") - @ApiOperation("获得交易订单分页") + @Operation(summary = "获得交易订单分页") @PreAuthorize("@ss.hasPermission('trade:order:query')") public CommonResult> getOrderPage(TradeOrderPageReqVO reqVO) { // 查询订单 @@ -65,8 +65,8 @@ public class TradeOrderController { } @GetMapping("/get-detail") - @ApiOperation("获得交易订单详情") - @ApiImplicitParam(name = "id", value = "订单编号", required = true, example = "1") + @Operation(summary = "获得交易订单详情") + @Parameter(name = "id", description = "订单编号", required = true, example = "1") @PreAuthorize("@ss.hasPermission('trade:order:query')") public CommonResult getOrderDetail(@RequestParam("id") Long id) { // 查询订单 @@ -83,7 +83,7 @@ public class TradeOrderController { } @PostMapping("/delivery") - @ApiOperation("发货订单") + @Operation(summary = "发货订单") @PreAuthorize("@ss.hasPermission('trade:order:delivery')") public CommonResult deliveryOrder(@RequestBody TradeOrderDeliveryReqVO deliveryReqVO) { tradeOrderService.deliveryOrder(getLoginUserId(), deliveryReqVO); diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderBaseVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderBaseVO.java index 1669bc1ff..5fef8841f 100755 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderBaseVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.trade.controller.admin.order.vo; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; @@ -15,131 +15,131 @@ public class TradeOrderBaseVO { // ========== 订单基本信息 ========== - @ApiModelProperty(value = "订单编号", required = true, example = "1024") + @Schema(description = "订单编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "订单流水号", required = true, example = "1146347329394184195") + @Schema(description = "订单流水号", required = true, example = "1146347329394184195") private String no; - @ApiModelProperty(value = "创建时间", required = true, notes = "下单时间") + @Schema(description = "下单时间", required = true) private Date createTime; - @ApiModelProperty(value = "订单类型", required = true, example = "1", notes = "参见 TradeOrderTypeEnum 枚举") + @Schema(description = "订单类型", required = true, example = "1") private Integer type; - @ApiModelProperty(value = "订单来源", required = true, example = "1", notes = "参见 TerminalEnum 枚举") + @Schema(description = "订单来源", required = true, example = "1") private Integer terminal; - @ApiModelProperty(value = "用户编号", required = true, example = "2048") + @Schema(description = "用户编号", required = true, example = "2048") private Long userId; - @ApiModelProperty(value = "用户 IP", required = true, example = "127.0.0.1") + @Schema(description = "用户 IP", required = true, example = "127.0.0.1") private String userIp; - @ApiModelProperty(value = "用户备注", required = true, example = "你猜") + @Schema(description = "用户备注", required = true, example = "你猜") private String userRemark; - @ApiModelProperty(value = "订单状态", required = true, example = "1", notes = "参见 TradeOrderStatusEnum 枚举") + @Schema(description = "订单状态", required = true, example = "1") private Integer status; - @ApiModelProperty(value = "购买的商品数量", required = true, example = "10") + @Schema(description = "购买的商品数量", required = true, example = "10") private Integer productCount; - @ApiModelProperty(value = "订单完成时间") + @Schema(description = "订单完成时间") private LocalDateTime finishTime; - @ApiModelProperty(value = "订单取消时间") + @Schema(description = "订单取消时间") private LocalDateTime cancelTime; - @ApiModelProperty(value = "取消类型", example = "10", notes = "参见 TradeOrderCancelTypeEnum 枚举") + @Schema(description = "取消类型", example = "10") private Integer cancelType; - @ApiModelProperty(value = "商家备注", example = "你猜一下") + @Schema(description = "商家备注", example = "你猜一下") private String remark; // ========== 价格 + 支付基本信息 ========== - @ApiModelProperty(value = "支付订单编号", required = true, example = "1024") + @Schema(description = "支付订单编号", required = true, example = "1024") private Long payOrderId; - @ApiModelProperty(value = "是否已支付", required = true, example = "true") + @Schema(description = "是否已支付", required = true, example = "true") private Boolean payed; - @ApiModelProperty(value = "付款时间") + @Schema(description = "付款时间") private LocalDateTime payTime; - @ApiModelProperty(value = "支付渠道", required = true, example = "wx_lite", notes = "参见 PayChannelEnum 枚举") + @Schema(description = "支付渠道", required = true, example = "wx_lite") private String payChannelCode; - @ApiModelProperty(value = "商品原价(总)", required = true, example = "1000", notes = "单位:分") + @Schema(description = "商品原价(总)", required = true, example = "1000") private Integer originalPrice; - @ApiModelProperty(value = "订单原价(总)", required = true, example = "1000", notes = "单位:分") + @Schema(description = "订单原价(总)", required = true, example = "1000") private Integer orderPrice; - @ApiModelProperty(value = "订单优惠(总)", required = true, example = "100", notes = "单位:分") + @Schema(description = "订单优惠(总)", required = true, example = "100") private Integer discountPrice; - @ApiModelProperty(value = "运费金额", required = true, example = "100", notes = "单位:分") + @Schema(description = "运费金额", required = true, example = "100") private Integer deliveryPrice; - @ApiModelProperty(value = "订单调价(总)", required = true, example = "100", notes = "单位:分") + @Schema(description = "订单调价(总)", required = true, example = "100") private Integer adjustPrice; - @ApiModelProperty(value = "应付金额(总)", required = true, example = "1000", notes = "单位:分") + @Schema(description = "应付金额(总)", required = true, example = "1000") private Integer payPrice; // ========== 收件 + 物流基本信息 ========== - @ApiModelProperty(value = "配送模板编号", example = "1024") + @Schema(description = "配送模板编号", example = "1024") private Long deliveryTemplateId; - @ApiModelProperty(value = "发货物流公司编号", example = "1024") + @Schema(description = "发货物流公司编号", example = "1024") private Long logisticsId; - @ApiModelProperty(value = "发货物流单号", example = "1024") + @Schema(description = "发货物流单号", example = "1024") private String logisticsNo; - @ApiModelProperty(value = "发货状态", required = true, example = "1", notes = "参见 TradeOrderDeliveryStatusEnum 枚举") + @Schema(description = "发货状态", required = true, example = "1") private Integer deliveryStatus; - @ApiModelProperty(value = "发货时间") + @Schema(description = "发货时间") private LocalDateTime deliveryTime; - @ApiModelProperty(value = "收货时间") + @Schema(description = "收货时间") private LocalDateTime receiveTime; - @ApiModelProperty(value = "收件人名称", required = true, example = "张三") + @Schema(description = "收件人名称", required = true, example = "张三") private String receiverName; - @ApiModelProperty(value = "收件人手机", required = true, example = "13800138000") + @Schema(description = "收件人手机", required = true, example = "13800138000") private String receiverMobile; - @ApiModelProperty(value = "收件人地区编号", required = true, example = "110000") + @Schema(description = "收件人地区编号", required = true, example = "110000") private Integer receiverAreaId; - @ApiModelProperty(value = "收件人邮编", required = true, example = "100000") + @Schema(description = "收件人邮编", required = true, example = "100000") private Integer receiverPostCode; - @ApiModelProperty(value = "收件人详细地址", required = true, example = "中关村大街 1 号") + @Schema(description = "收件人详细地址", required = true, example = "中关村大街 1 号") private String receiverDetailAddress; // ========== 售后基本信息 ========== - @ApiModelProperty(value = "售后状态", example = "1", notes = "参见 TradeOrderAfterSaleStatusEnum 枚举") + @Schema(description = "售后状态", example = "1") private Integer afterSaleStatus; - @ApiModelProperty(value = "退款金额", required = true, example = "100", notes = "单位:分") + @Schema(description = "退款金额", required = true, example = "100") private Integer refundPrice; // ========== 营销基本信息 ========== - @ApiModelProperty(value = "优惠劵编号", example = "1024") + @Schema(description = "优惠劵编号", example = "1024") private Long couponId; - @ApiModelProperty(value = "优惠劵减免金额", required = true, example = "100", notes = "单位:分") + @Schema(description = "优惠劵减免金额", required = true, example = "100") private Integer couponPrice; - @ApiModelProperty(value = "积分抵扣的金额", required = true, example = "100", notes = "单位:分") + @Schema(description = "积分抵扣的金额", required = true, example = "100") private Integer pointPrice; } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderDeliveryReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderDeliveryReqVO.java index e75fcacf2..8cb16f89f 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderDeliveryReqVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderDeliveryReqVO.java @@ -1,25 +1,24 @@ package cn.iocoder.yudao.module.trade.controller.admin.order.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 订单发货 Request VO") +@Schema(description = "管理后台 - 订单发货 Request VO") @Data public class TradeOrderDeliveryReqVO { - @ApiModelProperty(name = "订单编号", required = true, example = "1024") + @Schema(description = "订单编号", required = true, example = "1024") @NotNull(message = "订单编号不能为空") private Long id; - @ApiModelProperty(name = "发货物流公司编号", required = true, example = "1") + @Schema(description = "发货物流公司编号", required = true, example = "1") @NotNull(message = "发货物流公司编号不能为空") private Long logisticsId; - @ApiModelProperty(name = "发货物流单号", required = true, example = "SF123456789") + @Schema(description = "发货物流单号", required = true, example = "SF123456789") @NotEmpty(message = "发货物流单号不能为空") private String logisticsNo; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderDetailRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderDetailRespVO.java index a5fe26fda..f24716e16 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderDetailRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderDetailRespVO.java @@ -2,17 +2,16 @@ package cn.iocoder.yudao.module.trade.controller.admin.order.vo; import cn.iocoder.yudao.module.trade.controller.admin.base.member.user.MemberUserRespVO; import cn.iocoder.yudao.module.trade.controller.admin.base.product.property.ProductPropertyValueDetailRespVO; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.List; -@ApiModel("管理后台 - 交易订单的详情 Response VO") +@Schema(description = "管理后台 - 交易订单的详情 Response VO") @Data public class TradeOrderDetailRespVO extends TradeOrderBaseVO { - @ApiModelProperty(value = "收件人地区名字", required = true, example = "上海 上海市 普陀区") + @Schema(description = "收件人地区名字", required = true, example = "上海 上海市 普陀区") private String receiverAreaName; /** @@ -25,7 +24,7 @@ public class TradeOrderDetailRespVO extends TradeOrderBaseVO { */ private MemberUserRespVO user; - @ApiModel("管理后台 - 交易订单的详情的订单项目") + @Schema(description = "管理后台 - 交易订单的详情的订单项目") @Data public static class Item extends TradeOrderItemBaseVO { diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderItemBaseVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderItemBaseVO.java index 8e55b8ea7..b927e5e9e 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderItemBaseVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderItemBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.trade.controller.admin.order.vo; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; /** @@ -12,50 +12,50 @@ public class TradeOrderItemBaseVO { // ========== 订单项基本信息 ========== - @ApiModelProperty(value = "编号", required = true, example = "1") + @Schema(description = "编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "用户编号", required = true, example = "1") + @Schema(description = "用户编号", required = true, example = "1") private Long userId; - @ApiModelProperty(value = "订单编号", required = true, example = "1") + @Schema(description = "订单编号", required = true, example = "1") private Long orderId; // ========== 商品基本信息 ========== - @ApiModelProperty(value = "商品 SPU 编号", required = true, example = "1") + @Schema(description = "商品 SPU 编号", required = true, example = "1") private Long spuId; - @ApiModelProperty(value = "商品 SPU 名称", required = true, example = "芋道源码") + @Schema(description = "商品 SPU 名称", required = true, example = "芋道源码") private String spuName; - @ApiModelProperty(value = "商品 SKU 编号", required = true, example = "1") + @Schema(description = "商品 SKU 编号", required = true, example = "1") private Long skuId; - @ApiModelProperty(value = "商品图片", required = true, example = "https://www.iocoder.cn/1.png") + @Schema(description = "商品图片", required = true, example = "https://www.iocoder.cn/1.png") private String picUrl; - @ApiModelProperty(value = "购买数量", required = true, example = "1") + @Schema(description = "购买数量", required = true, example = "1") private Integer count; // ========== 价格 + 支付基本信息 ========== - @ApiModelProperty(value = "商品原价(总)", required = true, example = "100", notes = "单位:分") + @Schema(description = "商品原价(总)", required = true, example = "100") private Integer originalPrice; - @ApiModelProperty(value = "商品原价(单)", required = true, example = "100", notes = "单位:分") + @Schema(description = "商品原价(单)", required = true, example = "100") private Integer originalUnitPrice; - @ApiModelProperty(value = "商品优惠(总)", required = true, example = "100", notes = "单位:分") + @Schema(description = "商品优惠(总)", required = true, example = "100") private Integer discountPrice; - @ApiModelProperty(value = "商品实付金额(总)", required = true, example = "100", notes = "单位:分") + @Schema(description = "商品实付金额(总)", required = true, example = "100") private Integer payPrice; - @ApiModelProperty(value = "子订单分摊金额(总)", required = true, example = "100", notes = "单位:分") + @Schema(description = "子订单分摊金额(总)", required = true, example = "100") private Integer orderPartPrice; - @ApiModelProperty(value = "分摊后子订单实付金额(总)", required = true, example = "100", notes = "单位:分") + @Schema(description = "分摊后子订单实付金额(总)", required = true, example = "100") private Integer orderDividePrice; // ========== 营销基本信息 ========== @@ -64,7 +64,7 @@ public class TradeOrderItemBaseVO { // ========== 售后基本信息 ========== - @ApiModelProperty(value = "售后状态", required = true, example = "1", notes = "参见 TradeOrderItemAfterSaleStatusEnum 枚举类") + @Schema(description = "售后状态", required = true, example = "1") private Integer afterSaleStatus; } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageItemRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageItemRespVO.java index deb71d819..fc02acbc5 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageItemRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageItemRespVO.java @@ -1,17 +1,16 @@ package cn.iocoder.yudao.module.trade.controller.admin.order.vo; import cn.iocoder.yudao.module.trade.controller.admin.base.product.property.ProductPropertyValueDetailRespVO; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.List; -@ApiModel("管理后台 - 交易订单的分页项 Response VO") +@Schema(description = "管理后台 - 交易订单的分页项 Response VO") @Data public class TradeOrderPageItemRespVO extends TradeOrderBaseVO { - @ApiModelProperty(value = "收件人地区名字", required = true, example = "上海 上海市 普陀区") + @Schema(description = "收件人地区名字", required = true, example = "上海 上海市 普陀区") private String receiverAreaName; /** @@ -19,7 +18,7 @@ public class TradeOrderPageItemRespVO extends TradeOrderBaseVO { */ private List items; - @ApiModel("管理后台 - 交易订单的分页项的订单项目") + @Schema(description = "管理后台 - 交易订单的分页项的订单项目") @Data public static class Item extends TradeOrderItemBaseVO { diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageReqVO.java index 4295d8c3d..a09e15271 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageReqVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageReqVO.java @@ -4,8 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.framework.common.validation.Mobile; import cn.iocoder.yudao.module.trade.enums.order.TradeOrderStatusEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -13,41 +12,41 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 交易订单的分页 Request VO") +@Schema(description = "管理后台 - 交易订单的分页 Request VO") @Data public class TradeOrderPageReqVO extends PageParam { - @ApiModelProperty(value = "订单号", example = "88888888", notes = "模糊匹配") + @Schema(description = "订单号", example = "88888888") private String no; - @ApiModelProperty(value = "用户编号", example = "1024") + @Schema(description = "用户编号", example = "1024") private Long userId; - @ApiModelProperty(value = "用户昵称", example = "小王", notes = "模糊匹配") + @Schema(description = "用户昵称", example = "小王") private String userNickname; - @ApiModelProperty(value = "用户手机号", example = "小王", notes = "精准匹配") + @Schema(description = "用户手机号", example = "小王") @Mobile private String userMobile; - @ApiModelProperty(value = "收件人名称", example = "小红", notes = "模糊匹配") + @Schema(description = "收件人名称", example = "小红") private String receiverName; - @ApiModelProperty(value = "收件人手机", example = "1560", notes = "模糊匹配") + @Schema(description = "收件人手机", example = "1560") @Mobile private String receiverMobile; - @ApiModelProperty(value = "订单类型", example = "1", notes = "参见 TradeOrderTypeEnum 枚举") + @Schema(description = "订单类型", example = "1") private Integer type; - @ApiModelProperty(value = "订单状态", example = "1", notes = "参见 TradeOrderStatusEnum 枚举") + @Schema(description = "订单状态", example = "1") @InEnum(value = TradeOrderStatusEnum.class, message = "订单状态必须是 {value}") private Integer status; - @ApiModelProperty(value = "支付渠道", example = "wx_lite") + @Schema(description = "支付渠道", example = "wx_lite") private String payChannelCode; - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/AppTradeAfterSaleController.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/AppTradeAfterSaleController.java index 5c1758f3b..c78a10e36 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/AppTradeAfterSaleController.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/AppTradeAfterSaleController.java @@ -4,9 +4,9 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppTradeAfterSaleCreateReqVO; import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppTradeAfterSaleDeliveryReqVO; import cn.iocoder.yudao.module.trade.service.aftersale.TradeAfterSaleService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -16,7 +16,7 @@ import javax.annotation.Resource; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; -@Api(tags = "用户 App - 交易售后") +@Tag(name = "用户 App - 交易售后") @RestController @RequestMapping("/trade/after-sale") @Validated @@ -27,21 +27,21 @@ public class AppTradeAfterSaleController { private TradeAfterSaleService afterSaleService; @PostMapping(value = "/create") - @ApiOperation(value = "申请售后") + @Operation(summary = "申请售后") public CommonResult createAfterSale(@RequestBody AppTradeAfterSaleCreateReqVO createReqVO) { return success(afterSaleService.createAfterSale(getLoginUserId(), createReqVO)); } @PostMapping(value = "/delivery") - @ApiOperation(value = "退回货物") + @Operation(summary = "退回货物") public CommonResult deliveryAfterSale(@RequestBody AppTradeAfterSaleDeliveryReqVO deliveryReqVO) { afterSaleService.deliveryAfterSale(getLoginUserId(), deliveryReqVO); return success(true); } @DeleteMapping(value = "/cancel") - @ApiOperation(value = "取消售后") - @ApiImplicitParam(name = "id", value = "售后编号", required = true, example = "1") + @Operation(summary = "取消售后") + @Parameter(name = "id", description = "售后编号", required = true, example = "1") public CommonResult cancelAfterSale(@RequestParam("id") Long id) { afterSaleService.cancelAfterSale(getLoginUserId(), id); return success(true); diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/vo/AppTradeAfterSaleCreateReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/vo/AppTradeAfterSaleCreateReqVO.java index b5ea83904..d668005e3 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/vo/AppTradeAfterSaleCreateReqVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/vo/AppTradeAfterSaleCreateReqVO.java @@ -2,40 +2,39 @@ package cn.iocoder.yudao.module.trade.controller.app.aftersale.vo; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.module.trade.enums.aftersale.TradeAfterSaleWayEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import java.util.List; -@ApiModel("用户 App - 交易售后创建 Request VO") +@Schema(description = "用户 App - 交易售后创建 Request VO") @Data public class AppTradeAfterSaleCreateReqVO { - @ApiModelProperty(name = "订单项编号", required = true, example = "1024") + @Schema(description = "订单项编号", required = true, example = "1024") @NotNull(message = "订单项编号不能为空") private Long orderItemId; - @ApiModelProperty(name = "售后方式", required = true, example = "1", notes = "对应 TradeAfterSaleWayEnum 枚举") + @Schema(description = "售后方式", required = true, example = "1") @NotNull(message = "售后方式不能为空") @InEnum(value = TradeAfterSaleWayEnum.class, message = "售后方式必须是 {value}") private Integer way; - @ApiModelProperty(name = "退款金额", required = true, example = "100", notes = "单位:分") + @Schema(description = "退款金额", required = true, example = "100") @NotNull(message = "退款金额不能为空") @Min(value = 1, message = "退款金额必须大于 0") private Integer refundPrice; - @ApiModelProperty(name = "申请原因", required = true, example = "1", notes = "使用数据字典枚举,对应 trade_refund_apply_reason 类型") + @Schema(description = "申请原因", required = true, example = "1") @NotNull(message = "申请原因不能为空") private String applyReason; - @ApiModelProperty(name = "补充描述", example = "商品质量不好") + @Schema(description = "补充描述", example = "商品质量不好") private String applyDescription; - @ApiModelProperty(name = "补充凭证图片", example = "https://www.iocoder.cn/1.png, https://www.iocoder.cn/2.png") + @Schema(description = "补充凭证图片", example = "https://www.iocoder.cn/1.png, https://www.iocoder.cn/2.png") private List applyPicUrls; } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/vo/AppTradeAfterSaleDeliveryReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/vo/AppTradeAfterSaleDeliveryReqVO.java index c59d00034..9266d38d1 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/vo/AppTradeAfterSaleDeliveryReqVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/vo/AppTradeAfterSaleDeliveryReqVO.java @@ -1,30 +1,29 @@ package cn.iocoder.yudao.module.trade.controller.app.aftersale.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.time.LocalDateTime; -@ApiModel("用户 App - 交易售后退回货物 Request VO") +@Schema(description = "用户 App - 交易售后退回货物 Request VO") @Data public class AppTradeAfterSaleDeliveryReqVO { - @ApiModelProperty(name = "售后编号", required = true, example = "1024") + @Schema(description = "售后编号", required = true, example = "1024") @NotNull(message = "售后编号不能为空") private Long id; - @ApiModelProperty(name = "退货物流公司编号", required = true, example = "1") + @Schema(description = "退货物流公司编号", required = true, example = "1") @NotNull(message = "退货物流公司编号不能为空") private Long logisticsId; - @ApiModelProperty(name = "退货物流单号", required = true, example = "SF123456789") + @Schema(description = "退货物流单号", required = true, example = "SF123456789") @NotNull(message = "退货物流单号不能为空") private String logisticsNo; - @ApiModelProperty(name = "退货时间", required = true) + @Schema(description = "退货时间", required = true) @NotEmpty(message = "退货时间不能为空") private LocalDateTime deliveryTime; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/base/property/AppProductPropertyValueDetailRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/base/property/AppProductPropertyValueDetailRespVO.java index bd5543b5f..22dda6a71 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/base/property/AppProductPropertyValueDetailRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/base/property/AppProductPropertyValueDetailRespVO.java @@ -1,23 +1,22 @@ package cn.iocoder.yudao.module.trade.controller.app.base.property; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@ApiModel("用户 App - 商品属性值的明细 Response VO") +@Schema(description = "用户 App - 商品属性值的明细 Response VO") @Data public class AppProductPropertyValueDetailRespVO { - @ApiModelProperty(value = "属性的编号", required = true, example = "1") + @Schema(description = "属性的编号", required = true, example = "1") private Long propertyId; - @ApiModelProperty(value = "属性的名称", required = true, example = "颜色") + @Schema(description = "属性的名称", required = true, example = "颜色") private String propertyName; - @ApiModelProperty(value = "属性值的编号", required = true, example = "1024") + @Schema(description = "属性值的编号", required = true, example = "1024") private Long valueId; - @ApiModelProperty(value = "属性值的名称", required = true, example = "红色") + @Schema(description = "属性值的名称", required = true, example = "红色") private String valueName; } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/base/sku/AppProductSkuBaseRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/base/sku/AppProductSkuBaseRespVO.java index e95b261d2..053e329b4 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/base/sku/AppProductSkuBaseRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/base/sku/AppProductSkuBaseRespVO.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.module.trade.controller.app.base.sku; import cn.iocoder.yudao.module.trade.controller.app.base.property.AppProductPropertyValueDetailRespVO; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.List; @@ -14,16 +14,16 @@ import java.util.List; @Data public class AppProductSkuBaseRespVO { - @ApiModelProperty(value = "主键", required = true, example = "1024") + @Schema(description = "主键", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "商品 SKU 名字", required = true, example = "芋道") + @Schema(description = "商品 SKU 名字", required = true, example = "芋道") private String name; - @ApiModelProperty(value = "图片地址", example = "https://www.iocoder.cn/xx.png") + @Schema(description = "图片地址", example = "https://www.iocoder.cn/xx.png") private String picUrl; - @ApiModelProperty(value = "库存", required = true, example = "1") + @Schema(description = "库存", required = true, example = "1") private Integer stock; /** diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/base/spu/AppProductSpuBaseRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/base/spu/AppProductSpuBaseRespVO.java index c7d9f236f..b73be6e0c 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/base/spu/AppProductSpuBaseRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/base/spu/AppProductSpuBaseRespVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.trade.controller.app.base.spu; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.List; @@ -13,13 +13,13 @@ import java.util.List; @Data public class AppProductSpuBaseRespVO { - @ApiModelProperty(value = "主键", required = true, example = "1024") + @Schema(description = "主键", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "商品 SPU 名字", required = true, example = "芋道") + @Schema(description = "商品 SPU 名字", required = true, example = "芋道") private String name; - @ApiModelProperty(value = "商品主图地址", example = "https://www.iocoder.cn/xx.png") + @Schema(description = "商品主图地址", example = "https://www.iocoder.cn/xx.png") private List picUrls; } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/TradeCartController.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/TradeCartController.java index e3688d155..46512a959 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/TradeCartController.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/TradeCartController.java @@ -7,9 +7,9 @@ import cn.iocoder.yudao.module.trade.controller.app.cart.vo.AppTradeCartItemAddC import cn.iocoder.yudao.module.trade.controller.app.cart.vo.AppTradeCartItemUpdateCountReqVO; import cn.iocoder.yudao.module.trade.controller.app.cart.vo.AppTradeCartItemUpdateSelectedReqVO; import cn.iocoder.yudao.module.trade.service.cart.TradeCartService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; @@ -22,7 +22,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; -@Api(tags = "用户 App - 购物车") +@Tag(name = "用户 App - 购物车") @RestController @RequestMapping("/trade/cart") @RequiredArgsConstructor @@ -34,7 +34,7 @@ public class TradeCartController { private TradeCartService cartService; @PostMapping("/add-count") - @ApiOperation("添加商品到购物车") + @Operation(summary = "添加商品到购物车") @PreAuthenticated public CommonResult addCartItemCount(@Valid @RequestBody AppTradeCartItemAddCountReqVO addCountReqVO) { cartService.addCartItemCount(getLoginUserId(), addCountReqVO); @@ -42,7 +42,7 @@ public class TradeCartController { } @PutMapping("update-count") - @ApiOperation("更新购物车商品数量") + @Operation(summary = "更新购物车商品数量") @PreAuthenticated public CommonResult updateCartItemQuantity(@Valid @RequestBody AppTradeCartItemUpdateCountReqVO updateCountReqVO) { cartService.updateCartItemCount(getLoginUserId(), updateCountReqVO); @@ -50,7 +50,7 @@ public class TradeCartController { } @PutMapping("update-selected") - @ApiOperation("更新购物车商品是否选中") + @Operation(summary = "更新购物车商品是否选中") @PreAuthenticated public CommonResult updateCartItemSelected(@Valid @RequestBody AppTradeCartItemUpdateSelectedReqVO updateSelectedReqVO) { cartService.updateCartItemSelected(getLoginUserId(), updateSelectedReqVO); @@ -59,8 +59,8 @@ public class TradeCartController { } @DeleteMapping("/delete") - @ApiOperation("删除购物车商品") - @ApiImplicitParam(name = "skuIds", value = "商品 SKU 编号的数组", required = true, example = "1024,2048", dataTypeClass = List.class) + @Operation(summary = "删除购物车商品") + @Parameter(name = "skuIds", description = "商品 SKU 编号的数组", required = true, example = "1024,2048") @PreAuthenticated public CommonResult deleteCartItem(@RequestParam("skuIds") List skuIds) { cartService.deleteCartItems(getLoginUserId(), skuIds); @@ -68,14 +68,14 @@ public class TradeCartController { } @GetMapping("get-count") - @ApiOperation("查询用户在购物车中的商品数量") + @Operation(summary = "查询用户在购物车中的商品数量") @PreAuthenticated public CommonResult getCartCount() { return success(cartService.getCartCount(getLoginUserId())); } @GetMapping("/get-detail") - @ApiOperation("查询用户的购物车的详情") + @Operation(summary = "查询用户的购物车的详情") @PreAuthenticated public CommonResult getCartDetail() { return success(cartService.getCartDetail(getLoginUserId())); diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartDetailRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartDetailRespVO.java index 5656c3d69..769418528 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartDetailRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartDetailRespVO.java @@ -1,13 +1,12 @@ package cn.iocoder.yudao.module.trade.controller.app.cart.vo; import cn.iocoder.yudao.module.trade.controller.app.base.sku.AppProductSkuBaseRespVO; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.List; -@ApiModel(value = "用户 App - 用户的购物车明细 Response VO") +@Schema(description = "用户 App - 用户的购物车明细 Response VO") @Data public class AppTradeCartDetailRespVO { @@ -21,7 +20,7 @@ public class AppTradeCartDetailRespVO { */ private Order order; - @ApiModel(value = "商品分组", description = "多个商品,参加同一个活动,从而形成分组") + @Schema(description = "商品分组") // 多个商品,参加同一个活动,从而形成分组 @Data public static class ItemGroup { @@ -36,7 +35,7 @@ public class AppTradeCartDetailRespVO { } - @ApiModel(value = "商品 SKU") + @Schema(description = "商品 SKU") @Data public static class Sku extends AppProductSkuBaseRespVO { @@ -47,26 +46,26 @@ public class AppTradeCartDetailRespVO { // ========== 购物车相关的字段 ========== - @ApiModelProperty(value = "商品数量", required = true, example = "1") + @Schema(description = "商品数量", required = true, example = "1") private Integer count; - @ApiModelProperty(value = "是否选中", required = true, example = "true") + @Schema(description = "是否选中", required = true, example = "true") private Boolean selected; // ========== 价格相关的字段,对应 PriceCalculateRespDTO.OrderItem 的属性 ========== // TODO 芋艿:后续可以去除一些无用的字段 - @ApiModelProperty(value = "商品原价(单)", required = true, example = "100") + @Schema(description = "商品原价(单)", required = true, example = "100") private Integer originalPrice; - @ApiModelProperty(value = "商品原价(总)", required = true, example = "200") + @Schema(description = "商品原价(总)", required = true, example = "200") private Integer totalOriginalPrice; - @ApiModelProperty(value = "商品级优惠(总)", required = true, example = "300") + @Schema(description = "商品级优惠(总)", required = true, example = "300") private Integer totalPromotionPrice; - @ApiModelProperty(value = "最终购买金额(总)", required = true, example = "400") + @Schema(description = "最终购买金额(总)", required = true, example = "400") private Integer totalPresentPrice; - @ApiModelProperty(value = "最终购买金额(单)", required = true, example = "500") + @Schema(description = "最终购买金额(单)", required = true, example = "500") private Integer presentPrice; - @ApiModelProperty(value = "应付金额(总)", required = true, example = "600") + @Schema(description = "应付金额(总)", required = true, example = "600") private Integer totalPayPrice; // ========== 营销相关的字段 ========== @@ -77,40 +76,40 @@ public class AppTradeCartDetailRespVO { } - @ApiModel(value = "订单", description = "对应 PriceCalculateRespDTO.Order 类,用于费用(合计)") + @Schema(description = "订单") // 对应 PriceCalculateRespDTO.Order 类,用于费用(合计) @Data public static class Order { // TODO 芋艿:后续可以去除一些无用的字段 - @ApiModelProperty(value = "商品原价(总)", required = true, example = "100") + @Schema(description = "商品原价(总)", required = true, example = "100") private Integer skuOriginalPrice; - @ApiModelProperty(value = "商品优惠(总)", required = true, example = "200") + @Schema(description = "商品优惠(总)", required = true, example = "200") private Integer skuPromotionPrice; - @ApiModelProperty(value = "订单优惠(总)", required = true, example = "300") + @Schema(description = "订单优惠(总)", required = true, example = "300") private Integer orderPromotionPrice; - @ApiModelProperty(value = "运费金额", required = true, example = "400") + @Schema(description = "运费金额", required = true, example = "400") private Integer deliveryPrice; - @ApiModelProperty(value = "应付金额(总)", required = true, example = "500") + @Schema(description = "应付金额(总)", required = true, example = "500") private Integer payPrice; } - @ApiModel(value = "营销活动", description = "对应 PriceCalculateRespDTO.Promotion 类的属性") + @Schema(description = "营销活动") // 对应 PriceCalculateRespDTO.Promotion 类的属性 @Data public static class Promotion { - @ApiModelProperty(value = "营销编号", required = true, example = "1024", notes = "营销活动的编号、优惠劵的编号") + @Schema(description = "营销编号", required = true, example = "1024") // 营销活动的编号、优惠劵的编号 private Long id; - @ApiModelProperty(value = "营销名字", required = true, example = "xx 活动") + @Schema(description = "营销名字", required = true, example = "xx 活动") private String name; - @ApiModelProperty(value = "营销类型", required = true, example = "1", notes = "参见 PromotionTypeEnum 枚举类") + @Schema(description = "营销类型", required = true, example = "1") private Integer type; // ========== 匹配情况 ========== - @ApiModelProperty(value = "是否满足优惠条件", required = true, example = "true") + @Schema(description = "是否满足优惠条件", required = true, example = "true") private Boolean meet; - @ApiModelProperty(value = "满足条件的提示", required = true, example = "圣诞价:省 150.00 元") + @Schema(description = "满足条件的提示", required = true, example = "圣诞价:省 150.00 元") private String meetTip; } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartItemAddCountReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartItemAddCountReqVO.java index c3103dcce..9b4ba6929 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartItemAddCountReqVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartItemAddCountReqVO.java @@ -1,21 +1,20 @@ package cn.iocoder.yudao.module.trade.controller.app.cart.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; -@ApiModel(value = "用户 App - 购物车添加购物项 Request VO") +@Schema(description = "用户 App - 购物车添加购物项 Request VO") @Data public class AppTradeCartItemAddCountReqVO { - @ApiModelProperty(value = "商品 SKU 编号", required = true,example = "1024") + @Schema(description = "商品 SKU 编号", required = true,example = "1024") @NotNull(message = "商品 SKU 编号不能为空") private Long skuId; - @ApiModelProperty(value = "商品数量", required = true, example = "1", notes = "注意,这是新增数量") + @Schema(description = "新增商品数量", required = true, example = "1") @NotNull(message = "数量不能为空") @Min(message = "数量必须大于 0", value = 1L) private Integer count; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartItemUpdateCountReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartItemUpdateCountReqVO.java index 6beb09379..d3d12487e 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartItemUpdateCountReqVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartItemUpdateCountReqVO.java @@ -1,21 +1,20 @@ package cn.iocoder.yudao.module.trade.controller.app.cart.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; -@ApiModel(value = "用户 App - 购物车更新数量 Request VO") +@Schema(description = "用户 App - 购物车更新数量 Request VO") @Data public class AppTradeCartItemUpdateCountReqVO { - @ApiModelProperty(value = "商品 SKU 编号", required = true, example = "1024") + @Schema(description = "商品 SKU 编号", required = true, example = "1024") @NotNull(message = "商品 SKU 编号不能为空") private Long skuId; - @ApiModelProperty(value = "商品数量", required = true, example = "1") + @Schema(description = "商品数量", required = true, example = "1") @NotNull(message = "数量不能为空") @Min(message = "数量必须大于 0", value = 1L) private Integer count; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartItemUpdateSelectedReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartItemUpdateSelectedReqVO.java index cc7bf6f03..62327f320 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartItemUpdateSelectedReqVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartItemUpdateSelectedReqVO.java @@ -1,21 +1,20 @@ package cn.iocoder.yudao.module.trade.controller.app.cart.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; import java.util.Collection; -@ApiModel(value = "用户 App - 购物车更新是否选中 Request VO") +@Schema(description = "用户 App - 购物车更新是否选中 Request VO") @Data public class AppTradeCartItemUpdateSelectedReqVO { - @ApiModelProperty(value = "商品 SKU 编号列表", required = true, example = "1024,2048") + @Schema(description = "商品 SKU 编号列表", required = true, example = "1024,2048") @NotNull(message = "商品 SKU 编号列表不能为空") private Collection skuIds; - @ApiModelProperty(value = "是否选中", required = true, example = "true") + @Schema(description = "是否选中", required = true, example = "true") @NotNull(message = "是否选中不能为空") private Boolean selected; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java index 06ce965d2..610116c37 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java @@ -12,9 +12,9 @@ import cn.iocoder.yudao.module.trade.convert.order.TradeOrderConvert; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO; import cn.iocoder.yudao.module.trade.service.order.TradeOrderService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -27,7 +27,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; -@Api(tags = "用户 App - 交易订单") +@Tag(name = "用户 App - 交易订单") @RestController @RequestMapping("/trade/order") @Validated @@ -41,7 +41,7 @@ public class AppTradeOrderController { private ProductPropertyValueApi productPropertyValueApi; @GetMapping("/get-create-info") - @ApiOperation("基于商品,确认创建订单") + @Operation(summary = "基于商品,确认创建订单") @PreAuthenticated public CommonResult getOrderCreateInfo(AppTradeOrderCreateReqVO createReqVO) { // return success(tradeOrderService.getOrderConfirmCreateInfo(UserSecurityContextHolder.getUserId(), skuId, quantity, couponCardId)); @@ -49,7 +49,7 @@ public class AppTradeOrderController { } @PostMapping("/create") - @ApiOperation("创建订单") + @Operation(summary = "创建订单") @PreAuthenticated public CommonResult createOrder(@RequestBody AppTradeOrderCreateReqVO createReqVO, HttpServletRequest servletRequest) { @@ -62,7 +62,7 @@ public class AppTradeOrderController { } @PostMapping("/update-paid") - @ApiOperation(value = "更新订单为已支付", notes = "由 pay-module 支付服务,进行回调,可见 PayNotifyJob") + @Operation(description = "更新订单为已支付") // 由 pay-module 支付服务,进行回调,可见 PayNotifyJob public CommonResult updateOrderPaid(@RequestBody PayOrderNotifyReqDTO notifyReqDTO) { tradeOrderService.updateOrderPaid(Long.valueOf(notifyReqDTO.getMerchantOrderId()), notifyReqDTO.getPayOrderId()); @@ -70,8 +70,8 @@ public class AppTradeOrderController { } @GetMapping("/get-detail") - @ApiOperation("获得交易订单") - @ApiImplicitParam(name = "id", value = "交易订单编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "获得交易订单") + @Parameter(name = "id", description = "交易订单编号") public CommonResult getOrder(@RequestParam("id") Long id) { // 查询订单 TradeOrderDO order = tradeOrderService.getOrder(getLoginUserId(), id); @@ -85,7 +85,7 @@ public class AppTradeOrderController { } @GetMapping("/page") - @ApiOperation("获得订单交易分页") + @Operation(summary = "获得订单交易分页") public CommonResult> getOrderPage(AppTradeOrderPageReqVO reqVO) { // 查询订单 PageResult pageResult = tradeOrderService.getOrderPage(getLoginUserId(), reqVO); diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderCreateReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderCreateReqVO.java index 87c2919e2..6c881defe 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderCreateReqVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderCreateReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.trade.controller.app.order.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.Valid; @@ -10,21 +9,21 @@ import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.util.List; -@ApiModel(value = "用户 App - 交易订单创建 Request VO") +@Schema(description = "用户 App - 交易订单创建 Request VO") @Data public class AppTradeOrderCreateReqVO { - @ApiModelProperty(name = "收件地址编号", required = true, example = "1") + @Schema(description = "收件地址编号", required = true, example = "1") @NotNull(message = "收件地址不能为空") private Long addressId; - @ApiModelProperty(name = "优惠劵编号", example = "1024") + @Schema(description = "优惠劵编号", example = "1024") private Long couponId; - @ApiModelProperty(name = "备注", example = "这个是我的订单哟") + @Schema(description = "备注", example = "这个是我的订单哟") private String remark; - @ApiModelProperty(name = "是否来自购物车", required = true, example = "true", notes = "true - 来自购物车;false - 立即购买") + @Schema(description = "是否来自购物车", required = true, example = "true") // true - 来自购物车;false - 立即购买 @NotNull(message = "是否来自购物车不能为空") private Boolean fromCart; @@ -35,15 +34,15 @@ public class AppTradeOrderCreateReqVO { @Valid private List items; - @ApiModel(value = "订单商品项") + @Schema(description = "订单商品项") @Data public static class Item { - @ApiModelProperty(name = "商品 SKU 编号", required = true, example = "111") + @Schema(description = "商品 SKU 编号", required = true, example = "111") @NotNull(message = "商品 SKU 编号不能为空") private Long skuId; - @ApiModelProperty(name = "商品 SKU 购买数量", required = true, example = "1024") + @Schema(description = "商品 SKU 购买数量", required = true, example = "1024") @NotNull(message = "商品 SKU 购买数量不能为空") @Min(value = 1, message = "商品 SKU 购买数量必须大于 0") private Integer count; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderDetailRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderDetailRespVO.java index 14614a57e..c8a57bacb 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderDetailRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderDetailRespVO.java @@ -1,110 +1,109 @@ package cn.iocoder.yudao.module.trade.controller.app.order.vo; import cn.iocoder.yudao.module.trade.controller.app.base.property.AppProductPropertyValueDetailRespVO; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; import java.util.Date; import java.util.List; -@ApiModel("用户 App - 订单交易的明细 Response VO") +@Schema(description = "用户 App - 订单交易的明细 Response VO") @Data public class AppTradeOrderDetailRespVO { // ========== 订单基本信息 ========== - @ApiModelProperty(value = "订单编号", required = true, example = "1024") + @Schema(description = "订单编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "订单流水号", required = true, example = "1146347329394184195") + @Schema(description = "订单流水号", required = true, example = "1146347329394184195") private String no; - @ApiModelProperty(value = "创建时间", required = true, notes = "下单时间") + @Schema(description = "下单时间", required = true) private Date createTime; - @ApiModelProperty(value = "用户备注", required = true, example = "你猜") + @Schema(description = "用户备注", required = true, example = "你猜") private String userRemark; - @ApiModelProperty(value = "订单状态", required = true, example = "1", notes = "参见 TradeOrderStatusEnum 枚举") + @Schema(description = "订单状态", required = true, example = "1") private Integer status; - @ApiModelProperty(value = "购买的商品数量", required = true, example = "10") + @Schema(description = "购买的商品数量", required = true, example = "10") private Integer productCount; - @ApiModelProperty(value = "订单完成时间") + @Schema(description = "订单完成时间") private LocalDateTime finishTime; - @ApiModelProperty(value = "订单取消时间") + @Schema(description = "订单取消时间") private LocalDateTime cancelTime; // ========== 价格 + 支付基本信息 ========== - @ApiModelProperty(value = "支付订单编号", required = true, example = "1024") + @Schema(description = "支付订单编号", required = true, example = "1024") private Long payOrderId; - @ApiModelProperty(value = "付款时间") + @Schema(description = "付款时间") private LocalDateTime payTime; - @ApiModelProperty(value = "商品原价(总)", required = true, example = "1000", notes = "单位:分") + @Schema(description = "商品原价(总)", required = true, example = "1000") private Integer originalPrice; - @ApiModelProperty(value = "订单原价(总)", required = true, example = "1000", notes = "单位:分") + @Schema(description = "订单原价(总)", required = true, example = "1000") private Integer orderPrice; - @ApiModelProperty(value = "订单优惠(总)", required = true, example = "100", notes = "单位:分") + @Schema(description = "订单优惠(总)", required = true, example = "100") private Integer discountPrice; - @ApiModelProperty(value = "运费金额", required = true, example = "100", notes = "单位:分") + @Schema(description = "运费金额", required = true, example = "100") private Integer deliveryPrice; - @ApiModelProperty(value = "订单调价(总)", required = true, example = "100", notes = "单位:分") + @Schema(description = "订单调价(总)", required = true, example = "100") private Integer adjustPrice; - @ApiModelProperty(value = "应付金额(总)", required = true, example = "1000", notes = "单位:分") + @Schema(description = "应付金额(总)", required = true, example = "1000") private Integer payPrice; // ========== 收件 + 物流基本信息 ========== - @ApiModelProperty(value = "发货物流单号", example = "1024") + @Schema(description = "发货物流单号", example = "1024") private String logisticsNo; - @ApiModelProperty(value = "发货时间") + @Schema(description = "发货时间") private LocalDateTime deliveryTime; - @ApiModelProperty(value = "收货时间") + @Schema(description = "收货时间") private LocalDateTime receiveTime; - @ApiModelProperty(value = "收件人名称", required = true, example = "张三") + @Schema(description = "收件人名称", required = true, example = "张三") private String receiverName; - @ApiModelProperty(value = "收件人手机", required = true, example = "13800138000") + @Schema(description = "收件人手机", required = true, example = "13800138000") private String receiverMobile; - @ApiModelProperty(value = "收件人地区编号", required = true, example = "110000") + @Schema(description = "收件人地区编号", required = true, example = "110000") private Integer receiverAreaId; - @ApiModelProperty(value = "收件人地区名字", required = true, example = "上海 上海市 普陀区") + @Schema(description = "收件人地区名字", required = true, example = "上海 上海市 普陀区") private String receiverAreaName; - @ApiModelProperty(value = "收件人邮编", required = true, example = "100000") + @Schema(description = "收件人邮编", required = true, example = "100000") private Integer receiverPostCode; - @ApiModelProperty(value = "收件人详细地址", required = true, example = "中关村大街 1 号") + @Schema(description = "收件人详细地址", required = true, example = "中关村大街 1 号") private String receiverDetailAddress; // ========== 售后基本信息 ========== // ========== 营销基本信息 ========== - @ApiModelProperty(value = "优惠劵编号", example = "1024") + @Schema(description = "优惠劵编号", example = "1024") private Long couponId; - @ApiModelProperty(value = "优惠劵减免金额", required = true, example = "100", notes = "单位:分") + @Schema(description = "优惠劵减免金额", required = true, example = "100") private Integer couponPrice; - @ApiModelProperty(value = "积分抵扣的金额", required = true, example = "100", notes = "单位:分") + @Schema(description = "积分抵扣的金额", required = true, example = "100") private Integer pointPrice; /** @@ -112,32 +111,32 @@ public class AppTradeOrderDetailRespVO { */ private List items; - @ApiModel("用户 App - 交易订单的分页项的订单项目") + @Schema(description = "用户 App - 交易订单的分页项的订单项目") @Data public static class Item { - @ApiModelProperty(value = "编号", required = true, example = "1") + @Schema(description = "编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "商品 SPU 编号", required = true, example = "1") + @Schema(description = "商品 SPU 编号", required = true, example = "1") private Long spuId; - @ApiModelProperty(value = "商品 SPU 名称", required = true, example = "芋道源码") + @Schema(description = "商品 SPU 名称", required = true, example = "芋道源码") private String spuName; - @ApiModelProperty(value = "商品 SKU 编号", required = true, example = "1") + @Schema(description = "商品 SKU 编号", required = true, example = "1") private Long skuId; - @ApiModelProperty(value = "商品图片", required = true, example = "https://www.iocoder.cn/1.png") + @Schema(description = "商品图片", required = true, example = "https://www.iocoder.cn/1.png") private String picUrl; - @ApiModelProperty(value = "购买数量", required = true, example = "1") + @Schema(description = "购买数量", required = true, example = "1") private Integer count; - @ApiModelProperty(value = "商品原价(总)", required = true, example = "100", notes = "单位:分") + @Schema(description = "商品原价(总)", required = true, example = "100") private Integer originalPrice; - @ApiModelProperty(value = "商品原价(单)", required = true, example = "100", notes = "单位:分") + @Schema(description = "商品原价(单)", required = true, example = "100") private Integer originalUnitPrice; /** diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderGetCreateInfoRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderGetCreateInfoRespVO.java index dba7fcb53..86a1b61b7 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderGetCreateInfoRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderGetCreateInfoRespVO.java @@ -1,13 +1,12 @@ package cn.iocoder.yudao.module.trade.controller.app.order.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import java.util.List; -@ApiModel(value = "用户 App - 订单获得创建信息 Response VO") +@Schema(description = "用户 App - 订单获得创建信息 Response VO") @Data public class AppTradeOrderGetCreateInfoRespVO { @@ -25,7 +24,7 @@ public class AppTradeOrderGetCreateInfoRespVO { // */ // private List coupons; - @ApiModel(value = "商品分组", description = "多个商品,参加同一个活动,从而形成分组") + @Schema(description = "商品分组") // 多个商品,参加同一个活动,从而形成分组 @Data public static class ItemGroup { @@ -40,12 +39,12 @@ public class AppTradeOrderGetCreateInfoRespVO { } - @ApiModel("商品 SKU") + @Schema(description = "商品 SKU") @Data public static class Sku { // SKU 自带信息 - @ApiModelProperty(value = "SKU 编号", required = true, example = "1024") + @Schema(description = "SKU 编号", required = true, example = "1024") private Integer id; /** * SPU 信息 @@ -140,12 +139,12 @@ public class AppTradeOrderGetCreateInfoRespVO { } - @ApiModel("费用(合计)") + @Schema(description = "费用(合计)") @Data @AllArgsConstructor public static class Fee { - @ApiModelProperty(value = "购买总价", required = true, example = "1024") + @Schema(description = "购买总价", required = true, example = "1024") private Integer buyPrice; /** * 优惠总价 diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderPageItemRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderPageItemRespVO.java index 8815c0c39..d601553e6 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderPageItemRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderPageItemRespVO.java @@ -1,26 +1,25 @@ package cn.iocoder.yudao.module.trade.controller.app.order.vo; import cn.iocoder.yudao.module.trade.controller.app.base.property.AppProductPropertyValueDetailRespVO; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.List; -@ApiModel("用户 App - 订单交易的分页项 Response VO") +@Schema(description = "用户 App - 订单交易的分页项 Response VO") @Data public class AppTradeOrderPageItemRespVO { - @ApiModelProperty(value = "订单编号", required = true, example = "1024") + @Schema(description = "订单编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "订单流水号", required = true, example = "1146347329394184195") + @Schema(description = "订单流水号", required = true, example = "1146347329394184195") private String no; - @ApiModelProperty(value = "订单状态", required = true, example = "1", notes = "参见 TradeOrderStatusEnum 枚举") + @Schema(description = "订单状态", required = true, example = "1") private Integer status; - @ApiModelProperty(value = "购买的商品数量", required = true, example = "10") + @Schema(description = "购买的商品数量", required = true, example = "10") private Integer productCount; /** @@ -28,32 +27,32 @@ public class AppTradeOrderPageItemRespVO { */ private List items; - @ApiModel("用户 App - 交易订单的明细的订单项目") + @Schema(description = "用户 App - 交易订单的明细的订单项目") @Data public static class Item { - @ApiModelProperty(value = "编号", required = true, example = "1") + @Schema(description = "编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "商品 SPU 编号", required = true, example = "1") + @Schema(description = "商品 SPU 编号", required = true, example = "1") private Long spuId; - @ApiModelProperty(value = "商品 SPU 名称", required = true, example = "芋道源码") + @Schema(description = "商品 SPU 名称", required = true, example = "芋道源码") private String spuName; - @ApiModelProperty(value = "商品 SKU 编号", required = true, example = "1") + @Schema(description = "商品 SKU 编号", required = true, example = "1") private Long skuId; - @ApiModelProperty(value = "商品图片", required = true, example = "https://www.iocoder.cn/1.png") + @Schema(description = "商品图片", required = true, example = "https://www.iocoder.cn/1.png") private String picUrl; - @ApiModelProperty(value = "购买数量", required = true, example = "1") + @Schema(description = "购买数量", required = true, example = "1") private Integer count; - @ApiModelProperty(value = "商品原价(总)", required = true, example = "100", notes = "单位:分") + @Schema(description = "商品原价(总)", required = true, example = "100") private Integer originalPrice; - @ApiModelProperty(value = "商品原价(单)", required = true, example = "100", notes = "单位:分") + @Schema(description = "商品原价(单)", required = true, example = "100") private Integer originalUnitPrice; /** diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderPageReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderPageReqVO.java index 00d253305..180deadbf 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderPageReqVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderPageReqVO.java @@ -3,16 +3,15 @@ package cn.iocoder.yudao.module.trade.controller.app.order.vo; import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.module.trade.enums.order.TradeOrderStatusEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; // TODO 芋艿:字段优化 -@ApiModel("交易订单分页 Request VO") +@Schema(description = "交易订单分页 Request VO") @Data public class AppTradeOrderPageReqVO extends PageParam { - @ApiModelProperty(value = "订单状态", example = "1", notes = "参见 TradeOrderStatusEnum 枚举") + @Schema(description = "订单状态", example = "1") @InEnum(value = TradeOrderStatusEnum.class, message = "订单状态必须是 {value}") private Integer status; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/framework/package-info.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/framework/package-info.java new file mode 100644 index 000000000..68c67112f --- /dev/null +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/framework/package-info.java @@ -0,0 +1,6 @@ +/** + * 属于 trade 模块的 framework 封装 + * + * @author 芋道源码 + */ +package cn.iocoder.yudao.module.trade.framework; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/framework/web/config/TradeWebConfiguration.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/framework/web/config/TradeWebConfiguration.java new file mode 100644 index 000000000..707eaa846 --- /dev/null +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/framework/web/config/TradeWebConfiguration.java @@ -0,0 +1,24 @@ +package cn.iocoder.yudao.module.trade.framework.web.config; + +import cn.iocoder.yudao.framework.swagger.config.YudaoSwaggerAutoConfiguration; +import org.springdoc.core.GroupedOpenApi; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * trade 模块的 web 组件的 Configuration + * + * @author 芋道源码 + */ +@Configuration(proxyBeanMethods = false) +public class TradeWebConfiguration { + + /** + * trade 模块的 API 分组 + */ + @Bean + public GroupedOpenApi tradeGroupedOpenApi() { + return YudaoSwaggerAutoConfiguration.buildGroupedOpenApi("trade"); + } + +} diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/framework/web/package-info.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/framework/web/package-info.java new file mode 100644 index 000000000..208179851 --- /dev/null +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/framework/web/package-info.java @@ -0,0 +1,4 @@ +/** + * trade 模块的 web 配置 + */ +package cn.iocoder.yudao.module.trade.framework.web; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/package-info.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/package-info.java index 393abea6a..eba4aa766 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/package-info.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/package-info.java @@ -1,5 +1,5 @@ /** - * product 模块,product 模块,主要实现商品相关功能 + * trade 模块,product 模块,主要实现商品相关功能 * 例如:品牌、商品分类、spu、sku等功能。 * * 1. Controller URL:以 /product/ 开头,避免和其它 Module 冲突 diff --git a/yudao-module-member/yudao-module-member-biz/pom.xml b/yudao-module-member/yudao-module-member-biz/pom.xml index 11780b8a0..839ac3a88 100644 --- a/yudao-module-member/yudao-module-member-biz/pom.xml +++ b/yudao-module-member/yudao-module-member-biz/pom.xml @@ -54,6 +54,11 @@ yudao-spring-boot-starter-security + + org.springframework.boot + spring-boot-starter-validation + + cn.iocoder.boot diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/AppAddressController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/AppAddressController.java index ee75982fa..bd65bddfd 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/AppAddressController.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/AppAddressController.java @@ -7,9 +7,9 @@ import cn.iocoder.yudao.module.member.controller.app.address.vo.AppAddressUpdate import cn.iocoder.yudao.module.member.convert.address.AddressConvert; import cn.iocoder.yudao.module.member.dal.dataobject.address.AddressDO; import cn.iocoder.yudao.module.member.service.address.AddressService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.validation.annotation.Validated; 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.security.core.util.SecurityFrameworkUtils.getLoginUserId; -@Api(tags = "用户 APP - 用户收件地址") +@Tag(name = "用户 APP - 用户收件地址") @RestController @RequestMapping("/member/address") @Validated @@ -30,43 +30,43 @@ public class AppAddressController { private AddressService addressService; @PostMapping("/create") - @ApiOperation("创建用户收件地址") + @Operation(summary = "创建用户收件地址") public CommonResult createAddress(@Valid @RequestBody AppAddressCreateReqVO createReqVO) { return success(addressService.createAddress(getLoginUserId(), createReqVO)); } @PutMapping("/update") - @ApiOperation("更新用户收件地址") + @Operation(summary = "更新用户收件地址") public CommonResult updateAddress(@Valid @RequestBody AppAddressUpdateReqVO updateReqVO) { addressService.updateAddress(getLoginUserId(), updateReqVO); return success(true); } @DeleteMapping("/delete") - @ApiOperation("删除用户收件地址") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除用户收件地址") + @Parameter(name = "id", description = "编号", required = true) public CommonResult deleteAddress(@RequestParam("id") Long id) { addressService.deleteAddress(getLoginUserId(), id); return success(true); } @GetMapping("/get") - @ApiOperation("获得用户收件地址") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得用户收件地址") + @Parameter(name = "id", description = "编号", required = true, example = "1024") public CommonResult getAddress(@RequestParam("id") Long id) { AddressDO address = addressService.getAddress(getLoginUserId(), id); return success(AddressConvert.INSTANCE.convert(address)); } @GetMapping("/get-default") - @ApiOperation("获得默认的用户收件地址") + @Operation(summary = "获得默认的用户收件地址") public CommonResult getDefaultUserAddress() { AddressDO address = addressService.getDefaultUserAddress(getLoginUserId()); return success(AddressConvert.INSTANCE.convert(address)); } @GetMapping("/list") - @ApiOperation("获得用户收件地址列表") + @Operation(summary = "获得用户收件地址列表") public CommonResult> getAddressList() { List list = addressService.getAddressList(getLoginUserId()); return success(AddressConvert.INSTANCE.convertList(list)); diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressBaseVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressBaseVO.java index 8cfbac7d2..f207ad8be 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressBaseVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressBaseVO.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.member.controller.app.address.vo; - -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; @@ -13,27 +12,27 @@ import javax.validation.constraints.NotNull; @Data public class AppAddressBaseVO { - @ApiModelProperty(value = "收件人名称", required = true) + @Schema(description = "收件人名称", required = true) @NotNull(message = "收件人名称不能为空") private String name; - @ApiModelProperty(value = "手机号", required = true) + @Schema(description = "手机号", required = true) @NotNull(message = "手机号不能为空") private String mobile; - @ApiModelProperty(value = "地区编号", required = true) + @Schema(description = "地区编号", required = true) @NotNull(message = "地区编号不能为空") private Long areaId; - @ApiModelProperty(value = "邮编", required = true) + @Schema(description = "邮编", required = true) @NotEmpty(message = "邮编不能为空") private String postCode; - @ApiModelProperty(value = "收件详细地址", required = true) + @Schema(description = "收件详细地址", required = true) @NotNull(message = "收件详细地址不能为空") private String detailAddress; - @ApiModelProperty(value = "是否默认地址", required = true) + @Schema(description = "是否默认地址", required = true) @NotNull(message = "是否默认地址不能为空") private Boolean defaulted; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressCreateReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressCreateReqVO.java index 31fd89fa3..c92687f27 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressCreateReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressCreateReqVO.java @@ -1,11 +1,8 @@ package cn.iocoder.yudao.module.member.controller.app.address.vo; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import java.util.*; -import io.swagger.annotations.*; -import javax.validation.constraints.*; -@ApiModel("用户 APP - 用户收件地址创建 Request VO") +@Schema(description = "用户 APP - 用户收件地址创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressRespVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressRespVO.java index 0ba231e9f..4e9df9912 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressRespVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressRespVO.java @@ -1,19 +1,18 @@ package cn.iocoder.yudao.module.member.controller.app.address.vo; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDateTime; -import io.swagger.annotations.*; -@ApiModel("用户 APP - 用户收件地址 Response VO") +@Schema(description = "用户 APP - 用户收件地址 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class AppAddressRespVO extends AppAddressBaseVO { - @ApiModelProperty(value = "编号", required = true) + @Schema(description = "编号", required = true) private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressUpdateReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressUpdateReqVO.java index b4100c76a..f94197ece 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressUpdateReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/address/vo/AppAddressUpdateReqVO.java @@ -1,17 +1,15 @@ package cn.iocoder.yudao.module.member.controller.app.address.vo; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import java.util.*; -import io.swagger.annotations.*; import javax.validation.constraints.*; -@ApiModel("用户 APP - 用户收件地址更新 Request VO") +@Schema(description = "用户 APP - 用户收件地址更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class AppAddressUpdateReqVO extends AppAddressBaseVO { - @ApiModelProperty(value = "编号", required = true) + @Schema(description = "编号", required = true) @NotNull(message = "编号不能为空") private Long id; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/AppAuthController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/AppAuthController.java index fadd20733..0a9f69bc9 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/AppAuthController.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/AppAuthController.java @@ -8,10 +8,10 @@ import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.member.controller.app.auth.vo.*; import cn.iocoder.yudao.module.member.service.auth.MemberAuthService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -24,7 +24,7 @@ import javax.validation.Valid; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; -@Api(tags = "用户 APP - 认证") +@Tag(name = "用户 APP - 认证") @RestController @RequestMapping("/member/auth") @Validated @@ -38,14 +38,14 @@ public class AppAuthController { private SecurityProperties securityProperties; @PostMapping("/login") - @ApiOperation("使用手机 + 密码登录") + @Operation(summary = "使用手机 + 密码登录") public CommonResult login(@RequestBody @Valid AppAuthLoginReqVO reqVO) { return success(authService.login(reqVO)); } @PostMapping("/logout") @PermitAll - @ApiOperation("登出系统") + @Operation(summary = "登出系统") public CommonResult logout(HttpServletRequest request) { String token = SecurityFrameworkUtils.obtainAuthorization(request, securityProperties.getTokenHeader()); if (StrUtil.isNotBlank(token)) { @@ -55,8 +55,8 @@ public class AppAuthController { } @PostMapping("/refresh-token") - @ApiOperation("刷新令牌") - @ApiImplicitParam(name = "refreshToken", value = "刷新令牌", required = true, dataTypeClass = String.class) + @Operation(summary = "刷新令牌") + @Parameter(name = "refreshToken", description = "刷新令牌", required = true) @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 public CommonResult refreshToken(@RequestParam("refreshToken") String refreshToken) { return success(authService.refreshToken(refreshToken)); @@ -65,20 +65,20 @@ public class AppAuthController { // ========== 短信登录相关 ========== @PostMapping("/sms-login") - @ApiOperation("使用手机 + 验证码登录") + @Operation(summary = "使用手机 + 验证码登录") public CommonResult smsLogin(@RequestBody @Valid AppAuthSmsLoginReqVO reqVO) { return success(authService.smsLogin(reqVO)); } @PostMapping("/send-sms-code") - @ApiOperation(value = "发送手机验证码") + @Operation(summary = "发送手机验证码") public CommonResult sendSmsCode(@RequestBody @Valid AppAuthSmsSendReqVO reqVO) { authService.sendSmsCode(getLoginUserId(), reqVO); return success(true); } @PostMapping("/reset-password") - @ApiOperation(value = "重置密码", notes = "用户忘记密码时使用") + @Operation(summary = "重置密码", description = "用户忘记密码时使用") @PreAuthenticated public CommonResult resetPassword(@RequestBody @Valid AppAuthResetPasswordReqVO reqVO) { authService.resetPassword(reqVO); @@ -86,7 +86,7 @@ public class AppAuthController { } @PostMapping("/update-password") - @ApiOperation(value = "修改用户密码",notes = "用户修改密码时使用") + @Operation(summary = "修改用户密码",description = "用户修改密码时使用") @PreAuthenticated public CommonResult updatePassword(@RequestBody @Valid AppAuthUpdatePasswordReqVO reqVO) { authService.updatePassword(getLoginUserId(), reqVO); @@ -96,10 +96,10 @@ public class AppAuthController { // ========== 社交登录相关 ========== @GetMapping("/social-auth-redirect") - @ApiOperation("社交授权的跳转") - @ApiImplicitParams({ - @ApiImplicitParam(name = "type", value = "社交类型", required = true, dataTypeClass = Integer.class), - @ApiImplicitParam(name = "redirectUri", value = "回调路径", dataTypeClass = String.class) + @Operation(summary = "社交授权的跳转") + @Parameters({ + @Parameter(name = "type", description = "社交类型", required = true), + @Parameter(name = "redirectUri", description = "回调路径") }) public CommonResult socialAuthRedirect(@RequestParam("type") Integer type, @RequestParam("redirectUri") String redirectUri) { @@ -107,13 +107,13 @@ public class AppAuthController { } @PostMapping("/social-login") - @ApiOperation(value = "社交快捷登录,使用 code 授权码", notes = "适合未登录的用户,但是社交账号已绑定用户") + @Operation(summary = "社交快捷登录,使用 code 授权码", description = "适合未登录的用户,但是社交账号已绑定用户") public CommonResult socialLogin(@RequestBody @Valid AppAuthSocialLoginReqVO reqVO) { return success(authService.socialLogin(reqVO)); } @PostMapping("/weixin-mini-app-login") - @ApiOperation("微信小程序的一键登录") + @Operation(summary = "微信小程序的一键登录") public CommonResult weixinMiniAppLogin(@RequestBody @Valid AppAuthWeixinMiniAppLoginReqVO reqVO) { return success(authService.weixinMiniAppLogin(reqVO)); } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthCheckCodeReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthCheckCodeReqVO.java index dd050147e..170ffa504 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthCheckCodeReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthCheckCodeReqVO.java @@ -3,8 +3,7 @@ package cn.iocoder.yudao.module.member.controller.app.auth.vo; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.framework.common.validation.Mobile; import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -16,25 +15,25 @@ import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; // TODO 芋艿:code review 相关逻辑 -@ApiModel("用户 APP - 校验验证码 Request VO") +@Schema(description = "用户 APP - 校验验证码 Request VO") @Data @NoArgsConstructor @AllArgsConstructor @Builder public class AppAuthCheckCodeReqVO { - @ApiModelProperty(value = "手机号", example = "15601691234") + @Schema(description = "手机号", example = "15601691234") @NotBlank(message = "手机号不能为空") @Mobile private String mobile; - @ApiModelProperty(value = "手机验证码", required = true, example = "1024") + @Schema(description = "手机验证码", required = true, example = "1024") @NotBlank(message = "手机验证码不能为空") @Length(min = 4, max = 6, message = "手机验证码长度为 4-6 位") @Pattern(regexp = "^[0-9]+$", message = "手机验证码必须都是数字") private String code; - @ApiModelProperty(value = "发送场景", example = "1", notes = "对应 SmsSceneEnum 枚举") + @Schema(description = "发送场景,对应 SmsSceneEnum 枚举", example = "1") @NotNull(message = "发送场景不能为空") @InEnum(SmsSceneEnum.class) private Integer scene; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthLoginReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthLoginReqVO.java index d8fe3940f..237cd15dc 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthLoginReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthLoginReqVO.java @@ -4,8 +4,7 @@ import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.framework.common.validation.Mobile; import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -15,33 +14,33 @@ import org.hibernate.validator.constraints.Length; import javax.validation.constraints.AssertTrue; import javax.validation.constraints.NotEmpty; -@ApiModel(value = "用户 APP - 手机 + 密码登录 Request VO", description = "如果登录并绑定社交用户,需要传递 social 开头的参数") +@Schema(description = "用户 APP - 手机 + 密码登录 Request VO,如果登录并绑定社交用户,需要传递 social 开头的参数") @Data @NoArgsConstructor @AllArgsConstructor @Builder public class AppAuthLoginReqVO { - @ApiModelProperty(value = "手机号", required = true, example = "15601691300") + @Schema(description = "手机号", required = true, example = "15601691300") @NotEmpty(message = "手机号不能为空") @Mobile private String mobile; - @ApiModelProperty(value = "密码", required = true, example = "buzhidao") + @Schema(description = "密码", required = true, example = "buzhidao") @NotEmpty(message = "密码不能为空") @Length(min = 4, max = 16, message = "密码长度为 4-16 位") private String password; // ========== 绑定社交登录时,需要传递如下参数 ========== - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") + @Schema(description = "社交平台的类型,参见 SysUserSocialTypeEnum 枚举值", required = true, example = "10") @InEnum(SocialTypeEnum.class) private Integer socialType; - @ApiModelProperty(value = "授权码", required = true, example = "1024") + @Schema(description = "授权码", required = true, example = "1024") private String socialCode; - @ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") + @Schema(description = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") private String socialState; @AssertTrue(message = "授权码不能为空") diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthLoginRespVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthLoginRespVO.java index ebd1ea35c..3794b1f4c 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthLoginRespVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthLoginRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.member.controller.app.auth.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -9,23 +8,23 @@ import lombok.NoArgsConstructor; import java.time.LocalDateTime; -@ApiModel("用户 APP - 登录 Response VO") +@Schema(description = "用户 APP - 登录 Response VO") @Data @NoArgsConstructor @AllArgsConstructor @Builder public class AppAuthLoginRespVO { - @ApiModelProperty(value = "用户编号", required = true, example = "1024") + @Schema(description = "用户编号", required = true, example = "1024") private Long userId; - @ApiModelProperty(value = "访问令牌", required = true, example = "happy") + @Schema(description = "访问令牌", required = true, example = "happy") private String accessToken; - @ApiModelProperty(value = "刷新令牌", required = true, example = "nice") + @Schema(description = "刷新令牌", required = true, example = "nice") private String refreshToken; - @ApiModelProperty(value = "过期时间", required = true) + @Schema(description = "过期时间", required = true) private LocalDateTime expiresTime; } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthResetPasswordReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthResetPasswordReqVO.java index a6d6ebea4..e25139a31 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthResetPasswordReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthResetPasswordReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.member.controller.app.auth.vo; import cn.iocoder.yudao.framework.common.validation.Mobile; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -14,25 +13,25 @@ import javax.validation.constraints.NotEmpty; import javax.validation.constraints.Pattern; // TODO 芋艿:code review 相关逻辑 -@ApiModel("用户 APP - 重置密码 Request VO") +@Schema(description = "用户 APP - 重置密码 Request VO") @Data @NoArgsConstructor @AllArgsConstructor @Builder public class AppAuthResetPasswordReqVO { - @ApiModelProperty(value = "新密码", required = true, example = "buzhidao") + @Schema(description = "新密码", required = true, example = "buzhidao") @NotEmpty(message = "新密码不能为空") @Length(min = 4, max = 16, message = "密码长度为 4-16 位") private String password; - @ApiModelProperty(value = "手机验证码", required = true, example = "1024") + @Schema(description = "手机验证码", required = true, example = "1024") @NotEmpty(message = "手机验证码不能为空") @Length(min = 4, max = 6, message = "手机验证码长度为 4-6 位") @Pattern(regexp = "^[0-9]+$", message = "手机验证码必须都是数字") private String code; - @ApiModelProperty(value = "手机号",required = true,example = "15878962356") + @Schema(description = "手机号",required = true,example = "15878962356") @NotBlank(message = "手机号不能为空") @Mobile private String mobile; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSmsLoginReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSmsLoginReqVO.java index dd6de5d59..c4fb20528 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSmsLoginReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSmsLoginReqVO.java @@ -4,8 +4,7 @@ import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.framework.common.validation.Mobile; import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -16,19 +15,19 @@ import javax.validation.constraints.AssertTrue; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.Pattern; -@ApiModel(value = "用户 APP - 手机 + 验证码登录 Request VO", description = "如果登录并绑定社交用户,需要传递 social 开头的参数") +@Schema(description = "用户 APP - 手机 + 验证码登录 Request VO,如果登录并绑定社交用户,需要传递 social 开头的参数") @Data @NoArgsConstructor @AllArgsConstructor @Builder public class AppAuthSmsLoginReqVO { - @ApiModelProperty(value = "手机号", required = true, example = "15601691300") + @Schema(description = "手机号", required = true, example = "15601691300") @NotEmpty(message = "手机号不能为空") @Mobile private String mobile; - @ApiModelProperty(value = "手机验证码", required = true, example = "1024") + @Schema(description = "手机验证码", required = true, example = "1024") @NotEmpty(message = "手机验证码不能为空") @Length(min = 4, max = 6, message = "手机验证码长度为 4-6 位") @Pattern(regexp = "^[0-9]+$", message = "手机验证码必须都是数字") @@ -36,14 +35,14 @@ public class AppAuthSmsLoginReqVO { // ========== 绑定社交登录时,需要传递如下参数 ========== - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") + @Schema(description = "社交平台的类型,参见 SysUserSocialTypeEnum 枚举值", required = true, example = "10") @InEnum(SocialTypeEnum.class) private Integer socialType; - @ApiModelProperty(value = "授权码", required = true, example = "1024") + @Schema(description = "授权码", required = true, example = "1024") private String socialCode; - @ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") + @Schema(description = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") private String socialState; @AssertTrue(message = "授权码不能为空") diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSmsSendReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSmsSendReqVO.java index cd051f8c3..5f4b030f3 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSmsSendReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSmsSendReqVO.java @@ -3,23 +3,22 @@ package cn.iocoder.yudao.module.member.controller.app.auth.vo; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.framework.common.validation.Mobile; import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; import javax.validation.constraints.NotNull; -@ApiModel("用户 APP - 发送手机验证码 Request VO") +@Schema(description = "用户 APP - 发送手机验证码 Request VO") @Data @Accessors(chain = true) public class AppAuthSmsSendReqVO { - @ApiModelProperty(value = "手机号", example = "15601691234") + @Schema(description = "手机号", example = "15601691234") @Mobile private String mobile; - @ApiModelProperty(value = "发送场景", example = "1", notes = "对应 SmsSceneEnum 枚举") + @Schema(description = "发送场景,对应 SmsSceneEnum 枚举", example = "1") @NotNull(message = "发送场景不能为空") @InEnum(SmsSceneEnum.class) private Integer scene; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSocialLoginReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSocialLoginReqVO.java index 7a5856d67..21d328064 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSocialLoginReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthSocialLoginReqVO.java @@ -2,8 +2,7 @@ package cn.iocoder.yudao.module.member.controller.app.auth.vo; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -12,23 +11,23 @@ import lombok.NoArgsConstructor; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; -@ApiModel("用户 APP - 社交快捷登录 Request VO,使用 code 授权码") +@Schema(description = "用户 APP - 社交快捷登录 Request VO,使用 code 授权码") @Data @NoArgsConstructor @AllArgsConstructor @Builder public class AppAuthSocialLoginReqVO { - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") + @Schema(description = "社交平台的类型,参见 SysUserSocialTypeEnum 枚举值", required = true, example = "10") @InEnum(SocialTypeEnum.class) @NotNull(message = "社交平台的类型不能为空") private Integer type; - @ApiModelProperty(value = "授权码", required = true, example = "1024") + @Schema(description = "授权码", required = true, example = "1024") @NotEmpty(message = "授权码不能为空") private String code; - @ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") + @Schema(description = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") @NotEmpty(message = "state 不能为空") private String state; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthUpdatePasswordReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthUpdatePasswordReqVO.java index 9addb1046..e2a2d25be 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthUpdatePasswordReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthUpdatePasswordReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.member.controller.app.auth.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -12,19 +11,19 @@ import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotEmpty; // TODO 芋艿:code review 相关逻辑 -@ApiModel("用户 APP - 修改密码 Request VO") +@Schema(description = "用户 APP - 修改密码 Request VO") @Data @NoArgsConstructor @AllArgsConstructor @Builder public class AppAuthUpdatePasswordReqVO { - @ApiModelProperty(value = "用户旧密码", required = true, example = "123456") + @Schema(description = "用户旧密码", required = true, example = "123456") @NotBlank(message = "旧密码不能为空") @Length(min = 4, max = 16, message = "密码长度为 4-16 位") private String oldPassword; - @ApiModelProperty(value = "新密码", required = true, example = "buzhidao") + @Schema(description = "新密码", required = true, example = "buzhidao") @NotEmpty(message = "新密码不能为空") @Length(min = 4, max = 16, message = "密码长度为 4-16 位") private String password; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthWeixinMiniAppLoginReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthWeixinMiniAppLoginReqVO.java index bd34085b2..66475d013 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthWeixinMiniAppLoginReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/auth/vo/AppAuthWeixinMiniAppLoginReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.member.controller.app.auth.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -9,18 +8,18 @@ import lombok.NoArgsConstructor; import javax.validation.constraints.NotEmpty; -@ApiModel("用户 APP - 微信小程序手机登录 Request VO") +@Schema(description = "用户 APP - 微信小程序手机登录 Request VO") @Data @NoArgsConstructor @AllArgsConstructor @Builder public class AppAuthWeixinMiniAppLoginReqVO { - @ApiModelProperty(value = "手机 code", required = true, example = "hello", notes = "小程序通过 wx.getPhoneNumber 方法获得") + @Schema(description = "手机 code,小程序通过 wx.getPhoneNumber 方法获得", required = true, example = "hello") @NotEmpty(message = "手机 code 不能为空") private String phoneCode; - @ApiModelProperty(value = "登录 code", required = true, example = "word", notes = "小程序通过 wx.login 方法获得") + @Schema(description = "登录 code,小程序通过 wx.login 方法获得", required = true, example = "word") @NotEmpty(message = "登录 code 不能为空") private String loginCode; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/social/AppSocialUserController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/social/AppSocialUserController.java index d5dac93e6..fb22a4224 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/social/AppSocialUserController.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/social/AppSocialUserController.java @@ -6,8 +6,8 @@ import cn.iocoder.yudao.module.member.controller.app.social.vo.AppSocialUserBind import cn.iocoder.yudao.module.member.controller.app.social.vo.AppSocialUserUnbindReqVO; import cn.iocoder.yudao.module.member.convert.social.SocialUserConvert; import cn.iocoder.yudao.module.system.api.social.SocialUserApi; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -16,7 +16,7 @@ import javax.validation.Valid; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; -@Api(tags = "用户 App - 社交用户") +@Tag(name = "用户 App - 社交用户") @RestController @RequestMapping("/system/social-user") @Validated @@ -26,14 +26,14 @@ public class AppSocialUserController { private SocialUserApi socialUserApi; @PostMapping("/bind") - @ApiOperation("社交绑定,使用 code 授权码") + @Operation(summary = "社交绑定,使用 code 授权码") public CommonResult socialBind(@RequestBody @Valid AppSocialUserBindReqVO reqVO) { socialUserApi.bindSocialUser(SocialUserConvert.INSTANCE.convert(getLoginUserId(), UserTypeEnum.MEMBER.getValue(), reqVO)); return CommonResult.success(true); } @DeleteMapping("/unbind") - @ApiOperation("取消社交绑定") + @Operation(summary = "取消社交绑定") public CommonResult socialUnbind(@RequestBody AppSocialUserUnbindReqVO reqVO) { socialUserApi.unbindSocialUser(SocialUserConvert.INSTANCE.convert(getLoginUserId(), UserTypeEnum.MEMBER.getValue(), reqVO)); return CommonResult.success(true); diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/social/vo/AppSocialUserBindReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/social/vo/AppSocialUserBindReqVO.java index f3fcd0bb0..bd57ae155 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/social/vo/AppSocialUserBindReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/social/vo/AppSocialUserBindReqVO.java @@ -2,8 +2,7 @@ package cn.iocoder.yudao.module.member.controller.app.social.vo; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -12,23 +11,23 @@ import lombok.NoArgsConstructor; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; -@ApiModel("用户 APP - 社交绑定 Request VO,使用 code 授权码") +@Schema(description = "用户 APP - 社交绑定 Request VO,使用 code 授权码") @Data @NoArgsConstructor @AllArgsConstructor @Builder public class AppSocialUserBindReqVO { - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") + @Schema(description = "社交平台的类型,参见 SysUserSocialTypeEnum 枚举值", required = true, example = "10") @InEnum(SocialTypeEnum.class) @NotNull(message = "社交平台的类型不能为空") private Integer type; - @ApiModelProperty(value = "授权码", required = true, example = "1024") + @Schema(description = "授权码", required = true, example = "1024") @NotEmpty(message = "授权码不能为空") private String code; - @ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") + @Schema(description = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") @NotEmpty(message = "state 不能为空") private String state; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/social/vo/AppSocialUserUnbindReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/social/vo/AppSocialUserUnbindReqVO.java index 195238adc..7182643e6 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/social/vo/AppSocialUserUnbindReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/social/vo/AppSocialUserUnbindReqVO.java @@ -2,8 +2,7 @@ package cn.iocoder.yudao.module.member.controller.app.social.vo; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -12,19 +11,19 @@ import lombok.NoArgsConstructor; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; -@ApiModel("用户 APP - 取消社交绑定 Request VO") +@Schema(description = "用户 APP - 取消社交绑定 Request VO") @Data @NoArgsConstructor @AllArgsConstructor @Builder public class AppSocialUserUnbindReqVO { - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") + @Schema(description = "社交平台的类型,参见 SysUserSocialTypeEnum 枚举值", required = true, example = "10") @InEnum(SocialTypeEnum.class) @NotNull(message = "社交平台的类型不能为空") private Integer type; - @ApiModelProperty(value = "社交用户的 openid", required = true, example = "IPRmJ0wvBptiPIlGEZiPewGwiEiE") + @Schema(description = "社交用户的 openid", required = true, example = "IPRmJ0wvBptiPIlGEZiPewGwiEiE") @NotEmpty(message = "社交用户的 openid 不能为空") private String openid; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/AppUserController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/AppUserController.java index 4eec2893f..95b1a227a 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/AppUserController.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/AppUserController.java @@ -7,8 +7,8 @@ import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobile import cn.iocoder.yudao.module.member.convert.user.UserConvert; import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; import cn.iocoder.yudao.module.member.service.user.MemberUserService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -22,7 +22,7 @@ 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.module.infra.enums.ErrorCodeConstants.FILE_IS_EMPTY; -@Api(tags = "用户 APP - 用户个人中心") +@Tag(name = "用户 APP - 用户个人中心") @RestController @RequestMapping("/member/user") @Validated @@ -33,7 +33,7 @@ public class AppUserController { private MemberUserService userService; @PutMapping("/update-nickname") - @ApiOperation("修改用户昵称") + @Operation(summary = "修改用户昵称") @PreAuthenticated public CommonResult updateUserNickname(@RequestParam("nickname") String nickname) { userService.updateUserNickname(getLoginUserId(), nickname); @@ -41,7 +41,7 @@ public class AppUserController { } @PostMapping("/update-avatar") - @ApiOperation("修改用户头像") + @Operation(summary = "修改用户头像") @PreAuthenticated public CommonResult updateUserAvatar(@RequestParam("avatarFile") MultipartFile file) throws Exception { if (file.isEmpty()) { @@ -52,7 +52,7 @@ public class AppUserController { } @GetMapping("/get") - @ApiOperation("获得基本信息") + @Operation(summary = "获得基本信息") @PreAuthenticated public CommonResult getUserInfo() { MemberUserDO user = userService.getUser(getLoginUserId()); @@ -60,7 +60,7 @@ public class AppUserController { } @PostMapping("/update-mobile") - @ApiOperation(value = "修改用户手机") + @Operation(summary = "修改用户手机") @PreAuthenticated public CommonResult updateMobile(@RequestBody @Valid AppUserUpdateMobileReqVO reqVO) { userService.updateUserMobile(getLoginUserId(), reqVO); diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppUserInfoRespVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppUserInfoRespVO.java index 0a79b0886..ef0c3193b 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppUserInfoRespVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppUserInfoRespVO.java @@ -1,23 +1,22 @@ package cn.iocoder.yudao.module.member.controller.app.user.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; -@ApiModel("用户 APP - 用户个人信息 Response VO") +@Schema(description = "用户 APP - 用户个人信息 Response VO") @Data @NoArgsConstructor @AllArgsConstructor public class AppUserInfoRespVO { - @ApiModelProperty(value = "用户昵称", required = true, example = "芋艿") + @Schema(description = "用户昵称", required = true, example = "芋艿") private String nickname; - @ApiModelProperty(value = "用户头像", required = true, example = "/infra/file/get/35a12e57-4297-4faa-bf7d-7ed2f211c952") + @Schema(description = "用户头像", required = true, example = "/infra/file/get/35a12e57-4297-4faa-bf7d-7ed2f211c952") private String avatar; - @ApiModelProperty(value = "用户手机号", required = true, example = "15601691300") + @Schema(description = "用户手机号", required = true, example = "15601691300") private String mobile; } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppUserUpdateMobileReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppUserUpdateMobileReqVO.java index 1ab6e7c84..d6edf48b9 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppUserUpdateMobileReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppUserUpdateMobileReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.member.controller.app.user.vo; import cn.iocoder.yudao.framework.common.validation.Mobile; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -13,26 +12,26 @@ import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.Pattern; -@ApiModel("用户 APP - 修改手机 Request VO") +@Schema(description = "用户 APP - 修改手机 Request VO") @Data @NoArgsConstructor @AllArgsConstructor @Builder public class AppUserUpdateMobileReqVO { - @ApiModelProperty(value = "手机验证码", required = true, example = "1024") + @Schema(description = "手机验证码", required = true, example = "1024") @NotEmpty(message = "手机验证码不能为空") @Length(min = 4, max = 6, message = "手机验证码长度为 4-6 位") @Pattern(regexp = "^[0-9]+$", message = "手机验证码必须都是数字") private String code; - @ApiModelProperty(value = "手机号",required = true,example = "15823654487") + @Schema(description = "手机号",required = true,example = "15823654487") @NotBlank(message = "手机号不能为空") @Length(min = 8, max = 11, message = "手机号码长度为 8-11 位") @Mobile private String mobile; - @ApiModelProperty(value = "原手机验证码", required = true, example = "1024") + @Schema(description = "原手机验证码", required = true, example = "1024") @NotEmpty(message = "原手机验证码不能为空") @Length(min = 4, max = 6, message = "手机验证码长度为 4-6 位") @Pattern(regexp = "^[0-9]+$", message = "手机验证码必须都是数字") @@ -40,7 +39,7 @@ public class AppUserUpdateMobileReqVO { // TODO @芋艿:oldMobile 应该不用传递 - @ApiModelProperty(value = "原手机号",required = true,example = "15823654487") + @Schema(description = "原手机号",required = true,example = "15823654487") @NotBlank(message = "手机号不能为空") @Length(min = 8, max = 11, message = "手机号码长度为 8-11 位") @Mobile diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/weixin/AppWxMpController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/weixin/AppWxMpController.java index 5b33d44e6..7a2413ee3 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/weixin/AppWxMpController.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/weixin/AppWxMpController.java @@ -1,8 +1,8 @@ package cn.iocoder.yudao.module.member.controller.app.weixin; import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.bean.WxJsapiSignature; import me.chanjar.weixin.common.error.WxErrorException; @@ -17,7 +17,7 @@ import javax.annotation.Resource; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "微信公众号") +@Tag(name = "微信公众号") @RestController @RequestMapping("/member/wx-mp") @Validated @@ -28,8 +28,8 @@ public class AppWxMpController { private WxMpService mpService; @PostMapping("/create-jsapi-signature") - @ApiOperation(value = "创建微信 JS SDK 初始化所需的签名", - notes = "参考 https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html 文档") + @Operation(summary = "创建微信 JS SDK 初始化所需的签名", + description = "参考 https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html 文档") public CommonResult createJsapiSignature(@RequestParam("url") String url) throws WxErrorException { return success(mpService.createJsapiSignature(url)); } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/framework/web/config/MemberWebConfiguration.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/framework/web/config/MemberWebConfiguration.java new file mode 100644 index 000000000..82c70034e --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/framework/web/config/MemberWebConfiguration.java @@ -0,0 +1,24 @@ +package cn.iocoder.yudao.module.member.framework.web.config; + +import cn.iocoder.yudao.framework.swagger.config.YudaoSwaggerAutoConfiguration; +import org.springdoc.core.GroupedOpenApi; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * member 模块的 web 组件的 Configuration + * + * @author 芋道源码 + */ +@Configuration(proxyBeanMethods = false) +public class MemberWebConfiguration { + + /** + * member 模块的 API 分组 + */ + @Bean + public GroupedOpenApi memberGroupedOpenApi() { + return YudaoSwaggerAutoConfiguration.buildGroupedOpenApi("member"); + } + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/framework/web/package-info.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/framework/web/package-info.java new file mode 100644 index 000000000..3a964cfc2 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/framework/web/package-info.java @@ -0,0 +1,4 @@ +/** + * member 模块的 web 配置 + */ +package cn.iocoder.yudao.module.member.framework.web; diff --git a/yudao-module-member/yudao-module-member-biz/src/test/resources/sql/create_tables.sql b/yudao-module-member/yudao-module-member-biz/src/test/resources/sql/create_tables.sql index b0347b058..9724c80d6 100644 --- a/yudao-module-member/yudao-module-member-biz/src/test/resources/sql/create_tables.sql +++ b/yudao-module-member/yudao-module-member-biz/src/test/resources/sql/create_tables.sql @@ -17,19 +17,6 @@ CREATE TABLE IF NOT EXISTS "member_user" ( PRIMARY KEY ("id") ) COMMENT '会员表'; --- inf 开头的 DB -CREATE TABLE IF NOT EXISTS "inf_file" ( - "id" varchar(188) NOT NULL, - "type" varchar(63) DEFAULT NULL, - "content" blob NOT NULL, - "creator" varchar(64) DEFAULT '', - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar(64) DEFAULT '', - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, - PRIMARY KEY ("id") -) COMMENT '文件表'; - CREATE TABLE IF NOT EXISTS "member_address" ( "id" bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY, "user_id" bigint(20) NOT NULL, diff --git a/yudao-module-mp/yudao-module-mp-biz/pom.xml b/yudao-module-mp/yudao-module-mp-biz/pom.xml index ea9681832..f1a217698 100644 --- a/yudao-module-mp/yudao-module-mp-biz/pom.xml +++ b/yudao-module-mp/yudao-module-mp-biz/pom.xml @@ -54,6 +54,11 @@ yudao-spring-boot-starter-security + + org.springframework.boot + spring-boot-starter-validation + + cn.iocoder.boot diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/MpAccountController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/MpAccountController.java index e2192f5c6..62be175ac 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/MpAccountController.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/MpAccountController.java @@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.mp.controller.admin.account.vo.*; import cn.iocoder.yudao.module.mp.convert.account.MpAccountConvert; import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; import cn.iocoder.yudao.module.mp.service.account.MpAccountService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -19,7 +19,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 公众号账号") +@Tag(name = "管理后台 - 公众号账号") @RestController @RequestMapping("/mp/account") @Validated @@ -29,14 +29,14 @@ public class MpAccountController { private MpAccountService mpAccountService; @PostMapping("/create") - @ApiOperation("创建公众号账号") + @Operation(summary = "创建公众号账号") @PreAuthorize("@ss.hasPermission('mp:account:create')") public CommonResult createAccount(@Valid @RequestBody MpAccountCreateReqVO createReqVO) { return success(mpAccountService.createAccount(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新公众号账号") + @Operation(summary = "更新公众号账号") @PreAuthorize("@ss.hasPermission('mp:account:update')") public CommonResult updateAccount(@Valid @RequestBody MpAccountUpdateReqVO updateReqVO) { mpAccountService.updateAccount(updateReqVO); @@ -44,8 +44,8 @@ public class MpAccountController { } @DeleteMapping("/delete") - @ApiOperation("删除公众号账号") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除公众号账号") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('mp:account:delete')") public CommonResult deleteAccount(@RequestParam("id") Long id) { mpAccountService.deleteAccount(id); @@ -53,8 +53,8 @@ public class MpAccountController { } @GetMapping("/get") - @ApiOperation("获得公众号账号") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得公众号账号") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('mp:account:query')") public CommonResult getAccount(@RequestParam("id") Long id) { MpAccountDO wxAccount = mpAccountService.getAccount(id); @@ -62,7 +62,7 @@ public class MpAccountController { } @GetMapping("/page") - @ApiOperation("获得公众号账号分页") + @Operation(summary = "获得公众号账号分页") @PreAuthorize("@ss.hasPermission('mp:account:query')") public CommonResult> getAccountPage(@Valid MpAccountPageReqVO pageVO) { PageResult pageResult = mpAccountService.getAccountPage(pageVO); @@ -70,7 +70,7 @@ public class MpAccountController { } @GetMapping("/list-all-simple") - @ApiOperation(value = "获取公众号账号精简信息列表") + @Operation(summary = "获取公众号账号精简信息列表") @PreAuthorize("@ss.hasPermission('mp:account:query')") public CommonResult> getSimpleAccounts() { List list = mpAccountService.getAccountList(); @@ -78,8 +78,8 @@ public class MpAccountController { } @PutMapping("/generate-qr-code") - @ApiOperation("生成公众号二维码") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "生成公众号二维码") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('mp:account:qr-code')") public CommonResult generateAccountQrCode(@RequestParam("id") Long id) { mpAccountService.generateAccountQrCode(id); @@ -87,8 +87,8 @@ public class MpAccountController { } @PutMapping("/clear-quota") - @ApiOperation("清空公众号 API 配额") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "清空公众号 API 配额") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('mp:account:clear-quota')") public CommonResult clearAccountQuota(@RequestParam("id") Long id) { mpAccountService.clearAccountQuota(id); diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountBaseVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountBaseVO.java index 34176f9b5..cda7ec629 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountBaseVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.mp.controller.admin.account.vo; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; @@ -14,30 +14,30 @@ import javax.validation.constraints.NotEmpty; @Data public class MpAccountBaseVO { - @ApiModelProperty(value = "公众号名称", required = true, example = "芋道源码") + @Schema(description = "公众号名称", required = true, example = "芋道源码") @NotEmpty(message = "公众号名称不能为空") private String name; - @ApiModelProperty(value = "公众号微信号", required = true, example = "yudaoyuanma") + @Schema(description = "公众号微信号", required = true, example = "yudaoyuanma") @NotEmpty(message = "公众号微信号不能为空") private String account; - @ApiModelProperty(value = "公众号 appId", required = true, example = "wx5b23ba7a5589ecbb") + @Schema(description = "公众号 appId", required = true, example = "wx5b23ba7a5589ecbb") @NotEmpty(message = "公众号 appId 不能为空") private String appId; - @ApiModelProperty(value = "公众号密钥", required = true, example = "3a7b3b20c537e52e74afd395eb85f61f") + @Schema(description = "公众号密钥", required = true, example = "3a7b3b20c537e52e74afd395eb85f61f") @NotEmpty(message = "公众号密钥不能为空") private String appSecret; - @ApiModelProperty(value = "公众号 token", required = true, example = "kangdayuzhen") + @Schema(description = "公众号 token", required = true, example = "kangdayuzhen") @NotEmpty(message = "公众号 token 不能为空") private String token; - @ApiModelProperty(value = "加密密钥", example = "gjN+Ksei") + @Schema(description = "加密密钥", example = "gjN+Ksei") private String aesKey; - @ApiModelProperty(value = "备注", example = "请关注芋道源码,学习技术") + @Schema(description = "备注", example = "请关注芋道源码,学习技术") private String remark; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountCreateReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountCreateReqVO.java index 57b329b92..b864f16c5 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountCreateReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountCreateReqVO.java @@ -1,11 +1,11 @@ package cn.iocoder.yudao.module.mp.controller.admin.account.vo; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 公众号账号创建 Request VO") +@Schema(description = "管理后台 - 公众号账号创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountPageReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountPageReqVO.java index 23f2c2f0e..93093dc19 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountPageReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountPageReqVO.java @@ -1,22 +1,24 @@ package cn.iocoder.yudao.module.mp.controller.admin.account.vo; -import lombok.*; -import io.swagger.annotations.*; import cn.iocoder.yudao.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; -@ApiModel("管理后台 - 公众号账号分页 Request VO") +@Schema(description = "管理后台 - 公众号账号分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MpAccountPageReqVO extends PageParam { - @ApiModelProperty(value = "公众号名称", notes = "模糊匹配") + @Schema(name = "公众号名称", description = "模糊匹配") private String name; - @ApiModelProperty(value = "公众号账号", notes = "模糊匹配") + @Schema(name = "公众号账号", description = "模糊匹配") private String account; - @ApiModelProperty(value = "公众号 appid", notes = "模糊匹配") + @Schema(name = "公众号 appid", description = "模糊匹配") private String appId; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountRespVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountRespVO.java index 8cda94d9f..9914494ce 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountRespVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountRespVO.java @@ -1,26 +1,25 @@ package cn.iocoder.yudao.module.mp.controller.admin.account.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.util.Date; -@ApiModel("管理后台 - 公众号账号 Response VO") +@Schema(description = "管理后台 - 公众号账号 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MpAccountRespVO extends MpAccountBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "二维码图片URL", example = "https://www.iocoder.cn/1024.png") + @Schema(description = "二维码图片URL", example = "https://www.iocoder.cn/1024.png") private String qrCodeUrl; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private Date createTime; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountSimpleRespVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountSimpleRespVO.java index f3826eaa1..6d63f0ef7 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountSimpleRespVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountSimpleRespVO.java @@ -1,17 +1,16 @@ package cn.iocoder.yudao.module.mp.controller.admin.account.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@ApiModel("管理后台 - 公众号账号精简信息 Response VO") +@Schema(description = "管理后台 - 公众号账号精简信息 Response VO") @Data public class MpAccountSimpleRespVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "公众号名称", required = true, example = "芋道源码") + @Schema(description = "公众号名称", required = true, example = "芋道源码") private String name; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountUpdateReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountUpdateReqVO.java index f348c22c2..c19e0acac 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountUpdateReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/account/vo/MpAccountUpdateReqVO.java @@ -1,16 +1,19 @@ package cn.iocoder.yudao.module.mp.controller.admin.account.vo; -import lombok.*; -import io.swagger.annotations.*; -import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; -@ApiModel("管理后台 - 公众号账号更新 Request VO") +import javax.validation.constraints.NotNull; + +@Schema(description = "管理后台 - 公众号账号更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MpAccountUpdateReqVO extends MpAccountBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") @NotNull(message = "编号不能为空") private Long id; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/MpMaterialController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/MpMaterialController.java index efd7b0420..ef175d2af 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/MpMaterialController.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/MpMaterialController.java @@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.mp.controller.admin.material.vo.*; import cn.iocoder.yudao.module.mp.convert.material.MpMaterialConvert; import cn.iocoder.yudao.module.mp.dal.dataobject.material.MpMaterialDO; import cn.iocoder.yudao.module.mp.service.material.MpMaterialService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -19,7 +19,7 @@ import java.io.IOException; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 公众号素材") +@Tag(name = "管理后台 - 公众号素材") @RestController @RequestMapping("/mp/material") @Validated @@ -28,7 +28,7 @@ public class MpMaterialController { @Resource private MpMaterialService mpMaterialService; - @ApiOperation("上传临时素材") + @Operation(summary = "上传临时素材") @PostMapping("/upload-temporary") @PreAuthorize("@ss.hasPermission('mp:material:upload-temporary')") public CommonResult uploadTemporaryMaterial( @@ -37,7 +37,7 @@ public class MpMaterialController { return success(MpMaterialConvert.INSTANCE.convert(material)); } - @ApiOperation("上传永久素材") + @Operation(summary = "上传永久素材") @PostMapping("/upload-permanent") @PreAuthorize("@ss.hasPermission('mp:material:upload-permanent')") public CommonResult uploadPermanentMaterial( @@ -46,16 +46,16 @@ public class MpMaterialController { return success(MpMaterialConvert.INSTANCE.convert(material)); } - @ApiOperation("删除素材") + @Operation(summary = "删除素材") @DeleteMapping("/delete-permanent") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('mp:material:delete')") public CommonResult deleteMaterial(@RequestParam("id") Long id) { mpMaterialService.deleteMaterial(id); return success(true); } - @ApiOperation("上传图文内容中的图片") + @Operation(summary = "上传图文内容中的图片") @PostMapping("/upload-news-image") @PreAuthorize("@ss.hasPermission('mp:material:upload-news-image')") public CommonResult uploadNewsImage(@Valid MpMaterialUploadNewsImageReqVO reqVO) @@ -63,7 +63,7 @@ public class MpMaterialController { return success(mpMaterialService.uploadNewsImage(reqVO)); } - @ApiOperation("获得素材分页") + @Operation(summary = "获得素材分页") @GetMapping("/page") @PreAuthorize("@ss.hasPermission('mp:material:query')") public CommonResult> getMaterialPage(@Valid MpMaterialPageReqVO pageReqVO) { diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialPageReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialPageReqVO.java index 88c087c93..ce3b0f9e7 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialPageReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialPageReqVO.java @@ -1,28 +1,27 @@ package cn.iocoder.yudao.module.mp.controller.admin.material.vo; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 公众号素材的分页 Request VO") +@Schema(description = "管理后台 - 公众号素材的分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MpMaterialPageReqVO extends PageParam { - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") + @Schema(description = "公众号账号的编号", required = true, example = "2048") @NotNull(message = "公众号账号的编号不能为空") private Long accountId; - @ApiModelProperty(value = "是否永久", example = "true") + @Schema(description = "是否永久", example = "true") private Boolean permanent; - @ApiModelProperty(value = "文件类型", example = "image", notes = "参见 WxConsts.MediaFileType 枚举") + @Schema(description = "文件类型 参见 WxConsts.MediaFileType 枚举", example = "image") private String type; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialRespVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialRespVO.java index 352d8ba67..a93dfd994 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialRespVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialRespVO.java @@ -1,48 +1,47 @@ package cn.iocoder.yudao.module.mp.controller.admin.material.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.Date; -@ApiModel("管理后台 - 公众号素材 Response VO") +@Schema(description = "管理后台 - 公众号素材 Response VO") @Data public class MpMaterialRespVO { - @ApiModelProperty(value = "主键", required = true, example = "1024") + @Schema(description = "主键", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "1") + @Schema(description = "公众号账号的编号", required = true, example = "1") private Long accountId; - @ApiModelProperty(value = "公众号账号的 appId", required = true, example = "wx1234567890") + @Schema(description = "公众号账号的 appId", required = true, example = "wx1234567890") private String appId; - @ApiModelProperty(value = "素材的 media_id", required = true, example = "123") + @Schema(description = "素材的 media_id", required = true, example = "123") private String mediaId; - @ApiModelProperty(value = "文件类型", required = true, example = "image", notes = "参见 WxConsts.MediaFileType 枚举") + @Schema(description = "文件类型 参见 WxConsts.MediaFileType 枚举", required = true, example = "image") private String type; - @ApiModelProperty(value = "是否永久", required = true, example = "true", notes = "true - 永久;false - 临时") + @Schema(description = "是否永久 true - 永久;false - 临时", required = true, example = "true") private Boolean permanent; - @ApiModelProperty(value = "素材的 URL", required = true, example = "https://www.iocoder.cn/1.png") + @Schema(description = "素材的 URL", required = true, example = "https://www.iocoder.cn/1.png") private String url; - @ApiModelProperty(value = "名字", example = "yunai.png") + @Schema(description = "名字", example = "yunai.png") private String name; - @ApiModelProperty(value = "公众号文件 URL", example = "https://mmbiz.qpic.cn/xxx.mp3", notes = "只有【永久素材】使用") + @Schema(description = "公众号文件 URL 只有【永久素材】使用", example = "https://mmbiz.qpic.cn/xxx.mp3") private String mpUrl; - @ApiModelProperty(value = "视频素材的标题", example = "我是标题", notes = "只有【永久素材】使用") + @Schema(description = "视频素材的标题 只有【永久素材】使用", example = "我是标题") private String title; - @ApiModelProperty(value = "视频素材的描述", example = "我是介绍", notes = "只有【永久素材】使用") + @Schema(description = "视频素材的描述 只有【永久素材】使用", example = "我是介绍") private String introduction; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private Date createTime; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialUploadNewsImageReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialUploadNewsImageReqVO.java index 66aec47f7..5dd689a68 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialUploadNewsImageReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialUploadNewsImageReqVO.java @@ -1,22 +1,21 @@ package cn.iocoder.yudao.module.mp.controller.admin.material.vo; import com.fasterxml.jackson.annotation.JsonIgnore; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.web.multipart.MultipartFile; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 公众号素材上传图文内容中的图片 Request VO") +@Schema(description = "管理后台 - 公众号素材上传图文内容中的图片 Request VO") @Data public class MpMaterialUploadNewsImageReqVO { - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") + @Schema(description = "公众号账号的编号", required = true, example = "2048") @NotNull(message = "公众号账号的编号不能为空") private Long accountId; - @ApiModelProperty(value = "文件附件", required = true) + @Schema(description = "文件附件", required = true) @NotNull(message = "文件不能为空") @JsonIgnore // 避免被操作日志,进行序列化,导致报错 private MultipartFile file; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialUploadPermanentReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialUploadPermanentReqVO.java index 706f71351..93d0a863e 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialUploadPermanentReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialUploadPermanentReqVO.java @@ -2,8 +2,7 @@ package cn.iocoder.yudao.module.mp.controller.admin.material.vo; import cn.hutool.core.util.ObjectUtil; import com.fasterxml.jackson.annotation.JsonIgnore; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import me.chanjar.weixin.common.api.WxConsts; import org.springframework.web.multipart.MultipartFile; @@ -12,29 +11,29 @@ import javax.validation.constraints.AssertTrue; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 公众号素材上传永久 Request VO") +@Schema(description = "管理后台 - 公众号素材上传永久 Request VO") @Data public class MpMaterialUploadPermanentReqVO { - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") + @Schema(description = "公众号账号的编号", required = true, example = "2048") @NotNull(message = "公众号账号的编号不能为空") private Long accountId; - @ApiModelProperty(value = "文件类型", required = true, example = "image", notes = "参见 WxConsts.MediaFileType 枚举") + @Schema(description = "文件类型 参见 WxConsts.MediaFileType 枚举", required = true, example = "image") @NotEmpty(message = "文件类型不能为空") private String type; - @ApiModelProperty(value = "文件附件", required = true) + @Schema(description = "文件附件", required = true) @NotNull(message = "文件不能为空") @JsonIgnore // 避免被操作日志,进行序列化,导致报错 private MultipartFile file; - @ApiModelProperty(value = "名字", example = "wechat.mp", notes = "如果 name 为空,则使用 file 文件名") + @Schema(description = "名字 如果 name 为空,则使用 file 文件名", example = "wechat.mp") private String name; - @ApiModelProperty(value = "视频素材的标题", example = "视频素材的标题", notes = "文件类型为 video 时,必填") + @Schema(description = "视频素材的标题 文件类型为 video 时,必填", example = "视频素材的标题") private String title; - @ApiModelProperty(value = "视频素材的描述", example = "视频素材的描述", notes = "文件类型为 video 时,必填") + @Schema(description = "视频素材的描述 文件类型为 video 时,必填", example = "视频素材的描述") private String introduction; @AssertTrue(message = "标题不能为空") diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialUploadRespVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialUploadRespVO.java index 917cc8941..d6a257e03 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialUploadRespVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialUploadRespVO.java @@ -1,17 +1,16 @@ package cn.iocoder.yudao.module.mp.controller.admin.material.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@ApiModel("管理后台 - 公众号素材上传结果 Response VO") +@Schema(description = "管理后台 - 公众号素材上传结果 Response VO") @Data public class MpMaterialUploadRespVO { - @ApiModelProperty(value = "素材的 media_id", required = true, example = "123") + @Schema(description = "素材的 media_id", required = true, example = "123") private String mediaId; - @ApiModelProperty(value = "素材的 URL", required = true, example = "https://www.iocoder.cn/1.png") + @Schema(description = "素材的 URL", required = true, example = "https://www.iocoder.cn/1.png") private String url; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialUploadTemporaryReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialUploadTemporaryReqVO.java index f8c73cec2..5d0f7cafe 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialUploadTemporaryReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/material/vo/MpMaterialUploadTemporaryReqVO.java @@ -1,27 +1,26 @@ package cn.iocoder.yudao.module.mp.controller.admin.material.vo; import com.fasterxml.jackson.annotation.JsonIgnore; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.web.multipart.MultipartFile; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 公众号素材上传临时 Request VO") +@Schema(description = "管理后台 - 公众号素材上传临时 Request VO") @Data public class MpMaterialUploadTemporaryReqVO { - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") + @Schema(description = "公众号账号的编号", required = true, example = "2048") @NotNull(message = "公众号账号的编号不能为空") private Long accountId; - @ApiModelProperty(value = "文件类型", required = true, example = "image", notes = "参见 WxConsts.MediaFileType 枚举") + @Schema(description = "文件类型 参见 WxConsts.MediaFileType 枚举", required = true, example = "image") @NotEmpty(message = "文件类型不能为空") private String type; - @ApiModelProperty(value = "文件附件", required = true) + @Schema(description = "文件附件", required = true) @NotNull(message = "文件不能为空") @JsonIgnore // 避免被操作日志,进行序列化,导致报错 private MultipartFile file; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/MpMenuController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/MpMenuController.java index f84fee561..b7c883519 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/MpMenuController.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/MpMenuController.java @@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.mp.controller.admin.menu.vo.MpMenuSaveReqVO; import cn.iocoder.yudao.module.mp.convert.menu.MpMenuConvert; import cn.iocoder.yudao.module.mp.dal.dataobject.menu.MpMenuDO; import cn.iocoder.yudao.module.mp.service.menu.MpMenuService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -19,7 +19,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 公众号菜单") +@Tag(name = "管理后台 - 公众号菜单") @RestController @RequestMapping("/mp/menu") @Validated @@ -29,7 +29,7 @@ public class MpMenuController { private MpMenuService mpMenuService; @PostMapping("/save") - @ApiOperation("保存公众号菜单") + @Operation(summary = "保存公众号菜单") @PreAuthorize("@ss.hasPermission('mp:menu:save')") public CommonResult saveMenu(@Valid @RequestBody MpMenuSaveReqVO createReqVO) { mpMenuService.saveMenu(createReqVO); @@ -37,8 +37,8 @@ public class MpMenuController { } @DeleteMapping("/delete") - @ApiOperation("删除公众号菜单") - @ApiImplicitParam(name = "accountId", value = "公众号账号的编号", required = true, example = "10", dataTypeClass = Long.class) + @Operation(summary = "删除公众号菜单") + @Parameter(name = "accountId", description = "公众号账号的编号", required = true, example = "10") @PreAuthorize("@ss.hasPermission('mp:menu:delete')") public CommonResult deleteMenu(@RequestParam("accountId") Long accountId) { mpMenuService.deleteMenuByAccountId(accountId); @@ -46,8 +46,8 @@ public class MpMenuController { } @GetMapping("/list") - @ApiOperation("获得公众号菜单列表") - @ApiImplicitParam(name = "accountId", value = "公众号账号的编号", required = true, example = "10", dataTypeClass = Long.class) + @Operation(summary = "获得公众号菜单列表") + @Parameter(name = "accountId", description = "公众号账号的编号", required = true, example = "10") @PreAuthorize("@ss.hasPermission('mp:menu:query')") public CommonResult> getMenuList(@RequestParam("accountId") Long accountId) { List list = mpMenuService.getMenuListByAccountId(accountId); diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuBaseVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuBaseVO.java index 27a9c1c90..cd0e5b2e4 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuBaseVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuBaseVO.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.module.mp.controller.admin.menu.vo; import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpMessageDO; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import me.chanjar.weixin.common.api.WxConsts; import org.hibernate.validator.constraints.URL; @@ -44,54 +44,53 @@ public class MpMenuBaseVO { */ private String type; - @ApiModelProperty(value = "网页链接", example = "https://www.iocoder.cn/") + @Schema(description = "网页链接", example = "https://www.iocoder.cn/") @NotEmpty(message = "网页链接不能为空", groups = {ViewButtonGroup.class, MiniProgramButtonGroup.class}) @URL(message = "网页链接必须是 URL 格式") private String url; - @ApiModelProperty(value = "小程序的 appId", example = "wx1234567890") + @Schema(description = "小程序的 appId", example = "wx1234567890") @NotEmpty(message = "小程序的 appId 不能为空", groups = MiniProgramButtonGroup.class) private String miniProgramAppId; - @ApiModelProperty(value = "小程序的页面路径", example = "pages/index/index") + @Schema(description = "小程序的页面路径", example = "pages/index/index") @NotEmpty(message = "小程序的页面路径不能为空", groups = MiniProgramButtonGroup.class) private String miniProgramPagePath; - @ApiModelProperty(value ="跳转图文的媒体编号", example = "jCQk93AIIgp8ixClWcW_NXXqBKInNWNmq2XnPeDZl7IMVqWiNeL4FfELtggRXd83") + @Schema(description ="跳转图文的媒体编号", example = "jCQk93AIIgp8ixClWcW_NXXqBKInNWNmq2XnPeDZl7IMVqWiNeL4FfELtggRXd83") @NotEmpty(message = "跳转图文的媒体编号不能为空", groups = ViewLimitedButtonGroup.class) private String articleId; // ========== 消息内容 ========== - @ApiModelProperty(value = "回复的消息类型", example = "text", - notes = "枚举 TEXT、IMAGE、VOICE、VIDEO、NEWS、MUSIC") + @Schema(description = "回复的消息类型 枚举 TEXT、IMAGE、VOICE、VIDEO、NEWS、MUSIC", example = "text") @NotEmpty(message = "回复的消息类型不能为空", groups = {ClickButtonGroup.class, ScanCodeWaitMsgButtonGroup.class}) private String replyMessageType; - @ApiModelProperty(value = "回复的消息内容", example = "欢迎关注") + @Schema(description = "回复的消息内容", example = "欢迎关注") @NotEmpty(message = "回复的消息内容不能为空", groups = TextMessageGroup.class) private String replyContent; - @ApiModelProperty(value = "回复的媒体 id", example = "123456") + @Schema(description = "回复的媒体 id", example = "123456") @NotEmpty(message = "回复的消息 mediaId 不能为空", groups = {ImageMessageGroup.class, VoiceMessageGroup.class, VideoMessageGroup.class}) private String replyMediaId; - @ApiModelProperty(value = "回复的媒体 URL", example = "https://www.iocoder.cn/xxx.jpg") + @Schema(description = "回复的媒体 URL", example = "https://www.iocoder.cn/xxx.jpg") @NotEmpty(message = "回复的消息 mediaId 不能为空", groups = {ImageMessageGroup.class, VoiceMessageGroup.class, VideoMessageGroup.class}) private String replyMediaUrl; - @ApiModelProperty(value = "缩略图的媒体 id", example = "123456") + @Schema(description = "缩略图的媒体 id", example = "123456") @NotEmpty(message = "回复的消息 thumbMediaId 不能为空", groups = {MusicMessageGroup.class}) private String replyThumbMediaId; - @ApiModelProperty(value = "缩略图的媒体 URL",example = "https://www.iocoder.cn/xxx.jpg") + @Schema(description = "缩略图的媒体 URL",example = "https://www.iocoder.cn/xxx.jpg") @NotEmpty(message = "回复的消息 thumbMedia 地址不能为空", groups = {MusicMessageGroup.class}) private String replyThumbMediaUrl; - @ApiModelProperty(value = "回复的标题", example = "视频标题") + @Schema(description = "回复的标题", example = "视频标题") @NotEmpty(message = "回复的消息标题不能为空", groups = VideoMessageGroup.class) private String replyTitle; - @ApiModelProperty(value = "回复的描述", example = "视频描述") + @Schema(description = "回复的描述", example = "视频描述") @NotEmpty(message = "消息描述不能为空", groups = VideoMessageGroup.class) private String replyDescription; @@ -104,11 +103,11 @@ public class MpMenuBaseVO { @Valid private List replyArticles; - @ApiModelProperty(value = "回复的音乐链接", example = "https://www.iocoder.cn/xxx.mp3") + @Schema(description = "回复的音乐链接", example = "https://www.iocoder.cn/xxx.mp3") @NotEmpty(message = "回复的音乐链接不能为空", groups = MusicMessageGroup.class) @URL(message = "回复的高质量音乐链接格式不正确", groups = MusicMessageGroup.class) private String replyMusicUrl; - @ApiModelProperty(value = "高质量音乐链接", example = "https://www.iocoder.cn/xxx.mp3") + @Schema(description = "高质量音乐链接", example = "https://www.iocoder.cn/xxx.mp3") @NotEmpty(message = "回复的高质量音乐链接不能为空", groups = MusicMessageGroup.class) @URL(message = "回复的高质量音乐链接格式不正确", groups = MusicMessageGroup.class) private String replyHqMusicUrl; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuRespVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuRespVO.java index cd5bfb5a3..0d51b1064 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuRespVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuRespVO.java @@ -1,29 +1,28 @@ package cn.iocoder.yudao.module.mp.controller.admin.menu.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.util.Date; -@ApiModel("管理后台 - 公众号菜单 Response VO") +@Schema(description = "管理后台 - 公众号菜单 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MpMenuRespVO extends MpMenuBaseVO { - @ApiModelProperty(value = "主键", required = true, example = "1024") + @Schema(description = "主键", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") + @Schema(description = "公众号账号的编号", required = true, example = "2048") private Long accountId; - @ApiModelProperty(value = "公众号 appId", required = true, example = "wx1234567890ox") + @Schema(description = "公众号 appId", required = true, example = "wx1234567890ox") private String appId; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private Date createTime; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuSaveReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuSaveReqVO.java index 3c78bdfbb..43b7ff733 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuSaveReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/menu/vo/MpMenuSaveReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.mp.controller.admin.menu.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.Valid; @@ -9,11 +8,11 @@ import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.util.List; -@ApiModel("管理后台 - 公众号菜单保存 Request VO") +@Schema(description = "管理后台 - 公众号菜单保存 Request VO") @Data public class MpMenuSaveReqVO { - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") + @Schema(description = "公众号账号的编号", required = true, example = "2048") @NotNull(message = "公众号账号的编号不能为空") private Long accountId; @@ -21,7 +20,7 @@ public class MpMenuSaveReqVO { @Valid private List

menus; - @ApiModel("管理后台 - 公众号菜单保存时的每个菜单") + @Schema(description = "管理后台 - 公众号菜单保存时的每个菜单") @Data public static class Menu extends MpMenuBaseVO { diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/MpAutoReplyController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/MpAutoReplyController.java index 927103157..f6a8b9b38 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/MpAutoReplyController.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/MpAutoReplyController.java @@ -9,9 +9,9 @@ import cn.iocoder.yudao.module.mp.controller.admin.message.vo.message.MpMessageP import cn.iocoder.yudao.module.mp.convert.message.MpAutoReplyConvert; import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpAutoReplyDO; import cn.iocoder.yudao.module.mp.service.message.MpAutoReplyService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -21,7 +21,7 @@ import javax.validation.Valid; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 公众号自动回复") +@Tag(name = "管理后台 - 公众号自动回复") @RestController @RequestMapping("/mp/auto-reply") @Validated @@ -31,7 +31,7 @@ public class MpAutoReplyController { private MpAutoReplyService mpAutoReplyService; @GetMapping("/page") - @ApiOperation("获得公众号自动回复分页") + @Operation(summary = "获得公众号自动回复分页") @PreAuthorize("@ss.hasPermission('mp:auto-reply:query')") public CommonResult> getAutoReplyPage(@Valid MpMessagePageReqVO pageVO) { PageResult pageResult = mpAutoReplyService.getAutoReplyPage(pageVO); @@ -39,8 +39,8 @@ public class MpAutoReplyController { } @GetMapping("/get") - @ApiOperation("获得公众号自动回复") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得公众号自动回复") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('mp:auto-reply:query')") public CommonResult getAutoReply(@RequestParam("id") Long id) { MpAutoReplyDO autoReply = mpAutoReplyService.getAutoReply(id); @@ -48,14 +48,14 @@ public class MpAutoReplyController { } @PostMapping("/create") - @ApiOperation("创建公众号自动回复") + @Operation(summary = "创建公众号自动回复") @PreAuthorize("@ss.hasPermission('mp:auto-reply:create')") public CommonResult createAutoReply(@Valid @RequestBody MpAutoReplyCreateReqVO createReqVO) { return success(mpAutoReplyService.createAutoReply(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新公众号自动回复") + @Operation(summary = "更新公众号自动回复") @PreAuthorize("@ss.hasPermission('mp:auto-reply:update')") public CommonResult updateAutoReply(@Valid @RequestBody MpAutoReplyUpdateReqVO updateReqVO) { mpAutoReplyService.updateAutoReply(updateReqVO); @@ -63,8 +63,8 @@ public class MpAutoReplyController { } @DeleteMapping("/delete") - @ApiOperation("删除公众号自动回复") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除公众号自动回复") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('mp:auto-reply:delete')") public CommonResult deleteAutoReply(@RequestParam("id") Long id) { mpAutoReplyService.deleteAutoReply(id); diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/MpMessageController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/MpMessageController.java index 41b11c6f0..66befc65e 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/MpMessageController.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/MpMessageController.java @@ -8,8 +8,8 @@ import cn.iocoder.yudao.module.mp.controller.admin.message.vo.message.MpMessageS import cn.iocoder.yudao.module.mp.convert.message.MpMessageConvert; import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpMessageDO; import cn.iocoder.yudao.module.mp.service.message.MpMessageService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -19,7 +19,7 @@ import javax.validation.Valid; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 公众号消息") +@Tag(name = "管理后台 - 公众号消息") @RestController @RequestMapping("/mp/message") @Validated @@ -29,7 +29,7 @@ public class MpMessageController { private MpMessageService mpMessageService; @GetMapping("/page") - @ApiOperation("获得公众号消息分页") + @Operation(summary = "获得公众号消息分页") @PreAuthorize("@ss.hasPermission('mp:message:query')") public CommonResult> getMessagePage(@Valid MpMessagePageReqVO pageVO) { PageResult pageResult = mpMessageService.getMessagePage(pageVO); @@ -37,7 +37,7 @@ public class MpMessageController { } @PostMapping("/send") - @ApiOperation("给粉丝发送消息") + @Operation(summary = "给粉丝发送消息") @PreAuthorize("@ss.hasPermission('mp:message:send')") public CommonResult sendMessage(@Valid @RequestBody MpMessageSendReqVO reqVO) { MpMessageDO message = mpMessageService.sendKefuMessage(reqVO); diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyBaseVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyBaseVO.java index fa9ae31c7..4b84254fe 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyBaseVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyBaseVO.java @@ -4,7 +4,7 @@ import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpMessageDO; import cn.iocoder.yudao.module.mp.enums.message.MpAutoReplyTypeEnum; import cn.iocoder.yudao.module.mp.framework.mp.core.util.MpUtils.*; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import me.chanjar.weixin.common.api.WxConsts; import org.hibernate.validator.constraints.URL; @@ -22,51 +22,50 @@ import java.util.List; @Data public class MpAutoReplyBaseVO { - @ApiModelProperty(value = "回复类型", example = "1", notes = "参见 MpAutoReplyTypeEnum 枚举") + @Schema(description = "回复类型 参见 MpAutoReplyTypeEnum 枚举", example = "1") @NotNull(message = "回复类型不能为空") private Integer type; // ==================== 请求消息 ==================== - @ApiModelProperty(value = "请求的关键字", example = "关键字", notes = "当 type 为 MpAutoReplyTypeEnum#KEYWORD 时,必填") + @Schema(description = "请求的关键字 当 type 为 MpAutoReplyTypeEnum#KEYWORD 时,必填", example = "关键字") private String requestKeyword; - @ApiModelProperty(value = "请求的匹配方式", example = "1", notes = "当 type 为 MpAutoReplyTypeEnum#KEYWORD 时,必填") + @Schema(description = "请求的匹配方式 当 type 为 MpAutoReplyTypeEnum#KEYWORD 时,必填", example = "1") private Integer requestMatch; - @ApiModelProperty(value = "请求的消息类型", example = "text", notes = "当 type 为 MpAutoReplyTypeEnum#MESSAGE 时,必填") + @Schema(description = "请求的消息类型 当 type 为 MpAutoReplyTypeEnum#MESSAGE 时,必填", example = "text") private String requestMessageType; // ==================== 响应消息 ==================== - @ApiModelProperty(value = "回复的消息类型", example = "text", - notes = "枚举 TEXT、IMAGE、VOICE、VIDEO、NEWS、MUSIC") + @Schema(description = "回复的消息类型 枚举 TEXT、IMAGE、VOICE、VIDEO、NEWS、MUSIC", example = "text") @NotEmpty(message = "回复的消息类型不能为空") private String responseMessageType; - @ApiModelProperty(value = "回复的消息内容", example = "欢迎关注") + @Schema(description = "回复的消息内容", example = "欢迎关注") @NotEmpty(message = "回复的消息内容不能为空", groups = TextMessageGroup.class) private String responseContent; - @ApiModelProperty(value = "回复的媒体 id", example = "123456") + @Schema(description = "回复的媒体 id", example = "123456") @NotEmpty(message = "回复的消息 mediaId 不能为空", groups = {ImageMessageGroup.class, VoiceMessageGroup.class, VideoMessageGroup.class}) private String responseMediaId; - @ApiModelProperty(value = "回复的媒体 URL", example = "https://www.iocoder.cn/xxx.jpg") + @Schema(description = "回复的媒体 URL", example = "https://www.iocoder.cn/xxx.jpg") @NotEmpty(message = "回复的消息 mediaId 不能为空", groups = {ImageMessageGroup.class, VoiceMessageGroup.class, VideoMessageGroup.class}) private String responseMediaUrl; - @ApiModelProperty(value = "缩略图的媒体 id", example = "123456") + @Schema(description = "缩略图的媒体 id", example = "123456") @NotEmpty(message = "回复的消息 thumbMediaId 不能为空", groups = {MusicMessageGroup.class}) private String responseThumbMediaId; - @ApiModelProperty(value = "缩略图的媒体 URL",example = "https://www.iocoder.cn/xxx.jpg") + @Schema(description = "缩略图的媒体 URL",example = "https://www.iocoder.cn/xxx.jpg") @NotEmpty(message = "回复的消息 thumbMedia 地址不能为空", groups = {MusicMessageGroup.class}) private String responseThumbMediaUrl; - @ApiModelProperty(value = "回复的标题", example = "视频标题") + @Schema(description = "回复的标题", example = "视频标题") @NotEmpty(message = "回复的消息标题不能为空", groups = VideoMessageGroup.class) private String responseTitle; - @ApiModelProperty(value = "回复的描述", example = "视频描述") + @Schema(description = "回复的描述", example = "视频描述") @NotEmpty(message = "消息描述不能为空", groups = VideoMessageGroup.class) private String responseDescription; @@ -79,11 +78,11 @@ public class MpAutoReplyBaseVO { @Valid private List responseArticles; - @ApiModelProperty(value = "回复的音乐链接", example = "https://www.iocoder.cn/xxx.mp3") + @Schema(description = "回复的音乐链接", example = "https://www.iocoder.cn/xxx.mp3") @NotEmpty(message = "回复的音乐链接不能为空", groups = MusicMessageGroup.class) @URL(message = "回复的高质量音乐链接格式不正确", groups = MusicMessageGroup.class) private String responseMusicUrl; - @ApiModelProperty(value = "高质量音乐链接", example = "https://www.iocoder.cn/xxx.mp3") + @Schema(description = "高质量音乐链接", example = "https://www.iocoder.cn/xxx.mp3") @NotEmpty(message = "回复的高质量音乐链接不能为空", groups = MusicMessageGroup.class) @URL(message = "回复的高质量音乐链接格式不正确", groups = MusicMessageGroup.class) private String responseHqMusicUrl; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyCreateReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyCreateReqVO.java index a0020f429..1e2694886 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyCreateReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyCreateReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.mp.controller.admin.message.vo.autoreply; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 公众号自动回复的创建 Request VO") +@Schema(description = "管理后台 - 公众号自动回复的创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MpAutoReplyCreateReqVO extends MpAutoReplyBaseVO { - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "1024") + @Schema(description = "公众号账号的编号", required = true, example = "1024") @NotNull(message = "公众号账号的编号不能为空") private Long accountId; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyPageReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyPageReqVO.java index 20e6af0b3..ee3794f56 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyPageReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyPageReqVO.java @@ -1,21 +1,20 @@ package cn.iocoder.yudao.module.mp.controller.admin.message.vo.autoreply; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 公众号自动回复的分页 Request VO") +@Schema(description = "管理后台 - 公众号自动回复的分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MpAutoReplyPageReqVO extends PageParam { - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "1") + @Schema(description = "公众号账号的编号", required = true, example = "1") @NotNull(message = "公众号账号的编号不能为空") private Long accountId; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyRespVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyRespVO.java index cdef6a31b..9bd1aaaa7 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyRespVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyRespVO.java @@ -1,28 +1,27 @@ package cn.iocoder.yudao.module.mp.controller.admin.message.vo.autoreply; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.util.Date; -@ApiModel("管理后台 - 公众号自动回复 Response VO") +@Schema(description = "管理后台 - 公众号自动回复 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MpAutoReplyRespVO extends MpAutoReplyBaseVO { - @ApiModelProperty(value = "主键", required = true, example = "1024") + @Schema(description = "主键", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "1024") + @Schema(description = "公众号账号的编号", required = true, example = "1024") private Long accountId; - @ApiModelProperty(value = "公众号 appId", required = true, example = "wx1234567890") + @Schema(description = "公众号 appId", required = true, example = "wx1234567890") private String appId; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private Date createTime; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyUpdateReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyUpdateReqVO.java index f95ff0ce8..5478c687b 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyUpdateReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/autoreply/MpAutoReplyUpdateReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.mp.controller.admin.message.vo.autoreply; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 公众号自动回复的更新 Request VO") +@Schema(description = "管理后台 - 公众号自动回复的更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MpAutoReplyUpdateReqVO extends MpAutoReplyBaseVO { - @ApiModelProperty(value = "主键", required = true, example = "1024") + @Schema(description = "主键", required = true, example = "1024") @NotNull(message = "主键不能为空") private Long id; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/message/MpMessagePageReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/message/MpMessagePageReqVO.java index 4cf6190c4..b4ead5705 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/message/MpMessagePageReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/message/MpMessagePageReqVO.java @@ -1,9 +1,10 @@ package cn.iocoder.yudao.module.mp.controller.admin.message.vo.message; -import lombok.*; - -import io.swagger.annotations.*; import cn.iocoder.yudao.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.NotNull; @@ -11,24 +12,24 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 公众号消息分页 Request VO") +@Schema(description = "管理后台 - 公众号消息分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MpMessagePageReqVO extends PageParam { - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "1024") + @Schema(description = "公众号账号的编号", required = true, example = "1024") @NotNull(message = "公众号账号的编号不能为空") private Long accountId; - @ApiModelProperty(value = "消息类型", example = "text", notes = "参见 WxConsts.XmlMsgType 枚举") + @Schema(description = "消息类型 参见 WxConsts.XmlMsgType 枚举", example = "text") private String type; - @ApiModelProperty(value = "公众号粉丝标识", example = "o6_bmjrPTlm6_2sgVt7hMZOPfL2M") + @Schema(description = "公众号粉丝标识", example = "o6_bmjrPTlm6_2sgVt7hMZOPfL2M") private String openid; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/message/MpMessageRespVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/message/MpMessageRespVO.java index 195e56fbd..3e2bfef60 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/message/MpMessageRespVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/message/MpMessageRespVO.java @@ -2,80 +2,77 @@ package cn.iocoder.yudao.module.mp.controller.admin.message.vo.message; import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpMessageDO; import com.baomidou.mybatisplus.annotation.TableField; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import me.chanjar.weixin.common.api.WxConsts; import java.util.Date; import java.util.List; -@ApiModel("管理后台 - 公众号消息 Response VO") +@Schema(description = "管理后台 - 公众号消息 Response VO") @Data public class MpMessageRespVO { - @ApiModelProperty(value = "主键", required = true, example = "1024") + @Schema(description = "主键", required = true, example = "1024") private Integer id; - @ApiModelProperty(value = "微信公众号消息 id", required = true, example = "23953173569869169") + @Schema(description = "微信公众号消息 id", required = true, example = "23953173569869169") private Long msgId; - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "1") + @Schema(description = "公众号账号的编号", required = true, example = "1") private Long accountId; - @ApiModelProperty(value = "公众号账号的 appid", required = true, example = "wx1234567890") + @Schema(description = "公众号账号的 appid", required = true, example = "wx1234567890") private String appId; - @ApiModelProperty(value = "公众号粉丝编号", required = true, example = "2048") + @Schema(description = "公众号粉丝编号", required = true, example = "2048") private Long userId; - @ApiModelProperty(value = "公众号粉丝标志", required = true, example = "o6_bmjrPTlm6_2sgVt7hMZOPfL2M") + @Schema(description = "公众号粉丝标志", required = true, example = "o6_bmjrPTlm6_2sgVt7hMZOPfL2M") private String openid; - @ApiModelProperty(value = "消息类型", required = true, example = "text", notes = "参见 WxConsts.XmlMsgType 枚举") + @Schema(description = "消息类型 参见 WxConsts.XmlMsgType 枚举", required = true, example = "text") private String type; - @ApiModelProperty(value = "消息来源", required = true, example = "1", notes = "参见 MpMessageSendFromEnum 枚举") + @Schema(description = "消息来源 参见 MpMessageSendFromEnum 枚举", required = true, example = "1") private Integer sendFrom; // ========= 普通消息内容 https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_standard_messages.html - @ApiModelProperty(value = "消息内容", example = "你好呀", notes = "消息类型为 text 时,才有值") + @Schema(description = "消息内容 消息类型为 text 时,才有值", example = "你好呀") private String content; - @ApiModelProperty(value = "媒体素材的编号", example = "1234567890", notes = "消息类型为 image、voice、video 时,才有值") + @Schema(description = "媒体素材的编号 消息类型为 image、voice、video 时,才有值", example = "1234567890") private String mediaId; - @ApiModelProperty(value = "媒体文件的 URL", example = "https://www.iocoder.cn/xxx.png", - notes = "消息类型为 image、voice、video 时,才有值") + @Schema(description = "媒体文件的 URL 消息类型为 image、voice、video 时,才有值", example = "https://www.iocoder.cn/xxx.png") private String mediaUrl; - @ApiModelProperty(value = "语音识别后文本", example = "语音识别后文本", notes = "消息类型为 voice 时,才有值") + @Schema(description = "语音识别后文本 消息类型为 voice 时,才有值", example = "语音识别后文本") private String recognition; - @ApiModelProperty(value = "语音格式", example = "amr", notes = "消息类型为 voice 时,才有值") + @Schema(description = "语音格式 消息类型为 voice 时,才有值", example = "amr") private String format; - @ApiModelProperty(value = "标题", example = "我是标题", notes = "消息类型为 video、music、link 时,才有值") + @Schema(description = "标题 消息类型为 video、music、link 时,才有值", example = "我是标题") private String title; - @ApiModelProperty(value = "描述", example = "我是描述", notes = "消息类型为 video、music 时,才有值") + @Schema(description = "描述 消息类型为 video、music 时,才有值", example = "我是描述") private String description; - @ApiModelProperty(value = "缩略图的媒体 id", example = "1234567890", notes = "消息类型为 video、music 时,才有值") + @Schema(description = "缩略图的媒体 id 消息类型为 video、music 时,才有值", example = "1234567890") private String thumbMediaId; - @ApiModelProperty(value = "缩略图的媒体 URL", example = "https://www.iocoder.cn/xxx.png", - notes = "消息类型为 video、music 时,才有值") + @Schema(description = "缩略图的媒体 URL 消息类型为 video、music 时,才有值", example = "https://www.iocoder.cn/xxx.png") private String thumbMediaUrl; - @ApiModelProperty(value = "点击图文消息跳转链接", example = "https://www.iocoder.cn", notes = "消息类型为 link 时,才有值") + @Schema(description = "点击图文消息跳转链接 消息类型为 link 时,才有值", example = "https://www.iocoder.cn") private String url; - @ApiModelProperty(value = "地理位置维度", example = "23.137466", notes = "消息类型为 location 时,才有值") + @Schema(description = "地理位置维度 消息类型为 location 时,才有值", example = "23.137466") private Double locationX; - @ApiModelProperty(value = "地理位置经度", example = "113.352425", notes = "消息类型为 location 时,才有值") + @Schema(description = "地理位置经度 消息类型为 location 时,才有值", example = "113.352425") private Double locationY; - @ApiModelProperty(value = "地图缩放大小", example = "13", notes = "消息类型为 location 时,才有值") + @Schema(description = "地图缩放大小 消息类型为 location 时,才有值", example = "13") private Double scale; - @ApiModelProperty(value = "详细地址", example = "杨浦区黄兴路 221-4 号临", notes = "消息类型为 location 时,才有值") + @Schema(description = "详细地址 消息类型为 location 时,才有值", example = "杨浦区黄兴路 221-4 号临") private String label; /** @@ -86,19 +83,19 @@ public class MpMessageRespVO { @TableField(typeHandler = MpMessageDO.ArticleTypeHandler.class) private List articles; - @ApiModelProperty(value = "音乐链接", example = "https://www.iocoder.cn/xxx.mp3", notes = "消息类型为 music 时,才有值") + @Schema(description = "音乐链接 消息类型为 music 时,才有值", example = "https://www.iocoder.cn/xxx.mp3") private String musicUrl; - @ApiModelProperty(value = "高质量音乐链接", example = "https://www.iocoder.cn/xxx.mp3", notes = "消息类型为 music 时,才有值") + @Schema(description = "高质量音乐链接 消息类型为 music 时,才有值", example = "https://www.iocoder.cn/xxx.mp3") private String hqMusicUrl; // ========= 事件推送 https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_event_pushes.html - @ApiModelProperty(value = "事件类型", example = "subscribe", notes = "参见 WxConsts.EventType 枚举") + @Schema(description = "事件类型 参见 WxConsts.EventType 枚举", example = "subscribe") private String event; - @ApiModelProperty(value = "事件 Key", example = "qrscene_123456", notes = "参见 WxConsts.EventType 枚举") + @Schema(description = "事件 Key 参见 WxConsts.EventType 枚举", example = "qrscene_123456") private String eventKey; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private Date createTime; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/message/MpMessageSendReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/message/MpMessageSendReqVO.java index 8b6492484..465cbff60 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/message/MpMessageSendReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/message/vo/message/MpMessageSendReqVO.java @@ -2,8 +2,7 @@ package cn.iocoder.yudao.module.mp.controller.admin.message.vo.message; import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpMessageDO; import cn.iocoder.yudao.module.mp.framework.mp.core.util.MpUtils.*; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.Valid; @@ -11,49 +10,49 @@ import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.util.List; -@ApiModel("管理后台 - 公众号消息发送 Request VO") +@Schema(description = "管理后台 - 公众号消息发送 Request VO") @Data public class MpMessageSendReqVO { - @ApiModelProperty(value = "公众号粉丝的编号", required = true, example = "1024") + @Schema(description = "公众号粉丝的编号", required = true, example = "1024") @NotNull(message = "公众号粉丝的编号不能为空") private Long userId; // ========== 消息内容 ========== - @ApiModelProperty(value = "消息类型", required = true, example = "text", notes = "TEXT/IMAGE/VOICE/VIDEO/NEWS") + @Schema(description = "消息类型 TEXT/IMAGE/VOICE/VIDEO/NEWS", required = true, example = "text") @NotEmpty(message = "消息类型不能为空") public String type; - @ApiModelProperty(value = "消息内容", required = true, example = "你好呀") + @Schema(description = "消息内容", required = true, example = "你好呀") @NotEmpty(message = "消息内容不能为空", groups = TextMessageGroup.class) private String content; - @ApiModelProperty(value = "媒体 ID", required = true, example = "qqc_2Fot30Jse-HDoZmo5RrUDijz2nGUkP") + @Schema(description = "媒体 ID", required = true, example = "qqc_2Fot30Jse-HDoZmo5RrUDijz2nGUkP") @NotEmpty(message = "消息内容不能为空", groups = {ImageMessageGroup.class, VoiceMessageGroup.class, VideoMessageGroup.class}) private String mediaId; - @ApiModelProperty(value = "标题", required = true, example = "没有标题") + @Schema(description = "标题", required = true, example = "没有标题") @NotEmpty(message = "消息内容不能为空", groups = VideoMessageGroup.class) private String title; - @ApiModelProperty(value = "描述", required = true, example = "你猜") + @Schema(description = "描述", required = true, example = "你猜") @NotEmpty(message = "消息描述不能为空", groups = VideoMessageGroup.class) private String description; - @ApiModelProperty(value = "缩略图的媒体 id", required = true, example = "qqc_2Fot30Jse-HDoZmo5RrUDijz2nGUkP") + @Schema(description = "缩略图的媒体 id", required = true, example = "qqc_2Fot30Jse-HDoZmo5RrUDijz2nGUkP") @NotEmpty(message = "缩略图的媒体 id 不能为空", groups = MusicMessageGroup.class) private String thumbMediaId; - @ApiModelProperty(value = "图文消息", required = true) + @Schema(description = "图文消息", required = true) @Valid @NotNull(message = "图文消息不能为空", groups = NewsMessageGroup.class) private List articles; - @ApiModelProperty(value = "音乐链接", example = "https://www.iocoder.cn/music.mp3", notes = "消息类型为 MUSIC 时") + @Schema(description = "音乐链接 消息类型为 MUSIC 时", example = "https://www.iocoder.cn/music.mp3") private String musicUrl; - @ApiModelProperty(value = "高质量音乐链接", example = "https://www.iocoder.cn/music.mp3", notes = "消息类型为 MUSIC 时") + @Schema(description = "高质量音乐链接 消息类型为 MUSIC 时", example = "https://www.iocoder.cn/music.mp3") private String hqMusicUrl; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpDraftController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpDraftController.java index 148b5a5fe..c43d6c5d7 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpDraftController.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpDraftController.java @@ -9,10 +9,10 @@ import cn.iocoder.yudao.module.mp.controller.admin.news.vo.MpDraftPageReqVO; import cn.iocoder.yudao.module.mp.dal.dataobject.material.MpMaterialDO; import cn.iocoder.yudao.module.mp.framework.mp.core.MpServiceFactory; import cn.iocoder.yudao.module.mp.service.material.MpMaterialService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.mp.api.WxMpService; import me.chanjar.weixin.mp.bean.draft.*; @@ -31,7 +31,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.util.collection.MapUtils.findAndThen; import static cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants.*; -@Api(tags = "管理后台 - 公众号草稿") +@Tag(name = "管理后台 - 公众号草稿") @RestController @RequestMapping("/mp/draft") @Validated @@ -44,7 +44,7 @@ public class MpDraftController { private MpMaterialService mpMaterialService; @GetMapping("/page") - @ApiOperation("获得草稿分页") + @Operation(summary = "获得草稿分页") @PreAuthorize("@ss.hasPermission('mp:draft:query')") public CommonResult> getDraftPage(MpDraftPageReqVO reqVO) { // 从公众号查询草稿箱 @@ -79,9 +79,8 @@ public class MpDraftController { } @PostMapping("/create") - @ApiOperation("创建草稿") - @ApiImplicitParam(name = "accountId", value = "公众号账号的编号", required = true, - example = "1024", dataTypeClass = Long.class) + @Operation(summary = "创建草稿") + @Parameter(name = "accountId", description = "公众号账号的编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('mp:draft:create')") public CommonResult deleteDraft(@RequestParam("accountId") Long accountId, @RequestBody WxMpAddDraft draft) { @@ -95,12 +94,10 @@ public class MpDraftController { } @PutMapping("/update") - @ApiOperation("更新草稿") - @ApiImplicitParams({ - @ApiImplicitParam(name = "accountId", value = "公众号账号的编号", required = true, - example = "1024", dataTypeClass = Long.class), - @ApiImplicitParam(name = "mediaId", value = "草稿素材的编号", required = true, - example = "xxx", dataTypeClass = String.class), + @Operation(summary = "更新草稿") + @Parameters({ + @Parameter(name = "accountId", description = "公众号账号的编号", required = true, example = "1024"), + @Parameter(name = "mediaId", description = "草稿素材的编号", required = true, example = "xxx") }) @PreAuthorize("@ss.hasPermission('mp:draft:update')") public CommonResult deleteDraft(@RequestParam("accountId") Long accountId, @@ -119,12 +116,10 @@ public class MpDraftController { } @DeleteMapping("/delete") - @ApiOperation("删除草稿") - @ApiImplicitParams({ - @ApiImplicitParam(name = "accountId", value = "公众号账号的编号", required = true, - example = "1024", dataTypeClass = Long.class), - @ApiImplicitParam(name = "mediaId", value = "草稿素材的编号", required = true, - example = "xxx", dataTypeClass = String.class), + @Operation(summary = "删除草稿") + @Parameters({ + @Parameter(name = "accountId", description = "公众号账号的编号", required = true, example = "1024"), + @Parameter(name = "mediaId", description = "草稿素材的编号", required = true, example = "xxx") }) @PreAuthorize("@ss.hasPermission('mp:draft:delete')") public CommonResult deleteDraft(@RequestParam("accountId") Long accountId, diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpFreePublishController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpFreePublishController.java index 6938e3274..e36d7343c 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpFreePublishController.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/MpFreePublishController.java @@ -9,10 +9,10 @@ import cn.iocoder.yudao.module.mp.controller.admin.news.vo.MpFreePublishPageReqV import cn.iocoder.yudao.module.mp.dal.dataobject.material.MpMaterialDO; import cn.iocoder.yudao.module.mp.framework.mp.core.MpServiceFactory; import cn.iocoder.yudao.module.mp.service.material.MpMaterialService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.mp.api.WxMpService; import me.chanjar.weixin.mp.bean.freepublish.WxMpFreePublishItem; @@ -32,7 +32,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.util.collection.MapUtils.findAndThen; import static cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants.*; -@Api(tags = "管理后台 - 公众号发布能力") +@Tag(name = "管理后台 - 公众号发布能力") @RestController @RequestMapping("/mp/free-publish") @Validated @@ -45,7 +45,7 @@ public class MpFreePublishController { private MpMaterialService mpMaterialService; @GetMapping("/page") - @ApiOperation("获得已发布的图文分页") + @Operation(summary = "获得已发布的图文分页") @PreAuthorize("@ss.hasPermission('mp:free-publish:query')") public CommonResult> getFreePublishPage(MpFreePublishPageReqVO reqVO) { // 从公众号查询已发布的图文列表 @@ -81,12 +81,10 @@ public class MpFreePublishController { } @PostMapping("/submit") - @ApiOperation("发布草稿") - @ApiImplicitParams({ - @ApiImplicitParam(name = "accountId", value = "公众号账号的编号", required = true, - example = "1024", dataTypeClass = Long.class), - @ApiImplicitParam(name = "mediaId", value = "要发布的草稿的 media_id", required = true, - example = "2048", dataTypeClass = String.class) + @Operation(summary = "发布草稿") + @Parameters({ + @Parameter(name = "accountId", description = "公众号账号的编号", required = true, example = "1024"), + @Parameter(name = "mediaId", description = "要发布的草稿的 media_id", required = true, example = "2048") }) @PreAuthorize("@ss.hasPermission('mp:free-publish:submit')") public CommonResult submitFreePublish(@RequestParam("accountId") Long accountId, @@ -101,12 +99,10 @@ public class MpFreePublishController { } @DeleteMapping("/delete") - @ApiOperation("删除草稿") - @ApiImplicitParams({ - @ApiImplicitParam(name = "accountId", value = "公众号账号的编号", required = true, - example = "1024", dataTypeClass = Long.class), - @ApiImplicitParam(name = "articleId", value = "发布记录的编号", required = true, - example = "2048", dataTypeClass = String.class) + @Operation(summary = "删除草稿") + @Parameters({ + @Parameter(name = "accountId", description = "公众号账号的编号", required = true, example = "1024"), + @Parameter(name = "articleId", description = "发布记录的编号", required = true, example = "2048") }) @PreAuthorize("@ss.hasPermission('mp:free-publish:delete')") public CommonResult deleteFreePublish(@RequestParam("accountId") Long accountId, diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/vo/MpDraftPageReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/vo/MpDraftPageReqVO.java index c6a5afbca..5c285f627 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/vo/MpDraftPageReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/vo/MpDraftPageReqVO.java @@ -1,21 +1,20 @@ package cn.iocoder.yudao.module.mp.controller.admin.news.vo; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 公众号草稿的分页 Request VO") +@Schema(description = "管理后台 - 公众号草稿的分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MpDraftPageReqVO extends PageParam { - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "1024") + @Schema(description = "公众号账号的编号", required = true, example = "1024") @NotNull(message = "公众号账号的编号不能为空") private Long accountId; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/vo/MpFreePublishPageReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/vo/MpFreePublishPageReqVO.java index 140e029ee..51f2c6c74 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/vo/MpFreePublishPageReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/news/vo/MpFreePublishPageReqVO.java @@ -1,21 +1,20 @@ package cn.iocoder.yudao.module.mp.controller.admin.news.vo; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 公众号已发布列表的分页 Request VO") +@Schema(description = "管理后台 - 公众号已发布列表的分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MpFreePublishPageReqVO extends PageParam { - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "1024") + @Schema(description = "公众号账号的编号", required = true, example = "1024") @NotNull(message = "公众号账号的编号不能为空") private Long accountId; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/open/MpOpenController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/open/MpOpenController.java index 10954d80b..067102e11 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/open/MpOpenController.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/open/MpOpenController.java @@ -10,8 +10,8 @@ import cn.iocoder.yudao.module.mp.dal.dataobject.account.MpAccountDO; import cn.iocoder.yudao.module.mp.framework.mp.core.MpServiceFactory; import cn.iocoder.yudao.module.mp.framework.mp.core.context.MpContextHolder; import cn.iocoder.yudao.module.mp.service.account.MpAccountService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.mp.api.WxMpMessageRouter; import me.chanjar.weixin.mp.api.WxMpService; @@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.Objects; -@Api(tags = "管理后台 - 公众号回调") +@Tag(name = "管理后台 - 公众号回调") @RestController @RequestMapping("/mp/open") @Validated @@ -41,7 +41,7 @@ public class MpOpenController { * * 对应 文档 */ - @ApiOperation("校验签名") // 参见 + @Operation(summary = "校验签名") // 参见 @GetMapping(value = "/{appId}", produces = "text/plain;charset=utf-8") public String checkSignature(@PathVariable("appId") String appId, MpOpenCheckSignatureReqVO reqVO) { @@ -61,7 +61,7 @@ public class MpOpenController { * * 文档 */ - @ApiOperation("处理消息") + @Operation(summary = "处理消息") @PostMapping(value = "/{appId}", produces = "application/xml; charset=UTF-8") @OperateLog(enable = false) // 回调地址,无需记录操作日志 public String handleMessage(@PathVariable("appId") String appId, diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/open/vo/MpOpenCheckSignatureReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/open/vo/MpOpenCheckSignatureReqVO.java index 23c3ab01d..67dfa6232 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/open/vo/MpOpenCheckSignatureReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/open/vo/MpOpenCheckSignatureReqVO.java @@ -1,32 +1,27 @@ package cn.iocoder.yudao.module.mp.controller.admin.open.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.ToString; -import org.springframework.web.bind.annotation.RequestParam; import javax.validation.constraints.NotEmpty; -@ApiModel("管理后台 - 公众号校验签名 Request VO") +@Schema(description = "管理后台 - 公众号校验签名 Request VO") @Data public class MpOpenCheckSignatureReqVO { - @ApiModelProperty(value = "微信加密签名", required = true, example = "490eb57f448b87bd5f20ccef58aa4de46aa1908e") + @Schema(description = "微信加密签名", required = true, example = "490eb57f448b87bd5f20ccef58aa4de46aa1908e") @NotEmpty(message = "微信加密签名不能为空") private String signature; - @ApiModelProperty(value = "时间戳", required = true, example = "1672587863") + @Schema(description = "时间戳", required = true, example = "1672587863") @NotEmpty(message = "时间戳不能为空") private String timestamp; - @ApiModelProperty(value = "随机数", required = true, example = "1827365808") + @Schema(description = "随机数", required = true, example = "1827365808") @NotEmpty(message = "随机数不能为空") private String nonce; - @ApiModelProperty(value = "随机字符串", required = true, example = "2721154047828672511") + @Schema(description = "随机字符串", required = true, example = "2721154047828672511") @NotEmpty(message = "随机字符串不能为空") @SuppressWarnings("SpellCheckingInspection") private String echostr; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/open/vo/MpOpenHandleMessageReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/open/vo/MpOpenHandleMessageReqVO.java index 36310481a..4f9e51699 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/open/vo/MpOpenHandleMessageReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/open/vo/MpOpenHandleMessageReqVO.java @@ -1,38 +1,37 @@ package cn.iocoder.yudao.module.mp.controller.admin.open.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; -@ApiModel("管理后台 - 公众号处理消息 Request VO") +@Schema(description = "管理后台 - 公众号处理消息 Request VO") @Data public class MpOpenHandleMessageReqVO { public static final String ENCRYPT_TYPE_AES = "aes"; - @ApiModelProperty(value = "微信加密签名", required = true, example = "490eb57f448b87bd5f20ccef58aa4de46aa1908e") + @Schema(description = "微信加密签名", required = true, example = "490eb57f448b87bd5f20ccef58aa4de46aa1908e") @NotEmpty(message = "微信加密签名不能为空") private String signature; - @ApiModelProperty(value = "时间戳", required = true, example = "1672587863") + @Schema(description = "时间戳", required = true, example = "1672587863") @NotEmpty(message = "时间戳不能为空") private String timestamp; - @ApiModelProperty(value = "随机数", required = true, example = "1827365808") + @Schema(description = "随机数", required = true, example = "1827365808") @NotEmpty(message = "随机数不能为空") private String nonce; - @ApiModelProperty(value = "粉丝 openid", required = true, example = "oz-Jdtyn-WGm4C4I5Z-nvBMO_ZfY") + @Schema(description = "粉丝 openid", required = true, example = "oz-Jdtyn-WGm4C4I5Z-nvBMO_ZfY") @NotEmpty(message = "粉丝 openid 不能为空") private String openid; - @ApiModelProperty(value = "消息加密类型", example = "aes") + @Schema(description = "消息加密类型", example = "aes") private String encrypt_type; - @ApiModelProperty(value = "微信签名", example = "QW5kcm9pZCBUaGUgQmFzZTY0IGlzIGEgZ2VuZXJhdGVkIHN0cmluZw==") + @Schema(description = "微信签名", example = "QW5kcm9pZCBUaGUgQmFzZTY0IGlzIGEgZ2VuZXJhdGVkIHN0cmluZw==") private String msg_signature; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/MpStatisticsController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/MpStatisticsController.java index 3a5380ec9..8a9df53c3 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/MpStatisticsController.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/MpStatisticsController.java @@ -4,8 +4,8 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.mp.controller.admin.statistics.vo.*; import cn.iocoder.yudao.module.mp.convert.statistics.MpStatisticsConvert; import cn.iocoder.yudao.module.mp.service.statistics.MpStatisticsService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import me.chanjar.weixin.mp.bean.datacube.WxDataCubeInterfaceResult; import me.chanjar.weixin.mp.bean.datacube.WxDataCubeMsgResult; import me.chanjar.weixin.mp.bean.datacube.WxDataCubeUserCumulate; @@ -21,7 +21,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 公众号统计") +@Tag(name = "管理后台 - 公众号统计") @RestController @RequestMapping("/mp/statistics") @Validated @@ -31,7 +31,7 @@ public class MpStatisticsController { private MpStatisticsService mpStatisticsService; @GetMapping("/user-summary") - @ApiOperation("获得粉丝增减数据") + @Operation(summary = "获得粉丝增减数据") @PreAuthorize("@ss.hasPermission('mp:statistics:query')") public CommonResult> getUserSummary(MpStatisticsGetReqVO getReqVO) { List list = mpStatisticsService.getUserSummary( @@ -40,7 +40,7 @@ public class MpStatisticsController { } @GetMapping("/user-cumulate") - @ApiOperation("获得粉丝累计数据") + @Operation(summary = "获得粉丝累计数据") @PreAuthorize("@ss.hasPermission('mp:statistics:query')") public CommonResult> getUserCumulate(MpStatisticsGetReqVO getReqVO) { List list = mpStatisticsService.getUserCumulate( @@ -49,7 +49,7 @@ public class MpStatisticsController { } @GetMapping("/upstream-message") - @ApiOperation("获取消息发送概况数据") + @Operation(summary = "获取消息发送概况数据") @PreAuthorize("@ss.hasPermission('mp:statistics:query')") public CommonResult> getUpstreamMessage(MpStatisticsGetReqVO getReqVO) { List list = mpStatisticsService.getUpstreamMessage( @@ -58,7 +58,7 @@ public class MpStatisticsController { } @GetMapping("/interface-summary") - @ApiOperation("获取消息发送概况数据") + @Operation(summary = "获取消息发送概况数据") @PreAuthorize("@ss.hasPermission('mp:statistics:query')") public CommonResult> getInterfaceSummary(MpStatisticsGetReqVO getReqVO) { List list = mpStatisticsService.getInterfaceSummary( diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsGetReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsGetReqVO.java index 63b514887..19b8537e6 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsGetReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsGetReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.mp.controller.admin.statistics.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -10,15 +9,15 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 获得统计数据 Request VO") +@Schema(description = "管理后台 - 获得统计数据 Request VO") @Data public class MpStatisticsGetReqVO { - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "1024") + @Schema(description = "公众号账号的编号", required = true, example = "1024") @NotNull(message = "公众号账号的编号不能为空") private Long accountId; - @ApiModelProperty(value = "查询时间范围") + @Schema(description = "查询时间范围") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @NotNull(message = "查询时间范围不能为空") private LocalDateTime[] date; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsInterfaceSummaryRespVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsInterfaceSummaryRespVO.java index dfcf45fa3..78db7666c 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsInterfaceSummaryRespVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsInterfaceSummaryRespVO.java @@ -1,28 +1,27 @@ package cn.iocoder.yudao.module.mp.controller.admin.statistics.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.Date; -@ApiModel("管理后台 - 某一天的接口分析数据 Response VO") +@Schema(description = "管理后台 - 某一天的接口分析数据 Response VO") @Data public class MpStatisticsInterfaceSummaryRespVO { - @ApiModelProperty(value = "日期", required = true) + @Schema(description = "日期", required = true) private Date refDate; - @ApiModelProperty(value = "通过服务器配置地址获得消息后,被动回复粉丝消息的次数", required = true, example = "10") + @Schema(description = "通过服务器配置地址获得消息后,被动回复粉丝消息的次数", required = true, example = "10") private Integer callbackCount; - @ApiModelProperty(value = "上述动作的失败次数", required = true, example = "20") + @Schema(description = "上述动作的失败次数", required = true, example = "20") private Integer failCount; - @ApiModelProperty(value = "总耗时,除以 callback_count 即为平均耗时", required = true, example = "30") + @Schema(description = "总耗时,除以 callback_count 即为平均耗时", required = true, example = "30") private Integer totalTimeCost; - @ApiModelProperty(value = "最大耗时", required = true, example = "40") + @Schema(description = "最大耗时", required = true, example = "40") private Integer maxTimeCost; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsUpstreamMessageRespVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsUpstreamMessageRespVO.java index 8a0386165..0f2a71916 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsUpstreamMessageRespVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsUpstreamMessageRespVO.java @@ -1,22 +1,21 @@ package cn.iocoder.yudao.module.mp.controller.admin.statistics.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.Date; -@ApiModel("管理后台 - 某一天的粉丝增减数据 Response VO") +@Schema(description = "管理后台 - 某一天的粉丝增减数据 Response VO") @Data public class MpStatisticsUpstreamMessageRespVO { - @ApiModelProperty(value = "日期", required = true) + @Schema(description = "日期", required = true) private Date refDate; - @ApiModelProperty(value = "上行发送了(向公众号发送了)消息的粉丝数", required = true, example = "10") + @Schema(description = "上行发送了(向公众号发送了)消息的粉丝数", required = true, example = "10") private Integer messageUser; - @ApiModelProperty(value = "上行发送了消息的消息总数", required = true, example = "20") + @Schema(description = "上行发送了消息的消息总数", required = true, example = "20") private Integer messageCount; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsUserCumulateRespVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsUserCumulateRespVO.java index 0db34a790..630c193b5 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsUserCumulateRespVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsUserCumulateRespVO.java @@ -1,19 +1,18 @@ package cn.iocoder.yudao.module.mp.controller.admin.statistics.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.Date; -@ApiModel("管理后台 - 某一天的消息发送概况数据 Response VO") +@Schema(description = "管理后台 - 某一天的消息发送概况数据 Response VO") @Data public class MpStatisticsUserCumulateRespVO { - @ApiModelProperty(value = "日期", required = true) + @Schema(description = "日期", required = true) private Date refDate; - @ApiModelProperty(value = "累计粉丝量", required = true, example = "10") + @Schema(description = "累计粉丝量", required = true, example = "10") private Integer cumulateUser; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsUserSummaryRespVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsUserSummaryRespVO.java index c65247cce..b99f554ab 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsUserSummaryRespVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/statistics/vo/MpStatisticsUserSummaryRespVO.java @@ -1,25 +1,24 @@ package cn.iocoder.yudao.module.mp.controller.admin.statistics.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.Date; -@ApiModel("管理后台 - 某一天的粉丝增减数据 Response VO") +@Schema(description = "管理后台 - 某一天的粉丝增减数据 Response VO") @Data public class MpStatisticsUserSummaryRespVO { - @ApiModelProperty(value = "日期", required = true) + @Schema(description = "日期", required = true) private Date refDate; - @ApiModelProperty(value = "粉丝来源", required = true, example = "0") + @Schema(description = "粉丝来源", required = true, example = "0") private Integer userSource; - @ApiModelProperty(value = "新关注的粉丝数量", required = true, example = "10") + @Schema(description = "新关注的粉丝数量", required = true, example = "10") private Integer newUser; - @ApiModelProperty(value = "取消关注的粉丝数量", required = true, example = "20") + @Schema(description = "取消关注的粉丝数量", required = true, example = "20") private Integer cancelUser; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/MpTagController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/MpTagController.java index 1ae7751fe..d7237d282 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/MpTagController.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/MpTagController.java @@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.mp.controller.admin.tag.vo.*; import cn.iocoder.yudao.module.mp.convert.tag.MpTagConvert; import cn.iocoder.yudao.module.mp.dal.dataobject.tag.MpTagDO; import cn.iocoder.yudao.module.mp.service.tag.MpTagService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -19,7 +19,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 公众号标签") +@Tag(name = "管理后台 - 公众号标签") @RestController @RequestMapping("/mp/tag") @Validated @@ -29,14 +29,14 @@ public class MpTagController { private MpTagService mpTagService; @PostMapping("/create") - @ApiOperation("创建公众号标签") + @Operation(summary = "创建公众号标签") @PreAuthorize("@ss.hasPermission('mp:tag:create')") public CommonResult createTag(@Valid @RequestBody MpTagCreateReqVO createReqVO) { return success(mpTagService.createTag(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新公众号标签") + @Operation(summary = "更新公众号标签") @PreAuthorize("@ss.hasPermission('mp:tag:update')") public CommonResult updateTag(@Valid @RequestBody MpTagUpdateReqVO updateReqVO) { mpTagService.updateTag(updateReqVO); @@ -44,8 +44,8 @@ public class MpTagController { } @DeleteMapping("/delete") - @ApiOperation("删除公众号标签") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除公众号标签") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('mp:tag:delete')") public CommonResult deleteTag(@RequestParam("id") Long id) { mpTagService.deleteTag(id); @@ -53,7 +53,7 @@ public class MpTagController { } @GetMapping("/page") - @ApiOperation("获取公众号标签分页") + @Operation(summary = "获取公众号标签分页") @PreAuthorize("@ss.hasPermission('mp:tag:query')") public CommonResult> getTagPage(MpTagPageReqVO pageReqVO) { PageResult pageResult = mpTagService.getTagPage(pageReqVO); @@ -61,7 +61,7 @@ public class MpTagController { } @GetMapping("/list-all-simple") - @ApiOperation(value = "获取公众号账号精简信息列表") + @Operation(summary = "获取公众号账号精简信息列表") @PreAuthorize("@ss.hasPermission('mp:account:query')") public CommonResult> getSimpleTags() { List list = mpTagService.getTagList(); @@ -69,8 +69,8 @@ public class MpTagController { } @PostMapping("/sync") - @ApiOperation("同步公众号标签") - @ApiImplicitParam(name = "accountId", value = "公众号账号的编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "同步公众号标签") + @Parameter(name = "accountId", description = "公众号账号的编号", required = true) @PreAuthorize("@ss.hasPermission('mp:tag:sync')") public CommonResult syncTag(@RequestParam("accountId") Long accountId) { mpTagService.syncTag(accountId); diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagBaseVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagBaseVO.java index 832faf535..f9cc47c35 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagBaseVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; @@ -14,7 +14,7 @@ import javax.validation.constraints.NotEmpty; @Data public class MpTagBaseVO { - @ApiModelProperty(value = "标签名", required = true, example = "土豆") + @Schema(description = "标签名", required = true, example = "土豆") @NotEmpty(message = "标签名不能为空") private String name; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagCreateReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagCreateReqVO.java index 24eb0167b..25fc2093e 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagCreateReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagCreateReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 公众号标签创建 Request VO") +@Schema(description = "管理后台 - 公众号标签创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MpTagCreateReqVO extends MpTagBaseVO { - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") + @Schema(description = "公众号账号的编号", required = true, example = "2048") @NotNull(message = "公众号账号的编号不能为空") private Long accountId; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagPageReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagPageReqVO.java index b48481fc2..b2e3a8643 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagPageReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagPageReqVO.java @@ -1,25 +1,24 @@ package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotEmpty; -@ApiModel("管理后台 - 公众号标签分页 Request VO") +@Schema(description = "管理后台 - 公众号标签分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MpTagPageReqVO extends PageParam { - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") + @Schema(description = "公众号账号的编号", required = true, example = "2048") @NotEmpty(message = "公众号账号的编号不能为空") private Long accountId; - @ApiModelProperty(value = "标签名", example = "哈哈", notes = "模糊匹配") + @Schema(description = "标签名 模糊匹配", example = "哈哈") private String name; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagRespVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagRespVO.java index cae0dab16..3a9a1cd9e 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagRespVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagRespVO.java @@ -1,26 +1,25 @@ package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.util.Date; -@ApiModel("管理后台 - 公众号标签 Response VO") +@Schema(description = "管理后台 - 公众号标签 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MpTagRespVO extends MpTagBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "此标签下粉丝数量", required = true, example = "0") + @Schema(description = "此标签下粉丝数量", required = true, example = "0") private Integer count; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private Date createTime; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagSimpleRespVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagSimpleRespVO.java index 75f68a6c9..9918ef563 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagSimpleRespVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagSimpleRespVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@ApiModel("管理后台 - 公众号标签精简信息 Response VO") +@Schema(description = "管理后台 - 公众号标签精简信息 Response VO") @Data public class MpTagSimpleRespVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "公众号的标签编号", required = true, example = "2048") + @Schema(description = "公众号的标签编号", required = true, example = "2048") private Long tagId; - @ApiModelProperty(value = "标签名称", required = true, example = "快乐") + @Schema(description = "标签名称", required = true, example = "快乐") private String name; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagUpdateReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagUpdateReqVO.java index 873871fd4..c8032ca96 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagUpdateReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/vo/MpTagUpdateReqVO.java @@ -1,17 +1,19 @@ package cn.iocoder.yudao.module.mp.controller.admin.tag.vo; -import lombok.*; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; -import javax.validation.constraints.*; +import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 公众号标签更新 Request VO") +@Schema(description = "管理后台 - 公众号标签更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MpTagUpdateReqVO extends MpTagBaseVO { - @ApiModelProperty(value = "编号", required = true) + @Schema(description = "编号", required = true) @NotNull(message = "编号不能为空") private Long id; diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/MpUserController.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/MpUserController.java index d446c1cfe..7098bc57e 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/MpUserController.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/MpUserController.java @@ -8,9 +8,9 @@ import cn.iocoder.yudao.module.mp.controller.admin.user.vo.MpUserUpdateReqVO; import cn.iocoder.yudao.module.mp.convert.user.MpUserConvert; import cn.iocoder.yudao.module.mp.dal.dataobject.user.MpUserDO; import cn.iocoder.yudao.module.mp.service.user.MpUserService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -20,7 +20,7 @@ import javax.validation.Valid; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 公众号粉丝") +@Tag(name = "管理后台 - 公众号粉丝") @RestController @RequestMapping("/mp/user") @Validated @@ -30,7 +30,7 @@ public class MpUserController { private MpUserService mpUserService; @GetMapping("/page") - @ApiOperation("获得公众号粉丝分页") + @Operation(summary = "获得公众号粉丝分页") @PreAuthorize("@ss.hasPermission('mp:user:query')") public CommonResult> getUserPage(@Valid MpUserPageReqVO pageVO) { PageResult pageResult = mpUserService.getUserPage(pageVO); @@ -38,15 +38,15 @@ public class MpUserController { } @GetMapping("/get") - @ApiOperation("获得公众号粉丝") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得公众号粉丝") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('mp:user:query')") public CommonResult getUser(@RequestParam("id") Long id) { return success(MpUserConvert.INSTANCE.convert(mpUserService.getUser(id))); } @PutMapping("/update") - @ApiOperation("更新公众号粉丝") + @Operation(summary = "更新公众号粉丝") @PreAuthorize("@ss.hasPermission('mp:user:update')") public CommonResult updateUser(@Valid @RequestBody MpUserUpdateReqVO updateReqVO) { mpUserService.updateUser(updateReqVO); @@ -54,8 +54,8 @@ public class MpUserController { } @PostMapping("/sync") - @ApiOperation("同步公众号粉丝") - @ApiImplicitParam(name = "accountId", value = "公众号账号的编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "同步公众号粉丝") + @Parameter(name = "accountId", description = "公众号账号的编号", required = true) @PreAuthorize("@ss.hasPermission('mp:user:sync')") public CommonResult syncUser(@RequestParam("accountId") Long accountId) { mpUserService.syncUser(accountId); diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/vo/MpUserPageReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/vo/MpUserPageReqVO.java index 96b8d7412..c6ef1fad3 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/vo/MpUserPageReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/vo/MpUserPageReqVO.java @@ -1,28 +1,27 @@ package cn.iocoder.yudao.module.mp.controller.admin.user.vo; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 公众号粉丝分页 Request VO") +@Schema(description = "管理后台 - 公众号粉丝分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MpUserPageReqVO extends PageParam { - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "2048") + @Schema(description = "公众号账号的编号", required = true, example = "2048") @NotNull(message = "公众号账号的编号不能为空") private Long accountId; - @ApiModelProperty(value = "公众号粉丝标识", example = "o6_bmjrPTlm6_2sgVt7hMZOPfL2M", notes = "模糊匹配") + @Schema(description = "公众号粉丝标识 模糊匹配", example = "o6_bmjrPTlm6_2sgVt7hMZOPfL2M") private String openid; - @ApiModelProperty(value = "公众号粉丝昵称", example = "芋艿", notes = "模糊匹配") + @Schema(description = "公众号粉丝昵称 模糊匹配", example = "芋艿") private String nickname; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/vo/MpUserRespVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/vo/MpUserRespVO.java index 4fb73840c..af2b1de74 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/vo/MpUserRespVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/vo/MpUserRespVO.java @@ -1,54 +1,53 @@ package cn.iocoder.yudao.module.mp.controller.admin.user.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; import java.util.Date; import java.util.List; -@ApiModel("管理后台 - 公众号粉丝 Response VO") +@Schema(description = "管理后台 - 公众号粉丝 Response VO") @Data public class MpUserRespVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "公众号粉丝标识", required = true, example = "o6_bmjrPTlm6_2sgVt7hMZOPfL2M") + @Schema(description = "公众号粉丝标识", required = true, example = "o6_bmjrPTlm6_2sgVt7hMZOPfL2M") private String openid; - @ApiModelProperty(value = "关注状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举") + @Schema(description = "关注状态 参见 CommonStatusEnum 枚举", required = true, example = "1") private Integer subscribeStatus; - @ApiModelProperty(value = "关注时间", required = true) + @Schema(description = "关注时间", required = true) private LocalDateTime subscribeTime; - @ApiModelProperty(value = "取消关注时间") + @Schema(description = "取消关注时间") private LocalDateTime unsubscribeTime; - @ApiModelProperty(value = "昵称", example = "芋道") + @Schema(description = "昵称", example = "芋道") private String nickname; - @ApiModelProperty(value = "头像地址", example = "https://www.iocoder.cn/1.png") + @Schema(description = "头像地址", example = "https://www.iocoder.cn/1.png") private String headImageUrl; - @ApiModelProperty(value = "语言", example = "zh_CN") + @Schema(description = "语言", example = "zh_CN") private String language; - @ApiModelProperty(value = "国家", example = "中国") + @Schema(description = "国家", example = "中国") private String country; - @ApiModelProperty(value = "省份", example = "广东省") + @Schema(description = "省份", example = "广东省") private String province; - @ApiModelProperty(value = "城市", example = "广州市") + @Schema(description = "城市", example = "广州市") private String city; - @ApiModelProperty(value = "备注", example = "你是一个芋头嘛") + @Schema(description = "备注", example = "你是一个芋头嘛") private String remark; - @ApiModelProperty(value = "标签编号数组", example = "1,2,3") + @Schema(description = "标签编号数组", example = "1,2,3") private List tagIds; - @ApiModelProperty(value = "公众号账号的编号", required = true, example = "1") + @Schema(description = "公众号账号的编号", required = true, example = "1") private Long accountId; - @ApiModelProperty(value = "公众号账号的 appId", required = true, example = "wx1234567890") + @Schema(description = "公众号账号的 appId", required = true, example = "wx1234567890") private String appId; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private Date createTime; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/vo/MpUserUpdateReqVO.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/vo/MpUserUpdateReqVO.java index e367a3ee0..6174f6c4c 100644 --- a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/vo/MpUserUpdateReqVO.java +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/user/vo/MpUserUpdateReqVO.java @@ -1,27 +1,26 @@ package cn.iocoder.yudao.module.mp.controller.admin.user.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; import java.util.List; -@ApiModel("管理后台 - 公众号粉丝更新 Request VO") +@Schema(description = "管理后台 - 公众号粉丝更新 Request VO") @Data public class MpUserUpdateReqVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") @NotNull(message = "编号不能为空") private Long id; - @ApiModelProperty(value = "昵称", example = "芋道") + @Schema(description = "昵称", example = "芋道") private String nickname; - @ApiModelProperty(value = "备注", example = "你是一个芋头嘛") + @Schema(description = "备注", example = "你是一个芋头嘛") private String remark; - @ApiModelProperty(value = "标签编号数组", example = "1,2,3") + @Schema(description = "标签编号数组", example = "1,2,3") private List tagIds; } diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/framework/web/config/MpWebConfiguration.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/framework/web/config/MpWebConfiguration.java new file mode 100644 index 000000000..3e6e1acfc --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/framework/web/config/MpWebConfiguration.java @@ -0,0 +1,24 @@ +package cn.iocoder.yudao.module.mp.framework.web.config; + +import cn.iocoder.yudao.framework.swagger.config.YudaoSwaggerAutoConfiguration; +import org.springdoc.core.GroupedOpenApi; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * mp 模块的 web 组件的 Configuration + * + * @author 芋道源码 + */ +@Configuration(proxyBeanMethods = false) +public class MpWebConfiguration { + + /** + * mp 模块的 API 分组 + */ + @Bean + public GroupedOpenApi mpGroupedOpenApi() { + return YudaoSwaggerAutoConfiguration.buildGroupedOpenApi("mp"); + } + +} diff --git a/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/framework/web/package-info.java b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/framework/web/package-info.java new file mode 100644 index 000000000..a103f1c38 --- /dev/null +++ b/yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/framework/web/package-info.java @@ -0,0 +1,4 @@ +/** + * mp 模块的 web 配置 + */ +package cn.iocoder.yudao.module.mp.framework.web; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/PayAppController.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/PayAppController.java index 47cc3a4db..4d746cf89 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/PayAppController.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/PayAppController.java @@ -15,9 +15,9 @@ import cn.iocoder.yudao.module.pay.dal.dataobject.merchant.PayMerchantDO; import cn.iocoder.yudao.module.pay.service.merchant.PayAppService; import cn.iocoder.yudao.module.pay.service.merchant.PayChannelService; import cn.iocoder.yudao.module.pay.service.merchant.PayMerchantService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import lombok.extern.slf4j.Slf4j; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -33,7 +33,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; @Slf4j -@Api(tags = "管理后台 - 支付应用信息") +@Tag(name = "管理后台 - 支付应用信息") @RestController @RequestMapping("/pay/app") @Validated @@ -47,14 +47,14 @@ public class PayAppController { private PayMerchantService merchantService; @PostMapping("/create") - @ApiOperation("创建支付应用信息") + @Operation(summary = "创建支付应用信息") @PreAuthorize("@ss.hasPermission('pay:app:create')") public CommonResult createApp(@Valid @RequestBody PayAppCreateReqVO createReqVO) { return success(appService.createApp(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新支付应用信息") + @Operation(summary = "更新支付应用信息") @PreAuthorize("@ss.hasPermission('pay:app:update')") public CommonResult updateApp(@Valid @RequestBody PayAppUpdateReqVO updateReqVO) { appService.updateApp(updateReqVO); @@ -62,7 +62,7 @@ public class PayAppController { } @PutMapping("/update-status") - @ApiOperation("更新支付应用状态") + @Operation(summary = "更新支付应用状态") @PreAuthorize("@ss.hasPermission('pay:app:update')") public CommonResult updateAppStatus(@Valid @RequestBody PayAppUpdateStatusReqVO updateReqVO) { appService.updateAppStatus(updateReqVO.getId(), updateReqVO.getStatus()); @@ -70,8 +70,8 @@ public class PayAppController { } @DeleteMapping("/delete") - @ApiOperation("删除支付应用信息") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除支付应用信息") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('pay:app:delete')") public CommonResult deleteApp(@RequestParam("id") Long id) { appService.deleteApp(id); @@ -79,8 +79,8 @@ public class PayAppController { } @GetMapping("/get") - @ApiOperation("获得支付应用信息") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得支付应用信息") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('pay:app:query')") public CommonResult getApp(@RequestParam("id") Long id) { PayAppDO app = appService.getApp(id); @@ -88,8 +88,8 @@ public class PayAppController { } @GetMapping("/list") - @ApiOperation("获得支付应用信息列表") - @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) + @Operation(summary = "获得支付应用信息列表") + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") @PreAuthorize("@ss.hasPermission('pay:app:query')") public CommonResult> getAppList(@RequestParam("ids") Collection ids) { List list = appService.getAppList(ids); @@ -97,7 +97,7 @@ public class PayAppController { } @GetMapping("/page") - @ApiOperation("获得支付应用信息分页") + @Operation(summary = "获得支付应用信息分页") @PreAuthorize("@ss.hasPermission('pay:app:query')") public CommonResult> getAppPage(@Valid PayAppPageReqVO pageVO) { // 得到应用分页列表 @@ -140,7 +140,7 @@ public class PayAppController { } @GetMapping("/export-excel") - @ApiOperation("导出支付应用信息 Excel") + @Operation(summary = "导出支付应用信息 Excel") @PreAuthorize("@ss.hasPermission('pay:app:export')") @OperateLog(type = EXPORT) public void exportAppExcel(@Valid PayAppExportReqVO exportReqVO, @@ -152,8 +152,8 @@ public class PayAppController { } @GetMapping("/list-merchant-id") - @ApiOperation("根据商户 ID 查询支付应用信息") - @ApiImplicitParam(name = "merchantId", value = "商户ID", required = true, example = "1", dataTypeClass = Long.class) + @Operation(summary = "根据商户 ID 查询支付应用信息") + @Parameter(name = "merchantId", description = "商户ID", required = true, example = "1") @PreAuthorize("@ss.hasPermission('pay:merchant:query')") public CommonResult> getMerchantListByName(@RequestParam Long merchantId) { List appListDO = appService.getListByMerchantId(merchantId); diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/PayChannelController.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/PayChannelController.java index 82d3a354e..6ef6f5712 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/PayChannelController.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/PayChannelController.java @@ -8,10 +8,10 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -26,7 +26,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; -@Api(tags = "管理后台 - 支付渠道") +@Tag(name = "管理后台 - 支付渠道") @RestController @RequestMapping("/pay/channel") @Validated @@ -36,14 +36,14 @@ public class PayChannelController { private PayChannelService channelService; @PostMapping("/create") - @ApiOperation("创建支付渠道 ") + @Operation(summary = "创建支付渠道 ") @PreAuthorize("@ss.hasPermission('pay:channel:create')") public CommonResult createChannel(@Valid @RequestBody PayChannelCreateReqVO createReqVO) { return success(channelService.createChannel(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新支付渠道 ") + @Operation(summary = "更新支付渠道 ") @PreAuthorize("@ss.hasPermission('pay:channel:update')") public CommonResult updateChannel(@Valid @RequestBody PayChannelUpdateReqVO updateReqVO) { channelService.updateChannel(updateReqVO); @@ -51,8 +51,8 @@ public class PayChannelController { } @DeleteMapping("/delete") - @ApiOperation("删除支付渠道 ") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除支付渠道 ") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('pay:channel:delete')") public CommonResult deleteChannel(@RequestParam("id") Long id) { channelService.deleteChannel(id); @@ -60,8 +60,8 @@ public class PayChannelController { } @GetMapping("/get") - @ApiOperation("获得支付渠道 ") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得支付渠道 ") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('pay:channel:query')") public CommonResult getChannel(@RequestParam("id") Long id) { PayChannelDO channel = channelService.getChannel(id); @@ -69,9 +69,9 @@ public class PayChannelController { } @GetMapping("/list") - @ApiOperation("获得支付渠道列表") - @ApiImplicitParam(name = "ids", value = "编号列表", - required = true, example = "1024,2048", dataTypeClass = List.class) + @Operation(summary = "获得支付渠道列表") + @Parameter(name = "ids", description = "编号列表", + required = true, example = "1024,2048") @PreAuthorize("@ss.hasPermission('pay:channel:query')") public CommonResult> getChannelList(@RequestParam("ids") Collection ids) { List list = channelService.getChannelList(ids); @@ -79,7 +79,7 @@ public class PayChannelController { } @GetMapping("/page") - @ApiOperation("获得支付渠道分页") + @Operation(summary = "获得支付渠道分页") @PreAuthorize("@ss.hasPermission('pay:channel:query')") public CommonResult> getChannelPage(@Valid PayChannelPageReqVO pageVO) { PageResult pageResult = channelService.getChannelPage(pageVO); @@ -87,7 +87,7 @@ public class PayChannelController { } @GetMapping("/export-excel") - @ApiOperation("导出支付渠道Excel") + @Operation(summary = "导出支付渠道Excel") @PreAuthorize("@ss.hasPermission('pay:channel:export')") @OperateLog(type = EXPORT) public void exportChannelExcel(@Valid PayChannelExportReqVO exportReqVO, @@ -99,14 +99,14 @@ public class PayChannelController { } @GetMapping("/get-channel") - @ApiOperation("根据条件查询微信支付渠道") - @ApiImplicitParams({ - @ApiImplicitParam(name = "merchantId", value = "商户编号", - required = true, example = "1", dataTypeClass = Long.class), - @ApiImplicitParam(name = "appId", value = "应用编号", - required = true, example = "1", dataTypeClass = Long.class), - @ApiImplicitParam(name = "code", value = "支付渠道编码", - required = true, example = "wx_pub", dataTypeClass = String.class) + @Operation(summary = "根据条件查询微信支付渠道") + @Parameters({ + @Parameter(name = "merchantId", description = "商户编号", + required = true, example = "1"), + @Parameter(name = "appId", description = "应用编号", + required = true, example = "1"), + @Parameter(name = "code", description = "支付渠道编码", + required = true, example = "wx_pub") }) @PreAuthorize("@ss.hasPermission('pay:channel:query')") public CommonResult getChannel( diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/PayMerchantController.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/PayMerchantController.java index 19bdfc86d..2af7fa528 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/PayMerchantController.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/PayMerchantController.java @@ -8,9 +8,9 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -25,7 +25,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; -@Api(tags = "支付商户信息") +@Tag(name = "支付商户信息") @RestController @RequestMapping("/pay/merchant") @Validated @@ -35,14 +35,14 @@ public class PayMerchantController { private PayMerchantService merchantService; @PostMapping("/create") - @ApiOperation("创建支付商户信息") + @Operation(summary = "创建支付商户信息") @PreAuthorize("@ss.hasPermission('pay:merchant:create')") public CommonResult createMerchant(@Valid @RequestBody PayMerchantCreateReqVO createReqVO) { return success(merchantService.createMerchant(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新支付商户信息") + @Operation(summary = "更新支付商户信息") @PreAuthorize("@ss.hasPermission('pay:merchant:update')") public CommonResult updateMerchant(@Valid @RequestBody PayMerchantUpdateReqVO updateReqVO) { merchantService.updateMerchant(updateReqVO); @@ -50,7 +50,7 @@ public class PayMerchantController { } @PutMapping("/update-status") - @ApiOperation("修改支付商户状态") + @Operation(summary = "修改支付商户状态") @PreAuthorize("@ss.hasPermission('pay:merchant:update')") public CommonResult updateMerchantStatus(@Valid @RequestBody PayMerchantUpdateStatusReqVO reqVO) { merchantService.updateMerchantStatus(reqVO.getId(), reqVO.getStatus()); @@ -58,8 +58,8 @@ public class PayMerchantController { } @DeleteMapping("/delete") - @ApiOperation("删除支付商户信息") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除支付商户信息") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('pay:merchant:delete')") public CommonResult deleteMerchant(@RequestParam("id") Long id) { merchantService.deleteMerchant(id); @@ -67,8 +67,8 @@ public class PayMerchantController { } @GetMapping("/get") - @ApiOperation("获得支付商户信息") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得支付商户信息") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('pay:merchant:query')") public CommonResult getMerchant(@RequestParam("id") Long id) { PayMerchantDO merchant = merchantService.getMerchant(id); @@ -76,8 +76,8 @@ public class PayMerchantController { } @GetMapping("/list-by-name") - @ApiOperation("根据商户名称获得支付商户信息列表") - @ApiImplicitParam(name = "name", value = "商户名称", example = "芋道", dataTypeClass = String.class) + @Operation(summary = "根据商户名称获得支付商户信息列表") + @Parameter(name = "name", description = "商户名称", example = "芋道") @PreAuthorize("@ss.hasPermission('pay:merchant:query')") public CommonResult> getMerchantListByName(@RequestParam(required = false) String name) { List merchantListDO = merchantService.getMerchantListByName(name); @@ -85,8 +85,8 @@ public class PayMerchantController { } @GetMapping("/list") - @ApiOperation("获得支付商户信息列表") - @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) + @Operation(summary = "获得支付商户信息列表") + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") @PreAuthorize("@ss.hasPermission('pay:merchant:query')") public CommonResult> getMerchantList(@RequestParam("ids") Collection ids) { List list = merchantService.getMerchantList(ids); @@ -94,7 +94,7 @@ public class PayMerchantController { } @GetMapping("/page") - @ApiOperation("获得支付商户信息分页") + @Operation(summary = "获得支付商户信息分页") @PreAuthorize("@ss.hasPermission('pay:merchant:query')") public CommonResult> getMerchantPage(@Valid PayMerchantPageReqVO pageVO) { PageResult pageResult = merchantService.getMerchantPage(pageVO); @@ -102,7 +102,7 @@ public class PayMerchantController { } @GetMapping("/export-excel") - @ApiOperation("导出支付商户信息 Excel") + @Operation(summary = "导出支付商户信息 Excel") @PreAuthorize("@ss.hasPermission('pay:merchant:export')") @OperateLog(type = EXPORT) public void exportMerchantExcel(@Valid PayMerchantExportReqVO exportReqVO, diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppBaseVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppBaseVO.java index 795b3c643..54e62320d 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppBaseVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppBaseVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.app; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; import javax.validation.constraints.*; /** @@ -11,26 +10,26 @@ import javax.validation.constraints.*; @Data public class PayAppBaseVO { - @ApiModelProperty(value = "应用名", required = true) + @Schema(description = "应用名", required = true) @NotNull(message = "应用名不能为空") private String name; - @ApiModelProperty(value = "开启状态", required = true) + @Schema(description = "开启状态", required = true) @NotNull(message = "开启状态不能为空") private Integer status; - @ApiModelProperty(value = "备注") + @Schema(description = "备注") private String remark; - @ApiModelProperty(value = "支付结果的回调地址", required = true) + @Schema(description = "支付结果的回调地址", required = true) @NotNull(message = "支付结果的回调地址不能为空") private String payNotifyUrl; - @ApiModelProperty(value = "退款结果的回调地址", required = true) + @Schema(description = "退款结果的回调地址", required = true) @NotNull(message = "退款结果的回调地址不能为空") private String refundNotifyUrl; - @ApiModelProperty(value = "商户编号", required = true) + @Schema(description = "商户编号", required = true) @NotNull(message = "商户编号不能为空") private Long merchantId; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppCreateReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppCreateReqVO.java index a66a71963..36816cc24 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppCreateReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppCreateReqVO.java @@ -1,9 +1,8 @@ package cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.app; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; -@ApiModel("管理后台 - 支付应用信息创建 Request VO") +@Schema(description = "管理后台 - 支付应用信息创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppExportReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppExportReqVO.java index 3ea1f3e2e..b13a6e65b 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppExportReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppExportReqVO.java @@ -1,37 +1,36 @@ package cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.app; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDateTime; -import io.swagger.annotations.*; import org.springframework.format.annotation.DateTimeFormat; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel(value = "管理后台 - 支付应用信息 Excel 导出 Request VO", description = "参数和 PayAppPageReqVO 是一致的") +@Schema(description = "管理后台 - 支付应用信息 Excel 导出 Request VO,参数和 PayAppPageReqVO 是一致的") @Data public class PayAppExportReqVO { - @ApiModelProperty(value = "应用名") + @Schema(description = "应用名") private String name; - @ApiModelProperty(value = "开启状态") + @Schema(description = "开启状态") private Integer status; - @ApiModelProperty(value = "备注") + @Schema(description = "备注") private String remark; - @ApiModelProperty(value = "支付结果的回调地址") + @Schema(description = "支付结果的回调地址") private String payNotifyUrl; - @ApiModelProperty(value = "退款结果的回调地址") + @Schema(description = "退款结果的回调地址") private String refundNotifyUrl; - @ApiModelProperty(value = "商户名称") + @Schema(description = "商户名称") private String merchantName; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppPageItemRespVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppPageItemRespVO.java index f0e06b0d0..72655db05 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppPageItemRespVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppPageItemRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.app; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -9,16 +8,16 @@ import lombok.ToString; import java.time.LocalDateTime; import java.util.Set; -@ApiModel(value = "管理后台 - 支付应用信息分页查询 Response VO", description = "相比于支付信息,还会多出应用渠道的开关信息") +@Schema(description = "管理后台 - 支付应用信息分页查询 Response VO,相比于支付信息,还会多出应用渠道的开关信息") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class PayAppPageItemRespVO extends PayAppBaseVO { - @ApiModelProperty(value = "应用编号", required = true) + @Schema(description = "应用编号", required = true) private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; /** @@ -26,19 +25,19 @@ public class PayAppPageItemRespVO extends PayAppBaseVO { */ private PayMerchant payMerchant; - @ApiModel("商户") + @Schema(description = "商户") @Data public static class PayMerchant { - @ApiModelProperty(value = "商户编号", required = true, example = "1") + @Schema(description = "商户编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "商户名称", required = true, example = "研发部") + @Schema(description = "商户名称", required = true, example = "研发部") private String name; } - @ApiModelProperty(value = "渠道编码集合", required = true, example = "alipay_pc,alipay_wap...") + @Schema(description = "渠道编码集合", required = true, example = "alipay_pc,alipay_wap...") private Set channelCodes; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppPageReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppPageReqVO.java index c743a8822..1aaadc78a 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppPageReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppPageReqVO.java @@ -1,40 +1,39 @@ package cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.app; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDateTime; -import io.swagger.annotations.*; import cn.iocoder.yudao.framework.common.pojo.PageParam; import org.springframework.format.annotation.DateTimeFormat; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 支付应用信息分页 Request VO") +@Schema(description = "管理后台 - 支付应用信息分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class PayAppPageReqVO extends PageParam { - @ApiModelProperty(value = "应用名") + @Schema(description = "应用名") private String name; - @ApiModelProperty(value = "开启状态") + @Schema(description = "开启状态") private Integer status; - @ApiModelProperty(value = "备注") + @Schema(description = "备注") private String remark; - @ApiModelProperty(value = "支付结果的回调地址") + @Schema(description = "支付结果的回调地址") private String payNotifyUrl; - @ApiModelProperty(value = "退款结果的回调地址") + @Schema(description = "退款结果的回调地址") private String refundNotifyUrl; - @ApiModelProperty(value = "商户名称") + @Schema(description = "商户名称") private String merchantName; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppRespVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppRespVO.java index 17d4961a1..0bb0c5563 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppRespVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppRespVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.app; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDateTime; -import io.swagger.annotations.*; -@ApiModel("管理后台 - 支付应用信息 Response VO") +@Schema(description = "管理后台 - 支付应用信息 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class PayAppRespVO extends PayAppBaseVO { - @ApiModelProperty(value = "应用编号", required = true) + @Schema(description = "应用编号", required = true) private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppUpdateReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppUpdateReqVO.java index 9bdd04254..2d940d5c2 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppUpdateReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppUpdateReqVO.java @@ -1,16 +1,15 @@ package cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.app; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; import javax.validation.constraints.*; -@ApiModel("管理后台 - 支付应用信息更新 Request VO") +@Schema(description = "管理后台 - 支付应用信息更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class PayAppUpdateReqVO extends PayAppBaseVO { - @ApiModelProperty(value = "应用编号", required = true) + @Schema(description = "应用编号", required = true) @NotNull(message = "应用编号不能为空") private Long id; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppUpdateStatusReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppUpdateStatusReqVO.java index 2ccce684c..8454f5f2a 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppUpdateStatusReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/app/PayAppUpdateStatusReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.app; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 应用更新状态 Request VO") +@Schema(description = "管理后台 - 应用更新状态 Request VO") @Data public class PayAppUpdateStatusReqVO { - @ApiModelProperty(value = "商户编号", required = true, example = "1024") + @Schema(description = "商户编号", required = true, example = "1024") @NotNull(message = "商户编号不能为空") private Long id; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 SysCommonStatusEnum 枚举") + @Schema(description = "状态,见 SysCommonStatusEnum 枚举", required = true, example = "1") @NotNull(message = "状态不能为空") private Integer status; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelBaseVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelBaseVO.java index 8b9f53490..a8f0c1ec9 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelBaseVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelBaseVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.channel; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; import javax.validation.constraints.*; /** @@ -11,26 +10,26 @@ import javax.validation.constraints.*; @Data public class PayChannelBaseVO { - @ApiModelProperty(value = "渠道编码", required = true) + @Schema(description = "渠道编码", required = true) @NotNull(message = "渠道编码不能为空") private String code; - @ApiModelProperty(value = "开启状态", required = true) + @Schema(description = "开启状态", required = true) @NotNull(message = "开启状态不能为空") private Integer status; - @ApiModelProperty(value = "备注") + @Schema(description = "备注") private String remark; - @ApiModelProperty(value = "渠道费率,单位:百分比", required = true) + @Schema(description = "渠道费率,单位:百分比", required = true) @NotNull(message = "渠道费率,单位:百分比不能为空") private Double feeRate; - @ApiModelProperty(value = "商户编号", required = true) + @Schema(description = "商户编号", required = true) @NotNull(message = "商户编号不能为空") private Long merchantId; - @ApiModelProperty(value = "应用编号", required = true) + @Schema(description = "应用编号", required = true) @NotNull(message = "应用编号不能为空") private Long appId; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelCreateReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelCreateReqVO.java index 5852f9bb1..89547bc1e 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelCreateReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelCreateReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.channel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotBlank; -@ApiModel("管理后台 - 支付渠道 创建 Request VO") +@Schema(description = "管理后台 - 支付渠道 创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class PayChannelCreateReqVO extends PayChannelBaseVO { - @ApiModelProperty(value = "渠道配置的 json 字符串") + @Schema(description = "渠道配置的 json 字符串") @NotBlank(message = "渠道配置不能为空") private String config; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelExportReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelExportReqVO.java index 263d1b8e9..3a7e16fb5 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelExportReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelExportReqVO.java @@ -1,40 +1,39 @@ package cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.channel; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDateTime; -import io.swagger.annotations.*; import org.springframework.format.annotation.DateTimeFormat; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel(value = "管理后台 - 支付渠道 Excel 导出 Request VO", description = "参数和 PayChannelPageReqVO 是一致的") +@Schema(description = "管理后台 - 支付渠道 Excel 导出 Request VO,参数和 PayChannelPageReqVO 是一致的") @Data public class PayChannelExportReqVO { - @ApiModelProperty(value = "渠道编码") + @Schema(description = "渠道编码") private String code; - @ApiModelProperty(value = "开启状态") + @Schema(description = "开启状态") private Integer status; - @ApiModelProperty(value = "备注") + @Schema(description = "备注") private String remark; - @ApiModelProperty(value = "渠道费率,单位:百分比") + @Schema(description = "渠道费率,单位:百分比") private Double feeRate; - @ApiModelProperty(value = "商户编号") + @Schema(description = "商户编号") private Long merchantId; - @ApiModelProperty(value = "应用编号") + @Schema(description = "应用编号") private Long appId; - @ApiModelProperty(value = "支付渠道配置") + @Schema(description = "支付渠道配置") private String config; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelPageReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelPageReqVO.java index 4d8e7729c..00c724893 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelPageReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelPageReqVO.java @@ -1,43 +1,42 @@ package cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.channel; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDateTime; -import io.swagger.annotations.*; import cn.iocoder.yudao.framework.common.pojo.PageParam; import org.springframework.format.annotation.DateTimeFormat; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 支付渠道 分页 Request VO") +@Schema(description = "管理后台 - 支付渠道 分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class PayChannelPageReqVO extends PageParam { - @ApiModelProperty(value = "渠道编码") + @Schema(description = "渠道编码") private String code; - @ApiModelProperty(value = "开启状态") + @Schema(description = "开启状态") private Integer status; - @ApiModelProperty(value = "备注") + @Schema(description = "备注") private String remark; - @ApiModelProperty(value = "渠道费率,单位:百分比") + @Schema(description = "渠道费率,单位:百分比") private Double feeRate; - @ApiModelProperty(value = "商户编号") + @Schema(description = "商户编号") private Long merchantId; - @ApiModelProperty(value = "应用编号") + @Schema(description = "应用编号") private Long appId; - @ApiModelProperty(value = "支付渠道配置") + @Schema(description = "支付渠道配置") private String config; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelRespVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelRespVO.java index e3e53d3f9..5fa189e18 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelRespVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelRespVO.java @@ -1,22 +1,21 @@ package cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.channel; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDateTime; -import io.swagger.annotations.*; -@ApiModel("管理后台 - 支付渠道 Response VO") +@Schema(description = "管理后台 - 支付渠道 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class PayChannelRespVO extends PayChannelBaseVO { - @ApiModelProperty(value = "商户编号", required = true) + @Schema(description = "商户编号", required = true) private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; - @ApiModelProperty(value = "配置", required = true) + @Schema(description = "配置", required = true) private String config; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelUpdateReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelUpdateReqVO.java index c216de9ae..959c069b4 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelUpdateReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/channel/PayChannelUpdateReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.channel; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; import javax.validation.constraints.*; -@ApiModel("管理后台 - 支付渠道 更新 Request VO") +@Schema(description = "管理后台 - 支付渠道 更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class PayChannelUpdateReqVO extends PayChannelBaseVO { - @ApiModelProperty(value = "商户编号", required = true) + @Schema(description = "商户编号", required = true) @NotNull(message = "商户编号不能为空") private Long id; - @ApiModelProperty(value = "渠道配置的json字符串") + @Schema(description = "渠道配置的json字符串") @NotBlank(message = "渠道配置不能为空") private String config; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantBaseVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantBaseVO.java index 1052fdd03..dd8b3eddc 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantBaseVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantBaseVO.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.merchant; - -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; @@ -12,19 +11,19 @@ import javax.validation.constraints.NotNull; @Data public class PayMerchantBaseVO { - @ApiModelProperty(value = "商户全称", required = true) + @Schema(description = "商户全称", required = true) @NotNull(message = "商户全称不能为空") private String name; - @ApiModelProperty(value = "商户简称", required = true) + @Schema(description = "商户简称", required = true) @NotNull(message = "商户简称不能为空") private String shortName; - @ApiModelProperty(value = "开启状态", required = true) + @Schema(description = "开启状态", required = true) @NotNull(message = "开启状态不能为空") private Integer status; - @ApiModelProperty(value = "备注") + @Schema(description = "备注") private String remark; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantCreateReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantCreateReqVO.java index 018db180b..f63aa123f 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantCreateReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantCreateReqVO.java @@ -1,9 +1,8 @@ package cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.merchant; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; -@ApiModel("管理后台 - 支付商户信息创建 Request VO") +@Schema(description = "管理后台 - 支付商户信息创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantExportReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantExportReqVO.java index 6a41d3afc..4903531c9 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantExportReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantExportReqVO.java @@ -1,34 +1,33 @@ package cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.merchant; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDateTime; -import io.swagger.annotations.*; import org.springframework.format.annotation.DateTimeFormat; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel(value = "管理后台 - 支付商户信息 Excel 导出 Request VO", description = "参数和 PayMerchantPageReqVO 是一致的") +@Schema(description = "管理后台 - 支付商户信息 Excel 导出 Request VO,参数和 PayMerchantPageReqVO 是一致的") @Data public class PayMerchantExportReqVO { - @ApiModelProperty(value = "商户号") + @Schema(description = "商户号") private String no; - @ApiModelProperty(value = "商户全称") + @Schema(description = "商户全称") private String name; - @ApiModelProperty(value = "商户简称") + @Schema(description = "商户简称") private String shortName; - @ApiModelProperty(value = "开启状态") + @Schema(description = "开启状态") private Integer status; - @ApiModelProperty(value = "备注") + @Schema(description = "备注") private String remark; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantPageReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantPageReqVO.java index 756299f5f..0dccc4dab 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantPageReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantPageReqVO.java @@ -1,37 +1,36 @@ package cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.merchant; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDateTime; -import io.swagger.annotations.*; import cn.iocoder.yudao.framework.common.pojo.PageParam; import org.springframework.format.annotation.DateTimeFormat; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 支付商户信息分页 Request VO") +@Schema(description = "管理后台 - 支付商户信息分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class PayMerchantPageReqVO extends PageParam { - @ApiModelProperty(value = "商户号") + @Schema(description = "商户号") private String no; - @ApiModelProperty(value = "商户全称") + @Schema(description = "商户全称") private String name; - @ApiModelProperty(value = "商户简称") + @Schema(description = "商户简称") private String shortName; - @ApiModelProperty(value = "开启状态") + @Schema(description = "开启状态") private Integer status; - @ApiModelProperty(value = "备注") + @Schema(description = "备注") private String remark; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantRespVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantRespVO.java index f4003b7a4..3e150f71c 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantRespVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantRespVO.java @@ -1,26 +1,25 @@ package cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.merchant; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 支付商户信息 Response VO") +@Schema(description = "管理后台 - 支付商户信息 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class PayMerchantRespVO extends PayMerchantBaseVO { - @ApiModelProperty(value = "商户编号", required = true) + @Schema(description = "商户编号", required = true) private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; - @ApiModelProperty(value = "商户号", required = true, example = "M233666999") + @Schema(description = "商户号", required = true, example = "M233666999") private String no; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantUpdateReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantUpdateReqVO.java index d270a3d84..2fd70e2d9 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantUpdateReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantUpdateReqVO.java @@ -1,16 +1,15 @@ package cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.merchant; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; import javax.validation.constraints.*; -@ApiModel("管理后台 - 支付商户信息更新 Request VO") +@Schema(description = "管理后台 - 支付商户信息更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class PayMerchantUpdateReqVO extends PayMerchantBaseVO { - @ApiModelProperty(value = "商户编号", required = true) + @Schema(description = "商户编号", required = true) @NotNull(message = "商户编号不能为空") private Long id; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantUpdateStatusReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantUpdateStatusReqVO.java index 39e26b8b7..b42cd61f3 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantUpdateStatusReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/merchant/vo/merchant/PayMerchantUpdateStatusReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.merchant; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 商户更新状态 Request VO") +@Schema(description = "管理后台 - 商户更新状态 Request VO") @Data public class PayMerchantUpdateStatusReqVO { - @ApiModelProperty(value = "商户编号", required = true, example = "1024") + @Schema(description = "商户编号", required = true, example = "1024") @NotNull(message = "商户编号不能为空") private Long id; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 SysCommonStatusEnum 枚举") + @Schema(description = "状态,见 SysCommonStatusEnum 枚举", required = true, example = "1") @NotNull(message = "状态不能为空") private Integer status; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/notify/PayNotifyController.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/notify/PayNotifyController.java index fa9177538..62b753730 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/notify/PayNotifyController.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/notify/PayNotifyController.java @@ -6,8 +6,8 @@ import cn.iocoder.yudao.framework.pay.core.client.PayClientFactory; import cn.iocoder.yudao.framework.pay.core.client.dto.PayNotifyDataDTO; import cn.iocoder.yudao.module.pay.service.order.PayOrderService; import cn.iocoder.yudao.module.pay.service.refund.PayRefundService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -19,7 +19,7 @@ import java.util.Map; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.PAY_CHANNEL_CLIENT_NOT_FOUND; -@Api(tags = "管理后台 - 支付通知") +@Tag(name = "管理后台 - 支付通知") @RestController @RequestMapping("/pay/notify") @Validated @@ -43,7 +43,7 @@ public class PayNotifyController { * @return 返回跳转页面 */ @GetMapping(value = "/return/{channelId}") - @ApiOperation("渠道统一的支付成功返回地址") + @Operation(summary = "渠道统一的支付成功返回地址") @Deprecated // TODO yunai:如果是 way 的情况,应该是跳转回前端地址 public String returnCallback(@PathVariable("channelId") Long channelId, @RequestParam Map params) { @@ -60,7 +60,7 @@ public class PayNotifyController { * @return 成功返回 "success" */ @PostMapping(value = "/callback/{channelId}") - @ApiOperation(value = "支付渠道的统一回调接口", notes = "包括支付回调,退款回调") + @Operation(summary = "支付渠道的统一回调接口 - 包括支付回调,退款回调") @PermitAll @OperateLog(enable = false) // 回调地址,无需记录操作日志 public String notifyCallback(@PathVariable("channelId") Long channelId, diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/PayOrderController.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/PayOrderController.java index 2219204c4..1be5e379e 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/PayOrderController.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/PayOrderController.java @@ -18,9 +18,9 @@ import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; import cn.iocoder.yudao.framework.pay.core.enums.PayChannelEnum; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; @@ -39,7 +39,7 @@ import java.util.Map; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; -@Api(tags = "管理后台 - 支付订单") +@Tag(name = "管理后台 - 支付订单") @RestController @RequestMapping("/pay/order") @Validated @@ -55,8 +55,8 @@ public class PayOrderController { private PayAppService appService; @GetMapping("/get") - @ApiOperation("获得支付订单") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得支付订单") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('pay:order:query')") public CommonResult getOrder(@RequestParam("id") Long id) { PayOrderDO order = orderService.getOrder(id); @@ -83,7 +83,7 @@ public class PayOrderController { } @GetMapping("/page") - @ApiOperation("获得支付订单分页") + @Operation(summary = "获得支付订单分页") @PreAuthorize("@ss.hasPermission('pay:order:query')") public CommonResult> getOrderPage(@Valid PayOrderPageReqVO pageVO) { PageResult pageResult = orderService.getOrderPage(pageVO); @@ -114,7 +114,7 @@ public class PayOrderController { } @GetMapping("/export-excel") - @ApiOperation("导出支付订单Excel") + @Operation(summary = "导出支付订单Excel") @PreAuthorize("@ss.hasPermission('pay:order:export')") @OperateLog(type = EXPORT) public void exportOrderExcel(@Valid PayOrderExportReqVO exportReqVO, diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderBaseVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderBaseVO.java index 6928ca3c8..7991c7c7e 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderBaseVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderBaseVO.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.pay.controller.admin.order.vo; - -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -18,90 +17,90 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @Data public class PayOrderBaseVO { - @ApiModelProperty(value = "商户编号", required = true) + @Schema(description = "商户编号", required = true) @NotNull(message = "商户编号不能为空") private Long merchantId; - @ApiModelProperty(value = "应用编号", required = true) + @Schema(description = "应用编号", required = true) @NotNull(message = "应用编号不能为空") private Long appId; - @ApiModelProperty(value = "渠道编号") + @Schema(description = "渠道编号") private Long channelId; - @ApiModelProperty(value = "渠道编码") + @Schema(description = "渠道编码") private String channelCode; - @ApiModelProperty(value = "商户订单编号", required = true) + @Schema(description = "商户订单编号", required = true) @NotNull(message = "商户订单编号不能为空") private String merchantOrderId; - @ApiModelProperty(value = "商品标题", required = true) + @Schema(description = "商品标题", required = true) @NotNull(message = "商品标题不能为空") private String subject; - @ApiModelProperty(value = "商品描述", required = true) + @Schema(description = "商品描述", required = true) @NotNull(message = "商品描述不能为空") private String body; - @ApiModelProperty(value = "异步通知地址", required = true) + @Schema(description = "异步通知地址", required = true) @NotNull(message = "异步通知地址不能为空") private String notifyUrl; - @ApiModelProperty(value = "通知商户支付结果的回调状态", required = true) + @Schema(description = "通知商户支付结果的回调状态", required = true) @NotNull(message = "通知商户支付结果的回调状态不能为空") private Integer notifyStatus; - @ApiModelProperty(value = "支付金额,单位:分", required = true) + @Schema(description = "支付金额,单位:分", required = true) @NotNull(message = "支付金额,单位:分不能为空") private Long amount; - @ApiModelProperty(value = "渠道手续费,单位:百分比") + @Schema(description = "渠道手续费,单位:百分比") private Double channelFeeRate; - @ApiModelProperty(value = "渠道手续金额,单位:分") + @Schema(description = "渠道手续金额,单位:分") private Long channelFeeAmount; - @ApiModelProperty(value = "支付状态", required = true) + @Schema(description = "支付状态", required = true) @NotNull(message = "支付状态不能为空") private Integer status; - @ApiModelProperty(value = "用户 IP", required = true) + @Schema(description = "用户 IP", required = true) @NotNull(message = "用户 IP不能为空") private String userIp; - @ApiModelProperty(value = "订单失效时间", required = true) + @Schema(description = "订单失效时间", required = true) @NotNull(message = "订单失效时间不能为空") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime expireTime; - @ApiModelProperty(value = "订单支付成功时间") + @Schema(description = "订单支付成功时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime successTime; - @ApiModelProperty(value = "订单支付通知时间") + @Schema(description = "订单支付通知时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime notifyTime; - @ApiModelProperty(value = "支付成功的订单拓展单编号") + @Schema(description = "支付成功的订单拓展单编号") private Long successExtensionId; - @ApiModelProperty(value = "退款状态", required = true) + @Schema(description = "退款状态", required = true) @NotNull(message = "退款状态不能为空") private Integer refundStatus; - @ApiModelProperty(value = "退款次数", required = true) + @Schema(description = "退款次数", required = true) @NotNull(message = "退款次数不能为空") private Integer refundTimes; - @ApiModelProperty(value = "退款总金额,单位:分", required = true) + @Schema(description = "退款总金额,单位:分", required = true) @NotNull(message = "退款总金额,单位:分不能为空") private Long refundAmount; - @ApiModelProperty(value = "渠道用户编号") + @Schema(description = "渠道用户编号") private String channelUserId; - @ApiModelProperty(value = "渠道订单号") + @Schema(description = "渠道订单号") private String channelOrderNo; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderDetailsRespVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderDetailsRespVO.java index 8c35a0f8f..6a1d2c8f6 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderDetailsRespVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderDetailsRespVO.java @@ -1,32 +1,31 @@ package cn.iocoder.yudao.module.pay.controller.admin.order.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 支付订单详细信息 Response VO") +@Schema(description = "管理后台 - 支付订单详细信息 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class PayOrderDetailsRespVO extends PayOrderBaseVO { - @ApiModelProperty(value = "支付订单编号") + @Schema(description = "支付订单编号") private Long id; - @ApiModelProperty(value = "商户名称") + @Schema(description = "商户名称") private String merchantName; - @ApiModelProperty(value = "应用名称") + @Schema(description = "应用名称") private String appName; - @ApiModelProperty(value = "渠道编号名称") + @Schema(description = "渠道编号名称") private String channelCodeName; - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime createTime; /** @@ -35,13 +34,13 @@ public class PayOrderDetailsRespVO extends PayOrderBaseVO { private PayOrderExtension payOrderExtension; @Data - @ApiModel("支付订单扩展") + @Schema(description = "支付订单扩展") public static class PayOrderExtension { - @ApiModelProperty(value = "支付订单号") + @Schema(description = "支付订单号") private String no; - @ApiModelProperty(value = "支付异步通知的内容") + @Schema(description = "支付异步通知的内容") private String channelNotifyData; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderExportReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderExportReqVO.java index 955b5787e..a5783806c 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderExportReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderExportReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.pay.controller.admin.order.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -9,84 +8,84 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel(value = "管理后台 - 支付订单 Excel 导出 Request VO", description = "参数和 PayOrderPageReqVO 是一致的") +@Schema(description = "管理后台 - 支付订单 Excel 导出 Request VO,参数和 PayOrderPageReqVO 是一致的") @Data public class PayOrderExportReqVO { - @ApiModelProperty(value = "商户编号") + @Schema(description = "商户编号") private Long merchantId; - @ApiModelProperty(value = "应用编号") + @Schema(description = "应用编号") private Long appId; - @ApiModelProperty(value = "渠道编号") + @Schema(description = "渠道编号") private Long channelId; - @ApiModelProperty(value = "渠道编码") + @Schema(description = "渠道编码") private String channelCode; - @ApiModelProperty(value = "商户订单编号") + @Schema(description = "商户订单编号") private String merchantOrderId; - @ApiModelProperty(value = "商品标题") + @Schema(description = "商品标题") private String subject; - @ApiModelProperty(value = "商品描述") + @Schema(description = "商品描述") private String body; - @ApiModelProperty(value = "异步通知地址") + @Schema(description = "异步通知地址") private String notifyUrl; - @ApiModelProperty(value = "通知商户支付结果的回调状态") + @Schema(description = "通知商户支付结果的回调状态") private Integer notifyStatus; - @ApiModelProperty(value = "支付金额,单位:分") + @Schema(description = "支付金额,单位:分") private Long amount; - @ApiModelProperty(value = "渠道手续费,单位:百分比") + @Schema(description = "渠道手续费,单位:百分比") private Double channelFeeRate; - @ApiModelProperty(value = "渠道手续金额,单位:分") + @Schema(description = "渠道手续金额,单位:分") private Long channelFeeAmount; - @ApiModelProperty(value = "支付状态") + @Schema(description = "支付状态") private Integer status; - @ApiModelProperty(value = "用户 IP") + @Schema(description = "用户 IP") private String userIp; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "订单失效时间") + @Schema(description = "订单失效时间") private LocalDateTime[] expireTime; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "开始订单支付成功时间") + @Schema(description = "开始订单支付成功时间") private LocalDateTime[] successTime; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "开始订单支付通知时间") + @Schema(description = "开始订单支付通知时间") private LocalDateTime[] notifyTime; - @ApiModelProperty(value = "支付成功的订单拓展单编号") + @Schema(description = "支付成功的订单拓展单编号") private Long successExtensionId; - @ApiModelProperty(value = "退款状态") + @Schema(description = "退款状态") private Integer refundStatus; - @ApiModelProperty(value = "退款次数") + @Schema(description = "退款次数") private Integer refundTimes; - @ApiModelProperty(value = "退款总金额,单位:分") + @Schema(description = "退款总金额,单位:分") private Long refundAmount; - @ApiModelProperty(value = "渠道用户编号") + @Schema(description = "渠道用户编号") private String channelUserId; - @ApiModelProperty(value = "渠道订单号") + @Schema(description = "渠道订单号") private String channelOrderNo; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderPageItemRespVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderPageItemRespVO.java index ec1e405a7..8ca5f2162 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderPageItemRespVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderPageItemRespVO.java @@ -1,35 +1,34 @@ package cn.iocoder.yudao.module.pay.controller.admin.order.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 支付订单分页 Request VO") +@Schema(description = "管理后台 - 支付订单分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class PayOrderPageItemRespVO extends PayOrderBaseVO { - @ApiModelProperty(value = "支付订单编号", required = true) + @Schema(description = "支付订单编号", required = true) private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; - @ApiModelProperty(value = "商户名称") + @Schema(description = "商户名称") private String merchantName; - @ApiModelProperty(value = "应用名称") + @Schema(description = "应用名称") private String appName; - @ApiModelProperty(value = "渠道名称") + @Schema(description = "渠道名称") private String channelCodeName; - @ApiModelProperty(value = "支付订单号") + @Schema(description = "支付订单号") private String no; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderPageReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderPageReqVO.java index 2ae90322a..2ca72f9fc 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderPageReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderPageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.pay.controller.admin.order.vo; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,86 +11,86 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 支付订单分页 Request VO") +@Schema(description = "管理后台 - 支付订单分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class PayOrderPageReqVO extends PageParam { - @ApiModelProperty(value = "商户编号") + @Schema(description = "商户编号") private Long merchantId; - @ApiModelProperty(value = "应用编号") + @Schema(description = "应用编号") private Long appId; - @ApiModelProperty(value = "渠道编号") + @Schema(description = "渠道编号") private Long channelId; - @ApiModelProperty(value = "渠道编码") + @Schema(description = "渠道编码") private String channelCode; - @ApiModelProperty(value = "商户订单编号") + @Schema(description = "商户订单编号") private String merchantOrderId; - @ApiModelProperty(value = "商品标题") + @Schema(description = "商品标题") private String subject; - @ApiModelProperty(value = "商品描述") + @Schema(description = "商品描述") private String body; - @ApiModelProperty(value = "异步通知地址") + @Schema(description = "异步通知地址") private String notifyUrl; - @ApiModelProperty(value = "通知商户支付结果的回调状态") + @Schema(description = "通知商户支付结果的回调状态") private Integer notifyStatus; - @ApiModelProperty(value = "支付金额,单位:分") + @Schema(description = "支付金额,单位:分") private Long amount; - @ApiModelProperty(value = "渠道手续费,单位:百分比") + @Schema(description = "渠道手续费,单位:百分比") private Double channelFeeRate; - @ApiModelProperty(value = "渠道手续金额,单位:分") + @Schema(description = "渠道手续金额,单位:分") private Long channelFeeAmount; - @ApiModelProperty(value = "支付状态") + @Schema(description = "支付状态") private Integer status; - @ApiModelProperty(value = "用户 IP") + @Schema(description = "用户 IP") private String userIp; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "订单失效时间") + @Schema(description = "订单失效时间") private LocalDateTime[] expireTime; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "订单支付成功时间") + @Schema(description = "订单支付成功时间") private LocalDateTime[] successTime; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "订单支付通知时间") + @Schema(description = "订单支付通知时间") private LocalDateTime[] notifyTime; - @ApiModelProperty(value = "支付成功的订单拓展单编号") + @Schema(description = "支付成功的订单拓展单编号") private Long successExtensionId; - @ApiModelProperty(value = "退款状态") + @Schema(description = "退款状态") private Integer refundStatus; - @ApiModelProperty(value = "退款次数") + @Schema(description = "退款次数") private Integer refundTimes; - @ApiModelProperty(value = "退款总金额,单位:分") + @Schema(description = "退款总金额,单位:分") private Long refundAmount; - @ApiModelProperty(value = "渠道用户编号") + @Schema(description = "渠道用户编号") private String channelUserId; - @ApiModelProperty(value = "渠道订单号") + @Schema(description = "渠道订单号") private String channelOrderNo; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderRespVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderRespVO.java index a22c1d709..57794982d 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderRespVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderRespVO.java @@ -1,23 +1,22 @@ package cn.iocoder.yudao.module.pay.controller.admin.order.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 支付订单 Response VO") +@Schema(description = "管理后台 - 支付订单 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class PayOrderRespVO extends PayOrderBaseVO { - @ApiModelProperty(value = "支付订单编号", required = true) + @Schema(description = "支付订单编号", required = true) private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/PayRefundController.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/PayRefundController.java index 58cb24fa3..e16e51115 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/PayRefundController.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/PayRefundController.java @@ -18,9 +18,9 @@ import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; import cn.iocoder.yudao.framework.pay.core.enums.PayChannelEnum; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; @@ -39,7 +39,7 @@ import java.util.Map; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; -@Api(tags = "管理后台 - 退款订单") +@Tag(name = "管理后台 - 退款订单") @RestController @RequestMapping("/pay/refund") @Validated @@ -55,8 +55,8 @@ public class PayRefundController { private PayOrderService orderService; @GetMapping("/get") - @ApiOperation("获得退款订单") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得退款订单") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('pay:refund:query')") public CommonResult getRefund(@RequestParam("id") Long id) { PayRefundDO refund = refundService.getRefund(id); @@ -79,7 +79,7 @@ public class PayRefundController { } @GetMapping("/page") - @ApiOperation("获得退款订单分页") + @Operation(summary = "获得退款订单分页") @PreAuthorize("@ss.hasPermission('pay:refund:query')") public CommonResult> getRefundPage(@Valid PayRefundPageReqVO pageVO) { PageResult pageResult = refundService.getRefundPage(pageVO); @@ -111,7 +111,7 @@ public class PayRefundController { } @GetMapping("/export-excel") - @ApiOperation("导出退款订单 Excel") + @Operation(summary = "导出退款订单 Excel") @PreAuthorize("@ss.hasPermission('pay:refund:export')") @OperateLog(type = EXPORT) public void exportRefundExcel(@Valid PayRefundExportReqVO exportReqVO, diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundBaseVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundBaseVO.java index f79780683..54ac525d5 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundBaseVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundBaseVO.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.pay.controller.admin.refund.vo; - -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -16,94 +15,94 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @Data public class PayRefundBaseVO { - @ApiModelProperty(value = "商户编号", required = true) + @Schema(description = "商户编号", required = true) @NotNull(message = "商户编号不能为空") private Long merchantId; - @ApiModelProperty(value = "应用编号", required = true) + @Schema(description = "应用编号", required = true) @NotNull(message = "应用编号不能为空") private Long appId; - @ApiModelProperty(value = "渠道编号", required = true) + @Schema(description = "渠道编号", required = true) @NotNull(message = "渠道编号不能为空") private Long channelId; - @ApiModelProperty(value = "渠道编码", required = true) + @Schema(description = "渠道编码", required = true) @NotNull(message = "渠道编码不能为空") private String channelCode; - @ApiModelProperty(value = "支付订单编号 pay_order 表id", required = true) + @Schema(description = "支付订单编号 pay_order 表id", required = true) @NotNull(message = "支付订单编号 pay_order 表id不能为空") private Long orderId; - @ApiModelProperty(value = "交易订单号 pay_extension 表no 字段", required = true) + @Schema(description = "交易订单号 pay_extension 表no 字段", required = true) @NotNull(message = "交易订单号 pay_extension 表no 字段不能为空") private String tradeNo; - @ApiModelProperty(value = "商户订单编号(商户系统生成)", required = true) + @Schema(description = "商户订单编号(商户系统生成)", required = true) @NotNull(message = "商户订单编号(商户系统生成)不能为空") private String merchantOrderId; - @ApiModelProperty(value = "商户退款订单号(商户系统生成)", required = true) + @Schema(description = "商户退款订单号(商户系统生成)", required = true) @NotNull(message = "商户退款订单号(商户系统生成)不能为空") private String merchantRefundNo; - @ApiModelProperty(value = "异步通知商户地址", required = true) + @Schema(description = "异步通知商户地址", required = true) @NotNull(message = "异步通知商户地址不能为空") private String notifyUrl; - @ApiModelProperty(value = "通知商户退款结果的回调状态", required = true) + @Schema(description = "通知商户退款结果的回调状态", required = true) @NotNull(message = "通知商户退款结果的回调状态不能为空") private Integer notifyStatus; - @ApiModelProperty(value = "退款状态", required = true) + @Schema(description = "退款状态", required = true) @NotNull(message = "退款状态不能为空") private Integer status; - @ApiModelProperty(value = "退款类型(部分退款,全部退款)", required = true) + @Schema(description = "退款类型(部分退款,全部退款)", required = true) @NotNull(message = "退款类型(部分退款,全部退款)不能为空") private Integer type; - @ApiModelProperty(value = "支付金额,单位分", required = true) + @Schema(description = "支付金额,单位分", required = true) @NotNull(message = "支付金额,单位分不能为空") private Long payAmount; - @ApiModelProperty(value = "退款金额,单位分", required = true) + @Schema(description = "退款金额,单位分", required = true) @NotNull(message = "退款金额,单位分不能为空") private Long refundAmount; - @ApiModelProperty(value = "退款原因", required = true) + @Schema(description = "退款原因", required = true) @NotNull(message = "退款原因不能为空") private String reason; - @ApiModelProperty(value = "用户 IP") + @Schema(description = "用户 IP") private String userIp; - @ApiModelProperty(value = "渠道订单号,pay_order 中的channel_order_no 对应", required = true) + @Schema(description = "渠道订单号,pay_order 中的channel_order_no 对应", required = true) @NotNull(message = "渠道订单号,pay_order 中的channel_order_no 对应不能为空") private String channelOrderNo; - @ApiModelProperty(value = "渠道退款单号,渠道返回") + @Schema(description = "渠道退款单号,渠道返回") private String channelRefundNo; - @ApiModelProperty(value = "渠道调用报错时,错误码") + @Schema(description = "渠道调用报错时,错误码") private String channelErrorCode; - @ApiModelProperty(value = "渠道调用报错时,错误信息") + @Schema(description = "渠道调用报错时,错误信息") private String channelErrorMsg; - @ApiModelProperty(value = "支付渠道的额外参数") + @Schema(description = "支付渠道的额外参数") private String channelExtras; - @ApiModelProperty(value = "退款失效时间") + @Schema(description = "退款失效时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime expireTime; - @ApiModelProperty(value = "退款成功时间") + @Schema(description = "退款成功时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime successTime; - @ApiModelProperty(value = "退款通知时间") + @Schema(description = "退款通知时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime notifyTime; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundCreateReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundCreateReqVO.java index cc09111ef..86cf94636 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundCreateReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundCreateReqVO.java @@ -1,9 +1,8 @@ package cn.iocoder.yudao.module.pay.controller.admin.refund.vo; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; -@ApiModel("管理后台 - 退款订单创建 Request VO") +@Schema(description = "管理后台 - 退款订单创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundDetailsRespVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundDetailsRespVO.java index dcabd031d..a02099946 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundDetailsRespVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundDetailsRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.pay.controller.admin.refund.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -9,31 +8,31 @@ import lombok.ToString; import javax.validation.constraints.NotNull; import java.time.LocalDateTime; -@ApiModel("管理后台 - 退款订单详情 Response VO") +@Schema(description = "管理后台 - 退款订单详情 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class PayRefundDetailsRespVO extends PayRefundBaseVO { - @ApiModelProperty(value = "支付退款编号", required = true) + @Schema(description = "支付退款编号", required = true) private Long id; - @ApiModelProperty(value = "商户名称") + @Schema(description = "商户名称") private String merchantName; - @ApiModelProperty(value = "应用名称") + @Schema(description = "应用名称") private String appName; - @ApiModelProperty(value = "渠道编号名称") + @Schema(description = "渠道编号名称") private String channelCodeName; @NotNull(message = "商品标题不能为空") private String subject; - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime createTime; - @ApiModelProperty(value = "更新时间") + @Schema(description = "更新时间") private LocalDateTime updateTime; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundExportReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundExportReqVO.java index b39f82dd3..bc7d7946b 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundExportReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundExportReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.pay.controller.admin.refund.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -9,87 +8,87 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel(value = "管理后台 - 退款订单 Excel 导出 Request VO", description = "参数和 PayRefundPageReqVO 是一致的") +@Schema(description = "管理后台 - 退款订单 Excel 导出 Request VO,参数和 PayRefundPageReqVO 是一致的") @Data public class PayRefundExportReqVO { - @ApiModelProperty(value = "商户编号") + @Schema(description = "商户编号") private Long merchantId; - @ApiModelProperty(value = "应用编号") + @Schema(description = "应用编号") private Long appId; - @ApiModelProperty(value = "渠道编号") + @Schema(description = "渠道编号") private Long channelId; - @ApiModelProperty(value = "渠道编码") + @Schema(description = "渠道编码") private String channelCode; - @ApiModelProperty(value = "支付订单编号 pay_order 表id") + @Schema(description = "支付订单编号 pay_order 表id") private Long orderId; - @ApiModelProperty(value = "交易订单号 pay_extension 表no 字段") + @Schema(description = "交易订单号 pay_extension 表no 字段") private String tradeNo; - @ApiModelProperty(value = "商户订单编号(商户系统生成)") + @Schema(description = "商户订单编号(商户系统生成)") private String merchantOrderId; - @ApiModelProperty(value = "商户退款订单号(商户系统生成)") + @Schema(description = "商户退款订单号(商户系统生成)") private String merchantRefundNo; - @ApiModelProperty(value = "异步通知商户地址") + @Schema(description = "异步通知商户地址") private String notifyUrl; - @ApiModelProperty(value = "通知商户退款结果的回调状态") + @Schema(description = "通知商户退款结果的回调状态") private Integer notifyStatus; - @ApiModelProperty(value = "退款状态") + @Schema(description = "退款状态") private Integer status; - @ApiModelProperty(value = "退款类型(部分退款,全部退款)") + @Schema(description = "退款类型(部分退款,全部退款)") private Integer type; - @ApiModelProperty(value = "支付金额,单位分") + @Schema(description = "支付金额,单位分") private Long payAmount; - @ApiModelProperty(value = "退款金额,单位分") + @Schema(description = "退款金额,单位分") private Long refundAmount; - @ApiModelProperty(value = "退款原因") + @Schema(description = "退款原因") private String reason; - @ApiModelProperty(value = "用户 IP") + @Schema(description = "用户 IP") private String userIp; - @ApiModelProperty(value = "渠道订单号,pay_order 中的channel_order_no 对应") + @Schema(description = "渠道订单号,pay_order 中的channel_order_no 对应") private String channelOrderNo; - @ApiModelProperty(value = "渠道退款单号,渠道返回") + @Schema(description = "渠道退款单号,渠道返回") private String channelRefundNo; - @ApiModelProperty(value = "渠道调用报错时,错误码") + @Schema(description = "渠道调用报错时,错误码") private String channelErrorCode; - @ApiModelProperty(value = "渠道调用报错时,错误信息") + @Schema(description = "渠道调用报错时,错误信息") private String channelErrorMsg; - @ApiModelProperty(value = "支付渠道的额外参数") + @Schema(description = "支付渠道的额外参数") private String channelExtras; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "退款失效时间") + @Schema(description = "退款失效时间") private LocalDateTime[] expireTime; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "退款成功时间") + @Schema(description = "退款成功时间") private LocalDateTime[] successTime; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "退款通知时间") + @Schema(description = "退款通知时间") private LocalDateTime[] notifyTime; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundPageItemRespVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundPageItemRespVO.java index b57a34c06..df2d0aadd 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundPageItemRespVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundPageItemRespVO.java @@ -1,32 +1,31 @@ package cn.iocoder.yudao.module.pay.controller.admin.refund.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 退款订单分页查询 Response VO") +@Schema(description = "管理后台 - 退款订单分页查询 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class PayRefundPageItemRespVO extends PayRefundBaseVO { - @ApiModelProperty(value = "支付订单编号", required = true) + @Schema(description = "支付订单编号", required = true) private Long id; - @ApiModelProperty(value = "商户名称") + @Schema(description = "商户名称") private String merchantName; - @ApiModelProperty(value = "应用名称") + @Schema(description = "应用名称") private String appName; - @ApiModelProperty(value = "渠道名称") + @Schema(description = "渠道名称") private String channelCodeName; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundPageReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundPageReqVO.java index 141e2a77f..49d87f645 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundPageReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundPageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.pay.controller.admin.refund.vo; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,89 +11,89 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 退款订单分页 Request VO") +@Schema(description = "管理后台 - 退款订单分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class PayRefundPageReqVO extends PageParam { - @ApiModelProperty(value = "商户编号") + @Schema(description = "商户编号") private Long merchantId; - @ApiModelProperty(value = "应用编号") + @Schema(description = "应用编号") private Long appId; - @ApiModelProperty(value = "渠道编号") + @Schema(description = "渠道编号") private Long channelId; - @ApiModelProperty(value = "渠道编码") + @Schema(description = "渠道编码") private String channelCode; - @ApiModelProperty(value = "支付订单编号 pay_order 表id") + @Schema(description = "支付订单编号 pay_order 表id") private Long orderId; - @ApiModelProperty(value = "交易订单号 pay_extension 表no 字段") + @Schema(description = "交易订单号 pay_extension 表no 字段") private String tradeNo; - @ApiModelProperty(value = "商户订单编号(商户系统生成)") + @Schema(description = "商户订单编号(商户系统生成)") private String merchantOrderId; - @ApiModelProperty(value = "商户退款订单号(商户系统生成)") + @Schema(description = "商户退款订单号(商户系统生成)") private String merchantRefundNo; - @ApiModelProperty(value = "异步通知商户地址") + @Schema(description = "异步通知商户地址") private String notifyUrl; - @ApiModelProperty(value = "通知商户退款结果的回调状态") + @Schema(description = "通知商户退款结果的回调状态") private Integer notifyStatus; - @ApiModelProperty(value = "退款状态") + @Schema(description = "退款状态") private Integer status; - @ApiModelProperty(value = "退款类型(部分退款,全部退款)") + @Schema(description = "退款类型(部分退款,全部退款)") private Integer type; - @ApiModelProperty(value = "支付金额,单位分") + @Schema(description = "支付金额,单位分") private Long payAmount; - @ApiModelProperty(value = "退款金额,单位分") + @Schema(description = "退款金额,单位分") private Long refundAmount; - @ApiModelProperty(value = "退款原因") + @Schema(description = "退款原因") private String reason; - @ApiModelProperty(value = "用户 IP") + @Schema(description = "用户 IP") private String userIp; - @ApiModelProperty(value = "渠道订单号,pay_order 中的channel_order_no 对应") + @Schema(description = "渠道订单号,pay_order 中的channel_order_no 对应") private String channelOrderNo; - @ApiModelProperty(value = "渠道退款单号,渠道返回") + @Schema(description = "渠道退款单号,渠道返回") private String channelRefundNo; - @ApiModelProperty(value = "渠道调用报错时,错误码") + @Schema(description = "渠道调用报错时,错误码") private String channelErrorCode; - @ApiModelProperty(value = "渠道调用报错时,错误信息") + @Schema(description = "渠道调用报错时,错误信息") private String channelErrorMsg; - @ApiModelProperty(value = "支付渠道的额外参数") + @Schema(description = "支付渠道的额外参数") private String channelExtras; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "退款失效时间") + @Schema(description = "退款失效时间") private LocalDateTime[] expireTime; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "退款成功时间") + @Schema(description = "退款成功时间") private LocalDateTime[] successTime; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "退款通知时间") + @Schema(description = "退款通知时间") private LocalDateTime[] notifyTime; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundRespVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundRespVO.java index e5453fbd4..1374074e8 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundRespVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundRespVO.java @@ -1,23 +1,22 @@ package cn.iocoder.yudao.module.pay.controller.admin.refund.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 退款订单 Response VO") +@Schema(description = "管理后台 - 退款订单 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class PayRefundRespVO extends PayRefundBaseVO { - @ApiModelProperty(value = "支付退款编号", required = true) + @Schema(description = "支付退款编号", required = true) private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundUpdateReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundUpdateReqVO.java index b7d555563..bb28fe2d0 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundUpdateReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundUpdateReqVO.java @@ -1,16 +1,15 @@ package cn.iocoder.yudao.module.pay.controller.admin.refund.vo; - +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; import javax.validation.constraints.*; -@ApiModel("管理后台 - 退款订单更新 Request VO") +@Schema(description = "管理后台 - 退款订单更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class PayRefundUpdateReqVO extends PayRefundBaseVO { - @ApiModelProperty(value = "支付退款编号", required = true) + @Schema(description = "支付退款编号", required = true) @NotNull(message = "支付退款编号不能为空") private Long id; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/AppPayOrderController.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/AppPayOrderController.java index 72f037a28..df054cd49 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/AppPayOrderController.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/AppPayOrderController.java @@ -8,8 +8,8 @@ import cn.iocoder.yudao.module.pay.dal.dataobject.order.PayOrderDO; import cn.iocoder.yudao.module.pay.service.order.PayOrderService; import cn.iocoder.yudao.module.pay.service.order.dto.PayOrderSubmitReqDTO; import cn.iocoder.yudao.module.pay.service.order.dto.PayOrderSubmitRespDTO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; @@ -22,7 +22,7 @@ import javax.annotation.Resource; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP; -@Api(tags = "用户 APP - 支付订单") +@Tag(name = "用户 APP - 支付订单") @RestController @RequestMapping("/pay/order") @Validated @@ -33,7 +33,7 @@ public class AppPayOrderController { private PayOrderService orderService; @PostMapping("/submit") - @ApiOperation("提交支付订单") + @Operation(summary = "提交支付订单") // @PreAuthenticated // TODO 暂时不加登陆验证,前端暂时没做好 public CommonResult submitPayOrder(@RequestBody AppPayOrderSubmitReqVO reqVO) { // 获得订单 diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/vo/AppPayOrderSubmitReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/vo/AppPayOrderSubmitReqVO.java index 6834c3838..38f19c735 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/vo/AppPayOrderSubmitReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/vo/AppPayOrderSubmitReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.pay.controller.app.order.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; @@ -9,20 +8,20 @@ import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.util.Map; -@ApiModel("用户 APP - 支付订单提交 Request VO") +@Schema(description = "用户 APP - 支付订单提交 Request VO") @Data @Accessors(chain = true) public class AppPayOrderSubmitReqVO { - @ApiModelProperty(value = "支付单编号", required = true, example = "1024") + @Schema(description = "支付单编号", required = true, example = "1024") @NotNull(message = "支付单编号不能为空") private Long id; - @ApiModelProperty(value = "支付渠道", required = true, example = "wx_pub") + @Schema(description = "支付渠道", required = true, example = "wx_pub") @NotEmpty(message = "支付渠道不能为空") private String channelCode; - @ApiModelProperty(value = "支付渠道的额外参数", notes = "例如说,微信公众号需要传递 openid 参数") + @Schema(description = "支付渠道的额外参数,例如说,微信公众号需要传递 openid 参数") private Map channelExtras; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/vo/AppPayOrderSubmitRespVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/vo/AppPayOrderSubmitRespVO.java index 7fcffd097..1eb4a852d 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/vo/AppPayOrderSubmitRespVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/vo/AppPayOrderSubmitRespVO.java @@ -1,13 +1,13 @@ package cn.iocoder.yudao.module.pay.controller.app.order.vo; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; -@ApiModel("用户 APP - 支付订单提交 Response VO") +@Schema(description = "用户 APP - 支付订单提交 Response VO") @Data @Accessors(chain = true) @Builder diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/refund/AppPayRefundController.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/refund/AppPayRefundController.java index 42fdc5dcb..855687c04 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/refund/AppPayRefundController.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/refund/AppPayRefundController.java @@ -8,8 +8,8 @@ import cn.iocoder.yudao.module.pay.convert.refund.PayRefundConvert; import cn.iocoder.yudao.module.pay.service.order.dto.PayRefundReqDTO; import cn.iocoder.yudao.module.pay.service.refund.PayRefundService; import cn.iocoder.yudao.module.pay.util.PaySeqUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; @@ -22,7 +22,7 @@ import javax.annotation.Resource; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP; -@Api(tags = "用户 APP - 退款订单") +@Tag(name = "用户 APP - 退款订单") @RestController @RequestMapping("/pay/refund") @Validated @@ -33,7 +33,7 @@ public class AppPayRefundController { private PayRefundService refundService; @PostMapping("/refund") - @ApiOperation("提交退款订单") + @Operation(summary = "提交退款订单") public CommonResult submitRefundOrder(@RequestBody AppPayRefundReqVO reqVO){ PayRefundReqDTO req = PayRefundConvert.INSTANCE.convert(reqVO); req.setUserIp(getClientIP()); diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/refund/vo/AppPayRefundReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/refund/vo/AppPayRefundReqVO.java index 627874561..09c31dae6 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/refund/vo/AppPayRefundReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/refund/vo/AppPayRefundReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.pay.controller.app.refund.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -9,25 +8,25 @@ import lombok.NoArgsConstructor; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; -@ApiModel("用户 APP - 退款订单 Req VO") +@Schema(description = "用户 APP - 退款订单 Req VO") @Data @NoArgsConstructor @AllArgsConstructor public class AppPayRefundReqVO { - @ApiModelProperty(value = "支付订单编号自增", required = true, example = "10") + @Schema(description = "支付订单编号自增", required = true, example = "10") @NotNull(message = "支付订单编号自增") private Long payOrderId; - @ApiModelProperty(value = "退款金额", required = true, example = "1") + @Schema(description = "退款金额", required = true, example = "1") @NotNull(message = "退款金额") private Long amount; - @ApiModelProperty(value = "退款原因", required = true, example = "不喜欢") + @Schema(description = "退款原因", required = true, example = "不喜欢") @NotEmpty(message = "退款原因") private String reason; - @ApiModelProperty(value = "商户退款订单号", required = true, example = "MR202111180000000001") + @Schema(description = "商户退款订单号", required = true, example = "MR202111180000000001") //TODO 测试暂时模拟生成 //@NotEmpty(message = "商户退款订单号") private String merchantRefundId; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/refund/vo/AppPayRefundRespVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/refund/vo/AppPayRefundRespVO.java index 534243281..3d2d65e53 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/refund/vo/AppPayRefundRespVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/refund/vo/AppPayRefundRespVO.java @@ -1,14 +1,13 @@ package cn.iocoder.yudao.module.pay.controller.app.refund.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; -@ApiModel("用户 APP - 提交退款订单 Response VO") +@Schema(description = "用户 APP - 提交退款订单 Response VO") @Data @Accessors(chain = true) @Builder @@ -16,7 +15,7 @@ import lombok.experimental.Accessors; @AllArgsConstructor public class AppPayRefundRespVO { - @ApiModelProperty(value = "退款订单编号", required = true, example = "10") + @Schema(description = "退款订单编号", required = true, example = "10") private Long refundId; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/framework/web/config/PayWebConfiguration.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/framework/web/config/PayWebConfiguration.java new file mode 100644 index 000000000..febc2bc8a --- /dev/null +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/framework/web/config/PayWebConfiguration.java @@ -0,0 +1,24 @@ +package cn.iocoder.yudao.module.pay.framework.web.config; + +import cn.iocoder.yudao.framework.swagger.config.YudaoSwaggerAutoConfiguration; +import org.springdoc.core.GroupedOpenApi; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * pay 模块的 web 组件的 Configuration + * + * @author 芋道源码 + */ +@Configuration(proxyBeanMethods = false) +public class PayWebConfiguration { + + /** + * pay 模块的 API 分组 + */ + @Bean + public GroupedOpenApi payGroupedOpenApi() { + return YudaoSwaggerAutoConfiguration.buildGroupedOpenApi("pay"); + } + +} diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/framework/web/package-info.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/framework/web/package-info.java new file mode 100644 index 000000000..03bfad978 --- /dev/null +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/framework/web/package-info.java @@ -0,0 +1,4 @@ +/** + * pay 模块的 web 配置 + */ +package cn.iocoder.yudao.module.pay.framework.web; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/notify/vo/PayNotifyOrderReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/notify/vo/PayNotifyOrderReqVO.java new file mode 100644 index 000000000..e69de29bb diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/notify/vo/PayRefundOrderReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/notify/vo/PayRefundOrderReqVO.java new file mode 100644 index 000000000..e69de29bb diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java index c9b456b90..c3d143e46 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java @@ -29,7 +29,7 @@ public interface DeptApi { * @param ids 部门编号数组 * @return 部门信息数组 */ - List getDepts(Collection ids); + List getDeptList(Collection ids); /** * 校验部门们是否有效。如下情况,视为无效: @@ -38,7 +38,7 @@ public interface DeptApi { * * @param ids 角色编号数组 */ - void validDepts(Collection ids); + void validateDeptList(Collection ids); /** * 获得指定编号的部门 Map @@ -47,7 +47,7 @@ public interface DeptApi { * @return 部门 Map */ default Map getDeptMap(Set ids) { - List list = getDepts(ids); + List list = getDeptList(ids); return CollectionUtils.convertMap(list, DeptRespDTO::getId); } diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/PostApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/PostApi.java index d1e3d47a1..57db07cc2 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/PostApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/PostApi.java @@ -16,6 +16,6 @@ public interface PostApi { * * @param ids 岗位编号数组 */ - void validPosts(Collection ids); + void validPostList(Collection ids); } diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApi.java index 5ba3dfd75..3bc28c89e 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApi.java @@ -19,7 +19,7 @@ public interface DictDataApi { * @param dictType 字典类型 * @param values 字典数据值的数组 */ - void validDictDatas(String dictType, Collection values); + void validateDictDataList(String dictType, Collection values); /** * 获得指定的字典数据,从缓存中 diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/ErrorCodeApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/ErrorCodeApi.java index b41728d40..6f6bc24c7 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/ErrorCodeApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/ErrorCodeApi.java @@ -19,7 +19,7 @@ public interface ErrorCodeApi { * * @param autoGenerateDTOs 错误码信息 */ - void autoGenerateErrorCodes(@Valid List autoGenerateDTOs); + void autoGenerateErrorCodeList(@Valid List autoGenerateDTOs); /** * 增量获得错误码数组 diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/RoleApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/RoleApi.java index 14133e9d9..309c9ef6e 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/RoleApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/RoleApi.java @@ -16,6 +16,6 @@ public interface RoleApi { * * @param ids 角色编号数组 */ - void validRoles(Collection ids); + void validRoleList(Collection ids); } diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsCodeApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsCodeApi.java index ffcf46dc0..98d4cdeef 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsCodeApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsCodeApi.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.module.system.api.sms; import cn.iocoder.yudao.framework.common.exception.ServiceException; -import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeCheckReqDTO; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeValidateReqDTO; import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeSendReqDTO; import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeUseReqDTO; @@ -35,6 +35,6 @@ public interface SmsCodeApi { * * @param reqDTO 校验请求 */ - void checkSmsCode(@Valid SmsCodeCheckReqDTO reqDTO); + void validateSmsCode(@Valid SmsCodeValidateReqDTO reqDTO); } diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeCheckReqDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeValidateReqDTO.java similarity index 95% rename from yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeCheckReqDTO.java rename to yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeValidateReqDTO.java index 92895bb4d..e7808354c 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeCheckReqDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/sms/dto/code/SmsCodeValidateReqDTO.java @@ -14,7 +14,7 @@ import javax.validation.constraints.NotNull; * @author 芋道源码 */ @Data -public class SmsCodeCheckReqDTO { +public class SmsCodeValidateReqDTO { /** * 手机号 diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApi.java index 3f255d55a..1fad83ed6 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApi.java @@ -14,13 +14,13 @@ public interface TenantApi { * * @return 租户编号数组 */ - List getTenantIds(); + List getTenantIdList(); /** * 校验租户是否合法 * * @param id 租户编号 */ - void validTenant(Long id); + void validateTenant(Long id); } diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApi.java index 6c0b7e9d9..35e11f02d 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApi.java @@ -6,7 +6,6 @@ import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; import java.util.Collection; import java.util.List; import java.util.Map; -import java.util.Set; /** * Admin 用户 API 接口 @@ -29,7 +28,7 @@ public interface AdminUserApi { * @param ids 用户 ID 们 * @return 用户对象信息 */ - List getUsers(Collection ids); + List getUserList(Collection ids); /** * 获得指定部门的用户数组 @@ -37,7 +36,7 @@ public interface AdminUserApi { * @param deptIds 部门数组 * @return 用户数组 */ - List getUsersByDeptIds(Collection deptIds); + List getUserListByDeptIds(Collection deptIds); /** * 获得指定岗位的用户数组 @@ -54,7 +53,7 @@ public interface AdminUserApi { * @return 用户 Map */ default Map getUserMap(Collection ids) { - List users = getUsers(ids); + List users = getUserList(ids); return CollectionUtils.convertMap(users, AdminUserRespDTO::getId); } @@ -65,6 +64,6 @@ public interface AdminUserApi { * * @param ids 用户编号数组 */ - void validUsers(Set ids); + void validateUserList(Collection ids); } diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java index b108ca775..8a54ba92e 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java @@ -50,7 +50,7 @@ public interface ErrorCodeConstants { ErrorCode DEPT_EXITS_CHILDREN = new ErrorCode(1002004003, "存在子部门,无法删除"); ErrorCode DEPT_PARENT_ERROR = new ErrorCode(1002004004, "不能设置自己为父部门"); ErrorCode DEPT_EXISTS_USER = new ErrorCode(1002004005, "部门中存在员工,无法删除"); - ErrorCode DEPT_NOT_ENABLE = new ErrorCode(1002004006, "部门不处于开启状态,不允许选择"); + ErrorCode DEPT_NOT_ENABLE = new ErrorCode(1002004006, "部门({})不处于开启状态,不允许选择"); ErrorCode DEPT_PARENT_IS_CHILD = new ErrorCode(1002004007, "不能设置自己的子部门为父部门"); // ========== 岗位模块 1002005000 ========== diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/permission/MenuIdEnum.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/permission/MenuIdEnum.java deleted file mode 100644 index fc2b72ac4..000000000 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/permission/MenuIdEnum.java +++ /dev/null @@ -1,20 +0,0 @@ -package cn.iocoder.yudao.module.system.enums.permission; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * Menu 编号枚举 - */ -@Getter -@AllArgsConstructor -public enum MenuIdEnum { - - /** - * 根节点 - */ - ROOT(0L); - - private final Long id; - -} diff --git a/yudao-module-system/yudao-module-system-biz/pom.xml b/yudao-module-system/yudao-module-system-biz/pom.xml index 42464d762..898029163 100644 --- a/yudao-module-system/yudao-module-system-biz/pom.xml +++ b/yudao-module-system/yudao-module-system-biz/pom.xml @@ -65,6 +65,11 @@ yudao-spring-boot-starter-security + + org.springframework.boot + spring-boot-starter-validation + + cn.iocoder.boot diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java index 5721030bb..c1676ca53 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java @@ -28,14 +28,14 @@ public class DeptApiImpl implements DeptApi { } @Override - public List getDepts(Collection ids) { - List depts = deptService.getDepts(ids); + public List getDeptList(Collection ids) { + List depts = deptService.getDeptList(ids); return DeptConvert.INSTANCE.convertList03(depts); } @Override - public void validDepts(Collection ids) { - deptService.validDepts(ids); + public void validateDeptList(Collection ids) { + deptService.validateDeptList(ids); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/PostApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/PostApiImpl.java index 9454193e7..3d8cdf997 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/PostApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/PostApiImpl.java @@ -18,7 +18,8 @@ public class PostApiImpl implements PostApi { private PostService postService; @Override - public void validPosts(Collection ids) { - postService.validPosts(ids); + public void validPostList(Collection ids) { + postService.validatePostList(ids); } + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApiImpl.java index 7de1a43b3..e88771fa7 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dict/DictDataApiImpl.java @@ -21,8 +21,8 @@ public class DictDataApiImpl implements DictDataApi { private DictDataService dictDataService; @Override - public void validDictDatas(String dictType, Collection values) { - dictDataService.validDictDatas(dictType, values); + public void validateDictDataList(String dictType, Collection values) { + dictDataService.validateDictDataList(dictType, values); } @Override diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/ErrorCodeApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/ErrorCodeApiImpl.java index b68c63215..c9c5f7029 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/ErrorCodeApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/errorcode/ErrorCodeApiImpl.java @@ -21,7 +21,7 @@ public class ErrorCodeApiImpl implements ErrorCodeApi { private ErrorCodeService errorCodeService; @Override - public void autoGenerateErrorCodes(List autoGenerateDTOs) { + public void autoGenerateErrorCodeList(List autoGenerateDTOs) { errorCodeService.autoGenerateErrorCodes(autoGenerateDTOs); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/permission/RoleApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/permission/RoleApiImpl.java index 2c4f94737..d8622a29a 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/permission/RoleApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/permission/RoleApiImpl.java @@ -18,7 +18,7 @@ public class RoleApiImpl implements RoleApi { private RoleService roleService; @Override - public void validRoles(Collection ids) { - roleService.validRoles(ids); + public void validRoleList(Collection ids) { + roleService.validateRoleList(ids); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsCodeApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsCodeApiImpl.java index 81957e082..23c5e4b3f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsCodeApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/sms/SmsCodeApiImpl.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.system.api.sms; -import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeCheckReqDTO; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeValidateReqDTO; import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeSendReqDTO; import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeUseReqDTO; import cn.iocoder.yudao.module.system.service.sms.SmsCodeService; @@ -32,8 +32,8 @@ public class SmsCodeApiImpl implements SmsCodeApi { } @Override - public void checkSmsCode(SmsCodeCheckReqDTO reqDTO) { - smsCodeService.checkSmsCode(reqDTO); + public void validateSmsCode(SmsCodeValidateReqDTO reqDTO) { + smsCodeService.validateSmsCode(reqDTO); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApiImpl.java index 6ea4c795e..25ea260c5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApiImpl.java @@ -18,12 +18,12 @@ public class TenantApiImpl implements TenantApi { private TenantService tenantService; @Override - public List getTenantIds() { - return tenantService.getTenantIds(); + public List getTenantIdList() { + return tenantService.getTenantIdList(); } @Override - public void validTenant(Long id) { + public void validateTenant(Long id) { tenantService.validTenant(id); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApiImpl.java index d493b747a..2271420c4 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApiImpl.java @@ -9,7 +9,6 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.Collection; import java.util.List; -import java.util.Set; /** * Admin 用户 API 实现类 @@ -29,26 +28,26 @@ public class AdminUserApiImpl implements AdminUserApi { } @Override - public List getUsers(Collection ids) { - List users = userService.getUsers(ids); + public List getUserList(Collection ids) { + List users = userService.getUserList(ids); return UserConvert.INSTANCE.convertList4(users); } @Override - public List getUsersByDeptIds(Collection deptIds) { - List users = userService.getUsersByDeptIds(deptIds); + public List getUserListByDeptIds(Collection deptIds) { + List users = userService.getUserListByDeptIds(deptIds); return UserConvert.INSTANCE.convertList4(users); } @Override public List getUsersByPostIds(Collection postIds) { - List users = userService.getUsersByPostIds(postIds); + List users = userService.getUserListByPostIds(postIds); return UserConvert.INSTANCE.convertList4(users); } @Override - public void validUsers(Set ids) { - userService.validUsers(ids); + public void validateUserList(Collection ids) { + userService.validateUserList(ids); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java index 9a9c0a95e..7ef7012cc 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java @@ -18,10 +18,10 @@ import cn.iocoder.yudao.module.system.service.permission.PermissionService; import cn.iocoder.yudao.module.system.service.permission.RoleService; import cn.iocoder.yudao.module.system.service.social.SocialUserService; import cn.iocoder.yudao.module.system.service.user.AdminUserService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -38,7 +38,7 @@ import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUti import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.obtainAuthorization; import static java.util.Collections.singleton; -@Api(tags = "管理后台 - 认证") +@Tag(name = "管理后台 - 认证") @RestController @RequestMapping("/system/auth") @Validated @@ -60,7 +60,7 @@ public class AuthController { @PostMapping("/login") @PermitAll - @ApiOperation("使用账号密码登录") + @Operation(summary = "使用账号密码登录") @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 public CommonResult login(@RequestBody @Valid AuthLoginReqVO reqVO) { return success(authService.login(reqVO)); @@ -68,7 +68,7 @@ public class AuthController { @PostMapping("/logout") @PermitAll - @ApiOperation("登出系统") + @Operation(summary = "登出系统") @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 public CommonResult logout(HttpServletRequest request) { String token = obtainAuthorization(request, securityProperties.getTokenHeader()); @@ -80,15 +80,15 @@ public class AuthController { @PostMapping("/refresh-token") @PermitAll - @ApiOperation("刷新令牌") - @ApiImplicitParam(name = "refreshToken", value = "刷新令牌", required = true, dataTypeClass = String.class) + @Operation(summary = "刷新令牌") + @Parameter(name = "refreshToken", description = "刷新令牌", required = true) @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 public CommonResult refreshToken(@RequestParam("refreshToken") String refreshToken) { return success(authService.refreshToken(refreshToken)); } @GetMapping("/get-permission-info") - @ApiOperation("获取登录用户的权限信息") + @Operation(summary = "获取登录用户的权限信息") public CommonResult getPermissionInfo() { // 获得用户信息 AdminUserDO user = userService.getUser(getLoginUserId()); @@ -97,7 +97,7 @@ public class AuthController { } // 获得角色列表 Set roleIds = permissionService.getUserRoleIdsFromCache(getLoginUserId(), singleton(CommonStatusEnum.ENABLE.getStatus())); - List roleList = roleService.getRolesFromCache(roleIds); + List roleList = roleService.getRoleListFromCache(roleIds); // 获得菜单列表 List menuList = permissionService.getRoleMenuListFromCache(roleIds, SetUtils.asSet(MenuTypeEnum.DIR.getType(), MenuTypeEnum.MENU.getType(), MenuTypeEnum.BUTTON.getType()), @@ -107,8 +107,8 @@ public class AuthController { } @GetMapping("/list-menus") - @ApiOperation("获得登录用户的菜单列表") - public CommonResult> getMenus() { + @Operation(summary = "获得登录用户的菜单列表") + public CommonResult> getMenuList() { // 获得角色列表 Set roleIds = permissionService.getUserRoleIdsFromCache(getLoginUserId(), singleton(CommonStatusEnum.ENABLE.getStatus())); // 获得用户拥有的菜单列表 @@ -123,7 +123,7 @@ public class AuthController { @PostMapping("/sms-login") @PermitAll - @ApiOperation("使用短信验证码登录") + @Operation(summary = "使用短信验证码登录") @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 public CommonResult smsLogin(@RequestBody @Valid AuthSmsLoginReqVO reqVO) { return success(authService.smsLogin(reqVO)); @@ -131,7 +131,7 @@ public class AuthController { @PostMapping("/send-sms-code") @PermitAll - @ApiOperation(value = "发送手机验证码") + @Operation(summary = "发送手机验证码") @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 public CommonResult sendLoginSmsCode(@RequestBody @Valid AuthSmsSendReqVO reqVO) { authService.sendSmsCode(reqVO); @@ -142,10 +142,10 @@ public class AuthController { @GetMapping("/social-auth-redirect") @PermitAll - @ApiOperation("社交授权的跳转") - @ApiImplicitParams({ - @ApiImplicitParam(name = "type", value = "社交类型", required = true, dataTypeClass = Integer.class), - @ApiImplicitParam(name = "redirectUri", value = "回调路径", dataTypeClass = String.class) + @Operation(summary = "社交授权的跳转") + @Parameters({ + @Parameter(name = "type", description = "社交类型", required = true), + @Parameter(name = "redirectUri", description = "回调路径") }) public CommonResult socialLogin(@RequestParam("type") Integer type, @RequestParam("redirectUri") String redirectUri) { @@ -154,7 +154,7 @@ public class AuthController { @PostMapping("/social-login") @PermitAll - @ApiOperation(value = "社交快捷登录,使用 code 授权码", notes = "适合未登录的用户,但是社交账号已绑定用户") + @Operation(summary = "社交快捷登录,使用 code 授权码", description = "适合未登录的用户,但是社交账号已绑定用户") @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 public CommonResult socialQuickLogin(@RequestBody @Valid AuthSocialLoginReqVO reqVO) { return success(authService.socialLogin(reqVO)); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthLoginReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthLoginReqVO.java index bafc322e2..757e7aef5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthLoginReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthLoginReqVO.java @@ -3,8 +3,7 @@ package cn.iocoder.yudao.module.system.controller.admin.auth.vo; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -15,42 +14,41 @@ import javax.validation.constraints.AssertTrue; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.Pattern; -@ApiModel(value = "管理后台 - 账号密码登录 Request VO", description = "如果登录并绑定社交用户,需要传递 social 开头的参数") +@Schema(description = "管理后台 - 账号密码登录 Request VO,如果登录并绑定社交用户,需要传递 social 开头的参数") @Data @NoArgsConstructor @AllArgsConstructor @Builder public class AuthLoginReqVO { - @ApiModelProperty(value = "账号", required = true, example = "yudaoyuanma") + @Schema(description = "账号", required = true, example = "yudaoyuanma") @NotEmpty(message = "登录账号不能为空") @Length(min = 4, max = 16, message = "账号长度为 4-16 位") @Pattern(regexp = "^[A-Za-z0-9]+$", message = "账号格式为数字以及字母") private String username; - @ApiModelProperty(value = "密码", required = true, example = "buzhidao") + @Schema(description = "密码", required = true, example = "buzhidao") @NotEmpty(message = "密码不能为空") @Length(min = 4, max = 16, message = "密码长度为 4-16 位") private String password; // ========== 图片验证码相关 ========== - @ApiModelProperty(value = "验证码", required = true, - example = "PfcH6mgr8tpXuMWFjvW6YVaqrswIuwmWI5dsVZSg7sGpWtDCUbHuDEXl3cFB1+VvCC/rAkSwK8Fad52FSuncVg==", - notes = "验证码开启时,需要传递") + @Schema(description = "验证码,验证码开启时,需要传递", required = true, + example = "PfcH6mgr8tpXuMWFjvW6YVaqrswIuwmWI5dsVZSg7sGpWtDCUbHuDEXl3cFB1+VvCC/rAkSwK8Fad52FSuncVg==") @NotEmpty(message = "验证码不能为空", groups = CodeEnableGroup.class) private String captchaVerification; // ========== 绑定社交登录时,需要传递如下参数 ========== - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SysUserSocialTypeEnum 枚举值") + @Schema(description = "社交平台的类型,参见 SysUserSocialTypeEnum 枚举值", required = true, example = "10") @InEnum(SocialTypeEnum.class) private Integer socialType; - @ApiModelProperty(value = "授权码", required = true, example = "1024") + @Schema(description = "授权码", required = true, example = "1024") private String socialCode; - @ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") + @Schema(description = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") private String socialState; /** diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthLoginRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthLoginRespVO.java index 6e1882887..79f745208 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthLoginRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthLoginRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.auth.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -9,23 +8,23 @@ import lombok.NoArgsConstructor; import java.time.LocalDateTime; -@ApiModel("管理后台 - 登录 Response VO") +@Schema(description = "管理后台 - 登录 Response VO") @Data @NoArgsConstructor @AllArgsConstructor @Builder public class AuthLoginRespVO { - @ApiModelProperty(value = "用户编号", required = true, example = "1024") + @Schema(description = "用户编号", required = true, example = "1024") private Long userId; - @ApiModelProperty(value = "访问令牌", required = true, example = "happy") + @Schema(description = "访问令牌", required = true, example = "happy") private String accessToken; - @ApiModelProperty(value = "刷新令牌", required = true, example = "nice") + @Schema(description = "刷新令牌", required = true, example = "nice") private String refreshToken; - @ApiModelProperty(value = "过期时间", required = true) + @Schema(description = "过期时间", required = true) private LocalDateTime expiresTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthMenuRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthMenuRespVO.java index 2ae7eaac8..58948178f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthMenuRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthMenuRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.auth.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -9,35 +8,35 @@ import lombok.NoArgsConstructor; import java.util.List; -@ApiModel("管理后台 - 登录用户的菜单信息 Response VO") +@Schema(description = "管理后台 - 登录用户的菜单信息 Response VO") @Data @NoArgsConstructor @AllArgsConstructor @Builder public class AuthMenuRespVO { - @ApiModelProperty(value = "菜单名称", required = true, example = "芋道") + @Schema(description = "菜单名称", required = true, example = "芋道") private Long id; - @ApiModelProperty(value = "父菜单 ID", required = true, example = "1024") + @Schema(description = "父菜单 ID", required = true, example = "1024") private Long parentId; - @ApiModelProperty(value = "菜单名称", required = true, example = "芋道") + @Schema(description = "菜单名称", required = true, example = "芋道") private String name; - @ApiModelProperty(value = "路由地址", example = "post", notes = "仅菜单类型为菜单或者目录时,才需要传") + @Schema(description = "路由地址,仅菜单类型为菜单或者目录时,才需要传", example = "post") private String path; - @ApiModelProperty(value = "组件路径", example = "system/post/index", notes = "仅菜单类型为菜单时,才需要传") + @Schema(description = "组件路径,仅菜单类型为菜单时,才需要传", example = "system/post/index") private String component; - @ApiModelProperty(value = "菜单图标", example = "/menu/list", notes = "仅菜单类型为菜单或者目录时,才需要传") + @Schema(description = "菜单图标,仅菜单类型为菜单或者目录时,才需要传", example = "/menu/list") private String icon; - @ApiModelProperty(value = "是否可见", required = true, example = "false") + @Schema(description = "是否可见", required = true, example = "false") private Boolean visible; - @ApiModelProperty(value = "是否缓存", required = true, example = "false") + @Schema(description = "是否缓存", required = true, example = "false") private Boolean keepAlive; /** diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthPermissionInfoRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthPermissionInfoRespVO.java index 0e809226c..957ca4b47 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthPermissionInfoRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthPermissionInfoRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.auth.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -9,36 +8,36 @@ import lombok.NoArgsConstructor; import java.util.Set; -@ApiModel(value = "管理后台 - 登录用户的权限信息 Response VO", description = "额外包括用户信息和角色列表") +@Schema(description = "管理后台 - 登录用户的权限信息 Response VO,额外包括用户信息和角色列表") @Data @NoArgsConstructor @AllArgsConstructor @Builder public class AuthPermissionInfoRespVO { - @ApiModelProperty(value = "用户信息", required = true) + @Schema(description = "用户信息", required = true) private UserVO user; - @ApiModelProperty(value = "角色标识数组", required = true) + @Schema(description = "角色标识数组", required = true) private Set roles; - @ApiModelProperty(value = "操作权限数组", required = true) + @Schema(description = "操作权限数组", required = true) private Set permissions; - @ApiModel("用户信息 VO") + @Schema(description = "用户信息 VO") @Data @NoArgsConstructor @AllArgsConstructor @Builder public static class UserVO { - @ApiModelProperty(value = "用户编号", required = true, example = "1024") + @Schema(description = "用户编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "用户昵称", required = true, example = "芋道源码") + @Schema(description = "用户昵称", required = true, example = "芋道源码") private String nickname; - @ApiModelProperty(value = "用户头像", required = true, example = "http://www.iocoder.cn/xx.jpg") + @Schema(description = "用户头像", required = true, example = "http://www.iocoder.cn/xx.jpg") private String avatar; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSmsLoginReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSmsLoginReqVO.java index b641bcca6..5245b2f05 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSmsLoginReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSmsLoginReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.auth.vo; import cn.iocoder.yudao.framework.common.validation.Mobile; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -10,19 +9,19 @@ import lombok.NoArgsConstructor; import javax.validation.constraints.NotEmpty; -@ApiModel("管理后台 - 短信验证码的登录 Request VO") +@Schema(description = "管理后台 - 短信验证码的登录 Request VO") @Data @NoArgsConstructor @AllArgsConstructor @Builder public class AuthSmsLoginReqVO { - @ApiModelProperty(value = "手机号", required = true, example = "yudaoyuanma") + @Schema(description = "手机号", required = true, example = "yudaoyuanma") @NotEmpty(message = "手机号不能为空") @Mobile private String mobile; - @ApiModelProperty(value = "短信验证码", required = true, example = "1024") + @Schema(description = "短信验证码", required = true, example = "1024") @NotEmpty(message = "验证码不能为空") private String code; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSmsSendReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSmsSendReqVO.java index 0df9a521e..0f8ce8343 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSmsSendReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSmsSendReqVO.java @@ -3,8 +3,7 @@ package cn.iocoder.yudao.module.system.controller.admin.auth.vo; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.framework.common.validation.Mobile; import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -13,19 +12,19 @@ import lombok.NoArgsConstructor; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 发送手机验证码 Request VO") +@Schema(description = "管理后台 - 发送手机验证码 Request VO") @Data @NoArgsConstructor @AllArgsConstructor @Builder public class AuthSmsSendReqVO { - @ApiModelProperty(value = "手机号", required = true, example = "yudaoyuanma") + @Schema(description = "手机号", required = true, example = "yudaoyuanma") @NotEmpty(message = "手机号不能为空") @Mobile private String mobile; - @ApiModelProperty(value = "短信场景", required = true, example = "1") + @Schema(description = "短信场景", required = true, example = "1") @NotNull(message = "发送场景不能为空") @InEnum(SmsSceneEnum.class) private Integer scene; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSocialLoginReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSocialLoginReqVO.java index e52a49288..9de058c12 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSocialLoginReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSocialLoginReqVO.java @@ -2,8 +2,7 @@ package cn.iocoder.yudao.module.system.controller.admin.auth.vo; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -12,23 +11,23 @@ import lombok.NoArgsConstructor; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 社交绑定登录 Request VO,使用 code 授权码 + 账号密码") +@Schema(description = "管理后台 - 社交绑定登录 Request VO,使用 code 授权码 + 账号密码") @Data @NoArgsConstructor @AllArgsConstructor @Builder public class AuthSocialLoginReqVO { - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 UserSocialTypeEnum 枚举值") + @Schema(description = "社交平台的类型,参见 UserSocialTypeEnum 枚举值", required = true, example = "10") @InEnum(SocialTypeEnum.class) @NotNull(message = "社交平台的类型不能为空") private Integer type; - @ApiModelProperty(value = "授权码", required = true, example = "1024") + @Schema(description = "授权码", required = true, example = "1024") @NotEmpty(message = "授权码不能为空") private String code; - @ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") + @Schema(description = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") @NotEmpty(message = "state 不能为空") private String state; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/captcha/CaptchaController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/captcha/CaptchaController.java index 9921c8ea8..9f163a62f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/captcha/CaptchaController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/captcha/CaptchaController.java @@ -6,8 +6,8 @@ import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; import com.xingyuv.captcha.model.common.ResponseModel; import com.xingyuv.captcha.model.vo.CaptchaVO; import com.xingyuv.captcha.service.CaptchaService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -22,7 +22,7 @@ import javax.servlet.http.HttpServletRequest; * * @author 芋道源码 */ -@Api(tags = "管理后台 - 验证码") +@Tag(name = "管理后台 - 验证码") @RestController("adminCaptchaController") @RequestMapping("/system/captcha") public class CaptchaController { @@ -31,7 +31,7 @@ public class CaptchaController { private CaptchaService captchaService; @PostMapping({"/get"}) - @ApiOperation("获得验证码") + @Operation(summary = "获得验证码") @PermitAll @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 public ResponseModel get(@RequestBody CaptchaVO data, HttpServletRequest request) { @@ -41,7 +41,7 @@ public class CaptchaController { } @PostMapping("/check") - @ApiOperation("校验验证码") + @Operation(summary = "校验验证码") @PermitAll @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 public ResponseModel check(@RequestBody CaptchaVO data, HttpServletRequest request) { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java index 0a292e243..906ab646a 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java @@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.*; import cn.iocoder.yudao.module.system.convert.dept.DeptConvert; import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; import cn.iocoder.yudao.module.system.service.dept.DeptService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -20,7 +20,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 部门") +@Tag(name = "管理后台 - 部门") @RestController @RequestMapping("/system/dept") @Validated @@ -30,7 +30,7 @@ public class DeptController { private DeptService deptService; @PostMapping("create") - @ApiOperation("创建部门") + @Operation(summary = "创建部门") @PreAuthorize("@ss.hasPermission('system:dept:create')") public CommonResult createDept(@Valid @RequestBody DeptCreateReqVO reqVO) { Long deptId = deptService.createDept(reqVO); @@ -38,7 +38,7 @@ public class DeptController { } @PutMapping("update") - @ApiOperation("更新部门") + @Operation(summary = "更新部门") @PreAuthorize("@ss.hasPermission('system:dept:update')") public CommonResult updateDept(@Valid @RequestBody DeptUpdateReqVO reqVO) { deptService.updateDept(reqVO); @@ -46,8 +46,8 @@ public class DeptController { } @DeleteMapping("delete") - @ApiOperation("删除部门") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "删除部门") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:dept:delete')") public CommonResult deleteDept(@RequestParam("id") Long id) { deptService.deleteDept(id); @@ -55,29 +55,29 @@ public class DeptController { } @GetMapping("/list") - @ApiOperation("获取部门列表") + @Operation(summary = "获取部门列表") @PreAuthorize("@ss.hasPermission('system:dept:query')") - public CommonResult> listDepts(DeptListReqVO reqVO) { - List list = deptService.getSimpleDepts(reqVO); + public CommonResult> getDeptList(DeptListReqVO reqVO) { + List list = deptService.getDeptList(reqVO); list.sort(Comparator.comparing(DeptDO::getSort)); return success(DeptConvert.INSTANCE.convertList(list)); } @GetMapping("/list-all-simple") - @ApiOperation(value = "获取部门精简信息列表", notes = "只包含被开启的部门,主要用于前端的下拉选项") - public CommonResult> getSimpleDepts() { + @Operation(summary = "获取部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项") + public CommonResult> getSimpleDeptList() { // 获得部门列表,只要开启状态的 DeptListReqVO reqVO = new DeptListReqVO(); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - List list = deptService.getSimpleDepts(reqVO); + List list = deptService.getDeptList(reqVO); // 排序后,返回给前端 list.sort(Comparator.comparing(DeptDO::getSort)); return success(DeptConvert.INSTANCE.convertList02(list)); } @GetMapping("/get") - @ApiOperation("获得部门信息") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得部门信息") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:dept:query')") public CommonResult getDept(@RequestParam("id") Long id) { return success(DeptConvert.INSTANCE.convert(deptService.getDept(id))); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/PostController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/PostController.java index 5275dc0c4..70e2d8639 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/PostController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/PostController.java @@ -9,9 +9,9 @@ import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.*; import cn.iocoder.yudao.module.system.convert.dept.PostConvert; import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; import cn.iocoder.yudao.module.system.service.dept.PostService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -27,7 +27,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; -@Api(tags = "管理后台 - 岗位") +@Tag(name = "管理后台 - 岗位") @RestController @RequestMapping("/system/post") @Validated @@ -37,7 +37,7 @@ public class PostController { private PostService postService; @PostMapping("/create") - @ApiOperation("创建岗位") + @Operation(summary = "创建岗位") @PreAuthorize("@ss.hasPermission('system:post:create')") public CommonResult createPost(@Valid @RequestBody PostCreateReqVO reqVO) { Long postId = postService.createPost(reqVO); @@ -45,7 +45,7 @@ public class PostController { } @PutMapping("/update") - @ApiOperation("修改岗位") + @Operation(summary = "修改岗位") @PreAuthorize("@ss.hasPermission('system:post:update')") public CommonResult updatePost(@Valid @RequestBody PostUpdateReqVO reqVO) { postService.updatePost(reqVO); @@ -53,7 +53,7 @@ public class PostController { } @DeleteMapping("/delete") - @ApiOperation("删除岗位") + @Operation(summary = "删除岗位") @PreAuthorize("@ss.hasPermission('system:post:delete')") public CommonResult deletePost(@RequestParam("id") Long id) { postService.deletePost(id); @@ -61,36 +61,36 @@ public class PostController { } @GetMapping(value = "/get") - @ApiOperation("获得岗位信息") - @ApiImplicitParam(name = "id", value = "岗位编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得岗位信息") + @Parameter(name = "id", description = "岗位编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:post:query')") public CommonResult getPost(@RequestParam("id") Long id) { return success(PostConvert.INSTANCE.convert(postService.getPost(id))); } @GetMapping("/list-all-simple") - @ApiOperation(value = "获取岗位精简信息列表", notes = "只包含被开启的岗位,主要用于前端的下拉选项") - public CommonResult> getSimplePosts() { + @Operation(summary = "获取岗位精简信息列表", description = "只包含被开启的岗位,主要用于前端的下拉选项") + public CommonResult> getSimplePostList() { // 获得岗位列表,只要开启状态的 - List list = postService.getPosts(null, Collections.singleton(CommonStatusEnum.ENABLE.getStatus())); + List list = postService.getPostList(null, Collections.singleton(CommonStatusEnum.ENABLE.getStatus())); // 排序后,返回给前端 list.sort(Comparator.comparing(PostDO::getSort)); return success(PostConvert.INSTANCE.convertList02(list)); } @GetMapping("/page") - @ApiOperation("获得岗位分页列表") + @Operation(summary = "获得岗位分页列表") @PreAuthorize("@ss.hasPermission('system:post:query')") public CommonResult> getPostPage(@Validated PostPageReqVO reqVO) { return success(PostConvert.INSTANCE.convertPage(postService.getPostPage(reqVO))); } @GetMapping("/export") - @ApiOperation("岗位管理") + @Operation(summary = "岗位管理") @PreAuthorize("@ss.hasPermission('system:post:export')") @OperateLog(type = EXPORT) public void export(HttpServletResponse response, @Validated PostExportReqVO reqVO) throws IOException { - List posts = postService.getPosts(reqVO); + List posts = postService.getPostList(reqVO); List data = PostConvert.INSTANCE.convertList03(posts); // 输出 ExcelUtils.write(response, "岗位数据.xls", "岗位列表", PostExcelVO.class, data); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptBaseVO.java index 699a27694..25f32c21a 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptBaseVO.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept; - -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.Email; @@ -15,31 +14,31 @@ import javax.validation.constraints.Size; @Data public class DeptBaseVO { - @ApiModelProperty(value = "菜单名称", required = true, example = "芋道") + @Schema(description = "菜单名称", required = true, example = "芋道") @NotBlank(message = "部门名称不能为空") @Size(max = 30, message = "部门名称长度不能超过30个字符") private String name; - @ApiModelProperty(value = "父菜单 ID", example = "1024") + @Schema(description = "父菜单 ID", example = "1024") private Long parentId; - @ApiModelProperty(value = "显示顺序不能为空", required = true, example = "1024") + @Schema(description = "显示顺序不能为空", required = true, example = "1024") @NotNull(message = "显示顺序不能为空") private Integer sort; - @ApiModelProperty(value = "负责人的用户编号", example = "2048") + @Schema(description = "负责人的用户编号", example = "2048") private Long leaderUserId; - @ApiModelProperty(value = "联系电话", example = "15601691000") + @Schema(description = "联系电话", example = "15601691000") @Size(max = 11, message = "联系电话长度不能超过11个字符") private String phone; - @ApiModelProperty(value = "邮箱", example = "yudao@iocoder.cn") + @Schema(description = "邮箱", example = "yudao@iocoder.cn") @Email(message = "邮箱格式不正确") @Size(max = 50, message = "邮箱长度不能超过50个字符") private String email; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举") + @Schema(description = "状态,见 CommonStatusEnum 枚举", required = true, example = "1") @NotNull(message = "状态不能为空") // @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") private Integer status; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptCreateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptCreateReqVO.java index efd6c39a3..66741f6da 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptCreateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptCreateReqVO.java @@ -1,11 +1,10 @@ package cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept; - -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 部门创建 Request VO") +@Schema(description = "管理后台 - 部门创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptListReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptListReqVO.java index c4ff55243..469dc6ac6 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptListReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptListReqVO.java @@ -1,17 +1,16 @@ package cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@ApiModel("管理后台 - 部门列表 Request VO") +@Schema(description = "管理后台 - 部门列表 Request VO") @Data public class DeptListReqVO { - @ApiModelProperty(value = "部门名称", example = "芋道", notes = "模糊匹配") + @Schema(description = "部门名称,模糊匹配", example = "芋道") private String name; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1") private Integer status; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptRespVO.java index a3361cdd6..7d8933a0c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptRespVO.java @@ -1,24 +1,23 @@ package cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import java.time.LocalDateTime; -@ApiModel("管理后台 - 部门信息 Response VO") +@Schema(description = "管理后台 - 部门信息 Response VO") @Data @EqualsAndHashCode(callSuper = true) public class DeptRespVO extends DeptBaseVO { - @ApiModelProperty(value = "部门编号", required = true, example = "1024") + @Schema(description = "部门编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "状态,参见 CommonStatusEnum 枚举类", required = true, example = "1") private Integer status; - @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") + @Schema(description = "创建时间", required = true, example = "时间戳格式") private LocalDateTime createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptSimpleRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptSimpleRespVO.java index 1a3d64f6e..582eaae51 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptSimpleRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptSimpleRespVO.java @@ -1,24 +1,23 @@ package cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; -@ApiModel("管理后台 - 部门精简信息 Response VO") +@Schema(description = "管理后台 - 部门精简信息 Response VO") @Data @NoArgsConstructor @AllArgsConstructor public class DeptSimpleRespVO { - @ApiModelProperty(value = "部门编号", required = true, example = "1024") + @Schema(description = "部门编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "部门名称", required = true, example = "芋道") + @Schema(description = "部门名称", required = true, example = "芋道") private String name; - @ApiModelProperty(value = "父部门 ID", required = true, example = "1024") + @Schema(description = "父部门 ID", required = true, example = "1024") private Long parentId; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptUpdateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptUpdateReqVO.java index 3e2f13a84..18d002438 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/dept/DeptUpdateReqVO.java @@ -1,18 +1,17 @@ package cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 部门更新 Request VO") +@Schema(description = "管理后台 - 部门更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class DeptUpdateReqVO extends DeptBaseVO { - @ApiModelProperty(value = "部门编号", required = true, example = "1024") + @Schema(description = "部门编号", required = true, example = "1024") @NotNull(message = "部门编号不能为空") private Long id; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostBaseVO.java index 98c1bf212..df3f10ec5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostBaseVO.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post; - -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -14,24 +13,24 @@ import javax.validation.constraints.Size; @Data public class PostBaseVO { - @ApiModelProperty(value = "岗位名称", required = true, example = "小博主") + @Schema(description = "岗位名称", required = true, example = "小博主") @NotBlank(message = "岗位名称不能为空") @Size(max = 50, message = "岗位名称长度不能超过50个字符") private String name; - @ApiModelProperty(value = "岗位编码", required = true, example = "yudao") + @Schema(description = "岗位编码", required = true, example = "yudao") @NotBlank(message = "岗位编码不能为空") @Size(max = 64, message = "岗位编码长度不能超过64个字符") private String code; - @ApiModelProperty(value = "显示顺序不能为空", required = true, example = "1024") + @Schema(description = "显示顺序不能为空", required = true, example = "1024") @NotNull(message = "显示顺序不能为空") private Integer sort; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "状态,参见 CommonStatusEnum 枚举类", required = true, example = "1") private Integer status; - @ApiModelProperty(value = "备注", example = "快乐的备注") + @Schema(description = "备注", example = "快乐的备注") private String remark; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostCreateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostCreateReqVO.java index 547739c0d..b2e52e174 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostCreateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostCreateReqVO.java @@ -1,10 +1,10 @@ package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; -@ApiModel("管理后台 - 岗位创建 Request VO") +@Schema(description = "管理后台 - 岗位创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class PostCreateReqVO extends PostBaseVO { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostExportReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostExportReqVO.java index 735bfcce1..8b7cc79a3 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostExportReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostExportReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@ApiModel(value = "管理后台 - 岗位导出 Request VO", description = "参数和 PostExcelVO 是一致的") +@Schema(description = "管理后台 - 岗位导出 Request VO,参数和 PostExcelVO 是一致的") @Data public class PostExportReqVO { - @ApiModelProperty(value = "岗位编码", example = "yudao", notes = "模糊匹配") + @Schema(description = "岗位编码,模糊匹配", example = "yudao") private String code; - @ApiModelProperty(value = "岗位名称", example = "芋道", notes = "模糊匹配") + @Schema(description = "岗位名称,模糊匹配", example = "芋道") private String name; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1") private Integer status; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostListReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostListReqVO.java index 58ba469e1..abb166132 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostListReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostListReqVO.java @@ -1,19 +1,18 @@ package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; -@ApiModel("管理后台 - 岗位列表 Request VO") +@Schema(description = "管理后台 - 岗位列表 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class PostListReqVO extends PostBaseVO { - @ApiModelProperty(value = "岗位名称", example = "芋道", notes = "模糊匹配") + @Schema(description = "岗位名称,模糊匹配", example = "芋道") private String name; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1") private Integer status; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostPageReqVO.java index be9ebeab4..0806725f5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostPageReqVO.java @@ -1,23 +1,22 @@ package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; -@ApiModel("管理后台 - 岗位分页 Request VO") +@Schema(description = "管理后台 - 岗位分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class PostPageReqVO extends PageParam { - @ApiModelProperty(value = "岗位编码", example = "yudao", notes = "模糊匹配") + @Schema(description = "岗位编码,模糊匹配", example = "yudao") private String code; - @ApiModelProperty(value = "岗位名称", example = "芋道", notes = "模糊匹配") + @Schema(description = "岗位名称,模糊匹配", example = "芋道") private String name; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1") private Integer status; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostRespVO.java index d6aa60d17..807abadeb 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostRespVO.java @@ -1,21 +1,20 @@ package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import java.time.LocalDateTime; -@ApiModel("管理后台 - 岗位信息 Response VO") +@Schema(description = "管理后台 - 岗位信息 Response VO") @Data @EqualsAndHashCode(callSuper = true) public class PostRespVO extends PostBaseVO { - @ApiModelProperty(value = "岗位序号", required = true, example = "1024") + @Schema(description = "岗位序号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") + @Schema(description = "创建时间", required = true, example = "时间戳格式") private LocalDateTime createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostSimpleRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostSimpleRespVO.java index 0334a7652..eeb613b40 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostSimpleRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostSimpleRespVO.java @@ -1,21 +1,20 @@ package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; -@ApiModel("管理后台 - 岗位精简信息 Response VO") +@Schema(description = "管理后台 - 岗位精简信息 Response VO") @Data @NoArgsConstructor @AllArgsConstructor public class PostSimpleRespVO { - @ApiModelProperty(value = "岗位编号", required = true, example = "1024") + @Schema(description = "岗位编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "岗位名称", required = true, example = "芋道") + @Schema(description = "岗位名称", required = true, example = "芋道") private String name; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostUpdateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostUpdateReqVO.java index aeb91998b..e78c8160f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/vo/post/PostUpdateReqVO.java @@ -1,18 +1,17 @@ package cn.iocoder.yudao.module.system.controller.admin.dept.vo.post; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 岗位更新 Request VO") +@Schema(description = "管理后台 - 岗位更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class PostUpdateReqVO extends PostBaseVO { - @ApiModelProperty(value = "岗位编号", required = true, example = "1024") + @Schema(description = "岗位编号", required = true, example = "1024") @NotNull(message = "岗位编号不能为空") private Long id; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictDataController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictDataController.java index 124e5fd05..276587472 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictDataController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictDataController.java @@ -8,9 +8,9 @@ import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.*; import cn.iocoder.yudao.module.system.convert.dict.DictDataConvert; import cn.iocoder.yudao.module.system.service.dict.DictDataService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -24,7 +24,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; -@Api(tags = "管理后台 - 字典数据") +@Tag(name = "管理后台 - 字典数据") @RestController @RequestMapping("/system/dict-data") @Validated @@ -34,7 +34,7 @@ public class DictDataController { private DictDataService dictDataService; @PostMapping("/create") - @ApiOperation("新增字典数据") + @Operation(summary = "新增字典数据") @PreAuthorize("@ss.hasPermission('system:dict:create')") public CommonResult createDictData(@Valid @RequestBody DictDataCreateReqVO reqVO) { Long dictDataId = dictDataService.createDictData(reqVO); @@ -42,7 +42,7 @@ public class DictDataController { } @PutMapping("update") - @ApiOperation("修改字典数据") + @Operation(summary = "修改字典数据") @PreAuthorize("@ss.hasPermission('system:dict:update')") public CommonResult updateDictData(@Valid @RequestBody DictDataUpdateReqVO reqVO) { dictDataService.updateDictData(reqVO); @@ -50,8 +50,8 @@ public class DictDataController { } @DeleteMapping("/delete") - @ApiOperation("删除字典数据") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "删除字典数据") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:dict:delete')") public CommonResult deleteDictData(Long id) { dictDataService.deleteDictData(id); @@ -59,34 +59,34 @@ public class DictDataController { } @GetMapping("/list-all-simple") - @ApiOperation(value = "获得全部字典数据列表", notes = "一般用于管理后台缓存字典数据在本地") + @Operation(summary = "获得全部字典数据列表", description = "一般用于管理后台缓存字典数据在本地") // 无需添加权限认证,因为前端全局都需要 - public CommonResult> getSimpleDictDatas() { - List list = dictDataService.getDictDatas(); + public CommonResult> getSimpleDictDataList() { + List list = dictDataService.getDictDataList(); return success(DictDataConvert.INSTANCE.convertList(list)); } @GetMapping("/page") - @ApiOperation("/获得字典类型的分页列表") + @Operation(summary = "/获得字典类型的分页列表") @PreAuthorize("@ss.hasPermission('system:dict:query')") public CommonResult> getDictTypePage(@Valid DictDataPageReqVO reqVO) { return success(DictDataConvert.INSTANCE.convertPage(dictDataService.getDictDataPage(reqVO))); } @GetMapping(value = "/get") - @ApiOperation("/查询字典数据详细") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "/查询字典数据详细") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:dict:query')") public CommonResult getDictData(@RequestParam("id") Long id) { return success(DictDataConvert.INSTANCE.convert(dictDataService.getDictData(id))); } @GetMapping("/export") - @ApiOperation("导出字典数据") + @Operation(summary = "导出字典数据") @PreAuthorize("@ss.hasPermission('system:dict:export')") @OperateLog(type = EXPORT) public void export(HttpServletResponse response, @Valid DictDataExportReqVO reqVO) throws IOException { - List list = dictDataService.getDictDatas(reqVO); + List list = dictDataService.getDictDataList(reqVO); List data = DictDataConvert.INSTANCE.convertList02(list); // 输出 ExcelUtils.write(response, "字典数据.xls", "数据列表", DictDataExcelVO.class, data); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictTypeController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictTypeController.java index e7c9b8894..6fcdcdd9c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictTypeController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/DictTypeController.java @@ -8,9 +8,9 @@ import cn.iocoder.yudao.module.system.controller.admin.dict.vo.type.*; import cn.iocoder.yudao.module.system.convert.dict.DictTypeConvert; import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictTypeDO; import cn.iocoder.yudao.module.system.service.dict.DictTypeService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -24,7 +24,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; -@Api(tags = "管理后台 - 字典类型") +@Tag(name = "管理后台 - 字典类型") @RestController @RequestMapping("/system/dict-type") @Validated @@ -34,7 +34,7 @@ public class DictTypeController { private DictTypeService dictTypeService; @PostMapping("/create") - @ApiOperation("创建字典类型") + @Operation(summary = "创建字典类型") @PreAuthorize("@ss.hasPermission('system:dict:create')") public CommonResult createDictType(@Valid @RequestBody DictTypeCreateReqVO reqVO) { Long dictTypeId = dictTypeService.createDictType(reqVO); @@ -42,7 +42,7 @@ public class DictTypeController { } @PutMapping("/update") - @ApiOperation("修改字典类型") + @Operation(summary = "修改字典类型") @PreAuthorize("@ss.hasPermission('system:dict:update')") public CommonResult updateDictType(@Valid @RequestBody DictTypeUpdateReqVO reqVO) { dictTypeService.updateDictType(reqVO); @@ -50,23 +50,23 @@ public class DictTypeController { } @DeleteMapping("/delete") - @ApiOperation("删除字典类型") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "删除字典类型") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:dict:delete')") public CommonResult deleteDictType(Long id) { dictTypeService.deleteDictType(id); return success(true); } - @ApiOperation("/获得字典类型的分页列表") + @Operation(summary = "/获得字典类型的分页列表") @GetMapping("/page") @PreAuthorize("@ss.hasPermission('system:dict:query')") public CommonResult> pageDictTypes(@Valid DictTypePageReqVO reqVO) { return success(DictTypeConvert.INSTANCE.convertPage(dictTypeService.getDictTypePage(reqVO))); } - @ApiOperation("/查询字典类型详细") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "/查询字典类型详细") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @GetMapping(value = "/get") @PreAuthorize("@ss.hasPermission('system:dict:query')") public CommonResult getDictType(@RequestParam("id") Long id) { @@ -74,14 +74,14 @@ public class DictTypeController { } @GetMapping("/list-all-simple") - @ApiOperation(value = "获得全部字典类型列表", notes = "包括开启 + 禁用的字典类型,主要用于前端的下拉选项") + @Operation(summary = "获得全部字典类型列表", description = "包括开启 + 禁用的字典类型,主要用于前端的下拉选项") // 无需添加权限认证,因为前端全局都需要 - public CommonResult> listSimpleDictTypes() { + public CommonResult> getSimpleDictTypeList() { List list = dictTypeService.getDictTypeList(); return success(DictTypeConvert.INSTANCE.convertList(list)); } - @ApiOperation("导出数据类型") + @Operation(summary = "导出数据类型") @GetMapping("/export") @PreAuthorize("@ss.hasPermission('system:dict:query')") @OperateLog(type = EXPORT) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataBaseVO.java index b3e14e8b4..90b5b9fea 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -14,36 +14,36 @@ import javax.validation.constraints.Size; @Data public class DictDataBaseVO { - @ApiModelProperty(value = "显示顺序不能为空", required = true, example = "1024") + @Schema(description = "显示顺序不能为空", required = true, example = "1024") @NotNull(message = "显示顺序不能为空") private Integer sort; - @ApiModelProperty(value = "字典标签", required = true, example = "芋道") + @Schema(description = "字典标签", required = true, example = "芋道") @NotBlank(message = "字典标签不能为空") @Size(max = 100, message = "字典标签长度不能超过100个字符") private String label; - @ApiModelProperty(value = "字典值", required = true, example = "iocoder") + @Schema(description = "字典值", required = true, example = "iocoder") @NotBlank(message = "字典键值不能为空") @Size(max = 100, message = "字典键值长度不能超过100个字符") private String value; - @ApiModelProperty(value = "字典类型", required = true, example = "sys_common_sex") + @Schema(description = "字典类型", required = true, example = "sys_common_sex") @NotBlank(message = "字典类型不能为空") @Size(max = 100, message = "字典类型长度不能超过100个字符") private String dictType; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举") + @Schema(description = "状态,见 CommonStatusEnum 枚举", required = true, example = "1") @NotNull(message = "状态不能为空") // @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") private Integer status; - @ApiModelProperty(value = "颜色类型", example = "default", notes = "default、primary、success、info、warning、danger") + @Schema(description = "颜色类型,default、primary、success、info、warning、danger", example = "default") private String colorType; - @ApiModelProperty(value = "css 样式", example = "btn-visible") + @Schema(description = "css 样式", example = "btn-visible") private String cssClass; - @ApiModelProperty(value = "备注", example = "我是一个角色") + @Schema(description = "备注", example = "我是一个角色") private String remark; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataCreateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataCreateReqVO.java index 57dc770d0..6f225eba4 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataCreateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataCreateReqVO.java @@ -1,10 +1,10 @@ package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; -@ApiModel("管理后台 - 字典数据创建 Request VO") +@Schema(description = "管理后台 - 字典数据创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class DictDataCreateReqVO extends DictDataBaseVO { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataExportReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataExportReqVO.java index 90290cbdb..60e91db19 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataExportReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataExportReqVO.java @@ -1,24 +1,23 @@ package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.Size; -@ApiModel("管理后台 - 字典类型导出 Request VO") +@Schema(description = "管理后台 - 字典类型导出 Request VO") @Data public class DictDataExportReqVO { - @ApiModelProperty(value = "字典标签", example = "芋道") + @Schema(description = "字典标签", example = "芋道") @Size(max = 100, message = "字典标签长度不能超过100个字符") private String label; - @ApiModelProperty(value = "字典类型", example = "sys_common_sex", notes = "模糊匹配") + @Schema(description = "字典类型,模糊匹配", example = "sys_common_sex") @Size(max = 100, message = "字典类型类型长度不能超过100个字符") private String dictType; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1") private Integer status; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataPageReqVO.java index 9df4605df..bceec1600 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataPageReqVO.java @@ -1,27 +1,26 @@ package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import javax.validation.constraints.Size; -@ApiModel("管理后台 - 字典类型分页列表 Request VO") +@Schema(description = "管理后台 - 字典类型分页列表 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class DictDataPageReqVO extends PageParam { - @ApiModelProperty(value = "字典标签", example = "芋道") + @Schema(description = "字典标签", example = "芋道") @Size(max = 100, message = "字典标签长度不能超过100个字符") private String label; - @ApiModelProperty(value = "字典类型", example = "sys_common_sex", notes = "模糊匹配") + @Schema(description = "字典类型,模糊匹配", example = "sys_common_sex") @Size(max = 100, message = "字典类型类型长度不能超过100个字符") private String dictType; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1") private Integer status; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataRespVO.java index 3cf1177d1..b3afef470 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; @@ -9,17 +8,17 @@ import lombok.NoArgsConstructor; import java.time.LocalDateTime; -@ApiModel("管理后台 - 字典数据信息 Response VO") +@Schema(description = "管理后台 - 字典数据信息 Response VO") @Data @NoArgsConstructor @AllArgsConstructor @EqualsAndHashCode(callSuper = true) public class DictDataRespVO extends DictDataBaseVO { - @ApiModelProperty(value = "字典数据编号", required = true, example = "1024") + @Schema(description = "字典数据编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") + @Schema(description = "创建时间", required = true, example = "时间戳格式") private LocalDateTime createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataSimpleRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataSimpleRespVO.java index 4ea0c5f9b..31256e68d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataSimpleRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataSimpleRespVO.java @@ -1,25 +1,24 @@ package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@ApiModel("管理后台 - 数据字典精简 Response VO") +@Schema(description = "管理后台 - 数据字典精简 Response VO") @Data public class DictDataSimpleRespVO { - @ApiModelProperty(value = "字典类型", required = true, example = "gender") + @Schema(description = "字典类型", required = true, example = "gender") private String dictType; - @ApiModelProperty(value = "字典键值", required = true, example = "1") + @Schema(description = "字典键值", required = true, example = "1") private String value; - @ApiModelProperty(value = "字典标签", required = true, example = "男") + @Schema(description = "字典标签", required = true, example = "男") private String label; - @ApiModelProperty(value = "颜色类型", example = "default", notes = "default、primary、success、info、warning、danger") + @Schema(description = "颜色类型,default、primary、success、info、warning、danger", example = "default") private String colorType; - @ApiModelProperty(value = "css 样式", example = "btn-visible") + @Schema(description = "css 样式", example = "btn-visible") private String cssClass; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataUpdateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataUpdateReqVO.java index f6f9b81a2..ddbe8d734 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/data/DictDataUpdateReqVO.java @@ -1,18 +1,17 @@ package cn.iocoder.yudao.module.system.controller.admin.dict.vo.data; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 字典数据更新 Request VO") +@Schema(description = "管理后台 - 字典数据更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class DictDataUpdateReqVO extends DictDataBaseVO { - @ApiModelProperty(value = "字典数据编号", required = true, example = "1024") + @Schema(description = "字典数据编号", required = true, example = "1024") @NotNull(message = "字典数据编号不能为空") private Long id; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeBaseVO.java index 4da6da0b3..876eb8842 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -14,16 +14,16 @@ import javax.validation.constraints.Size; @Data public class DictTypeBaseVO { - @ApiModelProperty(value = "字典名称", required = true, example = "性别") + @Schema(description = "字典名称", required = true, example = "性别") @NotBlank(message = "字典名称不能为空") @Size(max = 100, message = "字典类型名称长度不能超过100个字符") private String name; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "状态,参见 CommonStatusEnum 枚举类", required = true, example = "1") @NotNull(message = "状态不能为空") private Integer status; - @ApiModelProperty(value = "备注", example = "快乐的备注") + @Schema(description = "备注", example = "快乐的备注") private String remark; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeCreateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeCreateReqVO.java index ee2f45ae1..fc91e9197 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeCreateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeCreateReqVO.java @@ -1,19 +1,18 @@ package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; -@ApiModel("管理后台 - 字典类型创建 Request VO") +@Schema(description = "管理后台 - 字典类型创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class DictTypeCreateReqVO extends DictTypeBaseVO { - @ApiModelProperty(value = "字典类型", required = true, example = "sys_common_sex") + @Schema(description = "字典类型", required = true, example = "sys_common_sex") @NotNull(message = "字典类型不能为空") @Size(max = 100, message = "字典类型类型长度不能超过100个字符") private String type; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeExportReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeExportReqVO.java index 4a54fb3fc..b7d227ea3 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeExportReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeExportReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -9,21 +8,21 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 字典类型分页列表 Request VO") +@Schema(description = "管理后台 - 字典类型分页列表 Request VO") @Data public class DictTypeExportReqVO { - @ApiModelProperty(value = "字典类型名称", example = "芋道", notes = "模糊匹配") + @Schema(description = "字典类型名称,模糊匹配", example = "芋道") private String name; - @ApiModelProperty(value = "字典类型", example = "sys_common_sex", notes = "模糊匹配") + @Schema(description = "字典类型,模糊匹配", example = "sys_common_sex") private String type; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1") private Integer status; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypePageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypePageReqVO.java index f32886196..336836f89 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypePageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypePageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springframework.format.annotation.DateTimeFormat; @@ -12,23 +11,23 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 字典类型分页列表 Request VO") +@Schema(description = "管理后台 - 字典类型分页列表 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class DictTypePageReqVO extends PageParam { - @ApiModelProperty(value = "字典类型名称", example = "芋道", notes = "模糊匹配") + @Schema(description = "字典类型名称,模糊匹配", example = "芋道") private String name; - @ApiModelProperty(value = "字典类型", example = "sys_common_sex", notes = "模糊匹配") + @Schema(description = "字典类型,模糊匹配", example = "sys_common_sex") @Size(max = 100, message = "字典类型类型长度不能超过100个字符") private String type; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1") private Integer status; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeRespVO.java index c508df6af..06aeb469b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; @@ -9,20 +8,20 @@ import lombok.NoArgsConstructor; import java.time.LocalDateTime; -@ApiModel("管理后台 - 字典类型信息 Response VO") +@Schema(description = "管理后台 - 字典类型信息 Response VO") @Data @NoArgsConstructor @AllArgsConstructor @EqualsAndHashCode(callSuper = true) public class DictTypeRespVO extends DictTypeBaseVO { - @ApiModelProperty(value = "字典类型编号", required = true, example = "1024") + @Schema(description = "字典类型编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "字典类型", required = true, example = "sys_common_sex") + @Schema(description = "字典类型", required = true, example = "sys_common_sex") private String type; - @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") + @Schema(description = "创建时间", required = true, example = "时间戳格式") private LocalDateTime createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeSimpleRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeSimpleRespVO.java index 8cca026a9..61ca6a7c9 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeSimpleRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeSimpleRespVO.java @@ -1,24 +1,23 @@ package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; -@ApiModel("管理后台 - 字典类型精简信息 Response VO") +@Schema(description = "管理后台 - 字典类型精简信息 Response VO") @Data @NoArgsConstructor @AllArgsConstructor public class DictTypeSimpleRespVO { - @ApiModelProperty(value = "字典类型编号", required = true, example = "1024") + @Schema(description = "字典类型编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "字典类型名称", required = true, example = "芋道") + @Schema(description = "字典类型名称", required = true, example = "芋道") private String name; - @ApiModelProperty(value = "字典类型", required = true, example = "sys_common_sex") + @Schema(description = "字典类型", required = true, example = "sys_common_sex") private String type; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeUpdateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeUpdateReqVO.java index 00955f4fe..0a3120770 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dict/vo/type/DictTypeUpdateReqVO.java @@ -1,18 +1,17 @@ package cn.iocoder.yudao.module.system.controller.admin.dict.vo.type; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 字典类型更新 Request VO") +@Schema(description = "管理后台 - 字典类型更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class DictTypeUpdateReqVO extends DictTypeBaseVO { - @ApiModelProperty(value = "字典类型编号", required = true, example = "1024") + @Schema(description = "字典类型编号", required = true, example = "1024") @NotNull(message = "字典类型编号不能为空") private Long id; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/ErrorCodeController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/ErrorCodeController.java index e3161b8aa..90879472b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/ErrorCodeController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/ErrorCodeController.java @@ -8,9 +8,9 @@ import cn.iocoder.yudao.module.system.convert.errorcode.ErrorCodeConvert; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.*; import cn.iocoder.yudao.module.system.dal.dataobject.errorcode.ErrorCodeDO; import cn.iocoder.yudao.module.system.service.errorcode.ErrorCodeService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -24,7 +24,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; -@Api(tags = "管理后台 - 错误码") +@Tag(name = "管理后台 - 错误码") @RestController @RequestMapping("/system/error-code") @Validated @@ -34,14 +34,14 @@ public class ErrorCodeController { private ErrorCodeService errorCodeService; @PostMapping("/create") - @ApiOperation("创建错误码") + @Operation(summary = "创建错误码") @PreAuthorize("@ss.hasPermission('system:error-code:create')") public CommonResult createErrorCode(@Valid @RequestBody ErrorCodeCreateReqVO createReqVO) { return success(errorCodeService.createErrorCode(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新错误码") + @Operation(summary = "更新错误码") @PreAuthorize("@ss.hasPermission('system:error-code:update')") public CommonResult updateErrorCode(@Valid @RequestBody ErrorCodeUpdateReqVO updateReqVO) { errorCodeService.updateErrorCode(updateReqVO); @@ -49,8 +49,8 @@ public class ErrorCodeController { } @DeleteMapping("/delete") - @ApiOperation("删除错误码") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除错误码") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('system:error-code:delete')") public CommonResult deleteErrorCode(@RequestParam("id") Long id) { errorCodeService.deleteErrorCode(id); @@ -58,8 +58,8 @@ public class ErrorCodeController { } @GetMapping("/get") - @ApiOperation("获得错误码") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得错误码") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:error-code:query')") public CommonResult getErrorCode(@RequestParam("id") Long id) { ErrorCodeDO errorCode = errorCodeService.getErrorCode(id); @@ -67,7 +67,7 @@ public class ErrorCodeController { } @GetMapping("/page") - @ApiOperation("获得错误码分页") + @Operation(summary = "获得错误码分页") @PreAuthorize("@ss.hasPermission('system:error-code:query')") public CommonResult> getErrorCodePage(@Valid ErrorCodePageReqVO pageVO) { PageResult pageResult = errorCodeService.getErrorCodePage(pageVO); @@ -75,7 +75,7 @@ public class ErrorCodeController { } @GetMapping("/export-excel") - @ApiOperation("导出错误码 Excel") + @Operation(summary = "导出错误码 Excel") @PreAuthorize("@ss.hasPermission('system:error-code:export')") @OperateLog(type = EXPORT) public void exportErrorCodeExcel(@Valid ErrorCodeExportReqVO exportReqVO, diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeBaseVO.java index 150401aa3..6425e106c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.errorcode.vo; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; @@ -12,19 +12,19 @@ import javax.validation.constraints.NotNull; @Data public class ErrorCodeBaseVO { - @ApiModelProperty(value = "应用名", required = true, example = "dashboard") + @Schema(description = "应用名", required = true, example = "dashboard") @NotNull(message = "应用名不能为空") private String applicationName; - @ApiModelProperty(value = "错误码编码", required = true, example = "1234") + @Schema(description = "错误码编码", required = true, example = "1234") @NotNull(message = "错误码编码不能为空") private Integer code; - @ApiModelProperty(value = "错误码错误提示", required = true, example = "帅气") + @Schema(description = "错误码错误提示", required = true, example = "帅气") @NotNull(message = "错误码错误提示不能为空") private String message; - @ApiModelProperty(value = "备注", example = "哈哈哈") + @Schema(description = "备注", example = "哈哈哈") private String memo; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeCreateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeCreateReqVO.java index a0f36af1a..0f859dbd9 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeCreateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeCreateReqVO.java @@ -1,11 +1,11 @@ package cn.iocoder.yudao.module.system.controller.admin.errorcode.vo; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 错误码创建 Request VO") +@Schema(description = "管理后台 - 错误码创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeExportReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeExportReqVO.java index e44858160..cb2488ee8 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeExportReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeExportReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.errorcode.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -9,24 +8,24 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel(value = "管理后台 - 错误码 Excel 导出 Request VO", description = "参数和 InfErrorCodePageReqVO 是一致的") +@Schema(description = "管理后台 - 错误码 Excel 导出 Request VO,参数和 InfErrorCodePageReqVO 是一致的") @Data public class ErrorCodeExportReqVO { - @ApiModelProperty(value = "错误码类型", example = "1") + @Schema(description = "错误码类型", example = "1") private Integer type; - @ApiModelProperty(value = "应用名", example = "dashboard") + @Schema(description = "应用名", example = "dashboard") private String applicationName; - @ApiModelProperty(value = "错误码编码", example = "1234") + @Schema(description = "错误码编码", example = "1234") private Integer code; - @ApiModelProperty(value = "错误码错误提示", example = "帅气") + @Schema(description = "错误码错误提示", example = "帅气") private String message; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodePageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodePageReqVO.java index 8c719006c..8e5bbdb07 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodePageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodePageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.errorcode.vo; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,26 +11,26 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 错误码分页 Request VO") +@Schema(description = "管理后台 - 错误码分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ErrorCodePageReqVO extends PageParam { - @ApiModelProperty(value = "错误码类型", example = "1", notes = "参见 ErrorCodeTypeEnum 枚举类") + @Schema(description = "错误码类型,参见 ErrorCodeTypeEnum 枚举类", example = "1") private Integer type; - @ApiModelProperty(value = "应用名", example = "dashboard") + @Schema(description = "应用名", example = "dashboard") private String applicationName; - @ApiModelProperty(value = "错误码编码", example = "1234") + @Schema(description = "错误码编码", example = "1234") private Integer code; - @ApiModelProperty(value = "错误码错误提示", example = "帅气") + @Schema(description = "错误码错误提示", example = "帅气") private String message; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeRespVO.java index 47276517c..9fe447f90 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeRespVO.java @@ -1,26 +1,25 @@ package cn.iocoder.yudao.module.system.controller.admin.errorcode.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 错误码 Response VO") +@Schema(description = "管理后台 - 错误码 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ErrorCodeRespVO extends ErrorCodeBaseVO { - @ApiModelProperty(value = "错误码编号", required = true, example = "1024") + @Schema(description = "错误码编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "错误码类型", required = true, example = "1", notes = "参见 ErrorCodeTypeEnum 枚举类") + @Schema(description = "错误码类型,参见 ErrorCodeTypeEnum 枚举类", required = true, example = "1") private Integer type; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeUpdateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeUpdateReqVO.java index ff16c0283..64622acd2 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/errorcode/vo/ErrorCodeUpdateReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.system.controller.admin.errorcode.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 错误码更新 Request VO") +@Schema(description = "管理后台 - 错误码更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class ErrorCodeUpdateReqVO extends ErrorCodeBaseVO { - @ApiModelProperty(value = "错误码编号", required = true, example = "1024") + @Schema(description = "错误码编号", required = true, example = "1024") @NotNull(message = "错误码编号不能为空") private Long id; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/ip/AreaController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/ip/AreaController.java index a7e4d3e03..2d5c766fd 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/ip/AreaController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/ip/AreaController.java @@ -7,9 +7,9 @@ import cn.iocoder.yudao.framework.ip.core.utils.AreaUtils; import cn.iocoder.yudao.framework.ip.core.utils.IPUtils; import cn.iocoder.yudao.module.system.controller.admin.ip.vo.AreaNodeRespVO; import cn.iocoder.yudao.module.system.convert.ip.AreaConvert; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -20,14 +20,14 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 地区") +@Tag(name = "管理后台 - 地区") @RestController @RequestMapping("/system/area") @Validated public class AreaController { @GetMapping("/tree") - @ApiOperation("获得地区树") + @Operation(summary = "获得地区树") public CommonResult> getAreaTree() { Area area = AreaUtils.getArea(Area.ID_CHINA); Assert.notNull(area, "获取不到中国"); @@ -35,8 +35,8 @@ public class AreaController { } @GetMapping("/get-by-ip") - @ApiOperation("获得 IP 对应的地区名") - @ApiImplicitParam(name = "ip", value = "IP", required = true, dataTypeClass = String.class) + @Operation(summary = "获得 IP 对应的地区名") + @Parameter(name = "ip", description = "IP", required = true) public CommonResult getAreaByIp(@RequestParam("ip") String ip) { // 获得城市 Area area = IPUtils.getArea(ip); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/ip/vo/AreaNodeRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/ip/vo/AreaNodeRespVO.java index a2416832d..614b84fe0 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/ip/vo/AreaNodeRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/ip/vo/AreaNodeRespVO.java @@ -1,19 +1,18 @@ package cn.iocoder.yudao.module.system.controller.admin.ip.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.List; -@ApiModel("管理后台 - 地区节点 Response VO") +@Schema(description = "管理后台 - 地区节点 Response VO") @Data public class AreaNodeRespVO { - @ApiModelProperty(value = "编号", required = true, example = "110000") + @Schema(description = "编号", required = true, example = "110000") private Integer id; - @ApiModelProperty(value = "名字", required = true, example = "北京") + @Schema(description = "名字", required = true, example = "北京") private String name; /** diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/LoginLogController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/LoginLogController.java index 7cb3ac4b7..f5262697a 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/LoginLogController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/LoginLogController.java @@ -11,8 +11,8 @@ import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginL import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogRespVO; import cn.iocoder.yudao.module.system.convert.logger.LoginLogConvert; import cn.iocoder.yudao.module.system.service.logger.LoginLogService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; @@ -27,7 +27,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; -@Api(tags = "管理后台 - 登录日志") +@Tag(name = "管理后台 - 登录日志") @RestController @RequestMapping("/system/login-log") @Validated @@ -37,7 +37,7 @@ public class LoginLogController { private LoginLogService loginLogService; @GetMapping("/page") - @ApiOperation("获得登录日志分页列表") + @Operation(summary = "获得登录日志分页列表") @PreAuthorize("@ss.hasPermission('system:login-log:query')") public CommonResult> getLoginLogPage(@Valid LoginLogPageReqVO reqVO) { PageResult page = loginLogService.getLoginLogPage(reqVO); @@ -45,7 +45,7 @@ public class LoginLogController { } @GetMapping("/export") - @ApiOperation("导出登录日志 Excel") + @Operation(summary = "导出登录日志 Excel") @PreAuthorize("@ss.hasPermission('system:login-log:export')") @OperateLog(type = EXPORT) public void exportLoginLog(HttpServletResponse response, @Valid LoginLogExportReqVO reqVO) throws IOException { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/OperateLogController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/OperateLogController.java index d23477eb8..fc035f471 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/OperateLogController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/OperateLogController.java @@ -15,8 +15,8 @@ import cn.iocoder.yudao.framework.common.util.collection.MapUtils; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; import cn.iocoder.yudao.module.system.service.user.AdminUserService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; @@ -35,7 +35,7 @@ import java.util.Map; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; -@Api(tags = "管理后台 - 操作日志") +@Tag(name = "管理后台 - 操作日志") @RestController @RequestMapping("/system/operate-log") @Validated @@ -47,7 +47,7 @@ public class OperateLogController { private AdminUserService userService; @GetMapping("/page") - @ApiOperation("查看操作日志分页列表") + @Operation(summary = "查看操作日志分页列表") @PreAuthorize("@ss.hasPermission('system:operate-log:query')") public CommonResult> pageOperateLog(@Valid OperateLogPageReqVO reqVO) { PageResult pageResult = operateLogService.getOperateLogPage(reqVO); @@ -66,12 +66,12 @@ public class OperateLogController { return success(new PageResult<>(list, pageResult.getTotal())); } - @ApiOperation("导出操作日志") + @Operation(summary = "导出操作日志") @GetMapping("/export") @PreAuthorize("@ss.hasPermission('system:operate-log:export')") @OperateLog(type = EXPORT) public void exportOperateLog(HttpServletResponse response, @Valid OperateLogExportReqVO reqVO) throws IOException { - List list = operateLogService.getOperateLogs(reqVO); + List list = operateLogService.getOperateLogList(reqVO); // 获得拼接需要的数据 Collection userIds = CollectionUtils.convertList(list, OperateLogDO::getUserId); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogBaseVO.java index 4b5cc22bf..d5769c597 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -15,28 +15,28 @@ import javax.validation.constraints.Size; @Data public class LoginLogBaseVO { - @ApiModelProperty(value = "日志类型", required = true, example = "1", notes = "参见 LoginLogTypeEnum 枚举类") + @Schema(description = "日志类型,参见 LoginLogTypeEnum 枚举类", required = true, example = "1") @NotNull(message = "日志类型不能为空") private Integer logType; - @ApiModelProperty(value = "链路追踪编号", example = "89aca178-a370-411c-ae02-3f0d672be4ab") + @Schema(description = "链路追踪编号", example = "89aca178-a370-411c-ae02-3f0d672be4ab") @NotEmpty(message = "链路追踪编号不能为空") private String traceId; - @ApiModelProperty(value = "用户账号", required = true, example = "yudao") + @Schema(description = "用户账号", required = true, example = "yudao") @NotBlank(message = "用户账号不能为空") @Size(max = 30, message = "用户账号长度不能超过30个字符") private String username; - @ApiModelProperty(value = "登录结果", required = true, example = "1", notes = "参见 LoginResultEnum 枚举类") + @Schema(description = "登录结果,参见 LoginResultEnum 枚举类", required = true, example = "1") @NotNull(message = "登录结果不能为空") private Integer result; - @ApiModelProperty(value = "用户 IP", required = true, example = "127.0.0.1") + @Schema(description = "用户 IP", required = true, example = "127.0.0.1") @NotEmpty(message = "用户 IP 不能为空") private String userIp; - @ApiModelProperty(value = "浏览器 UserAgent", example = "Mozilla/5.0") + @Schema(description = "浏览器 UserAgent", example = "Mozilla/5.0") private String userAgent; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogExportReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogExportReqVO.java index 50f36edb3..a62d9da23 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogExportReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogExportReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -9,20 +8,20 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 登录日志分页列表 Request VO") +@Schema(description = "管理后台 - 登录日志分页列表 Request VO") @Data public class LoginLogExportReqVO { - @ApiModelProperty(value = "用户 IP", example = "127.0.0.1", notes = "模拟匹配") + @Schema(description = "用户 IP,模拟匹配", example = "127.0.0.1") private String userIp; - @ApiModelProperty(value = "用户账号", example = "芋道", notes = "模拟匹配") + @Schema(description = "用户账号,模拟匹配", example = "芋道") private String username; - @ApiModelProperty(value = "操作状态", example = "true") + @Schema(description = "操作状态", example = "true") private Boolean status; - @ApiModelProperty(value = "登录时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") + @Schema(description = "登录时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogPageReqVO.java index 51ed062e8..73f6d38a7 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogPageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springframework.format.annotation.DateTimeFormat; @@ -11,21 +10,21 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 登录日志分页列表 Request VO") +@Schema(description = "管理后台 - 登录日志分页列表 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class LoginLogPageReqVO extends PageParam { - @ApiModelProperty(value = "用户 IP", example = "127.0.0.1", notes = "模拟匹配") + @Schema(description = "用户 IP,模拟匹配", example = "127.0.0.1") private String userIp; - @ApiModelProperty(value = "用户账号", example = "芋道", notes = "模拟匹配") + @Schema(description = "用户账号,模拟匹配", example = "芋道") private String username; - @ApiModelProperty(value = "操作状态", example = "true") + @Schema(description = "操作状态", example = "true") private Boolean status; - @ApiModelProperty(value = "登录时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") + @Schema(description = "登录时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogRespVO.java index 4eb121c02..a67d871ea 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/loginlog/LoginLogRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -9,23 +8,23 @@ import lombok.ToString; import javax.validation.constraints.NotNull; import java.time.LocalDateTime; -@ApiModel("管理后台 - 登录日志 Response VO") +@Schema(description = "管理后台 - 登录日志 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class LoginLogRespVO extends LoginLogBaseVO { - @ApiModelProperty(value = "日志编号", required = true, example = "1024") + @Schema(description = "日志编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "用户编号", example = "666") + @Schema(description = "用户编号", example = "666") private Long userId; - @ApiModelProperty(value = "用户类型", required = true, example = "2", notes = "参见 UserTypeEnum 枚举") + @Schema(description = "用户类型,参见 UserTypeEnum 枚举", required = true, example = "2") @NotNull(message = "用户类型不能为空") private Integer userType; - @ApiModelProperty(value = "登录时间", required = true) + @Schema(description = "登录时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogBaseVO.java index abaf41247..e3187b0d5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; @@ -15,71 +15,71 @@ import java.util.Map; @Data public class OperateLogBaseVO { - @ApiModelProperty(value = "链路追踪编号", required = true, example = "89aca178-a370-411c-ae02-3f0d672be4ab") + @Schema(description = "链路追踪编号", required = true, example = "89aca178-a370-411c-ae02-3f0d672be4ab") @NotEmpty(message = "链路追踪编号不能为空") private String traceId; - @ApiModelProperty(value = "用户编号", required = true, example = "1024") + @Schema(description = "用户编号", required = true, example = "1024") @NotNull(message = "用户编号不能为空") private Long userId; - @ApiModelProperty(value = "操作模块", required = true, example = "订单") + @Schema(description = "操作模块", required = true, example = "订单") @NotEmpty(message = "操作模块不能为空") private String module; - @ApiModelProperty(value = "操作名", required = true, example = "创建订单") + @Schema(description = "操作名", required = true, example = "创建订单") @NotEmpty(message = "操作名") private String name; - @ApiModelProperty(value = "操作分类", required = true, example = "1", notes = "参见 OperateLogTypeEnum 枚举类") + @Schema(description = "操作分类,参见 OperateLogTypeEnum 枚举类", required = true, example = "1") @NotNull(message = "操作分类不能为空") private Integer type; - @ApiModelProperty(value = "操作明细", example = "修改编号为 1 的用户信息,将性别从男改成女,将姓名从芋道改成源码。") + @Schema(description = "操作明细", example = "修改编号为 1 的用户信息,将性别从男改成女,将姓名从芋道改成源码。") private String content; - @ApiModelProperty(value = "拓展字段", example = "{'orderId': 1}") + @Schema(description = "拓展字段", example = "{'orderId': 1}") private Map exts; - @ApiModelProperty(value = "请求方法名", required = true, example = "GET") + @Schema(description = "请求方法名", required = true, example = "GET") @NotEmpty(message = "请求方法名不能为空") private String requestMethod; - @ApiModelProperty(value = "请求地址", required = true, example = "/xxx/yyy") + @Schema(description = "请求地址", required = true, example = "/xxx/yyy") @NotEmpty(message = "请求地址不能为空") private String requestUrl; - @ApiModelProperty(value = "用户 IP", required = true, example = "127.0.0.1") + @Schema(description = "用户 IP", required = true, example = "127.0.0.1") @NotEmpty(message = "用户 IP 不能为空") private String userIp; - @ApiModelProperty(value = "浏览器 UserAgent", required = true, example = "Mozilla/5.0") + @Schema(description = "浏览器 UserAgent", required = true, example = "Mozilla/5.0") @NotEmpty(message = "浏览器 UserAgent 不能为空") private String userAgent; - @ApiModelProperty(value = "Java 方法名", required = true, example = "cn.iocoder.yudao.adminserver.UserController.save(...)") + @Schema(description = "Java 方法名", required = true, example = "cn.iocoder.yudao.adminserver.UserController.save(...)") @NotEmpty(message = "Java 方法名不能为空") private String javaMethod; - @ApiModelProperty(value = "Java 方法的参数") + @Schema(description = "Java 方法的参数") private String javaMethodArgs; - @ApiModelProperty(value = "开始时间", required = true) + @Schema(description = "开始时间", required = true) @NotNull(message = "开始时间不能为空") private LocalDateTime startTime; - @ApiModelProperty(value = "执行时长,单位:毫秒", required = true) + @Schema(description = "执行时长,单位:毫秒", required = true) @NotNull(message = "执行时长不能为空") private Integer duration; - @ApiModelProperty(value = "结果码", required = true) + @Schema(description = "结果码", required = true) @NotNull(message = "结果码不能为空") private Integer resultCode; - @ApiModelProperty(value = "结果提示") + @Schema(description = "结果提示") private String resultMsg; - @ApiModelProperty(value = "结果数据") + @Schema(description = "结果数据") private String resultData; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogExportReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogExportReqVO.java index 254681250..c12aca80e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogExportReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogExportReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -9,23 +8,23 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 操作日志分页列表 Request VO") +@Schema(description = "管理后台 - 操作日志分页列表 Request VO") @Data public class OperateLogExportReqVO { - @ApiModelProperty(value = "操作模块", example = "订单", notes = "模拟匹配") + @Schema(description = "操作模块,模拟匹配", example = "订单") private String module; - @ApiModelProperty(value = "用户昵称", example = "芋道", notes = "模拟匹配") + @Schema(description = "用户昵称,模拟匹配", example = "芋道") private String userNickname; - @ApiModelProperty(value = "操作分类", example = "1", notes = "参见 OperateLogTypeEnum 枚举类") + @Schema(description = "操作分类,参见 OperateLogTypeEnum 枚举类", example = "1") private Integer type; - @ApiModelProperty(value = "操作状态", example = "true") + @Schema(description = "操作状态", example = "true") private Boolean success; - @ApiModelProperty(value = "开始时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") + @Schema(description = "开始时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] startTime; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogPageReqVO.java index 9fa6fed66..13a23ac02 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogPageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -10,23 +9,23 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 操作日志分页列表 Request VO") +@Schema(description = "管理后台 - 操作日志分页列表 Request VO") @Data public class OperateLogPageReqVO extends PageParam { - @ApiModelProperty(value = "操作模块", example = "订单", notes = "模拟匹配") + @Schema(description = "操作模块,模拟匹配", example = "订单") private String module; - @ApiModelProperty(value = "用户昵称", example = "芋道", notes = "模拟匹配") + @Schema(description = "用户昵称,模拟匹配", example = "芋道") private String userNickname; - @ApiModelProperty(value = "操作分类", example = "1", notes = "参见 OperateLogTypeEnum 枚举类") + @Schema(description = "操作分类,参见 OperateLogTypeEnum 枚举类", example = "1") private Integer type; - @ApiModelProperty(value = "操作状态", example = "true") + @Schema(description = "操作状态", example = "true") private Boolean success; - @ApiModelProperty(value = "开始时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") + @Schema(description = "开始时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] startTime; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogRespVO.java index 445b40060..1e88408ff 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/logger/vo/operatelog/OperateLogRespVO.java @@ -1,21 +1,20 @@ package cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 操作日志 Response VO") +@Schema(description = "管理后台 - 操作日志 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class OperateLogRespVO extends OperateLogBaseVO { - @ApiModelProperty(value = "日志编号", required = true, example = "1024") + @Schema(description = "日志编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "用户昵称", required = true, example = "芋艿") + @Schema(description = "用户昵称", required = true, example = "芋艿") private String userNickname; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailAccountController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailAccountController.java index e2271ceb0..718e4b4fb 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailAccountController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailAccountController.java @@ -7,20 +7,19 @@ import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.*; import cn.iocoder.yudao.module.system.convert.mail.MailAccountConvert; import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; import cn.iocoder.yudao.module.system.service.mail.MailAccountService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.validation.Valid; -import java.util.Comparator; import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 邮箱账号") +@Tag(name = "管理后台 - 邮箱账号") @RestController @RequestMapping("/system/mail-account") public class MailAccountController { @@ -29,14 +28,14 @@ public class MailAccountController { private MailAccountService mailAccountService; @PostMapping("/create") - @ApiOperation("创建邮箱账号") + @Operation(summary = "创建邮箱账号") @PreAuthorize("@ss.hasPermission('system:mail-account:create')") public CommonResult createMailAccount(@Valid @RequestBody MailAccountCreateReqVO createReqVO) { return success(mailAccountService.createMailAccount(createReqVO)); } @PutMapping("/update") - @ApiOperation("修改邮箱账号") + @Operation(summary = "修改邮箱账号") @PreAuthorize("@ss.hasPermission('system:mail-account:update')") public CommonResult updateMailAccount(@Valid @RequestBody MailAccountUpdateReqVO updateReqVO) { mailAccountService.updateMailAccount(updateReqVO); @@ -44,8 +43,8 @@ public class MailAccountController { } @DeleteMapping("/delete") - @ApiOperation("删除邮箱账号") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除邮箱账号") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('system:mail-account:delete')") public CommonResult deleteMailAccount(@RequestParam Long id) { mailAccountService.deleteMailAccount(id); @@ -53,8 +52,8 @@ public class MailAccountController { } @GetMapping("/get") - @ApiOperation("获得邮箱账号") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得邮箱账号") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:mail-account:get')") public CommonResult getMailAccount(@RequestParam("id") Long id) { MailAccountDO mailAccountDO = mailAccountService.getMailAccount(id); @@ -62,7 +61,7 @@ public class MailAccountController { } @GetMapping("/page") - @ApiOperation("获得邮箱账号分页") + @Operation(summary = "获得邮箱账号分页") @PreAuthorize("@ss.hasPermission('system:mail-account:query')") public CommonResult> getMailAccountPage(@Valid MailAccountPageReqVO pageReqVO) { PageResult pageResult = mailAccountService.getMailAccountPage(pageReqVO); @@ -70,7 +69,7 @@ public class MailAccountController { } @GetMapping("/list-all-simple") - @ApiOperation(value = "获得邮箱账号精简列表") + @Operation(summary = "获得邮箱账号精简列表") public CommonResult> getSimpleMailAccountList() { List list = mailAccountService.getMailAccountList(); return success(MailAccountConvert.INSTANCE.convertList02(list)); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailLogController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailLogController.java index 2252c8789..1347f6ac6 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailLogController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailLogController.java @@ -1,19 +1,15 @@ package cn.iocoder.yudao.module.system.controller.admin.mail; - import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.system.controller.admin.mail.vo.log.MailLogPageReqVO; import cn.iocoder.yudao.module.system.controller.admin.mail.vo.log.MailLogRespVO; -import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.MailTemplateRespVO; import cn.iocoder.yudao.module.system.convert.mail.MailLogConvert; -import cn.iocoder.yudao.module.system.convert.mail.MailTemplateConvert; import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailLogDO; -import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; import cn.iocoder.yudao.module.system.service.mail.MailLogService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -25,8 +21,7 @@ import javax.validation.Valid; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; - -@Api(tags = "管理后台 - 邮件日志") +@Tag(name = "管理后台 - 邮件日志") @RestController @RequestMapping("/system/mail-log") public class MailLogController { @@ -35,7 +30,7 @@ public class MailLogController { private MailLogService mailLogService; @GetMapping("/page") - @ApiOperation("获得邮箱日志分页") + @Operation(summary = "获得邮箱日志分页") @PreAuthorize("@ss.hasPermission('system:mail-log:query')") public CommonResult> getMailLogPage(@Valid MailLogPageReqVO pageVO) { PageResult pageResult = mailLogService.getMailLogPage(pageVO); @@ -43,8 +38,8 @@ public class MailLogController { } @GetMapping("/get") - @ApiOperation("获得邮箱日志") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得邮箱日志") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:mail-log:query')") public CommonResult getMailTemplate(@RequestParam("id") Long id) { MailLogDO mailLogDO = mailLogService.getMailLog(id); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailTemplateController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailTemplateController.java index e98b4f084..87b338815 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailTemplateController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailTemplateController.java @@ -3,14 +3,13 @@ package cn.iocoder.yudao.module.system.controller.admin.mail; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.*; -import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateSendReqVO; import cn.iocoder.yudao.module.system.convert.mail.MailTemplateConvert; import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; import cn.iocoder.yudao.module.system.service.mail.MailSendService; import cn.iocoder.yudao.module.system.service.mail.MailTemplateService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; @@ -20,7 +19,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 邮件模版") +@Tag(name = "管理后台 - 邮件模版") @RestController @RequestMapping("/system/mail-template") public class MailTemplateController { @@ -31,14 +30,14 @@ public class MailTemplateController { private MailSendService mailSendService; @PostMapping("/create") - @ApiOperation("创建邮件模版") + @Operation(summary = "创建邮件模版") @PreAuthorize("@ss.hasPermission('system:mail-template:create')") public CommonResult createMailTemplate(@Valid @RequestBody MailTemplateCreateReqVO createReqVO){ return success(mailTempleService.createMailTemplate(createReqVO)); } @PutMapping("/update") - @ApiOperation("修改邮件模版") + @Operation(summary = "修改邮件模版") @PreAuthorize("@ss.hasPermission('system:mail-template:update')") public CommonResult updateMailTemplate(@Valid @RequestBody MailTemplateUpdateReqVO updateReqVO){ mailTempleService.updateMailTemplate(updateReqVO); @@ -46,8 +45,8 @@ public class MailTemplateController { } @DeleteMapping("/delete") - @ApiOperation("删除邮件模版") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "删除邮件模版") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:mail-template:delete')") public CommonResult deleteMailTemplate(@RequestParam("id") Long id) { mailTempleService.deleteMailTemplate(id); @@ -55,8 +54,8 @@ public class MailTemplateController { } @GetMapping("/get") - @ApiOperation("获得邮件模版") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得邮件模版") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:mail-template:get')") public CommonResult getMailTemplate(@RequestParam("id") Long id) { MailTemplateDO mailTemplateDO = mailTempleService.getMailTemplate(id); @@ -64,7 +63,7 @@ public class MailTemplateController { } @GetMapping("/page") - @ApiOperation("获得邮件模版分页") + @Operation(summary = "获得邮件模版分页") @PreAuthorize("@ss.hasPermission('system:mail-template:query')") public CommonResult> getMailTemplatePage(@Valid MailTemplatePageReqVO pageReqVO) { PageResult pageResult = mailTempleService.getMailTemplatePage(pageReqVO); @@ -72,14 +71,14 @@ public class MailTemplateController { } @GetMapping("/list-all-simple") - @ApiOperation(value = "获得邮件模版精简列表") + @Operation(summary = "获得邮件模版精简列表") public CommonResult> getSimpleTemplateList() { List list = mailTempleService.getMailTemplateList(); return success(MailTemplateConvert.INSTANCE.convertList02(list)); } @PostMapping("/send-mail") - @ApiOperation("发送短信") + @Operation(summary = "发送短信") @PreAuthorize("@ss.hasPermission('system:mail-template:send-mail')") public CommonResult sendMail(@Valid @RequestBody MailTemplateSendReqVO sendReqVO) { return success(mailSendService.sendSingleMailToAdmin(sendReqVO.getMail(), null, diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountBaseVO.java index ef18cb6ac..2778234a0 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.Email; @@ -13,28 +13,28 @@ import javax.validation.constraints.NotNull; @Data public class MailAccountBaseVO { - @ApiModelProperty(value = "邮箱", required = true, example = "yudaoyuanma@123.com") + @Schema(description = "邮箱", required = true, example = "yudaoyuanma@123.com") @NotNull(message = "邮箱不能为空") @Email(message = "必须是 Email 格式") private String mail; - @ApiModelProperty(value = "用户名", required = true, example = "yudao") + @Schema(description = "用户名", required = true, example = "yudao") @NotNull(message = "用户名不能为空") private String username; - @ApiModelProperty(value = "密码", required = true, example = "123456") + @Schema(description = "密码", required = true, example = "123456") @NotNull(message = "密码必填") private String password; - @ApiModelProperty(value = "SMTP 服务器域名", required = true, example = "www.iocoder.cn") + @Schema(description = "SMTP 服务器域名", required = true, example = "www.iocoder.cn") @NotNull(message = "SMTP 服务器域名不能为空") private String host; - @ApiModelProperty(value = "SMTP 服务器端口", required = true, example = "80") + @Schema(description = "SMTP 服务器端口", required = true, example = "80") @NotNull(message = "SMTP 服务器端口不能为空") private Integer port; - @ApiModelProperty(value = "是否开启 ssl", required = true, example = "true") + @Schema(description = "是否开启 ssl", required = true, example = "true") @NotNull(message = "是否开启 ssl 必填") private Boolean sslEnable; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountCreateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountCreateReqVO.java index 2bcca7850..6776ad9f7 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountCreateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountCreateReqVO.java @@ -1,14 +1,11 @@ package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -import javax.validation.constraints.NotNull; - -@ApiModel("管理后台 - 邮箱账号创建 Request VO") +@Schema(description = "管理后台 - 邮箱账号创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountPageReqVO.java index 9e5869172..ae420d1d2 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountPageReqVO.java @@ -1,22 +1,21 @@ package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 邮箱账号分页 Request VO") +@Schema(description = "管理后台 - 邮箱账号分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MailAccountPageReqVO extends PageParam { - @ApiModelProperty(value = "邮箱", required = true, example = "yudaoyuanma@123.com") + @Schema(description = "邮箱", required = true, example = "yudaoyuanma@123.com") private String mail; - @ApiModelProperty(value = "用户名" , required = true , example = "yudao") + @Schema(description = "用户名" , required = true , example = "yudao") private String username; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountRespVO.java index 9eef7281a..2067d6470 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -9,17 +8,17 @@ import lombok.ToString; import javax.validation.constraints.NotNull; import java.time.LocalDateTime; -@ApiModel("管理后台 - 邮箱账号 Response VO") +@Schema(description ="管理后台 - 邮箱账号 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MailAccountRespVO extends MailAccountBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") @NotNull(message = "编号不能为空") private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountSimpleRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountSimpleRespVO.java index 96916a715..dd6093ffa 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountSimpleRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountSimpleRespVO.java @@ -1,17 +1,16 @@ package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@ApiModel("管理后台 - 邮箱账号的精简 Response VO") +@Schema(description = "管理后台 - 邮箱账号的精简 Response VO") @Data public class MailAccountSimpleRespVO { - @ApiModelProperty(value = "邮箱编号", required = true, example = "1024") + @Schema(description = "邮箱编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "邮箱", required = true, example = "768541388@qq.com") + @Schema(description = "邮箱", required = true, example = "768541388@qq.com") private String mail; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountUpdateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountUpdateReqVO.java index 43a13ad18..c6ced00d6 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountUpdateReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 邮箱账号修改 Request VO") +@Schema(description = "管理后台 - 邮箱账号修改 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MailAccountUpdateReqVO extends MailAccountBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") @NotNull(message = "编号不能为空") private Long id; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/log/MailLogBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/log/MailLogBaseVO.java index 4a06fb893..a7b972af1 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/log/MailLogBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/log/MailLogBaseVO.java @@ -1,11 +1,9 @@ package cn.iocoder.yudao.module.system.controller.admin.mail.vo.log; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; import java.time.LocalDateTime; -import java.time.LocalDateTime; -import java.time.LocalDateTime; -import io.swagger.annotations.*; import javax.validation.constraints.*; import org.springframework.format.annotation.DateTimeFormat; @@ -18,59 +16,59 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @Data public class MailLogBaseVO { - @ApiModelProperty(value = "用户编号", example = "30883") + @Schema(description = "用户编号", example = "30883") private Long userId; - @ApiModelProperty(value = "用户类型", example = "2", notes = "参见 UserTypeEnum 枚举") + @Schema(description = "用户类型 - 参见 UserTypeEnum 枚举", example = "2") private Byte userType; - @ApiModelProperty(value = "接收邮箱地址", required = true, example = "76854@qq.com") + @Schema(description = "接收邮箱地址", required = true, example = "76854@qq.com") @NotNull(message = "接收邮箱地址不能为空") private String toMail; - @ApiModelProperty(value = "邮箱账号编号", required = true, example = "18107") + @Schema(description = "邮箱账号编号", required = true, example = "18107") @NotNull(message = "邮箱账号编号不能为空") private Long accountId; - @ApiModelProperty(value = "发送邮箱地址", required = true, example = "85757@qq.com") + @Schema(description = "发送邮箱地址", required = true, example = "85757@qq.com") @NotNull(message = "发送邮箱地址不能为空") private String fromMail; - @ApiModelProperty(value = "模板编号", required = true, example = "5678") + @Schema(description = "模板编号", required = true, example = "5678") @NotNull(message = "模板编号不能为空") private Long templateId; - @ApiModelProperty(value = "模板编码", required = true, example = "test_01") + @Schema(description = "模板编码", required = true, example = "test_01") @NotNull(message = "模板编码不能为空") private String templateCode; - @ApiModelProperty(value = "模版发送人名称", example = "李四") + @Schema(description = "模版发送人名称", example = "李四") private String templateNickname; - @ApiModelProperty(value = "邮件标题", required = true, example = "测试标题") + @Schema(description = "邮件标题", required = true, example = "测试标题") @NotNull(message = "邮件标题不能为空") private String templateTitle; - @ApiModelProperty(value = "邮件内容", required = true, example = "测试内容") + @Schema(description = "邮件内容", required = true, example = "测试内容") @NotNull(message = "邮件内容不能为空") private String templateContent; - @ApiModelProperty(value = "邮件参数", required = true) + @Schema(description = "邮件参数", required = true) @NotNull(message = "邮件参数不能为空") private Map templateParams; - @ApiModelProperty(value = "发送状态", required = true, example = "1", notes = "参见 MailSendStatusEnum 枚举") + @Schema(description = "发送状态 - 参见 MailSendStatusEnum 枚举", required = true, example = "1") @NotNull(message = "发送状态不能为空") private Byte sendStatus; - @ApiModelProperty(value = "发送时间") + @Schema(description = "发送时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime sendTime; - @ApiModelProperty(value = "发送返回的消息 ID", example = "28568") + @Schema(description = "发送返回的消息 ID", example = "28568") private String sendMessageId; - @ApiModelProperty(value = "发送异常") + @Schema(description = "发送异常") private String sendException; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/log/MailLogPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/log/MailLogPageReqVO.java index 1c02a15d0..6fe0244ef 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/log/MailLogPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/log/MailLogPageReqVO.java @@ -1,43 +1,41 @@ package cn.iocoder.yudao.module.system.controller.admin.mail.vo.log; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import org.springframework.format.annotation.DateTimeFormat; -import java.sql.Timestamp; import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 邮箱日志分页 Request VO") +@Schema(description = "管理后台 - 邮箱日志分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MailLogPageReqVO extends PageParam { - @ApiModelProperty(value = "用户编号", example = "30883") + @Schema(description = "用户编号", example = "30883") private Long userId; - @ApiModelProperty(value = "用户类型", example = "2", notes = "参见 UserTypeEnum 枚举") + @Schema(description = "用户类型 - 参见 UserTypeEnum 枚举", example = "2") private Integer userType; - @ApiModelProperty(value = "接收邮箱地址", example = "76854@qq.com", notes = "模糊匹配") + @Schema(description = "接收邮箱地址 模糊匹配", example = "76854@qq.com") private String toMail; - @ApiModelProperty(value = "邮箱账号编号", example = "18107") + @Schema(description = "邮箱账号编号", example = "18107") private Long accountId; - @ApiModelProperty(value = "模板编号", example = "5678") + @Schema(description = "模板编号", example = "5678") private Long templateId; - @ApiModelProperty(value = "发送状态", example = "1", notes = "参见 MailSendStatusEnum 枚举") + @Schema(description = "发送状态 - 参见 MailSendStatusEnum 枚举", example = "1") private Integer sendStatus; - @ApiModelProperty(value = "发送时间") + @Schema(description = "发送时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] sendTime; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/log/MailLogRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/log/MailLogRespVO.java index b0e10355a..cf1ecb2a1 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/log/MailLogRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/log/MailLogRespVO.java @@ -1,19 +1,19 @@ package cn.iocoder.yudao.module.system.controller.admin.mail.vo.log; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDateTime; -import io.swagger.annotations.*; -@ApiModel("管理后台 - 邮件日志 Response VO") +@Schema(description = "管理后台 - 邮件日志 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MailLogRespVO extends MailLogBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "31020") + @Schema(description = "编号", required = true, example = "31020") private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateBaseVO.java index e2835debd..0b90b2712 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateBaseVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template; -import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; @@ -14,34 +13,34 @@ import javax.validation.constraints.NotNull; @Data public class MailTemplateBaseVO { - @ApiModelProperty(value = "模版名称", required = true, example = "测试名字") + @Schema(description = "模版名称", required = true, example = "测试名字") @NotNull(message = "名称不能为空") private String name; - @ApiModelProperty(value = "模版编号", required = true, example = "test") + @Schema(description = "模版编号", required = true, example = "test") @NotNull(message = "模版编号不能为空") private String code; - @ApiModelProperty(value = "发送的邮箱账号编号", required = true, example = "1") + @Schema(description = "发送的邮箱账号编号", required = true, example = "1") @NotNull(message = "发送的邮箱账号编号不能为空") private Long accountId; - @ApiModelProperty(value = "发送人名称", example = "芋头") + @Schema(description = "发送人名称", example = "芋头") private String nickname; - @ApiModelProperty(value = "标题", required = true, example = "注册成功") + @Schema(description = "标题", required = true, example = "注册成功") @NotEmpty(message = "标题不能为空") private String title; - @ApiModelProperty(value = "内容", required = true, example = "你好,注册成功啦") + @Schema(description = "内容", required = true, example = "你好,注册成功啦") @NotEmpty(message = "内容不能为空") private String content; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举") + @Schema(description = "状态 - 参见 CommonStatusEnum 枚举", required = true, example = "1") @NotNull(message = "状态不能为空") private Integer status; - @ApiModelProperty(value = "备注", example = "奥特曼") + @Schema(description = "备注", example = "奥特曼") private String remark; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateCreateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateCreateReqVO.java index 6eab6e9ab..b8b47e3b2 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateCreateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateCreateReqVO.java @@ -1,11 +1,11 @@ package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 邮件模版创建 Request VO") +@Schema(description = "管理后台 - 邮件模版创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplatePageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplatePageReqVO.java index f3cec08f9..4044b7244 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplatePageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplatePageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,25 +11,25 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 邮件模版分页 Request VO") +@Schema(description = "管理后台 - 邮件模版分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MailTemplatePageReqVO extends PageParam { - @ApiModelProperty(value = "状态", example = "1", notes = "参见 CommonStatusEnum 枚举") + @Schema(description = "状态 - 参见 CommonStatusEnum 枚举", example = "1") private Integer status; - @ApiModelProperty(value = "标识", example = "code_1024", notes = "模糊匹配") + @Schema(description = "标识 - 模糊匹配", example = "code_1024") private String code; - @ApiModelProperty(value = "名称", example = "芋头", notes = "模糊匹配") + @Schema(description = "名称 - 模糊匹配", example = "芋头") private String name; - @ApiModelProperty(value = "账号编号", example = "2048") + @Schema(description = "账号编号", example = "2048") private Long accountId; - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateRespVO.java index a2153f9cd..561512cd7 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -9,19 +8,19 @@ import lombok.ToString; import java.time.LocalDateTime; import java.util.List; -@ApiModel("管理后台 - 邮件末班 Response VO") +@Schema(description = "管理后台 - 邮件末班 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MailTemplateRespVO extends MailTemplateBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "参数数组", example = "name,code") + @Schema(description = "参数数组", example = "name,code") private List params; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateSendReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateSendReqVO.java index ccef59770..5d1d9a00d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateSendReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateSendReqVO.java @@ -1,26 +1,25 @@ package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.util.Map; -@ApiModel("管理后台 - 邮件发送 Req VO") +@Schema(description = "管理后台 - 邮件发送 Req VO") @Data public class MailTemplateSendReqVO { - @ApiModelProperty(value = "接收邮箱", required = true, example = "7685413@qq.com") + @Schema(description = "接收邮箱", required = true, example = "7685413@qq.com") @NotEmpty(message = "接收邮箱不能为空") private String mail; - @ApiModelProperty(value = "模板编码", required = true, example = "test_01") + @Schema(description = "模板编码", required = true, example = "test_01") @NotNull(message = "模板编码不能为空") private String templateCode; - @ApiModelProperty(value = "模板参数") + @Schema(description = "模板参数") private Map templateParams; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateSimpleRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateSimpleRespVO.java index 2ff488036..3146e8546 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateSimpleRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateSimpleRespVO.java @@ -1,17 +1,16 @@ package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@ApiModel("管理后台 - 邮件模版的精简 Response VO") +@Schema(description = "管理后台 - 邮件模版的精简 Response VO") @Data public class MailTemplateSimpleRespVO { - @ApiModelProperty(value = "模版编号", required = true, example = "1024") + @Schema(description = "模版编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "模版名字", required = true, example = "哒哒哒") + @Schema(description = "模版名字", required = true, example = "哒哒哒") private String name; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateUpdateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateUpdateReqVO.java index 5dfa377a2..1f50821ba 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateUpdateReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 邮件模版修改 Request VO") +@Schema(description = "管理后台 - 邮件模版修改 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MailTemplateUpdateReqVO extends MailTemplateBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") @NotNull(message = "编号不能为空") private Long id; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/NoticeController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/NoticeController.java index d14cfb733..0e1957785 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/NoticeController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/NoticeController.java @@ -8,9 +8,9 @@ import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticeRespVO; import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticeUpdateReqVO; import cn.iocoder.yudao.module.system.convert.notice.NoticeConvert; import cn.iocoder.yudao.module.system.service.notice.NoticeService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -20,7 +20,7 @@ import javax.validation.Valid; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 通知公告") +@Tag(name = "管理后台 - 通知公告") @RestController @RequestMapping("/system/notice") @Validated @@ -30,7 +30,7 @@ public class NoticeController { private NoticeService noticeService; @PostMapping("/create") - @ApiOperation("创建通知公告") + @Operation(summary = "创建通知公告") @PreAuthorize("@ss.hasPermission('system:notice:create')") public CommonResult createNotice(@Valid @RequestBody NoticeCreateReqVO reqVO) { Long noticeId = noticeService.createNotice(reqVO); @@ -38,7 +38,7 @@ public class NoticeController { } @PutMapping("/update") - @ApiOperation("修改通知公告") + @Operation(summary = "修改通知公告") @PreAuthorize("@ss.hasPermission('system:notice:update')") public CommonResult updateNotice(@Valid @RequestBody NoticeUpdateReqVO reqVO) { noticeService.updateNotice(reqVO); @@ -46,8 +46,8 @@ public class NoticeController { } @DeleteMapping("/delete") - @ApiOperation("删除通知公告") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "删除通知公告") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:notice:delete')") public CommonResult deleteNotice(@RequestParam("id") Long id) { noticeService.deleteNotice(id); @@ -55,15 +55,15 @@ public class NoticeController { } @GetMapping("/page") - @ApiOperation("获取通知公告列表") + @Operation(summary = "获取通知公告列表") @PreAuthorize("@ss.hasPermission('system:notice:query')") - public CommonResult> pageNotices(@Validated NoticePageReqVO reqVO) { - return success(NoticeConvert.INSTANCE.convertPage(noticeService.pageNotices(reqVO))); + public CommonResult> getNoticePage(@Validated NoticePageReqVO reqVO) { + return success(NoticeConvert.INSTANCE.convertPage(noticeService.getNoticePage(reqVO))); } @GetMapping("/get") - @ApiOperation("获得通知公告") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得通知公告") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:notice:query')") public CommonResult getNotice(@RequestParam("id") Long id) { return success(NoticeConvert.INSTANCE.convert(noticeService.getNotice(id))); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticeBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticeBaseVO.java index 43cacd1d5..0b90841be 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticeBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticeBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.notice.vo; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -14,19 +14,19 @@ import javax.validation.constraints.Size; @Data public class NoticeBaseVO { - @ApiModelProperty(value = "公告标题", required = true, example = "小博主") + @Schema(description = "公告标题", required = true, example = "小博主") @NotBlank(message = "公告标题不能为空") @Size(max = 50, message = "公告标题不能超过50个字符") private String title; - @ApiModelProperty(value = "公告类型", required = true, example = "小博主") + @Schema(description = "公告类型", required = true, example = "小博主") @NotNull(message = "公告类型不能为空") private Integer type; - @ApiModelProperty(value = "公告内容", required = true, example = "半生编码") + @Schema(description = "公告内容", required = true, example = "半生编码") private String content; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "状态,参见 CommonStatusEnum 枚举类", required = true, example = "1") private Integer status; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticeCreateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticeCreateReqVO.java index 49e671ce1..211f4f0cf 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticeCreateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticeCreateReqVO.java @@ -1,10 +1,10 @@ package cn.iocoder.yudao.module.system.controller.admin.notice.vo; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; -@ApiModel("管理后台 - 通知公告创建 Request VO") +@Schema(description = "管理后台 - 通知公告创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class NoticeCreateReqVO extends NoticeBaseVO { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticePageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticePageReqVO.java index ba1287c47..53ad45f56 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticePageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticePageReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.system.controller.admin.notice.vo; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; -@ApiModel("管理后台 - 通知公告分页 Request VO") +@Schema(description = "管理后台 - 通知公告分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class NoticePageReqVO extends PageParam { - @ApiModelProperty(value = "通知公告名称", example = "芋道", notes = "模糊匹配") + @Schema(description = "通知公告名称,模糊匹配", example = "芋道") private String title; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1") private Integer status; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticeRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticeRespVO.java index bfa986b04..7b83d9d15 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticeRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticeRespVO.java @@ -1,21 +1,20 @@ package cn.iocoder.yudao.module.system.controller.admin.notice.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import java.time.LocalDateTime; -@ApiModel("管理后台 - 通知公告信息 Response VO") +@Schema(description = "管理后台 - 通知公告信息 Response VO") @Data @EqualsAndHashCode(callSuper = true) public class NoticeRespVO extends NoticeBaseVO { - @ApiModelProperty(value = "通知公告序号", required = true, example = "1024") + @Schema(description = "通知公告序号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") + @Schema(description = "创建时间", required = true, example = "时间戳格式") private LocalDateTime createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticeUpdateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticeUpdateReqVO.java index 30f4a3720..af1d53ed1 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticeUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notice/vo/NoticeUpdateReqVO.java @@ -1,18 +1,17 @@ package cn.iocoder.yudao.module.system.controller.admin.notice.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 岗位公告更新 Request VO") +@Schema(description = "管理后台 - 岗位公告更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class NoticeUpdateReqVO extends NoticeBaseVO { - @ApiModelProperty(value = "岗位公告编号", required = true, example = "1024") + @Schema(description = "岗位公告编号", required = true, example = "1024") @NotNull(message = "岗位公告编号不能为空") private Long id; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/NotifyMessageController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/NotifyMessageController.java index 51d236110..c3e5249e8 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/NotifyMessageController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/NotifyMessageController.java @@ -9,9 +9,9 @@ import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyM import cn.iocoder.yudao.module.system.convert.notify.NotifyMessageConvert; import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyMessageDO; import cn.iocoder.yudao.module.system.service.notify.NotifyMessageService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -23,7 +23,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; -@Api(tags = "管理后台 - 我的站内信") +@Tag(name = "管理后台 - 我的站内信") @RestController @RequestMapping("/system/notify-message") @Validated @@ -35,8 +35,8 @@ public class NotifyMessageController { // ========== 管理所有的站内信 ========== @GetMapping("/get") - @ApiOperation("获得站内信") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得站内信") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:notify-message:query')") public CommonResult getNotifyMessage(@RequestParam("id") Long id) { NotifyMessageDO notifyMessage = notifyMessageService.getNotifyMessage(id); @@ -44,7 +44,7 @@ public class NotifyMessageController { } @GetMapping("/page") - @ApiOperation("获得站内信分页") + @Operation(summary = "获得站内信分页") @PreAuthorize("@ss.hasPermission('system:notify-message:query')") public CommonResult> getNotifyMessagePage(@Valid NotifyMessagePageReqVO pageVO) { PageResult pageResult = notifyMessageService.getNotifyMessagePage(pageVO); @@ -54,7 +54,7 @@ public class NotifyMessageController { // ========== 查看自己的站内信 ========== @GetMapping("/my-page") - @ApiOperation("获得我的站内信分页") + @Operation(summary = "获得我的站内信分页") public CommonResult> getMyMyNotifyMessagePage(@Valid NotifyMessageMyPageReqVO pageVO) { PageResult pageResult = notifyMessageService.getMyMyNotifyMessagePage(pageVO, getLoginUserId(), UserTypeEnum.ADMIN.getValue()); @@ -62,23 +62,23 @@ public class NotifyMessageController { } @PutMapping("/update-read") - @ApiOperation("标记站内信为已读") - @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) + @Operation(summary = "标记站内信为已读") + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") public CommonResult updateNotifyMessageRead(@RequestParam("ids") List ids) { notifyMessageService.updateNotifyMessageRead(ids, getLoginUserId(), UserTypeEnum.ADMIN.getValue()); return success(Boolean.TRUE); } @PutMapping("/update-all-read") - @ApiOperation("标记所有站内信为已读") + @Operation(summary = "标记所有站内信为已读") public CommonResult updateAllNotifyMessageRead() { notifyMessageService.updateAllNotifyMessageRead(getLoginUserId(), UserTypeEnum.ADMIN.getValue()); return success(Boolean.TRUE); } @GetMapping("/get-unread-list") - @ApiOperation("获取当前用户的最新站内信列表,默认 10 条") - @ApiImplicitParam(name = "size", value = "10", defaultValue = "10", dataTypeClass = Integer.class) + @Operation(summary = "获取当前用户的最新站内信列表,默认 10 条") + @Parameter(name = "size", description = "10") public CommonResult> getUnreadNotifyMessageList( @RequestParam(name = "size", defaultValue = "10") Integer size) { List list = notifyMessageService.getUnreadNotifyMessageList( @@ -87,7 +87,7 @@ public class NotifyMessageController { } @GetMapping("/get-unread-count") - @ApiOperation("获得当前用户的未读站内信数量") + @Operation(summary = "获得当前用户的未读站内信数量") public CommonResult getUnreadNotifyMessageCount() { return success(notifyMessageService.getUnreadNotifyMessageCount(getLoginUserId(), UserTypeEnum.ADMIN.getValue())); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/NotifyTemplateController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/NotifyTemplateController.java index c90145dcd..0299836d7 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/NotifyTemplateController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/NotifyTemplateController.java @@ -7,9 +7,9 @@ import cn.iocoder.yudao.module.system.convert.notify.NotifyTemplateConvert; import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyTemplateDO; import cn.iocoder.yudao.module.system.service.notify.NotifySendService; import cn.iocoder.yudao.module.system.service.notify.NotifyTemplateService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -19,7 +19,7 @@ import javax.validation.Valid; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 站内信模版") +@Tag(name = "管理后台 - 站内信模版") @RestController @RequestMapping("/system/notify-template") @Validated @@ -32,14 +32,14 @@ public class NotifyTemplateController { private NotifySendService notifySendService; @PostMapping("/create") - @ApiOperation("创建站内信模版") + @Operation(summary = "创建站内信模版") @PreAuthorize("@ss.hasPermission('system:notify-template:create')") public CommonResult createNotifyTemplate(@Valid @RequestBody NotifyTemplateCreateReqVO createReqVO) { return success(notifyTemplateService.createNotifyTemplate(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新站内信模版") + @Operation(summary = "更新站内信模版") @PreAuthorize("@ss.hasPermission('system:notify-template:update')") public CommonResult updateNotifyTemplate(@Valid @RequestBody NotifyTemplateUpdateReqVO updateReqVO) { notifyTemplateService.updateNotifyTemplate(updateReqVO); @@ -47,8 +47,8 @@ public class NotifyTemplateController { } @DeleteMapping("/delete") - @ApiOperation("删除站内信模版") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除站内信模版") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('system:notify-template:delete')") public CommonResult deleteNotifyTemplate(@RequestParam("id") Long id) { notifyTemplateService.deleteNotifyTemplate(id); @@ -56,8 +56,8 @@ public class NotifyTemplateController { } @GetMapping("/get") - @ApiOperation("获得站内信模版") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得站内信模版") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:notify-template:query')") public CommonResult getNotifyTemplate(@RequestParam("id") Long id) { NotifyTemplateDO notifyTemplate = notifyTemplateService.getNotifyTemplate(id); @@ -65,7 +65,7 @@ public class NotifyTemplateController { } @GetMapping("/page") - @ApiOperation("获得站内信模版分页") + @Operation(summary = "获得站内信模版分页") @PreAuthorize("@ss.hasPermission('system:notify-template:query')") public CommonResult> getNotifyTemplatePage(@Valid NotifyTemplatePageReqVO pageVO) { PageResult pageResult = notifyTemplateService.getNotifyTemplatePage(pageVO); @@ -73,7 +73,7 @@ public class NotifyTemplateController { } @PostMapping("/send-notify") - @ApiOperation("发送站内信") + @Operation(summary = "发送站内信") @PreAuthorize("@ss.hasPermission('system:notify-template:send-notify')") public CommonResult sendNotify(@Valid @RequestBody NotifyTemplateSendReqVO sendReqVO) { return success(notifySendService.sendSingleNotifyToAdmin(sendReqVO.getUserId(), diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessageBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessageBaseVO.java index 161fb9331..5cb1e0b45 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessageBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessageBaseVO.java @@ -1,12 +1,11 @@ package cn.iocoder.yudao.module.system.controller.admin.notify.vo.message; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.NotNull; import java.time.LocalDateTime; -import java.util.Date; import java.util.Map; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -18,43 +17,43 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @Data public class NotifyMessageBaseVO { - @ApiModelProperty(value = "用户编号", required = true, example = "25025") + @Schema(description = "用户编号", required = true, example = "25025") @NotNull(message = "用户编号不能为空") private Long userId; - @ApiModelProperty(value = "用户类型", required = true, example = "1", notes = "参见 UserTypeEnum 枚举") + @Schema(description = "用户类型 - 参见 UserTypeEnum 枚举", required = true, example = "1") @NotNull(message = "用户类型不能为空") private Byte userType; - @ApiModelProperty(value = "模版编号", required = true, example = "13013") + @Schema(description = "模版编号", required = true, example = "13013") @NotNull(message = "模版编号不能为空") private Long templateId; - @ApiModelProperty(value = "模板编码", required = true, example = "test_01") + @Schema(description = "模板编码", required = true, example = "test_01") @NotNull(message = "模板编码不能为空") private String templateCode; - @ApiModelProperty(value = "模版发送人名称", required = true, example = "芋艿") + @Schema(description = "模版发送人名称", required = true, example = "芋艿") @NotNull(message = "模版发送人名称不能为空") private String templateNickname; - @ApiModelProperty(value = "模版内容", required = true, example = "测试内容") + @Schema(description = "模版内容", required = true, example = "测试内容") @NotNull(message = "模版内容不能为空") private String templateContent; - @ApiModelProperty(value = "模版类型", required = true, example = "2") + @Schema(description = "模版类型", required = true, example = "2") @NotNull(message = "模版类型不能为空") private Integer templateType; - @ApiModelProperty(value = "模版参数", required = true) + @Schema(description = "模版参数", required = true) @NotNull(message = "模版参数不能为空") private Map templateParams; - @ApiModelProperty(value = "是否已读", required = true, example = "true") + @Schema(description = "是否已读", required = true, example = "true") @NotNull(message = "是否已读不能为空") private Boolean readStatus; - @ApiModelProperty(value = "阅读时间") + @Schema(description = "阅读时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime readTime; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessageMyPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessageMyPageReqVO.java index 8d3eac162..213d6e17c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessageMyPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessageMyPageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.notify.vo.message; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,16 +11,16 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 站内信分页 Request VO") +@Schema(description = "管理后台 - 站内信分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class NotifyMessageMyPageReqVO extends PageParam { - @ApiModelProperty(value = "是否已读", example = "true") + @Schema(description = "是否已读", example = "true") private Boolean readStatus; - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessagePageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessagePageReqVO.java index f705527c4..4e3aea5c9 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessagePageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessagePageReqVO.java @@ -1,37 +1,35 @@ package cn.iocoder.yudao.module.system.controller.admin.notify.vo.message; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; -import java.util.Date; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 站内信分页 Request VO") +@Schema(description = "管理后台 - 站内信分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class NotifyMessagePageReqVO extends PageParam { - @ApiModelProperty(value = "用户编号", example = "25025") + @Schema(description = "用户编号", example = "25025") private Long userId; - @ApiModelProperty(value = "用户类型", example = "1") + @Schema(description = "用户类型", example = "1") private Integer userType; - @ApiModelProperty(value = "模板编码", example = "test_01") + @Schema(description = "模板编码", example = "test_01") private String templateCode; - @ApiModelProperty(value = "模版类型", example = "2") + @Schema(description = "模版类型", example = "2") private Integer templateType; - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessageRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessageRespVO.java index 26be638a4..f109c36fb 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessageRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessageRespVO.java @@ -1,19 +1,19 @@ package cn.iocoder.yudao.module.system.controller.admin.notify.vo.message; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; -import io.swagger.annotations.*; -@ApiModel("管理后台 - 站内信 Response VO") +@Schema(description = "管理后台 - 站内信 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class NotifyMessageRespVO extends NotifyMessageBaseVO { - @ApiModelProperty(value = "ID", required = true, example = "1024") + @Schema(description = "ID", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private Date createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateBaseVO.java index 118f55baf..1e8762ca0 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateBaseVO.java @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.controller.admin.notify.vo.template; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.validation.InEnum; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; @@ -15,32 +15,32 @@ import javax.validation.constraints.NotNull; @Data public class NotifyTemplateBaseVO { - @ApiModelProperty(value = "模版名称", required = true, example = "测试模版") + @Schema(description = "模版名称", required = true, example = "测试模版") @NotEmpty(message = "模版名称不能为空") private String name; - @ApiModelProperty(value = "模版编码", required = true, example = "SEND_TEST") + @Schema(description = "模版编码", required = true, example = "SEND_TEST") @NotNull(message = "模版编码不能为空") private String code; - @ApiModelProperty(value = "模版类型", required = true, example = "1", notes = "对应 system_notify_template_type 字典") + @Schema(description = "模版类型 - 对应 system_notify_template_type 字典", required = true, example = "1") @NotNull(message = "模版类型不能为空") private Integer type; - @ApiModelProperty(value = "发送人名称", required = true, example = "土豆") + @Schema(description = "发送人名称", required = true, example = "土豆") @NotEmpty(message = "发送人名称不能为空") private String nickname; - @ApiModelProperty(value = "模版内容", required = true, example = "我是模版内容") + @Schema(description = "模版内容", required = true, example = "我是模版内容") @NotEmpty(message = "模版内容不能为空") private String content; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举") + @Schema(description = "状态 - 参见 CommonStatusEnum 枚举", required = true, example = "1") @NotNull(message = "状态不能为空") @InEnum(value = CommonStatusEnum.class, message = "状态必须是 {value}") private Integer status; - @ApiModelProperty(value = "备注", example = "我是备注") + @Schema(description = "备注", example = "我是备注") private String remark; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateCreateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateCreateReqVO.java index aa41b4e28..eb080a7bf 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateCreateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateCreateReqVO.java @@ -1,9 +1,9 @@ package cn.iocoder.yudao.module.system.controller.admin.notify.vo.template; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; -@ApiModel("管理后台 - 站内信模版创建 Request VO") +@Schema(description = "管理后台 - 站内信模版创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplatePageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplatePageReqVO.java index 849ce1275..6c3a36bb1 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplatePageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplatePageReqVO.java @@ -1,32 +1,30 @@ package cn.iocoder.yudao.module.system.controller.admin.notify.vo.template; -import cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDateTime; -import java.util.*; -import io.swagger.annotations.*; import cn.iocoder.yudao.framework.common.pojo.PageParam; import org.springframework.format.annotation.DateTimeFormat; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 站内信模版分页 Request VO") +@Schema(description = "管理后台 - 站内信模版分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class NotifyTemplatePageReqVO extends PageParam { - @ApiModelProperty(value = "模版编码", example = "test_01") + @Schema(description = "模版编码", example = "test_01") private String code; - @ApiModelProperty(value = "模版名称", example = "我是名称") + @Schema(description = "模版名称", example = "我是名称") private String name; - @ApiModelProperty(value = "状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "状态 - 参见 CommonStatusEnum 枚举类", example = "1") private Integer status; - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateRespVO.java index 4df5b7b64..acfed3013 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateRespVO.java @@ -1,22 +1,22 @@ package cn.iocoder.yudao.module.system.controller.admin.notify.vo.template; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; -import io.swagger.annotations.*; -@ApiModel("管理后台 - 站内信模版 Response VO") +@Schema(description = "管理后台 - 站内信模版 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class NotifyTemplateRespVO extends NotifyTemplateBaseVO { - @ApiModelProperty(value = "ID", required = true, example = "1024") + @Schema(description = "ID", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "参数数组", example = "name,code") + @Schema(description = "参数数组", example = "name,code") private List params; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private Date createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateSendReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateSendReqVO.java index e078fd845..adb73b00c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateSendReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateSendReqVO.java @@ -1,25 +1,24 @@ package cn.iocoder.yudao.module.system.controller.admin.notify.vo.template; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.util.Map; -@ApiModel("管理后台 - 站内信模板的发送 Request VO") +@Schema(description = "管理后台 - 站内信模板的发送 Request VO") @Data public class NotifyTemplateSendReqVO { - @ApiModelProperty(value = "用户id", required = true, example = "01") + @Schema(description = "用户id", required = true, example = "01") @NotNull(message = "用户id不能为空") private Long userId; - @ApiModelProperty(value = "模板编码", required = true, example = "01") + @Schema(description = "模板编码", required = true, example = "01") @NotEmpty(message = "模板编码不能为空") private String templateCode; - @ApiModelProperty(value = "模板参数") + @Schema(description = "模板参数") private Map templateParams; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateUpdateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateUpdateReqVO.java index 6e75ccf89..cdbeade2d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateUpdateReqVO.java @@ -1,16 +1,16 @@ package cn.iocoder.yudao.module.system.controller.admin.notify.vo.template; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; import javax.validation.constraints.*; -@ApiModel("管理后台 - 站内信模版更新 Request VO") +@Schema(description = "管理后台 - 站内信模版更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class NotifyTemplateUpdateReqVO extends NotifyTemplateBaseVO { - @ApiModelProperty(value = "ID", required = true, example = "1024") + @Schema(description = "ID", required = true, example = "1024") @NotNull(message = "ID 不能为空") private Long id; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2ClientController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2ClientController.java index d6b927857..358f94678 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2ClientController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2ClientController.java @@ -9,9 +9,9 @@ import cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.client.OAuth2Cl import cn.iocoder.yudao.module.system.convert.auth.OAuth2ClientConvert; import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2ClientDO; import cn.iocoder.yudao.module.system.service.oauth2.OAuth2ClientService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -21,7 +21,7 @@ import javax.validation.Valid; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - OAuth2 客户端") +@Tag(name = "管理后台 - OAuth2 客户端") @RestController @RequestMapping("/system/oauth2-client") @Validated @@ -31,14 +31,14 @@ public class OAuth2ClientController { private OAuth2ClientService oAuth2ClientService; @PostMapping("/create") - @ApiOperation("创建 OAuth2 客户端") + @Operation(summary = "创建 OAuth2 客户端") @PreAuthorize("@ss.hasPermission('system:oauth2-client:create')") public CommonResult createOAuth2Client(@Valid @RequestBody OAuth2ClientCreateReqVO createReqVO) { return success(oAuth2ClientService.createOAuth2Client(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新 OAuth2 客户端") + @Operation(summary = "更新 OAuth2 客户端") @PreAuthorize("@ss.hasPermission('system:oauth2-client:update')") public CommonResult updateOAuth2Client(@Valid @RequestBody OAuth2ClientUpdateReqVO updateReqVO) { oAuth2ClientService.updateOAuth2Client(updateReqVO); @@ -46,8 +46,8 @@ public class OAuth2ClientController { } @DeleteMapping("/delete") - @ApiOperation("删除 OAuth2 客户端") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除 OAuth2 客户端") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('system:oauth2-client:delete')") public CommonResult deleteOAuth2Client(@RequestParam("id") Long id) { oAuth2ClientService.deleteOAuth2Client(id); @@ -55,8 +55,8 @@ public class OAuth2ClientController { } @GetMapping("/get") - @ApiOperation("获得 OAuth2 客户端") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得 OAuth2 客户端") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:oauth2-client:query')") public CommonResult getOAuth2Client(@RequestParam("id") Long id) { OAuth2ClientDO oAuth2Client = oAuth2ClientService.getOAuth2Client(id); @@ -64,7 +64,7 @@ public class OAuth2ClientController { } @GetMapping("/page") - @ApiOperation("获得OAuth2 客户端分页") + @Operation(summary = "获得OAuth2 客户端分页") @PreAuthorize("@ss.hasPermission('system:oauth2-client:query')") public CommonResult> getOAuth2ClientPage(@Valid OAuth2ClientPageReqVO pageVO) { PageResult pageResult = oAuth2ClientService.getOAuth2ClientPage(pageVO); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenController.java index 608f5341a..2ff359235 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2OpenController.java @@ -22,10 +22,10 @@ import cn.iocoder.yudao.module.system.service.oauth2.OAuth2ClientService; import cn.iocoder.yudao.module.system.service.oauth2.OAuth2GrantService; import cn.iocoder.yudao.module.system.service.oauth2.OAuth2TokenService; import cn.iocoder.yudao.module.system.util.oauth2.OAuth2Utils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -55,7 +55,7 @@ import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUti * * @author 芋道源码 */ -@Api(tags = "管理后台 - OAuth2.0 授权") +@Tag(name = "管理后台 - OAuth2.0 授权") @RestController @RequestMapping("/system/oauth2") @Validated @@ -84,16 +84,16 @@ public class OAuth2OpenController { */ @PostMapping("/token") @PermitAll - @ApiOperation(value = "获得访问令牌", notes = "适合 code 授权码模式,或者 implicit 简化模式;在 sso.vue 单点登录界面被【获取】调用") - @ApiImplicitParams({ - @ApiImplicitParam(name = "grant_type", required = true, value = "授权类型", example = "code", dataTypeClass = String.class), - @ApiImplicitParam(name = "code", value = "授权范围", example = "userinfo.read", dataTypeClass = String.class), - @ApiImplicitParam(name = "redirect_uri", value = "重定向 URI", example = "https://www.iocoder.cn", dataTypeClass = String.class), - @ApiImplicitParam(name = "state", value = "状态", example = "1", dataTypeClass = String.class), - @ApiImplicitParam(name = "username", example = "tudou", dataTypeClass = String.class), - @ApiImplicitParam(name = "password", example = "cai", dataTypeClass = String.class), // 多个使用空格分隔 - @ApiImplicitParam(name = "scope", example = "user_info", dataTypeClass = String.class), - @ApiImplicitParam(name = "refresh_token", example = "123424233", dataTypeClass = String.class), + @Operation(summary = "获得访问令牌", description = "适合 code 授权码模式,或者 implicit 简化模式;在 sso.vue 单点登录界面被【获取】调用") + @Parameters({ + @Parameter(name = "grant_type", required = true, description = "授权类型", example = "code"), + @Parameter(name = "code", description = "授权范围", example = "userinfo.read"), + @Parameter(name = "redirect_uri", description = "重定向 URI", example = "https://www.iocoder.cn"), + @Parameter(name = "state", description = "状态", example = "1"), + @Parameter(name = "username", example = "tudou"), + @Parameter(name = "password", example = "cai"), // 多个使用空格分隔 + @Parameter(name = "scope", example = "user_info"), + @Parameter(name = "refresh_token", example = "123424233"), }) @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 public CommonResult postAccessToken(HttpServletRequest request, @@ -144,8 +144,8 @@ public class OAuth2OpenController { @DeleteMapping("/token") @PermitAll - @ApiOperation(value = "删除访问令牌") - @ApiImplicitParam(name = "token", required = true, value = "访问令牌", example = "biu", dataTypeClass = String.class) + @Operation(summary = "删除访问令牌") + @Parameter(name = "token", required = true, description = "访问令牌", example = "biu") @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 public CommonResult revokeToken(HttpServletRequest request, @RequestParam("token") String token) { @@ -163,8 +163,8 @@ public class OAuth2OpenController { */ @PostMapping("/check-token") @PermitAll - @ApiOperation(value = "校验访问令牌") - @ApiImplicitParam(name = "token", required = true, value = "访问令牌", example = "biu", dataTypeClass = String.class) + @Operation(summary = "校验访问令牌") + @Parameter(name = "token", required = true, description = "访问令牌", example = "biu") @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 public CommonResult checkToken(HttpServletRequest request, @RequestParam("token") String token) { @@ -183,8 +183,8 @@ public class OAuth2OpenController { * 对应 Spring Security OAuth 的 AuthorizationEndpoint 类的 authorize 方法 */ @GetMapping("/authorize") - @ApiOperation(value = "获得授权信息", notes = "适合 code 授权码模式,或者 implicit 简化模式;在 sso.vue 单点登录界面被【获取】调用") - @ApiImplicitParam(name = "clientId", required = true, value = "客户端编号", example = "tudou", dataTypeClass = String.class) + @Operation(summary = "获得授权信息", description = "适合 code 授权码模式,或者 implicit 简化模式;在 sso.vue 单点登录界面被【获取】调用") + @Parameter(name = "clientId", required = true, description = "客户端编号", example = "tudou") public CommonResult authorize(@RequestParam("clientId") String clientId) { // 0. 校验用户已经登录。通过 Spring Security 实现 @@ -207,14 +207,14 @@ public class OAuth2OpenController { * 因为前后端分离,Axios 无法很好的处理 302 重定向,所以和 Spring Security OAuth 略有不同,返回结果是重定向的 URL,剩余交给前端处理 */ @PostMapping("/authorize") - @ApiOperation(value = "申请授权", notes = "适合 code 授权码模式,或者 implicit 简化模式;在 sso.vue 单点登录界面被【提交】调用") - @ApiImplicitParams({ - @ApiImplicitParam(name = "response_type", required = true, value = "响应类型", example = "code", dataTypeClass = String.class), - @ApiImplicitParam(name = "client_id", required = true, value = "客户端编号", example = "tudou", dataTypeClass = String.class), - @ApiImplicitParam(name = "scope", value = "授权范围", example = "userinfo.read", dataTypeClass = String.class), // 使用 Map 格式,Spring MVC 暂时不支持这么接收参数 - @ApiImplicitParam(name = "redirect_uri", required = true, value = "重定向 URI", example = "https://www.iocoder.cn", dataTypeClass = String.class), - @ApiImplicitParam(name = "auto_approve", required = true, value = "用户是否接受", example = "true", dataTypeClass = Boolean.class), - @ApiImplicitParam(name = "state", example = "1", dataTypeClass = String.class) + @Operation(summary = "申请授权", description = "适合 code 授权码模式,或者 implicit 简化模式;在 sso.vue 单点登录界面被【提交】调用") + @Parameters({ + @Parameter(name = "response_type", required = true, description = "响应类型", example = "code"), + @Parameter(name = "client_id", required = true, description = "客户端编号", example = "tudou"), + @Parameter(name = "scope", description = "授权范围", example = "userinfo.read"), // 使用 Map 格式,Spring MVC 暂时不支持这么接收参数 + @Parameter(name = "redirect_uri", required = true, description = "重定向 URI", example = "https://www.iocoder.cn"), + @Parameter(name = "auto_approve", required = true, description = "用户是否接受", example = "true"), + @Parameter(name = "state", example = "1") }) @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 public CommonResult approveOrDeny(@RequestParam("response_type") String responseType, diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2TokenController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2TokenController.java index c055a19df..d1e0364dc 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2TokenController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2TokenController.java @@ -9,9 +9,9 @@ import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO; import cn.iocoder.yudao.module.system.enums.logger.LoginLogTypeEnum; import cn.iocoder.yudao.module.system.service.auth.AdminAuthService; import cn.iocoder.yudao.module.system.service.oauth2.OAuth2TokenService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; @@ -20,7 +20,7 @@ import javax.validation.Valid; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - OAuth2.0 令牌") +@Tag(name = "管理后台 - OAuth2.0 令牌") @RestController @RequestMapping("/system/oauth2-token") public class OAuth2TokenController { @@ -31,7 +31,7 @@ public class OAuth2TokenController { private AdminAuthService authService; @GetMapping("/page") - @ApiOperation(value = "获得访问令牌分页", notes = "只返回有效期内的") + @Operation(summary = "获得访问令牌分页", description = "只返回有效期内的") @PreAuthorize("@ss.hasPermission('system:oauth2-token:page')") public CommonResult> getAccessTokenPage(@Valid OAuth2AccessTokenPageReqVO reqVO) { PageResult pageResult = oauth2TokenService.getAccessTokenPage(reqVO); @@ -39,8 +39,8 @@ public class OAuth2TokenController { } @DeleteMapping("/delete") - @ApiOperation("删除访问令牌") - @ApiImplicitParam(name = "accessToken", value = "访问令牌", required = true, dataTypeClass = String.class, example = "tudou") + @Operation(summary = "删除访问令牌") + @Parameter(name = "accessToken", description = "访问令牌", required = true, example = "tudou") @PreAuthorize("@ss.hasPermission('system:oauth2-token:delete')") public CommonResult deleteAccessToken(@RequestParam("accessToken") String accessToken) { authService.logout(accessToken, LoginLogTypeEnum.LOGOUT_DELETE.getType()); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2UserController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2UserController.java index 39b6125ab..b56d71484 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2UserController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/OAuth2UserController.java @@ -11,8 +11,8 @@ import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.service.dept.DeptService; import cn.iocoder.yudao.module.system.service.dept.PostService; import cn.iocoder.yudao.module.system.service.user.AdminUserService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; import lombok.extern.slf4j.Slf4j; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -33,7 +33,7 @@ import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUti * * @author 芋道源码 */ -@Api(tags = "管理后台 - OAuth2.0 用户") +@Tag(name = "管理后台 - OAuth2.0 用户") @RestController @RequestMapping("/system/oauth2/user") @Validated @@ -48,7 +48,7 @@ public class OAuth2UserController { private PostService postService; @GetMapping("/get") - @ApiOperation("获得用户基本信息") + @Operation(summary = "获得用户基本信息") @PreAuthorize("@ss.hasScope('user.read')") // public CommonResult getUserInfo() { // 获得用户基本信息 @@ -61,14 +61,14 @@ public class OAuth2UserController { } // 获得岗位信息 if (CollUtil.isNotEmpty(user.getPostIds())) { - List posts = postService.getPosts(user.getPostIds()); + List posts = postService.getPostList(user.getPostIds()); resp.setPosts(OAuth2UserConvert.INSTANCE.convertList(posts)); } return success(resp); } @PutMapping("/update") - @ApiOperation("更新用户基本信息") + @Operation(summary = "更新用户基本信息") @PreAuthorize("@ss.hasScope('user.write')") public CommonResult updateUserInfo(@Valid @RequestBody OAuth2UserUpdateReqVO reqVO) { // 这里将 UserProfileUpdateReqVO =》UserProfileUpdateReqVO 对象,实现接口的复用。 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/client/OAuth2ClientBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/client/OAuth2ClientBaseVO.java index dbd74e552..c0056ed3d 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/client/OAuth2ClientBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/client/OAuth2ClientBaseVO.java @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.client; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.util.json.JsonUtils; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.hibernate.validator.constraints.URL; @@ -18,60 +18,60 @@ import java.util.List; @Data public class OAuth2ClientBaseVO { - @ApiModelProperty(value = "客户端编号", required = true, example = "tudou") + @Schema(description = "客户端编号", required = true, example = "tudou") @NotNull(message = "客户端编号不能为空") private String clientId; - @ApiModelProperty(value = "客户端密钥", required = true, example = "fan") + @Schema(description = "客户端密钥", required = true, example = "fan") @NotNull(message = "客户端密钥不能为空") private String secret; - @ApiModelProperty(value = "应用名", required = true, example = "土豆") + @Schema(description = "应用名", required = true, example = "土豆") @NotNull(message = "应用名不能为空") private String name; - @ApiModelProperty(value = "应用图标", required = true, example = "https://www.iocoder.cn/xx.png") + @Schema(description = "应用图标", required = true, example = "https://www.iocoder.cn/xx.png") @NotNull(message = "应用图标不能为空") @URL(message = "应用图标的地址不正确") private String logo; - @ApiModelProperty(value = "应用描述", example = "我是一个应用") + @Schema(description = "应用描述", example = "我是一个应用") private String description; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举") + @Schema(description = "状态,参见 CommonStatusEnum 枚举", required = true, example = "1") @NotNull(message = "状态不能为空") private Integer status; - @ApiModelProperty(value = "访问令牌的有效期", required = true, example = "8640") + @Schema(description = "访问令牌的有效期", required = true, example = "8640") @NotNull(message = "访问令牌的有效期不能为空") private Integer accessTokenValiditySeconds; - @ApiModelProperty(value = "刷新令牌的有效期", required = true, example = "8640000") + @Schema(description = "刷新令牌的有效期", required = true, example = "8640000") @NotNull(message = "刷新令牌的有效期不能为空") private Integer refreshTokenValiditySeconds; - @ApiModelProperty(value = "可重定向的 URI 地址", required = true, example = "https://www.iocoder.cn") + @Schema(description = "可重定向的 URI 地址", required = true, example = "https://www.iocoder.cn") @NotNull(message = "可重定向的 URI 地址不能为空") private List<@NotEmpty(message = "重定向的 URI 不能为空") @URL(message = "重定向的 URI 格式不正确") String> redirectUris; - @ApiModelProperty(value = "授权类型", required = true, example = "password", notes = "参见 OAuth2GrantTypeEnum 枚举") + @Schema(description = "授权类型,参见 OAuth2GrantTypeEnum 枚举", required = true, example = "password") @NotNull(message = "授权类型不能为空") private List authorizedGrantTypes; - @ApiModelProperty(value = "授权范围", example = "user_info") + @Schema(description = "授权范围", example = "user_info") private List scopes; - @ApiModelProperty(value = "自动通过的授权范围", example = "user_info") + @Schema(description = "自动通过的授权范围", example = "user_info") private List autoApproveScopes; - @ApiModelProperty(value = "权限", example = "system:user:query") + @Schema(description = "权限", example = "system:user:query") private List authorities; - @ApiModelProperty(value = "资源", example = "1024") + @Schema(description = "资源", example = "1024") private List resourceIds; - @ApiModelProperty(value = "附加信息", example = "{yunai: true}") + @Schema(description = "附加信息", example = "{yunai: true}") private String additionalInformation; @AssertTrue(message = "附加信息必须是 JSON 格式") diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/client/OAuth2ClientCreateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/client/OAuth2ClientCreateReqVO.java index b241277ac..b7b8ffc38 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/client/OAuth2ClientCreateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/client/OAuth2ClientCreateReqVO.java @@ -1,9 +1,9 @@ package cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.client; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; -@ApiModel("管理后台 - OAuth2 客户端创建 Request VO") +@Schema(description = "管理后台 - OAuth2 客户端创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/client/OAuth2ClientPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/client/OAuth2ClientPageReqVO.java index 286fc73ac..66fd1f41b 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/client/OAuth2ClientPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/client/OAuth2ClientPageReqVO.java @@ -1,19 +1,19 @@ package cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.client; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; import cn.iocoder.yudao.framework.common.pojo.PageParam; -@ApiModel("管理后台 - OAuth2 客户端分页 Request VO") +@Schema(description = "管理后台 - OAuth2 客户端分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class OAuth2ClientPageReqVO extends PageParam { - @ApiModelProperty(value = "应用名", example = "土豆", notes = "模糊匹配") + @Schema(description = "应用名,模糊匹配", example = "土豆") private String name; - @ApiModelProperty(value = "状态", example = "1", notes = "参见 CommonStatusEnum 枚举") + @Schema(description = "状态,参见 CommonStatusEnum 枚举", example = "1") private Integer status; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/client/OAuth2ClientRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/client/OAuth2ClientRespVO.java index f4bdf4cc7..28aff686c 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/client/OAuth2ClientRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/client/OAuth2ClientRespVO.java @@ -1,23 +1,22 @@ package cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.client; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - OAuth2 客户端 Response VO") +@Schema(description = "管理后台 - OAuth2 客户端 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class OAuth2ClientRespVO extends OAuth2ClientBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/client/OAuth2ClientUpdateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/client/OAuth2ClientUpdateReqVO.java index 024a1511f..ba76eaeb9 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/client/OAuth2ClientUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/client/OAuth2ClientUpdateReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.client; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - OAuth2 客户端更新 Request VO") +@Schema(description = "管理后台 - OAuth2 客户端更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class OAuth2ClientUpdateReqVO extends OAuth2ClientBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") @NotNull(message = "编号不能为空") private Long id; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/OAuth2OpenAccessTokenRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/OAuth2OpenAccessTokenRespVO.java index 4fdb4e539..745095403 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/OAuth2OpenAccessTokenRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/OAuth2OpenAccessTokenRespVO.java @@ -1,35 +1,34 @@ package cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.open; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; -@ApiModel("管理后台 - 【开放接口】访问令牌 Response VO") +@Schema(description = "管理后台 - 【开放接口】访问令牌 Response VO") @Data @NoArgsConstructor @AllArgsConstructor public class OAuth2OpenAccessTokenRespVO { - @ApiModelProperty(value = "访问令牌", required = true, example = "tudou") + @Schema(description = "访问令牌", required = true, example = "tudou") @JsonProperty("access_token") private String accessToken; - @ApiModelProperty(value = "刷新令牌", required = true, example = "nice") + @Schema(description = "刷新令牌", required = true, example = "nice") @JsonProperty("refresh_token") private String refreshToken; - @ApiModelProperty(value = "令牌类型", required = true, example = "bearer") + @Schema(description = "令牌类型", required = true, example = "bearer") @JsonProperty("token_type") private String tokenType; - @ApiModelProperty(value = "过期时间", required = true, example = "42430", notes = "单位:秒") + @Schema(description = "过期时间,单位:秒", required = true, example = "42430") @JsonProperty("expires_in") private Long expiresIn; - @ApiModelProperty(value = "授权范围", example = "user_info", notes = "如果多个授权范围,使用空格分隔") + @Schema(description = "授权范围,如果多个授权范围,使用空格分隔", example = "user_info") private String scope; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/OAuth2OpenAuthorizeInfoRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/OAuth2OpenAuthorizeInfoRespVO.java index d2a7bb36e..984f87916 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/OAuth2OpenAuthorizeInfoRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/OAuth2OpenAuthorizeInfoRespVO.java @@ -1,15 +1,14 @@ package cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.open; import cn.iocoder.yudao.framework.common.core.KeyValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import java.util.List; -@ApiModel("管理后台 - 授权页的信息 Response VO") +@Schema(description = "管理后台 - 授权页的信息 Response VO") @Data @NoArgsConstructor @AllArgsConstructor @@ -20,7 +19,7 @@ public class OAuth2OpenAuthorizeInfoRespVO { */ private Client client; - @ApiModelProperty(value = "scope 的选中信息", required = true, notes = "使用 List 保证有序性,Key 是 scope,Value 为是否选中") + @Schema(description = "scope 的选中信息,使用 List 保证有序性,Key 是 scope,Value 为是否选中", required = true) private List> scopes; @Data @@ -28,10 +27,10 @@ public class OAuth2OpenAuthorizeInfoRespVO { @AllArgsConstructor public static class Client { - @ApiModelProperty(value = "应用名", required = true, example = "土豆") + @Schema(description = "应用名", required = true, example = "土豆") private String name; - @ApiModelProperty(value = "应用图标", required = true, example = "https://www.iocoder.cn/xx.png") + @Schema(description = "应用图标", required = true, example = "https://www.iocoder.cn/xx.png") private String logo; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/OAuth2OpenCheckTokenRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/OAuth2OpenCheckTokenRespVO.java index e1639e9ac..d2dc8eb46 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/OAuth2OpenCheckTokenRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/open/OAuth2OpenCheckTokenRespVO.java @@ -1,41 +1,40 @@ package cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.open; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import java.util.List; -@ApiModel("管理后台 - 【开放接口】校验令牌 Response VO") +@Schema(description = "管理后台 - 【开放接口】校验令牌 Response VO") @Data @NoArgsConstructor @AllArgsConstructor public class OAuth2OpenCheckTokenRespVO { - @ApiModelProperty(value = "用户编号", required = true, example = "666") + @Schema(description = "用户编号", required = true, example = "666") @JsonProperty("user_id") private Long userId; - @ApiModelProperty(value = "用户类型", required = true, example = "2", notes = "参见 UserTypeEnum 枚举") + @Schema(description = "用户类型,参见 UserTypeEnum 枚举", required = true, example = "2") @JsonProperty("user_type") private Integer userType; - @ApiModelProperty(value = "租户编号", required = true, example = "1024") + @Schema(description = "租户编号", required = true, example = "1024") @JsonProperty("tenant_id") private Long tenantId; - @ApiModelProperty(value = "客户端编号", required = true, example = "car") + @Schema(description = "客户端编号", required = true, example = "car") @JsonProperty("client_id") private String clientId; - @ApiModelProperty(value = "授权范围", required = true, example = "user_info") + @Schema(description = "授权范围", required = true, example = "user_info") private List scopes; - @ApiModelProperty(value = "访问令牌", required = true, example = "tudou") + @Schema(description = "访问令牌", required = true, example = "tudou") @JsonProperty("access_token") private String accessToken; - @ApiModelProperty(value = "过期时间", required = true, example = "1593092157", notes = "时间戳 / 1000,即单位:秒") + @Schema(description = "过期时间,时间戳 / 1000,即单位:秒", required = true, example = "1593092157") private Long exp; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/token/OAuth2AccessTokenPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/token/OAuth2AccessTokenPageReqVO.java index 65103adc6..1a54fdcb6 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/token/OAuth2AccessTokenPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/token/OAuth2AccessTokenPageReqVO.java @@ -1,23 +1,22 @@ package cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.token; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; -@ApiModel("管理后台 - 访问令牌分页 Request VO") +@Schema(description = "管理后台 - 访问令牌分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class OAuth2AccessTokenPageReqVO extends PageParam { - @ApiModelProperty(value = "用户编号", required = true, example = "666") + @Schema(description = "用户编号", required = true, example = "666") private Long userId; - @ApiModelProperty(value = "用户类型", required = true, example = "2", notes = "参见 UserTypeEnum 枚举") + @Schema(description = "用户类型,参见 UserTypeEnum 枚举", required = true, example = "2") private Integer userType; - @ApiModelProperty(value = "客户端编号", required = true, example = "2") + @Schema(description = "客户端编号", required = true, example = "2") private String clientId; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/token/OAuth2AccessTokenRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/token/OAuth2AccessTokenRespVO.java index 76a2bb7d5..125e37f46 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/token/OAuth2AccessTokenRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/token/OAuth2AccessTokenRespVO.java @@ -1,41 +1,40 @@ package cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.token; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import java.time.LocalDateTime; -@ApiModel("管理后台 - 访问令牌 Response VO") +@Schema(description = "管理后台 - 访问令牌 Response VO") @Data @NoArgsConstructor @AllArgsConstructor public class OAuth2AccessTokenRespVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "访问令牌", required = true, example = "tudou") + @Schema(description = "访问令牌", required = true, example = "tudou") private String accessToken; - @ApiModelProperty(value = "刷新令牌", required = true, example = "nice") + @Schema(description = "刷新令牌", required = true, example = "nice") private String refreshToken; - @ApiModelProperty(value = "用户编号", required = true, example = "666") + @Schema(description = "用户编号", required = true, example = "666") private Long userId; - @ApiModelProperty(value = "用户类型", required = true, example = "2", notes = "参见 UserTypeEnum 枚举") + @Schema(description = "用户类型,参见 UserTypeEnum 枚举", required = true, example = "2") private Integer userType; - @ApiModelProperty(value = "客户端编号", required = true, example = "2") + @Schema(description = "客户端编号", required = true, example = "2") private String clientId; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; - @ApiModelProperty(value = "过期时间", required = true) + @Schema(description = "过期时间", required = true) private LocalDateTime expiresTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/user/OAuth2UserInfoRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/user/OAuth2UserInfoRespVO.java index f22c14a9f..0a1002f7c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/user/OAuth2UserInfoRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/user/OAuth2UserInfoRespVO.java @@ -1,37 +1,36 @@ package cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.user; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import java.util.List; -@ApiModel("管理后台 - OAuth2 获得用户基本信息 Response VO") +@Schema(description = "管理后台 - OAuth2 获得用户基本信息 Response VO") @Data @NoArgsConstructor @AllArgsConstructor public class OAuth2UserInfoRespVO { - @ApiModelProperty(value = "用户编号", required = true, example = "1") + @Schema(description = "用户编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "用户账号", required = true, example = "芋艿") + @Schema(description = "用户账号", required = true, example = "芋艿") private String username; - @ApiModelProperty(value = "用户昵称", required = true, example = "芋道") + @Schema(description = "用户昵称", required = true, example = "芋道") private String nickname; - @ApiModelProperty(value = "用户邮箱", example = "yudao@iocoder.cn") + @Schema(description = "用户邮箱", example = "yudao@iocoder.cn") private String email; - @ApiModelProperty(value = "手机号码", example = "15601691300") + @Schema(description = "手机号码", example = "15601691300") private String mobile; - @ApiModelProperty(value = "用户性别", example = "1", notes = "参见 SexEnum 枚举类") + @Schema(description = "用户性别,参见 SexEnum 枚举类", example = "1") private Integer sex; - @ApiModelProperty(value = "用户头像", example = "https://www.iocoder.cn/xxx.png") + @Schema(description = "用户头像", example = "https://www.iocoder.cn/xxx.png") private String avatar; /** @@ -44,26 +43,26 @@ public class OAuth2UserInfoRespVO { */ private List posts; - @ApiModel("部门") + @Schema(description = "部门") @Data public static class Dept { - @ApiModelProperty(value = "部门编号", required = true, example = "1") + @Schema(description = "部门编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "部门名称", required = true, example = "研发部") + @Schema(description = "部门名称", required = true, example = "研发部") private String name; } - @ApiModel("岗位") + @Schema(description = "岗位") @Data public static class Post { - @ApiModelProperty(value = "岗位编号", required = true, example = "1") + @Schema(description = "岗位编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "岗位名称", required = true, example = "开发") + @Schema(description = "岗位名称", required = true, example = "开发") private String name; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/user/OAuth2UserUpdateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/user/OAuth2UserUpdateReqVO.java index 16082a75e..739b12d6b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/user/OAuth2UserUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/oauth2/vo/user/OAuth2UserUpdateReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.oauth2.vo.user; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -10,26 +9,26 @@ import org.hibernate.validator.constraints.Length; import javax.validation.constraints.Email; import javax.validation.constraints.Size; -@ApiModel("管理后台 - OAuth2 更新用户基本信息 Request VO") +@Schema(description = "管理后台 - OAuth2 更新用户基本信息 Request VO") @Data @NoArgsConstructor @AllArgsConstructor public class OAuth2UserUpdateReqVO { - @ApiModelProperty(value = "用户昵称", required = true, example = "芋艿") + @Schema(description = "用户昵称", required = true, example = "芋艿") @Size(max = 30, message = "用户昵称长度不能超过 30 个字符") private String nickname; - @ApiModelProperty(value = "用户邮箱", example = "yudao@iocoder.cn") + @Schema(description = "用户邮箱", example = "yudao@iocoder.cn") @Email(message = "邮箱格式不正确") @Size(max = 50, message = "邮箱长度不能超过 50 个字符") private String email; - @ApiModelProperty(value = "手机号码", example = "15601691300") + @Schema(description = "手机号码", example = "15601691300") @Length(min = 11, max = 11, message = "手机号长度必须 11 位") private String mobile; - @ApiModelProperty(value = "用户性别", example = "1", notes = "参见 SexEnum 枚举类") + @Schema(description = "用户性别,参见 SexEnum 枚举类", example = "1") private Integer sex; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/MenuController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/MenuController.java index 9813d8c0a..4b007ff72 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/MenuController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/MenuController.java @@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu.*; import cn.iocoder.yudao.module.system.convert.permission.MenuConvert; import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO; import cn.iocoder.yudao.module.system.service.permission.MenuService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -20,7 +20,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 菜单") +@Tag(name = "管理后台 - 菜单") @RestController @RequestMapping("/system/menu") @Validated @@ -30,7 +30,7 @@ public class MenuController { private MenuService menuService; @PostMapping("/create") - @ApiOperation("创建菜单") + @Operation(summary = "创建菜单") @PreAuthorize("@ss.hasPermission('system:menu:create')") public CommonResult createMenu(@Valid @RequestBody MenuCreateReqVO reqVO) { Long menuId = menuService.createMenu(reqVO); @@ -38,7 +38,7 @@ public class MenuController { } @PutMapping("/update") - @ApiOperation("修改菜单") + @Operation(summary = "修改菜单") @PreAuthorize("@ss.hasPermission('system:menu:update')") public CommonResult updateMenu(@Valid @RequestBody MenuUpdateReqVO reqVO) { menuService.updateMenu(reqVO); @@ -46,8 +46,8 @@ public class MenuController { } @DeleteMapping("/delete") - @ApiOperation("删除菜单") - @ApiImplicitParam(name = "id", value = "角色编号", required= true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "删除菜单") + @Parameter(name = "id", description = "角色编号", required= true, example = "1024") @PreAuthorize("@ss.hasPermission('system:menu:delete')") public CommonResult deleteMenu(@RequestParam("id") Long id) { menuService.deleteMenu(id); @@ -55,29 +55,29 @@ public class MenuController { } @GetMapping("/list") - @ApiOperation(value = "获取菜单列表", notes = "用于【菜单管理】界面") + @Operation(summary = "获取菜单列表", description = "用于【菜单管理】界面") @PreAuthorize("@ss.hasPermission('system:menu:query')") - public CommonResult> getMenus(MenuListReqVO reqVO) { - List list = menuService.getMenus(reqVO); + public CommonResult> getMenuList(MenuListReqVO reqVO) { + List list = menuService.getMenuList(reqVO); list.sort(Comparator.comparing(MenuDO::getSort)); return success(MenuConvert.INSTANCE.convertList(list)); } @GetMapping("/list-all-simple") - @ApiOperation(value = "获取菜单精简信息列表", notes = "只包含被开启的菜单,用于【角色分配菜单】功能的选项。" + + @Operation(summary = "获取菜单精简信息列表", description = "只包含被开启的菜单,用于【角色分配菜单】功能的选项。" + "在多租户的场景下,会只返回租户所在套餐有的菜单") - public CommonResult> getSimpleMenus() { + public CommonResult> getSimpleMenuList() { // 获得菜单列表,只要开启状态的 MenuListReqVO reqVO = new MenuListReqVO(); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - List list = menuService.getTenantMenus(reqVO); + List list = menuService.getMenuListByTenant(reqVO); // 排序后,返回给前端 list.sort(Comparator.comparing(MenuDO::getSort)); return success(MenuConvert.INSTANCE.convertList02(list)); } @GetMapping("/get") - @ApiOperation("获取菜单信息") + @Operation(summary = "获取菜单信息") @PreAuthorize("@ss.hasPermission('system:menu:query')") public CommonResult getMenu(Long id) { MenuDO menu = menuService.getMenu(id); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/PermissionController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/PermissionController.java index 01ae9ea7b..ca768d14f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/PermissionController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/PermissionController.java @@ -7,9 +7,9 @@ import cn.iocoder.yudao.module.system.controller.admin.permission.vo.permission. import cn.iocoder.yudao.module.system.controller.admin.permission.vo.permission.PermissionAssignUserRoleReqVO; import cn.iocoder.yudao.module.system.service.permission.PermissionService; import cn.iocoder.yudao.module.system.service.tenant.TenantService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -25,7 +25,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; * * @author 芋道源码 */ -@Api(tags = "管理后台 - 权限") +@Tag(name = "管理后台 - 权限") @RestController @RequestMapping("/system/permission") public class PermissionController { @@ -35,8 +35,8 @@ public class PermissionController { @Resource private TenantService tenantService; - @ApiOperation("获得角色拥有的菜单编号") - @ApiImplicitParam(name = "roleId", value = "角色编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "获得角色拥有的菜单编号") + @Parameter(name = "roleId", description = "角色编号", required = true) @GetMapping("/list-role-resources") @PreAuthorize("@ss.hasPermission('system:permission:assign-role-menu')") public CommonResult> listRoleMenus(Long roleId) { @@ -44,7 +44,7 @@ public class PermissionController { } @PostMapping("/assign-role-menu") - @ApiOperation("赋予角色菜单") + @Operation(summary = "赋予角色菜单") @PreAuthorize("@ss.hasPermission('system:permission:assign-role-menu')") public CommonResult assignRoleMenu(@Validated @RequestBody PermissionAssignRoleMenuReqVO reqVO) { // 开启多租户的情况下,需要过滤掉未开通的菜单 @@ -56,22 +56,22 @@ public class PermissionController { } @PostMapping("/assign-role-data-scope") - @ApiOperation("赋予角色数据权限") + @Operation(summary = "赋予角色数据权限") @PreAuthorize("@ss.hasPermission('system:permission:assign-role-data-scope')") public CommonResult assignRoleDataScope(@Valid @RequestBody PermissionAssignRoleDataScopeReqVO reqVO) { permissionService.assignRoleDataScope(reqVO.getRoleId(), reqVO.getDataScope(), reqVO.getDataScopeDeptIds()); return success(true); } - @ApiOperation("获得管理员拥有的角色编号列表") - @ApiImplicitParam(name = "userId", value = "用户编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "获得管理员拥有的角色编号列表") + @Parameter(name = "userId", description = "用户编号", required = true) @GetMapping("/list-user-roles") @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')") public CommonResult> listAdminRoles(@RequestParam("userId") Long userId) { return success(permissionService.getUserRoleIdListByUserId(userId)); } - @ApiOperation("赋予用户角色") + @Operation(summary = "赋予用户角色") @PostMapping("/assign-user-role") @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')") public CommonResult assignUserRole(@Validated @RequestBody PermissionAssignUserRoleReqVO reqVO) { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/RoleController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/RoleController.java index 3716c8e7c..2df1e74b0 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/RoleController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/RoleController.java @@ -9,9 +9,9 @@ import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.*; import cn.iocoder.yudao.module.system.convert.permission.RoleConvert; import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; import cn.iocoder.yudao.module.system.service.permission.RoleService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -20,14 +20,14 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.IOException; -import java.util.Collections; import java.util.Comparator; import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; +import static java.util.Collections.singleton; -@Api(tags = "管理后台 - 角色") +@Tag(name = "管理后台 - 角色") @RestController @RequestMapping("/system/role") @Validated @@ -37,14 +37,14 @@ public class RoleController { private RoleService roleService; @PostMapping("/create") - @ApiOperation("创建角色") + @Operation(summary = "创建角色") @PreAuthorize("@ss.hasPermission('system:role:create')") public CommonResult createRole(@Valid @RequestBody RoleCreateReqVO reqVO) { return success(roleService.createRole(reqVO, null)); } @PutMapping("/update") - @ApiOperation("修改角色") + @Operation(summary = "修改角色") @PreAuthorize("@ss.hasPermission('system:role:update')") public CommonResult updateRole(@Valid @RequestBody RoleUpdateReqVO reqVO) { roleService.updateRole(reqVO); @@ -52,7 +52,7 @@ public class RoleController { } @PutMapping("/update-status") - @ApiOperation("修改角色状态") + @Operation(summary = "修改角色状态") @PreAuthorize("@ss.hasPermission('system:role:update')") public CommonResult updateRoleStatus(@Valid @RequestBody RoleUpdateStatusReqVO reqVO) { roleService.updateRoleStatus(reqVO.getId(), reqVO.getStatus()); @@ -60,8 +60,8 @@ public class RoleController { } @DeleteMapping("/delete") - @ApiOperation("删除角色") - @ApiImplicitParam(name = "id", value = "角色编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "删除角色") + @Parameter(name = "id", description = "角色编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:role:delete')") public CommonResult deleteRole(@RequestParam("id") Long id) { roleService.deleteRole(id); @@ -69,7 +69,7 @@ public class RoleController { } @GetMapping("/get") - @ApiOperation("获得角色信息") + @Operation(summary = "获得角色信息") @PreAuthorize("@ss.hasPermission('system:role:query')") public CommonResult getRole(@RequestParam("id") Long id) { RoleDO role = roleService.getRole(id); @@ -77,17 +77,17 @@ public class RoleController { } @GetMapping("/page") - @ApiOperation("获得角色分页") + @Operation(summary = "获得角色分页") @PreAuthorize("@ss.hasPermission('system:role:query')") public CommonResult> getRolePage(RolePageReqVO reqVO) { return success(roleService.getRolePage(reqVO)); } @GetMapping("/list-all-simple") - @ApiOperation(value = "获取角色精简信息列表", notes = "只包含被开启的角色,主要用于前端的下拉选项") - public CommonResult> getSimpleRoles() { + @Operation(summary = "获取角色精简信息列表", description = "只包含被开启的角色,主要用于前端的下拉选项") + public CommonResult> getSimpleRoleList() { // 获得角色列表,只要开启状态的 - List list = roleService.getRoles(Collections.singleton(CommonStatusEnum.ENABLE.getStatus())); + List list = roleService.getRoleListByStatus(singleton(CommonStatusEnum.ENABLE.getStatus())); // 排序后,返回给前端 list.sort(Comparator.comparing(RoleDO::getSort)); return success(RoleConvert.INSTANCE.convertList02(list)); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuBaseVO.java index 7c64dd13f..3b89c7515 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -14,46 +14,46 @@ import javax.validation.constraints.Size; @Data public class MenuBaseVO { - @ApiModelProperty(value = "菜单名称", required = true, example = "芋道") + @Schema(description = "菜单名称", required = true, example = "芋道") @NotBlank(message = "菜单名称不能为空") @Size(max = 50, message = "菜单名称长度不能超过50个字符") private String name; - @ApiModelProperty(value = "权限标识", example = "sys:menu:add", notes = "仅菜单类型为按钮时,才需要传递") + @Schema(description = "权限标识,仅菜单类型为按钮时,才需要传递", example = "sys:menu:add") @Size(max = 100) private String permission; - @ApiModelProperty(value = "类型", required = true, example = "1", notes = "参见 MenuTypeEnum 枚举类") + @Schema(description = "类型,参见 MenuTypeEnum 枚举类", required = true, example = "1") @NotNull(message = "菜单类型不能为空") private Integer type; - @ApiModelProperty(value = "显示顺序不能为空", required = true, example = "1024") + @Schema(description = "显示顺序不能为空", required = true, example = "1024") @NotNull(message = "显示顺序不能为空") private Integer sort; - @ApiModelProperty(value = "父菜单 ID", required = true, example = "1024") + @Schema(description = "父菜单 ID", required = true, example = "1024") @NotNull(message = "父菜单 ID 不能为空") private Long parentId; - @ApiModelProperty(value = "路由地址", example = "post", notes = "仅菜单类型为菜单或者目录时,才需要传") + @Schema(description = "路由地址,仅菜单类型为菜单或者目录时,才需要传", example = "post") @Size(max = 200, message = "路由地址不能超过200个字符") private String path; - @ApiModelProperty(value = "菜单图标", example = "/menu/list", notes = "仅菜单类型为菜单或者目录时,才需要传") + @Schema(description = "菜单图标,仅菜单类型为菜单或者目录时,才需要传", example = "/menu/list") private String icon; - @ApiModelProperty(value = "组件路径", example = "system/post/index", notes = "仅菜单类型为菜单时,才需要传") + @Schema(description = "组件路径,仅菜单类型为菜单时,才需要传", example = "system/post/index") @Size(max = 200, message = "组件路径不能超过255个字符") private String component; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举") + @Schema(description = "状态,见 CommonStatusEnum 枚举", required = true, example = "1") @NotNull(message = "状态不能为空") private Integer status; - @ApiModelProperty(value = "是否可见", example = "false") + @Schema(description = "是否可见", example = "false") private Boolean visible; - @ApiModelProperty(value = "是否缓存", example = "false") + @Schema(description = "是否缓存", example = "false") private Boolean keepAlive; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuCreateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuCreateReqVO.java index a793997ff..56721b7fe 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuCreateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuCreateReqVO.java @@ -1,9 +1,9 @@ package cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -@ApiModel("管理后台 - 菜单创建 Request VO") +@Schema(description = "管理后台 - 菜单创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class MenuCreateReqVO extends MenuBaseVO { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuListReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuListReqVO.java index 2600fb92b..ce6cf5dbd 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuListReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuListReqVO.java @@ -1,17 +1,16 @@ package cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -@ApiModel("管理后台 - 菜单列表 Request VO") +@Schema(description = "管理后台 - 菜单列表 Request VO") @Data public class MenuListReqVO { - @ApiModelProperty(value = "菜单名称", example = "芋道", notes = "模糊匹配") + @Schema(description = "菜单名称,模糊匹配", example = "芋道") private String name; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1") private Integer status; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuRespVO.java index c6482b296..f85532639 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; @@ -9,20 +8,20 @@ import lombok.NoArgsConstructor; import java.time.LocalDateTime; -@ApiModel("管理后台 - 菜单信息 Response VO") +@Schema(description = "管理后台 - 菜单信息 Response VO") @Data @NoArgsConstructor @AllArgsConstructor @EqualsAndHashCode(callSuper = true) public class MenuRespVO extends MenuBaseVO { - @ApiModelProperty(value = "菜单编号", required = true, example = "1024") + @Schema(description = "菜单编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "状态,参见 CommonStatusEnum 枚举类", required = true, example = "1") private Integer status; - @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") + @Schema(description = "创建时间", required = true, example = "时间戳格式") private LocalDateTime createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuSimpleRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuSimpleRespVO.java index 8f99d1e21..bc8665ec1 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuSimpleRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuSimpleRespVO.java @@ -1,29 +1,28 @@ package cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 菜单精简信息 Response VO") +@Schema(description = "管理后台 - 菜单精简信息 Response VO") @Data @NoArgsConstructor @AllArgsConstructor public class MenuSimpleRespVO { - @ApiModelProperty(value = "菜单编号", required = true, example = "1024") + @Schema(description = "菜单编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "菜单名称", required = true, example = "芋道") + @Schema(description = "菜单名称", required = true, example = "芋道") private String name; - @ApiModelProperty(value = "父菜单 ID", required = true, example = "1024") + @Schema(description = "父菜单 ID", required = true, example = "1024") private Long parentId; - @ApiModelProperty(value = "类型", required = true, example = "1", notes = "参见 MenuTypeEnum 枚举类") + @Schema(description = "类型,参见 MenuTypeEnum 枚举类", required = true, example = "1") private Integer type; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuUpdateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuUpdateReqVO.java index 7a1784363..9346be045 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuUpdateReqVO.java @@ -1,17 +1,16 @@ package cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 菜单更新 Request VO") +@Schema(description = "管理后台 - 菜单更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class MenuUpdateReqVO extends MenuBaseVO { - @ApiModelProperty(value = "菜单编号", required = true, example = "1024") + @Schema(description = "菜单编号", required = true, example = "1024") @NotNull(message = "菜单编号不能为空") private Long id; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/permission/PermissionAssignRoleDataScopeReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/permission/PermissionAssignRoleDataScopeReqVO.java index 6adb8c854..3d6449c99 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/permission/PermissionAssignRoleDataScopeReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/permission/PermissionAssignRoleDataScopeReqVO.java @@ -1,27 +1,26 @@ package cn.iocoder.yudao.module.system.controller.admin.permission.vo.permission; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; import java.util.Collections; import java.util.Set; -@ApiModel("管理后台 - 赋予角色数据权限 Request VO") +@Schema(description = "管理后台 - 赋予角色数据权限 Request VO") @Data public class PermissionAssignRoleDataScopeReqVO { - @ApiModelProperty(value = "角色编号", required = true, example = "1") + @Schema(description = "角色编号", required = true, example = "1") @NotNull(message = "角色编号不能为空") private Long roleId; - @ApiModelProperty(value = "数据范围", required = true, example = "1", notes = "参见 DataScopeEnum 枚举类") + @Schema(description = "数据范围,参见 DataScopeEnum 枚举类", required = true, example = "1") @NotNull(message = "数据范围不能为空") // TODO 这里要多一个枚举校验 private Integer dataScope; - @ApiModelProperty(value = "部门编号列表", example = "1,3,5", notes = "只有范围类型为 DEPT_CUSTOM 时,该字段才需要") + @Schema(description = "部门编号列表,只有范围类型为 DEPT_CUSTOM 时,该字段才需要", example = "1,3,5") private Set dataScopeDeptIds = Collections.emptySet(); // 兜底 } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/permission/PermissionAssignRoleMenuReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/permission/PermissionAssignRoleMenuReqVO.java index 3fc4dcb2c..393ab47b2 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/permission/PermissionAssignRoleMenuReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/permission/PermissionAssignRoleMenuReqVO.java @@ -1,22 +1,21 @@ package cn.iocoder.yudao.module.system.controller.admin.permission.vo.permission; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; import java.util.Collections; import java.util.Set; -@ApiModel("管理后台 - 赋予角色菜单 Request VO") +@Schema(description = "管理后台 - 赋予角色菜单 Request VO") @Data public class PermissionAssignRoleMenuReqVO { - @ApiModelProperty(value = "角色编号", required = true, example = "1") + @Schema(description = "角色编号", required = true, example = "1") @NotNull(message = "角色编号不能为空") private Long roleId; - @ApiModelProperty(value = "菜单编号列表", example = "1,3,5") + @Schema(description = "菜单编号列表", example = "1,3,5") private Set menuIds = Collections.emptySet(); // 兜底 } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/permission/PermissionAssignUserRoleReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/permission/PermissionAssignUserRoleReqVO.java index 93cc8ffa2..74971401f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/permission/PermissionAssignUserRoleReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/permission/PermissionAssignUserRoleReqVO.java @@ -1,22 +1,21 @@ package cn.iocoder.yudao.module.system.controller.admin.permission.vo.permission; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; import java.util.Collections; import java.util.Set; -@ApiModel("管理后台 - 赋予用户角色 Request VO") +@Schema(description = "管理后台 - 赋予用户角色 Request VO") @Data public class PermissionAssignUserRoleReqVO { - @ApiModelProperty(value = "用户编号", required = true, example = "1") + @Schema(description = "用户编号", required = true, example = "1") @NotNull(message = "用户编号不能为空") private Long userId; - @ApiModelProperty(value = "角色编号列表", example = "1,3,5") + @Schema(description = "角色编号列表", example = "1,3,5") private Set roleIds = Collections.emptySet(); // 兜底 } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleBaseVO.java index 60d678aa9..84acfad92 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.permission.vo.role; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -14,21 +14,21 @@ import javax.validation.constraints.Size; @Data public class RoleBaseVO { - @ApiModelProperty(value = "角色名称", required = true, example = "管理员") + @Schema(description = "角色名称", required = true, example = "管理员") @NotBlank(message = "角色名称不能为空") @Size(max = 30, message = "角色名称长度不能超过30个字符") private String name; @NotBlank(message = "角色标志不能为空") @Size(max = 100, message = "角色标志长度不能超过100个字符") - @ApiModelProperty(value = "角色编码", required = true, example = "ADMIN") + @Schema(description = "角色编码", required = true, example = "ADMIN") private String code; - @ApiModelProperty(value = "显示顺序不能为空", required = true, example = "1024") + @Schema(description = "显示顺序不能为空", required = true, example = "1024") @NotNull(message = "显示顺序不能为空") private Integer sort; - @ApiModelProperty(value = "备注", example = "我是一个角色") + @Schema(description = "备注", example = "我是一个角色") private String remark; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleCreateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleCreateReqVO.java index 785f65815..ab4523f15 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleCreateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleCreateReqVO.java @@ -1,10 +1,10 @@ package cn.iocoder.yudao.module.system.controller.admin.permission.vo.role; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; -@ApiModel("管理后台 - 角色创建 Request VO") +@Schema(description = "管理后台 - 角色创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class RoleCreateReqVO extends RoleBaseVO { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleExportReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleExportReqVO.java index ca9bed7cd..f13e91f33 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleExportReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleExportReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.permission.vo.role; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -9,20 +8,20 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 角色分页 Request VO") +@Schema(description = "管理后台 - 角色分页 Request VO") @Data public class RoleExportReqVO { - @ApiModelProperty(value = "角色名称", example = "芋道", notes = "模糊匹配") + @Schema(description = "角色名称,模糊匹配", example = "芋道") private String name; - @ApiModelProperty(value = "角色标识", example = "yudao", notes = "模糊匹配") + @Schema(description = "角色标识,模糊匹配", example = "yudao") private String code; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1") private Integer status; - @ApiModelProperty(value = "开始时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") + @Schema(description = "开始时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RolePageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RolePageReqVO.java index 040462a6f..cc0f0040d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RolePageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RolePageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.permission.vo.role; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.springframework.format.annotation.DateTimeFormat; @@ -11,21 +10,21 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 角色分页 Request VO") +@Schema(description = "管理后台 - 角色分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class RolePageReqVO extends PageParam { - @ApiModelProperty(value = "角色名称", example = "芋道", notes = "模糊匹配") + @Schema(description = "角色名称,模糊匹配", example = "芋道") private String name; - @ApiModelProperty(value = "角色标识", example = "yudao", notes = "模糊匹配") + @Schema(description = "角色标识,模糊匹配", example = "yudao") private String code; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1") private Integer status; - @ApiModelProperty(value = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") + @Schema(description = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleRespVO.java index 6653820b0..b4090f40e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.permission.vo.role; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; @@ -10,29 +9,29 @@ import lombok.NoArgsConstructor; import java.time.LocalDateTime; import java.util.Set; -@ApiModel("管理后台 - 角色信息 Response VO") +@Schema(description = "管理后台 - 角色信息 Response VO") @Data @NoArgsConstructor @AllArgsConstructor @EqualsAndHashCode(callSuper = true) public class RoleRespVO extends RoleBaseVO { - @ApiModelProperty(value = "角色编号", required = true, example = "1") + @Schema(description = "角色编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "数据范围", required = true, example = "1", notes = "参见 DataScopeEnum 枚举类") + @Schema(description = "数据范围,参见 DataScopeEnum 枚举类", required = true, example = "1") private Integer dataScope; - @ApiModelProperty(value = "数据范围(指定部门数组)", example = "1") + @Schema(description = "数据范围(指定部门数组)", example = "1") private Set dataScopeDeptIds; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "状态,参见 CommonStatusEnum 枚举类", required = true, example = "1") private Integer status; - @ApiModelProperty(value = "角色类型", required = true, example = "1", notes = "参见 RoleTypeEnum 枚举类") + @Schema(description = "角色类型,参见 RoleTypeEnum 枚举类", required = true, example = "1") private Integer type; - @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") + @Schema(description = "创建时间", required = true, example = "时间戳格式") private LocalDateTime createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleSimpleRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleSimpleRespVO.java index c0a4c3083..d0404da61 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleSimpleRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleSimpleRespVO.java @@ -1,21 +1,20 @@ package cn.iocoder.yudao.module.system.controller.admin.permission.vo.role; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; -@ApiModel("管理后台 - 角色精简信息 Response VO") +@Schema(description = "管理后台 - 角色精简信息 Response VO") @Data @NoArgsConstructor @AllArgsConstructor public class RoleSimpleRespVO { - @ApiModelProperty(value = "角色编号", required = true, example = "1024") + @Schema(description = "角色编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "角色名称", required = true, example = "芋道") + @Schema(description = "角色名称", required = true, example = "芋道") private String name; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleUpdateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleUpdateReqVO.java index 362cbb290..367fcf943 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleUpdateReqVO.java @@ -1,18 +1,17 @@ package cn.iocoder.yudao.module.system.controller.admin.permission.vo.role; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 角色更新 Request VO") +@Schema(description = "管理后台 - 角色更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class RoleUpdateReqVO extends RoleBaseVO { - @ApiModelProperty(value = "角色编号", required = true, example = "1024") + @Schema(description = "角色编号", required = true, example = "1024") @NotNull(message = "角色编号不能为空") private Long id; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleUpdateStatusReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleUpdateStatusReqVO.java index 790accd92..5f51b5757 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleUpdateStatusReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/role/RoleUpdateStatusReqVO.java @@ -2,21 +2,20 @@ package cn.iocoder.yudao.module.system.controller.admin.permission.vo.role; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.validation.InEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 角色更新状态 Request VO") +@Schema(description = "管理后台 - 角色更新状态 Request VO") @Data public class RoleUpdateStatusReqVO { - @ApiModelProperty(value = "角色编号", required = true, example = "1024") + @Schema(description = "角色编号", required = true, example = "1024") @NotNull(message = "角色编号不能为空") private Long id; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举") + @Schema(description = "状态,见 CommonStatusEnum 枚举", required = true, example = "1") @NotNull(message = "状态不能为空") @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") private Integer status; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/SensitiveWordController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/SensitiveWordController.java index e9536ad9a..ab0a129df 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/SensitiveWordController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/SensitiveWordController.java @@ -8,9 +8,9 @@ import cn.iocoder.yudao.module.system.controller.admin.sensitiveword.vo.*; import cn.iocoder.yudao.module.system.convert.sensitiveword.SensitiveWordConvert; import cn.iocoder.yudao.module.system.dal.dataobject.sensitiveword.SensitiveWordDO; import cn.iocoder.yudao.module.system.service.sensitiveword.SensitiveWordService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -25,7 +25,7 @@ import java.util.Set; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; -@Api(tags = "管理后台 - 敏感词") +@Tag(name = "管理后台 - 敏感词") @RestController @RequestMapping("/system/sensitive-word") @Validated @@ -35,14 +35,14 @@ public class SensitiveWordController { private SensitiveWordService sensitiveWordService; @PostMapping("/create") - @ApiOperation("创建敏感词") + @Operation(summary = "创建敏感词") @PreAuthorize("@ss.hasPermission('system:sensitive-word:create')") public CommonResult createSensitiveWord(@Valid @RequestBody SensitiveWordCreateReqVO createReqVO) { return success(sensitiveWordService.createSensitiveWord(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新敏感词") + @Operation(summary = "更新敏感词") @PreAuthorize("@ss.hasPermission('system:sensitive-word:update')") public CommonResult updateSensitiveWord(@Valid @RequestBody SensitiveWordUpdateReqVO updateReqVO) { sensitiveWordService.updateSensitiveWord(updateReqVO); @@ -50,8 +50,8 @@ public class SensitiveWordController { } @DeleteMapping("/delete") - @ApiOperation("删除敏感词") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除敏感词") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('system:sensitive-word:delete')") public CommonResult deleteSensitiveWord(@RequestParam("id") Long id) { sensitiveWordService.deleteSensitiveWord(id); @@ -59,8 +59,8 @@ public class SensitiveWordController { } @GetMapping("/get") - @ApiOperation("获得敏感词") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得敏感词") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:sensitive-word:query')") public CommonResult getSensitiveWord(@RequestParam("id") Long id) { SensitiveWordDO sensitiveWord = sensitiveWordService.getSensitiveWord(id); @@ -68,7 +68,7 @@ public class SensitiveWordController { } @GetMapping("/page") - @ApiOperation("获得敏感词分页") + @Operation(summary = "获得敏感词分页") @PreAuthorize("@ss.hasPermission('system:sensitive-word:query')") public CommonResult> getSensitiveWordPage(@Valid SensitiveWordPageReqVO pageVO) { PageResult pageResult = sensitiveWordService.getSensitiveWordPage(pageVO); @@ -76,7 +76,7 @@ public class SensitiveWordController { } @GetMapping("/export-excel") - @ApiOperation("导出敏感词 Excel") + @Operation(summary = "导出敏感词 Excel") @PreAuthorize("@ss.hasPermission('system:sensitive-word:export')") @OperateLog(type = EXPORT) public void exportSensitiveWordExcel(@Valid SensitiveWordExportReqVO exportReqVO, @@ -88,14 +88,14 @@ public class SensitiveWordController { } @GetMapping("/get-tags") - @ApiOperation("获取所有敏感词的标签数组") + @Operation(summary = "获取所有敏感词的标签数组") @PreAuthorize("@ss.hasPermission('system:sensitive-word:query')") - public CommonResult> getSensitiveWordTags() throws IOException { - return success(sensitiveWordService.getSensitiveWordTags()); + public CommonResult> getSensitiveWordTagSet() { + return success(sensitiveWordService.getSensitiveWordTagSet()); } @GetMapping("/validate-text") - @ApiOperation("获得文本所包含的不合法的敏感词数组") + @Operation(summary = "获得文本所包含的不合法的敏感词数组") public CommonResult> validateText(@RequestParam("text") String text, @RequestParam(value = "tags", required = false) List tags) { return success(sensitiveWordService.validateText(text, tags)); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordBaseVO.java index 770a22b92..408e952de 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.sensitiveword.vo; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; @@ -13,19 +13,19 @@ import java.util.List; @Data public class SensitiveWordBaseVO { - @ApiModelProperty(value = "敏感词", required = true, example = "敏感词") + @Schema(description = "敏感词", required = true, example = "敏感词") @NotNull(message = "敏感词不能为空") private String name; - @ApiModelProperty(value = "标签", required = true, example = "短信,评论") + @Schema(description = "标签", required = true, example = "短信,评论") @NotNull(message = "标签不能为空") private List tags; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "状态,参见 CommonStatusEnum 枚举类", required = true, example = "1") @NotNull(message = "状态不能为空") private Integer status; - @ApiModelProperty(value = "描述", example = "污言秽语") + @Schema(description = "描述", example = "污言秽语") private String description; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordCreateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordCreateReqVO.java index bb206652b..2e2e89df5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordCreateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordCreateReqVO.java @@ -1,11 +1,11 @@ package cn.iocoder.yudao.module.system.controller.admin.sensitiveword.vo; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 敏感词创建 Request VO") +@Schema(description = "管理后台 - 敏感词创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordExportReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordExportReqVO.java index 1addc4cfe..f5f3c4442 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordExportReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordExportReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.sensitiveword.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -9,21 +8,21 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel(value = "管理后台 - 敏感词 Excel 导出 Request VO", description = "参数和 SensitiveWordPageReqVO 是一致的") +@Schema(description = "管理后台 - 敏感词 Excel 导出 Request VO,参数和 SensitiveWordPageReqVO 是一致的") @Data public class SensitiveWordExportReqVO { - @ApiModelProperty(value = "敏感词", example = "敏感词") + @Schema(description = "敏感词", example = "敏感词") private String name; - @ApiModelProperty(value = "标签", example = "短信,评论") + @Schema(description = "标签", example = "短信,评论") private String tag; - @ApiModelProperty(value = "状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "状态,参见 CommonStatusEnum 枚举类", example = "1") private Integer status; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordPageReqVO.java index 087670180..173162194 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordPageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.sensitiveword.vo; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,23 +11,23 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 敏感词分页 Request VO") +@Schema(description = "管理后台 - 敏感词分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class SensitiveWordPageReqVO extends PageParam { - @ApiModelProperty(value = "敏感词", example = "敏感词") + @Schema(description = "敏感词", example = "敏感词") private String name; - @ApiModelProperty(value = "标签", example = "短信,评论") + @Schema(description = "标签", example = "短信,评论") private String tag; - @ApiModelProperty(value = "状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "状态,参见 CommonStatusEnum 枚举类", example = "1") private Integer status; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordRespVO.java index c92a8d4e0..28849b408 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordRespVO.java @@ -1,23 +1,22 @@ package cn.iocoder.yudao.module.system.controller.admin.sensitiveword.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 敏感词 Response VO") +@Schema(description = "管理后台 - 敏感词 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class SensitiveWordRespVO extends SensitiveWordBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1") + @Schema(description = "编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordUpdateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordUpdateReqVO.java index f87aa3a62..58828115e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sensitiveword/vo/SensitiveWordUpdateReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.system.controller.admin.sensitiveword.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 敏感词更新 Request VO") +@Schema(description = "管理后台 - 敏感词更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class SensitiveWordUpdateReqVO extends SensitiveWordBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1") + @Schema(description = "编号", required = true, example = "1") @NotNull(message = "编号不能为空") private Long id; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java index 8a0767652..05f13d257 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsCallbackController.java @@ -5,8 +5,8 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; import cn.iocoder.yudao.framework.sms.core.enums.SmsChannelEnum; import cn.iocoder.yudao.module.system.service.sms.SmsSendService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -17,7 +17,7 @@ import javax.servlet.http.HttpServletRequest; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 短信回调") +@Tag(name = "管理后台 - 短信回调") @RestController @RequestMapping("/system/sms/callback") public class SmsCallbackController { @@ -27,7 +27,7 @@ public class SmsCallbackController { @PostMapping("/aliyun") @PermitAll - @ApiOperation(value = "阿里云短信的回调", notes = "参见 https://help.aliyun.com/document_detail/120998.html 文档") + @Operation(summary = "阿里云短信的回调", description = "参见 https://help.aliyun.com/document_detail/120998.html 文档") @OperateLog(enable = false) public CommonResult receiveAliyunSmsStatus(HttpServletRequest request) throws Throwable { String text = ServletUtil.getBody(request); @@ -37,7 +37,7 @@ public class SmsCallbackController { @PostMapping("/tencent") @PermitAll - @ApiOperation(value = "腾讯云短信的回调", notes = "参见 https://cloud.tencent.com/document/product/382/52077 文档") + @Operation(summary = "腾讯云短信的回调", description = "参见 https://cloud.tencent.com/document/product/382/52077 文档") @OperateLog(enable = false) public CommonResult receiveTencentSmsStatus(HttpServletRequest request) throws Throwable { String text = ServletUtil.getBody(request); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsChannelController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsChannelController.java index 638140d21..b6512a601 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsChannelController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsChannelController.java @@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; import cn.iocoder.yudao.module.system.service.sms.SmsChannelService; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; @@ -19,7 +19,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 短信渠道") +@Tag(name = "管理后台 - 短信渠道") @RestController @RequestMapping("system/sms-channel") public class SmsChannelController { @@ -28,14 +28,14 @@ public class SmsChannelController { private SmsChannelService smsChannelService; @PostMapping("/create") - @ApiOperation("创建短信渠道") + @Operation(summary = "创建短信渠道") @PreAuthorize("@ss.hasPermission('system:sms-channel:create')") public CommonResult createSmsChannel(@Valid @RequestBody SmsChannelCreateReqVO createReqVO) { return success(smsChannelService.createSmsChannel(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新短信渠道") + @Operation(summary = "更新短信渠道") @PreAuthorize("@ss.hasPermission('system:sms-channel:update')") public CommonResult updateSmsChannel(@Valid @RequestBody SmsChannelUpdateReqVO updateReqVO) { smsChannelService.updateSmsChannel(updateReqVO); @@ -43,8 +43,8 @@ public class SmsChannelController { } @DeleteMapping("/delete") - @ApiOperation("删除短信渠道") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除短信渠道") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('system:sms-channel:delete')") public CommonResult deleteSmsChannel(@RequestParam("id") Long id) { smsChannelService.deleteSmsChannel(id); @@ -52,8 +52,8 @@ public class SmsChannelController { } @GetMapping("/get") - @ApiOperation("获得短信渠道") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得短信渠道") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:sms-channel:query')") public CommonResult getSmsChannel(@RequestParam("id") Long id) { SmsChannelDO smsChannel = smsChannelService.getSmsChannel(id); @@ -61,7 +61,7 @@ public class SmsChannelController { } @GetMapping("/page") - @ApiOperation("获得短信渠道分页") + @Operation(summary = "获得短信渠道分页") @PreAuthorize("@ss.hasPermission('system:sms-channel:query')") public CommonResult> getSmsChannelPage(@Valid SmsChannelPageReqVO pageVO) { PageResult pageResult = smsChannelService.getSmsChannelPage(pageVO); @@ -69,8 +69,8 @@ public class SmsChannelController { } @GetMapping("/list-all-simple") - @ApiOperation(value = "获得短信渠道精简列表", notes = "包含被禁用的短信渠道") - public CommonResult> getSimpleSmsChannels() { + @Operation(summary = "获得短信渠道精简列表", description = "包含被禁用的短信渠道") + public CommonResult> getSimpleSmsChannelList() { List list = smsChannelService.getSmsChannelList(); // 排序后,返回给前端 list.sort(Comparator.comparing(SmsChannelDO::getId)); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsLogController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsLogController.java index 5fbf10e74..27b957bd6 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsLogController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsLogController.java @@ -11,8 +11,8 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; @@ -28,7 +28,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; -@Api(tags = "管理后台 - 短信日志") +@Tag(name = "管理后台 - 短信日志") @RestController @RequestMapping("/system/sms-log") @Validated @@ -38,7 +38,7 @@ public class SmsLogController { private SmsLogService smsLogService; @GetMapping("/page") - @ApiOperation("获得短信日志分页") + @Operation(summary = "获得短信日志分页") @PreAuthorize("@ss.hasPermission('system:sms-log:query')") public CommonResult> getSmsLogPage(@Valid SmsLogPageReqVO pageVO) { PageResult pageResult = smsLogService.getSmsLogPage(pageVO); @@ -46,7 +46,7 @@ public class SmsLogController { } @GetMapping("/export-excel") - @ApiOperation("导出短信日志 Excel") + @Operation(summary = "导出短信日志 Excel") @PreAuthorize("@ss.hasPermission('system:sms-log:export')") @OperateLog(type = EXPORT) public void exportSmsLogExcel(@Valid SmsLogExportReqVO exportReqVO, diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsTemplateController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsTemplateController.java index 3eef58652..173d8f643 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsTemplateController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/SmsTemplateController.java @@ -9,9 +9,9 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; @@ -24,7 +24,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; -@Api(tags = "管理后台 - 短信模板") +@Tag(name = "管理后台 - 短信模板") @RestController @RequestMapping("/system/sms-template") public class SmsTemplateController { @@ -35,14 +35,14 @@ public class SmsTemplateController { private SmsSendService smsSendService; @PostMapping("/create") - @ApiOperation("创建短信模板") + @Operation(summary = "创建短信模板") @PreAuthorize("@ss.hasPermission('system:sms-template:create')") public CommonResult createSmsTemplate(@Valid @RequestBody SmsTemplateCreateReqVO createReqVO) { return success(smsTemplateService.createSmsTemplate(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新短信模板") + @Operation(summary = "更新短信模板") @PreAuthorize("@ss.hasPermission('system:sms-template:update')") public CommonResult updateSmsTemplate(@Valid @RequestBody SmsTemplateUpdateReqVO updateReqVO) { smsTemplateService.updateSmsTemplate(updateReqVO); @@ -50,8 +50,8 @@ public class SmsTemplateController { } @DeleteMapping("/delete") - @ApiOperation("删除短信模板") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除短信模板") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('system:sms-template:delete')") public CommonResult deleteSmsTemplate(@RequestParam("id") Long id) { smsTemplateService.deleteSmsTemplate(id); @@ -59,8 +59,8 @@ public class SmsTemplateController { } @GetMapping("/get") - @ApiOperation("获得短信模板") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得短信模板") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:sms-template:query')") public CommonResult getSmsTemplate(@RequestParam("id") Long id) { SmsTemplateDO smsTemplate = smsTemplateService.getSmsTemplate(id); @@ -68,7 +68,7 @@ public class SmsTemplateController { } @GetMapping("/page") - @ApiOperation("获得短信模板分页") + @Operation(summary = "获得短信模板分页") @PreAuthorize("@ss.hasPermission('system:sms-template:query')") public CommonResult> getSmsTemplatePage(@Valid SmsTemplatePageReqVO pageVO) { PageResult pageResult = smsTemplateService.getSmsTemplatePage(pageVO); @@ -76,7 +76,7 @@ public class SmsTemplateController { } @GetMapping("/export-excel") - @ApiOperation("导出短信模板 Excel") + @Operation(summary = "导出短信模板 Excel") @PreAuthorize("@ss.hasPermission('system:sms-template:export')") @OperateLog(type = EXPORT) public void exportSmsTemplateExcel(@Valid SmsTemplateExportReqVO exportReqVO, @@ -88,7 +88,7 @@ public class SmsTemplateController { } @PostMapping("/send-sms") - @ApiOperation("发送短信") + @Operation(summary = "发送短信") @PreAuthorize("@ss.hasPermission('system:sms-template:send-sms')") public CommonResult sendSms(@Valid @RequestBody SmsTemplateSendReqVO sendReqVO) { return success(smsSendService.sendSingleSmsToAdmin(sendReqVO.getMobile(), null, diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelBaseVO.java index b98697d5a..6c97f06de 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelBaseVO.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel; - -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.hibernate.validator.constraints.URL; @@ -13,25 +12,25 @@ import javax.validation.constraints.NotNull; @Data public class SmsChannelBaseVO { - @ApiModelProperty(value = "短信签名", required = true, example = "芋道源码") + @Schema(description = "短信签名", required = true, example = "芋道源码") @NotNull(message = "短信签名不能为空") private String signature; - @ApiModelProperty(value = "启用状态", required = true, example = "1") + @Schema(description = "启用状态", required = true, example = "1") @NotNull(message = "启用状态不能为空") private Integer status; - @ApiModelProperty(value = "备注", example = "好吃!") + @Schema(description = "备注", example = "好吃!") private String remark; - @ApiModelProperty(value = "短信 API 的账号", required = true, example = "yudao") + @Schema(description = "短信 API 的账号", required = true, example = "yudao") @NotNull(message = "短信 API 的账号不能为空") private String apiKey; - @ApiModelProperty(value = "短信 API 的密钥", example = "yuanma") + @Schema(description = "短信 API 的密钥", example = "yuanma") private String apiSecret; - @ApiModelProperty(value = "短信发送回调 URL", example = "http://www.iocoder.cn") + @Schema(description = "短信发送回调 URL", example = "http://www.iocoder.cn") @URL(message = "回调 URL 格式不正确") private String callbackUrl; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelCreateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelCreateReqVO.java index edc162f47..31671a572 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelCreateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelCreateReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 短信渠道创建 Request VO") +@Schema(description = "管理后台 - 短信渠道创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class SmsChannelCreateReqVO extends SmsChannelBaseVO { - @ApiModelProperty(value = "渠道编码", required = true, example = "YUN_PIAN", notes = "参见 SmsChannelEnum 枚举类") + @Schema(description = "渠道编码,参见 SmsChannelEnum 枚举类", required = true, example = "YUN_PIAN") @NotNull(message = "渠道编码不能为空") private String code; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelPageReqVO.java index f35c5e8ac..a0c5baaf6 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelPageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,20 +11,20 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 短信渠道分页 Request VO") +@Schema(description = "管理后台 - 短信渠道分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class SmsChannelPageReqVO extends PageParam { - @ApiModelProperty(value = "任务状态", example = "1") + @Schema(description = "任务状态", example = "1") private Integer status; - @ApiModelProperty(value = "短信签名", example = "芋道源码", notes = "模糊匹配") + @Schema(description = "短信签名,模糊匹配", example = "芋道源码") private String signature; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelRespVO.java index d52b6d9e7..27b09d60b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelRespVO.java @@ -1,26 +1,25 @@ package cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 短信渠道 Response VO") +@Schema(description = "管理后台 - 短信渠道 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class SmsChannelRespVO extends SmsChannelBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "渠道编码", required = true, example = "YUN_PIAN", notes = "参见 SmsChannelEnum 枚举类") + @Schema(description = "渠道编码,参见 SmsChannelEnum 枚举类", required = true, example = "YUN_PIAN") private String code; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelSimpleRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelSimpleRespVO.java index 22b5bc1d4..b9a3f46c0 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelSimpleRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelSimpleRespVO.java @@ -1,24 +1,23 @@ package cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 短信渠道精简 Response VO") +@Schema(description = "管理后台 - 短信渠道精简 Response VO") @Data public class SmsChannelSimpleRespVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") @NotNull(message = "编号不能为空") private Long id; - @ApiModelProperty(value = "短信签名", required = true, example = "芋道源码") + @Schema(description = "短信签名", required = true, example = "芋道源码") @NotNull(message = "短信签名不能为空") private String signature; - @ApiModelProperty(value = "渠道编码", required = true, example = "YUN_PIAN", notes = "参见 SmsChannelEnum 枚举类") + @Schema(description = "渠道编码,参见 SmsChannelEnum 枚举类", required = true, example = "YUN_PIAN") private String code; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelUpdateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelUpdateReqVO.java index 683328745..3379649f1 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/channel/SmsChannelUpdateReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 短信渠道更新 Request VO") +@Schema(description = "管理后台 - 短信渠道更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class SmsChannelUpdateReqVO extends SmsChannelBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") @NotNull(message = "编号不能为空") private Long id; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogExportReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogExportReqVO.java index 55a723a9c..739e630eb 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogExportReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogExportReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.sms.vo.log; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -9,31 +8,31 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel(value = "管理后台 - 短信日志 Excel 导出 Request VO", description = "参数和 SmsLogPageReqVO 是一致的") +@Schema(description = "管理后台 - 短信日志 Excel 导出 Request VO,参数和 SmsLogPageReqVO 是一致的") @Data public class SmsLogExportReqVO { - @ApiModelProperty(value = "短信渠道编号", example = "10") + @Schema(description = "短信渠道编号", example = "10") private Long channelId; - @ApiModelProperty(value = "模板编号", example = "20") + @Schema(description = "模板编号", example = "20") private Long templateId; - @ApiModelProperty(value = "手机号", example = "15601691300") + @Schema(description = "手机号", example = "15601691300") private String mobile; - @ApiModelProperty(value = "发送状态", example = "1") + @Schema(description = "发送状态", example = "1") private Integer sendStatus; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "开始发送时间") + @Schema(description = "开始发送时间") private LocalDateTime[] sendTime; - @ApiModelProperty(value = "接收状态", example = "0") + @Schema(description = "接收状态", example = "0") private Integer receiveStatus; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "开始接收时间") + @Schema(description = "开始接收时间") private LocalDateTime[] receiveTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogPageReqVO.java index 87e804796..0da70bd12 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogPageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.sms.vo.log; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,33 +11,33 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 短信日志分页 Request VO") +@Schema(description = "管理后台 - 短信日志分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class SmsLogPageReqVO extends PageParam { - @ApiModelProperty(value = "短信渠道编号", example = "10") + @Schema(description = "短信渠道编号", example = "10") private Long channelId; - @ApiModelProperty(value = "模板编号", example = "20") + @Schema(description = "模板编号", example = "20") private Long templateId; - @ApiModelProperty(value = "手机号", example = "15601691300") + @Schema(description = "手机号", example = "15601691300") private String mobile; - @ApiModelProperty(value = "发送状态", example = "1", notes = "参见 SmsSendStatusEnum 枚举类") + @Schema(description = "发送状态,参见 SmsSendStatusEnum 枚举类", example = "1") private Integer sendStatus; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "发送时间") + @Schema(description = "发送时间") private LocalDateTime[] sendTime; - @ApiModelProperty(value = "接收状态", example = "0", notes = "参见 SmsReceiveStatusEnum 枚举类") + @Schema(description = "接收状态,参见 SmsReceiveStatusEnum 枚举类", example = "0") private Integer receiveStatus; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "接收时间") + @Schema(description = "接收时间") private LocalDateTime[] receiveTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogRespVO.java index aee9657c8..2780b5de1 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/log/SmsLogRespVO.java @@ -1,89 +1,88 @@ package cn.iocoder.yudao.module.system.controller.admin.sms.vo.log; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.time.LocalDateTime; import java.util.Map; -@ApiModel("管理后台 - 短信日志 Response VO") +@Schema(description = "管理后台 - 短信日志 Response VO") @Data public class SmsLogRespVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "短信渠道编号", required = true, example = "10") + @Schema(description = "短信渠道编号", required = true, example = "10") private Long channelId; - @ApiModelProperty(value = "短信渠道编码", required = true, example = "ALIYUN") + @Schema(description = "短信渠道编码", required = true, example = "ALIYUN") private String channelCode; - @ApiModelProperty(value = "模板编号", required = true, example = "20") + @Schema(description = "模板编号", required = true, example = "20") private Long templateId; - @ApiModelProperty(value = "模板编码", required = true, example = "test-01") + @Schema(description = "模板编码", required = true, example = "test-01") private String templateCode; - @ApiModelProperty(value = "短信类型", required = true, example = "1") + @Schema(description = "短信类型", required = true, example = "1") private Integer templateType; - @ApiModelProperty(value = "短信内容", required = true, example = "你好,你的验证码是 1024") + @Schema(description = "短信内容", required = true, example = "你好,你的验证码是 1024") private String templateContent; - @ApiModelProperty(value = "短信参数", required = true, example = "name,code") + @Schema(description = "短信参数", required = true, example = "name,code") private Map templateParams; - @ApiModelProperty(value = "短信 API 的模板编号", required = true, example = "SMS_207945135") + @Schema(description = "短信 API 的模板编号", required = true, example = "SMS_207945135") private String apiTemplateId; - @ApiModelProperty(value = "手机号", required = true, example = "15601691300") + @Schema(description = "手机号", required = true, example = "15601691300") private String mobile; - @ApiModelProperty(value = "用户编号", example = "10") + @Schema(description = "用户编号", example = "10") private Long userId; - @ApiModelProperty(value = "用户类型", example = "1") + @Schema(description = "用户类型", example = "1") private Integer userType; - @ApiModelProperty(value = "发送状态", required = true, example = "1") + @Schema(description = "发送状态", required = true, example = "1") private Integer sendStatus; - @ApiModelProperty(value = "发送时间") + @Schema(description = "发送时间") private LocalDateTime sendTime; - @ApiModelProperty(value = "发送结果的编码", example = "0") + @Schema(description = "发送结果的编码", example = "0") private Integer sendCode; - @ApiModelProperty(value = "发送结果的提示", example = "成功") + @Schema(description = "发送结果的提示", example = "成功") private String sendMsg; - @ApiModelProperty(value = "短信 API 发送结果的编码", example = "SUCCESS") + @Schema(description = "短信 API 发送结果的编码", example = "SUCCESS") private String apiSendCode; - @ApiModelProperty(value = "短信 API 发送失败的提示", example = "成功") + @Schema(description = "短信 API 发送失败的提示", example = "成功") private String apiSendMsg; - @ApiModelProperty(value = "短信 API 发送返回的唯一请求 ID", example = "3837C6D3-B96F-428C-BBB2-86135D4B5B99") + @Schema(description = "短信 API 发送返回的唯一请求 ID", example = "3837C6D3-B96F-428C-BBB2-86135D4B5B99") private String apiRequestId; - @ApiModelProperty(value = "短信 API 发送返回的序号", example = "62923244790") + @Schema(description = "短信 API 发送返回的序号", example = "62923244790") private String apiSerialNo; - @ApiModelProperty(value = "接收状态", required = true, example = "0") + @Schema(description = "接收状态", required = true, example = "0") private Integer receiveStatus; - @ApiModelProperty(value = "接收时间") + @Schema(description = "接收时间") private LocalDateTime receiveTime; - @ApiModelProperty(value = "API 接收结果的编码", example = "DELIVRD") + @Schema(description = "API 接收结果的编码", example = "DELIVRD") private String apiReceiveCode; - @ApiModelProperty(value = "API 接收结果的说明", example = "用户接收成功") + @Schema(description = "API 接收结果的说明", example = "用户接收成功") private String apiReceiveMsg; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateBaseVO.java index ca9220f8a..dc33b45c0 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateBaseVO.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.system.controller.admin.sms.vo.template; - -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; @@ -12,34 +11,34 @@ import javax.validation.constraints.NotNull; @Data public class SmsTemplateBaseVO { - @ApiModelProperty(value = "短信类型", required = true, example = "1", notes = "参见 SmsTemplateTypeEnum 枚举类") + @Schema(description = "短信类型,参见 SmsTemplateTypeEnum 枚举类", required = true, example = "1") @NotNull(message = "短信类型不能为空") private Integer type; - @ApiModelProperty(value = "开启状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "开启状态,参见 CommonStatusEnum 枚举类", required = true, example = "1") @NotNull(message = "开启状态不能为空") private Integer status; - @ApiModelProperty(value = "模板编码", required = true, example = "test_01") + @Schema(description = "模板编码", required = true, example = "test_01") @NotNull(message = "模板编码不能为空") private String code; - @ApiModelProperty(value = "模板名称", required = true, example = "yudao") + @Schema(description = "模板名称", required = true, example = "yudao") @NotNull(message = "模板名称不能为空") private String name; - @ApiModelProperty(value = "模板内容", required = true, example = "你好,{name}。你长的太{like}啦!") + @Schema(description = "模板内容", required = true, example = "你好,{name}。你长的太{like}啦!") @NotNull(message = "模板内容不能为空") private String content; - @ApiModelProperty(value = "备注", example = "哈哈哈") + @Schema(description = "备注", example = "哈哈哈") private String remark; - @ApiModelProperty(value = "短信 API 的模板编号", required = true, example = "4383920") + @Schema(description = "短信 API 的模板编号", required = true, example = "4383920") @NotNull(message = "短信 API 的模板编号不能为空") private String apiTemplateId; - @ApiModelProperty(value = "短信渠道编号", required = true, example = "10") + @Schema(description = "短信渠道编号", required = true, example = "10") @NotNull(message = "短信渠道编号不能为空") private Long channelId; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateCreateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateCreateReqVO.java index ab8b89ebd..737a16a45 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateCreateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateCreateReqVO.java @@ -1,11 +1,10 @@ package cn.iocoder.yudao.module.system.controller.admin.sms.vo.template; - -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 短信模板创建 Request VO") +@Schema(description = "管理后台 - 短信模板创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateExportReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateExportReqVO.java index df5947adc..93d157340 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateExportReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateExportReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.sms.vo.template; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -9,30 +8,30 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel(value = "管理后台 - 短信模板 Excel 导出 Request VO", description = "参数和 SmsTemplatePageReqVO 是一致的") +@Schema(description = "管理后台 - 短信模板 Excel 导出 Request VO,参数和 SmsTemplatePageReqVO 是一致的") @Data public class SmsTemplateExportReqVO { - @ApiModelProperty(value = "短信签名", example = "1") + @Schema(description = "短信签名", example = "1") private Integer type; - @ApiModelProperty(value = "开启状态", example = "1") + @Schema(description = "开启状态", example = "1") private Integer status; - @ApiModelProperty(value = "模板编码", example = "test_01", notes = "模糊匹配") + @Schema(description = "模板编码,模糊匹配", example = "test_01") private String code; - @ApiModelProperty(value = "模板内容", example = "你好,{name}。你长的太{like}啦!", notes = "模糊匹配") + @Schema(description = "模板内容,模糊匹配", example = "你好,{name}。你长的太{like}啦!") private String content; - @ApiModelProperty(value = "短信 API 的模板编号", example = "4383920", notes = "模糊匹配") + @Schema(description = "短信 API 的模板编号,模糊匹配", example = "4383920") private String apiTemplateId; - @ApiModelProperty(value = "短信渠道编号", example = "10") + @Schema(description = "短信渠道编号", example = "10") private Long channelId; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplatePageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplatePageReqVO.java index 129e0f7a8..89ae459f5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplatePageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplatePageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.sms.vo.template; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,32 +11,32 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 短信模板分页 Request VO") +@Schema(description = "管理后台 - 短信模板分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class SmsTemplatePageReqVO extends PageParam { - @ApiModelProperty(value = "短信签名", example = "1") + @Schema(description = "短信签名", example = "1") private Integer type; - @ApiModelProperty(value = "开启状态", example = "1") + @Schema(description = "开启状态", example = "1") private Integer status; - @ApiModelProperty(value = "模板编码", example = "test_01", notes = "模糊匹配") + @Schema(description = "模板编码,模糊匹配", example = "test_01") private String code; - @ApiModelProperty(value = "模板内容", example = "你好,{name}。你长的太{like}啦!", notes = "模糊匹配") + @Schema(description = "模板内容,模糊匹配", example = "你好,{name}。你长的太{like}啦!") private String content; - @ApiModelProperty(value = "短信 API 的模板编号", example = "4383920", notes = "模糊匹配") + @Schema(description = "短信 API 的模板编号,模糊匹配", example = "4383920") private String apiTemplateId; - @ApiModelProperty(value = "短信渠道编号", example = "10") + @Schema(description = "短信渠道编号", example = "10") private Long channelId; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateRespVO.java index 8a10503cb..e1874ce67 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateRespVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.sms.vo.template; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -9,22 +8,22 @@ import lombok.ToString; import java.time.LocalDateTime; import java.util.List; -@ApiModel("管理后台 - 短信模板 Response VO") +@Schema(description = "管理后台 - 短信模板 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class SmsTemplateRespVO extends SmsTemplateBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "短信渠道编码", required = true, example = "ALIYUN") + @Schema(description = "短信渠道编码", required = true, example = "ALIYUN") private String channelCode; - @ApiModelProperty(value = "参数数组", example = "name,code") + @Schema(description = "参数数组", example = "name,code") private List params; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateSendReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateSendReqVO.java index 956b4839e..11561fae9 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateSendReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateSendReqVO.java @@ -1,25 +1,24 @@ package cn.iocoder.yudao.module.system.controller.admin.sms.vo.template; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; import java.util.Map; -@ApiModel("管理后台 - 短信模板的发送 Request VO") +@Schema(description = "管理后台 - 短信模板的发送 Request VO") @Data public class SmsTemplateSendReqVO { - @ApiModelProperty(value = "手机号", required = true, example = "15601691300") + @Schema(description = "手机号", required = true, example = "15601691300") @NotNull(message = "手机号不能为空") private String mobile; - @ApiModelProperty(value = "模板编码", required = true, example = "test_01") + @Schema(description = "模板编码", required = true, example = "test_01") @NotNull(message = "模板编码不能为空") private String templateCode; - @ApiModelProperty(value = "模板参数") + @Schema(description = "模板参数") private Map templateParams; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateUpdateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateUpdateReqVO.java index 86bdbba9a..6cfcdfe5f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/sms/vo/template/SmsTemplateUpdateReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.system.controller.admin.sms.vo.template; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 短信模板更新 Request VO") +@Schema(description = "管理后台 - 短信模板更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class SmsTemplateUpdateReqVO extends SmsTemplateBaseVO { - @ApiModelProperty(value = "编号", required = true, example = "1024") + @Schema(description = "编号", required = true, example = "1024") @NotNull(message = "编号不能为空") private Long id; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/socail/SocialUserController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/socail/SocialUserController.java index 85585f537..0a0682f69 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/socail/SocialUserController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/socail/SocialUserController.java @@ -6,8 +6,8 @@ import cn.iocoder.yudao.module.system.controller.admin.socail.vo.SocialUserBindR import cn.iocoder.yudao.module.system.controller.admin.socail.vo.SocialUserUnbindReqVO; import cn.iocoder.yudao.module.system.convert.social.SocialUserConvert; import cn.iocoder.yudao.module.system.service.social.SocialUserService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -16,7 +16,7 @@ import javax.validation.Valid; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; -@Api(tags = "管理后台 - 社交用户") +@Tag(name = "管理后台 - 社交用户") @RestController @RequestMapping("/system/social-user") @Validated @@ -26,14 +26,14 @@ public class SocialUserController { private SocialUserService socialUserService; @PostMapping("/bind") - @ApiOperation("社交绑定,使用 code 授权码") + @Operation(summary = "社交绑定,使用 code 授权码") public CommonResult socialBind(@RequestBody @Valid SocialUserBindReqVO reqVO) { socialUserService.bindSocialUser(SocialUserConvert.INSTANCE.convert(getLoginUserId(), UserTypeEnum.ADMIN.getValue(), reqVO)); return CommonResult.success(true); } @DeleteMapping("/unbind") - @ApiOperation("取消社交绑定") + @Operation(summary = "取消社交绑定") public CommonResult socialUnbind(@RequestBody SocialUserUnbindReqVO reqVO) { socialUserService.unbindSocialUser(getLoginUserId(), UserTypeEnum.ADMIN.getValue(), reqVO.getType(), reqVO.getOpenid()); return CommonResult.success(true); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/socail/vo/SocialUserBindReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/socail/vo/SocialUserBindReqVO.java index 27dd6b79a..c4d36e986 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/socail/vo/SocialUserBindReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/socail/vo/SocialUserBindReqVO.java @@ -2,8 +2,7 @@ package cn.iocoder.yudao.module.system.controller.admin.socail.vo; import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; import cn.iocoder.yudao.framework.common.validation.InEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -12,23 +11,23 @@ import lombok.NoArgsConstructor; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 社交绑定 Request VO,使用 code 授权码") +@Schema(description = "管理后台 - 社交绑定 Request VO,使用 code 授权码") @Data @NoArgsConstructor @AllArgsConstructor @Builder public class SocialUserBindReqVO { - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 UserSocialTypeEnum 枚举值") + @Schema(description = "社交平台的类型,参见 UserSocialTypeEnum 枚举值", required = true, example = "10") @InEnum(SocialTypeEnum.class) @NotNull(message = "社交平台的类型不能为空") private Integer type; - @ApiModelProperty(value = "授权码", required = true, example = "1024") + @Schema(description = "授权码", required = true, example = "1024") @NotEmpty(message = "授权码不能为空") private String code; - @ApiModelProperty(value = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") + @Schema(description = "state", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62") @NotEmpty(message = "state 不能为空") private String state; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/socail/vo/SocialUserUnbindReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/socail/vo/SocialUserUnbindReqVO.java index 68904ce58..aa293ca5c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/socail/vo/SocialUserUnbindReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/socail/vo/SocialUserUnbindReqVO.java @@ -2,8 +2,7 @@ package cn.iocoder.yudao.module.system.controller.admin.socail.vo; import cn.iocoder.yudao.framework.common.validation.InEnum; import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -12,19 +11,19 @@ import lombok.NoArgsConstructor; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 取消社交绑定 Request VO") +@Schema(description = "管理后台 - 取消社交绑定 Request VO") @Data @NoArgsConstructor @AllArgsConstructor @Builder public class SocialUserUnbindReqVO { - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 UserSocialTypeEnum 枚举值") + @Schema(description = "社交平台的类型,参见 UserSocialTypeEnum 枚举值", required = true, example = "10") @InEnum(SocialTypeEnum.class) @NotNull(message = "社交平台的类型不能为空") private Integer type; - @ApiModelProperty(value = "社交用户的 openid", required = true, example = "IPRmJ0wvBptiPIlGEZiPewGwiEiE") + @Schema(description = "社交用户的 openid", required = true, example = "IPRmJ0wvBptiPIlGEZiPewGwiEiE") @NotEmpty(message = "社交用户的 openid 不能为空") private String openid; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/TenantController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/TenantController.java index acc21d3fa..0020c9280 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/TenantController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/TenantController.java @@ -8,9 +8,9 @@ import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.*; import cn.iocoder.yudao.module.system.convert.tenant.TenantConvert; import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO; import cn.iocoder.yudao.module.system.service.tenant.TenantService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; @@ -24,7 +24,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; -@Api(tags = "管理后台 - 租户") +@Tag(name = "管理后台 - 租户") @RestController @RequestMapping("/system/tenant") public class TenantController { @@ -34,22 +34,22 @@ public class TenantController { @GetMapping("/get-id-by-name") @PermitAll - @ApiOperation(value = "使用租户名,获得租户编号", notes = "登录界面,根据用户的租户名,获得租户编号") - @ApiImplicitParam(name = "name", value = "租户名", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "使用租户名,获得租户编号", description = "登录界面,根据用户的租户名,获得租户编号") + @Parameter(name = "name", description = "租户名", required = true, example = "1024") public CommonResult getTenantIdByName(@RequestParam("name") String name) { TenantDO tenantDO = tenantService.getTenantByName(name); return success(tenantDO != null ? tenantDO.getId() : null); } @PostMapping("/create") - @ApiOperation("创建租户") + @Operation(summary = "创建租户") @PreAuthorize("@ss.hasPermission('system:tenant:create')") public CommonResult createTenant(@Valid @RequestBody TenantCreateReqVO createReqVO) { return success(tenantService.createTenant(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新租户") + @Operation(summary = "更新租户") @PreAuthorize("@ss.hasPermission('system:tenant:update')") public CommonResult updateTenant(@Valid @RequestBody TenantUpdateReqVO updateReqVO) { tenantService.updateTenant(updateReqVO); @@ -57,8 +57,8 @@ public class TenantController { } @DeleteMapping("/delete") - @ApiOperation("删除租户") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "删除租户") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:tenant:delete')") public CommonResult deleteTenant(@RequestParam("id") Long id) { tenantService.deleteTenant(id); @@ -66,8 +66,8 @@ public class TenantController { } @GetMapping("/get") - @ApiOperation("获得租户") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得租户") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:tenant:query')") public CommonResult getTenant(@RequestParam("id") Long id) { TenantDO tenant = tenantService.getTenant(id); @@ -75,7 +75,7 @@ public class TenantController { } @GetMapping("/page") - @ApiOperation("获得租户分页") + @Operation(summary = "获得租户分页") @PreAuthorize("@ss.hasPermission('system:tenant:query')") public CommonResult> getTenantPage(@Valid TenantPageReqVO pageVO) { PageResult pageResult = tenantService.getTenantPage(pageVO); @@ -83,7 +83,7 @@ public class TenantController { } @GetMapping("/export-excel") - @ApiOperation("导出租户 Excel") + @Operation(summary = "导出租户 Excel") @PreAuthorize("@ss.hasPermission('system:tenant:export')") @OperateLog(type = EXPORT) public void exportTenantExcel(@Valid TenantExportReqVO exportReqVO, diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/TenantPackageController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/TenantPackageController.java index b69b0dca5..ec4782388 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/TenantPackageController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/TenantPackageController.java @@ -7,9 +7,9 @@ import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.packages.*; import cn.iocoder.yudao.module.system.convert.tenant.TenantPackageConvert; import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantPackageDO; import cn.iocoder.yudao.module.system.service.tenant.TenantPackageService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -20,7 +20,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Api(tags = "管理后台 - 租户套餐") +@Tag(name = "管理后台 - 租户套餐") @RestController @RequestMapping("/system/tenant-package") @Validated @@ -30,14 +30,14 @@ public class TenantPackageController { private TenantPackageService tenantPackageService; @PostMapping("/create") - @ApiOperation("创建租户套餐") + @Operation(summary = "创建租户套餐") @PreAuthorize("@ss.hasPermission('system:tenant-package:create')") public CommonResult createTenantPackage(@Valid @RequestBody TenantPackageCreateReqVO createReqVO) { return success(tenantPackageService.createTenantPackage(createReqVO)); } @PutMapping("/update") - @ApiOperation("更新租户套餐") + @Operation(summary = "更新租户套餐") @PreAuthorize("@ss.hasPermission('system:tenant-package:update')") public CommonResult updateTenantPackage(@Valid @RequestBody TenantPackageUpdateReqVO updateReqVO) { tenantPackageService.updateTenantPackage(updateReqVO); @@ -45,8 +45,8 @@ public class TenantPackageController { } @DeleteMapping("/delete") - @ApiOperation("删除租户套餐") - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) + @Operation(summary = "删除租户套餐") + @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('system:tenant-package:delete')") public CommonResult deleteTenantPackage(@RequestParam("id") Long id) { tenantPackageService.deleteTenantPackage(id); @@ -54,8 +54,8 @@ public class TenantPackageController { } @GetMapping("/get") - @ApiOperation("获得租户套餐") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得租户套餐") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:tenant-package:query')") public CommonResult getTenantPackage(@RequestParam("id") Long id) { TenantPackageDO tenantPackage = tenantPackageService.getTenantPackage(id); @@ -63,7 +63,7 @@ public class TenantPackageController { } @GetMapping("/page") - @ApiOperation("获得租户套餐分页") + @Operation(summary = "获得租户套餐分页") @PreAuthorize("@ss.hasPermission('system:tenant-package:query')") public CommonResult> getTenantPackagePage(@Valid TenantPackagePageReqVO pageVO) { PageResult pageResult = tenantPackageService.getTenantPackagePage(pageVO); @@ -71,7 +71,7 @@ public class TenantPackageController { } @GetMapping("/get-simple-list") - @ApiOperation(value = "获取租户套餐精简信息列表", notes = "只包含被开启的租户套餐,主要用于前端的下拉选项") + @Operation(summary = "获取租户套餐精简信息列表", description = "只包含被开启的租户套餐,主要用于前端的下拉选项") public CommonResult> getTenantPackageList() { // 获得角色列表,只要开启状态的 List list = tenantPackageService.getTenantPackageListByStatus(CommonStatusEnum.ENABLE.getStatus()); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackageBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackageBaseVO.java index 36c838366..53adc072f 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackageBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackageBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.tenant.vo.packages; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; @@ -13,18 +13,18 @@ import java.util.Set; @Data public class TenantPackageBaseVO { - @ApiModelProperty(value = "套餐名", required = true, example = "VIP") + @Schema(description = "套餐名", required = true, example = "VIP") @NotNull(message = "套餐名不能为空") private String name; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举") + @Schema(description = "状态,参见 CommonStatusEnum 枚举", required = true, example = "1") @NotNull(message = "状态不能为空") private Integer status; - @ApiModelProperty(value = "备注", example = "好") + @Schema(description = "备注", example = "好") private String remark; - @ApiModelProperty(value = "关联的菜单编号", required = true) + @Schema(description = "关联的菜单编号", required = true) @NotNull(message = "关联的菜单编号不能为空") private Set menuIds; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackageCreateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackageCreateReqVO.java index 2290e5ca6..255971447 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackageCreateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackageCreateReqVO.java @@ -1,11 +1,11 @@ package cn.iocoder.yudao.module.system.controller.admin.tenant.vo.packages; -import io.swagger.annotations.ApiModel; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@ApiModel("管理后台 - 租户套餐创建 Request VO") +@Schema(description = "管理后台 - 租户套餐创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackagePageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackagePageReqVO.java index 7a2fd2493..525a5da73 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackagePageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackagePageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.tenant.vo.packages; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,22 +11,22 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 租户套餐分页 Request VO") +@Schema(description = "管理后台 - 租户套餐分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class TenantPackagePageReqVO extends PageParam { - @ApiModelProperty(value = "套餐名", example = "VIP") + @Schema(description = "套餐名", example = "VIP") private String name; - @ApiModelProperty(value = "状态", example = "1") + @Schema(description = "状态", example = "1") private Integer status; - @ApiModelProperty(value = "备注", example = "好") + @Schema(description = "备注", example = "好") private String remark; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackageRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackageRespVO.java index b46772922..f1a0d2f46 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackageRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackageRespVO.java @@ -1,23 +1,22 @@ package cn.iocoder.yudao.module.system.controller.admin.tenant.vo.packages; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import java.time.LocalDateTime; -@ApiModel("管理后台 - 租户套餐 Response VO") +@Schema(description = "管理后台 - 租户套餐 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class TenantPackageRespVO extends TenantPackageBaseVO { - @ApiModelProperty(value = "套餐编号", required = true, example = "1024") + @Schema(description = "套餐编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackageSimpleRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackageSimpleRespVO.java index 4ec1c97f7..feeff1fe8 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackageSimpleRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackageSimpleRespVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.system.controller.admin.tenant.vo.packages; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 租户套餐精简 Response VO") +@Schema(description = "管理后台 - 租户套餐精简 Response VO") @Data public class TenantPackageSimpleRespVO { - @ApiModelProperty(value = "套餐编号", required = true, example = "1024") + @Schema(description = "套餐编号", required = true, example = "1024") @NotNull(message = "套餐编号不能为空") private Long id; - @ApiModelProperty(value = "套餐名", required = true, example = "VIP") + @Schema(description = "套餐名", required = true, example = "VIP") @NotNull(message = "套餐名不能为空") private String name; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackageUpdateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackageUpdateReqVO.java index b1d269607..a91f2fb3d 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackageUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/packages/TenantPackageUpdateReqVO.java @@ -1,17 +1,16 @@ package cn.iocoder.yudao.module.system.controller.admin.tenant.vo.packages; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import java.util.*; -import io.swagger.annotations.*; import javax.validation.constraints.*; -@ApiModel("管理后台 - 租户套餐更新 Request VO") +@Schema(description = "管理后台 - 租户套餐更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class TenantPackageUpdateReqVO extends TenantPackageBaseVO { - @ApiModelProperty(value = "套餐编号", required = true, example = "1024") + @Schema(description = "套餐编号", required = true, example = "1024") @NotNull(message = "套餐编号不能为空") private Long id; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantBaseVO.java index 226c9b449..4673e2990 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantBaseVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; -import org.hibernate.validator.constraints.URL; import javax.validation.constraints.*; import java.time.LocalDateTime; @@ -14,34 +13,33 @@ import java.time.LocalDateTime; @Data public class TenantBaseVO { - @ApiModelProperty(value = "租户名", required = true, example = "芋道") + @Schema(description = "租户名", required = true, example = "芋道") @NotNull(message = "租户名不能为空") private String name; - @ApiModelProperty(value = "联系人", required = true, example = "芋艿") + @Schema(description = "联系人", required = true, example = "芋艿") @NotNull(message = "联系人不能为空") private String contactName; - @ApiModelProperty(value = "联系手机", example = "15601691300") + @Schema(description = "联系手机", example = "15601691300") private String contactMobile; - @ApiModelProperty(value = "租户状态", required = true, example = "1") + @Schema(description = "租户状态", required = true, example = "1") @NotNull(message = "租户状态") private Integer status; - @ApiModelProperty(value = "绑定域名", example = "https://www.iocoder.cn") - @URL(message = "绑定域名的地址非 URL 格式") + @Schema(description = "绑定域名", example = "https://www.iocoder.cn") private String domain; - @ApiModelProperty(value = "租户套餐编号", required = true, example = "1024") + @Schema(description = "租户套餐编号", required = true, example = "1024") @NotNull(message = "租户套餐编号不能为空") private Long packageId; - @ApiModelProperty(value = "过期时间", required = true) + @Schema(description = "过期时间", required = true) @NotNull(message = "过期时间不能为空") private LocalDateTime expireTime; - @ApiModelProperty(value = "账号数量", required = true, example = "1024") + @Schema(description = "账号数量", required = true, example = "1024") @NotNull(message = "账号数量不能为空") private Integer accountCount; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantCreateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantCreateReqVO.java index ff52811eb..8db44c2c1 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantCreateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantCreateReqVO.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; @@ -9,19 +9,19 @@ import javax.validation.constraints.NotEmpty; import javax.validation.constraints.Pattern; import javax.validation.constraints.Size; -@ApiModel("管理后台 - 租户创建 Request VO") +@Schema(description = "管理后台 - 租户创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class TenantCreateReqVO extends TenantBaseVO { - @ApiModelProperty(value = "用户账号", required = true, example = "yudao") + @Schema(description = "用户账号", required = true, example = "yudao") @NotBlank(message = "用户账号不能为空") @Pattern(regexp = "^[a-zA-Z0-9]{4,30}$", message = "用户账号由 数字、字母 组成") @Size(min = 4, max = 30, message = "用户账号长度为 4-30 个字符") private String username; - @ApiModelProperty(value = "密码", required = true, example = "123456") + @Schema(description = "密码", required = true, example = "123456") @NotEmpty(message = "密码不能为空") @Length(min = 4, max = 16, message = "密码长度为 4-16 位") private String password; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantExportReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantExportReqVO.java index 6498714af..706337276 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantExportReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantExportReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -9,24 +8,24 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel(value = "管理后台 - 租户 Excel 导出 Request VO", description = "参数和 TenantPageReqVO 是一致的") +@Schema(description = "管理后台 - 租户 Excel 导出 Request VO,参数和 TenantPageReqVO 是一致的") @Data public class TenantExportReqVO { - @ApiModelProperty(value = "租户名", example = "芋道") + @Schema(description = "租户名", example = "芋道") private String name; - @ApiModelProperty(value = "联系人", example = "芋艿") + @Schema(description = "联系人", example = "芋艿") private String contactName; - @ApiModelProperty(value = "联系手机", example = "15601691300") + @Schema(description = "联系手机", example = "15601691300") private String contactMobile; - @ApiModelProperty(value = "租户状态(0正常 1停用)", example = "1") + @Schema(description = "租户状态(0正常 1停用)", example = "1") private Integer status; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantPageReqVO.java index 499ecfd2f..512a4a761 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantPageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -12,26 +11,26 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 租户分页 Request VO") +@Schema(description = "管理后台 - 租户分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class TenantPageReqVO extends PageParam { - @ApiModelProperty(value = "租户名", example = "芋道") + @Schema(description = "租户名", example = "芋道") private String name; - @ApiModelProperty(value = "联系人", example = "芋艿") + @Schema(description = "联系人", example = "芋艿") private String contactName; - @ApiModelProperty(value = "联系手机", example = "15601691300") + @Schema(description = "联系手机", example = "15601691300") private String contactMobile; - @ApiModelProperty(value = "租户状态(0正常 1停用)", example = "1") + @Schema(description = "租户状态(0正常 1停用)", example = "1") private Integer status; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @ApiModelProperty(value = "创建时间") + @Schema(description = "创建时间") private LocalDateTime[] createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantRespVO.java index b2345d167..10e1aa552 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantRespVO.java @@ -1,20 +1,20 @@ package cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; import java.time.LocalDateTime; -@ApiModel("管理后台 - 租户 Response VO") +@Schema(description = "管理后台 - 租户 Response VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class TenantRespVO extends TenantBaseVO { - @ApiModelProperty(value = "租户编号", required = true, example = "1024") + @Schema(description = "租户编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "创建时间", required = true) + @Schema(description = "创建时间", required = true) private LocalDateTime createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantUpdateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantUpdateReqVO.java index 881d5fb87..1969fe302 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/tenant/vo/tenant/TenantUpdateReqVO.java @@ -1,16 +1,16 @@ package cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import io.swagger.annotations.*; import javax.validation.constraints.*; -@ApiModel("管理后台 - 租户更新 Request VO") +@Schema(description = "管理后台 - 租户更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class TenantUpdateReqVO extends TenantBaseVO { - @ApiModelProperty(value = "租户编号", required = true, example = "1024") + @Schema(description = "租户编号", required = true, example = "1024") @NotNull(message = "租户编号不能为空") private Long id; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java index a2369ae24..40efb2d23 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java @@ -14,10 +14,10 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.MapUtils; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -34,7 +34,7 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils. import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; -@Api(tags = "管理后台 - 用户") +@Tag(name = "管理后台 - 用户") @RestController @RequestMapping("/system/user") @Validated @@ -46,7 +46,7 @@ public class UserController { private DeptService deptService; @PostMapping("/create") - @ApiOperation("新增用户") + @Operation(summary = "新增用户") @PreAuthorize("@ss.hasPermission('system:user:create')") public CommonResult createUser(@Valid @RequestBody UserCreateReqVO reqVO) { Long id = userService.createUser(reqVO); @@ -54,7 +54,7 @@ public class UserController { } @PutMapping("update") - @ApiOperation("修改用户") + @Operation(summary = "修改用户") @PreAuthorize("@ss.hasPermission('system:user:update')") public CommonResult updateUser(@Valid @RequestBody UserUpdateReqVO reqVO) { userService.updateUser(reqVO); @@ -62,8 +62,8 @@ public class UserController { } @DeleteMapping("/delete") - @ApiOperation("删除用户") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "删除用户") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:user:delete')") public CommonResult deleteUser(@RequestParam("id") Long id) { userService.deleteUser(id); @@ -71,7 +71,7 @@ public class UserController { } @PutMapping("/update-password") - @ApiOperation("重置用户密码") + @Operation(summary = "重置用户密码") @PreAuthorize("@ss.hasPermission('system:user:update-password')") public CommonResult updateUserPassword(@Valid @RequestBody UserUpdatePasswordReqVO reqVO) { userService.updateUserPassword(reqVO.getId(), reqVO.getPassword()); @@ -79,7 +79,7 @@ public class UserController { } @PutMapping("/update-status") - @ApiOperation("修改用户状态") + @Operation(summary = "修改用户状态") @PreAuthorize("@ss.hasPermission('system:user:update')") public CommonResult updateUserStatus(@Valid @RequestBody UserUpdateStatusReqVO reqVO) { userService.updateUserStatus(reqVO.getId(), reqVO.getStatus()); @@ -87,7 +87,7 @@ public class UserController { } @GetMapping("/page") - @ApiOperation("获得用户分页列表") + @Operation(summary = "获得用户分页列表") @PreAuthorize("@ss.hasPermission('system:user:list')") public CommonResult> getUserPage(@Valid UserPageReqVO reqVO) { // 获得用户分页列表 @@ -110,30 +110,30 @@ public class UserController { } @GetMapping("/list-all-simple") - @ApiOperation(value = "获取用户精简信息列表", notes = "只包含被开启的用户,主要用于前端的下拉选项") - public CommonResult> getSimpleUsers() { + @Operation(summary = "获取用户精简信息列表", description = "只包含被开启的用户,主要用于前端的下拉选项") + public CommonResult> getSimpleUserList() { // 获用户列表,只要开启状态的 - List list = userService.getUsersByStatus(CommonStatusEnum.ENABLE.getStatus()); + List list = userService.getUserListByStatus(CommonStatusEnum.ENABLE.getStatus()); // 排序后,返回给前端 return success(UserConvert.INSTANCE.convertList04(list)); } @GetMapping("/get") - @ApiOperation("获得用户详情") - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @Operation(summary = "获得用户详情") + @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:user:query')") - public CommonResult getInfo(@RequestParam("id") Long id) { + public CommonResult getUser(@RequestParam("id") Long id) { return success(UserConvert.INSTANCE.convert(userService.getUser(id))); } @GetMapping("/export") - @ApiOperation("导出用户") + @Operation(summary = "导出用户") @PreAuthorize("@ss.hasPermission('system:user:export')") @OperateLog(type = EXPORT) - public void exportUsers(@Validated UserExportReqVO reqVO, - HttpServletResponse response) throws IOException { + public void exportUserList(@Validated UserExportReqVO reqVO, + HttpServletResponse response) throws IOException { // 获得用户列表 - List users = userService.getUsers(reqVO); + List users = userService.getUserList(reqVO); // 获得拼接需要的数据 Collection deptIds = convertList(users, AdminUserDO::getDeptId); @@ -159,7 +159,7 @@ public class UserController { } @GetMapping("/get-import-template") - @ApiOperation("获得导入用户模板") + @Operation(summary = "获得导入用户模板") public void importTemplate(HttpServletResponse response) throws IOException { // 手动创建导出 demo List list = Arrays.asList( @@ -174,16 +174,16 @@ public class UserController { } @PostMapping("/import") - @ApiOperation("导入用户") - @ApiImplicitParams({ - @ApiImplicitParam(name = "file", value = "Excel 文件", required = true, dataTypeClass = MultipartFile.class), - @ApiImplicitParam(name = "updateSupport", value = "是否支持更新,默认为 false", example = "true", dataTypeClass = Boolean.class) + @Operation(summary = "导入用户") + @Parameters({ + @Parameter(name = "file", description = "Excel 文件", required = true), + @Parameter(name = "updateSupport", description = "是否支持更新,默认为 false", example = "true") }) @PreAuthorize("@ss.hasPermission('system:user:import')") public CommonResult importExcel(@RequestParam("file") MultipartFile file, @RequestParam(value = "updateSupport", required = false, defaultValue = "false") Boolean updateSupport) throws Exception { List list = ExcelUtils.read(file, UserImportExcelVO.class); - return success(userService.importUsers(list, updateSupport)); + return success(userService.importUserList(list, updateSupport)); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserProfileController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserProfileController.java index d65994379..d9fc4a635 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserProfileController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserProfileController.java @@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.system.controller.admin.user; import cn.hutool.core.collection.CollUtil; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; -import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission; import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileRespVO; @@ -20,8 +19,8 @@ import cn.iocoder.yudao.module.system.service.permission.PermissionService; import cn.iocoder.yudao.module.system.service.permission.RoleService; import cn.iocoder.yudao.module.system.service.social.SocialUserService; import cn.iocoder.yudao.module.system.service.user.AdminUserService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -31,11 +30,12 @@ import javax.annotation.Resource; import javax.validation.Valid; import java.util.List; +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; 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.module.infra.enums.ErrorCodeConstants.FILE_IS_EMPTY; -@Api(tags = "管理后台 - 用户个人中心") +@Tag(name = "管理后台 - 用户个人中心") @RestController @RequestMapping("/system/user/profile") @Validated @@ -56,14 +56,14 @@ public class UserProfileController { private SocialUserService socialService; @GetMapping("/get") - @ApiOperation("获得登录用户信息") + @Operation(summary = "获得登录用户信息") @DataPermission(enable = false) // 关闭数据权限,避免只查看自己时,查询不到部门。 public CommonResult profile() { // 获得用户基本信息 AdminUserDO user = userService.getUser(getLoginUserId()); UserProfileRespVO resp = UserConvert.INSTANCE.convert03(user); // 获得用户角色 - List userRoles = roleService.getRolesFromCache(permissionService.getUserRoleIdListByUserId(user.getId())); + List userRoles = roleService.getRoleListFromCache(permissionService.getUserRoleIdListByUserId(user.getId())); resp.setRoles(UserConvert.INSTANCE.convertList(userRoles)); // 获得部门信息 if (user.getDeptId() != null) { @@ -72,7 +72,7 @@ public class UserProfileController { } // 获得岗位信息 if (CollUtil.isNotEmpty(user.getPostIds())) { - List posts = postService.getPosts(user.getPostIds()); + List posts = postService.getPostList(user.getPostIds()); resp.setPosts(UserConvert.INSTANCE.convertList02(posts)); } // 获得社交用户信息 @@ -82,24 +82,24 @@ public class UserProfileController { } @PutMapping("/update") - @ApiOperation("修改用户个人信息") + @Operation(summary = "修改用户个人信息") public CommonResult updateUserProfile(@Valid @RequestBody UserProfileUpdateReqVO reqVO) { userService.updateUserProfile(getLoginUserId(), reqVO); return success(true); } @PutMapping("/update-password") - @ApiOperation("修改用户个人密码") + @Operation(summary = "修改用户个人密码") public CommonResult updateUserProfilePassword(@Valid @RequestBody UserProfileUpdatePasswordReqVO reqVO) { userService.updateUserPassword(getLoginUserId(), reqVO); return success(true); } @RequestMapping(value = "/update-avatar", method = {RequestMethod.POST, RequestMethod.PUT}) // 解决 uni-app 不支持 Put 上传文件的问题 - @ApiOperation("上传用户个人头像") + @Operation(summary = "上传用户个人头像") public CommonResult updateUserAvatar(@RequestParam("avatarFile") MultipartFile file) throws Exception { if (file.isEmpty()) { - throw ServiceExceptionUtil.exception(FILE_IS_EMPTY); + throw exception(FILE_IS_EMPTY); } String avatar = userService.updateUserAvatar(getLoginUserId(), file.getInputStream()); return success(avatar); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileRespVO.java index 8767c0593..9e8298f45 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileRespVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.user.vo.profile; import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserBaseVO; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; @@ -16,22 +15,22 @@ import java.util.List; @EqualsAndHashCode(callSuper = true) @NoArgsConstructor @AllArgsConstructor -@ApiModel("管理后台 - 用户个人中心信息 Response VO") +@Schema(description = "管理后台 - 用户个人中心信息 Response VO") public class UserProfileRespVO extends UserBaseVO { - @ApiModelProperty(value = "用户编号", required = true, example = "1") + @Schema(description = "用户编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "状态,参见 CommonStatusEnum 枚举类", required = true, example = "1") private Integer status; - @ApiModelProperty(value = "最后登录 IP", required = true, example = "192.168.1.1") + @Schema(description = "最后登录 IP", required = true, example = "192.168.1.1") private String loginIp; - @ApiModelProperty(value = "最后登录时间", required = true, example = "时间戳格式") + @Schema(description = "最后登录时间", required = true, example = "时间戳格式") private LocalDateTime loginDate; - @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") + @Schema(description = "创建时间", required = true, example = "时间戳格式") private LocalDateTime createTime; /** @@ -53,50 +52,50 @@ public class UserProfileRespVO extends UserBaseVO { */ private List socialUsers; - @ApiModel("角色") + @Schema(description = "角色") @Data public static class Role { - @ApiModelProperty(value = "角色编号", required = true, example = "1") + @Schema(description = "角色编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "角色名称", required = true, example = "普通角色") + @Schema(description = "角色名称", required = true, example = "普通角色") private String name; } - @ApiModel("部门") + @Schema(description = "部门") @Data public static class Dept { - @ApiModelProperty(value = "部门编号", required = true, example = "1") + @Schema(description = "部门编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "部门名称", required = true, example = "研发部") + @Schema(description = "部门名称", required = true, example = "研发部") private String name; } - @ApiModel("岗位") + @Schema(description = "岗位") @Data public static class Post { - @ApiModelProperty(value = "岗位编号", required = true, example = "1") + @Schema(description = "岗位编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "岗位名称", required = true, example = "开发") + @Schema(description = "岗位名称", required = true, example = "开发") private String name; } - @ApiModel("社交用户") + @Schema(description = "社交用户") @Data public static class SocialUser { - @ApiModelProperty(value = "社交平台的类型", required = true, example = "10", notes = "参见 SocialTypeEnum 枚举类") + @Schema(description = "社交平台的类型,参见 SocialTypeEnum 枚举类", required = true, example = "10") private Integer type; - @ApiModelProperty(value = "社交用户的 openid", required = true, example = "IPRmJ0wvBptiPIlGEZiPewGwiEiE") + @Schema(description = "社交用户的 openid", required = true, example = "IPRmJ0wvBptiPIlGEZiPewGwiEiE") private String openid; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileUpdatePasswordReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileUpdatePasswordReqVO.java index 2269b37df..d784537cf 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileUpdatePasswordReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileUpdatePasswordReqVO.java @@ -1,22 +1,21 @@ package cn.iocoder.yudao.module.system.controller.admin.user.vo.profile; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotEmpty; -@ApiModel("管理后台 - 用户个人中心更新密码 Request VO") +@Schema(description = "管理后台 - 用户个人中心更新密码 Request VO") @Data public class UserProfileUpdatePasswordReqVO { - @ApiModelProperty(value = "旧密码", required = true, example = "123456") + @Schema(description = "旧密码", required = true, example = "123456") @NotEmpty(message = "旧密码不能为空") @Length(min = 4, max = 16, message = "密码长度为 4-16 位") private String oldPassword; - @ApiModelProperty(value = "新密码", required = true, example = "654321") + @Schema(description = "新密码", required = true, example = "654321") @NotEmpty(message = "新密码不能为空") @Length(min = 4, max = 16, message = "密码长度为 4-16 位") private String newPassword; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileUpdateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileUpdateReqVO.java index 5ab28d1e7..727f28178 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/profile/UserProfileUpdateReqVO.java @@ -1,31 +1,29 @@ package cn.iocoder.yudao.module.system.controller.admin.user.vo.profile; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; -import org.hibernate.validator.constraints.Length; import javax.validation.constraints.Email; import javax.validation.constraints.Size; -@ApiModel("管理后台 - 用户个人信息更新 Request VO") + +@Schema(description = "管理后台 - 用户个人信息更新 Request VO") @Data public class UserProfileUpdateReqVO { - @ApiModelProperty(value = "用户昵称", required = true, example = "芋艿") + @Schema(description = "用户昵称", required = true, example = "芋艿") @Size(max = 30, message = "用户昵称长度不能超过 30 个字符") private String nickname; - @ApiModelProperty(value = "用户邮箱", example = "yudao@iocoder.cn") + @Schema(description = "用户邮箱", example = "yudao@iocoder.cn") @Email(message = "邮箱格式不正确") @Size(max = 50, message = "邮箱长度不能超过 50 个字符") private String email; - @ApiModelProperty(value = "手机号码", example = "15601691300") - @Length(min = 11, max = 11, message = "手机号长度必须 11 位") + @Schema(description = "手机号码", example = "15601691300") private String mobile; - @ApiModelProperty(value = "用户性别", example = "1", notes = "参见 SexEnum 枚举类") + @Schema(description = "用户性别-参见 SexEnum 枚举类", example = "1") private Integer sex; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserBaseVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserBaseVO.java index 5268b10c7..93467b2ab 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserBaseVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserBaseVO.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.user.vo.user; import cn.iocoder.yudao.framework.common.validation.Mobile; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.Email; @@ -17,38 +17,38 @@ import java.util.Set; @Data public class UserBaseVO { - @ApiModelProperty(value = "用户账号", required = true, example = "yudao") + @Schema(description = "用户账号", required = true, example = "yudao") @NotBlank(message = "用户账号不能为空") @Pattern(regexp = "^[a-zA-Z0-9]{4,30}$", message = "用户账号由 数字、字母 组成") @Size(min = 4, max = 30, message = "用户账号长度为 4-30 个字符") private String username; - @ApiModelProperty(value = "用户昵称", required = true, example = "芋艿") + @Schema(description = "用户昵称", required = true, example = "芋艿") @Size(max = 30, message = "用户昵称长度不能超过30个字符") private String nickname; - @ApiModelProperty(value = "备注", example = "我是一个用户") + @Schema(description = "备注", example = "我是一个用户") private String remark; - @ApiModelProperty(value = "部门ID", example = "我是一个用户") + @Schema(description = "部门ID", example = "我是一个用户") private Long deptId; - @ApiModelProperty(value = "岗位编号数组", example = "1") + @Schema(description = "岗位编号数组", example = "1") private Set postIds; - @ApiModelProperty(value = "用户邮箱", example = "yudao@iocoder.cn") + @Schema(description = "用户邮箱", example = "yudao@iocoder.cn") @Email(message = "邮箱格式不正确") @Size(max = 50, message = "邮箱长度不能超过 50 个字符") private String email; - @ApiModelProperty(value = "手机号码", example = "15601691300") + @Schema(description = "手机号码", example = "15601691300") @Mobile private String mobile; - @ApiModelProperty(value = "用户性别", example = "1", notes = "参见 SexEnum 枚举类") + @Schema(description = "用户性别,参见 SexEnum 枚举类", example = "1") private Integer sex; - @ApiModelProperty(value = "用户头像", example = "https://www.iocoder.cn/xxx.png") + @Schema(description = "用户头像", example = "https://www.iocoder.cn/xxx.png") private String avatar; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserCreateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserCreateReqVO.java index 9d0ff1988..1a80ac2d0 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserCreateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserCreateReqVO.java @@ -1,20 +1,18 @@ package cn.iocoder.yudao.module.system.controller.admin.user.vo.user; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotEmpty; -@ApiModel("管理后台 - 用户创建 Request VO") +@Schema(description = "管理后台 - 用户创建 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class UserCreateReqVO extends UserBaseVO { - @ApiModelProperty(value = "密码", required = true, example = "123456") + @Schema(description = "密码", required = true, example = "123456") @NotEmpty(message = "密码不能为空") @Length(min = 4, max = 16, message = "密码长度为 4-16 位") private String password; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserExportReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserExportReqVO.java index 387ad784a..5d9464b79 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserExportReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserExportReqVO.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.user.vo.user; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -11,26 +10,26 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel(value = "管理后台 - 用户导出 Request VO", description = "参数和 UserPageReqVO 是一致的") +@Schema(description = "管理后台 - 用户导出 Request VO,参数和 UserPageReqVO 是一致的") @Data @NoArgsConstructor @AllArgsConstructor public class UserExportReqVO { - @ApiModelProperty(value = "用户账号", example = "yudao", notes = "模糊匹配") + @Schema(description = "用户账号,模糊匹配", example = "yudao") private String username; - @ApiModelProperty(value = "手机号码", example = "yudao", notes = "模糊匹配") + @Schema(description = "手机号码,模糊匹配", example = "yudao") private String mobile; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1") private Integer status; - @ApiModelProperty(value = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") + @Schema(description = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; - @ApiModelProperty(value = "部门编号", example = "1024", notes = "同时筛选子部门") + @Schema(description = "部门编号,同时筛选子部门", example = "1024") private Long deptId; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserImportRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserImportRespVO.java index 49f9b98d1..c0dcd09aa 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserImportRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserImportRespVO.java @@ -1,25 +1,24 @@ package cn.iocoder.yudao.module.system.controller.admin.user.vo.user; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; import lombok.Data; import java.util.List; import java.util.Map; -@ApiModel("管理后台 - 用户导入 Response VO") +@Schema(description = "管理后台 - 用户导入 Response VO") @Data @Builder public class UserImportRespVO { - @ApiModelProperty(value = "创建成功的用户名数组", required = true) + @Schema(description = "创建成功的用户名数组", required = true) private List createUsernames; - @ApiModelProperty(value = "更新成功的用户名数组", required = true) + @Schema(description = "更新成功的用户名数组", required = true) private List updateUsernames; - @ApiModelProperty(value = "导入失败的用户集合", required = true, notes = "key 为用户名,value 为失败原因") + @Schema(description = "导入失败的用户集合,key 为用户名,value 为失败原因", required = true) private Map failureUsernames; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageItemRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageItemRespVO.java index bcfe9ea23..52ae7b7ea 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageItemRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageItemRespVO.java @@ -1,13 +1,12 @@ package cn.iocoder.yudao.module.system.controller.admin.user.vo.user; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; -@ApiModel(value = "管理后台 - 用户分页时的信息 Response VO", description = "相比用户基本信息来说,会多部门信息") +@Schema(description = "管理后台 - 用户分页时的信息 Response VO,相比用户基本信息来说,会多部门信息") @Data @NoArgsConstructor @AllArgsConstructor @@ -19,14 +18,14 @@ public class UserPageItemRespVO extends UserRespVO { */ private Dept dept; - @ApiModel("部门") + @Schema(description = "部门") @Data public static class Dept { - @ApiModelProperty(value = "部门编号", required = true, example = "1") + @Schema(description = "部门编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "部门名称", required = true, example = "研发部") + @Schema(description = "部门名称", required = true, example = "研发部") private String name; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java index cbac2d9a5..4e6a42541 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java @@ -1,8 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.user.vo.user; import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; @@ -13,27 +12,27 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; -@ApiModel("管理后台 - 用户分页 Request VO") +@Schema(description = "管理后台 - 用户分页 Request VO") @Data @NoArgsConstructor @AllArgsConstructor @EqualsAndHashCode(callSuper = true) public class UserPageReqVO extends PageParam { - @ApiModelProperty(value = "用户账号", example = "yudao", notes = "模糊匹配") + @Schema(description = "用户账号,模糊匹配", example = "yudao") private String username; - @ApiModelProperty(value = "手机号码", example = "yudao", notes = "模糊匹配") + @Schema(description = "手机号码,模糊匹配", example = "yudao") private String mobile; - @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1") private Integer status; - @ApiModelProperty(value = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") + @Schema(description = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; - @ApiModelProperty(value = "部门编号", example = "1024", notes = "同时筛选子部门") + @Schema(description = "部门编号,同时筛选子部门", example = "1024") private Long deptId; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserRespVO.java index 972b3818b..93a53b74e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserRespVO.java @@ -1,32 +1,31 @@ package cn.iocoder.yudao.module.system.controller.admin.user.vo.user; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.time.LocalDateTime; -@ApiModel("管理后台 - 用户信息 Response VO") +@Schema(description = "管理后台 - 用户信息 Response VO") @Data @NoArgsConstructor @AllArgsConstructor @EqualsAndHashCode(callSuper = true) public class UserRespVO extends UserBaseVO { - @ApiModelProperty(value = "用户编号", required = true, example = "1") + @Schema(description = "用户编号", required = true, example = "1") private Long id; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") + @Schema(description = "状态,参见 CommonStatusEnum 枚举类", required = true, example = "1") private Integer status; - @ApiModelProperty(value = "最后登录 IP", required = true, example = "192.168.1.1") + @Schema(description = "最后登录 IP", required = true, example = "192.168.1.1") private String loginIp; - @ApiModelProperty(value = "最后登录时间", required = true, example = "时间戳格式") + @Schema(description = "最后登录时间", required = true, example = "时间戳格式") private LocalDateTime loginDate; - @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") + @Schema(description = "创建时间", required = true, example = "时间戳格式") private LocalDateTime createTime; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserSimpleRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserSimpleRespVO.java index e616b87cb..f08e8c132 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserSimpleRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserSimpleRespVO.java @@ -1,21 +1,20 @@ package cn.iocoder.yudao.module.system.controller.admin.user.vo.user; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; -@ApiModel("管理后台 - 用户精简信息 Response VO") +@Schema(description = "管理后台 - 用户精简信息 Response VO") @Data @NoArgsConstructor @AllArgsConstructor public class UserSimpleRespVO { - @ApiModelProperty(value = "用户编号", required = true, example = "1024") + @Schema(description = "用户编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "用户昵称", required = true, example = "芋道") + @Schema(description = "用户昵称", required = true, example = "芋道") private String nickname; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserUpdatePasswordReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserUpdatePasswordReqVO.java index 542fc2b0f..786fca8ca 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserUpdatePasswordReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserUpdatePasswordReqVO.java @@ -1,22 +1,21 @@ package cn.iocoder.yudao.module.system.controller.admin.user.vo.user; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 用户更新密码 Request VO") +@Schema(description = "管理后台 - 用户更新密码 Request VO") @Data public class UserUpdatePasswordReqVO { - @ApiModelProperty(value = "用户编号", required = true, example = "1024") + @Schema(description = "用户编号", required = true, example = "1024") @NotNull(message = "用户编号不能为空") private Long id; - @ApiModelProperty(value = "密码", required = true, example = "123456") + @Schema(description = "密码", required = true, example = "123456") @NotEmpty(message = "密码不能为空") @Length(min = 4, max = 16, message = "密码长度为 4-16 位") private String password; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserUpdateReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserUpdateReqVO.java index 84a3de60f..d11a6e493 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserUpdateReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserUpdateReqVO.java @@ -1,18 +1,17 @@ package cn.iocoder.yudao.module.system.controller.admin.user.vo.user; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 用户更新 Request VO") +@Schema(description = "管理后台 - 用户更新 Request VO") @Data @EqualsAndHashCode(callSuper = true) public class UserUpdateReqVO extends UserBaseVO { - @ApiModelProperty(value = "用户编号", required = true, example = "1024") + @Schema(description = "用户编号", required = true, example = "1024") @NotNull(message = "用户编号不能为空") private Long id; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserUpdateStatusReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserUpdateStatusReqVO.java index 2c7a83f22..0f8e21d0c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserUpdateStatusReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserUpdateStatusReqVO.java @@ -1,20 +1,19 @@ package cn.iocoder.yudao.module.system.controller.admin.user.vo.user; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import javax.validation.constraints.NotNull; -@ApiModel("管理后台 - 用户更新状态 Request VO") +@Schema(description = "管理后台 - 用户更新状态 Request VO") @Data public class UserUpdateStatusReqVO { - @ApiModelProperty(value = "用户编号", required = true, example = "1024") + @Schema(description = "用户编号", required = true, example = "1024") @NotNull(message = "角色编号不能为空") private Long id; - @ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举") + @Schema(description = "状态,见 CommonStatusEnum 枚举", required = true, example = "1") @NotNull(message = "状态不能为空") // @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") private Integer status; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/auth/AuthConvert.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/auth/AuthConvert.java index 38e84ea1d..12fd35b1c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/auth/AuthConvert.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/auth/AuthConvert.java @@ -9,13 +9,15 @@ import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO; import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO; import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; -import cn.iocoder.yudao.module.system.enums.permission.MenuIdEnum; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; import org.slf4j.LoggerFactory; import java.util.*; +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.filterList; +import static cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO.ID_ROOT; + @Mapper public interface AuthConvert { @@ -47,7 +49,7 @@ public interface AuthConvert { Map treeNodeMap = new LinkedHashMap<>(); menuList.forEach(menu -> treeNodeMap.put(menu.getId(), AuthConvert.INSTANCE.convertTreeNode(menu))); // 处理父子关系 - treeNodeMap.values().stream().filter(node -> !node.getParentId().equals(MenuIdEnum.ROOT.getId())).forEach(childNode -> { + treeNodeMap.values().stream().filter(node -> !node.getParentId().equals(ID_ROOT)).forEach(childNode -> { // 获得父节点 AuthMenuRespVO parentNode = treeNodeMap.get(childNode.getParentId()); if (parentNode == null) { @@ -62,7 +64,7 @@ public interface AuthConvert { parentNode.getChildren().add(childNode); }); // 获得到所有的根节点 - return CollectionUtils.filterList(treeNodeMap.values(), node -> MenuIdEnum.ROOT.getId().equals(node.getParentId())); + return filterList(treeNodeMap.values(), node -> ID_ROOT.equals(node.getParentId())); } SocialUserBindReqDTO convert(Long userId, Integer userType, AuthSocialLoginReqVO reqVO); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/permission/MenuDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/permission/MenuDO.java index 5d77c50da..91e46bbff 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/permission/MenuDO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/permission/MenuDO.java @@ -21,7 +21,12 @@ import lombok.EqualsAndHashCode; public class MenuDO extends BaseDO { /** - * 菜单ID + * 菜单编号 - 根节点 + */ + public static final Long ID_ROOT = 0L; + + /** + * 菜单编号 */ @TableId private Long id; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/DeptMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/DeptMapper.java index a7050a182..def79df69 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/DeptMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/DeptMapper.java @@ -4,7 +4,6 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -19,9 +18,7 @@ public interface DeptMapper extends BaseMapperX { } default DeptDO selectByParentIdAndName(Long parentId, String name) { - return selectOne(new LambdaQueryWrapper() - .eq(DeptDO::getParentId, parentId) - .eq(DeptDO::getName, name)); + return selectOne(DeptDO::getParentId, parentId, DeptDO::getName, name); } default Long selectCountByParentId(Long parentId) { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/PostMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/PostMapper.java index 6bcb8e2fd..ba062a2c0 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/PostMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/PostMapper.java @@ -2,11 +2,10 @@ package cn.iocoder.yudao.module.system.dal.mysql.dept; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; -import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostPageReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.apache.ibatis.annotations.Mapper; import java.util.Collection; @@ -16,31 +15,32 @@ import java.util.List; public interface PostMapper extends BaseMapperX { default List selectList(Collection ids, Collection statuses) { - return selectList(new QueryWrapperX().inIfPresent("id", ids) - .inIfPresent("status", statuses)); + return selectList(new LambdaQueryWrapperX() + .inIfPresent(PostDO::getId, ids) + .inIfPresent(PostDO::getStatus, statuses)); } default PageResult selectPage(PostPageReqVO reqVO) { - return selectPage(reqVO, new QueryWrapperX() - .likeIfPresent("code", reqVO.getCode()) - .likeIfPresent("name", reqVO.getName()) - .eqIfPresent("status", reqVO.getStatus()) - .orderByDesc("id")); + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(PostDO::getCode, reqVO.getCode()) + .likeIfPresent(PostDO::getName, reqVO.getName()) + .eqIfPresent(PostDO::getStatus, reqVO.getStatus()) + .orderByDesc(PostDO::getId)); } default List selectList(PostExportReqVO reqVO) { - return selectList(new QueryWrapperX() - .likeIfPresent("code", reqVO.getCode()) - .likeIfPresent("name", reqVO.getName()) - .eqIfPresent("status", reqVO.getStatus())); + return selectList(new LambdaQueryWrapperX() + .likeIfPresent(PostDO::getCode, reqVO.getCode()) + .likeIfPresent(PostDO::getName, reqVO.getName()) + .eqIfPresent(PostDO::getStatus, reqVO.getStatus())); } default PostDO selectByName(String name) { - return selectOne(new QueryWrapper().eq("name", name)); + return selectOne(PostDO::getName, name); } default PostDO selectByCode(String code) { - return selectOne(new QueryWrapper().eq("code", code)); + return selectOne(PostDO::getCode, code); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/UserPostMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/UserPostMapper.java index 9d2601e8f..addc67d43 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/UserPostMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/UserPostMapper.java @@ -13,8 +13,7 @@ import java.util.List; public interface UserPostMapper extends BaseMapperX { default List selectListByUserId(Long userId) { - return selectList(new LambdaQueryWrapperX() - .eq(UserPostDO::getUserId, userId)); + return selectList(UserPostDO::getUserId, userId); } default void deleteByUserIdAndPostId(Long userId, Collection postIds) { @@ -24,11 +23,10 @@ public interface UserPostMapper extends BaseMapperX { } default List selectListByPostIds(Collection postIds) { - return selectList(new LambdaQueryWrapperX() - .in(UserPostDO::getPostId, postIds)); + return selectList(UserPostDO::getPostId, postIds); } - default void deleteByUserId(Long userId){ + default void deleteByUserId(Long userId) { delete(Wrappers.lambdaUpdate(UserPostDO.class).eq(UserPostDO::getUserId, userId)); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictDataMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictDataMapper.java index 951ef87af..244825093 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictDataMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictDataMapper.java @@ -17,13 +17,11 @@ import java.util.List; public interface DictDataMapper extends BaseMapperX { default DictDataDO selectByDictTypeAndValue(String dictType, String value) { - return selectOne(new LambdaQueryWrapper().eq(DictDataDO::getDictType, dictType) - .eq(DictDataDO::getValue, value)); + return selectOne(DictDataDO::getDictType, dictType, DictDataDO::getValue, value); } default DictDataDO selectByDictTypeAndLabel(String dictType, String label) { - return selectOne(new LambdaQueryWrapper().eq(DictDataDO::getDictType, dictType) - .eq(DictDataDO::getLabel, label)); + return selectOne(DictDataDO::getDictType, dictType, DictDataDO::getLabel, label); } default List selectByDictTypeAndValues(String dictType, Collection values) { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/errorcode/ErrorCodeMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/errorcode/ErrorCodeMapper.java index 3cb6bc8af..93baced06 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/errorcode/ErrorCodeMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/errorcode/ErrorCodeMapper.java @@ -36,11 +36,11 @@ public interface ErrorCodeMapper extends BaseMapperX { } default List selectListByCodes(Collection codes) { - return selectList(new LambdaQueryWrapperX().in(ErrorCodeDO::getCode, codes)); + return selectList(ErrorCodeDO::getCode, codes); } default ErrorCodeDO selectByCode(Integer code) { - return selectOne(new LambdaQueryWrapperX().eq(ErrorCodeDO::getCode, code)); + return selectOne(ErrorCodeDO::getCode, code); } default List selectListByApplicationNameAndUpdateTimeGt(String applicationName, LocalDateTime minUpdateTime) { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/permission/MenuMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/permission/MenuMapper.java index cdab84b53..3d645bdf2 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/permission/MenuMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/permission/MenuMapper.java @@ -4,7 +4,6 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu.MenuListReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -13,8 +12,7 @@ import java.util.List; public interface MenuMapper extends BaseMapperX { default MenuDO selectByParentIdAndName(Long parentId, String name) { - return selectOne(new LambdaQueryWrapper().eq(MenuDO::getParentId, parentId) - .eq(MenuDO::getName, name)); + return selectOne(MenuDO::getParentId, parentId, MenuDO::getName, name); } default Long selectCountByParentId(Long parentId) { @@ -22,7 +20,8 @@ public interface MenuMapper extends BaseMapperX { } default List selectList(MenuListReqVO reqVO) { - return selectList(new LambdaQueryWrapperX().likeIfPresent(MenuDO::getName, reqVO.getName()) + return selectList(new LambdaQueryWrapperX() + .likeIfPresent(MenuDO::getName, reqVO.getName()) .eqIfPresent(MenuDO::getStatus, reqVO.getStatus())); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/social/SocialUserBindMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/social/SocialUserBindMapper.java index 88d0c9227..28619ca51 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/social/SocialUserBindMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/social/SocialUserBindMapper.java @@ -24,9 +24,8 @@ public interface SocialUserBindMapper extends BaseMapperX { } default SocialUserBindDO selectByUserTypeAndSocialUserId(Integer userType, Long socialUserId) { - return selectOne(new LambdaQueryWrapperX() - .eq(SocialUserBindDO::getUserType, userType) - .eq(SocialUserBindDO::getSocialUserId, socialUserId)); + return selectOne(SocialUserBindDO::getUserType, userType, + SocialUserBindDO::getSocialUserId, socialUserId); } default List selectListByUserIdAndUserType(Long userId, Integer userType) { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java index e6713bacb..4e0827210 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java @@ -6,7 +6,6 @@ import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserPageReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.apache.ibatis.annotations.Mapper; import java.util.Collection; @@ -16,15 +15,15 @@ import java.util.List; public interface AdminUserMapper extends BaseMapperX { default AdminUserDO selectByUsername(String username) { - return selectOne(new LambdaQueryWrapper().eq(AdminUserDO::getUsername, username)); + return selectOne(AdminUserDO::getUsername, username); } default AdminUserDO selectByEmail(String email) { - return selectOne(new LambdaQueryWrapper().eq(AdminUserDO::getEmail, email)); + return selectOne(AdminUserDO::getEmail, email); } default AdminUserDO selectByMobile(String mobile) { - return selectOne(new LambdaQueryWrapper().eq(AdminUserDO::getMobile, mobile)); + return selectOne(AdminUserDO::getMobile, mobile); } default PageResult selectPage(UserPageReqVO reqVO, Collection deptIds) { @@ -50,10 +49,6 @@ public interface AdminUserMapper extends BaseMapperX { return selectList(new LambdaQueryWrapperX().like(AdminUserDO::getNickname, nickname)); } - default List selectListByUsername(String username) { - return selectList(new LambdaQueryWrapperX().like(AdminUserDO::getUsername, username)); - } - default List selectListByStatus(Integer status) { return selectList(AdminUserDO::getStatus, status); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/web/config/SystemWebConfiguration.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/web/config/SystemWebConfiguration.java new file mode 100644 index 000000000..5b1b2355b --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/web/config/SystemWebConfiguration.java @@ -0,0 +1,24 @@ +package cn.iocoder.yudao.module.system.framework.web.config; + +import cn.iocoder.yudao.framework.swagger.config.YudaoSwaggerAutoConfiguration; +import org.springdoc.core.GroupedOpenApi; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * system 模块的 web 组件的 Configuration + * + * @author 芋道源码 + */ +@Configuration(proxyBeanMethods = false) +public class SystemWebConfiguration { + + /** + * system 模块的 API 分组 + */ + @Bean + public GroupedOpenApi systemGroupedOpenApi() { + return YudaoSwaggerAutoConfiguration.buildGroupedOpenApi("system"); + } + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/web/package-info.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/web/package-info.java new file mode 100644 index 000000000..1a17a3d7c --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/framework/web/package-info.java @@ -0,0 +1,4 @@ +/** + * system 模块的 web 配置 + */ +package cn.iocoder.yudao.module.system.framework.web; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java index 490284242..ca34156eb 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java @@ -94,7 +94,7 @@ public class AdminAuthServiceImpl implements AdminAuthService { @Override public AuthLoginRespVO login(AuthLoginReqVO reqVO) { // 校验验证码 - verifyCaptcha(reqVO); + validateCaptcha(reqVO); // 使用账号密码,进行登录 AdminUserDO user = authenticate(reqVO.getUsername(), reqVO.getPassword()); @@ -171,14 +171,8 @@ public class AdminAuthServiceImpl implements AdminAuthService { return createTokenAfterLoginSuccess(user.getId(), user.getUsername(), LoginLogTypeEnum.LOGIN_SOCIAL); } - @Override - public AuthLoginRespVO refreshToken(String refreshToken) { - OAuth2AccessTokenDO accessTokenDO = oauth2TokenService.refreshAccessToken(refreshToken, OAuth2ClientConstants.CLIENT_ID_DEFAULT); - return AuthConvert.INSTANCE.convert(accessTokenDO); - } - @VisibleForTesting - void verifyCaptcha(AuthLoginReqVO reqVO) { + void validateCaptcha(AuthLoginReqVO reqVO) { // 如果验证码关闭,则不进行校验 if (!captchaEnable) { return; @@ -206,6 +200,12 @@ public class AdminAuthServiceImpl implements AdminAuthService { return AuthConvert.INSTANCE.convert(accessTokenDO); } + @Override + public AuthLoginRespVO refreshToken(String refreshToken) { + OAuth2AccessTokenDO accessTokenDO = oauth2TokenService.refreshAccessToken(refreshToken, OAuth2ClientConstants.CLIENT_ID_DEFAULT); + return AuthConvert.INSTANCE.convert(accessTokenDO); + } + @Override public void logout(String token, Integer logType) { // 删除访问令牌 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java index a6c30bc10..87033d4b3 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java @@ -52,7 +52,7 @@ public interface DeptService { * @param reqVO 筛选条件请求 VO * @return 部门列表 */ - List getSimpleDepts(DeptListReqVO reqVO); + List getDeptList(DeptListReqVO reqVO); /** * 获得所有子部门,从缓存中 @@ -61,7 +61,7 @@ public interface DeptService { * @param recursive 是否递归获取所有 * @return 子部门列表 */ - List getDeptsByParentIdFromCache(Long parentId, boolean recursive); + List getDeptListByParentIdFromCache(Long parentId, boolean recursive); /** * 获得部门信息数组 @@ -69,7 +69,21 @@ public interface DeptService { * @param ids 部门编号数组 * @return 部门信息数组 */ - List getDepts(Collection ids); + List getDeptList(Collection ids); + + /** + * 获得指定编号的部门 Map + * + * @param ids 部门编号数组 + * @return 部门 Map + */ + default Map getDeptMap(Collection ids) { + if (CollUtil.isEmpty(ids)) { + return Collections.emptyMap(); + } + List list = getDeptList(ids); + return CollectionUtils.convertMap(list, DeptDO::getId); + } /** * 获得部门信息 @@ -86,27 +100,6 @@ public interface DeptService { * * @param ids 角色编号数组 */ - void validDepts(Collection ids); + void validateDeptList(Collection ids); - /** - * 获得指定编号的部门列表 - * - * @param ids 部门编号数组 - * @return 部门列表 - */ - List getSimpleDepts(Collection ids); - - /** - * 获得指定编号的部门 Map - * - * @param ids 部门编号数组 - * @return 部门 Map - */ - default Map getDeptMap(Collection ids) { - if (CollUtil.isEmpty(ids)) { - return Collections.emptyMap(); - } - List list = getSimpleDepts(ids); - return CollectionUtils.convertMap(list, DeptDO::getId); - } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java index 6262eaf70..1b2bbec04 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java @@ -2,8 +2,6 @@ package cn.iocoder.yudao.module.system.service.dept; import cn.hutool.core.collection.CollUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; -import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; -import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateReqVO; @@ -19,13 +17,11 @@ import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.Multimap; import lombok.Getter; import lombok.extern.slf4j.Slf4j; -import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import javax.annotation.PostConstruct; import javax.annotation.Resource; -import java.time.LocalDateTime; import java.util.*; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; @@ -95,7 +91,7 @@ public class DeptServiceImpl implements DeptService { if (reqVO.getParentId() == null) { reqVO.setParentId(DeptIdEnum.ROOT.getId()); } - checkCreateOrUpdate(null, reqVO.getParentId(), reqVO.getName()); + validateForCreateOrUpdate(null, reqVO.getParentId(), reqVO.getName()); // 插入部门 DeptDO dept = DeptConvert.INSTANCE.convert(reqVO); deptMapper.insert(dept); @@ -110,7 +106,7 @@ public class DeptServiceImpl implements DeptService { if (reqVO.getParentId() == null) { reqVO.setParentId(DeptIdEnum.ROOT.getId()); } - checkCreateOrUpdate(reqVO.getId(), reqVO.getParentId(), reqVO.getName()); + validateForCreateOrUpdate(reqVO.getId(), reqVO.getParentId(), reqVO.getName()); // 更新部门 DeptDO updateObj = DeptConvert.INSTANCE.convert(reqVO); deptMapper.updateById(updateObj); @@ -121,10 +117,10 @@ public class DeptServiceImpl implements DeptService { @Override public void deleteDept(Long id) { // 校验是否存在 - checkDeptExists(id); + validateDeptExists(id); // 校验是否有子部门 if (deptMapper.selectCountByParentId(id) > 0) { - throw ServiceExceptionUtil.exception(DEPT_EXITS_CHILDREN); + throw exception(DEPT_EXITS_CHILDREN); } // 删除部门 deptMapper.deleteById(id); @@ -133,20 +129,20 @@ public class DeptServiceImpl implements DeptService { } @Override - public List getSimpleDepts(DeptListReqVO reqVO) { + public List getDeptList(DeptListReqVO reqVO) { return deptMapper.selectList(reqVO); } @Override - public List getDeptsByParentIdFromCache(Long parentId, boolean recursive) { + public List getDeptListByParentIdFromCache(Long parentId, boolean recursive) { if (parentId == null) { return Collections.emptyList(); } - List result = new ArrayList<>(); // TODO 芋艿:待优化,新增缓存,避免每次遍历的计算 + List result = new ArrayList<>(); // 递归,简单粗暴 - this.getDeptsByParentIdFromCache(result, parentId, - recursive ? Integer.MAX_VALUE : 1, // 如果递归获取,则无限;否则,只递归 1 次 - parentDeptCache); + getDeptsByParentIdFromCache(result, parentId, + recursive ? Integer.MAX_VALUE : 1, // 如果递归获取,则无限;否则,只递归 1 次 + parentDeptCache); return result; } @@ -182,65 +178,65 @@ public class DeptServiceImpl implements DeptService { recursiveCount - 1, parentDeptMap)); } - private void checkCreateOrUpdate(Long id, Long parentId, String name) { + private void validateForCreateOrUpdate(Long id, Long parentId, String name) { // 校验自己存在 - checkDeptExists(id); + validateDeptExists(id); // 校验父部门的有效性 - checkParentDeptEnable(id, parentId); + validateParentDeptEnable(id, parentId); // 校验部门名的唯一性 - checkDeptNameUnique(id, parentId, name); + validateDeptNameUnique(id, parentId, name); } - private void checkParentDeptEnable(Long id, Long parentId) { + private void validateParentDeptEnable(Long id, Long parentId) { if (parentId == null || DeptIdEnum.ROOT.getId().equals(parentId)) { return; } // 不能设置自己为父部门 if (parentId.equals(id)) { - throw ServiceExceptionUtil.exception(DEPT_PARENT_ERROR); + throw exception(DEPT_PARENT_ERROR); } // 父岗位不存在 DeptDO dept = deptMapper.selectById(parentId); if (dept == null) { - throw ServiceExceptionUtil.exception(DEPT_PARENT_NOT_EXITS); + throw exception(DEPT_PARENT_NOT_EXITS); } // 父部门被禁用 if (!CommonStatusEnum.ENABLE.getStatus().equals(dept.getStatus())) { - throw ServiceExceptionUtil.exception(DEPT_NOT_ENABLE); + throw exception(DEPT_NOT_ENABLE); } // 父部门不能是原来的子部门 - List children = this.getDeptsByParentIdFromCache(id, true); + List children = getDeptListByParentIdFromCache(id, true); if (children.stream().anyMatch(dept1 -> dept1.getId().equals(parentId))) { - throw ServiceExceptionUtil.exception(DEPT_PARENT_IS_CHILD); + throw exception(DEPT_PARENT_IS_CHILD); } } - private void checkDeptExists(Long id) { + private void validateDeptExists(Long id) { if (id == null) { return; } DeptDO dept = deptMapper.selectById(id); if (dept == null) { - throw ServiceExceptionUtil.exception(DEPT_NOT_FOUND); + throw exception(DEPT_NOT_FOUND); } } - private void checkDeptNameUnique(Long id, Long parentId, String name) { + private void validateDeptNameUnique(Long id, Long parentId, String name) { DeptDO menu = deptMapper.selectByParentIdAndName(parentId, name); if (menu == null) { return; } // 如果 id 为空,说明不用比较是否为相同 id 的岗位 if (id == null) { - throw ServiceExceptionUtil.exception(DEPT_NAME_DUPLICATE); + throw exception(DEPT_NAME_DUPLICATE); } if (!menu.getId().equals(id)) { - throw ServiceExceptionUtil.exception(DEPT_NAME_DUPLICATE); + throw exception(DEPT_NAME_DUPLICATE); } } @Override - public List getDepts(Collection ids) { + public List getDeptList(Collection ids) { return deptMapper.selectBatchIds(ids); } @@ -250,13 +246,12 @@ public class DeptServiceImpl implements DeptService { } @Override - public void validDepts(Collection ids) { + public void validateDeptList(Collection ids) { if (CollUtil.isEmpty(ids)) { return; } // 获得科室信息 - List depts = deptMapper.selectBatchIds(ids); - Map deptMap = CollectionUtils.convertMap(depts, DeptDO::getId); + Map deptMap = getDeptMap(ids); // 校验 ids.forEach(id -> { DeptDO dept = deptMap.get(id); @@ -269,9 +264,4 @@ public class DeptServiceImpl implements DeptService { }); } - @Override - public List getSimpleDepts(Collection ids) { - return deptMapper.selectBatchIds(ids); - } - } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/PostService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/PostService.java index fc74c944a..c1b84c011 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/PostService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/PostService.java @@ -49,8 +49,8 @@ public interface PostService { * @param ids 岗位编号数组。如果为空,不进行筛选 * @return 部门列表 */ - default List getPosts(@Nullable Collection ids) { - return getPosts(ids, asSet(CommonStatusEnum.ENABLE.getStatus(), CommonStatusEnum.DISABLE.getStatus())); + default List getPostList(@Nullable Collection ids) { + return getPostList(ids, asSet(CommonStatusEnum.ENABLE.getStatus(), CommonStatusEnum.DISABLE.getStatus())); } /** @@ -60,7 +60,7 @@ public interface PostService { * @param statuses 状态数组。如果为空,不进行筛选 * @return 部门列表 */ - List getPosts(@Nullable Collection ids, @Nullable Collection statuses); + List getPostList(@Nullable Collection ids, @Nullable Collection statuses); /** * 获得岗位分页列表 @@ -76,7 +76,7 @@ public interface PostService { * @param reqVO 查询条件 * @return 部门列表 */ - List getPosts(PostExportReqVO reqVO); + List getPostList(PostExportReqVO reqVO); /** * 获得岗位信息 @@ -93,6 +93,6 @@ public interface PostService { * * @param ids 岗位编号数组 */ - void validPosts(Collection ids); + void validatePostList(Collection ids); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/PostServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/PostServiceImpl.java index 81e003152..3266a0c92 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/PostServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/PostServiceImpl.java @@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.system.service.dept; import cn.hutool.core.collection.CollUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; -import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostExportReqVO; @@ -38,7 +37,8 @@ public class PostServiceImpl implements PostService { @Override public Long createPost(PostCreateReqVO reqVO) { // 校验正确性 - this.checkCreateOrUpdate(null, reqVO.getName(), reqVO.getCode()); + validatePostForCreateOrUpdate(null, reqVO.getName(), reqVO.getCode()); + // 插入岗位 PostDO post = PostConvert.INSTANCE.convert(reqVO); postMapper.insert(post); @@ -48,7 +48,8 @@ public class PostServiceImpl implements PostService { @Override public void updatePost(PostUpdateReqVO reqVO) { // 校验正确性 - this.checkCreateOrUpdate(reqVO.getId(), reqVO.getName(), reqVO.getCode()); + validatePostForCreateOrUpdate(reqVO.getId(), reqVO.getName(), reqVO.getCode()); + // 更新岗位 PostDO updateObj = PostConvert.INSTANCE.convert(reqVO); postMapper.updateById(updateObj); @@ -57,13 +58,59 @@ public class PostServiceImpl implements PostService { @Override public void deletePost(Long id) { // 校验是否存在 - this.checkPostExists(id); + validatePostExists(id); // 删除部门 postMapper.deleteById(id); } + private void validatePostForCreateOrUpdate(Long id, String name, String code) { + // 校验自己存在 + validatePostExists(id); + // 校验岗位名的唯一性 + validatePostNameUnique(id, name); + // 校验岗位编码的唯一性 + validatePostCodeUnique(id, code); + } + + private void validatePostNameUnique(Long id, String name) { + PostDO post = postMapper.selectByName(name); + if (post == null) { + return; + } + // 如果 id 为空,说明不用比较是否为相同 id 的岗位 + if (id == null) { + throw exception(POST_NAME_DUPLICATE); + } + if (!post.getId().equals(id)) { + throw exception(POST_NAME_DUPLICATE); + } + } + + private void validatePostCodeUnique(Long id, String code) { + PostDO post = postMapper.selectByCode(code); + if (post == null) { + return; + } + // 如果 id 为空,说明不用比较是否为相同 id 的岗位 + if (id == null) { + throw exception(POST_CODE_DUPLICATE); + } + if (!post.getId().equals(id)) { + throw exception(POST_CODE_DUPLICATE); + } + } + + private void validatePostExists(Long id) { + if (id == null) { + return; + } + if (postMapper.selectById(id) == null) { + throw exception(POST_NOT_FOUND); + } + } + @Override - public List getPosts(Collection ids, Collection statuses) { + public List getPostList(Collection ids, Collection statuses) { return postMapper.selectList(ids, statuses); } @@ -73,7 +120,7 @@ public class PostServiceImpl implements PostService { } @Override - public List getPosts(PostExportReqVO reqVO) { + public List getPostList(PostExportReqVO reqVO) { return postMapper.selectList(reqVO); } @@ -82,55 +129,8 @@ public class PostServiceImpl implements PostService { return postMapper.selectById(id); } - private void checkCreateOrUpdate(Long id, String name, String code) { - // 校验自己存在 - checkPostExists(id); - // 校验岗位名的唯一性 - checkPostNameUnique(id, name); - // 校验岗位编码的唯一性 - checkPostCodeUnique(id, code); - } - - private void checkPostNameUnique(Long id, String name) { - PostDO post = postMapper.selectByName(name); - if (post == null) { - return; - } - // 如果 id 为空,说明不用比较是否为相同 id 的岗位 - if (id == null) { - throw ServiceExceptionUtil.exception(POST_NAME_DUPLICATE); - } - if (!post.getId().equals(id)) { - throw ServiceExceptionUtil.exception(POST_NAME_DUPLICATE); - } - } - - private void checkPostCodeUnique(Long id, String code) { - PostDO post = postMapper.selectByCode(code); - if (post == null) { - return; - } - // 如果 id 为空,说明不用比较是否为相同 id 的岗位 - if (id == null) { - throw ServiceExceptionUtil.exception(POST_CODE_DUPLICATE); - } - if (!post.getId().equals(id)) { - throw ServiceExceptionUtil.exception(POST_CODE_DUPLICATE); - } - } - - private void checkPostExists(Long id) { - if (id == null) { - return; - } - PostDO post = postMapper.selectById(id); - if (post == null) { - throw ServiceExceptionUtil.exception(POST_NOT_FOUND); - } - } - @Override - public void validPosts(Collection ids) { + public void validatePostList(Collection ids) { if (CollUtil.isEmpty(ids)) { return; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java index 610fe2a33..d2eb8c519 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java @@ -44,7 +44,7 @@ public interface DictDataService { * * @return 字典数据全列表 */ - List getDictDatas(); + List getDictDataList(); /** * 获得字典数据分页列表 @@ -60,7 +60,7 @@ public interface DictDataService { * @param reqVO 列表请求 * @return 字典数据列表 */ - List getDictDatas(DictDataExportReqVO reqVO); + List getDictDataList(DictDataExportReqVO reqVO); /** * 获得字典数据详情 @@ -86,7 +86,7 @@ public interface DictDataService { * @param dictType 字典类型 * @param values 字典数据值的数组 */ - void validDictDatas(String dictType, Collection values); + void validateDictDataList(String dictType, Collection values); /** * 获得指定的字典数据 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java index 0cfdb2b99..eccd2c219 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java @@ -48,7 +48,7 @@ public class DictDataServiceImpl implements DictDataService { private DictDataMapper dictDataMapper; @Override - public List getDictDatas() { + public List getDictDataList() { List list = dictDataMapper.selectList(); list.sort(COMPARATOR_TYPE_AND_SORT); return list; @@ -60,7 +60,7 @@ public class DictDataServiceImpl implements DictDataService { } @Override - public List getDictDatas(DictDataExportReqVO reqVO) { + public List getDictDataList(DictDataExportReqVO reqVO) { List list = dictDataMapper.selectList(reqVO); list.sort(COMPARATOR_TYPE_AND_SORT); return list; @@ -74,7 +74,7 @@ public class DictDataServiceImpl implements DictDataService { @Override public Long createDictData(DictDataCreateReqVO reqVO) { // 校验正确性 - checkCreateOrUpdate(null, reqVO.getValue(), reqVO.getDictType()); + validateDictDataForCreateOrUpdate(null, reqVO.getValue(), reqVO.getDictType()); // 插入字典类型 DictDataDO dictData = DictDataConvert.INSTANCE.convert(reqVO); @@ -85,7 +85,7 @@ public class DictDataServiceImpl implements DictDataService { @Override public void updateDictData(DictDataUpdateReqVO reqVO) { // 校验正确性 - checkCreateOrUpdate(reqVO.getId(), reqVO.getValue(), reqVO.getDictType()); + validateDictDataForCreateOrUpdate(reqVO.getId(), reqVO.getValue(), reqVO.getDictType()); // 更新字典类型 DictDataDO updateObj = DictDataConvert.INSTANCE.convert(reqVO); @@ -95,7 +95,7 @@ public class DictDataServiceImpl implements DictDataService { @Override public void deleteDictData(Long id) { // 校验是否存在 - checkDictDataExists(id); + validateDictDataExists(id); // 删除字典数据 dictDataMapper.deleteById(id); @@ -106,18 +106,17 @@ public class DictDataServiceImpl implements DictDataService { return dictDataMapper.selectCountByDictType(dictType); } - - private void checkCreateOrUpdate(Long id, String value, String dictType) { + private void validateDictDataForCreateOrUpdate(Long id, String value, String dictType) { // 校验自己存在 - checkDictDataExists(id); + validateDictDataExists(id); // 校验字典类型有效 - checkDictTypeValid(dictType); + validateDictTypeExists(dictType); // 校验字典数据的值的唯一性 - checkDictDataValueUnique(id, dictType, value); + validateDictDataValueUnique(id, dictType, value); } @VisibleForTesting - public void checkDictDataValueUnique(Long id, String dictType, String value) { + public void validateDictDataValueUnique(Long id, String dictType, String value) { DictDataDO dictData = dictDataMapper.selectByDictTypeAndValue(dictType, value); if (dictData == null) { return; @@ -132,7 +131,7 @@ public class DictDataServiceImpl implements DictDataService { } @VisibleForTesting - public void checkDictDataExists(Long id) { + public void validateDictDataExists(Long id) { if (id == null) { return; } @@ -143,7 +142,7 @@ public class DictDataServiceImpl implements DictDataService { } @VisibleForTesting - public void checkDictTypeValid(String type) { + public void validateDictTypeExists(String type) { DictTypeDO dictType = dictTypeService.getDictType(type); if (dictType == null) { throw exception(DICT_TYPE_NOT_EXISTS); @@ -154,7 +153,7 @@ public class DictDataServiceImpl implements DictDataService { } @Override - public void validDictDatas(String dictType, Collection values) { + public void validateDictDataList(String dictType, Collection values) { if (CollUtil.isEmpty(values)) { return; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceImpl.java index 07fcf40f3..cc731affe 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceImpl.java @@ -57,7 +57,8 @@ public class DictTypeServiceImpl implements DictTypeService { @Override public Long createDictType(DictTypeCreateReqVO reqVO) { // 校验正确性 - checkCreateOrUpdate(null, reqVO.getName(), reqVO.getType()); + validateDictTypeForCreateOrUpdate(null, reqVO.getName(), reqVO.getType()); + // 插入字典类型 DictTypeDO dictType = DictTypeConvert.INSTANCE.convert(reqVO) .setDeletedTime(LocalDateTimeUtils.EMPTY); // 唯一索引,避免 null 值 @@ -68,7 +69,8 @@ public class DictTypeServiceImpl implements DictTypeService { @Override public void updateDictType(DictTypeUpdateReqVO reqVO) { // 校验正确性 - checkCreateOrUpdate(reqVO.getId(), reqVO.getName(), null); + validateDictTypeForCreateOrUpdate(reqVO.getId(), reqVO.getName(), null); + // 更新字典类型 DictTypeDO updateObj = DictTypeConvert.INSTANCE.convert(reqVO); dictTypeMapper.updateById(updateObj); @@ -77,7 +79,7 @@ public class DictTypeServiceImpl implements DictTypeService { @Override public void deleteDictType(Long id) { // 校验是否存在 - DictTypeDO dictType = checkDictTypeExists(id); + DictTypeDO dictType = validateDictTypeExists(id); // 校验是否有字典数据 if (dictDataService.countByDictType(dictType.getType()) > 0) { throw exception(DICT_TYPE_HAS_CHILDREN); @@ -91,17 +93,17 @@ public class DictTypeServiceImpl implements DictTypeService { return dictTypeMapper.selectList(); } - private void checkCreateOrUpdate(Long id, String name, String type) { + private void validateDictTypeForCreateOrUpdate(Long id, String name, String type) { // 校验自己存在 - checkDictTypeExists(id); + validateDictTypeExists(id); // 校验字典类型的名字的唯一性 - checkDictTypeNameUnique(id, name); + validateDictTypeNameUnique(id, name); // 校验字典类型的类型的唯一性 - checkDictTypeUnique(id, type); + validateDictTypeUnique(id, type); } @VisibleForTesting - public void checkDictTypeNameUnique(Long id, String name) { + void validateDictTypeNameUnique(Long id, String name) { DictTypeDO dictType = dictTypeMapper.selectByName(name); if (dictType == null) { return; @@ -116,7 +118,7 @@ public class DictTypeServiceImpl implements DictTypeService { } @VisibleForTesting - public void checkDictTypeUnique(Long id, String type) { + void validateDictTypeUnique(Long id, String type) { if (StrUtil.isEmpty(type)) { return; } @@ -134,7 +136,7 @@ public class DictTypeServiceImpl implements DictTypeService { } @VisibleForTesting - public DictTypeDO checkDictTypeExists(Long id) { + DictTypeDO validateDictTypeExists(Long id) { if (id == null) { return null; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceImpl.java index d28f2baed..ed0712a90 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceImpl.java @@ -58,7 +58,7 @@ public class ErrorCodeServiceImpl implements ErrorCodeService { @Override public void updateErrorCode(ErrorCodeUpdateReqVO updateReqVO) { // 校验存在 - this.validateErrorCodeExists(updateReqVO.getId()); + validateErrorCodeExists(updateReqVO.getId()); // 校验 code 重复 validateCodeDuplicate(updateReqVO.getCode(), updateReqVO.getId()); @@ -71,7 +71,7 @@ public class ErrorCodeServiceImpl implements ErrorCodeService { @Override public void deleteErrorCode(Long id) { // 校验存在 - this.validateErrorCodeExists(id); + validateErrorCodeExists(id); // 删除 errorCodeMapper.deleteById(id); } @@ -100,7 +100,7 @@ public class ErrorCodeServiceImpl implements ErrorCodeService { } @VisibleForTesting - public void validateErrorCodeExists(Long id) { + void validateErrorCodeExists(Long id) { if (errorCodeMapper.selectById(id) == null) { throw exception(ERROR_CODE_NOT_EXISTS); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/logger/OperateLogService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/logger/OperateLogService.java index 224a83f19..434ecbc46 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/logger/OperateLogService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/logger/OperateLogService.java @@ -1,8 +1,6 @@ package cn.iocoder.yudao.module.system.service.logger; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.operatelog.core.service.OperateLog; -import cn.iocoder.yudao.framework.operatelog.core.service.OperateLogFrameworkService; import cn.iocoder.yudao.module.system.api.logger.dto.OperateLogCreateReqDTO; import cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog.OperateLogExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog.OperateLogPageReqVO; @@ -38,6 +36,6 @@ public interface OperateLogService { * @param reqVO 列表条件 * @return 日志列表 */ - List getOperateLogs(OperateLogExportReqVO reqVO); + List getOperateLogList(OperateLogExportReqVO reqVO); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImpl.java index 8ae3d139b..c899696ac 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImpl.java @@ -49,7 +49,7 @@ public class OperateLogServiceImpl implements OperateLogService { // 处理基于用户昵称的查询 Collection userIds = null; if (StrUtil.isNotEmpty(reqVO.getUserNickname())) { - userIds = convertSet(userService.getUsersByNickname(reqVO.getUserNickname()), AdminUserDO::getId); + userIds = convertSet(userService.getUserListByNickname(reqVO.getUserNickname()), AdminUserDO::getId); if (CollUtil.isEmpty(userIds)) { return PageResult.empty(); } @@ -59,11 +59,11 @@ public class OperateLogServiceImpl implements OperateLogService { } @Override - public List getOperateLogs(OperateLogExportReqVO reqVO) { + public List getOperateLogList(OperateLogExportReqVO reqVO) { // 处理基于用户昵称的查询 Collection userIds = null; if (StrUtil.isNotEmpty(reqVO.getUserNickname())) { - userIds = convertSet(userService.getUsersByNickname(reqVO.getUserNickname()), AdminUserDO::getId); + userIds = convertSet(userService.getUserListByNickname(reqVO.getUserNickname()), AdminUserDO::getId); if (CollUtil.isEmpty(userIds)) { return Collections.emptyList(); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/mail/MailSendServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/mail/MailSendServiceImpl.java index d7b17d877..72da3cf89 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/mail/MailSendServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/mail/MailSendServiceImpl.java @@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.system.service.mail; import cn.hutool.core.util.StrUtil; import cn.hutool.extra.mail.MailAccount; import cn.hutool.extra.mail.MailUtil; -import cn.iocoder.yudao.framework.common.core.KeyValue; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.module.system.convert.mail.MailAccountConvert; @@ -20,15 +19,13 @@ import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; -import java.util.List; import java.util.Map; -import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; /** - * 邮箱模版 服务实现类 + * 邮箱发送 Service 实现类 * * @author wangjingyi * @since 2022-03-21 @@ -82,13 +79,13 @@ public class MailSendServiceImpl implements MailSendService { public Long sendSingleMail(String mail, Long userId, Integer userType, String templateCode, Map templateParams) { // 校验邮箱模版是否合法 - MailTemplateDO template = checkMailTemplateValid(templateCode); + MailTemplateDO template = validateMailTemplate(templateCode); // 校验邮箱账号是否合法 - MailAccountDO account = checkMailAccountValid(template.getAccountId()); + MailAccountDO account = validateMailAccount(template.getAccountId()); // 校验邮箱是否存在 - mail = checkMail(mail); - checkTemplateParams(template, templateParams); + mail = validateMail(mail); + validateTemplateParams(template, templateParams); // 创建发送日志。如果模板被禁用,则不发送短信,只记录日志 Boolean isSend = CommonStatusEnum.ENABLE.getStatus().equals(template.getStatus()); @@ -106,7 +103,7 @@ public class MailSendServiceImpl implements MailSendService { @Override public void doSendMail(MailSendMessage message) { // 1. 创建发送账号 - MailAccountDO account = checkMailAccountValid(message.getAccountId()); + MailAccountDO account = validateMailAccount(message.getAccountId()); MailAccount mailAccount = MailAccountConvert.INSTANCE.convert(account, message.getNickname()); // 2. 发送邮件 try { @@ -121,7 +118,7 @@ public class MailSendServiceImpl implements MailSendService { } @VisibleForTesting - public MailTemplateDO checkMailTemplateValid(String templateCode) { + MailTemplateDO validateMailTemplate(String templateCode) { // 获得邮件模板。考虑到效率,从缓存中获取 MailTemplateDO template = mailTemplateService.getMailTemplateByCodeFromCache(templateCode); // 邮件模板不存在 @@ -132,7 +129,7 @@ public class MailSendServiceImpl implements MailSendService { } @VisibleForTesting - public MailAccountDO checkMailAccountValid(Long accountId) { + MailAccountDO validateMailAccount(Long accountId) { // 获得邮箱账号。考虑到效率,从缓存中获取 MailAccountDO account = mailAccountService.getMailAccountFromCache(accountId); // 邮箱账号不存在 @@ -143,7 +140,7 @@ public class MailSendServiceImpl implements MailSendService { } @VisibleForTesting - public String checkMail(String mail) { + String validateMail(String mail) { if (StrUtil.isEmpty(mail)) { throw exception(MAIL_SEND_MAIL_NOT_EXISTS); } @@ -157,7 +154,7 @@ public class MailSendServiceImpl implements MailSendService { * @param templateParams 参数列表 */ @VisibleForTesting - public void checkTemplateParams(MailTemplateDO template, Map templateParams) { + void validateTemplateParams(MailTemplateDO template, Map templateParams) { template.getParams().forEach(key -> { Object value = templateParams.get(key); if (value == null) { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notice/NoticeService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notice/NoticeService.java index 264fc3048..432fe876e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notice/NoticeService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notice/NoticeService.java @@ -39,7 +39,7 @@ public interface NoticeService { * @param reqVO 分页条件 * @return 部门分页列表 */ - PageResult pageNotices(NoticePageReqVO reqVO); + PageResult getNoticePage(NoticePageReqVO reqVO); /** * 获得岗位公告公告信息 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notice/NoticeServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notice/NoticeServiceImpl.java index 2b796e28c..1930e64c1 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notice/NoticeServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notice/NoticeServiceImpl.java @@ -1,18 +1,18 @@ package cn.iocoder.yudao.module.system.service.notice; -import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticeCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticePageReqVO; import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticeUpdateReqVO; import cn.iocoder.yudao.module.system.convert.notice.NoticeConvert; -import cn.iocoder.yudao.module.system.dal.mysql.notice.NoticeMapper; import cn.iocoder.yudao.module.system.dal.dataobject.notice.NoticeDO; +import cn.iocoder.yudao.module.system.dal.mysql.notice.NoticeMapper; import com.google.common.annotations.VisibleForTesting; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.NOTICE_NOT_FOUND; /** @@ -36,7 +36,7 @@ public class NoticeServiceImpl implements NoticeService { @Override public void updateNotice(NoticeUpdateReqVO reqVO) { // 校验是否存在 - this.checkNoticeExists(reqVO.getId()); + validateNoticeExists(reqVO.getId()); // 更新通知公告 NoticeDO updateObj = NoticeConvert.INSTANCE.convert(reqVO); noticeMapper.updateById(updateObj); @@ -45,13 +45,13 @@ public class NoticeServiceImpl implements NoticeService { @Override public void deleteNotice(Long id) { // 校验是否存在 - this.checkNoticeExists(id); + validateNoticeExists(id); // 删除通知公告 noticeMapper.deleteById(id); } @Override - public PageResult pageNotices(NoticePageReqVO reqVO) { + public PageResult getNoticePage(NoticePageReqVO reqVO) { return noticeMapper.selectPage(reqVO); } @@ -61,13 +61,13 @@ public class NoticeServiceImpl implements NoticeService { } @VisibleForTesting - public void checkNoticeExists(Long id) { + public void validateNoticeExists(Long id) { if (id == null) { return; } NoticeDO notice = noticeMapper.selectById(id); if (notice == null) { - throw ServiceExceptionUtil.exception(NOTICE_NOT_FOUND); + throw exception(NOTICE_NOT_FOUND); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notify/NotifySendServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notify/NotifySendServiceImpl.java index 39e685fd5..f71c5fe5c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notify/NotifySendServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notify/NotifySendServiceImpl.java @@ -44,13 +44,13 @@ public class NotifySendServiceImpl implements NotifySendService { @Override public Long sendSingleNotify(Long userId, Integer userType, String templateCode, Map templateParams) { // 校验模版 - NotifyTemplateDO template = checkNotifyTemplateValid(templateCode); + NotifyTemplateDO template = validateNotifyTemplate(templateCode); if (Objects.equals(template.getStatus(), CommonStatusEnum.DISABLE.getStatus())) { log.info("[sendSingleNotify][模版({})已经关闭,无法给用户({}/{})发送]", templateCode, userId, userType); return null; } // 校验参数 - checkTemplateParams(template, templateParams); + validateTemplateParams(template, templateParams); // 发送站内信 String content = notifyTemplateService.formatNotifyTemplateContent(template.getContent(), templateParams); @@ -58,7 +58,7 @@ public class NotifySendServiceImpl implements NotifySendService { } @VisibleForTesting - public NotifyTemplateDO checkNotifyTemplateValid(String templateCode) { + public NotifyTemplateDO validateNotifyTemplate(String templateCode) { // 获得站内信模板。考虑到效率,从缓存中获取 NotifyTemplateDO template = notifyTemplateService.getNotifyTemplateByCodeFromCache(templateCode); // 站内信模板不存在 @@ -75,7 +75,7 @@ public class NotifySendServiceImpl implements NotifySendService { * @param templateParams 参数列表 */ @VisibleForTesting - public void checkTemplateParams(NotifyTemplateDO template, Map templateParams) { + public void validateTemplateParams(NotifyTemplateDO template, Map templateParams) { template.getParams().forEach(key -> { Object value = templateParams.get(key); if (value == null) { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notify/NotifyTemplateServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notify/NotifyTemplateServiceImpl.java index 5ee8b4bbc..5b63ac720 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notify/NotifyTemplateServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notify/NotifyTemplateServiceImpl.java @@ -76,7 +76,7 @@ public class NotifyTemplateServiceImpl implements NotifyTemplateService { @Override public Long createNotifyTemplate(NotifyTemplateCreateReqVO createReqVO) { // 校验站内信编码是否重复 - checkNotifyTemplateCodeDuplicate(null, createReqVO.getCode()); + validateNotifyTemplateCodeDuplicate(null, createReqVO.getCode()); // 插入 NotifyTemplateDO notifyTemplate = NotifyTemplateConvert.INSTANCE.convert(createReqVO); @@ -93,7 +93,7 @@ public class NotifyTemplateServiceImpl implements NotifyTemplateService { // 校验存在 validateNotifyTemplateExists(updateReqVO.getId()); // 校验站内信编码是否重复 - checkNotifyTemplateCodeDuplicate(updateReqVO.getId(), updateReqVO.getCode()); + validateNotifyTemplateCodeDuplicate(updateReqVO.getId(), updateReqVO.getCode()); // 更新 NotifyTemplateDO updateObj = NotifyTemplateConvert.INSTANCE.convert(updateReqVO); @@ -136,7 +136,7 @@ public class NotifyTemplateServiceImpl implements NotifyTemplateService { } @VisibleForTesting - public void checkNotifyTemplateCodeDuplicate(Long id, String code) { + public void validateNotifyTemplateCodeDuplicate(Long id, String code) { NotifyTemplateDO template = notifyTemplateMapper.selectByCode(code); if (template == null) { return; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuService.java index 2bc192683..02418c077 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuService.java @@ -47,7 +47,7 @@ public interface MenuService { * * @return 菜单列表 */ - List getMenus(); + List getMenuList(); /** * 基于租户,筛选菜单列表 @@ -56,7 +56,7 @@ public interface MenuService { * @param reqVO 筛选条件请求 VO * @return 菜单列表 */ - List getTenantMenus(MenuListReqVO reqVO); + List getMenuListByTenant(MenuListReqVO reqVO); /** * 筛选菜单列表 @@ -64,7 +64,7 @@ public interface MenuService { * @param reqVO 筛选条件请求 VO * @return 菜单列表 */ - List getMenus(MenuListReqVO reqVO); + List getMenuList(MenuListReqVO reqVO); /** * 获得所有菜单,从缓存中 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java index 32466d592..27d6a3567 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java @@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.system.service.permission; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; -import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu.MenuCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu.MenuListReqVO; @@ -10,7 +9,6 @@ import cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu.MenuUp import cn.iocoder.yudao.module.system.convert.permission.MenuConvert; import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO; import cn.iocoder.yudao.module.system.dal.mysql.permission.MenuMapper; -import cn.iocoder.yudao.module.system.enums.permission.MenuIdEnum; import cn.iocoder.yudao.module.system.enums.permission.MenuTypeEnum; import cn.iocoder.yudao.module.system.mq.producer.permission.MenuProducer; import cn.iocoder.yudao.module.system.service.tenant.TenantService; @@ -19,6 +17,7 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.Multimap; import lombok.Getter; +import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; @@ -31,6 +30,8 @@ import javax.annotation.Resource; import java.util.*; import java.util.stream.Collectors; +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO.ID_ROOT; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; /** @@ -49,6 +50,7 @@ public class MenuServiceImpl implements MenuService { * 这里声明 volatile 修饰的原因是,每次刷新时,直接修改指向 */ @Getter + @Setter private volatile Map menuCache; /** * 权限与菜单缓存 @@ -58,6 +60,7 @@ public class MenuServiceImpl implements MenuService { * 这里声明 volatile 修饰的原因是,每次刷新时,直接修改指向 */ @Getter + @Setter private volatile Multimap permissionMenuCache; @Resource @@ -97,9 +100,10 @@ public class MenuServiceImpl implements MenuService { @Override public Long createMenu(MenuCreateReqVO reqVO) { // 校验父菜单存在 - checkParentResource(reqVO.getParentId(), null); + validateParentMenu(reqVO.getParentId(), null); // 校验菜单(自己) - checkResource(reqVO.getParentId(), reqVO.getName(), null); + validateMenu(reqVO.getParentId(), reqVO.getName(), null); + // 插入数据库 MenuDO menu = MenuConvert.INSTANCE.convert(reqVO); initMenuProperty(menu); @@ -114,12 +118,13 @@ public class MenuServiceImpl implements MenuService { public void updateMenu(MenuUpdateReqVO reqVO) { // 校验更新的菜单是否存在 if (menuMapper.selectById(reqVO.getId()) == null) { - throw ServiceExceptionUtil.exception(MENU_NOT_EXISTS); + throw exception(MENU_NOT_EXISTS); } // 校验父菜单存在 - checkParentResource(reqVO.getParentId(), reqVO.getId()); + validateParentMenu(reqVO.getParentId(), reqVO.getId()); // 校验菜单(自己) - checkResource(reqVO.getParentId(), reqVO.getName(), reqVO.getId()); + validateMenu(reqVO.getParentId(), reqVO.getName(), reqVO.getId()); + // 更新到数据库 MenuDO updateObject = MenuConvert.INSTANCE.convert(reqVO); initMenuProperty(updateObject); @@ -128,21 +133,16 @@ public class MenuServiceImpl implements MenuService { menuProducer.sendMenuRefreshMessage(); } - /** - * 删除菜单 - * - * @param menuId 菜单编号 - */ - @Transactional(rollbackFor = Exception.class) @Override + @Transactional(rollbackFor = Exception.class) public void deleteMenu(Long menuId) { // 校验是否还有子菜单 if (menuMapper.selectCountByParentId(menuId) > 0) { - throw ServiceExceptionUtil.exception(MENU_EXISTS_CHILDREN); + throw exception(MENU_EXISTS_CHILDREN); } // 校验删除的菜单是否存在 if (menuMapper.selectById(menuId) == null) { - throw ServiceExceptionUtil.exception(MENU_NOT_EXISTS); + throw exception(MENU_NOT_EXISTS); } // 标记删除 menuMapper.deleteById(menuId); @@ -160,20 +160,20 @@ public class MenuServiceImpl implements MenuService { } @Override - public List getMenus() { + public List getMenuList() { return menuMapper.selectList(); } @Override - public List getTenantMenus(MenuListReqVO reqVO) { - List menus = getMenus(reqVO); + public List getMenuListByTenant(MenuListReqVO reqVO) { + List menus = getMenuList(reqVO); // 开启多租户的情况下,需要过滤掉未开通的菜单 tenantService.handleTenantMenu(menuIds -> menus.removeIf(menu -> !CollUtil.contains(menuIds, menu.getId()))); return menus; } @Override - public List getMenus(MenuListReqVO reqVO) { + public List getMenuList(MenuListReqVO reqVO) { return menuMapper.selectList(reqVO); } @@ -223,23 +223,23 @@ public class MenuServiceImpl implements MenuService { * @param childId 当前菜单编号 */ @VisibleForTesting - public void checkParentResource(Long parentId, Long childId) { - if (parentId == null || MenuIdEnum.ROOT.getId().equals(parentId)) { + void validateParentMenu(Long parentId, Long childId) { + if (parentId == null || ID_ROOT.equals(parentId)) { return; } // 不能设置自己为父菜单 if (parentId.equals(childId)) { - throw ServiceExceptionUtil.exception(MENU_PARENT_ERROR); + throw exception(MENU_PARENT_ERROR); } MenuDO menu = menuMapper.selectById(parentId); // 父菜单不存在 if (menu == null) { - throw ServiceExceptionUtil.exception(MENU_PARENT_NOT_EXISTS); + throw exception(MENU_PARENT_NOT_EXISTS); } // 父菜单必须是目录或者菜单类型 if (!MenuTypeEnum.DIR.getType().equals(menu.getType()) && !MenuTypeEnum.MENU.getType().equals(menu.getType())) { - throw ServiceExceptionUtil.exception(MENU_PARENT_NOT_DIR_OR_MENU); + throw exception(MENU_PARENT_NOT_DIR_OR_MENU); } } @@ -253,17 +253,17 @@ public class MenuServiceImpl implements MenuService { * @param id 菜单编号 */ @VisibleForTesting - public void checkResource(Long parentId, String name, Long id) { + void validateMenu(Long parentId, String name, Long id) { MenuDO menu = menuMapper.selectByParentIdAndName(parentId, name); if (menu == null) { return; } // 如果 id 为空,说明不用比较是否为相同 id 的菜单 if (id == null) { - throw ServiceExceptionUtil.exception(MENU_NAME_DUPLICATE); + throw exception(MENU_NAME_DUPLICATE); } if (!menu.getId().equals(id)) { - throw ServiceExceptionUtil.exception(MENU_NAME_DUPLICATE); + throw exception(MENU_NAME_DUPLICATE); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceImpl.java index c40a8e31c..43365cf46 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceImpl.java @@ -158,7 +158,7 @@ public class PermissionServiceImpl implements PermissionService { } // 判断角色是否包含超级管理员。如果是超级管理员,获取到全部 - List roleList = roleService.getRolesFromCache(roleIds); + List roleList = roleService.getRoleListFromCache(roleIds); if (roleService.hasAnySuperAdmin(roleList)) { return menuService.getMenuListFromCache(menuTypes, menusStatuses); } @@ -190,7 +190,7 @@ public class PermissionServiceImpl implements PermissionService { public Set getRoleMenuIds(Long roleId) { // 如果是管理员的情况下,获取全部菜单编号 if (roleService.hasAnySuperAdmin(Collections.singleton(roleId))) { - return convertSet(menuService.getMenus(), MenuDO::getId); + return convertSet(menuService.getMenuList(), MenuDO::getId); } // 如果是非管理员的情况下,获得拥有的菜单编号 return convertSet(roleMenuMapper.selectListByRoleId(roleId), RoleMenuDO::getMenuId); @@ -371,7 +371,7 @@ public class PermissionServiceImpl implements PermissionService { if (roleService.hasAnySuperAdmin(roleIds)) { return true; } - Set userRoles = convertSet(roleService.getRolesFromCache(roleIds), + Set userRoles = convertSet(roleService.getRoleListFromCache(roleIds), RoleDO::getCode); return CollUtil.containsAny(userRoles, Sets.newHashSet(roles)); } @@ -388,7 +388,7 @@ public class PermissionServiceImpl implements PermissionService { result.setSelf(true); return result; } - List roles = roleService.getRolesFromCache(roleIds); + List roles = roleService.getRoleListFromCache(roleIds); // 获得用户的部门编号的缓存,通过 Guava 的 Suppliers 惰性求值,即有且仅有第一次发起 DB 的查询 Supplier userDeptIdCache = Suppliers.memoize(() -> userService.getUser(userId).getDeptId()); @@ -418,7 +418,7 @@ public class PermissionServiceImpl implements PermissionService { } // 情况四,DEPT_DEPT_AND_CHILD if (Objects.equals(role.getDataScope(), DataScopeEnum.DEPT_AND_CHILD.getScope())) { - List depts = deptService.getDeptsByParentIdFromCache(userDeptIdCache.get(), true); + List depts = deptService.getDeptListByParentIdFromCache(userDeptIdCache.get(), true); CollUtil.addAll(result.getDeptIds(), CollectionUtils.convertList(depts, DeptDO::getId)); // 添加本身部门编号 CollUtil.addAll(result.getDeptIds(), userDeptIdCache.get()); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/RoleService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/RoleService.java index a06095844..70acbdcb7 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/RoleService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/RoleService.java @@ -79,7 +79,7 @@ public interface RoleService { * @param statuses 筛选的状态。允许空,空时不筛选 * @return 角色列表 */ - List getRoles(@Nullable Collection statuses); + List getRoleListByStatus(@Nullable Collection statuses); /** * 获得角色数组,从缓存中 @@ -87,7 +87,7 @@ public interface RoleService { * @param ids 角色编号数组 * @return 角色数组 */ - List getRolesFromCache(Collection ids); + List getRoleListFromCache(Collection ids); /** * 判断角色数组中,是否有超级管理员 @@ -104,7 +104,7 @@ public interface RoleService { * @return 是否有管理员 */ default boolean hasAnySuperAdmin(Set ids) { - return hasAnySuperAdmin(getRolesFromCache(ids)); + return hasAnySuperAdmin(getRoleListFromCache(ids)); } /** @@ -138,6 +138,6 @@ public interface RoleService { * * @param ids 角色编号数组 */ - void validRoles(Collection ids); + void validateRoleList(Collection ids); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceImpl.java index 3f9ee1351..30ac2daa0 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceImpl.java @@ -5,7 +5,6 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils; import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleExportReqVO; @@ -34,6 +33,7 @@ import java.util.*; import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; /** @@ -76,7 +76,7 @@ public class RoleServiceImpl implements RoleService { log.info("[initLocalCache][缓存角色,数量为:{}]", roleList.size()); // 第二步:构建缓存 - roleCache = CollectionUtils.convertMap(roleList, RoleDO::getId); + roleCache = convertMap(roleList, RoleDO::getId); }); } @@ -84,7 +84,7 @@ public class RoleServiceImpl implements RoleService { @Transactional public Long createRole(RoleCreateReqVO reqVO, Integer type) { // 校验角色 - checkDuplicateRole(reqVO.getName(), reqVO.getCode(), null); + validateRoleDuplicate(reqVO.getName(), reqVO.getCode(), null); // 插入到数据库 RoleDO role = RoleConvert.INSTANCE.convert(reqVO); role.setType(ObjectUtil.defaultIfNull(type, RoleTypeEnum.CUSTOM.getType())); @@ -105,13 +105,13 @@ public class RoleServiceImpl implements RoleService { @Override public void updateRole(RoleUpdateReqVO reqVO) { // 校验是否可以更新 - checkUpdateRole(reqVO.getId()); + validateRoleForUpdate(reqVO.getId()); // 校验角色的唯一字段是否重复 - checkDuplicateRole(reqVO.getName(), reqVO.getCode(), reqVO.getId()); + validateRoleDuplicate(reqVO.getName(), reqVO.getCode(), reqVO.getId()); // 更新到数据库 - RoleDO updateObject = RoleConvert.INSTANCE.convert(reqVO); - roleMapper.updateById(updateObject); + RoleDO updateObj = RoleConvert.INSTANCE.convert(reqVO); + roleMapper.updateById(updateObj); // 发送刷新消息 roleProducer.sendRoleRefreshMessage(); } @@ -119,12 +119,11 @@ public class RoleServiceImpl implements RoleService { @Override public void updateRoleStatus(Long id, Integer status) { // 校验是否可以更新 - checkUpdateRole(id); + validateRoleForUpdate(id); + // 更新状态 - RoleDO updateObject = new RoleDO(); - updateObject.setId(id); - updateObject.setStatus(status); - roleMapper.updateById(updateObject); + RoleDO updateObj = new RoleDO().setId(id).setStatus(status); + roleMapper.updateById(updateObj); // 发送刷新消息 roleProducer.sendRoleRefreshMessage(); } @@ -132,7 +131,8 @@ public class RoleServiceImpl implements RoleService { @Override public void updateRoleDataScope(Long id, Integer dataScope, Set dataScopeDeptIds) { // 校验是否可以更新 - checkUpdateRole(id); + validateRoleForUpdate(id); + // 更新数据范围 RoleDO updateObject = new RoleDO(); updateObject.setId(id); @@ -147,7 +147,7 @@ public class RoleServiceImpl implements RoleService { @Transactional(rollbackFor = Exception.class) public void deleteRole(Long id) { // 校验是否可以更新 - this.checkUpdateRole(id); + validateRoleForUpdate(id); // 标记删除 roleMapper.deleteById(id); // 删除相关数据 @@ -169,7 +169,7 @@ public class RoleServiceImpl implements RoleService { } @Override - public List getRoles(@Nullable Collection statuses) { + public List getRoleListByStatus(@Nullable Collection statuses) { if (CollUtil.isEmpty(statuses)) { return roleMapper.selectList(); } @@ -177,7 +177,7 @@ public class RoleServiceImpl implements RoleService { } @Override - public List getRolesFromCache(Collection ids) { + public List getRoleListFromCache(Collection ids) { if (CollectionUtil.isEmpty(ids)) { return Collections.emptyList(); } @@ -219,7 +219,7 @@ public class RoleServiceImpl implements RoleService { * @param id 角色编号 */ @VisibleForTesting - public void checkDuplicateRole(String name, String code, Long id) { + void validateRoleDuplicate(String name, String code, Long id) { // 0. 超级管理员,不允许创建 if (RoleCodeEnum.isSuperAdmin(code)) { throw exception(ROLE_ADMIN_CODE_ERROR, code); @@ -246,7 +246,7 @@ public class RoleServiceImpl implements RoleService { * @param id 角色编号 */ @VisibleForTesting - public void checkUpdateRole(Long id) { + void validateRoleForUpdate(Long id) { RoleDO roleDO = roleMapper.selectById(id); if (roleDO == null) { throw exception(ROLE_NOT_EXISTS); @@ -258,13 +258,13 @@ public class RoleServiceImpl implements RoleService { } @Override - public void validRoles(Collection ids) { + public void validateRoleList(Collection ids) { if (CollUtil.isEmpty(ids)) { return; } // 获得角色信息 List roles = roleMapper.selectBatchIds(ids); - Map roleMap = CollectionUtils.convertMap(roles, RoleDO::getId); + Map roleMap = convertMap(roles, RoleDO::getId); // 校验 ids.forEach(id -> { RoleDO role = roleMap.get(id); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sensitiveword/SensitiveWordService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sensitiveword/SensitiveWordService.java index 29cd55e6e..a852ec9cf 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sensitiveword/SensitiveWordService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sensitiveword/SensitiveWordService.java @@ -81,7 +81,7 @@ public interface SensitiveWordService { * * @return 标签数组 */ - Set getSensitiveWordTags(); + Set getSensitiveWordTagSet(); /** * 获得文本所包含的不合法的敏感词数组 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sensitiveword/SensitiveWordServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sensitiveword/SensitiveWordServiceImpl.java index 53357753f..b82807855 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sensitiveword/SensitiveWordServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sensitiveword/SensitiveWordServiceImpl.java @@ -25,6 +25,7 @@ import javax.annotation.Resource; import java.util.*; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.filterList; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.SENSITIVE_WORD_EXISTS; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.SENSITIVE_WORD_NOT_EXISTS; @@ -85,7 +86,7 @@ public class SensitiveWordServiceImpl implements SensitiveWordService { private void initSensitiveWordTrie(List wordDOs) { // 过滤禁用的敏感词 - wordDOs = CollectionUtils.filterList(wordDOs, word -> word.getStatus().equals(CommonStatusEnum.ENABLE.getStatus())); + wordDOs = filterList(wordDOs, word -> word.getStatus().equals(CommonStatusEnum.ENABLE.getStatus())); // 初始化默认的 defaultSensitiveWordTrie this.defaultSensitiveWordTrie = new SimpleTrie(CollectionUtils.convertList(wordDOs, SensitiveWordDO::getName)); @@ -107,7 +108,8 @@ public class SensitiveWordServiceImpl implements SensitiveWordService { @Override public Long createSensitiveWord(SensitiveWordCreateReqVO createReqVO) { // 校验唯一性 - checkSensitiveWordNameUnique(null, createReqVO.getName()); + validateSensitiveWordNameUnique(null, createReqVO.getName()); + // 插入 SensitiveWordDO sensitiveWord = SensitiveWordConvert.INSTANCE.convert(createReqVO); sensitiveWordMapper.insert(sensitiveWord); @@ -119,8 +121,9 @@ public class SensitiveWordServiceImpl implements SensitiveWordService { @Override public void updateSensitiveWord(SensitiveWordUpdateReqVO updateReqVO) { // 校验唯一性 - checkSensitiveWordExists(updateReqVO.getId()); - checkSensitiveWordNameUnique(updateReqVO.getId(), updateReqVO.getName()); + validateSensitiveWordExists(updateReqVO.getId()); + validateSensitiveWordNameUnique(updateReqVO.getId(), updateReqVO.getName()); + // 更新 SensitiveWordDO updateObj = SensitiveWordConvert.INSTANCE.convert(updateReqVO); sensitiveWordMapper.updateById(updateObj); @@ -131,14 +134,14 @@ public class SensitiveWordServiceImpl implements SensitiveWordService { @Override public void deleteSensitiveWord(Long id) { // 校验存在 - checkSensitiveWordExists(id); + validateSensitiveWordExists(id); // 删除 sensitiveWordMapper.deleteById(id); // 发送消息,刷新缓存 sensitiveWordProducer.sendSensitiveWordRefreshMessage(); } - private void checkSensitiveWordNameUnique(Long id, String name) { + private void validateSensitiveWordNameUnique(Long id, String name) { SensitiveWordDO word = sensitiveWordMapper.selectByName(name); if (word == null) { return; @@ -152,7 +155,7 @@ public class SensitiveWordServiceImpl implements SensitiveWordService { } } - private void checkSensitiveWordExists(Long id) { + private void validateSensitiveWordExists(Long id) { if (sensitiveWordMapper.selectById(id) == null) { throw exception(SENSITIVE_WORD_NOT_EXISTS); } @@ -179,7 +182,7 @@ public class SensitiveWordServiceImpl implements SensitiveWordService { } @Override - public Set getSensitiveWordTags() { + public Set getSensitiveWordTagSet() { return sensitiveWordTagsCache; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelService.java index fb0b707d7..c0bb3f8cd 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelService.java @@ -1,13 +1,12 @@ package cn.iocoder.yudao.module.system.service.sms; -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelPageReqVO; import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelUpdateReqVO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; import javax.validation.Valid; -import java.util.Collection; import java.util.List; /** @@ -53,14 +52,6 @@ public interface SmsChannelService { */ SmsChannelDO getSmsChannel(Long id); - /** - * 获得短信渠道列表 - * - * @param ids 编号 - * @return 短信渠道列表 - */ - List getSmsChannelList(Collection ids); - /** * 获得所有短信渠道列表 * diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceImpl.java index d126fbf0f..d6f8aa004 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceImpl.java @@ -15,7 +15,6 @@ import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; import javax.annotation.Resource; -import java.util.Collection; import java.util.List; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; @@ -69,7 +68,7 @@ public class SmsChannelServiceImpl implements SmsChannelService { @Override public void updateSmsChannel(SmsChannelUpdateReqVO updateReqVO) { // 校验存在 - this.validateSmsChannelExists(updateReqVO.getId()); + validateSmsChannelExists(updateReqVO.getId()); // 更新 SmsChannelDO updateObj = SmsChannelConvert.INSTANCE.convert(updateReqVO); smsChannelMapper.updateById(updateObj); @@ -80,7 +79,7 @@ public class SmsChannelServiceImpl implements SmsChannelService { @Override public void deleteSmsChannel(Long id) { // 校验存在 - this.validateSmsChannelExists(id); + validateSmsChannelExists(id); // 校验是否有在使用该账号的模版 if (smsTemplateService.countByChannelId(id) > 0) { throw exception(SMS_CHANNEL_HAS_CHILDREN); @@ -102,11 +101,6 @@ public class SmsChannelServiceImpl implements SmsChannelService { return smsChannelMapper.selectById(id); } - @Override - public List getSmsChannelList(Collection ids) { - return smsChannelMapper.selectBatchIds(ids); - } - @Override public List getSmsChannelList() { return smsChannelMapper.selectList(); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsCodeService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsCodeService.java index f71b8a6bd..c310949b2 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsCodeService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsCodeService.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.module.system.service.sms; import cn.iocoder.yudao.framework.common.exception.ServiceException; -import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeCheckReqDTO; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeValidateReqDTO; import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeSendReqDTO; import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeUseReqDTO; @@ -35,6 +35,6 @@ public interface SmsCodeService { * * @param reqDTO 校验请求 */ - void checkSmsCode(@Valid SmsCodeCheckReqDTO reqDTO); + void validateSmsCode(@Valid SmsCodeValidateReqDTO reqDTO); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsCodeServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsCodeServiceImpl.java index 778445dd9..682b89eff 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsCodeServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsCodeServiceImpl.java @@ -3,11 +3,9 @@ package cn.iocoder.yudao.module.system.service.sms; import cn.hutool.core.date.LocalDateTimeUtil; import cn.hutool.core.lang.Assert; import cn.hutool.core.map.MapUtil; -import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; -import cn.iocoder.yudao.framework.common.util.date.DateUtils; -import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeCheckReqDTO; import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeSendReqDTO; import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeUseReqDTO; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeValidateReqDTO; import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsCodeDO; import cn.iocoder.yudao.module.system.dal.mysql.sms.SmsCodeMapper; import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum; @@ -16,11 +14,11 @@ import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; - import java.time.LocalDateTime; -import java.time.temporal.ChronoUnit; import static cn.hutool.core.util.RandomUtil.randomInt; +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.isToday; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; /** @@ -58,11 +56,11 @@ public class SmsCodeServiceImpl implements SmsCodeService { if (lastSmsCode != null) { if (LocalDateTimeUtil.between(lastSmsCode.getCreateTime(), LocalDateTime.now()).toMillis() < smsCodeProperties.getSendFrequency().toMillis()) { // 发送过于频繁 - throw ServiceExceptionUtil.exception(SMS_CODE_SEND_TOO_FAST); + throw exception(SMS_CODE_SEND_TOO_FAST); } - if (DateUtils.isToday(lastSmsCode.getCreateTime()) && // 必须是今天,才能计算超过当天的上限 + if (isToday(lastSmsCode.getCreateTime()) && // 必须是今天,才能计算超过当天的上限 lastSmsCode.getTodayIndex() >= smsCodeProperties.getSendMaximumQuantityPerDay()) { // 超过当天发送的上限。 - throw ServiceExceptionUtil.exception(SMS_CODE_EXCEED_SEND_MAXIMUM_QUANTITY_PER_DAY); + throw exception(SMS_CODE_EXCEED_SEND_MAXIMUM_QUANTITY_PER_DAY); } // TODO 芋艿:提升,每个 IP 每天可发送数量 // TODO 芋艿:提升,每个 IP 每小时可发送数量 @@ -71,7 +69,7 @@ public class SmsCodeServiceImpl implements SmsCodeService { // 创建验证码记录 String code = String.valueOf(randomInt(smsCodeProperties.getBeginCode(), smsCodeProperties.getEndCode() + 1)); SmsCodeDO newSmsCode = SmsCodeDO.builder().mobile(mobile).code(code).scene(scene) - .todayIndex(lastSmsCode != null && DateUtils.isToday(lastSmsCode.getCreateTime()) ? lastSmsCode.getTodayIndex() + 1 : 1) + .todayIndex(lastSmsCode != null && isToday(lastSmsCode.getCreateTime()) ? lastSmsCode.getTodayIndex() + 1 : 1) .createIp(ip).used(false).build(); smsCodeMapper.insert(newSmsCode); return code; @@ -80,32 +78,32 @@ public class SmsCodeServiceImpl implements SmsCodeService { @Override public void useSmsCode(SmsCodeUseReqDTO reqDTO) { // 检测验证码是否有效 - SmsCodeDO lastSmsCode = this.checkSmsCode0(reqDTO.getMobile(), reqDTO.getCode(), reqDTO.getScene()); + SmsCodeDO lastSmsCode = validateSmsCode0(reqDTO.getMobile(), reqDTO.getCode(), reqDTO.getScene()); // 使用验证码 smsCodeMapper.updateById(SmsCodeDO.builder().id(lastSmsCode.getId()) .used(true).usedTime(LocalDateTime.now()).usedIp(reqDTO.getUsedIp()).build()); } @Override - public void checkSmsCode(SmsCodeCheckReqDTO reqDTO) { - checkSmsCode0(reqDTO.getMobile(), reqDTO.getCode(), reqDTO.getScene()); + public void validateSmsCode(SmsCodeValidateReqDTO reqDTO) { + validateSmsCode0(reqDTO.getMobile(), reqDTO.getCode(), reqDTO.getScene()); } - public SmsCodeDO checkSmsCode0(String mobile, String code, Integer scene) { + private SmsCodeDO validateSmsCode0(String mobile, String code, Integer scene) { // 校验验证码 SmsCodeDO lastSmsCode = smsCodeMapper.selectLastByMobile(mobile, code, scene); // 若验证码不存在,抛出异常 if (lastSmsCode == null) { - throw ServiceExceptionUtil.exception(SMS_CODE_NOT_FOUND); + throw exception(SMS_CODE_NOT_FOUND); } // 超过时间 if (LocalDateTimeUtil.between(lastSmsCode.getCreateTime(), LocalDateTime.now()).toMillis() >= smsCodeProperties.getExpireTimes().toMillis()) { // 验证码已过期 - throw ServiceExceptionUtil.exception(SMS_CODE_EXPIRED); + throw exception(SMS_CODE_EXPIRED); } // 判断验证码是否已被使用 if (Boolean.TRUE.equals(lastSmsCode.getUsed())) { - throw ServiceExceptionUtil.exception(SMS_CODE_USED); + throw exception(SMS_CODE_USED); } return lastSmsCode; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceImpl.java index 85fee7ff4..af4aa32fc 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceImpl.java @@ -66,7 +66,7 @@ public class SmsSendServiceImpl implements SmsSendService { } } // 执行发送 - return this.sendSingleSms(mobile, userId, UserTypeEnum.ADMIN.getValue(), templateCode, templateParams); + return sendSingleSms(mobile, userId, UserTypeEnum.ADMIN.getValue(), templateCode, templateParams); } @Override @@ -76,21 +76,21 @@ public class SmsSendServiceImpl implements SmsSendService { mobile = memberService.getMemberUserMobile(userId); } // 执行发送 - return this.sendSingleSms(mobile, userId, UserTypeEnum.MEMBER.getValue(), templateCode, templateParams); + return sendSingleSms(mobile, userId, UserTypeEnum.MEMBER.getValue(), templateCode, templateParams); } @Override public Long sendSingleSms(String mobile, Long userId, Integer userType, String templateCode, Map templateParams) { // 校验短信模板是否合法 - SmsTemplateDO template = this.checkSmsTemplateValid(templateCode); + SmsTemplateDO template = validateSmsTemplate(templateCode); // 校验短信渠道是否合法 - SmsChannelDO smsChannel = this.checkSmsChannelValid(template.getChannelId()); + SmsChannelDO smsChannel = validateSmsChannel(template.getChannelId()); // 校验手机号码是否存在 - mobile = this.checkMobile(mobile); + mobile = validateMobile(mobile); // 构建有序的模板参数。为什么放在这个位置,是提前保证模板参数的正确性,而不是到了插入发送日志 - List> newTemplateParams = this.buildTemplateParams(template, templateParams); + List> newTemplateParams = buildTemplateParams(template, templateParams); // 创建发送日志。如果模板被禁用,则不发送短信,只记录日志 Boolean isSend = CommonStatusEnum.ENABLE.getStatus().equals(template.getStatus()) @@ -108,7 +108,7 @@ public class SmsSendServiceImpl implements SmsSendService { } @VisibleForTesting - public SmsChannelDO checkSmsChannelValid(Long channelId) { + SmsChannelDO validateSmsChannel(Long channelId) { // 获得短信模板。考虑到效率,从缓存中获取 SmsChannelDO channelDO = smsChannelService.getSmsChannel(channelId); // 短信模板不存在 @@ -119,7 +119,7 @@ public class SmsSendServiceImpl implements SmsSendService { } @VisibleForTesting - public SmsTemplateDO checkSmsTemplateValid(String templateCode) { + SmsTemplateDO validateSmsTemplate(String templateCode) { // 获得短信模板。考虑到效率,从缓存中获取 SmsTemplateDO template = smsTemplateService.getSmsTemplateByCodeFromCache(templateCode); // 短信模板不存在 @@ -139,7 +139,7 @@ public class SmsSendServiceImpl implements SmsSendService { * @return 处理后的参数 */ @VisibleForTesting - public List> buildTemplateParams(SmsTemplateDO template, Map templateParams) { + List> buildTemplateParams(SmsTemplateDO template, Map templateParams) { return template.getParams().stream().map(key -> { Object value = templateParams.get(key); if (value == null) { @@ -150,7 +150,7 @@ public class SmsSendServiceImpl implements SmsSendService { } @VisibleForTesting - public String checkMobile(String mobile) { + public String validateMobile(String mobile) { if (StrUtil.isEmpty(mobile)) { throw exception(SMS_SEND_MOBILE_NOT_EXISTS); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceImpl.java index 031edb7cc..20c4ec3f3 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceImpl.java @@ -105,11 +105,11 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { @Override public Long createSmsTemplate(SmsTemplateCreateReqVO createReqVO) { // 校验短信渠道 - SmsChannelDO channelDO = checkSmsChannel(createReqVO.getChannelId()); + SmsChannelDO channelDO = validateSmsChannel(createReqVO.getChannelId()); // 校验短信编码是否重复 - checkSmsTemplateCodeDuplicate(null, createReqVO.getCode()); + validateSmsTemplateCodeDuplicate(null, createReqVO.getCode()); // 校验短信模板 - checkApiTemplate(createReqVO.getChannelId(), createReqVO.getApiTemplateId()); + validateApiTemplate(createReqVO.getChannelId(), createReqVO.getApiTemplateId()); // 插入 SmsTemplateDO template = SmsTemplateConvert.INSTANCE.convert(createReqVO); @@ -125,13 +125,13 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { @Override public void updateSmsTemplate(SmsTemplateUpdateReqVO updateReqVO) { // 校验存在 - this.validateSmsTemplateExists(updateReqVO.getId()); + validateSmsTemplateExists(updateReqVO.getId()); // 校验短信渠道 - SmsChannelDO channelDO = checkSmsChannel(updateReqVO.getChannelId()); + SmsChannelDO channelDO = validateSmsChannel(updateReqVO.getChannelId()); // 校验短信编码是否重复 - checkSmsTemplateCodeDuplicate(updateReqVO.getId(), updateReqVO.getCode()); + validateSmsTemplateCodeDuplicate(updateReqVO.getId(), updateReqVO.getCode()); // 校验短信模板 - checkApiTemplate(updateReqVO.getChannelId(), updateReqVO.getApiTemplateId()); + validateApiTemplate(updateReqVO.getChannelId(), updateReqVO.getApiTemplateId()); // 更新 SmsTemplateDO updateObj = SmsTemplateConvert.INSTANCE.convert(updateReqVO); @@ -145,7 +145,7 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { @Override public void deleteSmsTemplate(Long id) { // 校验存在 - this.validateSmsTemplateExists(id); + validateSmsTemplateExists(id); // 更新 smsTemplateMapper.deleteById(id); // 发送刷新消息 @@ -184,7 +184,7 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { } @VisibleForTesting - public SmsChannelDO checkSmsChannel(Long channelId) { + public SmsChannelDO validateSmsChannel(Long channelId) { SmsChannelDO channelDO = smsChannelService.getSmsChannel(channelId); if (channelDO == null) { throw exception(SMS_CHANNEL_NOT_EXISTS); @@ -196,7 +196,7 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { } @VisibleForTesting - public void checkSmsTemplateCodeDuplicate(Long id, String code) { + public void validateSmsTemplateCodeDuplicate(Long id, String code) { SmsTemplateDO template = smsTemplateMapper.selectByCode(code); if (template == null) { return; @@ -217,7 +217,7 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { * @param apiTemplateId API 模板编号 */ @VisibleForTesting - public void checkApiTemplate(Long channelId, String apiTemplateId) { + public void validateApiTemplate(Long channelId, String apiTemplateId) { // 获得短信模板 SmsClient smsClient = smsClientFactory.getSmsClient(channelId); Assert.notNull(smsClient, String.format("短信客户端(%d) 不存在", channelId)); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantPackageServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantPackageServiceImpl.java index 2528cb905..4e6e60198 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantPackageServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantPackageServiceImpl.java @@ -64,9 +64,9 @@ public class TenantPackageServiceImpl implements TenantPackageService { @Override public void deleteTenantPackage(Long id) { // 校验存在 - this.validateTenantPackageExists(id); + validateTenantPackageExists(id); // 校验正在使用 - this.validateTenantUsed(id); + validateTenantUsed(id); // 删除 tenantPackageMapper.deleteById(id); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantService.java index d9d55e9f4..3dacfefe7 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantService.java @@ -120,7 +120,7 @@ public interface TenantService { * * @return 租户编号数组 */ - List getTenantIds(); + List getTenantIdList(); /** * 校验租户是否合法 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java index dc4a67ef0..3a70d31b9 100755 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java @@ -75,7 +75,7 @@ public class TenantServiceImpl implements TenantService { private PermissionService permissionService; @Override - public List getTenantIds() { + public List getTenantIdList() { List tenants = tenantMapper.selectList(); return CollectionUtils.convertList(tenants, TenantDO::getId); } @@ -138,7 +138,7 @@ public class TenantServiceImpl implements TenantService { @Transactional(rollbackFor = Exception.class) public void updateTenant(TenantUpdateReqVO updateReqVO) { // 校验存在 - TenantDO tenant = checkUpdateTenant(updateReqVO.getId()); + TenantDO tenant = validateUpdateTenant(updateReqVO.getId()); // 校验套餐被禁用 TenantPackageDO tenantPackage = tenantPackageService.validTenantPackage(updateReqVO.getPackageId()); @@ -156,7 +156,7 @@ public class TenantServiceImpl implements TenantService { public void updateTenantRoleMenu(Long tenantId, Set menuIds) { TenantUtils.execute(tenantId, () -> { // 获得所有角色 - List roles = roleService.getRoles(null); + List roles = roleService.getRoleListByStatus(null); roles.forEach(role -> Assert.isTrue(tenantId.equals(role.getTenantId()), "角色({}/{}) 租户不匹配", role.getId(), role.getTenantId(), tenantId)); // 兜底校验 // 重新分配每个角色的权限 @@ -179,12 +179,12 @@ public class TenantServiceImpl implements TenantService { @Override public void deleteTenant(Long id) { // 校验存在 - checkUpdateTenant(id); + validateUpdateTenant(id); // 删除 tenantMapper.deleteById(id); } - private TenantDO checkUpdateTenant(Long id) { + private TenantDO validateUpdateTenant(Long id) { TenantDO tenant = tenantMapper.selectById(id); if (tenant == null) { throw exception(TENANT_NOT_EXISTS); @@ -248,7 +248,7 @@ public class TenantServiceImpl implements TenantService { TenantDO tenant = getTenant(TenantContextHolder.getRequiredTenantId()); Set menuIds; if (isSystemTenant(tenant)) { // 系统租户,菜单是全量的 - menuIds = CollectionUtils.convertSet(menuService.getMenus(), MenuDO::getId); + menuIds = CollectionUtils.convertSet(menuService.getMenuList(), MenuDO::getId); } else { menuIds = tenantPackageService.getTenantPackage(tenant.getPackageId()).getMenuIds(); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java index ae3245de2..e10b9e997 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java @@ -127,7 +127,7 @@ public interface AdminUserService { * @param deptIds 部门数组 * @return 用户数组 */ - List getUsersByDeptIds(Collection deptIds); + List getUserListByDeptIds(Collection deptIds); /** * 获得指定岗位的用户数组 @@ -135,7 +135,7 @@ public interface AdminUserService { * @param postIds 岗位数组 * @return 用户数组 */ - List getUsersByPostIds(Collection postIds); + List getUserListByPostIds(Collection postIds); /** * 获得用户列表 @@ -143,7 +143,7 @@ public interface AdminUserService { * @param ids 用户编号数组 * @return 用户列表 */ - List getUsers(Collection ids); + List getUserList(Collection ids); /** * 校验用户们是否有效。如下情况,视为无效: @@ -152,7 +152,7 @@ public interface AdminUserService { * * @param ids 用户编号数组 */ - void validUsers(Set ids); + void validateUserList(Collection ids); /** * 获得用户 Map @@ -164,7 +164,7 @@ public interface AdminUserService { if (CollUtil.isEmpty(ids)) { return new HashMap<>(); } - return CollectionUtils.convertMap(getUsers(ids), AdminUserDO::getId); + return CollectionUtils.convertMap(getUserList(ids), AdminUserDO::getId); } /** @@ -173,7 +173,7 @@ public interface AdminUserService { * @param reqVO 列表请求 * @return 用户列表 */ - List getUsers(UserExportReqVO reqVO); + List getUserList(UserExportReqVO reqVO); /** * 获得用户列表,基于昵称模糊匹配 @@ -181,15 +181,7 @@ public interface AdminUserService { * @param nickname 昵称 * @return 用户列表 */ - List getUsersByNickname(String nickname); - - /** - * 获得用户列表,基于用户账号模糊匹配 - * - * @param username 用户账号 - * @return 用户列表 - */ - List getUsersByUsername(String username); + List getUserListByNickname(String nickname); /** * 批量导入用户 @@ -198,7 +190,7 @@ public interface AdminUserService { * @param isUpdateSupport 是否支持更新 * @return 导入结果 */ - UserImportRespVO importUsers(List importUsers, boolean isUpdateSupport); + UserImportRespVO importUserList(List importUsers, boolean isUpdateSupport); /** * 获得指定状态的用户们 @@ -206,7 +198,7 @@ public interface AdminUserService { * @param status 状态 * @return 用户们 */ - List getUsersByStatus(Integer status); + List getUserListByStatus(Integer status); /** * 判断密码是否匹配 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java index 1bb180011..bb43a89c2 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java @@ -8,7 +8,7 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.exception.ServiceException; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; -import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission; +import cn.iocoder.yudao.framework.datapermission.core.util.DataPermissionUtils; import cn.iocoder.yudao.module.infra.api.file.FileApi; import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO; import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO; @@ -43,6 +43,7 @@ import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; /** * 后台用户 Service 实现类 + * * @author 芋道源码 */ @Service("adminUserService") @@ -73,10 +74,6 @@ public class AdminUserServiceImpl implements AdminUserService { @Resource private FileApi fileApi; - @Resource - @Lazy // 循环依赖(自己依赖自己),避免报错 - private AdminUserServiceImpl self; - @Override @Transactional(rollbackFor = Exception.class) public Long createUser(UserCreateReqVO reqVO) { @@ -88,7 +85,7 @@ public class AdminUserServiceImpl implements AdminUserService { } }); // 校验正确性 - self.checkCreateOrUpdate(null, reqVO.getUsername(), reqVO.getMobile(), reqVO.getEmail(), + validateUserForCreateOrUpdate(null, reqVO.getUsername(), reqVO.getMobile(), reqVO.getEmail(), reqVO.getDeptId(), reqVO.getPostIds()); // 插入用户 AdminUserDO user = UserConvert.INSTANCE.convert(reqVO); @@ -107,7 +104,7 @@ public class AdminUserServiceImpl implements AdminUserService { @Transactional(rollbackFor = Exception.class) public void updateUser(UserUpdateReqVO reqVO) { // 校验正确性 - self.checkCreateOrUpdate(reqVO.getId(), reqVO.getUsername(), reqVO.getMobile(), reqVO.getEmail(), + validateUserForCreateOrUpdate(reqVO.getId(), reqVO.getUsername(), reqVO.getMobile(), reqVO.getEmail(), reqVO.getDeptId(), reqVO.getPostIds()); // 更新用户 AdminUserDO updateObj = UserConvert.INSTANCE.convert(reqVO); @@ -141,9 +138,9 @@ public class AdminUserServiceImpl implements AdminUserService { @Override public void updateUserProfile(Long id, UserProfileUpdateReqVO reqVO) { // 校验正确性 - checkUserExists(id); - checkEmailUnique(id, reqVO.getEmail()); - checkMobileUnique(id, reqVO.getMobile()); + validateUserExists(id); + validateEmailUnique(id, reqVO.getEmail()); + validateMobileUnique(id, reqVO.getMobile()); // 执行更新 userMapper.updateById(UserConvert.INSTANCE.convert(reqVO).setId(id)); } @@ -151,7 +148,7 @@ public class AdminUserServiceImpl implements AdminUserService { @Override public void updateUserPassword(Long id, UserProfileUpdatePasswordReqVO reqVO) { // 校验旧密码密码 - checkOldPassword(id, reqVO.getOldPassword()); + validateOldPassword(id, reqVO.getOldPassword()); // 执行更新 AdminUserDO updateObj = new AdminUserDO().setId(id); updateObj.setPassword(encodePassword(reqVO.getNewPassword())); // 加密密码 @@ -160,7 +157,7 @@ public class AdminUserServiceImpl implements AdminUserService { @Override public String updateUserAvatar(Long id, InputStream avatarFile) throws Exception { - checkUserExists(id); + validateUserExists(id); // 存储文件 String avatar = fileApi.createFile(IoUtil.readBytes(avatarFile)); // 更新路径 @@ -174,7 +171,7 @@ public class AdminUserServiceImpl implements AdminUserService { @Override public void updateUserPassword(Long id, String password) { // 校验用户存在 - checkUserExists(id); + validateUserExists(id); // 更新密码 AdminUserDO updateObj = new AdminUserDO(); updateObj.setId(id); @@ -185,7 +182,7 @@ public class AdminUserServiceImpl implements AdminUserService { @Override public void updateUserStatus(Long id, Integer status) { // 校验用户存在 - checkUserExists(id); + validateUserExists(id); // 更新状态 AdminUserDO updateObj = new AdminUserDO(); updateObj.setId(id); @@ -197,7 +194,7 @@ public class AdminUserServiceImpl implements AdminUserService { @Transactional(rollbackFor = Exception.class) public void deleteUser(Long id) { // 校验用户存在 - checkUserExists(id); + validateUserExists(id); // 删除用户 userMapper.deleteById(id); // 删除用户关联数据 @@ -227,7 +224,7 @@ public class AdminUserServiceImpl implements AdminUserService { } @Override - public List getUsersByDeptIds(Collection deptIds) { + public List getUserListByDeptIds(Collection deptIds) { if (CollUtil.isEmpty(deptIds)) { return Collections.emptyList(); } @@ -235,7 +232,7 @@ public class AdminUserServiceImpl implements AdminUserService { } @Override - public List getUsersByPostIds(Collection postIds) { + public List getUserListByPostIds(Collection postIds) { if (CollUtil.isEmpty(postIds)) { return Collections.emptyList(); } @@ -247,7 +244,7 @@ public class AdminUserServiceImpl implements AdminUserService { } @Override - public List getUsers(Collection ids) { + public List getUserList(Collection ids) { if (CollUtil.isEmpty(ids)) { return Collections.emptyList(); } @@ -255,7 +252,7 @@ public class AdminUserServiceImpl implements AdminUserService { } @Override - public void validUsers(Set ids) { + public void validateUserList(Collection ids) { if (CollUtil.isEmpty(ids)) { return; } @@ -275,20 +272,15 @@ public class AdminUserServiceImpl implements AdminUserService { } @Override - public List getUsers(UserExportReqVO reqVO) { + public List getUserList(UserExportReqVO reqVO) { return userMapper.selectList(reqVO, getDeptCondition(reqVO.getDeptId())); } @Override - public List getUsersByNickname(String nickname) { + public List getUserListByNickname(String nickname) { return userMapper.selectListByNickname(nickname); } - @Override - public List getUsersByUsername(String username) { - return userMapper.selectListByUsername(username); - } - /** * 获得部门条件:查询指定部门的子部门编号们,包括自身 * @param deptId 部门编号 @@ -298,31 +290,33 @@ public class AdminUserServiceImpl implements AdminUserService { if (deptId == null) { return Collections.emptySet(); } - Set deptIds = convertSet(deptService.getDeptsByParentIdFromCache( + Set deptIds = convertSet(deptService.getDeptListByParentIdFromCache( deptId, true), DeptDO::getId); deptIds.add(deptId); // 包括自身 return deptIds; } - @DataPermission(enable = false) // 关闭数据权限,避免因为没有数据权限,查询不到数据,进而导致唯一校验不正确 - public void checkCreateOrUpdate(Long id, String username, String mobile, String email, - Long deptId, Set postIds) { - // 校验用户存在 - checkUserExists(id); - // 校验用户名唯一 - checkUsernameUnique(id, username); - // 校验手机号唯一 - checkMobileUnique(id, mobile); - // 校验邮箱唯一 - checkEmailUnique(id, email); - // 校验部门处于开启状态 - deptService.validDepts(CollectionUtils.singleton(deptId)); - // 校验岗位处于开启状态 - postService.validPosts(postIds); + private void validateUserForCreateOrUpdate(Long id, String username, String mobile, String email, + Long deptId, Set postIds) { + // 关闭数据权限,避免因为没有数据权限,查询不到数据,进而导致唯一校验不正确 + DataPermissionUtils.executeIgnore(() -> { + // 校验用户存在 + validateUserExists(id); + // 校验用户名唯一 + validateUsernameUnique(id, username); + // 校验手机号唯一 + validateMobileUnique(id, mobile); + // 校验邮箱唯一 + validateEmailUnique(id, email); + // 校验部门处于开启状态 + deptService.validateDeptList(CollectionUtils.singleton(deptId)); + // 校验岗位处于开启状态 + postService.validatePostList(postIds); + }); } @VisibleForTesting - public void checkUserExists(Long id) { + void validateUserExists(Long id) { if (id == null) { return; } @@ -333,7 +327,7 @@ public class AdminUserServiceImpl implements AdminUserService { } @VisibleForTesting - public void checkUsernameUnique(Long id, String username) { + void validateUsernameUnique(Long id, String username) { if (StrUtil.isBlank(username)) { return; } @@ -351,7 +345,7 @@ public class AdminUserServiceImpl implements AdminUserService { } @VisibleForTesting - public void checkEmailUnique(Long id, String email) { + void validateEmailUnique(Long id, String email) { if (StrUtil.isBlank(email)) { return; } @@ -369,7 +363,7 @@ public class AdminUserServiceImpl implements AdminUserService { } @VisibleForTesting - public void checkMobileUnique(Long id, String mobile) { + void validateMobileUnique(Long id, String mobile) { if (StrUtil.isBlank(mobile)) { return; } @@ -392,7 +386,7 @@ public class AdminUserServiceImpl implements AdminUserService { * @param oldPassword 旧密码 */ @VisibleForTesting - public void checkOldPassword(Long id, String oldPassword) { + void validateOldPassword(Long id, String oldPassword) { AdminUserDO user = userMapper.selectById(id); if (user == null) { throw exception(USER_NOT_EXISTS); @@ -404,7 +398,7 @@ public class AdminUserServiceImpl implements AdminUserService { @Override @Transactional(rollbackFor = Exception.class) // 添加事务,异常则回滚所有导入 - public UserImportRespVO importUsers(List importUsers, boolean isUpdateSupport) { + public UserImportRespVO importUserList(List importUsers, boolean isUpdateSupport) { if (CollUtil.isEmpty(importUsers)) { throw exception(USER_IMPORT_LIST_IS_EMPTY); } @@ -413,7 +407,7 @@ public class AdminUserServiceImpl implements AdminUserService { importUsers.forEach(importUser -> { // 校验,判断是否有不符合的原因 try { - checkCreateOrUpdate(null, null, importUser.getMobile(), importUser.getEmail(), + validateUserForCreateOrUpdate(null, null, importUser.getMobile(), importUser.getEmail(), importUser.getDeptId(), null); } catch (ServiceException ex) { respVO.getFailureUsernames().put(importUser.getUsername(), ex.getMessage()); @@ -441,7 +435,7 @@ public class AdminUserServiceImpl implements AdminUserService { } @Override - public List getUsersByStatus(Integer status) { + public List getUserListByStatus(Integer status) { return userMapper.selectListByStatus(status); } diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImplTest.java index dc607b7ce..16e48ec4a 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImplTest.java @@ -1,31 +1,43 @@ package cn.iocoder.yudao.module.system.service.auth; +import cn.hutool.core.util.ReflectUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; -import cn.iocoder.yudao.framework.test.core.util.AssertUtils; import cn.iocoder.yudao.module.system.api.sms.SmsCodeApi; +import cn.iocoder.yudao.module.system.api.social.dto.SocialUserBindReqDTO; +import cn.iocoder.yudao.module.system.controller.admin.auth.vo.*; import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.enums.logger.LoginLogTypeEnum; import cn.iocoder.yudao.module.system.enums.logger.LoginResultEnum; +import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum; +import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum; import cn.iocoder.yudao.module.system.service.logger.LoginLogService; import cn.iocoder.yudao.module.system.service.member.MemberService; import cn.iocoder.yudao.module.system.service.oauth2.OAuth2TokenService; import cn.iocoder.yudao.module.system.service.social.SocialUserService; import cn.iocoder.yudao.module.system.service.user.AdminUserService; +import com.xingyuv.captcha.model.common.ResponseModel; import com.xingyuv.captcha.service.CaptchaService; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import javax.annotation.Resource; +import javax.validation.ConstraintViolationException; +import javax.validation.Validation; import javax.validation.Validator; +import static cn.hutool.core.util.RandomUtil.randomEle; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomString; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; @@ -42,17 +54,24 @@ public class AdminAuthServiceImplTest extends BaseDbUnitTest { @MockBean private LoginLogService loginLogService; @MockBean - private SocialUserService socialService; + private SocialUserService socialUserService; @MockBean private SmsCodeApi smsCodeApi; @MockBean private OAuth2TokenService oauth2TokenService; @MockBean private MemberService memberService; - @MockBean private Validator validator; + @BeforeEach + public void setUp() { + ReflectUtil.setFieldValue(authService, "captchaEnable", true); + // 注入一个 Validator 对象 + ReflectUtil.setFieldValue(authService, "validator", + Validation.buildDefaultValidatorFactory().getValidator()); + } + @Test public void testAuthenticate_success() { // 准备参数 @@ -78,7 +97,7 @@ public class AdminAuthServiceImplTest extends BaseDbUnitTest { String password = randomString(); // 调用, 并断言异常 - AssertUtils.assertServiceException(() -> authService.authenticate(username, password), + assertServiceException(() -> authService.authenticate(username, password), AUTH_LOGIN_BAD_CREDENTIALS); verify(loginLogService).createLoginLog( argThat(o -> o.getLogType().equals(LoginLogTypeEnum.LOGIN_USERNAME.getType()) @@ -98,7 +117,7 @@ public class AdminAuthServiceImplTest extends BaseDbUnitTest { when(userService.getUserByUsername(eq(username))).thenReturn(user); // 调用, 并断言异常 - AssertUtils.assertServiceException(() -> authService.authenticate(username, password), + assertServiceException(() -> authService.authenticate(username, password), AUTH_LOGIN_BAD_CREDENTIALS); verify(loginLogService).createLoginLog( argThat(o -> o.getLogType().equals(LoginLogTypeEnum.LOGIN_USERNAME.getType()) @@ -120,7 +139,7 @@ public class AdminAuthServiceImplTest extends BaseDbUnitTest { when(userService.isPasswordMatch(eq(password), eq(user.getPassword()))).thenReturn(true); // 调用, 并断言异常 - AssertUtils.assertServiceException(() -> authService.authenticate(username, password), + assertServiceException(() -> authService.authenticate(username, password), AUTH_LOGIN_USER_DISABLED); verify(loginLogService).createLoginLog( argThat(o -> o.getLogType().equals(LoginLogTypeEnum.LOGIN_USERNAME.getType()) @@ -129,82 +148,194 @@ public class AdminAuthServiceImplTest extends BaseDbUnitTest { ); } -// @Test -// public void testCaptcha_success() { -// // 准备参数 -// AuthLoginReqVO reqVO = randomPojo(AuthLoginReqVO.class); -// -// // mock 验证码正确 -// when(captchaService.getCaptchaCode(reqVO.getUuid())).thenReturn(reqVO.getCode()); -// -// // 调用 -// authService.verifyCaptcha(reqVO); -// // 断言 -// verify(captchaService).deleteCaptchaCode(reqVO.getUuid()); -// } -// -// @Test -// public void testCaptcha_notFound() { -// // 准备参数 -// AuthLoginReqVO reqVO = randomPojo(AuthLoginReqVO.class); -// -// // 调用, 并断言异常 -// assertServiceException(() -> authService.verifyCaptcha(reqVO), AUTH_LOGIN_CAPTCHA_NOT_FOUND); -// // 校验调用参数 -// verify(loginLogService, times(1)).createLoginLog( -// argThat(o -> o.getLogType().equals(LoginLogTypeEnum.LOGIN_USERNAME.getType()) -// && o.getResult().equals(LoginResultEnum.CAPTCHA_NOT_FOUND.getResult())) -// ); -// } + @Test + public void testLogin_success() { + // 准备参数 + AuthLoginReqVO reqVO = randomPojo(AuthLoginReqVO.class, o -> + o.setUsername("test_username").setPassword("test_password") + .setSocialType(randomEle(SocialTypeEnum.values()).getType())); -// @Test -// public void testCaptcha_codeError() { -// // 准备参数 -// AuthLoginReqVO reqVO = randomPojo(AuthLoginReqVO.class); -// -// // mock 验证码不正确 -// String code = randomString(); -// when(captchaService.getCaptchaCode(reqVO.getUuid())).thenReturn(code); -// -// // 调用, 并断言异常 -// assertServiceException(() -> authService.verifyCaptcha(reqVO), AUTH_LOGIN_CAPTCHA_CODE_ERROR); -// // 校验调用参数 -// verify(loginLogService).createLoginLog( -// argThat(o -> o.getLogType().equals(LoginLogTypeEnum.LOGIN_USERNAME.getType()) -// && o.getResult().equals(LoginResultEnum.CAPTCHA_CODE_ERROR.getResult())) -// ); -// } + // mock 验证码正确 + ReflectUtil.setFieldValue(authService, "captchaEnable", false); + // mock user 数据 + AdminUserDO user = randomPojo(AdminUserDO.class, o -> o.setId(1L).setUsername("test_username") + .setPassword("test_password").setStatus(CommonStatusEnum.ENABLE.getStatus())); + when(userService.getUserByUsername(eq("test_username"))).thenReturn(user); + // mock password 匹配 + when(userService.isPasswordMatch(eq("test_password"), eq(user.getPassword()))).thenReturn(true); + // mock 缓存登录用户到 Redis + OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class, o -> o.setUserId(1L) + .setUserType(UserTypeEnum.ADMIN.getValue())); + when(oauth2TokenService.createAccessToken(eq(1L), eq(UserTypeEnum.ADMIN.getValue()), eq("default"), isNull())) + .thenReturn(accessTokenDO); -// @Test -// public void testLogin_success() { -// // 准备参数 -// AuthLoginReqVO reqVO = randomPojo(AuthLoginReqVO.class, o -> -// o.setUsername("test_username").setPassword("test_password")); -// -// // mock 验证码正确 -// when(captchaService.getCaptchaCode(reqVO.getUuid())).thenReturn(reqVO.getCode()); -// // mock user 数据 -// AdminUserDO user = randomPojo(AdminUserDO.class, o -> o.setId(1L).setUsername("test_username") -// .setPassword("test_password").setStatus(CommonStatusEnum.ENABLE.getStatus())); -// when(userService.getUserByUsername(eq("test_username"))).thenReturn(user); -// // mock password 匹配 -// when(userService.isPasswordMatch(eq("test_password"), eq(user.getPassword()))).thenReturn(true); -// // mock 缓存登录用户到 Redis -// OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class, o -> o.setUserId(1L) -// .setUserType(UserTypeEnum.ADMIN.getValue())); -// when(oauth2TokenService.createAccessToken(eq(1L), eq(UserTypeEnum.ADMIN.getValue()), eq("default"), isNull())) -// .thenReturn(accessTokenDO); -// -// // 调用, 并断言异常 -// AuthLoginRespVO loginRespVO = authService.login(reqVO); -// assertPojoEquals(accessTokenDO, loginRespVO); -// // 校验调用参数 -// verify(loginLogService).createLoginLog( -// argThat(o -> o.getLogType().equals(LoginLogTypeEnum.LOGIN_USERNAME.getType()) -// && o.getResult().equals(LoginResultEnum.SUCCESS.getResult()) -// && o.getUserId().equals(user.getId())) -// ); -// } + // 调用,并校验 + AuthLoginRespVO loginRespVO = authService.login(reqVO); + assertPojoEquals(accessTokenDO, loginRespVO); + // 校验调用参数 + verify(loginLogService).createLoginLog( + argThat(o -> o.getLogType().equals(LoginLogTypeEnum.LOGIN_USERNAME.getType()) + && o.getResult().equals(LoginResultEnum.SUCCESS.getResult()) + && o.getUserId().equals(user.getId())) + ); + verify(socialUserService).bindSocialUser(eq(new SocialUserBindReqDTO( + user.getId(), UserTypeEnum.ADMIN.getValue(), + reqVO.getSocialType(), reqVO.getSocialCode(), reqVO.getSocialState()))); + } + + @Test + public void testSendSmsCode() { + // 准备参数 + String mobile = randomString(); + Integer scene = randomEle(SmsSceneEnum.values()).getScene(); + AuthSmsSendReqVO reqVO = new AuthSmsSendReqVO(mobile, scene); + // mock 方法(用户信息) + AdminUserDO user = randomPojo(AdminUserDO.class); + when(userService.getUserByMobile(eq(mobile))).thenReturn(user); + + // 调用 + authService.sendSmsCode(reqVO); + // 断言 + verify(smsCodeApi).sendSmsCode(argThat(sendReqDTO -> { + assertEquals(mobile, sendReqDTO.getMobile()); + assertEquals(scene, sendReqDTO.getScene()); + return true; + })); + } + + @Test + public void testSmsLogin_success() { + // 准备参数 + String mobile = randomString(); + String scene = randomString(); + AuthSmsLoginReqVO reqVO = new AuthSmsLoginReqVO(mobile, scene); + // mock 方法(用户信息) + AdminUserDO user = randomPojo(AdminUserDO.class, o -> o.setId(1L)); + when(userService.getUserByMobile(eq(mobile))).thenReturn(user); + // mock 缓存登录用户到 Redis + OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class, o -> o.setUserId(1L) + .setUserType(UserTypeEnum.ADMIN.getValue())); + when(oauth2TokenService.createAccessToken(eq(1L), eq(UserTypeEnum.ADMIN.getValue()), eq("default"), isNull())) + .thenReturn(accessTokenDO); + + // 调用,并断言 + AuthLoginRespVO loginRespVO = authService.smsLogin(reqVO); + assertPojoEquals(accessTokenDO, loginRespVO); + // 断言调用 + verify(loginLogService).createLoginLog( + argThat(o -> o.getLogType().equals(LoginLogTypeEnum.LOGIN_MOBILE.getType()) + && o.getResult().equals(LoginResultEnum.SUCCESS.getResult()) + && o.getUserId().equals(user.getId())) + ); + } + + @Test + public void testSocialLogin_success() { + // 准备参数 + AuthSocialLoginReqVO reqVO = randomPojo(AuthSocialLoginReqVO.class); + // mock 方法(绑定的用户编号) + Long userId = 1L; + when(socialUserService.getBindUserId(eq(UserTypeEnum.ADMIN.getValue()), eq(reqVO.getType()), + eq(reqVO.getCode()), eq(reqVO.getState()))).thenReturn(userId); + // mock(用户) + AdminUserDO user = randomPojo(AdminUserDO.class, o -> o.setId(userId)); + when(userService.getUser(eq(userId))).thenReturn(user); + // mock 缓存登录用户到 Redis + OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class, o -> o.setUserId(1L) + .setUserType(UserTypeEnum.ADMIN.getValue())); + when(oauth2TokenService.createAccessToken(eq(1L), eq(UserTypeEnum.ADMIN.getValue()), eq("default"), isNull())) + .thenReturn(accessTokenDO); + + // 调用,并断言 + AuthLoginRespVO loginRespVO = authService.socialLogin(reqVO); + assertPojoEquals(accessTokenDO, loginRespVO); + // 断言调用 + verify(loginLogService).createLoginLog( + argThat(o -> o.getLogType().equals(LoginLogTypeEnum.LOGIN_SOCIAL.getType()) + && o.getResult().equals(LoginResultEnum.SUCCESS.getResult()) + && o.getUserId().equals(user.getId())) + ); + } + + @Test + public void testValidateCaptcha_successWithEnable() { + // 准备参数 + AuthLoginReqVO reqVO = randomPojo(AuthLoginReqVO.class); + + // mock 验证码打开 + ReflectUtil.setFieldValue(authService, "captchaEnable", true); + // mock 验证通过 + when(captchaService.verification(argThat(captchaVO -> { + assertEquals(reqVO.getCaptchaVerification(), captchaVO.getCaptchaVerification()); + return true; + }))).thenReturn(ResponseModel.success()); + + // 调用,无需断言 + authService.validateCaptcha(reqVO); + } + + @Test + public void testValidateCaptcha_successWithDisable() { + // 准备参数 + AuthLoginReqVO reqVO = randomPojo(AuthLoginReqVO.class); + + // mock 验证码关闭 + ReflectUtil.setFieldValue(authService, "captchaEnable", false); + + // 调用,无需断言 + authService.validateCaptcha(reqVO); + } + + @Test + public void testValidateCaptcha_constraintViolationException() { + // 准备参数 + AuthLoginReqVO reqVO = randomPojo(AuthLoginReqVO.class).setCaptchaVerification(null); + + // mock 验证码打开 + ReflectUtil.setFieldValue(authService, "captchaEnable", true); + + // 调用,并断言异常 + assertThrows(ConstraintViolationException.class, () -> authService.validateCaptcha(reqVO), + "验证码不能为空"); + } + + + @Test + public void testCaptcha_fail() { + // 准备参数 + AuthLoginReqVO reqVO = randomPojo(AuthLoginReqVO.class); + + // mock 验证码打开 + ReflectUtil.setFieldValue(authService, "captchaEnable", true); + // mock 验证通过 + when(captchaService.verification(argThat(captchaVO -> { + assertEquals(reqVO.getCaptchaVerification(), captchaVO.getCaptchaVerification()); + return true; + }))).thenReturn(ResponseModel.errorMsg("就是不对")); + + // 调用, 并断言异常 + assertServiceException(() -> authService.validateCaptcha(reqVO), AUTH_LOGIN_CAPTCHA_CODE_ERROR, "就是不对"); + // 校验调用参数 + verify(loginLogService).createLoginLog( + argThat(o -> o.getLogType().equals(LoginLogTypeEnum.LOGIN_USERNAME.getType()) + && o.getResult().equals(LoginResultEnum.CAPTCHA_CODE_ERROR.getResult())) + ); + } + + @Test + public void testRefreshToken() { + // 准备参数 + String refreshToken = randomString(); + // mock 方法 + OAuth2AccessTokenDO accessTokenDO = randomPojo(OAuth2AccessTokenDO.class); + when(oauth2TokenService.refreshAccessToken(eq(refreshToken), eq("default"))) + .thenReturn(accessTokenDO); + + // 调用 + AuthLoginRespVO loginRespVO = authService.refreshToken(refreshToken); + // 断言 + assertPojoEquals(accessTokenDO, loginRespVO); + } @Test public void testLogout_success() { @@ -221,6 +352,8 @@ public class AdminAuthServiceImplTest extends BaseDbUnitTest { verify(loginLogService).createLoginLog(argThat(o -> o.getLogType().equals(LoginLogTypeEnum.LOGOUT_SELF.getType()) && o.getResult().equals(LoginResultEnum.SUCCESS.getResult())) ); + // 调用,并校验 + } @Test diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImplTest.java similarity index 69% rename from yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceTest.java rename to yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImplTest.java index 6b4ff1028..3771fc33e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImplTest.java @@ -19,6 +19,7 @@ import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import javax.annotation.Resource; +import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.function.Consumer; @@ -28,8 +29,8 @@ import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEq import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; +import static java.util.Collections.singletonList; import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; /** @@ -38,7 +39,7 @@ import static org.mockito.Mockito.verify; * @author niudehua */ @Import(DeptServiceImpl.class) -public class DeptServiceTest extends BaseDbUnitTest { +public class DeptServiceImplTest extends BaseDbUnitTest { @Resource private DeptServiceImpl deptService; @@ -76,7 +77,7 @@ public class DeptServiceTest extends BaseDbUnitTest { } @Test - void testListDepts() { + public void testListDepts() { // mock 数据 DeptDO dept = randomPojo(DeptDO.class, o -> { // 等会查询到 o.setName("开发部"); @@ -91,21 +92,22 @@ public class DeptServiceTest extends BaseDbUnitTest { DeptListReqVO reqVO = new DeptListReqVO(); reqVO.setName("开"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); + // 调用 - List sysDeptDOS = deptService.getSimpleDepts(reqVO); + List sysDeptDOS = deptService.getDeptList(reqVO); // 断言 assertEquals(1, sysDeptDOS.size()); assertPojoEquals(dept, sysDeptDOS.get(0)); } @Test - void testCreateDept_success() { + public void testCreateDept_success() { // 准备参数 - DeptCreateReqVO reqVO = randomPojo(DeptCreateReqVO.class, - o -> { - o.setParentId(DeptIdEnum.ROOT.getId()); - o.setStatus(randomCommonStatus()); - }); + DeptCreateReqVO reqVO = randomPojo(DeptCreateReqVO.class, o -> { + o.setParentId(DeptIdEnum.ROOT.getId()); + o.setStatus(randomCommonStatus()); + }); + // 调用 Long deptId = deptService.createDept(reqVO); // 断言 @@ -114,11 +116,11 @@ public class DeptServiceTest extends BaseDbUnitTest { DeptDO deptDO = deptMapper.selectById(deptId); assertPojoEquals(reqVO, deptDO); // 校验调用 - verify(deptProducer, times(1)).sendDeptRefreshMessage(); + verify(deptProducer).sendDeptRefreshMessage(); } @Test - void testUpdateDept_success() { + public void testUpdateDept_success() { // mock 数据 DeptDO dbDeptDO = randomPojo(DeptDO.class, o -> o.setStatus(randomCommonStatus())); deptMapper.insert(dbDeptDO);// @Sql: 先插入出一条存在的数据 @@ -129,28 +131,34 @@ public class DeptServiceTest extends BaseDbUnitTest { o.setId(dbDeptDO.getId()); o.setStatus(randomCommonStatus()); }); + // 调用 deptService.updateDept(reqVO); // 校验是否更新正确 DeptDO deptDO = deptMapper.selectById(reqVO.getId()); // 获取最新的 assertPojoEquals(reqVO, deptDO); + // 校验调用 + verify(deptProducer).sendDeptRefreshMessage(); } @Test - void testDeleteDept_success() { + public void testDeleteDept_success() { // mock 数据 DeptDO dbDeptDO = randomPojo(DeptDO.class, o -> o.setStatus(randomCommonStatus())); deptMapper.insert(dbDeptDO);// @Sql: 先插入出一条存在的数据 // 准备参数 Long id = dbDeptDO.getId(); + // 调用 deptService.deleteDept(id); // 校验数据不存在了 assertNull(deptMapper.selectById(id)); + // 校验调用 + verify(deptProducer).sendDeptRefreshMessage(); } @Test - void testCheckDept_nameDuplicateForUpdate() { + public void testValidateDept_nameDuplicateForUpdate() { // mock 数据 DeptDO deptDO = randomDeptDO(); // 设置根节点部门 @@ -162,37 +170,40 @@ public class DeptServiceTest extends BaseDbUnitTest { nameDeptDO.setParentId(DeptIdEnum.ROOT.getId()); deptMapper.insert(nameDeptDO); // 准备参数 - DeptUpdateReqVO reqVO = randomPojo(DeptUpdateReqVO.class, - o -> { - // 设置根节点部门 - o.setParentId(DeptIdEnum.ROOT.getId()); - // 设置更新的 ID - o.setId(deptDO.getId()); - // 模拟 name 重复 - o.setName(nameDeptDO.getName()); - }); + DeptUpdateReqVO reqVO = randomPojo(DeptUpdateReqVO.class, o -> { + // 设置根节点部门 + o.setParentId(DeptIdEnum.ROOT.getId()); + // 设置更新的 ID + o.setId(deptDO.getId()); + // 模拟 name 重复 + o.setName(nameDeptDO.getName()); + }); + // 调用, 并断言异常 assertServiceException(() -> deptService.updateDept(reqVO), DEPT_NAME_DUPLICATE); } @Test - void testCheckDept_parentNotExitsForCreate() { + public void testValidateDept_parentNotExitsForCreate() { + // 准备参数 DeptCreateReqVO reqVO = randomPojo(DeptCreateReqVO.class, o -> o.setStatus(randomCommonStatus())); + // 调用,并断言异常 assertServiceException(() -> deptService.createDept(reqVO), DEPT_PARENT_NOT_EXITS); } @Test - void testCheckDept_notFoundForDelete() { + public void testValidateDept_notFoundForDelete() { // 准备参数 Long id = randomLongId(); + // 调用, 并断言异常 assertServiceException(() -> deptService.deleteDept(id), DEPT_NOT_FOUND); } @Test - void testCheckDept_exitsChildrenForDelete() { + public void testValidateDept_exitsChildrenForDelete() { // mock 数据 DeptDO parentDept = randomPojo(DeptDO.class, o -> o.setStatus(randomCommonStatus())); deptMapper.insert(parentDept);// @Sql: 先插入出一条存在的数据 @@ -208,39 +219,39 @@ public class DeptServiceTest extends BaseDbUnitTest { } @Test - void testCheckDept_parentErrorForUpdate() { + public void testValidateDept_parentErrorForUpdate() { // mock 数据 DeptDO dbDeptDO = randomPojo(DeptDO.class, o -> o.setStatus(randomCommonStatus())); deptMapper.insert(dbDeptDO); // 准备参数 - DeptUpdateReqVO reqVO = randomPojo(DeptUpdateReqVO.class, - o -> { - // 设置自己为父部门 - o.setParentId(dbDeptDO.getId()); - // 设置更新的 ID - o.setId(dbDeptDO.getId()); - }); + DeptUpdateReqVO reqVO = randomPojo(DeptUpdateReqVO.class, o -> { + // 设置自己为父部门 + o.setParentId(dbDeptDO.getId()); + // 设置更新的 ID + o.setId(dbDeptDO.getId()); + }); + // 调用, 并断言异常 assertServiceException(() -> deptService.updateDept(reqVO), DEPT_PARENT_ERROR); } @Test - void testCheckDept_notEnableForCreate() { + public void testValidateDept_notEnableForCreate() { // mock 数据 DeptDO deptDO = randomPojo(DeptDO.class, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus())); deptMapper.insert(deptDO); // 准备参数 - DeptCreateReqVO reqVO = randomPojo(DeptCreateReqVO.class, - o -> { - // 设置未启用的部门为副部门 - o.setParentId(deptDO.getId()); - }); + DeptCreateReqVO reqVO = randomPojo(DeptCreateReqVO.class, o -> { + // 设置未启用的部门为父部门 + o.setParentId(deptDO.getId()); + }); + // 调用, 并断言异常 assertServiceException(() -> deptService.createDept(reqVO), DEPT_NOT_ENABLE); } @Test - void testCheckDept_parentIsChildForUpdate() { + public void testCheckDept_parentIsChildForUpdate() { // mock 数据 DeptDO parentDept = randomPojo(DeptDO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus())); deptMapper.insert(parentDept); @@ -251,18 +262,84 @@ public class DeptServiceTest extends BaseDbUnitTest { deptMapper.insert(childDept); // 初始化本地缓存 deptService.initLocalCache(); + // 准备参数 - DeptUpdateReqVO reqVO = randomPojo(DeptUpdateReqVO.class, - o -> { - // 设置自己的子部门为父部门 - o.setParentId(childDept.getId()); - // 设置更新的 ID - o.setId(parentDept.getId()); - }); + DeptUpdateReqVO reqVO = randomPojo(DeptUpdateReqVO.class, o -> { + // 设置自己的子部门为父部门 + o.setParentId(childDept.getId()); + // 设置更新的 ID + o.setId(parentDept.getId()); + }); + // 调用, 并断言异常 assertServiceException(() -> deptService.updateDept(reqVO), DEPT_PARENT_IS_CHILD); } + @Test + public void testGetDeptList() { + // mock 数据 + DeptDO deptDO01 = randomDeptDO(); + deptMapper.insert(deptDO01); + DeptDO deptDO02 = randomDeptDO(); + deptMapper.insert(deptDO02); + // 准备参数 + List ids = Arrays.asList(deptDO01.getId(), deptDO02.getId()); + + // 调用 + List deptDOList = deptService.getDeptList(ids); + // 断言 + assertEquals(2, deptDOList.size()); + assertEquals(deptDO01, deptDOList.get(0)); + assertEquals(deptDO02, deptDOList.get(1)); + } + + @Test + public void testGetDept() { + // mock 数据 + DeptDO deptDO = randomDeptDO(); + deptMapper.insert(deptDO); + // 准备参数 + Long id = deptDO.getId(); + + // 调用 + DeptDO dbDept = deptService.getDept(id); + // 断言 + assertEquals(deptDO, dbDept); + } + + @Test + public void testValidateDeptList_success() { + // mock 数据 + DeptDO deptDO = randomDeptDO().setStatus(CommonStatusEnum.ENABLE.getStatus()); + deptMapper.insert(deptDO); + // 准备参数 + List ids = singletonList(deptDO.getId()); + + // 调用,无需断言 + deptService.validateDeptList(ids); + } + + @Test + public void testValidateDeptList_notFound() { + // 准备参数 + List ids = singletonList(randomLongId()); + + // 调用, 并断言异常 + assertServiceException(() -> deptService.validateDeptList(ids), DEPT_NOT_FOUND); + } + + @Test + public void testValidateDeptList_notEnable() { + // mock 数据 + DeptDO deptDO = randomDeptDO().setStatus(CommonStatusEnum.DISABLE.getStatus()); + deptMapper.insert(deptDO); + // 准备参数 + List ids = singletonList(deptDO.getId()); + + // 调用, 并断言异常 + assertServiceException(() -> deptService.validateDeptList(ids), DEPT_NOT_ENABLE, deptDO.getName()); + } + @SafeVarargs private static DeptDO randomDeptDO(Consumer... consumers) { Consumer consumer = (o) -> { diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dept/PostServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dept/PostServiceImplTest.java similarity index 61% rename from yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dept/PostServiceTest.java rename to yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dept/PostServiceImplTest.java index 30e546f66..87c44b346 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dept/PostServiceTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dept/PostServiceImplTest.java @@ -1,41 +1,136 @@ package cn.iocoder.yudao.module.system.service.dept; -import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostPageReqVO; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostUpdateReqVO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; import cn.iocoder.yudao.module.system.dal.mysql.dept.PostMapper; -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Import; import javax.annotation.Resource; +import java.util.Arrays; import java.util.List; import java.util.function.Consumer; import static cn.hutool.core.util.RandomUtil.randomEle; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; +import static java.util.Collections.singletonList; import static org.junit.jupiter.api.Assertions.*; +/** + * {@link PostServiceImpl} 的单元测试类 + * + * @author niudehua + */ @Import(PostServiceImpl.class) -public class PostServiceTest extends BaseDbUnitTest { +public class PostServiceImplTest extends BaseDbUnitTest { @Resource private PostServiceImpl postService; + @Resource private PostMapper postMapper; @Test - void testPagePosts() { + public void testCreatePost_success() { + // 准备参数 + PostCreateReqVO reqVO = randomPojo(PostCreateReqVO.class, + o -> o.setStatus(randomEle(CommonStatusEnum.values()).getStatus())); + // 调用 + Long postId = postService.createPost(reqVO); + + // 断言 + assertNotNull(postId); + // 校验记录的属性是否正确 + PostDO post = postMapper.selectById(postId); + assertPojoEquals(reqVO, post); + } + + @Test + public void testUpdatePost_success() { + // mock 数据 + PostDO postDO = randomPostDO(); + postMapper.insert(postDO);// @Sql: 先插入出一条存在的数据 + // 准备参数 + PostUpdateReqVO reqVO = randomPojo(PostUpdateReqVO.class, o -> { + // 设置更新的 ID + o.setId(postDO.getId()); + o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); + }); + + // 调用 + postService.updatePost(reqVO); + // 校验是否更新正确 + PostDO post = postMapper.selectById(reqVO.getId()); + assertPojoEquals(reqVO, post); + } + + @Test + public void testDeletePost_success() { + // mock 数据 + PostDO postDO = randomPostDO(); + postMapper.insert(postDO); + // 准备参数 + Long id = postDO.getId(); + + // 调用 + postService.deletePost(id); + assertNull(postMapper.selectById(id)); + } + + @Test + public void testValidatePost_notFoundForDelete() { + // 准备参数 + Long id = randomLongId(); + + // 调用, 并断言异常 + assertServiceException(() -> postService.deletePost(id), POST_NOT_FOUND); + } + + @Test + public void testValidatePost_nameDuplicateForCreate() { + // mock 数据 + PostDO postDO = randomPostDO(); + postMapper.insert(postDO);// @Sql: 先插入出一条存在的数据 + // 准备参数 + PostCreateReqVO reqVO = randomPojo(PostCreateReqVO.class, + // 模拟 name 重复 + o -> o.setName(postDO.getName())); + assertServiceException(() -> postService.createPost(reqVO), POST_NAME_DUPLICATE); + } + + @Test + public void testValidatePost_codeDuplicateForUpdate() { + // mock 数据 + PostDO postDO = randomPostDO(); + postMapper.insert(postDO); + // mock 数据:稍后模拟重复它的 code + PostDO codePostDO = randomPostDO(); + postMapper.insert(codePostDO); + // 准备参数 + PostUpdateReqVO reqVO = randomPojo(PostUpdateReqVO.class, o -> { + // 设置更新的 ID + o.setId(postDO.getId()); + // 模拟 code 重复 + o.setCode(codePostDO.getCode()); + }); + + // 调用, 并断言异常 + assertServiceException(() -> postService.updatePost(reqVO), POST_CODE_DUPLICATE); + } + + @Test + public void testGetPostPage() { // mock 数据 PostDO postDO = randomPojo(PostDO.class, o -> { o.setName("码仔"); @@ -43,10 +138,9 @@ public class PostServiceTest extends BaseDbUnitTest { }); postMapper.insert(postDO); // 测试 name 不匹配 - postMapper.insert(ObjectUtils.cloneIgnoreId(postDO, o -> o.setName("程序员"))); + postMapper.insert(cloneIgnoreId(postDO, o -> o.setName("程序员"))); // 测试 status 不匹配 - postMapper.insert(ObjectUtils.cloneIgnoreId(postDO, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); - + postMapper.insert(cloneIgnoreId(postDO, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); // 准备参数 PostPageReqVO reqVO = new PostPageReqVO(); reqVO.setName("码"); @@ -54,7 +148,6 @@ public class PostServiceTest extends BaseDbUnitTest { // 调用 PageResult pageResult = postService.getPostPage(reqVO); - // 断言 assertEquals(1, pageResult.getTotal()); assertEquals(1, pageResult.getList().size()); @@ -62,7 +155,7 @@ public class PostServiceTest extends BaseDbUnitTest { } @Test - void testListPosts() { + public void testGetPostList_export() { // mock 数据 PostDO postDO = randomPojo(PostDO.class, o -> { o.setName("码仔"); @@ -70,23 +163,41 @@ public class PostServiceTest extends BaseDbUnitTest { }); postMapper.insert(postDO); // 测试 name 不匹配 - postMapper.insert(ObjectUtils.cloneIgnoreId(postDO, o -> o.setName("程序员"))); + postMapper.insert(cloneIgnoreId(postDO, o -> o.setName("程序员"))); // 测试 status 不匹配 - postMapper.insert(ObjectUtils.cloneIgnoreId(postDO, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); + postMapper.insert(cloneIgnoreId(postDO, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); // 准备参数 PostExportReqVO reqVO = new PostExportReqVO(); reqVO.setName("码"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); // 调用 - List list = postService.getPosts(reqVO); + List list = postService.getPostList(reqVO); // 断言 assertEquals(1, list.size()); assertPojoEquals(postDO, list.get(0)); } @Test - void testGetPost() { + public void testGetPostList() { + // mock 数据 + PostDO postDO01 = randomPojo(PostDO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus())); + postMapper.insert(postDO01); + // 测试 status 不匹配 + PostDO postDO02 = randomPojo(PostDO.class, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus())); + postMapper.insert(postDO02); + // 准备参数 + List ids = Arrays.asList(postDO01.getId(), postDO02.getId()); + + // 调用 + List list = postService.getPostList(ids, singletonList(CommonStatusEnum.ENABLE.getStatus())); + // 断言 + assertEquals(1, list.size()); + assertPojoEquals(postDO01, list.get(0)); + } + + @Test + public void testGetPost() { // mock 数据 PostDO dbPostDO = randomPostDO(); postMapper.insert(dbPostDO); @@ -100,94 +211,43 @@ public class PostServiceTest extends BaseDbUnitTest { } @Test - void testCreatePost_success() { - // 准备参数 - PostCreateReqVO reqVO = randomPojo(PostCreateReqVO.class, - o -> o.setStatus(randomEle(CommonStatusEnum.values()).getStatus())); - // 调用 - Long postId = postService.createPost(reqVO); - // 断言 - assertNotNull(postId); - // 校验记录的属性是否正确 - PostDO post = postMapper.selectById(postId); - assertPojoEquals(reqVO, post); - } - - @Test - void testUpdatePost_success() { + public void testValidatePostList_success() { // mock 数据 - PostDO postDO = randomPostDO(); - postMapper.insert(postDO);// @Sql: 先插入出一条存在的数据 - // 准备参数 - PostUpdateReqVO reqVO = randomPojo(PostUpdateReqVO.class, - o -> { - // 设置更新的 ID - o.setId(postDO.getId()); - o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); - }); - // 调用 - postService.updatePost(reqVO); - // 校验是否更新正确 - PostDO post = postMapper.selectById(reqVO.getId());// 获取最新的 - assertPojoEquals(reqVO, post); - } - - @Test - void testDeletePost_success() { - // mock 数据 - PostDO postDO = randomPostDO(); + PostDO postDO = randomPostDO().setStatus(CommonStatusEnum.ENABLE.getStatus()); postMapper.insert(postDO); // 准备参数 - Long id = postDO.getId(); - // 调用 - postService.deletePost(id); - assertNull(postMapper.selectById(id)); + List ids = singletonList(postDO.getId()); + + // 调用,无需断言 + postService.validatePostList(ids); } @Test - void testCheckPost_notFoundForDelete() { + public void testValidatePostList_notFound() { // 准备参数 - Long id = randomLongId(); + List ids = singletonList(randomLongId()); + // 调用, 并断言异常 - assertServiceException(() -> postService.deletePost(id), POST_NOT_FOUND); + assertServiceException(() -> postService.validatePostList(ids), POST_NOT_FOUND); } @Test - void testCheckPost_nameDuplicateForCreate() { + public void testValidatePostList_notEnable() { // mock 数据 - PostDO postDO = randomPostDO(); - postMapper.insert(postDO);// @Sql: 先插入出一条存在的数据 - // 准备参数 - PostCreateReqVO reqVO = randomPojo(PostCreateReqVO.class, - // 模拟 name 重复 - o -> o.setName(postDO.getName())); - assertServiceException(() -> postService.createPost(reqVO), POST_NAME_DUPLICATE); - } - - @Test - void testCheckPost_codeDuplicateForUpdate() { - // mock 数据 - PostDO postDO = randomPostDO(); + PostDO postDO = randomPostDO().setStatus(CommonStatusEnum.DISABLE.getStatus()); postMapper.insert(postDO); - // mock 数据 稍后模拟重复它的 code - PostDO codePostDO = randomPostDO(); - postMapper.insert(codePostDO); // 准备参数 - PostUpdateReqVO reqVO = randomPojo(PostUpdateReqVO.class, - o -> { - // 设置更新的 ID - o.setId(postDO.getId()); - // 模拟 code 重复 - o.setCode(codePostDO.getCode()); - }); + List ids = singletonList(postDO.getId()); + // 调用, 并断言异常 - assertServiceException(() -> postService.updatePost(reqVO), POST_CODE_DUPLICATE); + assertServiceException(() -> postService.validatePostList(ids), POST_NOT_ENABLE, + postDO.getName()); } @SafeVarargs private static PostDO randomPostDO(Consumer... consumers) { Consumer consumer = (o) -> { - o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 + o.setStatus(randomCommonStatus()); // 保证 status 的范围 }; return randomPojo(PostDO.class, ArrayUtils.append(consumer, consumers)); } diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImplTest.java similarity index 55% rename from yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceTest.java rename to yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImplTest.java index 02fba6c21..1e4dc9f90 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImplTest.java @@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.system.service.dict; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataExportReqVO; @@ -20,16 +19,18 @@ import javax.annotation.Resource; import java.util.List; import java.util.function.Consumer; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; +import static java.util.Collections.singletonList; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.when; @Import(DictDataServiceImpl.class) -public class DictDataServiceTest extends BaseDbUnitTest { +public class DictDataServiceImplTest extends BaseDbUnitTest { @Resource private DictDataServiceImpl dictDataService; @@ -39,6 +40,23 @@ public class DictDataServiceTest extends BaseDbUnitTest { @MockBean private DictTypeService dictTypeService; + @Test + public void testGetDictDataList() { + // mock 数据 + DictDataDO dictDataDO01 = randomDictDataDO().setDictType("yunai").setSort(2); + dictDataMapper.insert(dictDataDO01); + DictDataDO dictDataDO02 = randomDictDataDO().setDictType("yunai").setSort(1); + dictDataMapper.insert(dictDataDO02); + // 准备参数 + + // 调用 + List dictDataDOList = dictDataService.getDictDataList(); + // 断言 + assertEquals(2, dictDataDOList.size()); + assertPojoEquals(dictDataDO02, dictDataDOList.get(0)); + assertPojoEquals(dictDataDO01, dictDataDOList.get(1)); + } + @Test public void testGetDictDataPage() { // mock 数据 @@ -49,11 +67,11 @@ public class DictDataServiceTest extends BaseDbUnitTest { }); dictDataMapper.insert(dbDictData); // 测试 label 不匹配 - dictDataMapper.insert(ObjectUtils.cloneIgnoreId(dbDictData, o -> o.setLabel("艿"))); + dictDataMapper.insert(cloneIgnoreId(dbDictData, o -> o.setLabel("艿"))); // 测试 dictType 不匹配 - dictDataMapper.insert(ObjectUtils.cloneIgnoreId(dbDictData, o -> o.setDictType("nai"))); + dictDataMapper.insert(cloneIgnoreId(dbDictData, o -> o.setDictType("nai"))); // 测试 status 不匹配 - dictDataMapper.insert(ObjectUtils.cloneIgnoreId(dbDictData, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); + dictDataMapper.insert(cloneIgnoreId(dbDictData, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); // 准备参数 DictDataPageReqVO reqVO = new DictDataPageReqVO(); reqVO.setLabel("芋"); @@ -69,7 +87,7 @@ public class DictDataServiceTest extends BaseDbUnitTest { } @Test - public void testGetDictDataList() { + public void testGetDictDataList_export() { // mock 数据 DictDataDO dbDictData = randomPojo(DictDataDO.class, o -> { // 等会查询到 o.setLabel("芋艿"); @@ -78,11 +96,11 @@ public class DictDataServiceTest extends BaseDbUnitTest { }); dictDataMapper.insert(dbDictData); // 测试 label 不匹配 - dictDataMapper.insert(ObjectUtils.cloneIgnoreId(dbDictData, o -> o.setLabel("艿"))); + dictDataMapper.insert(cloneIgnoreId(dbDictData, o -> o.setLabel("艿"))); // 测试 dictType 不匹配 - dictDataMapper.insert(ObjectUtils.cloneIgnoreId(dbDictData, o -> o.setDictType("nai"))); + dictDataMapper.insert(cloneIgnoreId(dbDictData, o -> o.setDictType("nai"))); // 测试 status 不匹配 - dictDataMapper.insert(ObjectUtils.cloneIgnoreId(dbDictData, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); + dictDataMapper.insert(cloneIgnoreId(dbDictData, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); // 准备参数 DictDataExportReqVO reqVO = new DictDataExportReqVO(); reqVO.setLabel("芋"); @@ -90,12 +108,26 @@ public class DictDataServiceTest extends BaseDbUnitTest { reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); // 调用 - List list = dictDataService.getDictDatas(reqVO); + List list = dictDataService.getDictDataList(reqVO); // 断言 assertEquals(1, list.size()); assertPojoEquals(dbDictData, list.get(0)); } + @Test + public void testGetDictData() { + // mock 数据 + DictDataDO dbDictData = randomDictDataDO(); + dictDataMapper.insert(dbDictData); + // 准备参数 + Long id = dbDictData.getId(); + + // 调用 + DictDataDO dictData = dictDataService.getDictData(id); + // 断言 + assertPojoEquals(dbDictData, dictData); + } + @Test public void testCreateDictData_success() { // 准备参数 @@ -148,54 +180,54 @@ public class DictDataServiceTest extends BaseDbUnitTest { } @Test - public void testCheckDictDataExists_success() { + public void testValidateDictDataExists_success() { // mock 数据 DictDataDO dbDictData = randomDictDataDO(); dictDataMapper.insert(dbDictData);// @Sql: 先插入出一条存在的数据 // 调用成功 - dictDataService.checkDictDataExists(dbDictData.getId()); + dictDataService.validateDictDataExists(dbDictData.getId()); } @Test - public void testCheckDictDataExists_notExists() { - assertServiceException(() -> dictDataService.checkDictDataExists(randomLongId()), DICT_DATA_NOT_EXISTS); + public void testValidateDictDataExists_notExists() { + assertServiceException(() -> dictDataService.validateDictDataExists(randomLongId()), DICT_DATA_NOT_EXISTS); } @Test - public void testCheckDictTypeValid_success() { + public void testValidateDictTypeExists_success() { // mock 方法,数据类型被禁用 String type = randomString(); when(dictTypeService.getDictType(eq(type))).thenReturn(randomDictTypeDO(type)); // 调用, 成功 - dictDataService.checkDictTypeValid(type); + dictDataService.validateDictTypeExists(type); } @Test - public void testCheckDictTypeValid_notExists() { - assertServiceException(() -> dictDataService.checkDictTypeValid(randomString()), DICT_TYPE_NOT_EXISTS); + public void testValidateDictTypeExists_notExists() { + assertServiceException(() -> dictDataService.validateDictTypeExists(randomString()), DICT_TYPE_NOT_EXISTS); } @Test - public void testCheckDictTypeValid_notEnable() { + public void testValidateDictTypeExists_notEnable() { // mock 方法,数据类型被禁用 String dictType = randomString(); when(dictTypeService.getDictType(eq(dictType))).thenReturn( randomPojo(DictTypeDO.class, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); // 调用, 并断言异常 - assertServiceException(() -> dictDataService.checkDictTypeValid(dictType), DICT_TYPE_NOT_ENABLE); + assertServiceException(() -> dictDataService.validateDictTypeExists(dictType), DICT_TYPE_NOT_ENABLE); } @Test - public void testCheckDictDataValueUnique_success() { + public void testValidateDictDataValueUnique_success() { // 调用,成功 - dictDataService.checkDictDataValueUnique(randomLongId(), randomString(), randomString()); + dictDataService.validateDictDataValueUnique(randomLongId(), randomString(), randomString()); } @Test - public void testCheckDictDataValueUnique_valueDuplicateForCreate() { + public void testValidateDictDataValueUnique_valueDuplicateForCreate() { // 准备参数 String dictType = randomString(); String value = randomString(); @@ -206,12 +238,12 @@ public class DictDataServiceTest extends BaseDbUnitTest { })); // 调用,校验异常 - assertServiceException(() -> dictDataService.checkDictDataValueUnique(null, dictType, value), + assertServiceException(() -> dictDataService.validateDictDataValueUnique(null, dictType, value), DICT_DATA_VALUE_DUPLICATE); } @Test - public void testCheckDictDataValueUnique_valueDuplicateForUpdate() { + public void testValidateDictDataValueUnique_valueDuplicateForUpdate() { // 准备参数 Long id = randomLongId(); String dictType = randomString(); @@ -223,10 +255,96 @@ public class DictDataServiceTest extends BaseDbUnitTest { })); // 调用,校验异常 - assertServiceException(() -> dictDataService.checkDictDataValueUnique(id, dictType, value), + assertServiceException(() -> dictDataService.validateDictDataValueUnique(id, dictType, value), DICT_DATA_VALUE_DUPLICATE); } + @Test + public void testCountByDictType() { + // mock 数据 + dictDataMapper.insert(randomDictDataDO(o -> o.setDictType("yunai"))); + dictDataMapper.insert(randomDictDataDO(o -> o.setDictType("tudou"))); + dictDataMapper.insert(randomDictDataDO(o -> o.setDictType("yunai"))); + // 准备参数 + String dictType = "yunai"; + + // 调用 + long count = dictDataService.countByDictType(dictType); + // 校验 + assertEquals(2L, count); + } + + @Test + public void testValidateDictDataList_success() { + // mock 数据 + DictDataDO dictDataDO = randomDictDataDO().setStatus(CommonStatusEnum.ENABLE.getStatus()); + dictDataMapper.insert(dictDataDO); + // 准备参数 + String dictType = dictDataDO.getDictType(); + List values = singletonList(dictDataDO.getValue()); + + // 调用,无需断言 + dictDataService.validateDictDataList(dictType, values); + } + + @Test + public void testValidateDictDataList_notFound() { + // 准备参数 + String dictType = randomString(); + List values = singletonList(randomString()); + + // 调用, 并断言异常 + assertServiceException(() -> dictDataService.validateDictDataList(dictType, values), DICT_DATA_NOT_EXISTS); + } + + @Test + public void testValidateDictDataList_notEnable() { + // mock 数据 + DictDataDO dictDataDO = randomDictDataDO().setStatus(CommonStatusEnum.DISABLE.getStatus()); + dictDataMapper.insert(dictDataDO); + // 准备参数 + String dictType = dictDataDO.getDictType(); + List values = singletonList(dictDataDO.getValue()); + + // 调用, 并断言异常 + assertServiceException(() -> dictDataService.validateDictDataList(dictType, values), + DICT_DATA_NOT_ENABLE, dictDataDO.getLabel()); + } + + @Test + public void testGetDictData_dictType() { + // mock 数据 + DictDataDO dictDataDO = randomDictDataDO().setDictType("yunai").setValue("1"); + dictDataMapper.insert(dictDataDO); + DictDataDO dictDataDO02 = randomDictDataDO().setDictType("yunai").setValue("2"); + dictDataMapper.insert(dictDataDO02); + // 准备参数 + String dictType = "yunai"; + String value = "1"; + + // 调用 + DictDataDO dbDictData = dictDataService.getDictData(dictType, value); + // 断言 + assertEquals(dictDataDO, dbDictData); + } + + @Test + public void testParseDictData() { + // mock 数据 + DictDataDO dictDataDO = randomDictDataDO().setDictType("yunai").setLabel("1"); + dictDataMapper.insert(dictDataDO); + DictDataDO dictDataDO02 = randomDictDataDO().setDictType("yunai").setLabel("2"); + dictDataMapper.insert(dictDataDO02); + // 准备参数 + String dictType = "yunai"; + String label = "1"; + + // 调用 + DictDataDO dbDictData = dictDataService.parseDictData(dictType, label); + // 断言 + assertEquals(dictDataDO, dbDictData); + } + // ========== 随机对象 ========== @SafeVarargs diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceImplTest.java similarity index 70% rename from yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceTest.java rename to yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceImplTest.java index 5c39b32e6..fc9387019 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceImplTest.java @@ -2,36 +2,36 @@ package cn.iocoder.yudao.module.system.service.dict; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.type.DictTypeCreateReqVO; -import cn.iocoder.yudao.module.system.controller.admin.dict.vo.type.DictTypeUpdateReqVO; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.type.DictTypeExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.dict.vo.type.DictTypePageReqVO; +import cn.iocoder.yudao.module.system.controller.admin.dict.vo.type.DictTypeUpdateReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictTypeDO; import cn.iocoder.yudao.module.system.dal.mysql.dict.DictTypeMapper; -import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import org.junit.jupiter.api.Test; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import javax.annotation.Resource; -import java.time.LocalDateTime; import java.util.List; import java.util.function.Consumer; import static cn.hutool.core.util.RandomUtil.randomEle; -import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.when; @Import(DictTypeServiceImpl.class) -public class DictTypeServiceTest extends BaseDbUnitTest { +public class DictTypeServiceImplTest extends BaseDbUnitTest { @Resource private DictTypeServiceImpl dictTypeService; @@ -52,19 +52,19 @@ public class DictTypeServiceTest extends BaseDbUnitTest { }); dictTypeMapper.insert(dbDictType); // 测试 name 不匹配 - dictTypeMapper.insert(ObjectUtils.cloneIgnoreId(dbDictType, o -> o.setName("tudou"))); + dictTypeMapper.insert(cloneIgnoreId(dbDictType, o -> o.setName("tudou"))); // 测试 type 不匹配 - dictTypeMapper.insert(ObjectUtils.cloneIgnoreId(dbDictType, o -> o.setType("土豆"))); + dictTypeMapper.insert(cloneIgnoreId(dbDictType, o -> o.setType("土豆"))); // 测试 status 不匹配 - dictTypeMapper.insert(ObjectUtils.cloneIgnoreId(dbDictType, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); + dictTypeMapper.insert(cloneIgnoreId(dbDictType, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); // 测试 createTime 不匹配 - dictTypeMapper.insert(ObjectUtils.cloneIgnoreId(dbDictType, o -> o.setCreateTime(buildTime(2021, 1, 1)))); + dictTypeMapper.insert(cloneIgnoreId(dbDictType, o -> o.setCreateTime(buildTime(2021, 1, 1)))); // 准备参数 DictTypePageReqVO reqVO = new DictTypePageReqVO(); reqVO.setName("nai"); reqVO.setType("艿"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2021, 1, 10),buildTime(2021, 1, 20)})); + reqVO.setCreateTime(buildBetweenTime(2021, 1, 10, 2021, 1, 20)); // 调用 PageResult pageResult = dictTypeService.getDictTypePage(reqVO); @@ -75,7 +75,7 @@ public class DictTypeServiceTest extends BaseDbUnitTest { } @Test - public void testGetDictTypeList() { + public void testGetDictTypeList_export() { // mock 数据 DictTypeDO dbDictType = randomPojo(DictTypeDO.class, o -> { // 等会查询到 o.setName("yunai"); @@ -85,19 +85,19 @@ public class DictTypeServiceTest extends BaseDbUnitTest { }); dictTypeMapper.insert(dbDictType); // 测试 name 不匹配 - dictTypeMapper.insert(ObjectUtils.cloneIgnoreId(dbDictType, o -> o.setName("tudou"))); + dictTypeMapper.insert(cloneIgnoreId(dbDictType, o -> o.setName("tudou"))); // 测试 type 不匹配 - dictTypeMapper.insert(ObjectUtils.cloneIgnoreId(dbDictType, o -> o.setType("土豆"))); + dictTypeMapper.insert(cloneIgnoreId(dbDictType, o -> o.setType("土豆"))); // 测试 status 不匹配 - dictTypeMapper.insert(ObjectUtils.cloneIgnoreId(dbDictType, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); + dictTypeMapper.insert(cloneIgnoreId(dbDictType, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); // 测试 createTime 不匹配 - dictTypeMapper.insert(ObjectUtils.cloneIgnoreId(dbDictType, o -> o.setCreateTime(buildTime(2021, 1, 1)))); + dictTypeMapper.insert(cloneIgnoreId(dbDictType, o -> o.setCreateTime(buildTime(2021, 1, 1)))); // 准备参数 DictTypeExportReqVO reqVO = new DictTypeExportReqVO(); reqVO.setName("nai"); reqVO.setType("艿"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2021, 1, 10),buildTime(2021, 1, 20)})); + reqVO.setCreateTime(buildBetweenTime(2021, 1, 10, 2021, 1, 20)); // 调用 List list = dictTypeService.getDictTypeList(reqVO); @@ -107,7 +107,22 @@ public class DictTypeServiceTest extends BaseDbUnitTest { } @Test - public void testGetDictType() { + public void testGetDictType_id() { + // mock 数据 + DictTypeDO dbDictType = randomDictTypeDO(); + dictTypeMapper.insert(dbDictType); + // 准备参数 + Long id = dbDictType.getId(); + + // 调用 + DictTypeDO dictType = dictTypeService.getDictType(id); + // 断言 + assertNotNull(dictType); + assertPojoEquals(dbDictType, dictType); + } + + @Test + public void testGetDictType_type() { // mock 数据 DictTypeDO dbDictType = randomDictTypeDO(); dictTypeMapper.insert(dbDictType); @@ -183,40 +198,57 @@ public class DictTypeServiceTest extends BaseDbUnitTest { } @Test - public void testCheckDictDataExists_success() { + public void testGetDictTypeList() { + // 准备参数 + DictTypeDO dictTypeDO01 = randomDictTypeDO(); + dictTypeMapper.insert(dictTypeDO01); + DictTypeDO dictTypeDO02 = randomDictTypeDO(); + dictTypeMapper.insert(dictTypeDO02); + // mock 方法 + + // 调用 + List dictTypeDOList = dictTypeService.getDictTypeList(); + // 断言 + assertEquals(2, dictTypeDOList.size()); + assertPojoEquals(dictTypeDO01, dictTypeDOList.get(0)); + assertPojoEquals(dictTypeDO02, dictTypeDOList.get(1)); + } + + @Test + public void testValidateDictDataExists_success() { // mock 数据 DictTypeDO dbDictType = randomDictTypeDO(); dictTypeMapper.insert(dbDictType);// @Sql: 先插入出一条存在的数据 // 调用成功 - dictTypeService.checkDictTypeExists(dbDictType.getId()); + dictTypeService.validateDictTypeExists(dbDictType.getId()); } @Test - public void testCheckDictDataExists_notExists() { - assertServiceException(() -> dictTypeService.checkDictTypeExists(randomLongId()), DICT_TYPE_NOT_EXISTS); + public void testValidateDictDataExists_notExists() { + assertServiceException(() -> dictTypeService.validateDictTypeExists(randomLongId()), DICT_TYPE_NOT_EXISTS); } @Test - public void testCheckDictTypeUnique_success() { + public void testValidateDictTypeUnique_success() { // 调用,成功 - dictTypeService.checkDictTypeUnique(randomLongId(), randomString()); + dictTypeService.validateDictTypeUnique(randomLongId(), randomString()); } @Test - public void testCheckDictTypeUnique_valueDuplicateForCreate() { + public void testValidateDictTypeUnique_valueDuplicateForCreate() { // 准备参数 String type = randomString(); // mock 数据 dictTypeMapper.insert(randomDictTypeDO(o -> o.setType(type))); // 调用,校验异常 - assertServiceException(() -> dictTypeService.checkDictTypeUnique(null, type), + assertServiceException(() -> dictTypeService.validateDictTypeUnique(null, type), DICT_TYPE_TYPE_DUPLICATE); } @Test - public void testCheckDictTypeUnique_valueDuplicateForUpdate() { + public void testValidateDictTypeUnique_valueDuplicateForUpdate() { // 准备参数 Long id = randomLongId(); String type = randomString(); @@ -224,30 +256,30 @@ public class DictTypeServiceTest extends BaseDbUnitTest { dictTypeMapper.insert(randomDictTypeDO(o -> o.setType(type))); // 调用,校验异常 - assertServiceException(() -> dictTypeService.checkDictTypeUnique(id, type), + assertServiceException(() -> dictTypeService.validateDictTypeUnique(id, type), DICT_TYPE_TYPE_DUPLICATE); } @Test - public void testCheckDictTypNameUnique_success() { + public void testValidateDictTypNameUnique_success() { // 调用,成功 - dictTypeService.checkDictTypeNameUnique(randomLongId(), randomString()); + dictTypeService.validateDictTypeNameUnique(randomLongId(), randomString()); } @Test - public void testCheckDictTypeNameUnique_nameDuplicateForCreate() { + public void testValidateDictTypeNameUnique_nameDuplicateForCreate() { // 准备参数 String name = randomString(); // mock 数据 dictTypeMapper.insert(randomDictTypeDO(o -> o.setName(name))); // 调用,校验异常 - assertServiceException(() -> dictTypeService.checkDictTypeNameUnique(null, name), + assertServiceException(() -> dictTypeService.validateDictTypeNameUnique(null, name), DICT_TYPE_NAME_DUPLICATE); } @Test - public void testCheckDictTypeNameUnique_nameDuplicateForUpdate() { + public void testValidateDictTypeNameUnique_nameDuplicateForUpdate() { // 准备参数 Long id = randomLongId(); String name = randomString(); @@ -255,7 +287,7 @@ public class DictTypeServiceTest extends BaseDbUnitTest { dictTypeMapper.insert(randomDictTypeDO(o -> o.setName(name))); // 调用,校验异常 - assertServiceException(() -> dictTypeService.checkDictTypeNameUnique(id, name), + assertServiceException(() -> dictTypeService.validateDictTypeNameUnique(id, name), DICT_TYPE_NAME_DUPLICATE); } diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceTest.java index 163a2cda3..cd5e01307 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/errorcode/ErrorCodeServiceTest.java @@ -2,9 +2,9 @@ package cn.iocoder.yudao.module.system.service.errorcode; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.system.api.errorcode.dto.ErrorCodeAutoGenerateReqDTO; +import cn.iocoder.yudao.module.system.api.errorcode.dto.ErrorCodeRespDTO; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodeExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.errorcode.vo.ErrorCodePageReqVO; @@ -22,7 +22,9 @@ import java.util.List; import java.util.function.Consumer; import static cn.hutool.core.util.RandomUtil.randomEle; +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; @@ -57,7 +59,7 @@ public class ErrorCodeServiceTest extends BaseDbUnitTest { @Test public void testUpdateErrorCode_success() { // mock 数据 - ErrorCodeDO dbErrorCode = randomInfErrorCodeDO(); + ErrorCodeDO dbErrorCode = randomErrorCodeDO(); errorCodeMapper.insert(dbErrorCode);// @Sql: 先插入出一条存在的数据 // 准备参数 ErrorCodeUpdateReqVO reqVO = randomPojo(ErrorCodeUpdateReqVO.class, o -> { @@ -75,7 +77,7 @@ public class ErrorCodeServiceTest extends BaseDbUnitTest { @Test public void testDeleteErrorCode_success() { // mock 数据 - ErrorCodeDO dbErrorCode = randomInfErrorCodeDO(); + ErrorCodeDO dbErrorCode = randomErrorCodeDO(); errorCodeMapper.insert(dbErrorCode);// @Sql: 先插入出一条存在的数据 // 准备参数 Long id = dbErrorCode.getId(); @@ -96,7 +98,7 @@ public class ErrorCodeServiceTest extends BaseDbUnitTest { reqVO.setApplicationName("tu"); reqVO.setCode(1); reqVO.setMessage("ma"); - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2020, 11, 1),buildTime(2020, 11, 30)})); + reqVO.setCreateTime(buildBetweenTime(2020, 11, 1, 2020, 11, 30)); // 调用 PageResult pageResult = errorCodeService.getErrorCodePage(reqVO); @@ -110,7 +112,7 @@ public class ErrorCodeServiceTest extends BaseDbUnitTest { * 初始化 getErrorCodePage 方法的测试数据 */ private ErrorCodeDO initGetErrorCodePage() { - ErrorCodeDO dbErrorCode = randomInfErrorCodeDO(o -> { // 等会查询到 + ErrorCodeDO dbErrorCode = randomErrorCodeDO(o -> { // 等会查询到 o.setType(ErrorCodeTypeEnum.AUTO_GENERATION.getType()); o.setApplicationName("tudou"); o.setCode(1); @@ -119,20 +121,20 @@ public class ErrorCodeServiceTest extends BaseDbUnitTest { }); errorCodeMapper.insert(dbErrorCode); // 测试 type 不匹配 - errorCodeMapper.insert(ObjectUtils.cloneIgnoreId(dbErrorCode, o -> o.setType(ErrorCodeTypeEnum.MANUAL_OPERATION.getType()))); + errorCodeMapper.insert(cloneIgnoreId(dbErrorCode, o -> o.setType(ErrorCodeTypeEnum.MANUAL_OPERATION.getType()))); // 测试 applicationName 不匹配 - errorCodeMapper.insert(ObjectUtils.cloneIgnoreId(dbErrorCode, o -> o.setApplicationName("yuan"))); + errorCodeMapper.insert(cloneIgnoreId(dbErrorCode, o -> o.setApplicationName("yuan"))); // 测试 code 不匹配 - errorCodeMapper.insert(ObjectUtils.cloneIgnoreId(dbErrorCode, o -> o.setCode(2))); + errorCodeMapper.insert(cloneIgnoreId(dbErrorCode, o -> o.setCode(2))); // 测试 message 不匹配 - errorCodeMapper.insert(ObjectUtils.cloneIgnoreId(dbErrorCode, o -> o.setMessage("nai"))); + errorCodeMapper.insert(cloneIgnoreId(dbErrorCode, o -> o.setMessage("nai"))); // 测试 createTime 不匹配 - errorCodeMapper.insert(ObjectUtils.cloneIgnoreId(dbErrorCode, o -> o.setCreateTime(buildTime(2020, 12, 12)))); + errorCodeMapper.insert(cloneIgnoreId(dbErrorCode, o -> o.setCreateTime(buildTime(2020, 12, 12)))); return dbErrorCode; } @Test - public void testGetErrorCodeList() { + public void testGetErrorCodeList_export() { // mock 数据 ErrorCodeDO dbErrorCode = initGetErrorCodePage(); // 准备参数 @@ -141,7 +143,7 @@ public class ErrorCodeServiceTest extends BaseDbUnitTest { reqVO.setApplicationName("tu"); reqVO.setCode(1); reqVO.setMessage("ma"); - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2020, 11, 1),buildTime(2020, 11, 30)})); + reqVO.setCreateTime(buildBetweenTime(2020, 11, 1, 2020, 11, 30)); // 调用 List list = errorCodeService.getErrorCodeList(reqVO); @@ -155,7 +157,7 @@ public class ErrorCodeServiceTest extends BaseDbUnitTest { // 准备参数 Integer code = randomInteger(); // mock 数据 - errorCodeMapper.insert(randomInfErrorCodeDO(o -> o.setCode(code))); + errorCodeMapper.insert(randomErrorCodeDO(o -> o.setCode(code))); // 调用,校验异常 assertServiceException(() -> errorCodeService.validateCodeDuplicate(code, null), @@ -168,7 +170,7 @@ public class ErrorCodeServiceTest extends BaseDbUnitTest { Long id = randomLongId(); Integer code = randomInteger(); // mock 数据 - errorCodeMapper.insert(randomInfErrorCodeDO(o -> o.setCode(code))); + errorCodeMapper.insert(randomErrorCodeDO(o -> o.setCode(code))); // 调用,校验异常 assertServiceException(() -> errorCodeService.validateCodeDuplicate(code, id), @@ -204,7 +206,7 @@ public class ErrorCodeServiceTest extends BaseDbUnitTest { @Test public void testAutoGenerateErrorCodes_021() { // mock 数据 - ErrorCodeDO dbErrorCode = randomInfErrorCodeDO(o -> o.setType(ErrorCodeTypeEnum.MANUAL_OPERATION.getType())); + ErrorCodeDO dbErrorCode = randomErrorCodeDO(o -> o.setType(ErrorCodeTypeEnum.MANUAL_OPERATION.getType())); errorCodeMapper.insert(dbErrorCode); // 准备参数 ErrorCodeAutoGenerateReqDTO generateReqDTO = randomPojo(ErrorCodeAutoGenerateReqDTO.class, @@ -224,7 +226,7 @@ public class ErrorCodeServiceTest extends BaseDbUnitTest { @Test public void testAutoGenerateErrorCodes_022() { // mock 数据 - ErrorCodeDO dbErrorCode = randomInfErrorCodeDO(o -> o.setType(ErrorCodeTypeEnum.AUTO_GENERATION.getType())); + ErrorCodeDO dbErrorCode = randomErrorCodeDO(o -> o.setType(ErrorCodeTypeEnum.AUTO_GENERATION.getType())); errorCodeMapper.insert(dbErrorCode); // 准备参数 ErrorCodeAutoGenerateReqDTO generateReqDTO = randomPojo(ErrorCodeAutoGenerateReqDTO.class, @@ -244,7 +246,7 @@ public class ErrorCodeServiceTest extends BaseDbUnitTest { @Test public void testAutoGenerateErrorCodes_023() { // mock 数据 - ErrorCodeDO dbErrorCode = randomInfErrorCodeDO(o -> o.setType(ErrorCodeTypeEnum.AUTO_GENERATION.getType())); + ErrorCodeDO dbErrorCode = randomErrorCodeDO(o -> o.setType(ErrorCodeTypeEnum.AUTO_GENERATION.getType())); errorCodeMapper.insert(dbErrorCode); // 准备参数 ErrorCodeAutoGenerateReqDTO generateReqDTO = randomPojo(ErrorCodeAutoGenerateReqDTO.class, @@ -265,7 +267,7 @@ public class ErrorCodeServiceTest extends BaseDbUnitTest { @Test public void testAutoGenerateErrorCodes_024() { // mock 数据 - ErrorCodeDO dbErrorCode = randomInfErrorCodeDO(o -> o.setType(ErrorCodeTypeEnum.AUTO_GENERATION.getType())); + ErrorCodeDO dbErrorCode = randomErrorCodeDO(o -> o.setType(ErrorCodeTypeEnum.AUTO_GENERATION.getType())); errorCodeMapper.insert(dbErrorCode); // 准备参数 ErrorCodeAutoGenerateReqDTO generateReqDTO = randomPojo(ErrorCodeAutoGenerateReqDTO.class, @@ -279,10 +281,44 @@ public class ErrorCodeServiceTest extends BaseDbUnitTest { assertPojoEquals(generateReqDTO, errorCode); } + @Test + public void testGetErrorCode() { + // 准备参数 + ErrorCodeDO errorCodeDO = randomErrorCodeDO(); + errorCodeMapper.insert(errorCodeDO); + // mock 方法 + Long id = errorCodeDO.getId(); + + // 调用 + ErrorCodeDO dbErrorCode = errorCodeService.getErrorCode(id); + // 断言 + assertPojoEquals(errorCodeDO, dbErrorCode); + } + + @Test + public void testGetErrorCodeList() { + // 准备参数 + ErrorCodeDO errorCodeDO01 = randomErrorCodeDO( + o -> o.setApplicationName("yunai_server").setUpdateTime(buildTime(2022, 1, 10))); + errorCodeMapper.insert(errorCodeDO01); + ErrorCodeDO errorCodeDO02 = randomErrorCodeDO( + o -> o.setApplicationName("yunai_server").setUpdateTime(buildTime(2022, 1, 12))); + errorCodeMapper.insert(errorCodeDO02); + // mock 方法 + String applicationName = "yunai_server"; + LocalDateTime minUpdateTime = buildTime(2022, 1, 11); + + // 调用 + List errorCodeList = errorCodeService.getErrorCodeList(applicationName, minUpdateTime); + // 断言 + assertEquals(1, errorCodeList.size()); + assertPojoEquals(errorCodeDO02, errorCodeList.get(0)); + } + // ========== 随机对象 ========== @SafeVarargs - private static ErrorCodeDO randomInfErrorCodeDO(Consumer... consumers) { + private static ErrorCodeDO randomErrorCodeDO(Consumer... consumers) { Consumer consumer = (o) -> { o.setType(randomEle(ErrorCodeTypeEnum.values()).getType()); // 保证 key 的范围 }; diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/logger/LoginLogServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/logger/LoginLogServiceImplTest.java index 101abe7d3..66eebc0bd 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/logger/LoginLogServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/logger/LoginLogServiceImplTest.java @@ -1,29 +1,25 @@ package cn.iocoder.yudao.module.system.service.logger; -import cn.hutool.core.util.RandomUtil; -import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; -import cn.iocoder.yudao.framework.test.core.util.RandomUtils; import cn.iocoder.yudao.module.system.api.logger.dto.LoginLogCreateReqDTO; import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogPageReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.logger.LoginLogDO; import cn.iocoder.yudao.module.system.dal.mysql.logger.LoginLogMapper; -import cn.iocoder.yudao.module.system.enums.logger.LoginLogTypeEnum; import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Import; import javax.annotation.Resource; -import java.time.LocalDateTime; import java.util.List; -import static cn.hutool.core.util.RandomUtil.randomEle; +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.yudao.module.system.enums.logger.LoginResultEnum.*; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; +import static cn.iocoder.yudao.module.system.enums.logger.LoginResultEnum.CAPTCHA_CODE_ERROR; +import static cn.iocoder.yudao.module.system.enums.logger.LoginResultEnum.SUCCESS; import static org.junit.jupiter.api.Assertions.assertEquals; @Import(LoginLogServiceImpl.class) @@ -37,42 +33,31 @@ public class LoginLogServiceImplTest extends BaseDbUnitTest { @Test public void testGetLoginLogPage() { - // 构造测试数据 - // 登录成功的 - LoginLogDO loginLogDO = RandomUtils.randomPojo(LoginLogDO.class, logDO -> { - logDO.setLogType(RandomUtil.randomEle(cn.iocoder.yudao.module.system.enums.logger.LoginLogTypeEnum.values()).getType()); - logDO.setTraceId(TracerUtils.getTraceId()); - logDO.setUserType(RandomUtil.randomEle(UserTypeEnum.values()).getValue()); - - logDO.setUserIp("192.168.199.16"); - logDO.setUsername("wangkai"); - logDO.setCreateTime(buildTime(2021, 3, 6)); - logDO.setResult(SUCCESS.getResult()); + // mock 数据 + LoginLogDO loginLogDO = randomPojo(LoginLogDO.class, o -> { + o.setUserIp("192.168.199.16"); + o.setUsername("wang"); + o.setResult(SUCCESS.getResult()); + o.setCreateTime(buildTime(2021, 3, 6)); }); loginLogMapper.insert(loginLogDO); - - // 下面几个都是不匹配的数据 - // 登录失败的 - loginLogMapper.insert(ObjectUtils.cloneIgnoreId(loginLogDO, logDO -> logDO.setResult(CAPTCHA_CODE_ERROR.getResult()))); - // 不同ip段的 - loginLogMapper.insert(ObjectUtils.cloneIgnoreId(loginLogDO, logDO -> logDO.setUserIp("192.168.128.18"))); - // 不同username - loginLogMapper.insert(ObjectUtils.cloneIgnoreId(loginLogDO, logDO -> logDO.setUsername("yunai"))); - // 构造一个早期时间 2021-02-06 00:00:00 - loginLogMapper.insert(ObjectUtils.cloneIgnoreId(loginLogDO, logDO -> logDO.setCreateTime(buildTime(2021, 2, 6)))); - - + // 测试 status 不匹配 + loginLogMapper.insert(cloneIgnoreId(loginLogDO, o -> o.setResult(CAPTCHA_CODE_ERROR.getResult()))); + // 测试 ip 不匹配 + loginLogMapper.insert(cloneIgnoreId(loginLogDO, o -> o.setUserIp("192.168.128.18"))); + // 测试 username 不匹配 + loginLogMapper.insert(cloneIgnoreId(loginLogDO, o -> o.setUsername("yunai"))); + // 测试 createTime 不匹配 + loginLogMapper.insert(cloneIgnoreId(loginLogDO, o -> o.setCreateTime(buildTime(2021, 2, 6)))); // 构造调用参数 LoginLogPageReqVO reqVO = new LoginLogPageReqVO(); - reqVO.setUsername("wangkai"); + reqVO.setUsername("wang"); reqVO.setUserIp("192.168.199"); reqVO.setStatus(true); - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2021, 3, 5), - buildTime(2021, 3, 7)})); + reqVO.setCreateTime(buildBetweenTime(2021, 3, 5, 2021, 3, 7)); - // 调用service方法 + // 调用 PageResult pageResult = loginLogService.getLoginLogPage(reqVO); - // 断言,只查到了一条符合条件的 assertEquals(1, pageResult.getTotal()); assertEquals(1, pageResult.getList().size()); @@ -81,62 +66,45 @@ public class LoginLogServiceImplTest extends BaseDbUnitTest { @Test public void testGetLoginLogList() { - // 构造测试数据 - - // 登录成功的 - LoginLogDO loginLogDO = RandomUtils.randomPojo(LoginLogDO.class, logDO -> { - logDO.setLogType(RandomUtil.randomEle(cn.iocoder.yudao.module.system.enums.logger.LoginLogTypeEnum.values()).getType()); - logDO.setTraceId(TracerUtils.getTraceId()); - logDO.setUserType(RandomUtil.randomEle(UserTypeEnum.values()).getValue()); - - logDO.setUserIp("192.168.111.16"); - logDO.setUsername("wangxiaokai"); - logDO.setCreateTime(buildTime(2021, 3, 6)); - logDO.setResult(SUCCESS.getResult()); + // mock 数据 + LoginLogDO loginLogDO = randomPojo(LoginLogDO.class, o -> { + o.setUserIp("192.168.199.16"); + o.setUsername("wang"); + o.setResult(SUCCESS.getResult()); + o.setCreateTime(buildTime(2021, 3, 6)); }); loginLogMapper.insert(loginLogDO); - - // 下面几个都是不匹配的数据 - // 登录失败的 - loginLogMapper.insert(ObjectUtils.cloneIgnoreId(loginLogDO, logDO -> logDO.setResult(CAPTCHA_CODE_ERROR.getResult()))); - // 不同ip段的 - loginLogMapper.insert(ObjectUtils.cloneIgnoreId(loginLogDO, logDO -> logDO.setUserIp("192.168.128.18"))); - // 不同username - loginLogMapper.insert(ObjectUtils.cloneIgnoreId(loginLogDO, logDO -> logDO.setUsername("yunai"))); - // 构造一个早期时间 2021-02-06 00:00:00 - loginLogMapper.insert(ObjectUtils.cloneIgnoreId(loginLogDO, logDO -> logDO.setCreateTime(buildTime(2021, 2, 6)))); - + // 测试 status 不匹配 + loginLogMapper.insert(cloneIgnoreId(loginLogDO, o -> o.setResult(CAPTCHA_CODE_ERROR.getResult()))); + // 测试 ip 不匹配 + loginLogMapper.insert(cloneIgnoreId(loginLogDO, o -> o.setUserIp("192.168.128.18"))); + // 测试 username 不匹配 + loginLogMapper.insert(cloneIgnoreId(loginLogDO, o -> o.setUsername("yunai"))); + // 测试 createTime 不匹配 + loginLogMapper.insert(cloneIgnoreId(loginLogDO, o -> o.setCreateTime(buildTime(2021, 2, 6)))); // 构造调用参数 LoginLogExportReqVO reqVO = new LoginLogExportReqVO(); - reqVO.setUsername("wangxiaokai"); - reqVO.setUserIp("192.168.111"); + reqVO.setUsername("wang"); + reqVO.setUserIp("192.168.199"); reqVO.setStatus(true); - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2021, 3, 5), - buildTime(2021, 3, 7)})); + reqVO.setCreateTime(buildBetweenTime(2021, 3, 5, 2021, 3, 7)); // 调用service方法 - List loginLogList = loginLogService.getLoginLogList(reqVO); - + List list = loginLogService.getLoginLogList(reqVO); // 断言 - assertEquals(1, loginLogList.size()); - assertPojoEquals(loginLogDO, loginLogList.get(0)); + assertEquals(1, list.size()); + assertPojoEquals(loginLogDO, list.get(0)); } @Test public void testCreateLoginLog() { - LoginLogCreateReqDTO reqDTO = RandomUtils.randomPojo(LoginLogCreateReqDTO.class, vo -> { - // 指定随机的范围,避免超出范围入库失败 - vo.setUserType(randomEle(UserTypeEnum.values()).getValue()); - vo.setLogType(randomEle(LoginLogTypeEnum.values()).getType()); - vo.setResult(randomEle(values()).getResult()); - vo.setTraceId(TracerUtils.getTraceId()); - }); + LoginLogCreateReqDTO reqDTO = randomPojo(LoginLogCreateReqDTO.class); // 调用 loginLogService.createLoginLog(reqDTO); - // 断言,忽略基本字段 - LoginLogDO sysLoginLogDO = loginLogMapper.selectOne(null); - assertPojoEquals(reqDTO, sysLoginLogDO); + // 断言 + LoginLogDO loginLogDO = loginLogMapper.selectOne(null); + assertPojoEquals(reqDTO, loginLogDO); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImplTest.java index 86be2a8bd..14b007e25 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/logger/OperateLogServiceImplTest.java @@ -5,8 +5,6 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.framework.test.core.util.RandomUtils; @@ -16,20 +14,20 @@ import cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog.Oper import cn.iocoder.yudao.module.system.dal.dataobject.logger.OperateLogDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.dal.mysql.logger.OperateLogMapper; -import cn.iocoder.yudao.module.system.enums.common.SexEnum; import cn.iocoder.yudao.module.system.service.user.AdminUserService; import org.junit.jupiter.api.Test; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import javax.annotation.Resource; -import java.time.LocalDateTime; import java.util.Collections; import java.util.List; import static cn.hutool.core.util.RandomUtil.randomEle; import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST; +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -49,34 +47,28 @@ public class OperateLogServiceImplTest extends BaseDbUnitTest { @Test public void testCreateOperateLogAsync() { - String traceId = TracerUtils.getTraceId(); - OperateLogCreateReqDTO reqVO = RandomUtils.randomPojo(OperateLogCreateReqDTO.class, o -> { - o.setTraceId(traceId); - o.setUserId(randomLongId()); - o.setUserType(randomEle(UserTypeEnum.values()).getValue()); - o.setExts(MapUtil.builder("orderId", randomLongId()).build()); - }); + OperateLogCreateReqDTO reqVO = RandomUtils.randomPojo(OperateLogCreateReqDTO.class, + o -> o.setExts(MapUtil.builder("orderId", randomLongId()).build())); - // 执行service方法 + // 调研 operateLogServiceImpl.createOperateLog(reqVO); - // 断言插入是否正确 - OperateLogDO sysOperateLogDO = operateLogMapper.selectOne("trace_id", traceId); - assertPojoEquals(reqVO, sysOperateLogDO); + // 断言 + OperateLogDO operateLogDO = operateLogMapper.selectOne(null); + assertPojoEquals(reqVO, operateLogDO); } @Test public void testGetOperateLogPage() { - // 构造测试数据 - // 先构造用户 + // mock(用户信息) AdminUserDO user = RandomUtils.randomPojo(AdminUserDO.class, o -> { - o.setNickname("wangkai"); - o.setSex(SexEnum.MALE.getSex()); + o.setNickname("wang"); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); }); - when(userService.getUsersByNickname("wangkai")).thenReturn(Collections.singletonList(user)); + when(userService.getUserListByNickname("wang")).thenReturn(Collections.singletonList(user)); Long userId = user.getId(); + // 构造操作日志 - OperateLogDO sysOperateLogDO = RandomUtils.randomPojo(OperateLogDO.class, o -> { + OperateLogDO operateLogDO = RandomUtils.randomPojo(OperateLogDO.class, o -> { o.setUserId(userId); o.setUserType(randomEle(UserTypeEnum.values()).getValue()); o.setModule("order"); @@ -85,50 +77,46 @@ public class OperateLogServiceImplTest extends BaseDbUnitTest { o.setResultCode(GlobalErrorCodeConstants.SUCCESS.getCode()); o.setExts(MapUtil.builder("orderId", randomLongId()).build()); }); - operateLogMapper.insert(sysOperateLogDO); - - // 下面几个是不匹配的数据 - // 随机 userId - operateLogMapper.insert(ObjectUtils.cloneIgnoreId(sysOperateLogDO, logDO -> logDO.setUserId(userId + 1))); - // module 不同 - operateLogMapper.insert(ObjectUtils.cloneIgnoreId(sysOperateLogDO, logDO -> logDO.setModule("user"))); - // type 不同 - operateLogMapper.insert(ObjectUtils.cloneIgnoreId(sysOperateLogDO, logDO -> logDO.setType(OperateTypeEnum.IMPORT.getType()))); - // createTime 不同 - operateLogMapper.insert(ObjectUtils.cloneIgnoreId(sysOperateLogDO, logDO -> logDO.setStartTime(buildTime(2021, 2, 6)))); - // resultCode 不同 - operateLogMapper.insert(ObjectUtils.cloneIgnoreId(sysOperateLogDO, logDO -> logDO.setResultCode(BAD_REQUEST.getCode()))); + operateLogMapper.insert(operateLogDO); + // 测试 userId 不匹配 + operateLogMapper.insert(cloneIgnoreId(operateLogDO, o -> o.setUserId(userId + 1))); + // 测试 module 不匹配 + operateLogMapper.insert(cloneIgnoreId(operateLogDO, o -> o.setModule("user"))); + // 测试 type 不匹配 + operateLogMapper.insert(cloneIgnoreId(operateLogDO, o -> o.setType(OperateTypeEnum.IMPORT.getType()))); + // 测试 createTime 不匹配 + operateLogMapper.insert(cloneIgnoreId(operateLogDO, o -> o.setStartTime(buildTime(2021, 2, 6)))); + // 测试 resultCode 不匹配 + operateLogMapper.insert(cloneIgnoreId(operateLogDO, o -> o.setResultCode(BAD_REQUEST.getCode()))); // 构造调用参数 OperateLogPageReqVO reqVO = new OperateLogPageReqVO(); - reqVO.setUserNickname("wangkai"); + reqVO.setUserNickname("wang"); reqVO.setModule("order"); reqVO.setType(OperateTypeEnum.CREATE.getType()); - reqVO.setStartTime((new LocalDateTime[]{buildTime(2021, 3, 5), - buildTime(2021, 3, 7)})); + reqVO.setStartTime(buildBetweenTime(2021, 3, 5, 2021, 3, 7)); reqVO.setSuccess(true); - // 调用service方法 + // 调用 PageResult pageResult = operateLogServiceImpl.getOperateLogPage(reqVO); // 断言,只查到了一条符合条件的 assertEquals(1, pageResult.getTotal()); assertEquals(1, pageResult.getList().size()); - assertPojoEquals(sysOperateLogDO, pageResult.getList().get(0)); + assertPojoEquals(operateLogDO, pageResult.getList().get(0)); } @Test public void testGetOperateLogs() { - // 构造测试数据 - // 先构造用户 + // mock(用户信息) AdminUserDO user = RandomUtils.randomPojo(AdminUserDO.class, o -> { - o.setNickname("wangkai"); - o.setSex(SexEnum.MALE.getSex()); + o.setNickname("wang"); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); }); - when(userService.getUsersByNickname("wangkai")).thenReturn(Collections.singletonList(user)); + when(userService.getUserListByNickname("wang")).thenReturn(Collections.singletonList(user)); Long userId = user.getId(); + // 构造操作日志 - OperateLogDO sysOperateLogDO = RandomUtils.randomPojo(OperateLogDO.class, o -> { + OperateLogDO operateLogDO = RandomUtils.randomPojo(OperateLogDO.class, o -> { o.setUserId(userId); o.setUserType(randomEle(UserTypeEnum.values()).getValue()); o.setModule("order"); @@ -137,33 +125,31 @@ public class OperateLogServiceImplTest extends BaseDbUnitTest { o.setResultCode(GlobalErrorCodeConstants.SUCCESS.getCode()); o.setExts(MapUtil.builder("orderId", randomLongId()).build()); }); - operateLogMapper.insert(sysOperateLogDO); - - // 下面几个是不匹配的数据 - // 随机 userId - operateLogMapper.insert(ObjectUtils.cloneIgnoreId(sysOperateLogDO, logDO -> logDO.setUserId(userId + 1))); - // module 不同 - operateLogMapper.insert(ObjectUtils.cloneIgnoreId(sysOperateLogDO, logDO -> logDO.setModule("user"))); - // type 不同 - operateLogMapper.insert(ObjectUtils.cloneIgnoreId(sysOperateLogDO, logDO -> logDO.setType(OperateTypeEnum.IMPORT.getType()))); - // createTime 不同 - operateLogMapper.insert(ObjectUtils.cloneIgnoreId(sysOperateLogDO, logDO -> logDO.setStartTime(buildTime(2021, 2, 6)))); - // resultCode 不同 - operateLogMapper.insert(ObjectUtils.cloneIgnoreId(sysOperateLogDO, logDO -> logDO.setResultCode(BAD_REQUEST.getCode()))); + operateLogMapper.insert(operateLogDO); + // 测试 userId 不匹配 + operateLogMapper.insert(cloneIgnoreId(operateLogDO, o -> o.setUserId(userId + 1))); + // 测试 module 不匹配 + operateLogMapper.insert(cloneIgnoreId(operateLogDO, o -> o.setModule("user"))); + // 测试 type 不匹配 + operateLogMapper.insert(cloneIgnoreId(operateLogDO, o -> o.setType(OperateTypeEnum.IMPORT.getType()))); + // 测试 createTime 不匹配 + operateLogMapper.insert(cloneIgnoreId(operateLogDO, o -> o.setStartTime(buildTime(2021, 2, 6)))); + // 测试 resultCode 不匹配 + operateLogMapper.insert(cloneIgnoreId(operateLogDO, o -> o.setResultCode(BAD_REQUEST.getCode()))); // 构造调用参数 OperateLogExportReqVO reqVO = new OperateLogExportReqVO(); - reqVO.setUserNickname("wangkai"); + reqVO.setUserNickname("wang"); reqVO.setModule("order"); reqVO.setType(OperateTypeEnum.CREATE.getType()); - reqVO.setStartTime((new LocalDateTime[]{buildTime(2021, 3, 5),buildTime(2021, 3, 7)})); + reqVO.setStartTime(buildBetweenTime(2021, 3, 5, 2021, 3, 7)); reqVO.setSuccess(true); // 调用 service 方法 - List list = operateLogServiceImpl.getOperateLogs(reqVO); + List list = operateLogServiceImpl.getOperateLogList(reqVO); // 断言,只查到了一条符合条件的 assertEquals(1, list.size()); - assertPojoEquals(sysOperateLogDO, list.get(0)); + assertPojoEquals(operateLogDO, list.get(0)); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/mail/MailAccountServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/mail/MailAccountServiceImplTest.java index ffca4b1b6..a0e41f75c 100755 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/mail/MailAccountServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/mail/MailAccountServiceImplTest.java @@ -6,7 +6,6 @@ import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccou import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountPageReqVO; import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountUpdateReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; -import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; import cn.iocoder.yudao.module.system.dal.mysql.mail.MailAccountMapper; import cn.iocoder.yudao.module.system.mq.producer.mail.MailProducer; import org.junit.jupiter.api.Test; @@ -14,7 +13,7 @@ import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import javax.annotation.Resource; - +import java.util.List; import java.util.Map; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; @@ -23,7 +22,9 @@ import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServic import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.MAIL_ACCOUNT_NOT_EXISTS; import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; /** * {@link MailAccountServiceImpl} 的单元测试类 @@ -109,6 +110,8 @@ public class MailAccountServiceImplTest extends BaseDbUnitTest { mailAccountMapper.insert(dbMailAccount);// @Sql: 先插入出一条存在的数据 // 准备参数 Long id = dbMailAccount.getId(); + // mock 方法(无关联模版) + when(mailTemplateService.countByAccountId(eq(id))).thenReturn(0L); // 调用 mailAccountService.deleteMailAccount(id); @@ -117,6 +120,21 @@ public class MailAccountServiceImplTest extends BaseDbUnitTest { verify(mailProducer).sendMailAccountRefreshMessage(); } + @Test + public void testGetMailAccountFromCache() { + // mock 数据 + MailAccountDO dbMailAccount = randomPojo(MailAccountDO.class); + mailAccountMapper.insert(dbMailAccount);// @Sql: 先插入出一条存在的数据 + mailAccountService.initLocalCache(); + // 准备参数 + Long id = dbMailAccount.getId(); + + // 调用 + MailAccountDO mailAccount = mailAccountService.getMailAccountFromCache(id); + // 断言 + assertPojoEquals(dbMailAccount, mailAccount); + } + @Test public void testDeleteMailAccount_notExists() { // 准备参数 @@ -151,4 +169,35 @@ public class MailAccountServiceImplTest extends BaseDbUnitTest { assertPojoEquals(dbMailAccount, pageResult.getList().get(0)); } + @Test + public void testGetMailAccount() { + // mock 数据 + MailAccountDO dbMailAccount = randomPojo(MailAccountDO.class); + mailAccountMapper.insert(dbMailAccount);// @Sql: 先插入出一条存在的数据 + // 准备参数 + Long id = dbMailAccount.getId(); + + // 调用 + MailAccountDO mailAccount = mailAccountService.getMailAccount(id); + // 断言 + assertPojoEquals(dbMailAccount, mailAccount); + } + + @Test + public void testGetMailAccountList() { + // mock 数据 + MailAccountDO dbMailAccount01 = randomPojo(MailAccountDO.class); + mailAccountMapper.insert(dbMailAccount01); + MailAccountDO dbMailAccount02 = randomPojo(MailAccountDO.class); + mailAccountMapper.insert(dbMailAccount02); + // 准备参数 + + // 调用 + List list = mailAccountService.getMailAccountList(); + // 断言 + assertEquals(2, list.size()); + assertPojoEquals(dbMailAccount01, list.get(0)); + assertPojoEquals(dbMailAccount02, list.get(1)); + } + } diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/mail/MailLogServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/mail/MailLogServiceImplTest.java index ccf4ba737..53acd0ef0 100755 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/mail/MailLogServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/mail/MailLogServiceImplTest.java @@ -116,6 +116,20 @@ public class MailLogServiceImplTest extends BaseDbUnitTest { assertEquals("NullPointerException: 测试异常", dbLog.getSendException()); } + @Test + public void testGetMailLog() { + // mock 数据 + MailLogDO dbMailLog = randomPojo(MailLogDO.class, o -> o.setTemplateParams(randomTemplateParams())); + mailLogMapper.insert(dbMailLog); + // 准备参数 + Long id = dbMailLog.getId(); + + // 调用 + MailLogDO mailLog = mailLogService.getMailLog(id); + // 断言 + assertPojoEquals(dbMailLog, mailLog); + } + @Test public void testGetMailLogPage() { // mock 数据 diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/mail/MailSendServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/mail/MailSendServiceImplTest.java index e1be7e8d6..911e91c89 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/mail/MailSendServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/mail/MailSendServiceImplTest.java @@ -6,14 +6,20 @@ import cn.hutool.extra.mail.MailUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; +import cn.iocoder.yudao.framework.test.core.util.RandomUtils; import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; +import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; +import cn.iocoder.yudao.module.system.mq.message.mail.MailSendMessage; import cn.iocoder.yudao.module.system.mq.producer.mail.MailProducer; +import cn.iocoder.yudao.module.system.service.member.MemberService; +import cn.iocoder.yudao.module.system.service.user.AdminUserService; import org.assertj.core.util.Lists; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.mockito.InjectMocks; import org.mockito.Mock; +import org.mockito.MockedStatic; import java.util.HashMap; import java.util.Map; @@ -23,6 +29,7 @@ import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServic import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; @@ -31,6 +38,10 @@ class MailSendServiceImplTest extends BaseMockitoUnitTest { @InjectMocks private MailSendServiceImpl mailSendService; + @Mock + private AdminUserService adminUserService; + @Mock + private MemberService memberService; @Mock private MailAccountService mailAccountService; @Mock @@ -55,6 +66,82 @@ class MailSendServiceImplTest extends BaseMockitoUnitTest { System.out.println("发送结果:" + messageId); } + @Test + public void testSendSingleMailToAdmin() { + // 准备参数 + Long userId = randomLongId(); + String templateCode = RandomUtils.randomString(); + Map templateParams = MapUtil.builder().put("code", "1234") + .put("op", "login").build(); + // mock adminUserService 的方法 + AdminUserDO user = randomPojo(AdminUserDO.class, o -> o.setMobile("15601691300")); + when(adminUserService.getUser(eq(userId))).thenReturn(user); + + // mock MailTemplateService 的方法 + MailTemplateDO template = randomPojo(MailTemplateDO.class, o -> { + o.setStatus(CommonStatusEnum.ENABLE.getStatus()); + o.setContent("验证码为{code}, 操作为{op}"); + o.setParams(Lists.newArrayList("code", "op")); + }); + when(mailTemplateService.getMailTemplateByCodeFromCache(eq(templateCode))).thenReturn(template); + String content = RandomUtils.randomString(); + when(mailTemplateService.formatMailTemplateContent(eq(template.getContent()), eq(templateParams))) + .thenReturn(content); + // mock MailAccountService 的方法 + MailAccountDO account = randomPojo(MailAccountDO.class); + when(mailAccountService.getMailAccountFromCache(eq(template.getAccountId()))).thenReturn(account); + // mock MailLogService 的方法 + Long mailLogId = randomLongId(); + when(mailLogService.createMailLog(eq(userId), eq(UserTypeEnum.ADMIN.getValue()), eq(user.getEmail()), + eq(account), eq(template), eq(content), eq(templateParams), eq(true))).thenReturn(mailLogId); + + // 调用 + Long resultMailLogId = mailSendService.sendSingleMailToAdmin(null, userId, templateCode, templateParams); + // 断言 + assertEquals(mailLogId, resultMailLogId); + // 断言调用 + verify(mailProducer).sendMailSendMessage(eq(mailLogId), eq(user.getEmail()), + eq(account.getId()), eq(template.getNickname()), eq(template.getTitle()), eq(content)); + } + + @Test + public void testSendSingleMailToMember() { + // 准备参数 + Long userId = randomLongId(); + String templateCode = RandomUtils.randomString(); + Map templateParams = MapUtil.builder().put("code", "1234") + .put("op", "login").build(); + // mock memberService 的方法 + String mail = randomEmail(); + when(memberService.getMemberUserEmail(eq(userId))).thenReturn(mail); + + // mock MailTemplateService 的方法 + MailTemplateDO template = randomPojo(MailTemplateDO.class, o -> { + o.setStatus(CommonStatusEnum.ENABLE.getStatus()); + o.setContent("验证码为{code}, 操作为{op}"); + o.setParams(Lists.newArrayList("code", "op")); + }); + when(mailTemplateService.getMailTemplateByCodeFromCache(eq(templateCode))).thenReturn(template); + String content = RandomUtils.randomString(); + when(mailTemplateService.formatMailTemplateContent(eq(template.getContent()), eq(templateParams))) + .thenReturn(content); + // mock MailAccountService 的方法 + MailAccountDO account = randomPojo(MailAccountDO.class); + when(mailAccountService.getMailAccountFromCache(eq(template.getAccountId()))).thenReturn(account); + // mock MailLogService 的方法 + Long mailLogId = randomLongId(); + when(mailLogService.createMailLog(eq(userId), eq(UserTypeEnum.MEMBER.getValue()), eq(mail), + eq(account), eq(template), eq(content), eq(templateParams), eq(true))).thenReturn(mailLogId); + + // 调用 + Long resultMailLogId = mailSendService.sendSingleMailToMember(null, userId, templateCode, templateParams); + // 断言 + assertEquals(mailLogId, resultMailLogId); + // 断言调用 + verify(mailProducer).sendMailSendMessage(eq(mailLogId), eq(mail), + eq(account.getId()), eq(template.getNickname()), eq(template.getTitle()), eq(content)); + } + /** * 发送成功,当短信模板开启时 */ @@ -64,7 +151,7 @@ class MailSendServiceImplTest extends BaseMockitoUnitTest { String mail = randomEmail(); Long userId = randomLongId(); Integer userType = randomEle(UserTypeEnum.values()).getValue(); - String templateCode = randomString(); + String templateCode = RandomUtils.randomString(); Map templateParams = MapUtil.builder().put("code", "1234") .put("op", "login").build(); // mock MailTemplateService 的方法 @@ -74,7 +161,7 @@ class MailSendServiceImplTest extends BaseMockitoUnitTest { o.setParams(Lists.newArrayList("code", "op")); }); when(mailTemplateService.getMailTemplateByCodeFromCache(eq(templateCode))).thenReturn(template); - String content = randomString(); + String content = RandomUtils.randomString(); when(mailTemplateService.formatMailTemplateContent(eq(template.getContent()), eq(templateParams))) .thenReturn(content); // mock MailAccountService 的方法 @@ -103,7 +190,7 @@ class MailSendServiceImplTest extends BaseMockitoUnitTest { String mail = randomEmail(); Long userId = randomLongId(); Integer userType = randomEle(UserTypeEnum.values()).getValue(); - String templateCode = randomString(); + String templateCode = RandomUtils.randomString(); Map templateParams = MapUtil.builder().put("code", "1234") .put("op", "login").build(); // mock MailTemplateService 的方法 @@ -113,7 +200,7 @@ class MailSendServiceImplTest extends BaseMockitoUnitTest { o.setParams(Lists.newArrayList("code", "op")); }); when(mailTemplateService.getMailTemplateByCodeFromCache(eq(templateCode))).thenReturn(template); - String content = randomString(); + String content = RandomUtils.randomString(); when(mailTemplateService.formatMailTemplateContent(eq(template.getContent()), eq(templateParams))) .thenReturn(content); // mock MailAccountService 的方法 @@ -134,18 +221,18 @@ class MailSendServiceImplTest extends BaseMockitoUnitTest { } @Test - public void testCheckMailTemplateValid_notExists() { + public void testValidateMailTemplateValid_notExists() { // 准备参数 - String templateCode = randomString(); + String templateCode = RandomUtils.randomString(); // mock 方法 // 调用,并断言异常 - assertServiceException(() -> mailSendService.checkMailTemplateValid(templateCode), + assertServiceException(() -> mailSendService.validateMailTemplate(templateCode), MAIL_TEMPLATE_NOT_EXISTS); } @Test - public void testCheckTemplateParams_paramMiss() { + public void testValidateTemplateParams_paramMiss() { // 准备参数 MailTemplateDO template = randomPojo(MailTemplateDO.class, o -> o.setParams(Lists.newArrayList("code"))); @@ -153,18 +240,80 @@ class MailSendServiceImplTest extends BaseMockitoUnitTest { // mock 方法 // 调用,并断言异常 - assertServiceException(() -> mailSendService.checkTemplateParams(template, templateParams), + assertServiceException(() -> mailSendService.validateTemplateParams(template, templateParams), MAIL_SEND_TEMPLATE_PARAM_MISS, "code"); } @Test - public void testCheckMail_notExists() { + public void testValidateMail_notExists() { // 准备参数 // mock 方法 // 调用,并断言异常 - assertServiceException(() -> mailSendService.checkMail(null), + assertServiceException(() -> mailSendService.validateMail(null), MAIL_SEND_MAIL_NOT_EXISTS); } + @Test + public void testDoSendMail_success() { + try (MockedStatic mailUtilMock = mockStatic(MailUtil.class)) { + // 准备参数 + MailSendMessage message = randomPojo(MailSendMessage.class, o -> o.setNickname("芋艿")); + // mock 方法(获得邮箱账号) + MailAccountDO account = randomPojo(MailAccountDO.class, o -> o.setMail("7685@qq.com")); + when(mailAccountService.getMailAccountFromCache(eq(message.getAccountId()))) + .thenReturn(account); + + // mock 方法(发送邮件) + String messageId = randomString(); + mailUtilMock.when(() -> MailUtil.send(argThat(mailAccount -> { + assertEquals("芋艿 <7685@qq.com>", mailAccount.getFrom()); + assertTrue(mailAccount.isAuth()); + assertEquals(account.getUsername(), mailAccount.getUser()); + assertEquals(account.getPassword(), mailAccount.getPass()); + assertEquals(account.getHost(), mailAccount.getHost()); + assertEquals(account.getPort(), mailAccount.getPort()); + assertEquals(account.getSslEnable(), mailAccount.isSslEnable()); + return true; + }), eq(message.getMail()), eq(message.getTitle()), eq(message.getContent()), eq(true))) + .thenReturn(messageId); + + // 调用 + mailSendService.doSendMail(message); + // 断言 + verify(mailLogService).updateMailSendResult(eq(message.getLogId()), eq(messageId), isNull()); + } + } + + @Test + public void testDoSendMail_exception() { + try (MockedStatic mailUtilMock = mockStatic(MailUtil.class)) { + // 准备参数 + MailSendMessage message = randomPojo(MailSendMessage.class, o -> o.setNickname("芋艿")); + // mock 方法(获得邮箱账号) + MailAccountDO account = randomPojo(MailAccountDO.class, o -> o.setMail("7685@qq.com")); + when(mailAccountService.getMailAccountFromCache(eq(message.getAccountId()))) + .thenReturn(account); + + // mock 方法(发送邮件) + Exception e = new NullPointerException("啦啦啦"); + mailUtilMock.when(() -> MailUtil.send(argThat(mailAccount -> { + assertEquals("芋艿 <7685@qq.com>", mailAccount.getFrom()); + assertTrue(mailAccount.isAuth()); + assertEquals(account.getUsername(), mailAccount.getUser()); + assertEquals(account.getPassword(), mailAccount.getPass()); + assertEquals(account.getHost(), mailAccount.getHost()); + assertEquals(account.getPort(), mailAccount.getPort()); + assertEquals(account.getSslEnable(), mailAccount.isSslEnable()); + return true; + }), eq(message.getMail()), eq(message.getTitle()), eq(message.getContent()), eq(true))) + .thenThrow(e); + + // 调用 + mailSendService.doSendMail(message); + // 断言 + verify(mailLogService).updateMailSendResult(eq(message.getLogId()), isNull(), same(e)); + } + } + } diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/mail/MailTemplateServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/mail/MailTemplateServiceImplTest.java index ab005822b..83f23e92e 100755 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/mail/MailTemplateServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/mail/MailTemplateServiceImplTest.java @@ -6,7 +6,6 @@ import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.MailTemplateCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.MailTemplatePageReqVO; import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.MailTemplateUpdateReqVO; -import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; import cn.iocoder.yudao.module.system.dal.mysql.mail.MailTemplateMapper; import cn.iocoder.yudao.module.system.mq.producer.mail.MailProducer; @@ -15,7 +14,8 @@ import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import javax.annotation.Resource; - +import java.util.HashMap; +import java.util.List; import java.util.Map; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; @@ -27,6 +27,7 @@ import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.MAIL_TEMPLATE_NOT_EXISTS; import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.verify; /** * {@link MailTemplateServiceImpl} 的单元测试类 @@ -72,6 +73,7 @@ public class MailTemplateServiceImplTest extends BaseDbUnitTest { // 校验记录的属性是否正确 MailTemplateDO mailTemplate = mailTemplateMapper.selectById(mailTemplateId); assertPojoEquals(reqVO, mailTemplate); + verify(mailProducer).sendMailTemplateRefreshMessage(); } @Test @@ -89,6 +91,7 @@ public class MailTemplateServiceImplTest extends BaseDbUnitTest { // 校验是否更新正确 MailTemplateDO mailTemplate = mailTemplateMapper.selectById(reqVO.getId()); // 获取最新的 assertPojoEquals(reqVO, mailTemplate); + verify(mailProducer).sendMailTemplateRefreshMessage(); } @Test @@ -110,8 +113,9 @@ public class MailTemplateServiceImplTest extends BaseDbUnitTest { // 调用 mailTemplateService.deleteMailTemplate(id); - // 校验数据不存在了 - assertNull(mailTemplateMapper.selectById(id)); + // 校验数据不存在了 + assertNull(mailTemplateMapper.selectById(id)); + verify(mailProducer).sendMailTemplateRefreshMessage(); } @Test @@ -160,4 +164,77 @@ public class MailTemplateServiceImplTest extends BaseDbUnitTest { assertPojoEquals(dbMailTemplate, pageResult.getList().get(0)); } + @Test + public void testGetMailTemplateList() { + // mock 数据 + MailTemplateDO dbMailTemplate01 = randomPojo(MailTemplateDO.class); + mailTemplateMapper.insert(dbMailTemplate01); + MailTemplateDO dbMailTemplate02 = randomPojo(MailTemplateDO.class); + mailTemplateMapper.insert(dbMailTemplate02); + + // 调用 + List list = mailTemplateService.getMailTemplateList(); + // 断言 + assertEquals(2, list.size()); + assertEquals(dbMailTemplate01, list.get(0)); + assertEquals(dbMailTemplate02, list.get(1)); + } + + @Test + public void testGetMailTemplate() { + // mock 数据 + MailTemplateDO dbMailTemplate = randomPojo(MailTemplateDO.class); + mailTemplateMapper.insert(dbMailTemplate); + // 准备参数 + Long id = dbMailTemplate.getId(); + + // 调用 + MailTemplateDO mailTemplate = mailTemplateService.getMailTemplate(id); + // 断言 + assertPojoEquals(dbMailTemplate, mailTemplate); + } + + @Test + public void testGetMailTemplateByCodeFromCache() { + // mock 数据 + MailTemplateDO dbMailTemplate = randomPojo(MailTemplateDO.class); + mailTemplateMapper.insert(dbMailTemplate); + mailTemplateService.initLocalCache(); + // 准备参数 + String code = dbMailTemplate.getCode(); + + // 调用 + MailTemplateDO mailTemplate = mailTemplateService.getMailTemplateByCodeFromCache(code); + // 断言 + assertPojoEquals(dbMailTemplate, mailTemplate); + } + + @Test + public void testFormatMailTemplateContent() { + // 准备参数 + Map params = new HashMap<>(); + params.put("name", "小红"); + params.put("what", "饭"); + + // 调用,并断言 + assertEquals("小红,你好,饭吃了吗?", + mailTemplateService.formatMailTemplateContent("{name},你好,{what}吃了吗?", params)); + } + + @Test + public void testCountByAccountId() { + // mock 数据 + MailTemplateDO dbMailTemplate = randomPojo(MailTemplateDO.class); + mailTemplateMapper.insert(dbMailTemplate); + // 测试 accountId 不匹配 + mailTemplateMapper.insert(cloneIgnoreId(dbMailTemplate, o -> o.setAccountId(2L))); + // 准备参数 + Long accountId = dbMailTemplate.getAccountId(); + + // 调用 + long count = mailTemplateService.countByAccountId(accountId); + // 断言 + assertEquals(1, count); + } + } diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/notice/NoticeServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/notice/NoticeServiceImplTest.java index a2af9545b..b4727096a 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/notice/NoticeServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/notice/NoticeServiceImplTest.java @@ -2,75 +2,67 @@ package cn.iocoder.yudao.module.system.service.notice; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticeCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticePageReqVO; import cn.iocoder.yudao.module.system.controller.admin.notice.vo.NoticeUpdateReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.notice.NoticeDO; import cn.iocoder.yudao.module.system.dal.mysql.notice.NoticeMapper; -import cn.iocoder.yudao.module.system.enums.notice.NoticeTypeEnum; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Import; import javax.annotation.Resource; -import java.util.function.Consumer; - -import static cn.hutool.core.util.RandomUtil.randomEle; -import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.NOTICE_NOT_FOUND; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.NOTICE_NOT_FOUND; import static org.junit.jupiter.api.Assertions.*; @Import(NoticeServiceImpl.class) class NoticeServiceImplTest extends BaseDbUnitTest { @Resource - private NoticeServiceImpl sysNoticeService; + private NoticeServiceImpl noticeService; @Resource - private NoticeMapper sysNoticeMapper; + private NoticeMapper noticeMapper; @Test - public void testPageNotices_success() { + public void testGetNoticePage_success() { // 插入前置数据 NoticeDO dbNotice = randomPojo(NoticeDO.class, o -> { o.setTitle("尼古拉斯赵四来啦!"); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); - o.setType(randomEle(NoticeTypeEnum.values()).getType()); }); - sysNoticeMapper.insert(dbNotice); - + noticeMapper.insert(dbNotice); // 测试 title 不匹配 - sysNoticeMapper.insert(ObjectUtils.cloneIgnoreId(dbNotice, o -> o.setTitle("尼古拉斯凯奇也来啦!"))); + noticeMapper.insert(cloneIgnoreId(dbNotice, o -> o.setTitle("尼古拉斯凯奇也来啦!"))); // 测试 status 不匹配 - sysNoticeMapper.insert(ObjectUtils.cloneIgnoreId(dbNotice, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); - - - // 查询 + noticeMapper.insert(cloneIgnoreId(dbNotice, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); + // 准备参数 NoticePageReqVO reqVO = new NoticePageReqVO(); reqVO.setTitle("尼古拉斯赵四来啦!"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - PageResult pageResult = sysNoticeService.pageNotices(reqVO); + // 调用 + PageResult pageResult = noticeService.getNoticePage(reqVO); // 验证查询结果经过筛选 assertEquals(1, pageResult.getTotal()); assertEquals(1, pageResult.getList().size()); assertPojoEquals(dbNotice, pageResult.getList().get(0)); - } @Test public void testGetNotice_success() { // 插入前置数据 - NoticeDO dbNotice = randomNoticeDO(); - sysNoticeMapper.insert(dbNotice); + NoticeDO dbNotice = randomPojo(NoticeDO.class); + noticeMapper.insert(dbNotice); // 查询 - NoticeDO notice = sysNoticeService.getNotice(dbNotice.getId()); + NoticeDO notice = noticeService.getNotice(dbNotice.getId()); // 验证插入与读取对象是否一致 assertNotNull(notice); @@ -80,84 +72,59 @@ class NoticeServiceImplTest extends BaseDbUnitTest { @Test public void testCreateNotice_success() { // 准备参数 - NoticeCreateReqVO reqVO = randomNoticeCreateReqVO(); - - // 校验插入是否成功 - Long noticeId = sysNoticeService.createNotice(reqVO); - assertNotNull(noticeId); + NoticeCreateReqVO reqVO = randomPojo(NoticeCreateReqVO.class); + // 调用 + Long noticeId = noticeService.createNotice(reqVO); // 校验插入属性是否正确 - NoticeDO notice = sysNoticeMapper.selectById(noticeId); + assertNotNull(noticeId); + NoticeDO notice = noticeMapper.selectById(noticeId); assertPojoEquals(reqVO, notice); } @Test public void testUpdateNotice_success() { // 插入前置数据 - NoticeDO dbNoticeDO = randomNoticeDO(); - sysNoticeMapper.insert(dbNoticeDO); + NoticeDO dbNoticeDO = randomPojo(NoticeDO.class); + noticeMapper.insert(dbNoticeDO); // 准备更新参数 - NoticeUpdateReqVO reqVO = randomNoticeUpdateReqVO(o -> o.setId(dbNoticeDO.getId())); + NoticeUpdateReqVO reqVO = randomPojo(NoticeUpdateReqVO.class, o -> o.setId(dbNoticeDO.getId())); // 更新 - sysNoticeService.updateNotice(reqVO); - + noticeService.updateNotice(reqVO); // 检验是否更新成功 - NoticeDO notice = sysNoticeMapper.selectById(reqVO.getId()); + NoticeDO notice = noticeMapper.selectById(reqVO.getId()); assertPojoEquals(reqVO, notice); } @Test public void testDeleteNotice_success() { // 插入前置数据 - NoticeDO dbNotice = randomNoticeDO(); - sysNoticeMapper.insert(dbNotice); + NoticeDO dbNotice = randomPojo(NoticeDO.class); + noticeMapper.insert(dbNotice); // 删除 - sysNoticeService.deleteNotice(dbNotice.getId()); + noticeService.deleteNotice(dbNotice.getId()); // 检查是否删除成功 - assertNull(sysNoticeMapper.selectById(dbNotice.getId())); + assertNull(noticeMapper.selectById(dbNotice.getId())); } @Test - public void checkNoticeExists_success() { + public void testValidateNoticeExists_success() { // 插入前置数据 - NoticeDO dbNotice = randomNoticeDO(); - sysNoticeMapper.insert(dbNotice); + NoticeDO dbNotice = randomPojo(NoticeDO.class); + noticeMapper.insert(dbNotice); // 成功调用 - sysNoticeService.checkNoticeExists(dbNotice.getId()); + noticeService.validateNoticeExists(dbNotice.getId()); } @Test - public void checkNoticeExists_noExists() { - assertServiceException(() -> sysNoticeService.checkNoticeExists(randomLongId()), NOTICE_NOT_FOUND); + public void testValidateNoticeExists_noExists() { + assertServiceException(() -> + noticeService.validateNoticeExists(randomLongId()), NOTICE_NOT_FOUND); } - @SafeVarargs - private static NoticeDO randomNoticeDO(Consumer... consumers) { - NoticeDO notice = randomPojo(NoticeDO.class, consumers); - notice.setType(randomEle(NoticeTypeEnum.values()).getType()); - notice.setStatus(CommonStatusEnum.ENABLE.getStatus()); - return notice; - } - - @SafeVarargs - private static NoticeUpdateReqVO randomNoticeUpdateReqVO(Consumer... consumers) { - NoticeUpdateReqVO reqVO = randomPojo(NoticeUpdateReqVO.class, consumers); - reqVO.setType(randomEle(NoticeTypeEnum.values()).getType()); - reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - return reqVO; - } - - private static NoticeCreateReqVO randomNoticeCreateReqVO() { - NoticeCreateReqVO reqVO = randomPojo(NoticeCreateReqVO.class); - reqVO.setType(randomEle(NoticeTypeEnum.values()).getType()); - reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - return reqVO; - } - - } diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/notify/NotifyMessageServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/notify/NotifyMessageServiceImplTest.java index 1087918cc..9e2158da1 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/notify/NotifyMessageServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/notify/NotifyMessageServiceImplTest.java @@ -108,6 +108,20 @@ public class NotifyMessageServiceImplTest extends BaseDbUnitTest { assertPojoEquals(dbNotifyMessage, pageResult.getList().get(0)); } + @Test + public void testGetNotifyMessage() { + // mock 数据 + NotifyMessageDO dbNotifyMessage = randomPojo(NotifyMessageDO.class, + o -> o.setTemplateParams(randomTemplateParams())); + notifyMessageMapper.insert(dbNotifyMessage); + // 准备参数 + Long id = dbNotifyMessage.getId(); + + // 调用 + NotifyMessageDO notifyMessage = notifyMessageService.getNotifyMessage(id); + assertPojoEquals(dbNotifyMessage, notifyMessage); + } + @Test public void testGetMyNotifyMessagePage() { // mock 数据 diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/notify/NotifySendServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/notify/NotifySendServiceImplTest.java index e3ee32853..7c5078330 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/notify/NotifySendServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/notify/NotifySendServiceImplTest.java @@ -4,8 +4,6 @@ import cn.hutool.core.map.MapUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; -import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; -import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyTemplateDO; import org.assertj.core.util.Lists; import org.junit.jupiter.api.Test; @@ -18,7 +16,8 @@ import java.util.Map; import static cn.hutool.core.util.RandomUtil.randomEle; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; -import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.NOTICE_NOT_FOUND; +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.NOTIFY_SEND_TEMPLATE_PARAM_MISS; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; import static org.mockito.ArgumentMatchers.eq; @@ -34,6 +33,62 @@ class NotifySendServiceImplTest extends BaseMockitoUnitTest { @Mock private NotifyMessageService notifyMessageService; + @Test + public void testSendSingleNotifyToAdmin() { + // 准备参数 + Long userId = randomLongId(); + String templateCode = randomString(); + Map templateParams = MapUtil.builder().put("code", "1234") + .put("op", "login").build(); + // mock NotifyTemplateService 的方法 + NotifyTemplateDO template = randomPojo(NotifyTemplateDO.class, o -> { + o.setStatus(CommonStatusEnum.ENABLE.getStatus()); + o.setContent("验证码为{code}, 操作为{op}"); + o.setParams(Lists.newArrayList("code", "op")); + }); + when(notifyTemplateService.getNotifyTemplateByCodeFromCache(eq(templateCode))).thenReturn(template); + String content = randomString(); + when(notifyTemplateService.formatNotifyTemplateContent(eq(template.getContent()), eq(templateParams))) + .thenReturn(content); + // mock NotifyMessageService 的方法 + Long messageId = randomLongId(); + when(notifyMessageService.createNotifyMessage(eq(userId), eq(UserTypeEnum.ADMIN.getValue()), + eq(template), eq(content), eq(templateParams))).thenReturn(messageId); + + // 调用 + Long resultMessageId = notifySendService.sendSingleNotifyToAdmin(userId, templateCode, templateParams); + // 断言 + assertEquals(messageId, resultMessageId); + } + + @Test + public void testSendSingleNotifyToMember() { + // 准备参数 + Long userId = randomLongId(); + String templateCode = randomString(); + Map templateParams = MapUtil.builder().put("code", "1234") + .put("op", "login").build(); + // mock NotifyTemplateService 的方法 + NotifyTemplateDO template = randomPojo(NotifyTemplateDO.class, o -> { + o.setStatus(CommonStatusEnum.ENABLE.getStatus()); + o.setContent("验证码为{code}, 操作为{op}"); + o.setParams(Lists.newArrayList("code", "op")); + }); + when(notifyTemplateService.getNotifyTemplateByCodeFromCache(eq(templateCode))).thenReturn(template); + String content = randomString(); + when(notifyTemplateService.formatNotifyTemplateContent(eq(template.getContent()), eq(templateParams))) + .thenReturn(content); + // mock NotifyMessageService 的方法 + Long messageId = randomLongId(); + when(notifyMessageService.createNotifyMessage(eq(userId), eq(UserTypeEnum.MEMBER.getValue()), + eq(template), eq(content), eq(templateParams))).thenReturn(messageId); + + // 调用 + Long resultMessageId = notifySendService.sendSingleNotifyToMember(userId, templateCode, templateParams); + // 断言 + assertEquals(messageId, resultMessageId); + } + /** * 发送成功,当短信模板开启时 */ @@ -100,7 +155,7 @@ class NotifySendServiceImplTest extends BaseMockitoUnitTest { // mock 方法 // 调用,并断言异常 - assertServiceException(() -> notifySendService.checkNotifyTemplateValid(templateCode), + assertServiceException(() -> notifySendService.validateNotifyTemplate(templateCode), NOTICE_NOT_FOUND); } @@ -113,7 +168,7 @@ class NotifySendServiceImplTest extends BaseMockitoUnitTest { // mock 方法 // 调用,并断言异常 - assertServiceException(() -> notifySendService.checkTemplateParams(template, templateParams), + assertServiceException(() -> notifySendService.validateTemplateParams(template, templateParams), NOTIFY_SEND_TEMPLATE_PARAM_MISS, "code"); } diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/notify/NotifyTemplateServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/notify/NotifyTemplateServiceImplTest.java index 5a6f5a508..28f6f9a38 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/notify/NotifyTemplateServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/notify/NotifyTemplateServiceImplTest.java @@ -14,6 +14,8 @@ import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Map; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; @@ -143,4 +145,44 @@ public class NotifyTemplateServiceImplTest extends BaseDbUnitTest { assertPojoEquals(dbNotifyTemplate, pageResult.getList().get(0)); } + @Test + public void testGetNotifyTemplate() { + // mock 数据 + NotifyTemplateDO dbNotifyTemplate = randomPojo(NotifyTemplateDO.class); + notifyTemplateMapper.insert(dbNotifyTemplate); + // 准备参数 + Long id = dbNotifyTemplate.getId(); + + // 调用 + NotifyTemplateDO notifyTemplate = notifyTemplateService.getNotifyTemplate(id); + // 断言 + assertPojoEquals(dbNotifyTemplate, notifyTemplate); + } + + @Test + public void testGetNotifyTemplateByCodeFromCache() { + // mock 数据 + NotifyTemplateDO dbNotifyTemplate = randomPojo(NotifyTemplateDO.class); + notifyTemplateMapper.insert(dbNotifyTemplate); + notifyTemplateService.initLocalCache(); + // 准备参数 + String code = dbNotifyTemplate.getCode(); + + // 调用 + NotifyTemplateDO notifyTemplate = notifyTemplateService.getNotifyTemplateByCodeFromCache(code); + // 断言 + assertPojoEquals(dbNotifyTemplate, notifyTemplate); + } + + @Test + public void testFormatNotifyTemplateContent() { + // 准备参数 + Map params = new HashMap<>(); + params.put("name", "小红"); + params.put("what", "饭"); + + // 调用,并断言 + assertEquals("小红,你好,饭吃了吗?", + notifyTemplateService.formatNotifyTemplateContent("{name},你好,{what}吃了吗?", params)); + } } diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2ClientServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2ClientServiceImplTest.java index 50401cf97..3a671b0b9 100755 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2ClientServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2ClientServiceImplTest.java @@ -153,6 +153,19 @@ public class OAuth2ClientServiceImplTest extends BaseDbUnitTest { assertServiceException(() -> oauth2ClientService.validateClientIdExists(null, clientId), OAUTH2_CLIENT_EXISTS); } + @Test + public void testGetOAuth2Client() { + // mock 数据 + OAuth2ClientDO clientDO = randomPojo(OAuth2ClientDO.class); + oauth2ClientMapper.insert(clientDO); + // 准备参数 + Long id = clientDO.getId(); + + // 调用,并断言 + OAuth2ClientDO dbClientDO = oauth2ClientService.getOAuth2Client(id); + assertPojoEquals(clientDO, dbClientDO); + } + @Test public void testGetOAuth2ClientPage() { // mock 数据 @@ -203,10 +216,13 @@ public class OAuth2ClientServiceImplTest extends BaseDbUnitTest { null, null, Collections.singleton(randomString()), null), OAUTH2_CLIENT_SCOPE_OVER); assertServiceException(() -> oauth2ClientService.validOAuthClientFromCache("default", null, null, null, "test"), OAUTH2_CLIENT_REDIRECT_URI_NOT_MATCH, "test"); - // 成功调用 + // 成功调用(1:参数完整) OAuth2ClientDO result = oauth2ClientService.validOAuthClientFromCache(client.getClientId(), client.getSecret(), client.getAuthorizedGrantTypes().get(0), client.getScopes(), client.getRedirectUris().get(0)); assertPojoEquals(client, result); + // 成功调用(2:只有 clientId 参数) + result = oauth2ClientService.validOAuthClientFromCache(client.getClientId()); + assertPojoEquals(client, result); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2GrantServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2GrantServiceImplTest.java index 944086671..52c722831 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2GrantServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/oauth2/OAuth2GrantServiceImplTest.java @@ -16,6 +16,7 @@ import java.util.List; import static cn.hutool.core.util.RandomUtil.randomEle; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; +import static java.util.Collections.emptyList; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.when; @@ -134,6 +135,13 @@ public class OAuth2GrantServiceImplTest extends BaseMockitoUnitTest { refreshToken, clientId)); } + @Test + public void testGrantClientCredentials() { + assertThrows(UnsupportedOperationException.class, + () -> oauth2GrantService.grantClientCredentials(randomString(), emptyList()), + "暂时不支持 client_credentials 授权模式"); + } + @Test public void testRevokeToken_clientIdError() { // 准备参数 diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImplTest.java new file mode 100644 index 000000000..d643c5501 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImplTest.java @@ -0,0 +1,407 @@ +package cn.iocoder.yudao.module.system.service.permission; + +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; +import cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu.MenuCreateReqVO; +import cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu.MenuListReqVO; +import cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu.MenuUpdateReqVO; +import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO; +import cn.iocoder.yudao.module.system.dal.mysql.permission.MenuMapper; +import cn.iocoder.yudao.module.system.enums.permission.MenuTypeEnum; +import cn.iocoder.yudao.module.system.mq.producer.permission.MenuProducer; +import cn.iocoder.yudao.module.system.service.tenant.TenantService; +import com.google.common.collect.LinkedListMultimap; +import com.google.common.collect.Multimap; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.context.annotation.Import; + +import javax.annotation.Resource; +import java.util.*; + +import static cn.iocoder.yudao.framework.common.util.collection.SetUtils.asSet; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO.ID_ROOT; +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; +import static java.util.Arrays.asList; +import static java.util.Collections.singletonList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.mockito.ArgumentMatchers.argThat; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.verify; + +@Import(MenuServiceImpl.class) +public class MenuServiceImplTest extends BaseDbUnitTest { + + @Resource + private MenuServiceImpl menuService; + + @Resource + private MenuMapper menuMapper; + + @MockBean + private PermissionService permissionService; + @MockBean + private MenuProducer menuProducer; + @MockBean + private TenantService tenantService; + + @Test + public void testInitLocalCache_success() { + MenuDO menuDO1 = randomPojo(MenuDO.class); + menuMapper.insert(menuDO1); + MenuDO menuDO2 = randomPojo(MenuDO.class); + menuMapper.insert(menuDO2); + + // 调用 + menuService.initLocalCache(); + // 校验 menuCache 缓存 + Map menuCache = menuService.getMenuCache(); + assertEquals(2, menuCache.size()); + assertPojoEquals(menuDO1, menuCache.get(menuDO1.getId())); + assertPojoEquals(menuDO2, menuCache.get(menuDO2.getId())); + // 校验 permissionMenuCache 缓存 + Multimap permissionMenuCache = menuService.getPermissionMenuCache(); + assertEquals(2, permissionMenuCache.size()); + assertPojoEquals(menuDO1, permissionMenuCache.get(menuDO1.getPermission())); + assertPojoEquals(menuDO2, permissionMenuCache.get(menuDO2.getPermission())); + } + + @Test + public void testCreateMenu_success() { + // mock 数据(构造父菜单) + MenuDO menuDO = createMenuDO(MenuTypeEnum.MENU, + "parent", 0L); + menuMapper.insert(menuDO); + Long parentId = menuDO.getId(); + // 准备参数 + MenuCreateReqVO reqVO = randomPojo(MenuCreateReqVO.class, o -> { + o.setParentId(parentId); + o.setName("testSonName"); + o.setType(MenuTypeEnum.MENU.getType()); + }); + Long menuId = menuService.createMenu(reqVO); + + // 校验记录的属性是否正确 + MenuDO dbMenu = menuMapper.selectById(menuId); + assertPojoEquals(reqVO, dbMenu); + // 校验调用 + verify(menuProducer).sendMenuRefreshMessage(); + } + + @Test + public void testUpdateMenu_success() { + // mock 数据(构造父子菜单) + MenuDO sonMenuDO = initParentAndSonMenu(); + Long sonId = sonMenuDO.getId(); + // 准备参数 + MenuUpdateReqVO reqVO = randomPojo(MenuUpdateReqVO.class, o -> { + o.setId(sonId); + o.setName("testSonName"); // 修改名字 + o.setParentId(sonMenuDO.getParentId()); + o.setType(MenuTypeEnum.MENU.getType()); + }); + + // 调用 + menuService.updateMenu(reqVO); + // 校验记录的属性是否正确 + MenuDO dbMenu = menuMapper.selectById(sonId); + assertPojoEquals(reqVO, dbMenu); + // 校验调用 + verify(menuProducer).sendMenuRefreshMessage(); + } + + @Test + public void testUpdateMenu_sonIdNotExist() { + // 准备参数 + MenuUpdateReqVO reqVO = randomPojo(MenuUpdateReqVO.class); + // 调用,并断言异常 + assertServiceException(() -> menuService.updateMenu(reqVO), MENU_NOT_EXISTS); + } + + @Test + public void testDeleteMenu_success() { + // mock 数据 + MenuDO menuDO = randomPojo(MenuDO.class); + menuMapper.insert(menuDO); + // 准备参数 + Long id = menuDO.getId(); + + // 调用 + menuService.deleteMenu(id); + // 断言 + MenuDO dbMenuDO = menuMapper.selectById(id); + assertNull(dbMenuDO); + verify(permissionService).processMenuDeleted(id); + verify(menuProducer).sendMenuRefreshMessage(); + } + + @Test + public void testDeleteMenu_menuNotExist() { + assertServiceException(() -> menuService.deleteMenu(randomLongId()), + MENU_NOT_EXISTS); + } + + @Test + public void testDeleteMenu_existChildren() { + // mock 数据(构造父子菜单) + MenuDO sonMenu = initParentAndSonMenu(); + // 准备参数 + Long parentId = sonMenu.getParentId(); + + // 调用并断言异常 + assertServiceException(() -> menuService.deleteMenu(parentId), MENU_EXISTS_CHILDREN); + } + + @Test + public void testGetMenuList_all() { + // mock 数据 + MenuDO menu100 = randomPojo(MenuDO.class); + menuMapper.insert(menu100); + MenuDO menu101 = randomPojo(MenuDO.class); + menuMapper.insert(menu101); + // 准备参数 + + // 调用 + List list = menuService.getMenuList(); + // 断言 + assertEquals(2, list.size()); + assertPojoEquals(menu100, list.get(0)); + assertPojoEquals(menu101, list.get(1)); + } + + @Test + public void testGetMenuList() { + // mock 数据 + MenuDO menuDO = randomPojo(MenuDO.class, o -> o.setName("芋艿").setStatus(CommonStatusEnum.ENABLE.getStatus())); + menuMapper.insert(menuDO); + // 测试 status 不匹配 + menuMapper.insert(cloneIgnoreId(menuDO, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); + // 测试 name 不匹配 + menuMapper.insert(cloneIgnoreId(menuDO, o -> o.setName("艿"))); + // 准备参数 + MenuListReqVO reqVO = new MenuListReqVO().setName("芋").setStatus(CommonStatusEnum.ENABLE.getStatus()); + + // 调用 + List result = menuService.getMenuList(reqVO); + // 断言 + assertEquals(1, result.size()); + assertPojoEquals(menuDO, result.get(0)); + } + + @Test + public void testGetMenuListByTenant() { + // mock 数据 + MenuDO menu100 = randomPojo(MenuDO.class, o -> o.setId(100L).setStatus(CommonStatusEnum.ENABLE.getStatus())); + menuMapper.insert(menu100); + MenuDO menu101 = randomPojo(MenuDO.class, o -> o.setId(101L).setStatus(CommonStatusEnum.DISABLE.getStatus())); + menuMapper.insert(menu101); + MenuDO menu102 = randomPojo(MenuDO.class, o -> o.setId(102L).setStatus(CommonStatusEnum.ENABLE.getStatus())); + menuMapper.insert(menu102); + // mock 过滤菜单 + Set menuIds = asSet(100L, 101L); + doNothing().when(tenantService).handleTenantMenu(argThat(handler -> { + handler.handle(menuIds); + return true; + })); + // 准备参数 + MenuListReqVO reqVO = new MenuListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus()); + + // 调用 + List result = menuService.getMenuListByTenant(reqVO); + // 断言 + assertEquals(1, result.size()); + assertPojoEquals(menu100, result.get(0)); + } + + @Test + public void testListMenusFromCache_withoutId() { + // mock 缓存 + Map menuCache = new HashMap<>(); + // 可被匹配 + MenuDO menuDO = randomPojo(MenuDO.class, o -> o.setId(1L) + .setType(MenuTypeEnum.MENU.getType()).setStatus(CommonStatusEnum.ENABLE.getStatus())); + menuCache.put(menuDO.getId(), menuDO); + // 测试 type 不匹配 + menuCache.put(3L, randomPojo(MenuDO.class, o -> o.setId(3L) + .setType(MenuTypeEnum.BUTTON.getType()).setStatus(CommonStatusEnum.ENABLE.getStatus()))); + // 测试 status 不匹配 + menuCache.put(4L, randomPojo(MenuDO.class, o -> o.setId(4L) + .setType(MenuTypeEnum.MENU.getType()).setStatus(CommonStatusEnum.DISABLE.getStatus()))); + menuService.setMenuCache(menuCache); + // 准备参数 + Collection menuTypes = singletonList(MenuTypeEnum.MENU.getType()); + Collection menusStatuses = singletonList(CommonStatusEnum.ENABLE.getStatus()); + + // 调用 + List list = menuService.getMenuListFromCache(menuTypes, menusStatuses); + // 断言 + assertEquals(1, list.size()); + assertPojoEquals(menuDO, list.get(0)); + } + + @Test + public void testListMenusFromCache_withId() { + // mock 缓存 + Map menuCache = new HashMap<>(); + // 可被匹配 + MenuDO menuDO = randomPojo(MenuDO.class, o -> o.setId(1L) + .setType(MenuTypeEnum.MENU.getType()).setStatus(CommonStatusEnum.ENABLE.getStatus())); + menuCache.put(menuDO.getId(), menuDO); + // 测试 id 不匹配 + menuCache.put(2L, randomPojo(MenuDO.class, o -> o.setId(2L) + .setType(MenuTypeEnum.MENU.getType()).setStatus(CommonStatusEnum.ENABLE.getStatus()))); + // 测试 type 不匹配 + menuCache.put(3L, randomPojo(MenuDO.class, o -> o.setId(3L) + .setType(MenuTypeEnum.BUTTON.getType()).setStatus(CommonStatusEnum.ENABLE.getStatus()))); + // 测试 status 不匹配 + menuCache.put(4L, randomPojo(MenuDO.class, o -> o.setId(4L) + .setType(MenuTypeEnum.MENU.getType()).setStatus(CommonStatusEnum.DISABLE.getStatus()))); + menuService.setMenuCache(menuCache); + // 准备参数 + Collection menuIds = asList(1L, 3L, 4L); + Collection menuTypes = singletonList(MenuTypeEnum.MENU.getType()); + Collection menusStatuses = singletonList(CommonStatusEnum.ENABLE.getStatus()); + + // 调用 + List list = menuService.getMenuListFromCache(menuIds, menuTypes, menusStatuses); + // 断言 + assertEquals(1, list.size()); + assertPojoEquals(menuDO, list.get(0)); + } + + @Test + public void testGetMenuListByPermissionFromCache() { + // mock 缓存 + Multimap permissionMenuCache = LinkedListMultimap.create(); + // 可被匹配 + MenuDO menuDO01 = randomPojo(MenuDO.class, o -> o.setId(1L).setPermission("123")); + permissionMenuCache.put(menuDO01.getPermission(), menuDO01); + MenuDO menuDO02 = randomPojo(MenuDO.class, o -> o.setId(2L).setPermission("123")); + permissionMenuCache.put(menuDO02.getPermission(), menuDO02); + // 不可匹配 + permissionMenuCache.put("456", randomPojo(MenuDO.class, o -> o.setId(3L).setPermission("456"))); + menuService.setPermissionMenuCache(permissionMenuCache); + // 准备参数 + String permission = "123"; + + // 调用 + List list = menuService.getMenuListByPermissionFromCache(permission); + // 断言 + assertEquals(2, list.size()); + assertPojoEquals(menuDO01, list.get(0)); + assertPojoEquals(menuDO02, list.get(1)); + } + + @Test + public void testGetMenu() { + // mock 数据 + MenuDO menu = randomPojo(MenuDO.class); + menuMapper.insert(menu); + // 准备参数 + Long id = menu.getId(); + + // 调用 + MenuDO dbMenu = menuService.getMenu(id); + // 断言 + assertPojoEquals(menu, dbMenu); + } + + @Test + public void testValidateParentMenu_success() { + // mock 数据 + MenuDO menuDO = createMenuDO(MenuTypeEnum.MENU, "parent", 0L); + menuMapper.insert(menuDO); + // 准备参数 + Long parentId = menuDO.getId(); + + // 调用,无需断言 + menuService.validateParentMenu(parentId, null); + } + + @Test + public void testValidateParentMenu_canNotSetSelfToBeParent() { + // 调用,并断言异常 + assertServiceException(() -> menuService.validateParentMenu(1L, 1L), + MENU_PARENT_ERROR); + } + + @Test + public void testValidateParentMenu_parentNotExist() { + // 调用,并断言异常 + assertServiceException(() -> menuService.validateParentMenu(randomLongId(), null), + MENU_PARENT_NOT_EXISTS); + } + + @Test + public void testValidateParentMenu_parentTypeError() { + // mock 数据 + MenuDO menuDO = createMenuDO(MenuTypeEnum.BUTTON, "parent", 0L); + menuMapper.insert(menuDO); + // 准备参数 + Long parentId = menuDO.getId(); + + // 调用,并断言异常 + assertServiceException(() -> menuService.validateParentMenu(parentId, null), + MENU_PARENT_NOT_DIR_OR_MENU); + } + + @Test + public void testValidateMenu_success() { + // mock 父子菜单 + MenuDO sonMenu = initParentAndSonMenu(); + // 准备参数 + Long parentId = sonMenu.getParentId(); + Long otherSonMenuId = randomLongId(); + String otherSonMenuName = randomString(); + + // 调用,无需断言 + menuService.validateMenu(parentId, otherSonMenuName, otherSonMenuId); + } + + @Test + public void testValidateMenu_sonMenuNameDuplicate() { + // mock 父子菜单 + MenuDO sonMenu = initParentAndSonMenu(); + // 准备参数 + Long parentId = sonMenu.getParentId(); + Long otherSonMenuId = randomLongId(); + String otherSonMenuName = sonMenu.getName(); //相同名称 + + // 调用,并断言异常 + assertServiceException(() -> menuService.validateMenu(parentId, otherSonMenuName, otherSonMenuId), + MENU_NAME_DUPLICATE); + } + + // ====================== 初始化方法 ====================== + + /** + * 构造父子菜单,返回子菜单 + * + * @return 子菜单 + */ + private MenuDO initParentAndSonMenu() { + // 构造父子菜单 + MenuDO parentMenuDO = createMenuDO(MenuTypeEnum.MENU, "parent", ID_ROOT); + menuMapper.insert(parentMenuDO); + // 构建子菜单 + MenuDO sonMenuDO = createMenuDO(MenuTypeEnum.MENU, "testSonName", + parentMenuDO.getParentId()); + menuMapper.insert(sonMenuDO); + return sonMenuDO; + } + + private MenuDO createMenuDO(MenuTypeEnum type, String name, Long parentId) { + return createMenuDO(type, name, parentId, randomCommonStatus()); + } + + private MenuDO createMenuDO(MenuTypeEnum type, String name, Long parentId, Integer status) { + return randomPojo(MenuDO.class, o -> o.setId(null).setName(name).setParentId(parentId) + .setType(type.getType()).setStatus(status)); + } + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceTest.java deleted file mode 100644 index eae4633b1..000000000 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceTest.java +++ /dev/null @@ -1,384 +0,0 @@ -package cn.iocoder.yudao.module.system.service.permission; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.lang.Assert; -import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; -import cn.iocoder.yudao.framework.common.util.spring.SpringAopUtils; -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; -import cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu.MenuCreateReqVO; -import cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu.MenuListReqVO; -import cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu.MenuUpdateReqVO; -import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO; -import cn.iocoder.yudao.module.system.dal.mysql.permission.MenuMapper; -import cn.iocoder.yudao.module.system.enums.permission.MenuTypeEnum; -import cn.iocoder.yudao.module.system.mq.producer.permission.MenuProducer; -import cn.iocoder.yudao.module.system.service.tenant.TenantService; -import com.google.common.collect.Multimap; -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.context.annotation.Import; - -import javax.annotation.Resource; -import java.util.*; - -import static cn.iocoder.yudao.framework.common.util.collection.SetUtils.asSet; -import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; -import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.ArgumentMatchers.argThat; -import static org.mockito.Mockito.doNothing; -import static org.mockito.Mockito.verify; - -// TODO @芋艿:单测的代码质量可以提升下 -@Import(MenuServiceImpl.class) -public class MenuServiceTest extends BaseDbUnitTest { - - @Resource - private MenuServiceImpl menuService; - - @Resource - private MenuMapper menuMapper; - - @MockBean - private PermissionService permissionService; - @MockBean - private MenuProducer menuProducer; - @MockBean - private TenantService tenantService; - - @Test - public void testInitLocalCache_success() { - MenuDO menuDO1 = randomPojo(MenuDO.class); - menuMapper.insert(menuDO1); - MenuDO menuDO2 = randomPojo(MenuDO.class); - menuMapper.insert(menuDO2); - - // 调用 - menuService.initLocalCache(); - // 校验 menuCache 缓存 - Map menuCache = menuService.getMenuCache(); - Assert.isTrue(menuCache.size() == 2); - assertPojoEquals(menuDO1, menuCache.get(menuDO1.getId())); - assertPojoEquals(menuDO2, menuCache.get(menuDO2.getId())); - // 校验 permissionMenuCache 缓存 - Multimap permissionMenuCache = menuService.getPermissionMenuCache(); - Assert.isTrue(permissionMenuCache.size() == 2); - assertPojoEquals(menuDO1, permissionMenuCache.get(menuDO1.getPermission())); - assertPojoEquals(menuDO2, permissionMenuCache.get(menuDO2.getPermission())); - } - - @Test - public void testCreateMenu_success() { - //构造父目录 - MenuDO menuDO = createMenuDO(MenuTypeEnum.MENU, "parent", 0L); - menuMapper.insert(menuDO); - Long parentId = menuDO.getId(); - - //调用 - MenuCreateReqVO vo = randomPojo(MenuCreateReqVO.class, o -> { - o.setParentId(parentId); - o.setName("testSonName"); - o.setType(MenuTypeEnum.MENU.getType()); - o.setStatus(randomCommonStatus()); - }); - Long menuId = menuService.createMenu(vo); - - //断言 - assertNotNull(menuId); - // 校验记录的属性是否正确 - MenuDO ret = menuMapper.selectById(menuId); - assertPojoEquals(vo, ret); - // 校验调用 - verify(menuProducer).sendMenuRefreshMessage(); - } - - @Test - public void testUpdateMenu_success() { - //构造父子目录 - MenuDO sonMenuDO = initParentAndSonMenuDO(); - Long sonId = sonMenuDO.getId(); - Long parentId = sonMenuDO.getParentId(); - - //调用 - MenuUpdateReqVO vo = randomPojo(MenuUpdateReqVO.class, o -> { - o.setId(sonId); - o.setParentId(parentId); - o.setType(MenuTypeEnum.MENU.getType()); - o.setStatus(randomCommonStatus()); - o.setName("pppppp"); //修改名字 - }); - menuService.updateMenu(vo); - - //断言 - // 校验记录的属性是否正确 - MenuDO ret = menuMapper.selectById(sonId); - assertPojoEquals(vo, ret); - // 校验调用 - verify(menuProducer).sendMenuRefreshMessage(); - } - - @Test - public void testUpdateMenu_sonIdNotExist() { - Long sonId = 99999L; - Long parentId = 10000L; - - //调用 - MenuUpdateReqVO vo = randomPojo(MenuUpdateReqVO.class, o -> { - o.setId(sonId); - o.setParentId(parentId); - o.setType(MenuTypeEnum.MENU.getType()); - o.setStatus(randomCommonStatus()); - }); - //断言 - assertServiceException(() -> menuService.updateMenu(vo), MENU_NOT_EXISTS); - } - - @Test - public void testDeleteMenu_success() { - MenuDO sonMenuDO = initParentAndSonMenuDO(); - Long sonId = sonMenuDO.getId(); - - // 调用 - menuService.deleteMenu(sonId); - - // 断言 - MenuDO menuDO = menuMapper.selectById(sonId); - assertNull(menuDO); - verify(permissionService).processMenuDeleted(sonId); - verify(menuProducer).sendMenuRefreshMessage(); - } - - @Test - public void testDeleteMenu_menuNotExist() { - Long sonId = 99999L; - - assertServiceException(() -> menuService.deleteMenu(sonId), MENU_NOT_EXISTS); - } - - @Test - public void testDeleteMenu_existChildren() { - MenuDO sonMenu = initParentAndSonMenuDO(); - Long parentId = sonMenu.getParentId(); - - assertServiceException(() -> menuService.deleteMenu(parentId), MENU_EXISTS_CHILDREN); - } - - @Test - public void testGetMenus() { - // mock 数据 - MenuDO menu100 = randomPojo(MenuDO.class, o -> o.setId(100L).setStatus(CommonStatusEnum.ENABLE.getStatus())); - menuMapper.insert(menu100); - MenuDO menu101 = randomPojo(MenuDO.class, o -> o.setId(101L).setStatus(CommonStatusEnum.DISABLE.getStatus())); - menuMapper.insert(menu101); - // 准备参数 - MenuListReqVO reqVO = new MenuListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus()); - - // 调用 - List result = menuService.getMenus(reqVO); - // 断言 - assertEquals(1, result.size()); - assertPojoEquals(menu100, result.get(0)); - } - - @Test - public void testTenantMenus() { - // mock 数据 - MenuDO menu100 = randomPojo(MenuDO.class, o -> o.setId(100L).setStatus(CommonStatusEnum.ENABLE.getStatus())); - menuMapper.insert(menu100); - MenuDO menu101 = randomPojo(MenuDO.class, o -> o.setId(101L).setStatus(CommonStatusEnum.DISABLE.getStatus())); - menuMapper.insert(menu101); - MenuDO menu102 = randomPojo(MenuDO.class, o -> o.setId(102L).setStatus(CommonStatusEnum.ENABLE.getStatus())); - menuMapper.insert(menu102); - // mock 过滤菜单 - // mock 账户额度充足 - Set menuIds = asSet(100L, 101L); - doNothing().when(tenantService).handleTenantMenu(argThat(handler -> { - handler.handle(menuIds); - return true; - })); - // 准备参数 - MenuListReqVO reqVO = new MenuListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus()); - - // 调用 - List result = menuService.getTenantMenus(reqVO); - // 断言 - assertEquals(1, result.size()); - assertPojoEquals(menu100, result.get(0)); - } - - @Test - public void testGetMenusReqVo_success() { - Map idMenuMap = new HashMap<>(); - // 用于验证可以模糊搜索名称包含"name",状态为1的menu - MenuDO menu = createMenuDO(MenuTypeEnum.MENU, "name2", 0L, 1); - menuMapper.insert(menu); - idMenuMap.put(menu.getId(), menu); - - menu = createMenuDO(MenuTypeEnum.MENU, "11name111", 0L, 1); - menuMapper.insert(menu); - idMenuMap.put(menu.getId(), menu); - - menu = createMenuDO(MenuTypeEnum.MENU, "name", 0L, 1); - menuMapper.insert(menu); - idMenuMap.put(menu.getId(), menu); - - // 以下是不符合搜索条件的的menu - menu = createMenuDO(MenuTypeEnum.MENU, "xxxxxx", 0L, 1); - menuMapper.insert(menu); - menu = createMenuDO(MenuTypeEnum.MENU, "name", 0L, 2); - menuMapper.insert(menu); - - // 调用 - MenuListReqVO reqVO = new MenuListReqVO(); - reqVO.setStatus(1); - reqVO.setName("name"); - List menuDOS = menuService.getMenus(reqVO); - - // 断言 - assertEquals(menuDOS.size(), idMenuMap.size()); - menuDOS.forEach(m -> assertPojoEquals(idMenuMap.get(m.getId()), m)); - } - - @Test - public void testListMenusFromCache_success() throws Exception { - Map mockCacheMap = new HashMap<>(); - // 获取代理对象 - MenuServiceImpl target = (MenuServiceImpl) SpringAopUtils.getTarget(menuService); - BeanUtil.setFieldValue(target, "menuCache", mockCacheMap); - - Map idMenuMap = new HashMap<>(); - // 用于验证搜索类型为MENU,状态为1的menu - MenuDO menuDO = createMenuDO(1L, MenuTypeEnum.MENU, "name", 0L, 1); - mockCacheMap.put(menuDO.getId(), menuDO); - idMenuMap.put(menuDO.getId(), menuDO); - - menuDO = createMenuDO(2L, MenuTypeEnum.MENU, "name", 0L, 1); - mockCacheMap.put(menuDO.getId(), menuDO); - idMenuMap.put(menuDO.getId(), menuDO); - - // 以下是不符合搜索条件的menu - menuDO = createMenuDO(3L, MenuTypeEnum.BUTTON, "name", 0L, 1); - mockCacheMap.put(menuDO.getId(), menuDO); - menuDO = createMenuDO(4L, MenuTypeEnum.MENU, "name", 0L, 2); - mockCacheMap.put(menuDO.getId(), menuDO); - - List menuDOS = menuService.getMenuListFromCache(Collections.singletonList(MenuTypeEnum.MENU.getType()), - Collections.singletonList(CommonStatusEnum.DISABLE.getStatus())); - assertEquals(menuDOS.size(), idMenuMap.size()); - menuDOS.forEach(m -> assertPojoEquals(idMenuMap.get(m.getId()), m)); - } - - @Test - public void testListMenusFromCache2_success() throws Exception { - Map mockCacheMap = new HashMap<>(); - // 获取代理对象 - MenuServiceImpl target = (MenuServiceImpl) SpringAopUtils.getTarget(menuService); - BeanUtil.setFieldValue(target, "menuCache", mockCacheMap); - - Map idMenuMap = new HashMap<>(); - // 验证搜索id为1, 类型为MENU, 状态为1 的menu - MenuDO menuDO = createMenuDO(1L, MenuTypeEnum.MENU, "name", 0L, 1); - mockCacheMap.put(menuDO.getId(), menuDO); - idMenuMap.put(menuDO.getId(), menuDO); - - // 以下是不符合搜索条件的menu - menuDO = createMenuDO(2L, MenuTypeEnum.MENU, "name", 0L, 1); - mockCacheMap.put(menuDO.getId(), menuDO); - menuDO = createMenuDO(3L, MenuTypeEnum.BUTTON, "name", 0L, 1); - mockCacheMap.put(menuDO.getId(), menuDO); - menuDO = createMenuDO(4L, MenuTypeEnum.MENU, "name", 0L, 2); - mockCacheMap.put(menuDO.getId(), menuDO); - - List menuDOS = menuService.getMenuListFromCache(Collections.singletonList(1L), - Collections.singletonList(MenuTypeEnum.MENU.getType()), Collections.singletonList(1)); - assertEquals(menuDOS.size(), idMenuMap.size()); - menuDOS.forEach(menu -> assertPojoEquals(idMenuMap.get(menu.getId()), menu)); - } - - @Test - public void testCheckParentResource_success() { - MenuDO menuDO = createMenuDO(MenuTypeEnum.MENU, "parent", 0L); - menuMapper.insert(menuDO); - Long parentId = menuDO.getId(); - - menuService.checkParentResource(parentId, null); - } - - @Test - public void testCheckParentResource_canNotSetSelfToBeParent() { - assertServiceException(() -> menuService.checkParentResource(1L, 1L), MENU_PARENT_ERROR); - } - - @Test - public void testCheckParentResource_parentNotExist() { - assertServiceException(() -> menuService.checkParentResource(randomLongId(), null), MENU_PARENT_NOT_EXISTS); - } - - @Test - public void testCheckParentResource_parentTypeError() { - MenuDO menuDO = createMenuDO(MenuTypeEnum.BUTTON, "parent", 0L); - menuMapper.insert(menuDO); - Long parentId = menuDO.getId(); - - assertServiceException(() -> menuService.checkParentResource(parentId, null), MENU_PARENT_NOT_DIR_OR_MENU); - } - - @Test - public void testCheckResource_success() { - MenuDO sonMenu = initParentAndSonMenuDO(); - Long parentId = sonMenu.getParentId(); - - Long otherSonMenuId = randomLongId(); - String otherSonMenuName = randomString(); - - menuService.checkResource(parentId, otherSonMenuName, otherSonMenuId); - } - - @Test - public void testCheckResource_sonMenuNameDuplicate(){ - MenuDO sonMenu=initParentAndSonMenuDO(); - Long parentId=sonMenu.getParentId(); - - Long otherSonMenuId=randomLongId(); - String otherSonMenuName=sonMenu.getName(); //相同名称 - - assertServiceException(() -> menuService.checkResource(parentId, otherSonMenuName, otherSonMenuId), MENU_NAME_DUPLICATE); - } - - /** - * 构造父子目录,返回子目录 - * - * @return - */ - private MenuDO initParentAndSonMenuDO() { - //构造父子目录 - MenuDO menuDO = createMenuDO(MenuTypeEnum.MENU, "parent", 0L); - menuMapper.insert(menuDO); - Long parentId = menuDO.getId(); - - MenuDO sonMenuDO = createMenuDO(MenuTypeEnum.MENU, "testSonName", parentId); - menuMapper.insert(sonMenuDO); - return sonMenuDO; - } - - private MenuDO createMenuDO(MenuTypeEnum typeEnum, String menuName, Long parentId) { - return createMenuDO(typeEnum, menuName, parentId, randomCommonStatus()); - } - - private MenuDO createMenuDO(MenuTypeEnum typeEnum, String menuName, Long parentId, Integer status) { - return createMenuDO(null, typeEnum, menuName, parentId, status); - } - - private MenuDO createMenuDO(Long id, MenuTypeEnum typeEnum, String menuName, Long parentId, Integer status) { - return randomPojo(MenuDO.class, o -> { - o.setId(id); - o.setParentId(parentId); - o.setType(typeEnum.getType()); - o.setStatus(status); - o.setName(menuName); - }); - } - -} diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceTest.java index afc4c0ced..35b250208 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceTest.java @@ -106,7 +106,7 @@ public class PermissionServiceTest extends BaseDbUnitTest { Collection menusStatuses = asList(0, 1); // mock 方法 List roleList = singletonList(randomPojo(RoleDO.class, o -> o.setId(100L))); - when(roleService.getRolesFromCache(eq(roleIds))).thenReturn(roleList); + when(roleService.getRoleListFromCache(eq(roleIds))).thenReturn(roleList); when(roleService.hasAnySuperAdmin(same(roleList))).thenReturn(true); List menuList = randomPojoList(MenuDO.class); when(menuService.getMenuListFromCache(eq(menuTypes), eq(menusStatuses))).thenReturn(menuList); @@ -163,7 +163,7 @@ public class PermissionServiceTest extends BaseDbUnitTest { // mock 方法 when(roleService.hasAnySuperAdmin(eq(singleton(100L)))).thenReturn(true); List menuList = singletonList(randomPojo(MenuDO.class).setId(1L)); - when(menuService.getMenus()).thenReturn(menuList); + when(menuService.getMenuList()).thenReturn(menuList); // 调用 Set menuIds = permissionService.getRoleMenuIds(roleId); @@ -419,7 +419,7 @@ public class PermissionServiceTest extends BaseDbUnitTest { .setStatus(CommonStatusEnum.ENABLE.getStatus())); when(roleService.getRoleFromCache(eq(100L))).thenReturn(role); // mock 其它方法 - when(roleService.getRolesFromCache(eq(asSet(100L)))).thenReturn(singletonList(role)); + when(roleService.getRoleListFromCache(eq(asSet(100L)))).thenReturn(singletonList(role)); // 调用 boolean has = permissionService.hasAnyRoles(userId, roles); @@ -436,7 +436,7 @@ public class PermissionServiceTest extends BaseDbUnitTest { // mock 获得用户的角色 RoleDO roleDO = randomPojo(RoleDO.class, o -> o.setDataScope(DataScopeEnum.ALL.getScope()) .setStatus(CommonStatusEnum.ENABLE.getStatus())); - when(roleService.getRolesFromCache(eq(singleton(2L)))).thenReturn(singletonList(roleDO)); + when(roleService.getRoleListFromCache(eq(singleton(2L)))).thenReturn(singletonList(roleDO)); when(roleService.getRoleFromCache(eq(2L))).thenReturn(roleDO); // 调用 @@ -456,7 +456,7 @@ public class PermissionServiceTest extends BaseDbUnitTest { // mock 获得用户的角色 RoleDO roleDO = randomPojo(RoleDO.class, o -> o.setDataScope(DataScopeEnum.DEPT_CUSTOM.getScope()) .setStatus(CommonStatusEnum.ENABLE.getStatus())); - when(roleService.getRolesFromCache(eq(singleton(2L)))).thenReturn(singletonList(roleDO)); + when(roleService.getRoleListFromCache(eq(singleton(2L)))).thenReturn(singletonList(roleDO)); when(roleService.getRoleFromCache(eq(2L))).thenReturn(roleDO); // mock 部门的返回 when(userService.getUser(eq(1L))).thenReturn(new AdminUserDO().setDeptId(3L), null, null); // 最后返回 null 的目的,看看会不会重复调用 @@ -480,7 +480,7 @@ public class PermissionServiceTest extends BaseDbUnitTest { // mock 获得用户的角色 RoleDO roleDO = randomPojo(RoleDO.class, o -> o.setDataScope(DataScopeEnum.DEPT_ONLY.getScope()) .setStatus(CommonStatusEnum.ENABLE.getStatus())); - when(roleService.getRolesFromCache(eq(singleton(2L)))).thenReturn(singletonList(roleDO)); + when(roleService.getRoleListFromCache(eq(singleton(2L)))).thenReturn(singletonList(roleDO)); when(roleService.getRoleFromCache(eq(2L))).thenReturn(roleDO); // mock 部门的返回 when(userService.getUser(eq(1L))).thenReturn(new AdminUserDO().setDeptId(3L), null, null); // 最后返回 null 的目的,看看会不会重复调用 @@ -503,13 +503,13 @@ public class PermissionServiceTest extends BaseDbUnitTest { // mock 获得用户的角色 RoleDO roleDO = randomPojo(RoleDO.class, o -> o.setDataScope(DataScopeEnum.DEPT_AND_CHILD.getScope()) .setStatus(CommonStatusEnum.ENABLE.getStatus())); - when(roleService.getRolesFromCache(eq(singleton(2L)))).thenReturn(singletonList(roleDO)); + when(roleService.getRoleListFromCache(eq(singleton(2L)))).thenReturn(singletonList(roleDO)); when(roleService.getRoleFromCache(eq(2L))).thenReturn(roleDO); // mock 部门的返回 when(userService.getUser(eq(1L))).thenReturn(new AdminUserDO().setDeptId(3L), null, null); // 最后返回 null 的目的,看看会不会重复调用 // mock 方法(部门) DeptDO deptDO = randomPojo(DeptDO.class); - when(deptService.getDeptsByParentIdFromCache(eq(3L), eq(true))) + when(deptService.getDeptListByParentIdFromCache(eq(3L), eq(true))) .thenReturn(singletonList(deptDO)); // 调用 @@ -531,7 +531,7 @@ public class PermissionServiceTest extends BaseDbUnitTest { // mock 获得用户的角色 RoleDO roleDO = randomPojo(RoleDO.class, o -> o.setDataScope(DataScopeEnum.SELF.getScope()) .setStatus(CommonStatusEnum.ENABLE.getStatus())); - when(roleService.getRolesFromCache(eq(singleton(2L)))).thenReturn(singletonList(roleDO)); + when(roleService.getRoleListFromCache(eq(singleton(2L)))).thenReturn(singletonList(roleDO)); when(roleService.getRoleFromCache(eq(2L))).thenReturn(roleDO); // 调用 diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceImplTest.java new file mode 100644 index 000000000..a114556c4 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceImplTest.java @@ -0,0 +1,399 @@ +package cn.iocoder.yudao.module.system.service.permission; + +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; +import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleCreateReqVO; +import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleExportReqVO; +import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RolePageReqVO; +import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleUpdateReqVO; +import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; +import cn.iocoder.yudao.module.system.dal.mysql.permission.RoleMapper; +import cn.iocoder.yudao.module.system.enums.permission.DataScopeEnum; +import cn.iocoder.yudao.module.system.enums.permission.RoleTypeEnum; +import cn.iocoder.yudao.module.system.mq.producer.permission.RoleProducer; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.context.annotation.Import; + +import javax.annotation.Resource; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import static cn.hutool.core.util.RandomUtil.randomEle; +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; +import static java.util.Collections.singleton; +import static java.util.Collections.singletonList; +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.verify; + +@Import(RoleServiceImpl.class) +public class RoleServiceImplTest extends BaseDbUnitTest { + + @Resource + private RoleServiceImpl roleService; + + @Resource + private RoleMapper roleMapper; + + @MockBean + private PermissionService permissionService; + @MockBean + private RoleProducer roleProducer; + + @Test + public void testInitLocalCache() { + RoleDO roleDO1 = randomPojo(RoleDO.class); + roleMapper.insert(roleDO1); + RoleDO roleDO2 = randomPojo(RoleDO.class); + roleMapper.insert(roleDO2); + + // 调用 + roleService.initLocalCache(); + // 断言 roleCache 缓存 + Map roleCache = roleService.getRoleCache(); + assertPojoEquals(roleDO1, roleCache.get(roleDO1.getId())); + assertPojoEquals(roleDO2, roleCache.get(roleDO2.getId())); + } + + @Test + public void testCreateRole_success() { + // 准备参数 + RoleCreateReqVO reqVO = randomPojo(RoleCreateReqVO.class); + + // 调用 + Long roleId = roleService.createRole(reqVO, null); + // 断言 + RoleDO roleDO = roleMapper.selectById(roleId); + assertPojoEquals(reqVO, roleDO); + assertEquals(RoleTypeEnum.CUSTOM.getType(), roleDO.getType()); + assertEquals(CommonStatusEnum.ENABLE.getStatus(), roleDO.getStatus()); + assertEquals(DataScopeEnum.ALL.getScope(), roleDO.getDataScope()); + // verify 发送刷新消息 + verify(roleProducer).sendRoleRefreshMessage(); + } + + @Test + public void testUpdateRole_success() { + // mock 数据 + RoleDO roleDO = randomPojo(RoleDO.class, o -> o.setType(RoleTypeEnum.CUSTOM.getType())); + roleMapper.insert(roleDO); + // 准备参数 + Long id = roleDO.getId(); + RoleUpdateReqVO reqVO = randomPojo(RoleUpdateReqVO.class, o -> o.setId(id)); + + // 调用 + roleService.updateRole(reqVO); + // 断言 + RoleDO newRoleDO = roleMapper.selectById(id); + assertPojoEquals(reqVO, newRoleDO); + // verify 发送刷新消息 + verify(roleProducer).sendRoleRefreshMessage(); + } + + @Test + public void testUpdateRoleStatus_success() { + // mock 数据 + RoleDO roleDO = randomPojo(RoleDO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus()) + .setType(RoleTypeEnum.CUSTOM.getType())); + roleMapper.insert(roleDO); + + // 准备参数 + Long roleId = roleDO.getId(); + + // 调用 + roleService.updateRoleStatus(roleId, CommonStatusEnum.DISABLE.getStatus()); + // 断言 + RoleDO dbRoleDO = roleMapper.selectById(roleId); + assertEquals(CommonStatusEnum.DISABLE.getStatus(), dbRoleDO.getStatus()); + // verify 发送刷新消息 + verify(roleProducer).sendRoleRefreshMessage(); + } + + @Test + public void testUpdateRoleDataScope_success() { + // mock 数据 + RoleDO roleDO = randomPojo(RoleDO.class, o -> o.setType(RoleTypeEnum.CUSTOM.getType())); + roleMapper.insert(roleDO); + // 准备参数 + Long id = roleDO.getId(); + Integer dataScope = randomEle(DataScopeEnum.values()).getScope(); + Set dataScopeRoleIds = randomSet(Long.class); + + // 调用 + roleService.updateRoleDataScope(id, dataScope, dataScopeRoleIds); + // 断言 + RoleDO dbRoleDO = roleMapper.selectById(id); + assertEquals(dataScope, dbRoleDO.getDataScope()); + assertEquals(dataScopeRoleIds, dbRoleDO.getDataScopeDeptIds()); + // verify 发送刷新消息 + verify(roleProducer).sendRoleRefreshMessage(); + } + + @Test + public void testDeleteRole_success() { + // mock 数据 + RoleDO roleDO = randomPojo(RoleDO.class, o -> o.setType(RoleTypeEnum.CUSTOM.getType())); + roleMapper.insert(roleDO); + // 参数准备 + Long id = roleDO.getId(); + + // 调用 + roleService.deleteRole(id); + // 断言 + assertNull(roleMapper.selectById(id)); + // verify 删除相关数据 + verify(permissionService).processRoleDeleted(id); + // verify 发送刷新消息 + verify(roleProducer).sendRoleRefreshMessage(); + } + + @Test + public void testGetRoleFromCache() { + // mock 数据(缓存) + RoleDO roleDO = randomPojo(RoleDO.class); + roleMapper.insert(roleDO); + roleService.initLocalCache(); + // 参数准备 + Long id = roleDO.getId(); + + // 调用 + RoleDO dbRoleDO = roleService.getRoleFromCache(id); + // 断言 + assertPojoEquals(roleDO, dbRoleDO); + } + + @Test + public void testGetRole() { + // mock 数据 + RoleDO roleDO = randomPojo(RoleDO.class); + roleMapper.insert(roleDO); + // 参数准备 + Long id = roleDO.getId(); + + // 调用 + RoleDO dbRoleDO = roleService.getRole(id); + // 断言 + assertPojoEquals(roleDO, dbRoleDO); + } + + @Test + public void testGetRoleListByStatus_statusNotEmpty() { + // mock 数据 + RoleDO dbRole = randomPojo(RoleDO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus())); + roleMapper.insert(dbRole); + // 测试 status 不匹配 + roleMapper.insert(cloneIgnoreId(dbRole, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); + + // 调用 + List list = roleService.getRoleListByStatus(singleton(CommonStatusEnum.ENABLE.getStatus())); + // 断言 + assertEquals(1, list.size()); + assertPojoEquals(dbRole, list.get(0)); + } + + @Test + public void testGetRoleListByStatus_statusEmpty() { + // mock 数据 + RoleDO dbRole01 = randomPojo(RoleDO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus())); + roleMapper.insert(dbRole01); + RoleDO dbRole02 = randomPojo(RoleDO.class, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus())); + roleMapper.insert(dbRole02); + + // 调用 + List list = roleService.getRoleListByStatus(null); + // 断言 + assertEquals(2, list.size()); + assertPojoEquals(dbRole01, list.get(0)); + assertPojoEquals(dbRole02, list.get(1)); + } + + @Test + public void testGetRoleListFromCache() { + // mock 数据 + RoleDO dbRole = randomPojo(RoleDO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus())); + roleMapper.insert(dbRole); + // 测试 id 不匹配 + roleMapper.insert(cloneIgnoreId(dbRole, o -> {})); + roleService.initLocalCache(); + // 准备参数 + Collection ids = singleton(dbRole.getId()); + + // 调用 + List list = roleService.getRoleListFromCache(ids); + // 断言 + assertEquals(1, list.size()); + assertPojoEquals(dbRole, list.get(0)); + } + + @Test + public void testGetRoleList() { + // mock 数据 + RoleDO dbRole = randomPojo(RoleDO.class, o -> { // 等会查询到 + o.setName("土豆"); + o.setCode("tudou"); + o.setStatus(CommonStatusEnum.ENABLE.getStatus()); + o.setCreateTime(buildTime(2022, 2, 8)); + }); + roleMapper.insert(dbRole); + // 测试 name 不匹配 + roleMapper.insert(cloneIgnoreId(dbRole, o -> o.setName("红薯"))); + // 测试 code 不匹配 + roleMapper.insert(cloneIgnoreId(dbRole, o -> o.setCode("hong"))); + // 测试 createTime 不匹配 + roleMapper.insert(cloneIgnoreId(dbRole, o -> o.setCreateTime(buildTime(2022, 2, 16)))); + // 准备参数 + RoleExportReqVO reqVO = new RoleExportReqVO(); + reqVO.setName("土豆"); + reqVO.setCode("tu"); + reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); + reqVO.setCreateTime(buildBetweenTime(2022, 2, 1, 2022, 2, 12)); + + // 调用 + List list = roleService.getRoleList(reqVO); + // 断言 + assertEquals(1, list.size()); + assertPojoEquals(dbRole, list.get(0)); + } + + @Test + public void testGetRolePage() { + // mock 数据 + RoleDO dbRole = randomPojo(RoleDO.class, o -> { // 等会查询到 + o.setName("土豆"); + o.setCode("tudou"); + o.setStatus(CommonStatusEnum.ENABLE.getStatus()); + o.setCreateTime(buildTime(2022, 2, 8)); + }); + roleMapper.insert(dbRole); + // 测试 name 不匹配 + roleMapper.insert(cloneIgnoreId(dbRole, o -> o.setName("红薯"))); + // 测试 code 不匹配 + roleMapper.insert(cloneIgnoreId(dbRole, o -> o.setCode("hong"))); + // 测试 createTime 不匹配 + roleMapper.insert(cloneIgnoreId(dbRole, o -> o.setCreateTime(buildTime(2022, 2, 16)))); + // 准备参数 + RolePageReqVO reqVO = new RolePageReqVO(); + reqVO.setName("土豆"); + reqVO.setCode("tu"); + reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); + reqVO.setCreateTime(buildBetweenTime(2022, 2, 1, 2022, 2, 12)); + + // 调用 + PageResult pageResult = roleService.getRolePage(reqVO); + // 断言 + assertEquals(1, pageResult.getTotal()); + assertEquals(1, pageResult.getList().size()); + assertPojoEquals(dbRole, pageResult.getList().get(0)); + } + + @Test + public void testHasAnySuperAdmin() { + // 是超级 + assertTrue(roleService.hasAnySuperAdmin(singletonList(randomPojo(RoleDO.class, + o -> o.setCode("super_admin"))))); + // 非超级 + assertFalse(roleService.hasAnySuperAdmin(singletonList(randomPojo(RoleDO.class, + o -> o.setCode("tenant_admin"))))); + } + + @Test + public void testValidateRoleDuplicate_success() { + // 调用,不会抛异常 + roleService.validateRoleDuplicate(randomString(), randomString(), null); + } + + @Test + public void testValidateRoleDuplicate_nameDuplicate() { + // mock 数据 + RoleDO roleDO = randomPojo(RoleDO.class, o -> o.setName("role_name")); + roleMapper.insert(roleDO); + // 准备参数 + String name = "role_name"; + + // 调用,并断言异常 + assertServiceException(() -> roleService.validateRoleDuplicate(name, randomString(), null), + ROLE_NAME_DUPLICATE, name); + } + + @Test + public void testValidateRoleDuplicate_codeDuplicate() { + // mock 数据 + RoleDO roleDO = randomPojo(RoleDO.class, o -> o.setCode("code")); + roleMapper.insert(roleDO); + // 准备参数 + String code = "code"; + + // 调用,并断言异常 + assertServiceException(() -> roleService.validateRoleDuplicate(randomString(), code, null), + ROLE_CODE_DUPLICATE, code); + } + + @Test + public void testValidateUpdateRole_success() { + RoleDO roleDO = randomPojo(RoleDO.class); + roleMapper.insert(roleDO); + // 准备参数 + Long id = roleDO.getId(); + + // 调用,无异常 + roleService.validateRoleForUpdate(id); + } + + @Test + public void testValidateUpdateRole_roleIdNotExist() { + assertServiceException(() -> roleService.validateRoleForUpdate(randomLongId()), ROLE_NOT_EXISTS); + } + + @Test + public void testValidateUpdateRole_systemRoleCanNotBeUpdate() { + RoleDO roleDO = randomPojo(RoleDO.class, o -> o.setType(RoleTypeEnum.SYSTEM.getType())); + roleMapper.insert(roleDO); + // 准备参数 + Long id = roleDO.getId(); + + assertServiceException(() -> roleService.validateRoleForUpdate(id), + ROLE_CAN_NOT_UPDATE_SYSTEM_TYPE_ROLE); + } + + @Test + public void testValidateRoleList_success() { + // mock 数据 + RoleDO roleDO = randomPojo(RoleDO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus())); + roleMapper.insert(roleDO); + // 准备参数 + List ids = singletonList(roleDO.getId()); + + // 调用,无需断言 + roleService.validateRoleList(ids); + } + + @Test + public void testValidateRoleList_notFound() { + // 准备参数 + List ids = singletonList(randomLongId()); + + // 调用, 并断言异常 + assertServiceException(() -> roleService.validateRoleList(ids), ROLE_NOT_EXISTS); + } + + @Test + public void testValidateRoleList_notEnable() { + // mock 数据 + RoleDO RoleDO = randomPojo(RoleDO.class, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus())); + roleMapper.insert(RoleDO); + // 准备参数 + List ids = singletonList(RoleDO.getId()); + + // 调用, 并断言异常 + assertServiceException(() -> roleService.validateRoleList(ids), ROLE_IS_DISABLE, RoleDO.getName()); + } +} diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceTest.java deleted file mode 100644 index a0d6c79a0..000000000 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceTest.java +++ /dev/null @@ -1,301 +0,0 @@ -package cn.iocoder.yudao.module.system.service.permission; - -import cn.hutool.core.util.RandomUtil; -import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; -import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleCreateReqVO; -import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleExportReqVO; -import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RolePageReqVO; -import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleUpdateReqVO; -import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; -import cn.iocoder.yudao.module.system.dal.mysql.permission.RoleMapper; -import cn.iocoder.yudao.module.system.enums.permission.DataScopeEnum; -import cn.iocoder.yudao.module.system.enums.permission.RoleTypeEnum; -import cn.iocoder.yudao.module.system.mq.producer.permission.RoleProducer; -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.context.annotation.Import; - -import javax.annotation.Resource; -import java.time.LocalDateTime; -import java.util.*; - -import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; -import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; -import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; -import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; -import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.verify; - -// TODO @芋艿:单测的代码质量可以提升下 -@Import(RoleServiceImpl.class) -public class RoleServiceTest extends BaseDbUnitTest { - - @Resource - private RoleServiceImpl roleService; - - @Resource - private RoleMapper roleMapper; - - @MockBean - private PermissionService permissionService; - @MockBean - private RoleProducer roleProducer; - - @Test - public void testInitLocalCache() { - RoleDO roleDO1 = randomRole(); - roleMapper.insert(roleDO1); - RoleDO roleDO2 = randomRole(); - roleMapper.insert(roleDO2); - - // 调用 - roleService.initLocalCache(); - // 断言 roleCache 缓存 - Map roleCache = roleService.getRoleCache(); - assertPojoEquals(roleDO1, roleCache.get(roleDO1.getId())); - assertPojoEquals(roleDO2, roleCache.get(roleDO2.getId())); - } - - @Test - public void testCreateRole_success() { - // 准备参数 - RoleCreateReqVO reqVO = randomPojo(RoleCreateReqVO.class); - - // 调用 - Long roleId = roleService.createRole(reqVO, null); - // 断言 - assertNotNull(roleId); - RoleDO roleDO = roleMapper.selectById(roleId); - assertPojoEquals(reqVO, roleDO); - assertEquals(RoleTypeEnum.CUSTOM.getType(), roleDO.getType()); - assertEquals(CommonStatusEnum.ENABLE.getStatus(), roleDO.getStatus()); - assertEquals(DataScopeEnum.ALL.getScope(), roleDO.getDataScope()); - // verify 发送刷新消息 - verify(roleProducer).sendRoleRefreshMessage(); - } - - @Test - public void testUpdateRole_success() { - // mock 数据 - RoleDO roleDO = createRoleDO("role_name", RoleTypeEnum.CUSTOM, DataScopeEnum.ALL); - roleMapper.insert(roleDO); - Long roleId = roleDO.getId(); - - //调用 - RoleUpdateReqVO reqVO = randomPojo(RoleUpdateReqVO.class, o -> { - o.setId(roleId); - o.setCode("role_code"); - o.setName("update_name"); - o.setSort(999); - }); - roleService.updateRole(reqVO); - - //断言 - RoleDO newRoleDO = roleMapper.selectById(roleId); - assertPojoEquals(reqVO, newRoleDO); - - verify(roleProducer).sendRoleRefreshMessage(); - } - - @Test - public void testUpdateRoleStatus_success() { - RoleDO roleDO = createRoleDO("role_name", RoleTypeEnum.CUSTOM, DataScopeEnum.ALL, CommonStatusEnum.ENABLE.getStatus()); - roleMapper.insert(roleDO); - Long roleId = roleDO.getId(); - - //调用 - roleService.updateRoleStatus(roleId, CommonStatusEnum.DISABLE.getStatus()); - - //断言 - RoleDO newRoleDO = roleMapper.selectById(roleId); - assertEquals(CommonStatusEnum.DISABLE.getStatus(), newRoleDO.getStatus()); - - verify(roleProducer).sendRoleRefreshMessage(); - } - - @Test - public void testUpdateRoleDataScope_success() { - RoleDO roleDO = createRoleDO("role_name", RoleTypeEnum.CUSTOM, DataScopeEnum.ALL); - roleMapper.insert(roleDO); - Long roleId = roleDO.getId(); - - //调用 - Set deptIdSet = new HashSet<>(Arrays.asList(1L, 2L, 3L, 4L, 5L)); - roleService.updateRoleDataScope(roleId, DataScopeEnum.DEPT_CUSTOM.getScope(), deptIdSet); - - //断言 - RoleDO newRoleDO = roleMapper.selectById(roleId); - assertEquals(DataScopeEnum.DEPT_CUSTOM.getScope(), newRoleDO.getDataScope()); - - Set newDeptIdSet = newRoleDO.getDataScopeDeptIds(); - assertEquals(deptIdSet.size(), newDeptIdSet.size()); - deptIdSet.stream().forEach(d -> assertTrue(newDeptIdSet.contains(d))); - - verify(roleProducer).sendRoleRefreshMessage(); - } - - @Test - public void testDeleteRole_success() { - RoleDO roleDO = createRoleDO("role_name", RoleTypeEnum.CUSTOM, DataScopeEnum.ALL); - roleMapper.insert(roleDO); - Long roleId = roleDO.getId(); - - //调用 - roleService.deleteRole(roleId); - - //断言 - RoleDO newRoleDO = roleMapper.selectById(roleId); - assertNull(newRoleDO); - - verify(roleProducer).sendRoleRefreshMessage(); - } - - @Test - public void testGetRoles() { - // mock 数据 - RoleDO dbRole = randomPojo(RoleDO.class, o -> { // 等会查询到 - o.setName("土豆"); - o.setCode("tudou"); - o.setStatus(CommonStatusEnum.ENABLE.getStatus()); - o.setCreateTime(buildTime(2022, 2, 8)); - }); - roleMapper.insert(dbRole); - // 测试 name 不匹配 - roleMapper.insert(cloneIgnoreId(dbRole, o -> o.setName("红薯"))); - // 测试 code 不匹配 - roleMapper.insert(cloneIgnoreId(dbRole, o -> o.setCode("hong"))); - // 测试 createTime 不匹配 - roleMapper.insert(cloneIgnoreId(dbRole, o -> o.setCreateTime(buildTime(2022, 2, 16)))); - // 准备参数 - RoleExportReqVO reqVO = new RoleExportReqVO(); - reqVO.setName("土豆"); - reqVO.setCode("tu"); - reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2022, 2, 1),buildTime(2022, 2, 12)})); - - // 调用 - List list = roleService.getRoleList(reqVO); - // 断言 - assertEquals(1, list.size()); - assertPojoEquals(dbRole, list.get(0)); - } - - @Test - public void testGetRolePage() { - // mock 数据 - RoleDO dbRole = randomPojo(RoleDO.class, o -> { // 等会查询到 - o.setName("土豆"); - o.setCode("tudou"); - o.setStatus(CommonStatusEnum.ENABLE.getStatus()); - o.setCreateTime(buildTime(2022, 2, 8)); - }); - roleMapper.insert(dbRole); - // 测试 name 不匹配 - roleMapper.insert(cloneIgnoreId(dbRole, o -> o.setName("红薯"))); - // 测试 code 不匹配 - roleMapper.insert(cloneIgnoreId(dbRole, o -> o.setCode("hong"))); - // 测试 createTime 不匹配 - roleMapper.insert(cloneIgnoreId(dbRole, o -> o.setCreateTime(buildTime(2022, 2, 16)))); - // 准备参数 - RolePageReqVO reqVO = new RolePageReqVO(); - reqVO.setName("土豆"); - reqVO.setCode("tu"); - reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2022, 2, 1),buildTime(2022, 2, 12)})); - - // 调用 - PageResult pageResult = roleService.getRolePage(reqVO); - // 断言 - assertEquals(1, pageResult.getTotal()); - assertEquals(1, pageResult.getList().size()); - assertPojoEquals(dbRole, pageResult.getList().get(0)); - } - - @Test - public void testCheckDuplicateRole_success() { - roleService.checkDuplicateRole(randomString(), randomString(), null); - } - - @Test - public void testCheckDuplicateRole_nameDuplicate() { - RoleDO roleDO = createRoleDO("role_name", RoleTypeEnum.CUSTOM, DataScopeEnum.ALL); - roleMapper.insert(roleDO); - - String duplicateName = "role_name"; - - assertServiceException(() -> roleService.checkDuplicateRole(duplicateName, randomString(), null), ROLE_NAME_DUPLICATE, duplicateName); - } - - @Test - public void testCheckDuplicateRole_codeDuplicate() { - RoleDO roleDO = randomPojo(RoleDO.class, o -> { - o.setName("role_999"); - o.setCode("code"); - o.setType(RoleTypeEnum.CUSTOM.getType()); - o.setStatus(1); - o.setDataScope(DataScopeEnum.ALL.getScope()); - }); - roleMapper.insert(roleDO); - - String randomName = randomString(); - String duplicateCode = "code"; - - assertServiceException(() -> roleService.checkDuplicateRole(randomName, duplicateCode, null), ROLE_CODE_DUPLICATE, duplicateCode); - } - - @Test - public void testCheckUpdateRole_success() { - RoleDO roleDO = createRoleDO("role_name", RoleTypeEnum.CUSTOM, DataScopeEnum.ALL); - roleMapper.insert(roleDO); - Long roleId = roleDO.getId(); - - roleService.checkUpdateRole(roleId); - } - - @Test - public void testCheckUpdateRole_roleIdNotExist() { - assertServiceException(() -> roleService.checkUpdateRole(randomLongId()), ROLE_NOT_EXISTS); - } - - @Test - public void testCheckUpdateRole_systemRoleCanNotBeUpdate() { - RoleDO roleDO = createRoleDO("role_name", RoleTypeEnum.SYSTEM, DataScopeEnum.ALL); - roleMapper.insert(roleDO); - Long roleId = roleDO.getId(); - - assertServiceException(() -> roleService.checkUpdateRole(roleId), ROLE_CAN_NOT_UPDATE_SYSTEM_TYPE_ROLE); - } - - private RoleDO createRoleDO(String name, RoleTypeEnum typeEnum, DataScopeEnum scopeEnum, Integer status) { - return createRoleDO( name, typeEnum, scopeEnum, status, randomString()); - } - - private RoleDO createRoleDO(String name, RoleTypeEnum typeEnum, DataScopeEnum scopeEnum, Integer status, String code) { - return createRoleDO(null, name, typeEnum, scopeEnum, status, code); - } - - private RoleDO createRoleDO(String name, RoleTypeEnum typeEnum, DataScopeEnum scopeEnum) { - return createRoleDO(null, name, typeEnum, scopeEnum, randomCommonStatus(), randomString()); - } - - private RoleDO createRoleDO(Long id, String name, RoleTypeEnum typeEnum, DataScopeEnum scopeEnum, Integer status, String code) { - return randomPojo(RoleDO.class, o -> { - o.setId(id); - o.setName(name); - o.setType(typeEnum.getType()); - o.setStatus(status); - o.setDataScope(scopeEnum.getScope()); - o.setCode(code); - }); - } - - private RoleDO randomRole() { - return randomPojo(RoleDO.class, - o -> o.setDataScope(RandomUtil.randomEle(DataScopeEnum.values()).getScope())); - } - -} diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sensitiveword/SensitiveWordServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sensitiveword/SensitiveWordServiceImplTest.java index 273e74b4a..141236987 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sensitiveword/SensitiveWordServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sensitiveword/SensitiveWordServiceImplTest.java @@ -16,13 +16,12 @@ import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import javax.annotation.Resource; -import java.time.LocalDateTime; import java.util.Arrays; import java.util.List; +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; -import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.max; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; @@ -61,7 +60,7 @@ public class SensitiveWordServiceImplTest extends BaseDbUnitTest { // 调用 sensitiveWordService.initLocalCache(); // 断言 sensitiveWordTagsCache 缓存 - assertEquals(SetUtils.asSet("论坛", "蔬菜"), sensitiveWordService.getSensitiveWordTags()); + assertEquals(SetUtils.asSet("论坛", "蔬菜"), sensitiveWordService.getSensitiveWordTagSet()); // 断言 tagSensitiveWordTries 缓存 assertNotNull(sensitiveWordService.getDefaultSensitiveWordTrie()); assertEquals(2, sensitiveWordService.getTagSensitiveWordTries().size()); @@ -135,6 +134,36 @@ public class SensitiveWordServiceImplTest extends BaseDbUnitTest { assertServiceException(() -> sensitiveWordService.deleteSensitiveWord(id), SENSITIVE_WORD_NOT_EXISTS); } + @Test + public void testGetSensitiveWord() { + // mock 数据 + SensitiveWordDO sensitiveWord = randomPojo(SensitiveWordDO.class); + sensitiveWordMapper.insert(sensitiveWord); + // 准备参数 + Long id = sensitiveWord.getId(); + + // 调用 + SensitiveWordDO dbSensitiveWord = sensitiveWordService.getSensitiveWord(id); + // 断言 + assertPojoEquals(sensitiveWord, dbSensitiveWord); + } + + @Test + public void testGetSensitiveWordList() { + // mock 数据 + SensitiveWordDO sensitiveWord01 = randomPojo(SensitiveWordDO.class); + sensitiveWordMapper.insert(sensitiveWord01); + SensitiveWordDO sensitiveWord02 = randomPojo(SensitiveWordDO.class); + sensitiveWordMapper.insert(sensitiveWord02); + + // 调用 + List list = sensitiveWordService.getSensitiveWordList(); + // 断言 + assertEquals(2, list.size()); + assertEquals(sensitiveWord01, list.get(0)); + assertEquals(sensitiveWord02, list.get(1)); + } + @Test public void testGetSensitiveWordPage() { // mock 数据 @@ -156,7 +185,7 @@ public class SensitiveWordServiceImplTest extends BaseDbUnitTest { reqVO.setName("笨"); reqVO.setTag("论坛"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2022, 2, 1),buildTime(2022, 2, 12)})); + reqVO.setCreateTime(buildBetweenTime(2022, 2, 1, 2022, 2, 12)); // 调用 PageResult pageResult = sensitiveWordService.getSensitiveWordPage(reqVO); @@ -167,7 +196,7 @@ public class SensitiveWordServiceImplTest extends BaseDbUnitTest { } @Test - public void testGetSensitiveWordList() { + public void testGetSensitiveWordList_export() { // mock 数据 SensitiveWordDO dbSensitiveWord = randomPojo(SensitiveWordDO.class, o -> { // 等会查询到 o.setName("笨蛋"); @@ -187,7 +216,7 @@ public class SensitiveWordServiceImplTest extends BaseDbUnitTest { reqVO.setName("笨"); reqVO.setTag("论坛"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2022, 2, 1),buildTime(2022, 2, 12)})); + reqVO.setCreateTime(buildBetweenTime(2022, 2, 1, 2022, 2, 12)); // 调用 List list = sensitiveWordService.getSensitiveWordList(reqVO); diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceTest.java index 4fe433d90..dabb9aa75 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceTest.java @@ -2,8 +2,6 @@ package cn.iocoder.yudao.module.system.service.sms; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import cn.iocoder.yudao.framework.sms.core.client.SmsClientFactory; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelCreateReqVO; @@ -17,11 +15,12 @@ import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import javax.annotation.Resource; -import java.time.LocalDateTime; -import java.util.function.Consumer; -import static cn.hutool.core.util.RandomUtil.randomEle; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.SMS_CHANNEL_HAS_CHILDREN; @@ -49,9 +48,9 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { @Test public void testInitLocalCache_success() { // mock 数据 - SmsChannelDO smsChannelDO01 = randomSmsChannelDO(); + SmsChannelDO smsChannelDO01 = randomPojo(SmsChannelDO.class); smsChannelMapper.insert(smsChannelDO01); - SmsChannelDO smsChannelDO02 = randomSmsChannelDO(); + SmsChannelDO smsChannelDO02 = randomPojo(SmsChannelDO.class); smsChannelMapper.insert(smsChannelDO02); // 调用 @@ -82,7 +81,7 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { @Test public void testUpdateSmsChannel_success() { // mock 数据 - SmsChannelDO dbSmsChannel = randomSmsChannelDO(); + SmsChannelDO dbSmsChannel = randomPojo(SmsChannelDO.class); smsChannelMapper.insert(dbSmsChannel);// @Sql: 先插入出一条存在的数据 // 准备参数 SmsChannelUpdateReqVO reqVO = randomPojo(SmsChannelUpdateReqVO.class, o -> { @@ -112,7 +111,7 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { @Test public void testDeleteSmsChannel_success() { // mock 数据 - SmsChannelDO dbSmsChannel = randomSmsChannelDO(); + SmsChannelDO dbSmsChannel = randomPojo(SmsChannelDO.class); smsChannelMapper.insert(dbSmsChannel);// @Sql: 先插入出一条存在的数据 // 准备参数 Long id = dbSmsChannel.getId(); @@ -137,7 +136,7 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { @Test public void testDeleteSmsChannel_hasChildren() { // mock 数据 - SmsChannelDO dbSmsChannel = randomSmsChannelDO(); + SmsChannelDO dbSmsChannel = randomPojo(SmsChannelDO.class); smsChannelMapper.insert(dbSmsChannel);// @Sql: 先插入出一条存在的数据 // 准备参数 Long id = dbSmsChannel.getId(); @@ -148,6 +147,35 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { assertServiceException(() -> smsChannelService.deleteSmsChannel(id), SMS_CHANNEL_HAS_CHILDREN); } + @Test + public void testGetSmsChannel() { + // mock 数据 + SmsChannelDO dbSmsChannel = randomPojo(SmsChannelDO.class); + smsChannelMapper.insert(dbSmsChannel); // @Sql: 先插入出一条存在的数据 + // 准备参数 + Long id = dbSmsChannel.getId(); + + // 调用,并断言 + assertPojoEquals(dbSmsChannel, smsChannelService.getSmsChannel(id)); + } + + @Test + public void testGetSmsChannelList() { + // mock 数据 + SmsChannelDO dbSmsChannel01 = randomPojo(SmsChannelDO.class); + smsChannelMapper.insert(dbSmsChannel01); + SmsChannelDO dbSmsChannel02 = randomPojo(SmsChannelDO.class); + smsChannelMapper.insert(dbSmsChannel02); + // 准备参数 + + // 调用 + List list = smsChannelService.getSmsChannelList(); + // 断言 + assertEquals(2, list.size()); + assertPojoEquals(dbSmsChannel01, list.get(0)); + assertPojoEquals(dbSmsChannel02, list.get(1)); + } + @Test public void testGetSmsChannelPage() { // mock 数据 @@ -158,16 +186,16 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { }); smsChannelMapper.insert(dbSmsChannel); // 测试 signature 不匹配 - smsChannelMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsChannel, o -> o.setSignature("源码"))); + smsChannelMapper.insert(cloneIgnoreId(dbSmsChannel, o -> o.setSignature("源码"))); // 测试 status 不匹配 - smsChannelMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsChannel, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); + smsChannelMapper.insert(cloneIgnoreId(dbSmsChannel, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); // 测试 createTime 不匹配 - smsChannelMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsChannel, o -> o.setCreateTime(buildTime(2020, 11, 11)))); + smsChannelMapper.insert(cloneIgnoreId(dbSmsChannel, o -> o.setCreateTime(buildTime(2020, 11, 11)))); // 准备参数 SmsChannelPageReqVO reqVO = new SmsChannelPageReqVO(); reqVO.setSignature("芋道"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2020, 12, 1),buildTime(2020, 12, 24)})); + reqVO.setCreateTime(buildBetweenTime(2020, 12, 1, 2020, 12, 24)); // 调用 PageResult pageResult = smsChannelService.getSmsChannelPage(reqVO); @@ -177,14 +205,4 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { assertPojoEquals(dbSmsChannel, pageResult.getList().get(0)); } - // ========== 随机对象 ========== - - @SafeVarargs - private static SmsChannelDO randomSmsChannelDO(Consumer... consumers) { - Consumer consumer = (o) -> { - o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 - }; - return randomPojo(SmsChannelDO.class, ArrayUtils.append(consumer, consumers)); - } - } diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsCodeServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsCodeServiceImplTest.java new file mode 100644 index 000000000..e50d025af --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsCodeServiceImplTest.java @@ -0,0 +1,209 @@ +package cn.iocoder.yudao.module.system.service.sms; + +import cn.hutool.core.map.MapUtil; +import cn.iocoder.yudao.framework.mybatis.core.enums.SqlConstants; +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeSendReqDTO; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeUseReqDTO; +import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeValidateReqDTO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsCodeDO; +import cn.iocoder.yudao.module.system.dal.mysql.sms.SmsCodeMapper; +import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum; +import cn.iocoder.yudao.module.system.framework.sms.SmsCodeProperties; +import com.baomidou.mybatisplus.annotation.DbType; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.context.annotation.Import; + +import javax.annotation.Resource; +import java.time.Duration; +import java.time.LocalDateTime; + +import static cn.hutool.core.util.RandomUtil.randomEle; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isNull; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@Import(SmsCodeServiceImpl.class) +public class SmsCodeServiceImplTest extends BaseDbUnitTest { + + @Resource + private SmsCodeServiceImpl smsCodeService; + + @Resource + private SmsCodeMapper smsCodeMapper; + + @MockBean + private SmsCodeProperties smsCodeProperties; + @MockBean + private SmsSendService smsSendService; + + @BeforeEach + public void setUp() { + when(smsCodeProperties.getExpireTimes()).thenReturn(Duration.ofMinutes(5)); + when(smsCodeProperties.getSendFrequency()).thenReturn(Duration.ofMinutes(1)); + when(smsCodeProperties.getSendMaximumQuantityPerDay()).thenReturn(10); + when(smsCodeProperties.getBeginCode()).thenReturn(9999); + when(smsCodeProperties.getEndCode()).thenReturn(9999); + } + + @Test + public void sendSmsCode_success() { + // 准备参数 + SmsCodeSendReqDTO reqDTO = randomPojo(SmsCodeSendReqDTO.class, o -> { + o.setMobile("15601691300"); + o.setScene(SmsSceneEnum.MEMBER_LOGIN.getScene()); + }); + // mock 方法 + SqlConstants.init(DbType.MYSQL); + + // 调用 + smsCodeService.sendSmsCode(reqDTO); + // 断言 code 验证码 + SmsCodeDO smsCodeDO = smsCodeMapper.selectOne(null); + assertPojoEquals(reqDTO, smsCodeDO); + assertEquals("9999", smsCodeDO.getCode()); + assertEquals(1, smsCodeDO.getTodayIndex()); + assertFalse(smsCodeDO.getUsed()); + // 断言调用 + verify(smsSendService).sendSingleSms(eq(reqDTO.getMobile()), isNull(), isNull(), + eq("user-sms-login"), eq(MapUtil.of("code", "9999"))); + } + + @Test + public void sendSmsCode_tooFast() { + // mock 数据 + SmsCodeDO smsCodeDO = randomPojo(SmsCodeDO.class, + o -> o.setMobile("15601691300").setTodayIndex(1)); + smsCodeMapper.insert(smsCodeDO); + // 准备参数 + SmsCodeSendReqDTO reqDTO = randomPojo(SmsCodeSendReqDTO.class, o -> { + o.setMobile("15601691300"); + o.setScene(SmsSceneEnum.MEMBER_LOGIN.getScene()); + }); + // mock 方法 + SqlConstants.init(DbType.MYSQL); + + // 调用,并断言异常 + assertServiceException(() -> smsCodeService.sendSmsCode(reqDTO), + SMS_CODE_SEND_TOO_FAST); + } + + @Test + public void sendSmsCode_exceedDay() { + // mock 数据 + SmsCodeDO smsCodeDO = randomPojo(SmsCodeDO.class, + o -> o.setMobile("15601691300").setTodayIndex(10).setCreateTime(LocalDateTime.now())); + smsCodeMapper.insert(smsCodeDO); + // 准备参数 + SmsCodeSendReqDTO reqDTO = randomPojo(SmsCodeSendReqDTO.class, o -> { + o.setMobile("15601691300"); + o.setScene(SmsSceneEnum.MEMBER_LOGIN.getScene()); + }); + // mock 方法 + SqlConstants.init(DbType.MYSQL); + when(smsCodeProperties.getSendFrequency()).thenReturn(Duration.ofMillis(0)); + + // 调用,并断言异常 + assertServiceException(() -> smsCodeService.sendSmsCode(reqDTO), + SMS_CODE_EXCEED_SEND_MAXIMUM_QUANTITY_PER_DAY); + } + + @Test + public void testUseSmsCode_success() { + // 准备参数 + SmsCodeUseReqDTO reqDTO = randomPojo(SmsCodeUseReqDTO.class, o -> { + o.setMobile("15601691300"); + o.setScene(randomEle(SmsSceneEnum.values()).getScene()); + }); + // mock 数据 + SqlConstants.init(DbType.MYSQL); + smsCodeMapper.insert(randomPojo(SmsCodeDO.class, o -> { + o.setMobile(reqDTO.getMobile()).setScene(reqDTO.getScene()) + .setCode(reqDTO.getCode()).setUsed(false); + })); + + // 调用 + smsCodeService.useSmsCode(reqDTO); + // 断言 + SmsCodeDO smsCodeDO = smsCodeMapper.selectOne(null); + assertTrue(smsCodeDO.getUsed()); + assertNotNull(smsCodeDO.getUsedTime()); + assertEquals(reqDTO.getUsedIp(), smsCodeDO.getUsedIp()); + } + + @Test + public void validateSmsCode_success() { + // 准备参数 + SmsCodeValidateReqDTO reqDTO = randomPojo(SmsCodeValidateReqDTO.class, o -> { + o.setMobile("15601691300"); + o.setScene(randomEle(SmsSceneEnum.values()).getScene()); + }); + // mock 数据 + SqlConstants.init(DbType.MYSQL); + smsCodeMapper.insert(randomPojo(SmsCodeDO.class, o -> o.setMobile(reqDTO.getMobile()) + .setScene(reqDTO.getScene()).setCode(reqDTO.getCode()).setUsed(false))); + + // 调用 + smsCodeService.validateSmsCode(reqDTO); + } + + @Test + public void validateSmsCode_notFound() { + // 准备参数 + SmsCodeValidateReqDTO reqDTO = randomPojo(SmsCodeValidateReqDTO.class, o -> { + o.setMobile("15601691300"); + o.setScene(randomEle(SmsSceneEnum.values()).getScene()); + }); + // mock 数据 + SqlConstants.init(DbType.MYSQL); + + // 调用,并断言异常 + assertServiceException(() -> smsCodeService.validateSmsCode(reqDTO), + SMS_CODE_NOT_FOUND); + } + + @Test + public void validateSmsCode_expired() { + // 准备参数 + SmsCodeValidateReqDTO reqDTO = randomPojo(SmsCodeValidateReqDTO.class, o -> { + o.setMobile("15601691300"); + o.setScene(randomEle(SmsSceneEnum.values()).getScene()); + }); + // mock 数据 + SqlConstants.init(DbType.MYSQL); + smsCodeMapper.insert(randomPojo(SmsCodeDO.class, o -> o.setMobile(reqDTO.getMobile()) + .setScene(reqDTO.getScene()).setCode(reqDTO.getCode()).setUsed(false) + .setCreateTime(LocalDateTime.now().minusMinutes(6)))); + + // 调用,并断言异常 + assertServiceException(() -> smsCodeService.validateSmsCode(reqDTO), + SMS_CODE_EXPIRED); + } + + @Test + public void validateSmsCode_used() { + // 准备参数 + SmsCodeValidateReqDTO reqDTO = randomPojo(SmsCodeValidateReqDTO.class, o -> { + o.setMobile("15601691300"); + o.setScene(randomEle(SmsSceneEnum.values()).getScene()); + }); + // mock 数据 + SqlConstants.init(DbType.MYSQL); + smsCodeMapper.insert(randomPojo(SmsCodeDO.class, o -> o.setMobile(reqDTO.getMobile()) + .setScene(reqDTO.getScene()).setCode(reqDTO.getCode()).setUsed(true) + .setCreateTime(LocalDateTime.now()))); + + // 调用,并断言异常 + assertServiceException(() -> smsCodeService.validateSmsCode(reqDTO), + SMS_CODE_USED); + } + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceImplTest.java similarity index 81% rename from yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceTest.java rename to yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceImplTest.java index 5a31892f5..2380ca09e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceImplTest.java @@ -1,7 +1,11 @@ package cn.iocoder.yudao.module.system.service.sms; import cn.hutool.core.map.MapUtil; +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogExportReqVO; import cn.iocoder.yudao.module.system.controller.admin.sms.vo.log.SmsLogPageReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsLogDO; @@ -10,11 +14,6 @@ import cn.iocoder.yudao.module.system.dal.mysql.sms.SmsLogMapper; import cn.iocoder.yudao.module.system.enums.sms.SmsReceiveStatusEnum; import cn.iocoder.yudao.module.system.enums.sms.SmsSendStatusEnum; import cn.iocoder.yudao.module.system.enums.sms.SmsTemplateTypeEnum; -import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Import; @@ -26,14 +25,16 @@ import java.util.function.Consumer; import static cn.hutool.core.util.RandomUtil.randomBoolean; import static cn.hutool.core.util.RandomUtil.randomEle; +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @Import(SmsLogServiceImpl.class) -public class SmsLogServiceTest extends BaseDbUnitTest { +public class SmsLogServiceImplTest extends BaseDbUnitTest { @Resource private SmsLogServiceImpl smsLogService; @@ -55,30 +56,28 @@ public class SmsLogServiceTest extends BaseDbUnitTest { }); smsLogMapper.insert(dbSmsLog); // 测试 channelId 不匹配 - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setChannelId(2L))); + smsLogMapper.insert(cloneIgnoreId(dbSmsLog, o -> o.setChannelId(2L))); // 测试 templateId 不匹配 - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setTemplateId(20L))); + smsLogMapper.insert(cloneIgnoreId(dbSmsLog, o -> o.setTemplateId(20L))); // 测试 mobile 不匹配 - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setMobile("18818260999"))); + smsLogMapper.insert(cloneIgnoreId(dbSmsLog, o -> o.setMobile("18818260999"))); // 测试 sendStatus 不匹配 - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setSendStatus(SmsSendStatusEnum.IGNORE.getStatus()))); + smsLogMapper.insert(cloneIgnoreId(dbSmsLog, o -> o.setSendStatus(SmsSendStatusEnum.IGNORE.getStatus()))); // 测试 sendTime 不匹配 - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setSendTime(buildTime(2020, 12, 12)))); + smsLogMapper.insert(cloneIgnoreId(dbSmsLog, o -> o.setSendTime(buildTime(2020, 12, 12)))); // 测试 receiveStatus 不匹配 - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setReceiveStatus(SmsReceiveStatusEnum.SUCCESS.getStatus()))); + smsLogMapper.insert(cloneIgnoreId(dbSmsLog, o -> o.setReceiveStatus(SmsReceiveStatusEnum.SUCCESS.getStatus()))); // 测试 receiveTime 不匹配 - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setReceiveTime(buildTime(2021, 12, 12)))); + smsLogMapper.insert(cloneIgnoreId(dbSmsLog, o -> o.setReceiveTime(buildTime(2021, 12, 12)))); // 准备参数 SmsLogPageReqVO reqVO = new SmsLogPageReqVO(); reqVO.setChannelId(1L); reqVO.setTemplateId(10L); reqVO.setMobile("156"); reqVO.setSendStatus(SmsSendStatusEnum.INIT.getStatus()); - reqVO.setSendTime((new LocalDateTime[]{buildTime(2020, 11, 1), - buildTime(2020, 11, 30)})); + reqVO.setSendTime(buildBetweenTime(2020, 11, 1, 2020, 11, 30)); reqVO.setReceiveStatus(SmsReceiveStatusEnum.INIT.getStatus()); - reqVO.setReceiveTime((new LocalDateTime[]{buildTime(2021, 11, 1), - buildTime(2021, 11, 30)})); + reqVO.setReceiveTime(buildBetweenTime(2021, 11, 1, 2021, 11, 30)); // 调用 PageResult pageResult = smsLogService.getSmsLogPage(reqVO); @@ -102,30 +101,28 @@ public class SmsLogServiceTest extends BaseDbUnitTest { }); smsLogMapper.insert(dbSmsLog); // 测试 channelId 不匹配 - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setChannelId(2L))); + smsLogMapper.insert(cloneIgnoreId(dbSmsLog, o -> o.setChannelId(2L))); // 测试 templateId 不匹配 - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setTemplateId(20L))); + smsLogMapper.insert(cloneIgnoreId(dbSmsLog, o -> o.setTemplateId(20L))); // 测试 mobile 不匹配 - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setMobile("18818260999"))); + smsLogMapper.insert(cloneIgnoreId(dbSmsLog, o -> o.setMobile("18818260999"))); // 测试 sendStatus 不匹配 - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setSendStatus(SmsSendStatusEnum.IGNORE.getStatus()))); + smsLogMapper.insert(cloneIgnoreId(dbSmsLog, o -> o.setSendStatus(SmsSendStatusEnum.IGNORE.getStatus()))); // 测试 sendTime 不匹配 - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setSendTime(buildTime(2020, 12, 12)))); + smsLogMapper.insert(cloneIgnoreId(dbSmsLog, o -> o.setSendTime(buildTime(2020, 12, 12)))); // 测试 receiveStatus 不匹配 - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setReceiveStatus(SmsReceiveStatusEnum.SUCCESS.getStatus()))); + smsLogMapper.insert(cloneIgnoreId(dbSmsLog, o -> o.setReceiveStatus(SmsReceiveStatusEnum.SUCCESS.getStatus()))); // 测试 receiveTime 不匹配 - smsLogMapper.insert(ObjectUtils.cloneIgnoreId(dbSmsLog, o -> o.setReceiveTime(buildTime(2021, 12, 12)))); + smsLogMapper.insert(cloneIgnoreId(dbSmsLog, o -> o.setReceiveTime(buildTime(2021, 12, 12)))); // 准备参数 SmsLogExportReqVO reqVO = new SmsLogExportReqVO(); reqVO.setChannelId(1L); reqVO.setTemplateId(10L); reqVO.setMobile("156"); reqVO.setSendStatus(SmsSendStatusEnum.INIT.getStatus()); - reqVO.setSendTime((new LocalDateTime[]{buildTime(2020, 11, 1), - buildTime(2020, 11, 30)})); + reqVO.setSendTime(buildBetweenTime(2020, 11, 1, 2020, 11, 30)); reqVO.setReceiveStatus(SmsReceiveStatusEnum.INIT.getStatus()); - reqVO.setReceiveTime((new LocalDateTime[]{buildTime(2021, 11, 1), - buildTime(2021, 11, 30)})); + reqVO.setReceiveTime(buildBetweenTime(2021, 11, 1, 2021, 11, 30)); // 调用 List list = smsLogService.getSmsLogList(reqVO); diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceImplTest.java similarity index 63% rename from yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceTest.java rename to yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceImplTest.java index 890924e14..0f7d0f9b7 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsSendServiceImplTest.java @@ -1,10 +1,6 @@ package cn.iocoder.yudao.module.system.service.sms; import cn.hutool.core.map.MapUtil; -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; -import cn.iocoder.yudao.module.system.mq.message.sms.SmsSendMessage; -import cn.iocoder.yudao.module.system.mq.producer.sms.SmsProducer; import cn.iocoder.yudao.framework.common.core.KeyValue; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; @@ -14,6 +10,13 @@ import cn.iocoder.yudao.framework.sms.core.client.SmsCommonResult; import cn.iocoder.yudao.framework.sms.core.client.dto.SmsReceiveRespDTO; import cn.iocoder.yudao.framework.sms.core.client.dto.SmsSendRespDTO; import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; +import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; +import cn.iocoder.yudao.module.system.mq.message.sms.SmsSendMessage; +import cn.iocoder.yudao.module.system.mq.producer.sms.SmsProducer; +import cn.iocoder.yudao.module.system.service.member.MemberService; +import cn.iocoder.yudao.module.system.service.user.AdminUserService; import org.assertj.core.util.Lists; import org.junit.jupiter.api.Test; import org.mockito.InjectMocks; @@ -31,11 +34,15 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; -public class SmsSendServiceTest extends BaseMockitoUnitTest { +public class SmsSendServiceImplTest extends BaseMockitoUnitTest { @InjectMocks private SmsSendServiceImpl smsService; + @Mock + private AdminUserService adminUserService; + @Mock + private MemberService memberService; @Mock private SmsChannelService smsChannelService; @Mock @@ -48,6 +55,84 @@ public class SmsSendServiceTest extends BaseMockitoUnitTest { @Mock private SmsClientFactory smsClientFactory; + @Test + public void testSendSingleSmsToAdmin() { + // 准备参数 + Long userId = randomLongId(); + String templateCode = randomString(); + Map templateParams = MapUtil.builder().put("code", "1234") + .put("op", "login").build(); + // mock adminUserService 的方法 + AdminUserDO user = randomPojo(AdminUserDO.class, o -> o.setMobile("15601691300")); + when(adminUserService.getUser(eq(userId))).thenReturn(user); + + // mock SmsTemplateService 的方法 + SmsTemplateDO template = randomPojo(SmsTemplateDO.class, o -> { + o.setStatus(CommonStatusEnum.ENABLE.getStatus()); + o.setContent("验证码为{code}, 操作为{op}"); + o.setParams(Lists.newArrayList("code", "op")); + }); + when(smsTemplateService.getSmsTemplateByCodeFromCache(eq(templateCode))).thenReturn(template); + String content = randomString(); + when(smsTemplateService.formatSmsTemplateContent(eq(template.getContent()), eq(templateParams))) + .thenReturn(content); + // mock SmsChannelService 的方法 + SmsChannelDO smsChannel = randomPojo(SmsChannelDO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus())); + when(smsChannelService.getSmsChannel(eq(template.getChannelId()))).thenReturn(smsChannel); + // mock SmsLogService 的方法 + Long smsLogId = randomLongId(); + when(smsLogService.createSmsLog(eq(user.getMobile()), eq(userId), eq(UserTypeEnum.ADMIN.getValue()), eq(Boolean.TRUE), eq(template), + eq(content), eq(templateParams))).thenReturn(smsLogId); + + // 调用 + Long resultSmsLogId = smsService.sendSingleSmsToAdmin(null, userId, templateCode, templateParams); + // 断言 + assertEquals(smsLogId, resultSmsLogId); + // 断言调用 + verify(smsProducer).sendSmsSendMessage(eq(smsLogId), eq(user.getMobile()), + eq(template.getChannelId()), eq(template.getApiTemplateId()), + eq(Lists.newArrayList(new KeyValue<>("code", "1234"), new KeyValue<>("op", "login")))); + } + + @Test + public void testSendSingleSmsToUser() { + // 准备参数 + Long userId = randomLongId(); + String templateCode = randomString(); + Map templateParams = MapUtil.builder().put("code", "1234") + .put("op", "login").build(); + // mock memberService 的方法 + String mobile = "15601691300"; + when(memberService.getMemberUserMobile(eq(userId))).thenReturn(mobile); + + // mock SmsTemplateService 的方法 + SmsTemplateDO template = randomPojo(SmsTemplateDO.class, o -> { + o.setStatus(CommonStatusEnum.ENABLE.getStatus()); + o.setContent("验证码为{code}, 操作为{op}"); + o.setParams(Lists.newArrayList("code", "op")); + }); + when(smsTemplateService.getSmsTemplateByCodeFromCache(eq(templateCode))).thenReturn(template); + String content = randomString(); + when(smsTemplateService.formatSmsTemplateContent(eq(template.getContent()), eq(templateParams))) + .thenReturn(content); + // mock SmsChannelService 的方法 + SmsChannelDO smsChannel = randomPojo(SmsChannelDO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus())); + when(smsChannelService.getSmsChannel(eq(template.getChannelId()))).thenReturn(smsChannel); + // mock SmsLogService 的方法 + Long smsLogId = randomLongId(); + when(smsLogService.createSmsLog(eq(mobile), eq(userId), eq(UserTypeEnum.MEMBER.getValue()), eq(Boolean.TRUE), eq(template), + eq(content), eq(templateParams))).thenReturn(smsLogId); + + // 调用 + Long resultSmsLogId = smsService.sendSingleSmsToMember(null, userId, templateCode, templateParams); + // 断言 + assertEquals(smsLogId, resultSmsLogId); + // 断言调用 + verify(smsProducer).sendSmsSendMessage(eq(smsLogId), eq(mobile), + eq(template.getChannelId()), eq(template.getApiTemplateId()), + eq(Lists.newArrayList(new KeyValue<>("code", "1234"), new KeyValue<>("op", "login")))); + } + /** * 发送成功,当短信模板开启时 */ @@ -83,7 +168,7 @@ public class SmsSendServiceTest extends BaseMockitoUnitTest { // 断言 assertEquals(smsLogId, resultSmsLogId); // 断言调用 - verify(smsProducer, times(1)).sendSmsSendMessage(eq(smsLogId), eq(mobile), + verify(smsProducer).sendSmsSendMessage(eq(smsLogId), eq(mobile), eq(template.getChannelId()), eq(template.getApiTemplateId()), eq(Lists.newArrayList(new KeyValue<>("code", "1234"), new KeyValue<>("op", "login")))); } @@ -134,7 +219,7 @@ public class SmsSendServiceTest extends BaseMockitoUnitTest { // mock 方法 // 调用,并断言异常 - assertServiceException(() -> smsService.checkSmsTemplateValid(templateCode), + assertServiceException(() -> smsService.validateSmsTemplate(templateCode), SMS_SEND_TEMPLATE_NOT_EXISTS); } @@ -157,7 +242,7 @@ public class SmsSendServiceTest extends BaseMockitoUnitTest { // mock 方法 // 调用,并断言异常 - assertServiceException(() -> smsService.checkMobile(null), + assertServiceException(() -> smsService.validateMobile(null), SMS_SEND_MOBILE_NOT_EXISTS); } @@ -177,7 +262,7 @@ public class SmsSendServiceTest extends BaseMockitoUnitTest { // 调用 smsService.doSendSms(message); // 断言 - verify(smsLogService, times(1)).updateSmsSendResult(eq(message.getLogId()), + verify(smsLogService).updateSmsSendResult(eq(message.getLogId()), eq(sendResult.getCode()), eq(sendResult.getMsg()), eq(sendResult.getApiCode()), eq(sendResult.getApiMsg()), eq(sendResult.getApiRequestId()), eq(sendResult.getData().getSerialNo())); } diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceImplTest.java similarity index 92% rename from yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceTest.java rename to yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceImplTest.java index a89d1b2e1..3b9b577a2 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceImplTest.java @@ -1,14 +1,5 @@ package cn.iocoder.yudao.module.system.service.sms; -import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateCreateReqVO; -import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateExportReqVO; -import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplatePageReqVO; -import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateUpdateReqVO; -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; -import cn.iocoder.yudao.module.system.dal.mysql.sms.SmsTemplateMapper; -import cn.iocoder.yudao.module.system.mq.producer.sms.SmsProducer; -import cn.iocoder.yudao.module.system.enums.sms.SmsTemplateTypeEnum; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -19,31 +10,38 @@ import cn.iocoder.yudao.framework.sms.core.client.SmsClientFactory; import cn.iocoder.yudao.framework.sms.core.client.SmsCommonResult; import cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateRespDTO; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; +import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateCreateReqVO; +import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateExportReqVO; +import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplatePageReqVO; +import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateUpdateReqVO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; +import cn.iocoder.yudao.module.system.dal.mysql.sms.SmsTemplateMapper; +import cn.iocoder.yudao.module.system.enums.sms.SmsTemplateTypeEnum; +import cn.iocoder.yudao.module.system.mq.producer.sms.SmsProducer; import com.google.common.collect.Lists; import org.junit.jupiter.api.Test; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import javax.annotation.Resource; -import java.time.LocalDateTime; import java.util.List; import java.util.Map; import java.util.function.Consumer; -import static cn.hutool.core.bean.BeanUtil.getFieldValue; import static cn.hutool.core.util.RandomUtil.randomEle; -import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.max; -import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; @Import(SmsTemplateServiceImpl.class) -public class SmsTemplateServiceTest extends BaseDbUnitTest { +public class SmsTemplateServiceImplTest extends BaseDbUnitTest { @Resource private SmsTemplateServiceImpl smsTemplateService; @@ -226,7 +224,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { reqVO.setContent("芋道"); reqVO.setApiTemplateId("yu"); reqVO.setChannelId(1L); - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2021, 11, 1),buildTime(2021, 12, 1)})); + reqVO.setCreateTime(buildBetweenTime(2021, 11, 1, 2021, 12, 1)); // 调用 PageResult pageResult = smsTemplateService.getSmsTemplatePage(reqVO); @@ -271,7 +269,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { reqVO.setContent("芋道"); reqVO.setApiTemplateId("yu"); reqVO.setChannelId(1L); - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2021, 11, 1),buildTime(2021, 12, 1)})); + reqVO.setCreateTime(buildBetweenTime(2021, 11, 1, 2021, 12, 1)); // 调用 List list = smsTemplateService.getSmsTemplateList(reqVO); @@ -281,7 +279,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { } @Test - public void testCheckSmsChannel_success() { + public void testValidateSmsChannel_success() { // 准备参数 Long channelId = randomLongId(); // mock 方法 @@ -292,23 +290,23 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { when(smsChannelService.getSmsChannel(eq(channelId))).thenReturn(channelDO); // 调用 - SmsChannelDO returnChannelDO = smsTemplateService.checkSmsChannel(channelId); + SmsChannelDO returnChannelDO = smsTemplateService.validateSmsChannel(channelId); // 断言 assertPojoEquals(returnChannelDO, channelDO); } @Test - public void testCheckSmsChannel_notExists() { + public void testValidateSmsChannel_notExists() { // 准备参数 Long channelId = randomLongId(); // 调用,校验异常 - assertServiceException(() -> smsTemplateService.checkSmsChannel(channelId), + assertServiceException(() -> smsTemplateService.validateSmsChannel(channelId), SMS_CHANNEL_NOT_EXISTS); } @Test - public void testCheckSmsChannel_disable() { + public void testValidateSmsChannel_disable() { // 准备参数 Long channelId = randomLongId(); // mock 方法 @@ -319,30 +317,30 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { when(smsChannelService.getSmsChannel(eq(channelId))).thenReturn(channelDO); // 调用,校验异常 - assertServiceException(() -> smsTemplateService.checkSmsChannel(channelId), + assertServiceException(() -> smsTemplateService.validateSmsChannel(channelId), SMS_CHANNEL_DISABLE); } @Test - public void testCheckDictDataValueUnique_success() { + public void testValidateDictDataValueUnique_success() { // 调用,成功 - smsTemplateService.checkSmsTemplateCodeDuplicate(randomLongId(), randomString()); + smsTemplateService.validateSmsTemplateCodeDuplicate(randomLongId(), randomString()); } @Test - public void testCheckSmsTemplateCodeDuplicate_valueDuplicateForCreate() { + public void testValidateSmsTemplateCodeDuplicate_valueDuplicateForCreate() { // 准备参数 String code = randomString(); // mock 数据 smsTemplateMapper.insert(randomSmsTemplateDO(o -> o.setCode(code))); // 调用,校验异常 - assertServiceException(() -> smsTemplateService.checkSmsTemplateCodeDuplicate(null, code), + assertServiceException(() -> smsTemplateService.validateSmsTemplateCodeDuplicate(null, code), SMS_TEMPLATE_CODE_DUPLICATE, code); } @Test - public void testCheckDictDataValueUnique_valueDuplicateForUpdate() { + public void testValidateDictDataValueUnique_valueDuplicateForUpdate() { // 准备参数 Long id = randomLongId(); String code = randomString(); @@ -350,7 +348,7 @@ public class SmsTemplateServiceTest extends BaseDbUnitTest { smsTemplateMapper.insert(randomSmsTemplateDO(o -> o.setCode(code))); // 调用,校验异常 - assertServiceException(() -> smsTemplateService.checkSmsTemplateCodeDuplicate(id, code), + assertServiceException(() -> smsTemplateService.validateSmsTemplateCodeDuplicate(id, code), SMS_TEMPLATE_CODE_DUPLICATE, code); } diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImplTest.java similarity index 99% rename from yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceTest.java rename to yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImplTest.java index 6a3e76bdf..48f914a1a 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/social/SocialUserServiceImplTest.java @@ -35,7 +35,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.*; @Import(SocialUserServiceImpl.class) -public class SocialUserServiceTest extends BaseDbAndRedisUnitTest { +public class SocialUserServiceImplTest extends BaseDbAndRedisUnitTest { @Resource private SocialUserServiceImpl socialUserService; diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantPackageServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantPackageServiceImplTest.java index 8277cdea5..9f80a1014 100755 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantPackageServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantPackageServiceImplTest.java @@ -2,21 +2,22 @@ package cn.iocoder.yudao.module.system.service.tenant; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.packages.TenantPackageCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.packages.TenantPackagePageReqVO; import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.packages.TenantPackageUpdateReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO; import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantPackageDO; import cn.iocoder.yudao.module.system.dal.mysql.tenant.TenantPackageMapper; -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import org.junit.jupiter.api.Test; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import javax.annotation.Resource; -import java.time.LocalDateTime; +import java.util.List; +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; @@ -158,7 +159,7 @@ public class TenantPackageServiceImplTest extends BaseDbUnitTest { reqVO.setName("芋道"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); reqVO.setRemark("源码"); - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2022, 10, 9),buildTime(2022, 10, 11)})); + reqVO.setCreateTime(buildBetweenTime(2022, 10, 9, 2022, 10, 11)); // 调用 PageResult pageResult = tenantPackageService.getTenantPackagePage(reqVO); @@ -201,4 +202,34 @@ public class TenantPackageServiceImplTest extends BaseDbUnitTest { assertServiceException(() -> tenantPackageService.validTenantPackage(dbTenantPackage.getId()), TENANT_PACKAGE_DISABLE, dbTenantPackage.getName()); } + + @Test + public void testGetTenantPackage() { + // mock 数据 + TenantPackageDO dbTenantPackage = randomPojo(TenantPackageDO.class); + tenantPackageMapper.insert(dbTenantPackage);// @Sql: 先插入出一条存在的数据 + + // 调用 + TenantPackageDO result = tenantPackageService.getTenantPackage(dbTenantPackage.getId()); + // 断言 + assertPojoEquals(result, dbTenantPackage); + } + + @Test + public void testGetTenantPackageListByStatus() { + // mock 数据 + TenantPackageDO dbTenantPackage = randomPojo(TenantPackageDO.class, + o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus())); + tenantPackageMapper.insert(dbTenantPackage); + // 测试 status 不匹配 + tenantPackageMapper.insert(cloneIgnoreId(dbTenantPackage, + o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); + + // 调用 + List list = tenantPackageService.getTenantPackageListByStatus( + CommonStatusEnum.ENABLE.getStatus()); + assertEquals(1, list.size()); + assertPojoEquals(dbTenantPackage, list.get(0)); + } + } diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImplTest.java index dfaebdbb7..38357b280 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImplTest.java @@ -34,6 +34,7 @@ import java.util.Collections; import java.util.List; import static cn.iocoder.yudao.framework.common.util.collection.SetUtils.asSet; +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; @@ -81,13 +82,13 @@ public class TenantServiceImplTest extends BaseDbUnitTest { } @Test - public void testGetTenantIds() { + public void testGetTenantIdList() { // mock 数据 TenantDO tenant = randomPojo(TenantDO.class, o -> o.setId(1L)); tenantMapper.insert(tenant); // 调用,并断言业务异常 - List result = tenantService.getTenantIds(); + List result = tenantService.getTenantIdList(); assertEquals(Collections.singletonList(1L), result); } @@ -196,7 +197,7 @@ public class TenantServiceImplTest extends BaseDbUnitTest { role100.setTenantId(dbTenant.getId()); RoleDO role101 = randomPojo(RoleDO.class, o -> o.setId(101L)); role101.setTenantId(dbTenant.getId()); - when(roleService.getRoles(isNull())).thenReturn(asList(role100, role101)); + when(roleService.getRoleListByStatus(isNull())).thenReturn(asList(role100, role101)); // mock 每个角色的权限 when(permissionService.getRoleMenuIds(eq(101L))).thenReturn(asSet(201L, 202L)); @@ -310,7 +311,7 @@ public class TenantServiceImplTest extends BaseDbUnitTest { reqVO.setContactName("艿"); reqVO.setContactMobile("1560"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setCreateTime(new LocalDateTime[]{buildTime(2020, 12, 1),buildTime(2020, 12, 24)}); + reqVO.setCreateTime(buildBetweenTime(2020, 12, 1, 2020, 12, 24)); // 调用 PageResult pageResult = tenantService.getTenantPage(reqVO); @@ -347,7 +348,7 @@ public class TenantServiceImplTest extends BaseDbUnitTest { reqVO.setContactName("艿"); reqVO.setContactMobile("1560"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setCreateTime(new LocalDateTime[]{buildTime(2020, 12, 1),buildTime(2020, 12, 24)}); + reqVO.setCreateTime(buildBetweenTime(2020, 12, 1, 2020, 12, 24)); // 调用 List list = tenantService.getTenantList(reqVO); @@ -356,7 +357,6 @@ public class TenantServiceImplTest extends BaseDbUnitTest { assertPojoEquals(dbTenant, list.get(0)); } - @Test public void testGetTenantByName() { // mock 数据 @@ -453,7 +453,7 @@ public class TenantServiceImplTest extends BaseDbUnitTest { tenantMapper.insert(dbTenant);// @Sql: 先插入出一条存在的数据 TenantContextHolder.setTenantId(dbTenant.getId()); // mock 菜单 - when(menuService.getMenus()).thenReturn(Arrays.asList(randomPojo(MenuDO.class, o -> o.setId(100L)), + when(menuService.getMenuList()).thenReturn(Arrays.asList(randomPojo(MenuDO.class, o -> o.setId(100L)), randomPojo(MenuDO.class, o -> o.setId(101L)))); // 调用 diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImplTest.java index 2822789e3..a5e0183a4 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImplTest.java @@ -6,7 +6,6 @@ import cn.iocoder.yudao.framework.common.exception.ServiceException; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; -import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.infra.api.file.FileApi; import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO; @@ -32,23 +31,25 @@ import org.springframework.security.crypto.password.PasswordEncoder; import javax.annotation.Resource; import java.io.ByteArrayInputStream; -import java.time.LocalDateTime; import java.util.Collection; import java.util.List; +import java.util.Map; import java.util.function.Consumer; import static cn.hutool.core.util.RandomUtil.randomBytes; import static cn.hutool.core.util.RandomUtil.randomEle; import static cn.iocoder.yudao.framework.common.util.collection.SetUtils.asSet; +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; import static java.util.Collections.singleton; +import static java.util.Collections.singletonList; import static org.assertj.core.util.Lists.newArrayList; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.*; import static org.mockito.Mockito.*; @@ -102,7 +103,7 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { o.setId(postId); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); })); - when(postService.getPosts(eq(reqVO.getPostIds()), isNull())).thenReturn(posts); + when(postService.getPostList(eq(reqVO.getPostIds()), isNull())).thenReturn(posts); // mock passwordEncoder 的方法 when(passwordEncoder.encode(eq(reqVO.getPassword()))).thenReturn("yudaoyuanma"); @@ -160,7 +161,7 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { o.setId(postId); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); })); - when(postService.getPosts(eq(reqVO.getPostIds()), isNull())).thenReturn(posts); + when(postService.getPostList(eq(reqVO.getPostIds()), isNull())).thenReturn(posts); // 调用 userService.updateUser(reqVO); @@ -173,6 +174,23 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { assertEquals(3L, userPosts.get(1).getPostId()); } + @Test + public void testUpdateUserLogin() { + // mock 数据 + AdminUserDO user = randomAdminUserDO(o -> o.setLoginDate(null)); + userMapper.insert(user); + // 准备参数 + Long id = user.getId(); + String loginIp = randomString(); + + // 调用 + userService.updateUserLogin(id, loginIp); + // 断言 + AdminUserDO dbUser = userMapper.selectById(id); + assertEquals(loginIp, dbUser.getLoginIp()); + assertNotNull(dbUser.getLoginDate()); + } + @Test public void testUpdateUserProfile_success() { // mock 数据 @@ -286,6 +304,34 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { verify(permissionService, times(1)).processUserDeleted(eq(userId)); } + @Test + public void testGetUserByUsername() { + // mock 数据 + AdminUserDO dbUser = randomAdminUserDO(); + userMapper.insert(dbUser); + // 准备参数 + String username = dbUser.getUsername(); + + // 调用 + AdminUserDO user = userService.getUserByUsername(username); + // 断言 + assertPojoEquals(dbUser, user); + } + + @Test + public void testGetUserByMobile() { + // mock 数据 + AdminUserDO dbUser = randomAdminUserDO(); + userMapper.insert(dbUser); + // 准备参数 + String mobile = dbUser.getMobile(); + + // 调用 + AdminUserDO user = userService.getUserByMobile(mobile); + // 断言 + assertPojoEquals(dbUser, user); + } + @Test public void testGetUserPage() { // mock 数据 @@ -295,11 +341,11 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { reqVO.setUsername("tu"); reqVO.setMobile("1560"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2020, 12, 1),buildTime(2020, 12, 24)})); + reqVO.setCreateTime(buildBetweenTime(2020, 12, 1, 2020, 12, 24)); reqVO.setDeptId(1L); // 其中,1L 是 2L 的父部门 // mock 方法 List deptList = newArrayList(randomPojo(DeptDO.class, o -> o.setId(2L))); - when(deptService.getDeptsByParentIdFromCache(eq(reqVO.getDeptId()), eq(true))).thenReturn(deptList); + when(deptService.getDeptListByParentIdFromCache(eq(reqVO.getDeptId()), eq(true))).thenReturn(deptList); // 调用 PageResult pageResult = userService.getUserPage(reqVO); @@ -310,7 +356,7 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { } @Test - public void testGetUsers() { + public void testGetUserList_export() { // mock 数据 AdminUserDO dbUser = initGetUserPageData(); // 准备参数 @@ -318,14 +364,14 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { reqVO.setUsername("tu"); reqVO.setMobile("1560"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2020, 12, 1),buildTime(2020, 12, 24)})); + reqVO.setCreateTime(buildBetweenTime(2020, 12, 1, 2020, 12, 24)); reqVO.setDeptId(1L); // 其中,1L 是 2L 的父部门 // mock 方法 List deptList = newArrayList(randomPojo(DeptDO.class, o -> o.setId(2L))); - when(deptService.getDeptsByParentIdFromCache(eq(reqVO.getDeptId()), eq(true))).thenReturn(deptList); + when(deptService.getDeptListByParentIdFromCache(eq(reqVO.getDeptId()), eq(true))).thenReturn(deptList); // 调用 - List list = userService.getUsers(reqVO); + List list = userService.getUserList(reqVO); // 断言 assertEquals(1, list.size()); assertPojoEquals(dbUser, list.get(0)); @@ -345,31 +391,62 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { }); userMapper.insert(dbUser); // 测试 username 不匹配 - userMapper.insert(ObjectUtils.cloneIgnoreId(dbUser, o -> o.setUsername("dou"))); + userMapper.insert(cloneIgnoreId(dbUser, o -> o.setUsername("dou"))); // 测试 mobile 不匹配 - userMapper.insert(ObjectUtils.cloneIgnoreId(dbUser, o -> o.setMobile("18818260888"))); + userMapper.insert(cloneIgnoreId(dbUser, o -> o.setMobile("18818260888"))); // 测试 status 不匹配 - userMapper.insert(ObjectUtils.cloneIgnoreId(dbUser, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); + userMapper.insert(cloneIgnoreId(dbUser, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); // 测试 createTime 不匹配 - userMapper.insert(ObjectUtils.cloneIgnoreId(dbUser, o -> o.setCreateTime(buildTime(2020, 11, 11)))); + userMapper.insert(cloneIgnoreId(dbUser, o -> o.setCreateTime(buildTime(2020, 11, 11)))); // 测试 dept 不匹配 - userMapper.insert(ObjectUtils.cloneIgnoreId(dbUser, o -> o.setDeptId(0L))); + userMapper.insert(cloneIgnoreId(dbUser, o -> o.setDeptId(0L))); return dbUser; } + @Test + public void testGetUser() { + // mock 数据 + AdminUserDO dbUser = randomAdminUserDO(); + userMapper.insert(dbUser); + // 准备参数 + Long userId = dbUser.getId(); + + // 调用 + AdminUserDO user = userService.getUser(userId); + // 断言 + assertPojoEquals(dbUser, user); + } + + @Test + public void testGetUserListByDeptIds() { + // mock 数据 + AdminUserDO dbUser = randomAdminUserDO(o -> o.setDeptId(1L)); + userMapper.insert(dbUser); + // 测试 deptId 不匹配 + userMapper.insert(cloneIgnoreId(dbUser, o -> o.setDeptId(2L))); + // 准备参数 + Collection deptIds = singleton(1L); + + // 调用 + List list = userService.getUserListByDeptIds(deptIds); + // 断言 + assertEquals(1, list.size()); + assertEquals(dbUser, list.get(0)); + } + /** * 情况一,校验不通过,导致插入失败 */ @Test - public void testImportUsers_01() { + public void testImportUserList_01() { // 准备参数 UserImportExcelVO importUser = randomPojo(UserImportExcelVO.class, o -> { }); // mock 方法,模拟失败 - doThrow(new ServiceException(DEPT_NOT_FOUND)).when(deptService).validDepts(any()); + doThrow(new ServiceException(DEPT_NOT_FOUND)).when(deptService).validateDeptList(any()); // 调用 - UserImportRespVO respVO = userService.importUsers(newArrayList(importUser), true); + UserImportRespVO respVO = userService.importUserList(newArrayList(importUser), true); // 断言 assertEquals(0, respVO.getCreateUsernames().size()); assertEquals(0, respVO.getUpdateUsernames().size()); @@ -381,7 +458,7 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { * 情况二,不存在,进行插入 */ @Test - public void testImportUsers_02() { + public void testImportUserList_02() { // 准备参数 UserImportExcelVO importUser = randomPojo(UserImportExcelVO.class, o -> { o.setStatus(randomEle(CommonStatusEnum.values()).getStatus()); // 保证 status 的范围 @@ -397,7 +474,7 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { when(passwordEncoder.encode(eq("yudaoyuanma"))).thenReturn("java"); // 调用 - UserImportRespVO respVO = userService.importUsers(newArrayList(importUser), true); + UserImportRespVO respVO = userService.importUserList(newArrayList(importUser), true); // 断言 assertEquals(1, respVO.getCreateUsernames().size()); AdminUserDO user = userMapper.selectByUsername(respVO.getCreateUsernames().get(0)); @@ -411,7 +488,7 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { * 情况三,存在,但是不强制更新 */ @Test - public void testImportUsers_03() { + public void testImportUserList_03() { // mock 数据 AdminUserDO dbUser = randomAdminUserDO(); userMapper.insert(dbUser); @@ -429,7 +506,7 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { when(deptService.getDept(eq(dept.getId()))).thenReturn(dept); // 调用 - UserImportRespVO respVO = userService.importUsers(newArrayList(importUser), false); + UserImportRespVO respVO = userService.importUserList(newArrayList(importUser), false); // 断言 assertEquals(0, respVO.getCreateUsernames().size()); assertEquals(0, respVO.getUpdateUsernames().size()); @@ -441,7 +518,7 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { * 情况四,存在,强制更新 */ @Test - public void testImportUsers_04() { + public void testImportUserList_04() { // mock 数据 AdminUserDO dbUser = randomAdminUserDO(); userMapper.insert(dbUser); @@ -459,7 +536,7 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { when(deptService.getDept(eq(dept.getId()))).thenReturn(dept); // 调用 - UserImportRespVO respVO = userService.importUsers(newArrayList(importUser), true); + UserImportRespVO respVO = userService.importUserList(newArrayList(importUser), true); // 断言 assertEquals(0, respVO.getCreateUsernames().size()); assertEquals(1, respVO.getUpdateUsernames().size()); @@ -469,24 +546,24 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { } @Test - public void testCheckUserExists_notExists() { - assertServiceException(() -> userService.checkUserExists(randomLongId()), USER_NOT_EXISTS); + public void testValidateUserExists_notExists() { + assertServiceException(() -> userService.validateUserExists(randomLongId()), USER_NOT_EXISTS); } @Test - public void testCheckUsernameUnique_usernameExistsForCreate() { + public void testValidateUsernameUnique_usernameExistsForCreate() { // 准备参数 String username = randomString(); // mock 数据 userMapper.insert(randomAdminUserDO(o -> o.setUsername(username))); // 调用,校验异常 - assertServiceException(() -> userService.checkUsernameUnique(null, username), + assertServiceException(() -> userService.validateUsernameUnique(null, username), USER_USERNAME_EXISTS); } @Test - public void testCheckUsernameUnique_usernameExistsForUpdate() { + public void testValidateUsernameUnique_usernameExistsForUpdate() { // 准备参数 Long id = randomLongId(); String username = randomString(); @@ -494,24 +571,24 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { userMapper.insert(randomAdminUserDO(o -> o.setUsername(username))); // 调用,校验异常 - assertServiceException(() -> userService.checkUsernameUnique(id, username), + assertServiceException(() -> userService.validateUsernameUnique(id, username), USER_USERNAME_EXISTS); } @Test - public void testCheckEmailUnique_emailExistsForCreate() { + public void testValidateEmailUnique_emailExistsForCreate() { // 准备参数 String email = randomString(); // mock 数据 userMapper.insert(randomAdminUserDO(o -> o.setEmail(email))); // 调用,校验异常 - assertServiceException(() -> userService.checkEmailUnique(null, email), + assertServiceException(() -> userService.validateEmailUnique(null, email), USER_EMAIL_EXISTS); } @Test - public void testCheckEmailUnique_emailExistsForUpdate() { + public void testValidateEmailUnique_emailExistsForUpdate() { // 准备参数 Long id = randomLongId(); String email = randomString(); @@ -519,24 +596,24 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { userMapper.insert(randomAdminUserDO(o -> o.setEmail(email))); // 调用,校验异常 - assertServiceException(() -> userService.checkEmailUnique(id, email), + assertServiceException(() -> userService.validateEmailUnique(id, email), USER_EMAIL_EXISTS); } @Test - public void testCheckMobileUnique_mobileExistsForCreate() { + public void testValidateMobileUnique_mobileExistsForCreate() { // 准备参数 String mobile = randomString(); // mock 数据 userMapper.insert(randomAdminUserDO(o -> o.setMobile(mobile))); // 调用,校验异常 - assertServiceException(() -> userService.checkMobileUnique(null, mobile), + assertServiceException(() -> userService.validateMobileUnique(null, mobile), USER_MOBILE_EXISTS); } @Test - public void testCheckMobileUnique_mobileExistsForUpdate() { + public void testValidateMobileUnique_mobileExistsForUpdate() { // 准备参数 Long id = randomLongId(); String mobile = randomString(); @@ -544,18 +621,18 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { userMapper.insert(randomAdminUserDO(o -> o.setMobile(mobile))); // 调用,校验异常 - assertServiceException(() -> userService.checkMobileUnique(id, mobile), + assertServiceException(() -> userService.validateMobileUnique(id, mobile), USER_MOBILE_EXISTS); } @Test - public void testCheckOldPassword_notExists() { - assertServiceException(() -> userService.checkOldPassword(randomLongId(), randomString()), + public void testValidateOldPassword_notExists() { + assertServiceException(() -> userService.validateOldPassword(randomLongId(), randomString()), USER_NOT_EXISTS); } @Test - public void testCheckOldPassword_passwordFailed() { + public void testValidateOldPassword_passwordFailed() { // mock 数据 AdminUserDO user = randomAdminUserDO(); userMapper.insert(user); @@ -564,14 +641,14 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { String oldPassword = user.getPassword(); // 调用,校验异常 - assertServiceException(() -> userService.checkOldPassword(id, oldPassword), + assertServiceException(() -> userService.validateOldPassword(id, oldPassword), USER_PASSWORD_FAILED); // 校验调用 verify(passwordEncoder, times(1)).matches(eq(oldPassword), eq(user.getPassword())); } @Test - public void testUsersByPostIds() { + public void testUserListByPostIds() { // 准备参数 Collection postIds = asSet(10L, 20L); // mock user1 数据 @@ -585,12 +662,114 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { userPostMapper.insert(new UserPostDO().setUserId(user2.getId()).setPostId(100L)); // 调用 - List result = userService.getUsersByPostIds(postIds); + List result = userService.getUserListByPostIds(postIds); // 断言 assertEquals(1, result.size()); assertEquals(user1, result.get(0)); } + @Test + public void testGetUserList() { + // mock 数据 + AdminUserDO user = randomAdminUserDO(); + userMapper.insert(user); + // 测试 id 不匹配 + userMapper.insert(randomAdminUserDO()); + // 准备参数 + Collection ids = singleton(user.getId()); + + // 调用 + List result = userService.getUserList(ids); + // 断言 + assertEquals(1, result.size()); + assertEquals(user, result.get(0)); + } + + @Test + public void testGetUserMap() { + // mock 数据 + AdminUserDO user = randomAdminUserDO(); + userMapper.insert(user); + // 测试 id 不匹配 + userMapper.insert(randomAdminUserDO()); + // 准备参数 + Collection ids = singleton(user.getId()); + + // 调用 + Map result = userService.getUserMap(ids); + // 断言 + assertEquals(1, result.size()); + assertEquals(user, result.get(user.getId())); + } + + @Test + public void testGetUserListByNickname() { + // mock 数据 + AdminUserDO user = randomAdminUserDO(o -> o.setNickname("芋头")); + userMapper.insert(user); + // 测试 nickname 不匹配 + userMapper.insert(randomAdminUserDO(o -> o.setNickname("源码"))); + // 准备参数 + String nickname = "芋"; + + // 调用 + List result = userService.getUserListByNickname(nickname); + // 断言 + assertEquals(1, result.size()); + assertEquals(user, result.get(0)); + } + + @Test + public void testGetUserListByStatus() { + // mock 数据 + AdminUserDO user = randomAdminUserDO(o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus())); + userMapper.insert(user); + // 测试 status 不匹配 + userMapper.insert(randomAdminUserDO(o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus()))); + // 准备参数 + Integer status = CommonStatusEnum.DISABLE.getStatus(); + + // 调用 + List result = userService.getUserListByStatus(status); + // 断言 + assertEquals(1, result.size()); + assertEquals(user, result.get(0)); + } + + @Test + public void testValidateUserList_success() { + // mock 数据 + AdminUserDO userDO = randomAdminUserDO().setStatus(CommonStatusEnum.ENABLE.getStatus()); + userMapper.insert(userDO); + // 准备参数 + List ids = singletonList(userDO.getId()); + + // 调用,无需断言 + userService.validateUserList(ids); + } + + @Test + public void testValidateUserList_notFound() { + // 准备参数 + List ids = singletonList(randomLongId()); + + // 调用, 并断言异常 + assertServiceException(() -> userService.validateUserList(ids), USER_NOT_EXISTS); + } + + @Test + public void testValidateUserList_notEnable() { + // mock 数据 + AdminUserDO userDO = randomAdminUserDO().setStatus(CommonStatusEnum.DISABLE.getStatus()); + userMapper.insert(userDO); + // 准备参数 + List ids = singletonList(userDO.getId()); + + // 调用, 并断言异常 + assertServiceException(() -> userService.validateUserList(ids), USER_IS_DISABLE, + userDO.getNickname()); + } + // ========== 随机对象 ========== @SafeVarargs diff --git a/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/clean.sql b/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/clean.sql index 1be69f28b..785e5ea05 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/clean.sql +++ b/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/clean.sql @@ -4,16 +4,18 @@ DELETE FROM "system_role"; DELETE FROM "system_role_menu"; DELETE FROM "system_menu"; DELETE FROM "system_user_role"; -DELETE FROM "system_user_post"; DELETE FROM "system_dict_type"; DELETE FROM "system_user_session"; DELETE FROM "system_post"; +DELETE FROM "system_user_post"; +DELETE FROM "system_notice"; DELETE FROM "system_login_log"; DELETE FROM "system_operate_log"; DELETE FROM "system_users"; DELETE FROM "system_sms_channel"; DELETE FROM "system_sms_template"; DELETE FROM "system_sms_log"; +DELETE FROM "system_sms_code"; DELETE FROM "system_error_code"; DELETE FROM "system_social_user"; DELETE FROM "system_social_user_bind"; diff --git a/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/create_tables.sql b/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/create_tables.sql index bf135f39e..e665f6a3b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/create_tables.sql +++ b/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/create_tables.sql @@ -162,7 +162,6 @@ CREATE TABLE IF NOT EXISTS `system_user_post`( PRIMARY KEY (`id`) ) COMMENT ='用户岗位表'; - CREATE TABLE IF NOT EXISTS "system_notice" ( "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, "title" varchar(50) NOT NULL COMMENT '公告标题', @@ -250,63 +249,6 @@ CREATE TABLE IF NOT EXISTS "system_users" ( primary key ("id") ) comment '用户信息表'; -CREATE TABLE IF NOT EXISTS "inf_api_access_log" ( - "id" bigint not null GENERATED BY DEFAULT AS IDENTITY, - "trace_id" varchar(64) not null default '', - "user_id" bigint not null default '0', - "user_type" tinyint not null default '0', - "application_name" varchar(50) not null, - "request_method" varchar(16) not null default '', - "request_url" varchar(255) not null default '', - "request_params" varchar(8000) not null default '', - "user_ip" varchar(50) not null, - "user_agent" varchar(512) not null, - "begin_time" timestamp not null, - "end_time" timestamp not null, - "duration" integer not null, - "result_code" integer not null default '0', - "result_msg" varchar(512) default '', - "creator" varchar(64) default '', - "create_time" timestamp not null default current_timestamp, - "updater" varchar(64) default '', - "update_time" timestamp not null default current_timestamp, - "deleted" bit not null default false, - "tenant_id" bigint not null default '0', - primary key ("id") -) COMMENT 'API 访问日志表'; - -CREATE TABLE IF NOT EXISTS "inf_api_error_log" ( - "id" bigint not null GENERATED BY DEFAULT AS IDENTITY, - "trace_id" varchar(64) not null, - "user_id" bigint not null default '0', - "user_type" tinyint not null default '0', - "application_name" varchar(50) not null, - "request_method" varchar(16) not null, - "request_url" varchar(255) not null, - "request_params" varchar(8000) not null, - "user_ip" varchar(50) not null, - "user_agent" varchar(512) not null, - "exception_time" timestamp not null, - "exception_name" varchar(128) not null default '', - "exception_message" clob not null, - "exception_root_cause_message" clob not null, - "exception_stack_trace" clob not null, - "exception_class_name" varchar(512) not null, - "exception_file_name" varchar(512) not null, - "exception_method_name" varchar(512) not null, - "exception_line_number" integer not null, - "process_status" tinyint not null, - "process_time" timestamp default null, - "process_user_id" bigint default '0', - "creator" varchar(64) default '', - "create_time" timestamp not null default current_timestamp, - "updater" varchar(64) default '', - "update_time" timestamp not null default current_timestamp, - "deleted" bit not null default false, - "tenant_id" bigint not null default '0', - primary key ("id") -) COMMENT '系统异常日志'; - CREATE TABLE IF NOT EXISTS "system_sms_channel" ( "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, "signature" varchar(10) NOT NULL, @@ -377,6 +319,24 @@ CREATE TABLE IF NOT EXISTS "system_sms_log" ( PRIMARY KEY ("id") ) COMMENT '短信日志'; +CREATE TABLE IF NOT EXISTS "system_sms_code" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "mobile" varchar(11) NOT NULL, + "code" varchar(11) NOT NULL, + "scene" bigint NOT NULL, + "create_ip" varchar NOT NULL, + "today_index" int NOT NULL, + "used" bit NOT NULL DEFAULT FALSE, + "used_time" timestamp DEFAULT NULL, + "used_ip" varchar NULL, + "creator" varchar(64) DEFAULT '', + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar(64) DEFAULT '', + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + PRIMARY KEY ("id") +) COMMENT '短信日志'; + CREATE TABLE IF NOT EXISTS "system_error_code" ( "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, "type" tinyint NOT NULL DEFAULT '0', diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml index 546eff421..40b35b9cb 100644 --- a/yudao-server/pom.xml +++ b/yudao-server/pom.xml @@ -84,7 +84,6 @@ - org.springframework.boot diff --git a/yudao-server/src/main/java/cn/iocoder/yudao/module/shop/controller/app/AppShopOrderController.java b/yudao-server/src/main/java/cn/iocoder/yudao/module/shop/controller/app/AppShopOrderController.java index 9e66b17a4..ef209d765 100644 --- a/yudao-server/src/main/java/cn/iocoder/yudao/module/shop/controller/app/AppShopOrderController.java +++ b/yudao-server/src/main/java/cn/iocoder/yudao/module/shop/controller/app/AppShopOrderController.java @@ -7,8 +7,8 @@ import cn.iocoder.yudao.module.pay.service.order.PayOrderService; import cn.iocoder.yudao.module.pay.api.order.dto.PayOrderCreateReqDTO; import cn.iocoder.yudao.module.pay.util.PaySeqUtils; import cn.iocoder.yudao.module.shop.controller.app.vo.AppShopOrderCreateRespVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; @@ -23,7 +23,7 @@ import java.time.LocalDateTime; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP; -@Api(tags = "用户 APP - 商城订单") +@Tag(name = "用户 APP - 商城订单") @RestController @RequestMapping("/shop/order") @Validated @@ -34,7 +34,7 @@ public class AppShopOrderController { private PayOrderService payOrderService; @PostMapping("/create") - @ApiOperation("创建商城订单") + @Operation(summary = "创建商城订单") // @PreAuthenticated // TODO 暂时不加登陆验证,前端暂时没做好 public CommonResult create() { // 假装创建商城订单 @@ -57,14 +57,14 @@ public class AppShopOrderController { } @PostMapping("/pay-notify") - @ApiOperation("支付回调") + @Operation(summary = "支付回调") public CommonResult payNotify(@RequestBody @Valid PayOrderNotifyReqDTO reqVO) { log.info("[payNotify][回调成功]"); return success(true); } @PostMapping("/refund-notify") - @ApiOperation("退款回调") + @Operation(summary = "退款回调") public CommonResult refundNotify(@RequestBody @Valid PayRefundNotifyReqDTO reqVO) { log.info("[refundNotify][回调成功]"); return success(true); diff --git a/yudao-server/src/main/java/cn/iocoder/yudao/module/shop/controller/app/vo/AppShopOrderCreateRespVO.java b/yudao-server/src/main/java/cn/iocoder/yudao/module/shop/controller/app/vo/AppShopOrderCreateRespVO.java index 06a677dbb..0a8c30b36 100644 --- a/yudao-server/src/main/java/cn/iocoder/yudao/module/shop/controller/app/vo/AppShopOrderCreateRespVO.java +++ b/yudao-server/src/main/java/cn/iocoder/yudao/module/shop/controller/app/vo/AppShopOrderCreateRespVO.java @@ -1,21 +1,20 @@ package cn.iocoder.yudao.module.shop.controller.app.vo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; -@ApiModel("用户 APP - 商城订单创建 Response VO") +@Schema(description = "用户 APP - 商城订单创建 Response VO") @Data @Builder @AllArgsConstructor public class AppShopOrderCreateRespVO { - @ApiModelProperty(value = "商城订单编号", required = true, example = "1024") + @Schema(description = "商城订单编号", required = true, example = "1024") private Long id; - @ApiModelProperty(value = "支付订单编号", required = true, example = "2048") + @Schema(description = "支付订单编号", required = true, example = "2048") private Long payOrderId; } diff --git a/yudao-server/src/main/java/cn/iocoder/yudao/server/controller/DefaultController.java b/yudao-server/src/main/java/cn/iocoder/yudao/server/controller/DefaultController.java index 4cf1005d8..ab328b429 100644 --- a/yudao-server/src/main/java/cn/iocoder/yudao/server/controller/DefaultController.java +++ b/yudao-server/src/main/java/cn/iocoder/yudao/server/controller/DefaultController.java @@ -27,4 +27,12 @@ public class DefaultController { "[微信公众号 yudao-module-mp - 已禁用][参考 https://doc.iocoder.cn/mp/build/ 开启]"); } + @RequestMapping(value = {"/admin-api/product/**", // 商品中心 + "/admin-api/trade/**", // 交易中心 + "/admin-api/promotion/**"}) // 营销中心 + public CommonResult mall404() { + return CommonResult.error(NOT_IMPLEMENTED.getCode(), + "[商城 yudao-module-mp - 已禁用][参考 https://doc.iocoder.cn/mall/build/ 开启]"); + } + } diff --git a/yudao-server/src/main/resources/application.yaml b/yudao-server/src/main/resources/application.yaml index c443218aa..29ab3b1d1 100644 --- a/yudao-server/src/main/resources/application.yaml +++ b/yudao-server/src/main/resources/application.yaml @@ -34,6 +34,21 @@ spring: redis: time-to-live: 1h # 设置过期时间为 1 小时 +--- #################### 接口文档配置 #################### + +springdoc: + api-docs: + enabled: true + path: /v3/api-docs + swagger-ui: + enabled: true + path: /swagger-ui + +knife4j: + enable: true + setting: + language: zh_cn + # 工作流 Flowable 配置 flowable: # 1. false: 默认值,Flowable 启动时,对比数据库表中保存的版本,如果不匹配。将抛出异常 @@ -99,10 +114,13 @@ yudao: maxOnlineCount: 0 # 最大连接人数 sessionMap: true # 保存sessionMap swagger: - title: 管理后台 - description: 提供管理员管理的所有功能 + title: 芋道快速开发平台 + description: 提供管理后台、用户 App 的所有功能 version: ${yudao.info.version} - base-package: ${yudao.info.base-package} + url: ${yudao.web.admin-ui.url} + email: xingyu4j@vip.qq.com + license: MIT + license-url: https://gitee.com/zhijiantianya/ruoyi-vue-pro/blob/master/LICENSE captcha: enable: true # 验证码的开关,默认为 true codegen: diff --git a/yudao-ui-admin-vue3/.env.dev b/yudao-ui-admin-vue3/.env.dev index 3b85e4819..658a4f62d 100644 --- a/yudao-ui-admin-vue3/.env.dev +++ b/yudao-ui-admin-vue3/.env.dev @@ -4,10 +4,10 @@ NODE_ENV=production VITE_DEV=false # 请求路径 -VITE_BASE_URL='http://localhost:48080' +VITE_BASE_URL='http://localhost:58080' # 上传路径 -VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload' +VITE_UPLOAD_URL='http://localhost:58080/admin-api/infra/file/upload' # 接口前缀 VITE_API_BASEPATH=/dev-api diff --git a/yudao-ui-admin-vue3/.env.pro b/yudao-ui-admin-vue3/.env.pro index 8348e02e3..0c91638b0 100644 --- a/yudao-ui-admin-vue3/.env.pro +++ b/yudao-ui-admin-vue3/.env.pro @@ -4,10 +4,10 @@ NODE_ENV=production VITE_DEV=false # 请求路径 -VITE_BASE_URL='http://localhost:48080' +VITE_BASE_URL='http://localhost:58080' # 上传路径 -VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload' +VITE_UPLOAD_URL='http://localhost:58080/admin-api/infra/file/upload' # 接口前缀 VITE_API_BASEPATH= diff --git a/yudao-ui-admin-vue3/.env.test b/yudao-ui-admin-vue3/.env.test index 85e2cf545..72b1c47cd 100644 --- a/yudao-ui-admin-vue3/.env.test +++ b/yudao-ui-admin-vue3/.env.test @@ -4,10 +4,10 @@ NODE_ENV=production VITE_DEV=false # 请求路径 -VITE_BASE_URL='http://localhost:48080' +VITE_BASE_URL='http://localhost:58080' # 上传路径 -VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload' +VITE_UPLOAD_URL='http://localhost:58080/admin-api/infra/file/upload' # 接口前缀 VITE_API_BASEPATH= diff --git a/yudao-ui-admin-vue3/package.json b/yudao-ui-admin-vue3/package.json index 35165c102..7fd3f96ed 100644 --- a/yudao-ui-admin-vue3/package.json +++ b/yudao-ui-admin-vue3/package.json @@ -24,40 +24,52 @@ "lint:pretty": "pretty-quick --staged" }, "dependencies": { - "@iconify/iconify": "^3.0.1", - "@vueuse/core": "^9.11.0", + "@form-create/designer": "^3.1.0", + "@form-create/element-ui": "^3.1.17", + "@iconify/iconify": "^3.1.0", + "@vueuse/core": "^9.11.1", "@wangeditor/editor": "^5.1.23", "@wangeditor/editor-for-vue": "^5.1.10", - "@zxcvbn-ts/core": "^2.1.0", + "@zxcvbn-ts/core": "^2.2.0", "animate.css": "^4.1.1", - "axios": "^1.2.3", + "axios": "^1.2.5", + "bpmn-js-token-simulation": "^0.10.0", + "camunda-bpmn-moddle": "^7.0.1", "cropperjs": "^1.5.13", "crypto-js": "^4.1.1", "dayjs": "^1.11.7", + "diagram-js": "^11.6.0", "echarts": "^5.4.1", "echarts-wordcloud": "^2.1.0", "element-plus": "2.2.28", + "fast-xml-parser": "^4.0.13", + "highlight.js": "^11.7.0", "intro.js": "^6.0.0", "jsencrypt": "^3.3.1", "lodash-es": "^4.17.21", + "min-dash": "^4.0.0", "mitt": "^3.0.0", "nprogress": "^0.2.0", "pinia": "^2.0.29", "qrcode": "^1.5.1", "qs": "^6.11.0", + "steady-xml": "^0.1.0", "url": "^0.11.0", "vue": "3.2.45", "vue-i18n": "9.2.2", "vue-router": "^4.1.6", "vue-types": "^5.0.2", + "vue3-treeselect": "^0.1.10", + "vuedraggable": "^4.1.0", "vxe-table": "^4.3.9", "web-storage-cache": "^1.1.1", - "xe-utils": "^3.5.7" + "xe-utils": "^3.5.7", + "xml-js": "^1.6.11" }, "devDependencies": { "@commitlint/cli": "^17.4.2", "@commitlint/config-conventional": "^17.4.2", - "@iconify/json": "^2.2.8", + "@iconify/json": "^2.2.13", "@intlify/unplugin-vue-i18n": "^0.8.1", "@purge-icons/generated": "^0.9.0", "@types/intro.js": "^5.1.0", @@ -66,12 +78,14 @@ "@types/nprogress": "^0.2.0", "@types/qrcode": "^1.5.0", "@types/qs": "^6.9.7", - "@typescript-eslint/eslint-plugin": "^5.48.2", - "@typescript-eslint/parser": "^5.48.2", - "@vitejs/plugin-legacy": "^3.0.1", + "@typescript-eslint/eslint-plugin": "^5.49.0", + "@typescript-eslint/parser": "^5.49.0", + "@vitejs/plugin-legacy": "^3.0.2", "@vitejs/plugin-vue": "^4.0.0", "@vitejs/plugin-vue-jsx": "^3.0.0", "autoprefixer": "^10.4.13", + "bpmn-js": "^8.9.0", + "bpmn-js-properties-panel": "^0.46.0", "consola": "^2.15.3", "eslint": "^8.32.0", "eslint-config-prettier": "^8.6.0", @@ -83,8 +97,8 @@ "postcss-html": "^1.5.0", "postcss-scss": "^4.0.6", "prettier": "^2.8.3", - "rimraf": "^4.1.1", - "rollup": "^3.10.0", + "rimraf": "^4.1.2", + "rollup": "^3.11.0", "sass": "^1.57.1", "stylelint": "^14.16.1", "stylelint-config-html": "^1.1.0", @@ -94,7 +108,7 @@ "stylelint-order": "^6.0.1", "terser": "^5.16.1", "typescript": "4.9.4", - "unplugin-auto-import": "^0.12.1", + "unplugin-auto-import": "^0.12.2", "unplugin-element-plus": "^0.4.1", "unplugin-vue-components": "^0.22.12", "vite": "4.0.4", @@ -121,4 +135,4 @@ "url": "https://gitee.com/zhijiantianya/ruoyi-vue-pro/issues" }, "homepage": "https://gitee.com/zhijiantianya/ruoyi-vue-pro" -} +} \ No newline at end of file diff --git a/yudao-ui-admin-vue3/pnpm-lock.yaml b/yudao-ui-admin-vue3/pnpm-lock.yaml index 7c0f236be..c5b7b725b 100644 --- a/yudao-ui-admin-vue3/pnpm-lock.yaml +++ b/yudao-ui-admin-vue3/pnpm-lock.yaml @@ -1,10 +1,12 @@ -lockfileVersion: 5.4 +lockfileVersion: 5.3 specifiers: '@commitlint/cli': ^17.4.2 '@commitlint/config-conventional': ^17.4.2 - '@iconify/iconify': ^3.0.1 - '@iconify/json': ^2.2.8 + '@form-create/designer': ^3.1.0 + '@form-create/element-ui': ^3.1.17 + '@iconify/iconify': ^3.1.0 + '@iconify/json': ^2.2.13 '@intlify/unplugin-vue-i18n': ^0.8.1 '@purge-icons/generated': ^0.9.0 '@types/intro.js': ^5.1.0 @@ -13,22 +15,27 @@ specifiers: '@types/nprogress': ^0.2.0 '@types/qrcode': ^1.5.0 '@types/qs': ^6.9.7 - '@typescript-eslint/eslint-plugin': ^5.48.2 - '@typescript-eslint/parser': ^5.48.2 - '@vitejs/plugin-legacy': ^3.0.1 + '@typescript-eslint/eslint-plugin': ^5.49.0 + '@typescript-eslint/parser': ^5.49.0 + '@vitejs/plugin-legacy': ^3.0.2 '@vitejs/plugin-vue': ^4.0.0 '@vitejs/plugin-vue-jsx': ^3.0.0 - '@vueuse/core': ^9.11.0 + '@vueuse/core': ^9.11.1 '@wangeditor/editor': ^5.1.23 '@wangeditor/editor-for-vue': ^5.1.10 - '@zxcvbn-ts/core': ^2.1.0 + '@zxcvbn-ts/core': ^2.2.0 animate.css: ^4.1.1 autoprefixer: ^10.4.13 - axios: ^1.2.3 + axios: ^1.2.5 + bpmn-js: ^8.9.0 + bpmn-js-properties-panel: ^0.46.0 + bpmn-js-token-simulation: ^0.10.0 + camunda-bpmn-moddle: ^7.0.1 consola: ^2.15.3 cropperjs: ^1.5.13 crypto-js: ^4.1.1 dayjs: ^1.11.7 + diagram-js: ^11.6.0 echarts: ^5.4.1 echarts-wordcloud: ^2.1.0 element-plus: 2.2.28 @@ -37,10 +44,13 @@ specifiers: eslint-define-config: ^1.14.0 eslint-plugin-prettier: ^4.2.1 eslint-plugin-vue: ^9.9.0 + fast-xml-parser: ^4.0.13 + highlight.js: ^9.18.5 intro.js: ^6.0.0 jsencrypt: ^3.3.1 lint-staged: ^13.1.0 lodash-es: ^4.17.21 + min-dash: ^4.0.0 mitt: ^3.0.0 nprogress: ^0.2.0 pinia: ^2.0.29 @@ -50,8 +60,8 @@ specifiers: prettier: ^2.8.3 qrcode: ^1.5.1 qs: ^6.11.0 - rimraf: ^4.1.1 - rollup: ^3.10.0 + rimraf: ^4.1.2 + rollup: ^3.11.0 sass: ^1.57.1 stylelint: ^14.16.1 stylelint-config-html: ^1.1.0 @@ -61,7 +71,7 @@ specifiers: stylelint-order: ^6.0.1 terser: ^5.16.1 typescript: 4.9.4 - unplugin-auto-import: ^0.12.1 + unplugin-auto-import: ^0.12.2 unplugin-element-plus: ^0.4.1 unplugin-vue-components: ^0.22.12 url: ^0.11.0 @@ -79,31 +89,42 @@ specifiers: vue-router: ^4.1.6 vue-tsc: ^1.0.24 vue-types: ^5.0.2 + vue3-treeselect: ^0.1.10 + vuedraggable: ^4.1.0 vxe-table: ^4.3.9 web-storage-cache: ^1.1.1 windicss: ^3.5.6 xe-utils: ^3.5.7 + xml-js: ^1.6.11 dependencies: - '@iconify/iconify': 3.0.1 - '@vueuse/core': 9.11.0_vue@3.2.45 + '@form-create/designer': 3.1.0_vue@3.2.45 + '@form-create/element-ui': 3.1.17_vue@3.2.45 + '@iconify/iconify': 3.1.0 + '@vueuse/core': 9.11.1_vue@3.2.45 '@wangeditor/editor': 5.1.23 - '@wangeditor/editor-for-vue': 5.1.12_3apfu3xbp6awzuex7ed3sbrv6y - '@zxcvbn-ts/core': 2.1.0 + '@wangeditor/editor-for-vue': 5.1.12_d81e5a6ee17f816cd097f907b90635f6 + '@zxcvbn-ts/core': 2.2.0 animate.css: 4.1.1 - axios: 1.2.3 + axios: 1.2.5 + bpmn-js-token-simulation: 0.10.0 + camunda-bpmn-moddle: 7.0.1 cropperjs: 1.5.13 crypto-js: 4.1.1 dayjs: 1.11.7 + diagram-js: 11.6.0 echarts: 5.4.1 echarts-wordcloud: 2.1.0_echarts@5.4.1 element-plus: 2.2.28_vue@3.2.45 + fast-xml-parser: 4.0.15 + highlight.js: 9.18.5 intro.js: 6.0.0 jsencrypt: 3.3.1 lodash-es: 4.17.21 + min-dash: 4.0.0 mitt: 3.0.0 nprogress: 0.2.0 - pinia: 2.0.29_prq2uz4lho2pwp6irk4cfkrxwu + pinia: 2.0.29_typescript@4.9.4+vue@3.2.45 qrcode: 1.5.1 qs: 6.11.0 url: 0.11.0 @@ -111,14 +132,17 @@ dependencies: vue-i18n: 9.2.2_vue@3.2.45 vue-router: 4.1.6_vue@3.2.45 vue-types: 5.0.2_vue@3.2.45 + vue3-treeselect: 0.1.10_vue@3.2.45 + vuedraggable: 4.1.0_vue@3.2.45 vxe-table: 4.3.9_vue@3.2.45+xe-utils@3.5.7 web-storage-cache: 1.1.1 xe-utils: 3.5.7 + xml-js: 1.6.11 devDependencies: '@commitlint/cli': 17.4.2 '@commitlint/config-conventional': 17.4.2 - '@iconify/json': 2.2.8 + '@iconify/json': 2.2.13 '@intlify/unplugin-vue-i18n': 0.8.1_vue-i18n@9.2.2 '@purge-icons/generated': 0.9.0 '@types/intro.js': 5.1.0 @@ -127,38 +151,40 @@ devDependencies: '@types/nprogress': 0.2.0 '@types/qrcode': 1.5.0 '@types/qs': 6.9.7 - '@typescript-eslint/eslint-plugin': 5.48.2_caon6io6stgpr7lz2rtbhekxqy - '@typescript-eslint/parser': 5.48.2_7uibuqfxkfaozanbtbziikiqje - '@vitejs/plugin-legacy': 3.0.1_terser@5.16.1+vite@4.0.4 + '@typescript-eslint/eslint-plugin': 5.49.0_4537ad3e2b6da5832851075417e35a92 + '@typescript-eslint/parser': 5.49.0_eslint@8.32.0+typescript@4.9.4 + '@vitejs/plugin-legacy': 3.0.2_terser@5.16.1+vite@4.0.4 '@vitejs/plugin-vue': 4.0.0_vite@4.0.4+vue@3.2.45 '@vitejs/plugin-vue-jsx': 3.0.0_vite@4.0.4+vue@3.2.45 autoprefixer: 10.4.13_postcss@8.4.21 + bpmn-js: 8.10.0 + bpmn-js-properties-panel: 0.46.0_bpmn-js@8.10.0 consola: 2.15.3 eslint: 8.32.0 eslint-config-prettier: 8.6.0_eslint@8.32.0 eslint-define-config: 1.14.0 - eslint-plugin-prettier: 4.2.1_cn4lalcyadplruoxa5mhp7j3dq + eslint-plugin-prettier: 4.2.1_1378b02c5800deb8d1d7075877fd3b1c eslint-plugin-vue: 9.9.0_eslint@8.32.0 lint-staged: 13.1.0 postcss: 8.4.21 postcss-html: 1.5.0 postcss-scss: 4.0.6_postcss@8.4.21 prettier: 2.8.3 - rimraf: 4.1.1 - rollup: 3.10.0 + rimraf: 4.1.2 + rollup: 3.11.0 sass: 1.57.1 stylelint: 14.16.1 - stylelint-config-html: 1.1.0_kbto3rg3njmczth2rrsgfnlsqa + stylelint-config-html: 1.1.0_5066edc4db6a582cccfa8c6462b57280 stylelint-config-prettier: 9.0.4_stylelint@14.16.1 stylelint-config-recommended: 9.0.0_stylelint@14.16.1 stylelint-config-standard: 29.0.0_stylelint@14.16.1 stylelint-order: 6.0.1_stylelint@14.16.1 terser: 5.16.1 typescript: 4.9.4 - unplugin-auto-import: 0.12.1_ta7poabqclszbk6bszysx4wo3y - unplugin-element-plus: 0.4.1_rollup@3.10.0+vite@4.0.4 - unplugin-vue-components: 0.22.12_rollup@3.10.0+vue@3.2.45 - vite: 4.0.4_zxbrnrc4iyldik6mikh3pswz4i + unplugin-auto-import: 0.12.2_f0a1627ed0f26084cd4076d76d79ecd8 + unplugin-element-plus: 0.4.1_rollup@3.11.0+vite@4.0.4 + unplugin-vue-components: 0.22.12_rollup@3.11.0+vue@3.2.45 + vite: 4.0.4_cdc316c45c4616342bcc428fb7cad9e2 vite-plugin-compression: 0.5.1_vite@4.0.4 vite-plugin-ejs: 1.6.4 vite-plugin-eslint: 1.8.1_eslint@8.32.0+vite@4.0.4 @@ -436,6 +462,14 @@ packages: - supports-color dev: true + /@babel/runtime-corejs3/7.20.7: + resolution: {integrity: sha512-jr9lCZ4RbRQmCR28Q8U8Fu49zvFqLxTY9AMOUz+iyMohMoAgpEcVxY+wJNay99oXOpOcCTODkk70NDN2aaJEeg==} + engines: {node: '>=6.9.0'} + dependencies: + core-js-pure: 3.27.2 + regenerator-runtime: 0.13.11 + dev: false + /@babel/runtime/7.20.1: resolution: {integrity: sha512-mrzLkl6U9YLF8qpqI7TB82PESyEGjm/0Ly91jG575eVxMMlb8fYfOXFZIJ8XfLrJZQbm7dlKry2bJmXBUEkdFg==} engines: {node: '>=6.9.0'} @@ -443,8 +477,8 @@ packages: regenerator-runtime: 0.13.11 dev: false - /@babel/standalone/7.20.6: - resolution: {integrity: sha512-u5at/CbBLETf7kx2LOY4XdhseD79Y099WZKAOMXeT8qvd9OSR515my2UNBBLY4qIht/Qi9KySeQHQwQwxJN4Sw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/@babel/standalone/-/standalone-7.20.6.tgz} + /@babel/standalone/7.20.14: + resolution: {integrity: sha512-zxdQD6+eMQumJFPOLpOZE34JAAGrZPMXCKvHR7Mtat/l+nHDOxlit5u85HDk5WkBXmvN5PhUMeimiC95KXD9+A==} engines: {node: '>=6.9.0'} dev: true @@ -510,6 +544,31 @@ packages: '@babel/helper-validator-identifier': 7.19.1 to-fast-properties: 2.0.0 + /@bpmn-io/diagram-js-ui/0.2.2: + resolution: {integrity: sha512-IgOIxOwoqsFB2mMPdXtcbPVPjdYkZ3huW7ipowYLhg5jdRGHlBronQ+LER+lfWro6sPtzEsw7qX8D8Yq9M2S5g==} + dependencies: + htm: 3.1.1 + preact: 10.11.3 + dev: false + + /@bpmn-io/element-templates-validator/0.2.0: + resolution: {integrity: sha512-/ogp0+6zUFdoiY09NYaHL5JtapB8zN1spG8hpML96qetXDCODRxnsqlHTvSwxtZHUDcgun+lxcK8b4wgtCP+6Q==} + dependencies: + '@camunda/element-templates-json-schema': 0.4.0 + json-source-map: 0.6.1 + min-dash: 3.8.1 + dev: true + + /@bpmn-io/extract-process-variables/0.4.5: + resolution: {integrity: sha512-LtHx5b9xqS8avRLrq/uTlKhWzMeV3bWQKIdDic2bdo5n9roitX13GRb01u2S0hSsKDWEhXQtydFYN2b6G7bqfw==} + dependencies: + min-dash: 3.8.1 + dev: true + + /@camunda/element-templates-json-schema/0.4.0: + resolution: {integrity: sha512-M5xW61ba7z2maBxfoT4c1bjuLD8OIL7863et/hULiNG6+R/B9CZ4Qze1juuIfXv4zpF2fYSuUsTPkTtiZrcspQ==} + dev: true + /@commitlint/cli/17.4.2: resolution: {integrity: sha512-0rPGJ2O1owhpxMIXL9YJ2CgPkdrFLKZElIZHXDN8L8+qWK1DGH7Q7IelBT1pchXTYTuDlqkOTdh//aTvT3bSUA==} engines: {node: '>=v14'} @@ -599,12 +658,12 @@ packages: '@types/node': 18.11.18 chalk: 4.1.2 cosmiconfig: 8.0.0 - cosmiconfig-typescript-loader: 4.2.0_bxtyj3et3xbsdyxhh3oblnfbj4 + cosmiconfig-typescript-loader: 4.2.0_0de784ec93ddc321e2e73edc15b4a14f lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 lodash.uniq: 4.5.0 resolve-from: 5.0.0 - ts-node: 10.9.1_awa2wsr5thmg3i7jqycphctjfq + ts-node: 10.9.1_0581ab4a3d99d86da3e98604f38a692c typescript: 4.9.4 transitivePeerDependencies: - '@swc/core' @@ -685,7 +744,7 @@ packages: '@jridgewell/trace-mapping': 0.3.9 dev: true - /@csstools/selector-specificity/2.0.2_wajs5nedgkikc5pcuwett7legi: + /@csstools/selector-specificity/2.0.2_b0132eb4833290a175e2a58939fd6432: resolution: {integrity: sha512-IkpVW/ehM1hWKln4fCA3NzJU8KwD+kIOvPZA4cqxoJHtE21CCzjyp+Kxbu0i5I4tBNOlXPL9mjwnWlL0VEG4Fg==} engines: {node: ^12 || ^14 || >=16} peerDependencies: @@ -934,6 +993,100 @@ packages: '@floating-ui/core': 1.0.2 dev: false + /@form-create/component-elm-checkbox/3.1.15: + resolution: {integrity: sha512-bAl3k0p76wwMX0OxeR8KAEiUl2RP1Jl1kAqbjD762EcSXGgaXgP94v9ag1JhUoiwZkSKWl6IF+e/utjEonRSFw==} + dependencies: + '@form-create/utils': 3.1.15 + dev: false + + /@form-create/component-elm-frame/3.1.15: + resolution: {integrity: sha512-78WbMpMLTYwTo3QP7Fa+N2VF/u1vmRuwDmiobtBtVg9EE7m6//bQV96ibnLNXX27MD41gIg+o1GUJtx/qxZ8Ew==} + dependencies: + '@form-create/utils': 3.1.15 + dev: false + + /@form-create/component-elm-group/3.1.15: + resolution: {integrity: sha512-V/oVxHf9rHqqMHRV0XRVED9EYFCVZ8Tv/EbbIN/4rORruHtzdQOH8I0QHQ9T4vZO9Q4eblApzcJb8Y7bbHX23Q==} + dependencies: + '@form-create/utils': 3.1.15 + dev: false + + /@form-create/component-elm-radio/3.1.15: + resolution: {integrity: sha512-qAf1VlhrUvMlgzkz6BYLRn0UOLahkTI/cbzt8nkp5PL1oGoSXp5xqIOtHMjbnGEkEXW57kjRKI5Q7UjzIhYmvQ==} + dependencies: + '@form-create/utils': 3.1.15 + dev: false + + /@form-create/component-elm-select/3.1.15: + resolution: {integrity: sha512-ZnvPn/TGqgFDed7bKabjRvlwlQ8RYq5WCG9Iy63d2igC8577tv5QTI2rNvfGfxxH/254MPwgNlA94JukxzEOTw==} + dependencies: + '@form-create/utils': 3.1.15 + dev: false + + /@form-create/component-elm-tree/3.1.15: + resolution: {integrity: sha512-4VPN406A8Mvannn8P/2DvStqDYFfDHZ+ILG/0JndOyfe+GdYdSA5SwD3LfC4zD6AhpGrkOJXbd4YYXlBUtzt8g==} + dependencies: + '@form-create/utils': 3.1.15 + dev: false + + /@form-create/component-elm-upload/3.1.17: + resolution: {integrity: sha512-9FToAS1rQAS1KBq5YK473i3EpGGwHAerqjuoiKiH4wlaGsJma+nGtRui1SSAF4r4QfWGKuSGZJmPtT6EMP4w8Q==} + dependencies: + '@form-create/utils': 3.1.15 + dev: false + + /@form-create/component-subform/3.1.5: + resolution: {integrity: sha512-JHNEFGuwpnjGvCJ0I0GCqPL5al0qXoN4ymnRBpm+oL+6MMo5bz1kUyoqMX1MutuC96gHTqpeqc67hssi8g2mIw==} + dev: false + + /@form-create/component-wangeditor/3.1.12: + resolution: {integrity: sha512-ncsHFCiBY4veyD0yj0kWz+hqEjvY8VGTCJYpYL/b7/8dnPAEaSn9fwOKc32eyZbb8YJXwt3BivvFBx3aMj0cTg==} + dependencies: + wangeditor: 4.7.15 + dev: false + + /@form-create/core/3.1.17_vue@3.2.45: + resolution: {integrity: sha512-XGsrmUR5nQEvDvxhB035df62iunSA91oQ77XbGvfaoi8Sz/EBos7xbVdIXNfACxdLMedy33+LBVGIrEHU8UNjw==} + peerDependencies: + vue: ^3.1.0 + dependencies: + '@form-create/utils': 3.1.15 + vue: 3.2.45 + dev: false + + /@form-create/designer/3.1.0_vue@3.2.45: + resolution: {integrity: sha512-+YH/MkInTyL1bNqX6BSeixPlNUxyeqMvy5zrC97nzf+m87SuBny+qFECEkMWhtQ4GTAIy91DjxQM2KJ6QTlB4w==} + dependencies: + '@form-create/component-wangeditor': 3.1.12 + '@form-create/element-ui': 3.1.17_vue@3.2.45 + '@form-create/utils': 3.1.15 + vuedraggable: 4.1.0_vue@3.2.45 + transitivePeerDependencies: + - vue + dev: false + + /@form-create/element-ui/3.1.17_vue@3.2.45: + resolution: {integrity: sha512-MQ/ozkH8Ckx1rgzUcrQmqqfg3SCOBb6AYIOn6YcF/H+iid7xbq16qJjPa0sAKNlO3WC6ak3ucF6KuWu4R7uChw==} + peerDependencies: + vue: ^3.1.0 + dependencies: + '@form-create/component-elm-checkbox': 3.1.15 + '@form-create/component-elm-frame': 3.1.15 + '@form-create/component-elm-group': 3.1.15 + '@form-create/component-elm-radio': 3.1.15 + '@form-create/component-elm-select': 3.1.15 + '@form-create/component-elm-tree': 3.1.15 + '@form-create/component-elm-upload': 3.1.17 + '@form-create/component-subform': 3.1.5 + '@form-create/core': 3.1.17_vue@3.2.45 + '@form-create/utils': 3.1.15 + vue: 3.2.45 + dev: false + + /@form-create/utils/3.1.15: + resolution: {integrity: sha512-tP6Z/c2XC6OYrI8D9/XWvJc2h6apsyMFTy051sY+tCcxppqyR7dBEEXmgfWOrAr980N7k10g27kwJ9TdVn+bfw==} + dev: false + /@humanwhocodes/config-array/0.11.8: resolution: {integrity: sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==} engines: {node: '>=10.10.0'} @@ -955,20 +1108,20 @@ packages: dev: true /@iconify/iconify/2.1.2: - resolution: {integrity: sha512-QcUzFeEWkE/mW+BVtEGmcWATClcCOIJFiYUD/PiCWuTcdEA297o8D4oN6Ra44WrNOHu1wqNW4J0ioaDIiqaFOQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/@iconify/iconify/-/iconify-2.1.2.tgz} + resolution: {integrity: sha512-QcUzFeEWkE/mW+BVtEGmcWATClcCOIJFiYUD/PiCWuTcdEA297o8D4oN6Ra44WrNOHu1wqNW4J0ioaDIiqaFOQ==} dependencies: cross-fetch: 3.1.5 transitivePeerDependencies: - encoding dev: true - /@iconify/iconify/3.0.1: - resolution: {integrity: sha512-OPqVBTh8YsfrYZRVFv3OkmFNLqacM0dy/Oiw1h2wO+RZW5LieNGHlG2f9pzaeVRFWbEB8LHTeo8mcwgUTUbibQ==} + /@iconify/iconify/3.1.0: + resolution: {integrity: sha512-Xyz+N5NSIiHj7G228CvFUcMKBz3BbpUTAuPnK2ariEUM7891F8ysD6Gh8782f3En1U4Qz70F0tzuyF8BhCfTQg==} dependencies: '@iconify/types': 2.0.0 - /@iconify/json/2.2.8: - resolution: {integrity: sha512-Vusnz/QRrTmGFzzmZ1Mf6mG2OEbBWLrd/gXgaBpCbjP/abDLdKd7+DMRJlaZA/jqMJ0rsIL0juZ9FwApBnh/ww==} + /@iconify/json/2.2.13: + resolution: {integrity: sha512-TgTGzEhU2o0gGrkke3hVbkVtZB8EcbCdNR4X6ZbXJsApMuFghS4s+yuEbGHw+mMa3sp40L5qRi7wFU6Q47ysfw==} dependencies: '@iconify/types': 2.0.0 pathe: 1.0.0 @@ -1005,12 +1158,14 @@ packages: '@intlify/message-compiler': 9.2.2 '@intlify/shared': 9.2.2 '@intlify/vue-devtools': 9.2.2 + dev: false /@intlify/devtools-if/9.2.2: resolution: {integrity: sha512-4ttr/FNO29w+kBbU7HZ/U0Lzuh2cRDhP8UlWOtV9ERcjHzuyXVZmjyleESK6eVP60tGC9QtQW9yZE+JeRhDHkg==} engines: {node: '>= 14'} dependencies: '@intlify/shared': 9.2.2 + dev: false /@intlify/message-compiler/9.2.2: resolution: {integrity: sha512-IUrQW7byAKN2fMBe8z6sK6riG1pue95e5jfokn8hA5Q3Bqy4MBJ5lJAofUsawQJYHeoPJ7svMDyBaVJ4d0GTtA==} @@ -1018,6 +1173,7 @@ packages: dependencies: '@intlify/shared': 9.2.2 source-map: 0.6.1 + dev: false /@intlify/message-compiler/9.3.0-beta.16: resolution: {integrity: sha512-CGQI3xRcs1ET75eDQ0DUy3MRYOqTauRIIgaMoISKiF83gqRWg93FqN8lGMKcpBqaF4tI0JhsfosCaGiBL9+dnw==} @@ -1030,6 +1186,7 @@ packages: /@intlify/shared/9.2.2: resolution: {integrity: sha512-wRwTpsslgZS5HNyM7uDQYZtxnbI12aGiBZURX3BTR9RFIKKRWpllTsgzHWvj3HKm3Y2Sh5LPC1r0PDCKEhVn9Q==} engines: {node: '>= 14'} + dev: false /@intlify/shared/9.3.0-beta.16: resolution: {integrity: sha512-kXbm4svALe3lX+EjdJxfnabOphqS4yQ1Ge/iIlR8tvUiYRCoNz3hig1M4336iY++Dfx5ytEQJPNjIcknNIuvig==} @@ -1074,6 +1231,7 @@ packages: dependencies: '@intlify/core-base': 9.2.2 '@intlify/shared': 9.2.2 + dev: false /@jridgewell/gen-mapping/0.1.1: resolution: {integrity: sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz} @@ -1164,7 +1322,7 @@ packages: /@purge-icons/generated/0.9.0: resolution: {integrity: sha512-s2t+1oVtGDV6KtqfCXtUOhxfeYvOdDF90IVm+nMs/6bUP0HeGZLslguuL/AibpwtfL4FA/oCsIu/RhwapgAdJw==} dependencies: - '@iconify/iconify': 3.0.1 + '@iconify/iconify': 3.1.0 dev: true /@rollup/pluginutils/4.2.1: @@ -1175,7 +1333,7 @@ packages: picomatch: 2.3.1 dev: true - /@rollup/pluginutils/5.0.2_rollup@3.10.0: + /@rollup/pluginutils/5.0.2_rollup@3.11.0: resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1187,7 +1345,7 @@ packages: '@types/estree': 1.0.0 estree-walker: 2.0.2 picomatch: 2.3.1 - rollup: 3.10.0 + rollup: 3.11.0 dev: true /@sxzz/popperjs-es/2.11.7: @@ -1296,9 +1454,10 @@ packages: /@types/web-bluetooth/0.0.16: resolution: {integrity: sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==} + dev: false - /@typescript-eslint/eslint-plugin/5.48.2_caon6io6stgpr7lz2rtbhekxqy: - resolution: {integrity: sha512-sR0Gja9Ky1teIq4qJOl0nC+Tk64/uYdX+mi+5iB//MH8gwyx8e3SOyhEzeLZEFEEfCaLf8KJq+Bd/6je1t+CAg==} + /@typescript-eslint/eslint-plugin/5.49.0_4537ad3e2b6da5832851075417e35a92: + resolution: {integrity: sha512-IhxabIpcf++TBaBa1h7jtOWyon80SXPRLDq0dVz5SLFC/eW6tofkw/O7Ar3lkx5z5U6wzbKDrl2larprp5kk5Q==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: '@typescript-eslint/parser': ^5.0.0 @@ -1308,10 +1467,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.48.2_7uibuqfxkfaozanbtbziikiqje - '@typescript-eslint/scope-manager': 5.48.2 - '@typescript-eslint/type-utils': 5.48.2_7uibuqfxkfaozanbtbziikiqje - '@typescript-eslint/utils': 5.48.2_7uibuqfxkfaozanbtbziikiqje + '@typescript-eslint/parser': 5.49.0_eslint@8.32.0+typescript@4.9.4 + '@typescript-eslint/scope-manager': 5.49.0 + '@typescript-eslint/type-utils': 5.49.0_eslint@8.32.0+typescript@4.9.4 + '@typescript-eslint/utils': 5.49.0_eslint@8.32.0+typescript@4.9.4 debug: 4.3.4 eslint: 8.32.0 ignore: 5.2.1 @@ -1324,8 +1483,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser/5.48.2_7uibuqfxkfaozanbtbziikiqje: - resolution: {integrity: sha512-38zMsKsG2sIuM5Oi/olurGwYJXzmtdsHhn5mI/pQogP+BjYVkK5iRazCQ8RGS0V+YLk282uWElN70zAAUmaYHw==} + /@typescript-eslint/parser/5.49.0_eslint@8.32.0+typescript@4.9.4: + resolution: {integrity: sha512-veDlZN9mUhGqU31Qiv2qEp+XrJj5fgZpJ8PW30sHU+j/8/e5ruAhLaVDAeznS7A7i4ucb/s8IozpDtt9NqCkZg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -1334,9 +1493,9 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.48.2 - '@typescript-eslint/types': 5.48.2 - '@typescript-eslint/typescript-estree': 5.48.2_typescript@4.9.4 + '@typescript-eslint/scope-manager': 5.49.0 + '@typescript-eslint/types': 5.49.0 + '@typescript-eslint/typescript-estree': 5.49.0_typescript@4.9.4 debug: 4.3.4 eslint: 8.32.0 typescript: 4.9.4 @@ -1344,16 +1503,16 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager/5.48.2: - resolution: {integrity: sha512-zEUFfonQid5KRDKoI3O+uP1GnrFd4tIHlvs+sTJXiWuypUWMuDaottkJuR612wQfOkjYbsaskSIURV9xo4f+Fw==} + /@typescript-eslint/scope-manager/5.49.0: + resolution: {integrity: sha512-clpROBOiMIzpbWNxCe1xDK14uPZh35u4QaZO1GddilEzoCLAEz4szb51rBpdgurs5k2YzPtJeTEN3qVbG+LRUQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.48.2 - '@typescript-eslint/visitor-keys': 5.48.2 + '@typescript-eslint/types': 5.49.0 + '@typescript-eslint/visitor-keys': 5.49.0 dev: true - /@typescript-eslint/type-utils/5.48.2_7uibuqfxkfaozanbtbziikiqje: - resolution: {integrity: sha512-QVWx7J5sPMRiOMJp5dYshPxABRoZV1xbRirqSk8yuIIsu0nvMTZesKErEA3Oix1k+uvsk8Cs8TGJ6kQ0ndAcew==} + /@typescript-eslint/type-utils/5.49.0_eslint@8.32.0+typescript@4.9.4: + resolution: {integrity: sha512-eUgLTYq0tR0FGU5g1YHm4rt5H/+V2IPVkP0cBmbhRyEmyGe4XvJ2YJ6sYTmONfjmdMqyMLad7SB8GvblbeESZA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '*' @@ -1362,8 +1521,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.48.2_typescript@4.9.4 - '@typescript-eslint/utils': 5.48.2_7uibuqfxkfaozanbtbziikiqje + '@typescript-eslint/typescript-estree': 5.49.0_typescript@4.9.4 + '@typescript-eslint/utils': 5.49.0_eslint@8.32.0+typescript@4.9.4 debug: 4.3.4 eslint: 8.32.0 tsutils: 3.21.0_typescript@4.9.4 @@ -1372,13 +1531,13 @@ packages: - supports-color dev: true - /@typescript-eslint/types/5.48.2: - resolution: {integrity: sha512-hE7dA77xxu7ByBc6KCzikgfRyBCTst6dZQpwaTy25iMYOnbNljDT4hjhrGEJJ0QoMjrfqrx+j1l1B9/LtKeuqA==} + /@typescript-eslint/types/5.49.0: + resolution: {integrity: sha512-7If46kusG+sSnEpu0yOz2xFv5nRz158nzEXnJFCGVEHWnuzolXKwrH5Bsf9zsNlOQkyZuk0BZKKoJQI+1JPBBg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree/5.48.2_typescript@4.9.4: - resolution: {integrity: sha512-bibvD3z6ilnoVxUBFEgkO0k0aFvUc4Cttt0dAreEr+nrAHhWzkO83PEVVuieK3DqcgL6VAK5dkzK8XUVja5Zcg==} + /@typescript-eslint/typescript-estree/5.49.0_typescript@4.9.4: + resolution: {integrity: sha512-PBdx+V7deZT/3GjNYPVQv1Nc0U46dAHbIuOG8AZ3on3vuEKiPDwFE/lG1snN2eUB9IhF7EyF7K1hmTcLztNIsA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: typescript: '*' @@ -1386,8 +1545,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.48.2 - '@typescript-eslint/visitor-keys': 5.48.2 + '@typescript-eslint/types': 5.49.0 + '@typescript-eslint/visitor-keys': 5.49.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -1398,17 +1557,17 @@ packages: - supports-color dev: true - /@typescript-eslint/utils/5.48.2_7uibuqfxkfaozanbtbziikiqje: - resolution: {integrity: sha512-2h18c0d7jgkw6tdKTlNaM7wyopbLRBiit8oAxoP89YnuBOzCZ8g8aBCaCqq7h208qUTroL7Whgzam7UY3HVLow==} + /@typescript-eslint/utils/5.49.0_eslint@8.32.0+typescript@4.9.4: + resolution: {integrity: sha512-cPJue/4Si25FViIb74sHCLtM4nTSBXtLx1d3/QT6mirQ/c65bV8arBEebBJJizfq8W2YyMoPI/WWPFWitmNqnQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: '@types/json-schema': 7.0.11 '@types/semver': 7.3.13 - '@typescript-eslint/scope-manager': 5.48.2 - '@typescript-eslint/types': 5.48.2 - '@typescript-eslint/typescript-estree': 5.48.2_typescript@4.9.4 + '@typescript-eslint/scope-manager': 5.49.0 + '@typescript-eslint/types': 5.49.0 + '@typescript-eslint/typescript-estree': 5.49.0_typescript@4.9.4 eslint: 8.32.0 eslint-scope: 5.1.1 eslint-utils: 3.0.0_eslint@8.32.0 @@ -1418,11 +1577,11 @@ packages: - typescript dev: true - /@typescript-eslint/visitor-keys/5.48.2: - resolution: {integrity: sha512-z9njZLSkwmjFWUelGEwEbdf4NwKvfHxvGC0OcGN1Hp/XNDIcJ7D5DpPNPv6x6/mFvc1tQHsaWmpD/a4gOvvCJQ==} + /@typescript-eslint/visitor-keys/5.49.0: + resolution: {integrity: sha512-v9jBMjpNWyn8B6k/Mjt6VbUS4J1GvUlR4x3Y+ibnP1z7y7V4n0WRz+50DY6+Myj0UaXVSuUlHohO+eZ8IJEnkg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.48.2 + '@typescript-eslint/types': 5.49.0 eslint-visitor-keys: 3.3.0 dev: true @@ -1467,20 +1626,20 @@ packages: nanoid: 3.3.4 dev: false - /@vitejs/plugin-legacy/3.0.1_terser@5.16.1+vite@4.0.4: - resolution: {integrity: sha512-XCtEjxoR3rmy000ujYRBp5kggWqzHz9+F20/yIMUWOzbvu0+KW1e14Fvb8h7SpNn+bfjGW1RiAs1Vrgb7Js+iQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/@vitejs/plugin-legacy/-/plugin-legacy-3.0.1.tgz} + /@vitejs/plugin-legacy/3.0.2_terser@5.16.1+vite@4.0.4: + resolution: {integrity: sha512-9BT2mXunC7kQGKHP70BIbNZ/85P/KUMGKBS9CiV+XKNDZGNBjUnyrh3ofgtqgObmxKaEP2xJsEIRNIFJ+hjI8w==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: terser: ^5.4.0 vite: ^4.0.0 dependencies: - '@babel/standalone': 7.20.6 - core-js: 3.26.1 + '@babel/standalone': 7.20.14 + core-js: 3.27.2 magic-string: 0.27.0 regenerator-runtime: 0.13.11 systemjs: 6.13.0 terser: 5.16.1 - vite: 4.0.4_zxbrnrc4iyldik6mikh3pswz4i + vite: 4.0.4_cdc316c45c4616342bcc428fb7cad9e2 dev: true /@vitejs/plugin-vue-jsx/3.0.0_vite@4.0.4+vue@3.2.45: @@ -1493,7 +1652,7 @@ packages: '@babel/core': 7.20.5 '@babel/plugin-transform-typescript': 7.20.2_@babel+core@7.20.5 '@vue/babel-plugin-jsx': 1.1.1_@babel+core@7.20.5 - vite: 4.0.4_zxbrnrc4iyldik6mikh3pswz4i + vite: 4.0.4_cdc316c45c4616342bcc428fb7cad9e2 vue: 3.2.45 transitivePeerDependencies: - supports-color @@ -1506,7 +1665,7 @@ packages: vite: ^4.0.0 vue: ^3.2.25 dependencies: - vite: 4.0.4_zxbrnrc4iyldik6mikh3pswz4i + vite: 4.0.4_cdc316c45c4616342bcc428fb7cad9e2 vue: 3.2.45 dev: true @@ -1606,6 +1765,7 @@ packages: /@vue/devtools-api/6.4.5: resolution: {integrity: sha512-JD5fcdIuFxU4fQyXUu3w2KpAJHzTVdN+p4iOX2lMWSHMOoQdMAcpFLZzm9Z/2nmsoZ1a96QEhZ26e50xLBsgOQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/@vue/devtools-api/-/devtools-api-6.4.5.tgz} + dev: false /@vue/reactivity-transform/3.2.45: resolution: {integrity: sha512-BHVmzYAvM7vcU5WmuYqXpwaBHjsS8T63jlKGWVtHxAHIoMIlmaMyurUSEs1Zcg46M4AYT5MtB1U274/2aNzjJQ==} @@ -1626,6 +1786,7 @@ packages: dependencies: '@vue/reactivity': 3.2.45 '@vue/shared': 3.2.45 + dev: false /@vue/runtime-dom/3.2.45: resolution: {integrity: sha512-cy88YpfP5Ue2bDBbj75Cb4bIEZUMM/mAkDMfqDTpUYVgTf/kuQ2VQ8LebuZ8k6EudgH8pYhsGWHlY0lcxlvTwA==} @@ -1633,6 +1794,7 @@ packages: '@vue/runtime-core': 3.2.45 '@vue/shared': 3.2.45 csstype: 2.6.21 + dev: false /@vue/server-renderer/3.2.45_vue@3.2.45: resolution: {integrity: sha512-ebiMq7q24WBU1D6uhPK//2OTR1iRIyxjF5iVq/1a5I1SDMDyDu4Ts6fJaMnjrvD3MqnaiFkKQj+LKAgz5WIK3g==} @@ -1642,33 +1804,37 @@ packages: '@vue/compiler-ssr': 3.2.45 '@vue/shared': 3.2.45 vue: 3.2.45 + dev: false /@vue/shared/3.2.45: resolution: {integrity: sha512-Ewzq5Yhimg7pSztDV+RH1UDKBzmtqieXQlpTVm2AwraoRL/Rks96mvd8Vgi7Lj+h+TH8dv7mXD3FRZR3TUvbSg==} - /@vueuse/core/9.11.0_vue@3.2.45: - resolution: {integrity: sha512-7yZJ8LNOssA8ZmeSjd4F+wbFBA4csiP4TiaXgruqg1H4PAtzSkv93PPwFLvQkSnfo3Bar+e+6QoRvWjhz7l2Xg==} + /@vueuse/core/9.11.1_vue@3.2.45: + resolution: {integrity: sha512-E/cizD1w9ILkq4axYjZrXLkKaBfzloaby2n3NMjUfd6yI/jkfTVgc6iwy/Cw2e++Ld4LphGbO+3MhzizvwUslQ==} dependencies: '@types/web-bluetooth': 0.0.16 - '@vueuse/metadata': 9.11.0 - '@vueuse/shared': 9.11.0_vue@3.2.45 + '@vueuse/metadata': 9.11.1 + '@vueuse/shared': 9.11.1_vue@3.2.45 vue-demi: 0.13.11_vue@3.2.45 transitivePeerDependencies: - '@vue/composition-api' - vue + dev: false - /@vueuse/metadata/9.11.0: - resolution: {integrity: sha512-HhtG2SWkcfZBLbamHdvLn7jKOCFpw/ifXjVTd5ilFkj98WVUk/3UTQ03wF1XIkuhSO4+b45hD2lfG9/GdKCF7w==} + /@vueuse/metadata/9.11.1: + resolution: {integrity: sha512-ABjkrG+VXggNhjfGyw5e/sekxTZfXTwjrYXkkWQmQ7Biyv+Gq9UD6IDNfeGvQZEINI0Qzw6nfuO2UFCd3hlrxQ==} + dev: false - /@vueuse/shared/9.11.0_vue@3.2.45: - resolution: {integrity: sha512-8lO7wD5abYxupKy2KynH1pSgP715ky6iCrWYb8aX2AuAVi9uHXj7qE1dw6BnmArSaLHci4x9iuzWPCpAzUkC/A==} + /@vueuse/shared/9.11.1_vue@3.2.45: + resolution: {integrity: sha512-UTZYGAjT96hWn4buf4wstZbeheBVNcKPQuej6qpoSkjF1atdaeCD6kqm9uGL2waHfisSgH9mq0qCRiBOk5C/2w==} dependencies: vue-demi: 0.13.11_vue@3.2.45 transitivePeerDependencies: - '@vue/composition-api' - vue + dev: false - /@wangeditor/basic-modules/1.1.7_j7icpicfeimtkldwmemjnpdjs4: + /@wangeditor/basic-modules/1.1.7_4fd027a0452219352c76611896bc6997: resolution: {integrity: sha512-cY9CPkLJaqF05STqfpZKWG4LpxTMeGSIIF1fHvfm/mz+JXatCagjdkbxdikOuKYlxDdeqvOeBmsUBItufDLXZg==} peerDependencies: '@wangeditor/core': 1.x @@ -1678,7 +1844,7 @@ packages: slate: ^0.72.0 snabbdom: ^3.1.0 dependencies: - '@wangeditor/core': 1.1.19_qokc4m5r26t2nkvzejrgzroa7e + '@wangeditor/core': 1.1.19_83942e33b1d7a7a6aab922626cc5c0f9 dom7: 3.0.0 is-url: 1.2.4 lodash.throttle: 4.1.1 @@ -1687,7 +1853,7 @@ packages: snabbdom: 3.5.1 dev: false - /@wangeditor/code-highlight/1.0.3_tztyh2vh7kwzpeloifaekkk3my: + /@wangeditor/code-highlight/1.0.3_9e6783eaa7faad97916e414045295b66: resolution: {integrity: sha512-iazHwO14XpCuIWJNTQTikqUhGKyqj+dUNWJ9288Oym9M2xMVHvnsOmDU2sgUDWVy+pOLojReMPgXCsvvNlOOhw==} peerDependencies: '@wangeditor/core': 1.x @@ -1695,14 +1861,14 @@ packages: slate: ^0.72.0 snabbdom: ^3.1.0 dependencies: - '@wangeditor/core': 1.1.19_qokc4m5r26t2nkvzejrgzroa7e + '@wangeditor/core': 1.1.19_83942e33b1d7a7a6aab922626cc5c0f9 dom7: 3.0.0 prismjs: 1.29.0 slate: 0.72.8 snabbdom: 3.5.1 dev: false - /@wangeditor/core/1.1.19_qokc4m5r26t2nkvzejrgzroa7e: + /@wangeditor/core/1.1.19_83942e33b1d7a7a6aab922626cc5c0f9: resolution: {integrity: sha512-KevkB47+7GhVszyYF2pKGKtCSj/YzmClsD03C3zTt+9SR2XWT5T0e3yQqg8baZpcMvkjs1D8Dv4fk8ok/UaS2Q==} peerDependencies: '@uppy/core': ^2.1.1 @@ -1742,7 +1908,7 @@ packages: snabbdom: 3.5.1 dev: false - /@wangeditor/editor-for-vue/5.1.12_3apfu3xbp6awzuex7ed3sbrv6y: + /@wangeditor/editor-for-vue/5.1.12_d81e5a6ee17f816cd097f907b90635f6: resolution: {integrity: sha512-0Ds3D8I+xnpNWezAeO7HmPRgTfUxHLMd9JKcIw+QzvSmhC5xUHbpCcLU+KLmeBKTR/zffnS5GQo6qi3GhTMJWQ==} peerDependencies: '@wangeditor/editor': '>=5.1.0' @@ -1757,13 +1923,13 @@ packages: dependencies: '@uppy/core': 2.3.4 '@uppy/xhr-upload': 2.1.3_@uppy+core@2.3.4 - '@wangeditor/basic-modules': 1.1.7_j7icpicfeimtkldwmemjnpdjs4 - '@wangeditor/code-highlight': 1.0.3_tztyh2vh7kwzpeloifaekkk3my - '@wangeditor/core': 1.1.19_qokc4m5r26t2nkvzejrgzroa7e - '@wangeditor/list-module': 1.0.5_tztyh2vh7kwzpeloifaekkk3my - '@wangeditor/table-module': 1.1.4_2dde2uzwslfxq2cqrl35sl4erm - '@wangeditor/upload-image-module': 1.0.2_dwqga4onuah5imhngzkgmw6t5a - '@wangeditor/video-module': 1.1.4_i6gxywmu7tvxmjxypclnjlcil4 + '@wangeditor/basic-modules': 1.1.7_4fd027a0452219352c76611896bc6997 + '@wangeditor/code-highlight': 1.0.3_9e6783eaa7faad97916e414045295b66 + '@wangeditor/core': 1.1.19_83942e33b1d7a7a6aab922626cc5c0f9 + '@wangeditor/list-module': 1.0.5_9e6783eaa7faad97916e414045295b66 + '@wangeditor/table-module': 1.1.4_d0c64d533692cb7868508af7d92f848b + '@wangeditor/upload-image-module': 1.0.2_1da06071cda00fd430ed3654665bd3e8 + '@wangeditor/video-module': 1.1.4_478d7c5994fceb7626f87896d4ac485f dom7: 3.0.0 is-hotkey: 0.2.0 lodash.camelcase: 4.3.0 @@ -1778,7 +1944,7 @@ packages: snabbdom: 3.5.1 dev: false - /@wangeditor/list-module/1.0.5_tztyh2vh7kwzpeloifaekkk3my: + /@wangeditor/list-module/1.0.5_9e6783eaa7faad97916e414045295b66: resolution: {integrity: sha512-uDuYTP6DVhcYf7mF1pTlmNn5jOb4QtcVhYwSSAkyg09zqxI1qBqsfUnveeDeDqIuptSJhkh81cyxi+MF8sEPOQ==} peerDependencies: '@wangeditor/core': 1.x @@ -1786,13 +1952,13 @@ packages: slate: ^0.72.0 snabbdom: ^3.1.0 dependencies: - '@wangeditor/core': 1.1.19_qokc4m5r26t2nkvzejrgzroa7e + '@wangeditor/core': 1.1.19_83942e33b1d7a7a6aab922626cc5c0f9 dom7: 3.0.0 slate: 0.72.8 snabbdom: 3.5.1 dev: false - /@wangeditor/table-module/1.1.4_2dde2uzwslfxq2cqrl35sl4erm: + /@wangeditor/table-module/1.1.4_d0c64d533692cb7868508af7d92f848b: resolution: {integrity: sha512-5saanU9xuEocxaemGdNi9t8MCDSucnykEC6jtuiT72kt+/Hhh4nERYx1J20OPsTCCdVr7hIyQenFD1iSRkIQ6w==} peerDependencies: '@wangeditor/core': 1.x @@ -1803,7 +1969,7 @@ packages: slate: ^0.72.0 snabbdom: ^3.1.0 dependencies: - '@wangeditor/core': 1.1.19_qokc4m5r26t2nkvzejrgzroa7e + '@wangeditor/core': 1.1.19_83942e33b1d7a7a6aab922626cc5c0f9 dom7: 3.0.0 lodash.isequal: 4.5.0 lodash.throttle: 4.1.1 @@ -1812,7 +1978,7 @@ packages: snabbdom: 3.5.1 dev: false - /@wangeditor/upload-image-module/1.0.2_dwqga4onuah5imhngzkgmw6t5a: + /@wangeditor/upload-image-module/1.0.2_1da06071cda00fd430ed3654665bd3e8: resolution: {integrity: sha512-z81lk/v71OwPDYeQDxj6cVr81aDP90aFuywb8nPD6eQeECtOymrqRODjpO6VGvCVxVck8nUxBHtbxKtjgcwyiA==} peerDependencies: '@uppy/core': ^2.0.3 @@ -1826,15 +1992,15 @@ packages: dependencies: '@uppy/core': 2.3.4 '@uppy/xhr-upload': 2.1.3_@uppy+core@2.3.4 - '@wangeditor/basic-modules': 1.1.7_j7icpicfeimtkldwmemjnpdjs4 - '@wangeditor/core': 1.1.19_qokc4m5r26t2nkvzejrgzroa7e + '@wangeditor/basic-modules': 1.1.7_4fd027a0452219352c76611896bc6997 + '@wangeditor/core': 1.1.19_83942e33b1d7a7a6aab922626cc5c0f9 dom7: 3.0.0 lodash.foreach: 4.5.0 slate: 0.72.8 snabbdom: 3.5.1 dev: false - /@wangeditor/video-module/1.1.4_i6gxywmu7tvxmjxypclnjlcil4: + /@wangeditor/video-module/1.1.4_478d7c5994fceb7626f87896d4ac485f: resolution: {integrity: sha512-ZdodDPqKQrgx3IwWu4ZiQmXI8EXZ3hm2/fM6E3t5dB8tCaIGWQZhmqd6P5knfkRAd3z2+YRSRbxOGfoRSp/rLg==} peerDependencies: '@uppy/core': ^2.1.4 @@ -1847,7 +2013,7 @@ packages: dependencies: '@uppy/core': 2.3.4 '@uppy/xhr-upload': 2.1.3_@uppy+core@2.3.4 - '@wangeditor/core': 1.1.19_qokc4m5r26t2nkvzejrgzroa7e + '@wangeditor/core': 1.1.19_83942e33b1d7a7a6aab922626cc5c0f9 dom7: 3.0.0 nanoid: 3.3.4 slate: 0.72.8 @@ -1878,8 +2044,10 @@ packages: - supports-color dev: true - /@zxcvbn-ts/core/2.1.0: - resolution: {integrity: sha512-doxol9xrO7LgyVJhguXe7vO0xthnIYmsOKoDwrLg0Ho2kkpQaVtM+AOQw+BkEiKIqNg1V48eUf4/cTzMElXdiA==} + /@zxcvbn-ts/core/2.2.0: + resolution: {integrity: sha512-LPKwI9ZBXGbXhQD39L//c923743yhmiTvnR8cu+u0mpsBt/kRdOJGMUMrbVV0sZZgn0XFc5RokjIxWllghN9kA==} + dependencies: + fastest-levenshtein: 1.0.16 dev: false /JSONStream/1.3.5: @@ -2099,8 +2267,8 @@ packages: - debug dev: true - /axios/1.2.3: - resolution: {integrity: sha512-pdDkMYJeuXLZ6Xj/Q5J3Phpe+jbGdsSzlQaFVkMQzRUL05+6+tetX8TV3p4HrU4kzuO9bt+io/yGQxuyxA/xcw==} + /axios/1.2.5: + resolution: {integrity: sha512-9pU/8mmjSSOb4CXVsvGIevN+MlO/t9OWtKadTaLuN85Gge3HGorUckgp8A/2FH4V4hJ7JuQ3LIeI7KAV9ITZrQ==} dependencies: follow-redirects: 1.15.2 form-data: 4.0.0 @@ -2147,6 +2315,54 @@ packages: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} dev: true + /bpmn-js-properties-panel/0.46.0_bpmn-js@8.10.0: + resolution: {integrity: sha512-8MlNvHklIZZQH9vtoKf0A0A1v0sHO4Iz19jGhHeX15czOOiCfdavjo+q23GHWNKzQA9347F91XYFcrnM6FO8zw==} + peerDependencies: + bpmn-js: ^3.x || ^4.x || ^5.x || ^6.x || ^7.x || ^8.x + dependencies: + '@bpmn-io/element-templates-validator': 0.2.0 + '@bpmn-io/extract-process-variables': 0.4.5 + bpmn-js: 8.10.0 + ids: 1.0.0 + inherits: 2.0.4 + lodash: 4.17.21 + min-dom: 3.2.1 + scroll-tabs: 1.0.1 + selection-update: 0.1.2 + semver: 6.3.0 + dev: true + + /bpmn-js-token-simulation/0.10.0: + resolution: {integrity: sha512-QuZQ/KVXKt9Vl+XENyOBoTW2Aw+uKjuBlKdCJL6El7AyM7DkJ5bZkSYURshId1SkBDdYg2mJ1flSmsrhGuSfwg==} + dependencies: + min-dash: 3.8.1 + min-dom: 0.2.0 + svg.js: 2.7.1 + dev: false + + /bpmn-js/8.10.0: + resolution: {integrity: sha512-NozeOi01qL0ZdVq8+5hWZcikyEvgrP1yzCBqlhSufJdHFsnEMBCwn2bJJ0B/6JgX+IBwy1sk/Uw+Ds8rQ8vfrw==} + dependencies: + bpmn-moddle: 7.1.3 + css.escape: 1.5.1 + diagram-js: 7.9.0 + diagram-js-direct-editing: 1.8.0_diagram-js@7.9.0 + ids: 1.0.0 + inherits: 2.0.4 + min-dash: 3.8.1 + min-dom: 3.2.1 + object-refs: 0.3.0 + tiny-svg: 2.2.4 + dev: true + + /bpmn-moddle/7.1.3: + resolution: {integrity: sha512-ZcBfw0NSOdYTSXFKEn7MOXHItz7VfLZTrFYKO8cK6V8ZzGjCcdiLIOiw7Lctw1PJsihhLiZQS8Htj2xKf+NwCg==} + dependencies: + min-dash: 3.8.1 + moddle: 5.0.4 + moddle-xml: 9.0.6 + dev: true + /brace-expansion/1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: @@ -2174,8 +2390,6 @@ packages: snapdragon-node: 2.1.1 split-string: 3.1.0 to-regex: 3.0.2 - transitivePeerDependencies: - - supports-color dev: true /braces/3.0.2: @@ -2245,6 +2459,10 @@ packages: engines: {node: '>=10'} dev: true + /camunda-bpmn-moddle/7.0.1: + resolution: {integrity: sha512-Br8Diu6roMpziHdpl66Dhnm0DTnCFMrSD9zwLV08LpD52QA0UsXxU87XfHf08HjuB7ly0Hd1bvajZRpf9hbmYQ==} + dev: false + /caniuse-lite/1.0.30001431: resolution: {integrity: sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ==} dev: true @@ -2352,6 +2570,11 @@ packages: engines: {node: '>=0.8'} dev: true + /clsx/1.2.1: + resolution: {integrity: sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==} + engines: {node: '>=6'} + dev: false + /collection-visit/1.0.0: resolution: {integrity: sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw==} engines: {node: '>=0.10.0'} @@ -2415,10 +2638,51 @@ packages: dot-prop: 5.3.0 dev: true + /component-classes/1.2.6: + resolution: {integrity: sha512-hPFGULxdwugu1QWW3SvVOCUHLzO34+a2J6Wqy0c5ASQkfi9/8nZcBB0ZohaEbXOQlCflMAEMmEWk7u7BVs4koA==} + dependencies: + component-indexof: 0.0.3 + dev: false + + /component-closest/0.1.4: + resolution: {integrity: sha512-NF9hMj6JKGM5sb6wP/dg7GdJOttaIH9PcTsUNdWcrvu7Kw/5R5swQAFpgaYEHlARrNMyn4Wf7O1PlRej+pt76Q==} + dependencies: + component-matches-selector: 0.1.7 + dev: false + + /component-delegate/0.2.4: + resolution: {integrity: sha512-OlpcB/6Fi+kXQPh/TfXnSvvmrU04ghz7vcJh/jgLF0Ni+I+E3WGlKJQbBGDa5X+kVUG8WxOgjP+8iWbz902fPg==} + dependencies: + component-closest: 0.1.4 + component-event: 0.1.4 + dev: false + /component-emitter/1.3.0: resolution: {integrity: sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==} dev: true + /component-event/0.1.4: + resolution: {integrity: sha512-GMwOG8MnUHP1l8DZx1ztFO0SJTFnIzZnBDkXAj8RM2ntV2A6ALlDxgbMY1Fvxlg6WPQ+5IM/a6vg4PEYbjg/Rw==} + + /component-event/0.2.1: + resolution: {integrity: sha512-wGA++isMqiDq1jPYeyv2as/Bt/u+3iLW0rEa+8NQ82jAv3TgqMiCM+B2SaBdn2DfLilLjjq736YcezihRYhfxw==} + dev: false + + /component-indexof/0.0.3: + resolution: {integrity: sha512-puDQKvx/64HZXb4hBwIcvQLaLgux8o1CbWl39s41hrIIZDl1lJiD5jc22gj3RBeGK0ovxALDYpIbyjqDUUl0rw==} + dev: false + + /component-matches-selector/0.1.7: + resolution: {integrity: sha512-Yb2+pVBvrqkQVpPaDBF0DYXRreBveXJNrpJs9FnFu8PF6/5IIcz5oDZqiH9nB5hbD2/TmFVN5ZCxBzqu7yFFYQ==} + dependencies: + component-query: 0.0.3 + global-object: 1.0.0 + dev: false + + /component-query/0.0.3: + resolution: {integrity: sha512-VgebQseT1hz1Ps7vVp2uaSg+N/gsI5ts3AZUSnN6GMA2M82JH7o+qYifWhmVE/e8w/H48SJuA3nA9uX8zRe95Q==} + dev: false + /compute-scroll-into-view/1.0.17: resolution: {integrity: sha512-j4dx+Fb0URmzbwwMUrhqWM2BEWHdFGx+qZ9qqASHRPqvTYdqvWnHg0H1hIbcyLnvgnoNAVMlwkepyqM3DaIFUg==} dev: false @@ -2453,8 +2717,8 @@ packages: engines: {node: '>=10'} hasBin: true dependencies: - JSONStream: 1.3.5 is-text-path: 1.0.1 + JSONStream: 1.3.5 lodash: 4.17.21 meow: 8.1.2 split2: 3.2.2 @@ -2470,8 +2734,13 @@ packages: engines: {node: '>=0.10.0'} dev: true - /core-js/3.26.1: - resolution: {integrity: sha512-21491RRQVzUn0GGM9Z1Jrpr6PNPxPi+Za8OM9q4tksTSnlbXXGKK1nXNg/QvwFYettXvSX6zWKCtHHfjN4puyA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/core-js/-/core-js-3.26.1.tgz} + /core-js-pure/3.27.2: + resolution: {integrity: sha512-Cf2jqAbXgWH3VVzjyaaFkY1EBazxugUepGymDoeteyYr9ByX51kD2jdHZlsEF/xnJMyN3Prua7mQuzwMg6Zc9A==} + requiresBuild: true + dev: false + + /core-js/3.27.2: + resolution: {integrity: sha512-9ashVQskuh5AZEZ1JdQWp1GqSoC1e1G87MzRqg2gIfVAQ7Qn9K+uFj8EcniUFA4P2NLZfV+TOlX1SzoKfo+s7w==} requiresBuild: true dev: true @@ -2483,7 +2752,7 @@ packages: vary: 1.1.2 dev: true - /cosmiconfig-typescript-loader/4.2.0_bxtyj3et3xbsdyxhh3oblnfbj4: + /cosmiconfig-typescript-loader/4.2.0_0de784ec93ddc321e2e73edc15b4a14f: resolution: {integrity: sha512-NkANeMnaHrlaSSlpKGyvn2R4rqUDeE/9E5YHx+b4nwo0R8dZyAqcih8/gxpCZvqWP9Vf6xuLpMSzSgdVEIM78g==} engines: {node: '>=12', npm: '>=6'} peerDependencies: @@ -2494,7 +2763,7 @@ packages: dependencies: '@types/node': 18.11.18 cosmiconfig: 8.0.0 - ts-node: 10.9.1_awa2wsr5thmg3i7jqycphctjfq + ts-node: 10.9.1_0581ab4a3d99d86da3e98604f38a692c typescript: 4.9.4 dev: true @@ -2576,6 +2845,9 @@ packages: engines: {node: '>= 6'} dev: true + /css.escape/1.5.1: + resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==} + /cssesc/3.0.0: resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} engines: {node: '>=4'} @@ -2591,6 +2863,7 @@ packages: /csstype/2.6.21: resolution: {integrity: sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==} + dev: false /d/1.0.1: resolution: {integrity: sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==} @@ -2614,11 +2887,6 @@ packages: /debug/2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true dependencies: ms: 2.0.0 dev: true @@ -2683,6 +2951,54 @@ packages: engines: {node: '>=0.4.0'} dev: false + /diagram-js-direct-editing/1.8.0_diagram-js@7.9.0: + resolution: {integrity: sha512-B4Xj+PJfgBjbPEzT3uZQEkZI5xHFB0Izc+7BhDFuHidzrEMzQKZrFGdA3PqfWhReHf3dp+iB6Tt11G9eGNjKMw==} + peerDependencies: + diagram-js: '*' + dependencies: + diagram-js: 7.9.0 + min-dash: 3.8.1 + min-dom: 3.2.1 + dev: true + + /diagram-js/11.6.0: + resolution: {integrity: sha512-84qw+D3WVMRP25DSRSUSaXp1he65e49EXP59mTUh3OSBPllSL/5s28Cx3uyCt6441Sw11LTQ0ZujSvCt8r6V+A==} + dependencies: + '@bpmn-io/diagram-js-ui': 0.2.2 + clsx: 1.2.1 + css.escape: 1.5.1 + didi: 9.0.2 + hammerjs: 2.0.8 + inherits-browser: 0.1.0 + min-dash: 4.0.0 + min-dom: 4.1.0 + object-refs: 0.3.0 + path-intersection: 2.2.1 + tiny-svg: 3.0.0 + dev: false + + /diagram-js/7.9.0: + resolution: {integrity: sha512-o1yUtX5TXV1pmpevP55gxU/AEG6nCidOXGs/HLuxNXG0zMZ3jQta7kMqRxTK93rNw/XuHmP1eMOwdvdJ2RP5qA==} + dependencies: + css.escape: 1.5.1 + didi: 5.2.1 + hammerjs: 2.0.8 + inherits: 2.0.4 + min-dash: 3.8.1 + min-dom: 3.2.1 + object-refs: 0.3.0 + path-intersection: 2.2.1 + tiny-svg: 2.2.4 + dev: true + + /didi/5.2.1: + resolution: {integrity: sha512-IKNnajUlD4lWMy/Q9Emkk7H1qnzREgY4UyE3IhmOi/9IKua0JYtYldk928bOdt1yNxN8EiOy1sqtSozEYsmjCg==} + dev: true + + /didi/9.0.2: + resolution: {integrity: sha512-q2+aj+lnJcUweV7A9pdUrwFr4LHVmRPwTmQLtHPFz4aT7IBoryN6Iy+jmFku+oIzr5ebBkvtBCOb87+dJhb7bg==} + dev: false + /diff/4.0.2: resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} engines: {node: '>=0.3.1'} @@ -2763,6 +3079,9 @@ packages: domelementtype: 2.3.0 dev: true + /domify/1.4.1: + resolution: {integrity: sha512-x18nuiDHMCZGXr4KJSRMf/TWYtiaRo6RX8KN9fEbW54mvbQ6pieUuerC2ahBg+kEp1wycFj8MPUI0WkIOw5E9w==} + /domutils/1.7.0: resolution: {integrity: sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==} dependencies: @@ -2835,13 +3154,13 @@ packages: '@popperjs/core': /@sxzz/popperjs-es/2.11.7 '@types/lodash': 4.14.189 '@types/lodash-es': 4.17.6 - '@vueuse/core': 9.11.0_vue@3.2.45 + '@vueuse/core': 9.11.1_vue@3.2.45 async-validator: 4.2.5 dayjs: 1.11.7 escape-html: 1.0.3 lodash: 4.17.21 lodash-es: 4.17.21 - lodash-unified: 1.0.3_3ib2ivapxullxkx3xftsimdk7u + lodash-unified: 1.0.3_da03a4540fbd16bbaafbb96724306afd memoize-one: 6.0.0 normalize-wheel-es: 1.2.0 vue: 3.2.45 @@ -2981,7 +3300,7 @@ packages: engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0, npm: '>=6.14.13', pnpm: '>= 7.0.0'} dev: true - /eslint-plugin-prettier/4.2.1_cn4lalcyadplruoxa5mhp7j3dq: + /eslint-plugin-prettier/4.2.1_1378b02c5800deb8d1d7075877fd3b1c: resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} engines: {node: '>=12.0.0'} peerDependencies: @@ -3215,8 +3534,6 @@ packages: regex-not: 1.0.2 snapdragon: 0.8.2 to-regex: 3.0.2 - transitivePeerDependencies: - - supports-color dev: true /ext/1.7.0: @@ -3252,8 +3569,6 @@ packages: regex-not: 1.0.2 snapdragon: 0.8.2 to-regex: 3.0.2 - transitivePeerDependencies: - - supports-color dev: true /fast-deep-equal/3.1.3: @@ -3283,10 +3598,16 @@ packages: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} dev: true + /fast-xml-parser/4.0.15: + resolution: {integrity: sha512-bF4/E33/K/EZDHV23IJpSK2SU7rZTaSkDH5G85nXX8SKlQ9qBpWQhyPpm2nlTBewDJgtpd6+1x4TNpKmocmthQ==} + hasBin: true + dependencies: + strnum: 1.0.5 + dev: false + /fastest-levenshtein/1.0.16: resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==} engines: {node: '>= 4.9.1'} - dev: true /fastq/1.13.0: resolution: {integrity: sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==} @@ -3496,6 +3817,10 @@ packages: global-prefix: 3.0.0 dev: true + /global-object/1.0.0: + resolution: {integrity: sha512-mSPSkY6UsHv6hgW0V2dfWBWTS8TnPnLx3ECVNoWp6rBI2Bg66VYoqGoTFlH/l7XhAZ/l+StYlntXlt87BEeCcg==} + dev: false + /global-prefix/3.0.0: resolution: {integrity: sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==} engines: {node: '>=6'} @@ -3541,6 +3866,10 @@ packages: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} dev: true + /hammerjs/2.0.8: + resolution: {integrity: sha512-tSQXBXS/MWQOn/RKckawJ61vvsDpCom87JgxiYdGwHdOa0ht0vzUWDlfioofFCRU0L+6NGDt6XzbgoJvZkMeRQ==} + engines: {node: '>=0.8.0'} + /hard-rejection/2.1.0: resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} engines: {node: '>=6'} @@ -3615,6 +3944,12 @@ packages: hasBin: true dev: true + /highlight.js/9.18.5: + resolution: {integrity: sha512-a5bFyofd/BHCX52/8i8uJkjr9DYwXIPnM/plwI6W7ezItLGqzt7X2G2nXuYSfsIJdkwwj/g9DG1LkcGJI/dDoA==} + deprecated: Support has ended for 9.x series. Upgrade to @latest + requiresBuild: true + dev: false + /hosted-git-info/2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} dev: true @@ -3626,6 +3961,10 @@ packages: lru-cache: 6.0.0 dev: true + /htm/3.1.1: + resolution: {integrity: sha512-983Vyg8NwUE7JkZ6NmOqpCZ+sh1bKv2iYTlUkzlWmA5JD2acKoxd4KVxbMmxX/85mtfdnDmTFoNKcg5DGAvxNQ==} + dev: false + /html-tags/3.2.0: resolution: {integrity: sha512-vy7ClnArOZwCnqZgvv+ddgHgJiAFXe3Ge9ML5/mBctVJoUoYPCdxVucOywjDARn6CVoh3dRSFdPHy2sX80L0Wg==} engines: {node: '>=8'} @@ -3671,6 +4010,10 @@ packages: '@babel/runtime': 7.20.1 dev: false + /ids/1.0.0: + resolution: {integrity: sha512-Zvtq1xUto4LttpstyOlFum8lKx+i1OmRfg+6A9drFS9iSZsDPMHG4Sof/qwNR4kCU7jBeWFPrY2ocHxiz7cCRw==} + dev: true + /ignore/5.2.1: resolution: {integrity: sha512-d2qQLzTJ9WxQftPAuEQpSPmKqzxePjzVbpAVv62AQ64NTL+wR4JkrVqR/LqFsFEUsHDAiId52mJteHDFuDkElA==} engines: {node: '>= 4'} @@ -3713,6 +4056,10 @@ packages: engines: {node: '>=8'} dev: true + /indexof/0.0.1: + resolution: {integrity: sha512-i0G7hLJ1z0DE8dsqJa2rycj9dBmNKgXBvotXtZYXakU9oivfB9Uj2ZBC27qqef2U58/ZLwalxa1X/RDCdkHtVg==} + dev: true + /inflight/1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} dependencies: @@ -3720,6 +4067,10 @@ packages: wrappy: 1.0.2 dev: true + /inherits-browser/0.1.0: + resolution: {integrity: sha512-CJHHvW3jQ6q7lzsXPpapLdMx5hDpSF3FSh45pwsj6bKxJJ8Nl8v43i5yXnr3BdfOimGHKyniewQtnAIp3vyJJw==} + dev: false + /inherits/2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} dev: true @@ -3981,6 +4332,10 @@ packages: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} dev: true + /json-source-map/0.6.1: + resolution: {integrity: sha512-1QoztHPsMQqhDq0hlXY5ZqcEdUzxQEIxgFkKl4WUp2pgShObl+9ovi4kRh2TfvAfxAoHOJ9vIMEqk3k4iex7tg==} + dev: true + /json-stable-stringify-without-jsonify/1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} dev: true @@ -4131,6 +4486,11 @@ packages: engines: {node: '>=14'} dev: true + /local-pkg/0.4.3: + resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} + engines: {node: '>=14'} + dev: true + /locate-path/5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} @@ -4148,7 +4508,7 @@ packages: resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} dev: false - /lodash-unified/1.0.3_3ib2ivapxullxkx3xftsimdk7u: + /lodash-unified/1.0.3_da03a4540fbd16bbaafbb96724306afd: resolution: {integrity: sha512-WK9qSozxXOD7ZJQlpSqOT+om2ZfcT4yO+03FuzAHD0wF6S0l0090LRPDx3vhTTLZ8cFKpBn+IOcVXK6qOcIlfQ==} peerDependencies: '@types/lodash-es': '*' @@ -4260,7 +4620,7 @@ packages: dev: true /magic-string/0.27.0: - resolution: {integrity: sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/magic-string/-/magic-string-0.27.0.tgz} + resolution: {integrity: sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==} engines: {node: '>=12'} dependencies: '@jridgewell/sourcemap-codec': 1.4.14 @@ -4292,6 +4652,10 @@ packages: object-visit: 1.0.1 dev: true + /matches-selector/1.2.0: + resolution: {integrity: sha512-c4vLwYWyl+Ji+U43eU/G5FwxWd4ZH0ePUsFs5y0uwD9HUEFBXUQ1zUUan+78IpRD+y4pUfG0nAzNM292K7ItvA==} + dev: true + /mathml-tag-names/2.1.3: resolution: {integrity: sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==} dev: true @@ -4372,8 +4736,6 @@ packages: regex-not: 1.0.2 snapdragon: 0.8.2 to-regex: 3.0.2 - transitivePeerDependencies: - - supports-color dev: true /micromatch/4.0.5: @@ -4412,6 +4774,43 @@ packages: engines: {node: '>=12'} dev: true + /min-dash/3.8.1: + resolution: {integrity: sha512-evumdlmIlg9mbRVPbC4F5FuRhNmcMS5pvuBUbqb1G9v09Ro0ImPEgz5n3khir83lFok1inKqVDjnKEg3GpDxQg==} + + /min-dash/4.0.0: + resolution: {integrity: sha512-piIvVJ/nxuA4+LpnYIzF6oCtRvdtDvQJteSC+H768H2UvPKFKIt5oiJnUVtr0ZdchneXTcvUZ91vIrvWVIN0AA==} + dev: false + + /min-dom/0.2.0: + resolution: {integrity: sha512-VmxugbnAcVZGqvepjhOA4d4apmrpX8mMaRS+/jo0dI5Yorzrr4Ru9zc9KVALlY/+XakVCb8iQ+PYXljihQcsNw==} + dependencies: + component-classes: 1.2.6 + component-closest: 0.1.4 + component-delegate: 0.2.4 + component-event: 0.1.4 + component-matches-selector: 0.1.7 + component-query: 0.0.3 + domify: 1.4.1 + dev: false + + /min-dom/3.2.1: + resolution: {integrity: sha512-v6YCmnDzxk4rRJntWTUiwggLupPw/8ZSRqUq0PDaBwVZEO/wYzCH4SKVBV+KkEvf3u0XaWHly5JEosPtqRATZA==} + dependencies: + component-event: 0.1.4 + domify: 1.4.1 + indexof: 0.0.1 + matches-selector: 1.2.0 + min-dash: 3.8.1 + dev: true + + /min-dom/4.1.0: + resolution: {integrity: sha512-1lj1EyoSwY/UmTeT/hhPiZTsq+vK9D+8FAJ/53iK5jT1otkG9rJTixSKdjmTieEvdfES+sKbbTptzaQJhnacjA==} + dependencies: + component-event: 0.2.1 + domify: 1.4.1 + min-dash: 4.0.0 + dev: false + /min-indent/1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} @@ -4443,6 +4842,10 @@ packages: resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} dev: true + /mitt/1.2.0: + resolution: {integrity: sha512-r6lj77KlwqLhIUku9UWYes7KJtsczvolZkzp8hbaDPPaE24OmWl5s539Mytlj22siEQKosZ26qCBgda2PKwoJw==} + dev: true + /mitt/3.0.0: resolution: {integrity: sha512-7dX2/10ITVyqh4aOSVI9gdape+t9l2/8QxHrFmUXu4EEUpdlxl6RudZUPZoc+zuY2hk1j7XxVroIVIan/pD/SQ==} dev: false @@ -4459,11 +4862,25 @@ packages: resolution: {integrity: sha512-cwzBrBfwGC1gYJyfcy8TcZU1f+dbH/T+TuOhtYP2wLv/Fb51/uV7HJQfBPtEupZ2ORLRU1EKFS/QfS3eo9+kBQ==} dependencies: acorn: 8.8.1 - pathe: 1.0.0 + pathe: 1.1.0 pkg-types: 1.0.1 ufo: 1.0.1 dev: true + /moddle-xml/9.0.6: + resolution: {integrity: sha512-tl0reHpsY/aKlLGhXeFlQWlYAQHFxTkFqC8tq8jXRYpQSnLVw13T6swMaourLd7EXqHdWsc+5ggsB+fEep6xZQ==} + dependencies: + min-dash: 3.8.1 + moddle: 5.0.4 + saxen: 8.1.2 + dev: true + + /moddle/5.0.4: + resolution: {integrity: sha512-Kjb+hjuzO+YlojNGxEUXvdhLYTHTtAABDlDcJTtTcn5MbJF9Zkv4I1Fyvp3Ypmfgg1EfHDZ3PsCQTuML9JD6wg==} + dependencies: + min-dash: 3.8.1 + dev: true + /ms/2.0.0: resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} dev: true @@ -4500,8 +4917,6 @@ packages: regex-not: 1.0.2 snapdragon: 0.8.2 to-regex: 3.0.2 - transitivePeerDependencies: - - supports-color dev: true /natural-compare-lite/1.4.0: @@ -4606,6 +5021,9 @@ packages: /object-inspect/1.12.2: resolution: {integrity: sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==} + /object-refs/0.3.0: + resolution: {integrity: sha512-eP0ywuoWOaDoiake/6kTJlPJhs+k0qNm4nYRzXLNHj6vh+5M3i9R1epJTdxIPGlhWc4fNRQ7a6XJNCX+/L4FOQ==} + /object-visit/1.0.1: resolution: {integrity: sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA==} engines: {node: '>=0.10.0'} @@ -4715,6 +5133,9 @@ packages: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} + /path-intersection/2.2.1: + resolution: {integrity: sha512-9u8xvMcSfuOiStv9bPdnRJQhGQXLKurew94n4GPQCdH1nj9QKC9ObbNoIpiRq8skiOBxKkt277PgOoFgAt3/rA==} + /path-is-absolute/1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} @@ -4747,6 +5168,10 @@ packages: resolution: {integrity: sha512-nPdMG0Pd09HuSsr7QOKUXO2Jr9eqaDiZvDwdyIhNG5SHYujkQHYKDfGQkulBxvbDHz8oHLsTgKN86LSwYzSHAg==} dev: true + /pathe/1.1.0: + resolution: {integrity: sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w==} + dev: true + /picocolors/1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} @@ -4761,7 +5186,7 @@ packages: hasBin: true dev: true - /pinia/2.0.29_prq2uz4lho2pwp6irk4cfkrxwu: + /pinia/2.0.29_typescript@4.9.4+vue@3.2.45: resolution: {integrity: sha512-5z/KpFecq/cIgfeTnulJXldiLcTITRkTe3N58RKYSj0Pc1EdR6oyCdnf5A9jLoVwBqX5LtHhd0kGlpzWvk9oiQ==} peerDependencies: '@vue/composition-api': ^1.4.0 @@ -4784,7 +5209,7 @@ packages: dependencies: jsonc-parser: 3.2.0 mlly: 1.1.0 - pathe: 1.0.0 + pathe: 1.1.0 dev: true /pngjs/5.0.0: @@ -5055,7 +5480,7 @@ packages: dev: true /regenerator-runtime/0.13.11: - resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz} + resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} /regex-not/1.0.2: resolution: {integrity: sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==} @@ -5153,8 +5578,8 @@ packages: glob: 7.2.3 dev: true - /rimraf/4.1.1: - resolution: {integrity: sha512-Z4Y81w8atcvaJuJuBB88VpADRH66okZAuEm+Jtaufa+s7rZmIz+Hik2G53kGaNytE7lsfXyWktTmfVz0H9xuDg==} + /rimraf/4.1.2: + resolution: {integrity: sha512-BlIbgFryTbw3Dz6hyoWFhKk+unCcHMSkZGrTFVAx2WmttdBSonsdtRlwiuTbDqTKr+UlXIUqJVS4QT5tUzGENQ==} engines: {node: '>=14'} hasBin: true dev: true @@ -5178,8 +5603,8 @@ packages: fsevents: 2.3.2 dev: true - /rollup/3.10.0: - resolution: {integrity: sha512-JmRYz44NjC1MjVF2VKxc0M1a97vn+cDxeqWmnwyAF4FvpjK8YFdHpaqvQB+3IxCvX05vJxKZkoMDU8TShhmJVA==} + /rollup/3.11.0: + resolution: {integrity: sha512-+uWPPkpWQ2H3Qi7sNBcRfhhHJyUNgBYhG4wKe5wuGRj2m55kpo+0p5jubKNBjQODyPe6tSBE3tNpdDwEisQvAQ==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: @@ -5218,16 +5643,36 @@ packages: source-map-js: 1.0.2 dev: true + /sax/1.2.4: + resolution: {integrity: sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==} + dev: false + + /saxen/8.1.2: + resolution: {integrity: sha512-xUOiiFbc3Ow7p8KMxwsGICPx46ZQvy3+qfNVhrkwfz3Vvq45eGt98Ft5IQaA1R/7Tb5B5MKh9fUR9x3c3nDTxw==} + dev: true + /scroll-into-view-if-needed/2.2.29: resolution: {integrity: sha512-hxpAR6AN+Gh53AdAimHM6C8oTN1ppwVZITihix+WqalywBeFcQ6LdQP5ABNl26nX8GTEL7VT+b8lKpdqq65wXg==} dependencies: compute-scroll-into-view: 1.0.17 dev: false + /scroll-tabs/1.0.1: + resolution: {integrity: sha512-W4xjEwNS4QAyQnaJ450vQTcKpbnalBAfsTDV926WrxEMOqjyj2To8uv2d0Cp0oxMdk5TkygtzXmctPNc2zgBcg==} + dependencies: + min-dash: 3.8.1 + min-dom: 3.2.1 + mitt: 1.2.0 + dev: true + /scule/1.0.0: resolution: {integrity: sha512-4AsO/FrViE/iDNEPaAQlb77tf0csuq27EsVpy6ett584EcRTp6pTDLoGWVxCD77y5iU5FauOvhsI4o1APwPoSQ==} dev: true + /selection-update/0.1.2: + resolution: {integrity: sha512-4jzoJNh7VT2s2tvm/kUSskSw7pD0BVcrrGccbfOMK+3AXLBPz6nIy1yo+pbXgvNoTNII96Pq92+sAY+rF0LUAA==} + dev: true + /semver/5.7.1: resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} hasBin: true @@ -5365,10 +5810,12 @@ packages: source-map: 0.5.7 source-map-resolve: 0.5.3 use: 3.1.1 - transitivePeerDependencies: - - supports-color dev: true + /sortablejs/1.14.0: + resolution: {integrity: sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w==} + dev: false + /source-map-js/1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} @@ -5542,11 +5989,15 @@ packages: acorn: 8.8.1 dev: true + /strnum/1.0.5: + resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==} + dev: false + /style-search/0.1.0: resolution: {integrity: sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg==} dev: true - /stylelint-config-html/1.1.0_kbto3rg3njmczth2rrsgfnlsqa: + /stylelint-config-html/1.1.0_5066edc4db6a582cccfa8c6462b57280: resolution: {integrity: sha512-IZv4IVESjKLumUGi+HWeb7skgO6/g4VMuAYrJdlqQFndgbj6WJAXPhaysvBiXefX79upBdQVumgYcdd17gCpjQ==} engines: {node: ^12 || >=14} peerDependencies: @@ -5599,7 +6050,7 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} hasBin: true dependencies: - '@csstools/selector-specificity': 2.0.2_wajs5nedgkikc5pcuwett7legi + '@csstools/selector-specificity': 2.0.2_b0132eb4833290a175e2a58939fd6432 balanced-match: 2.0.0 colord: 2.9.3 cosmiconfig: 7.1.0 @@ -5696,14 +6147,16 @@ packages: posthtml-svg-mode: 1.0.3 query-string: 4.3.4 traverse: 0.6.7 - transitivePeerDependencies: - - supports-color dev: true /svg-tags/1.0.0: resolution: {integrity: sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==} dev: true + /svg.js/2.7.1: + resolution: {integrity: sha512-ycbxpizEQktk3FYvn/8BH+6/EuWXg7ZpQREJvgacqn46gIddG24tNNe4Son6omdXCnSOaApnpZw6MPCBA1dODA==} + dev: false + /svgo/2.8.0: resolution: {integrity: sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==} engines: {node: '>=10.13.0'} @@ -5719,7 +6172,7 @@ packages: dev: true /systemjs/6.13.0: - resolution: {integrity: sha512-P3cgh2bpaPvAO2NE3uRp/n6hmk4xPX4DQf+UzTlCAycssKdqhp6hjw+ENWe+aUS7TogKRFtptMosTSFeC6R55g==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/systemjs/-/systemjs-6.13.0.tgz} + resolution: {integrity: sha512-P3cgh2bpaPvAO2NE3uRp/n6hmk4xPX4DQf+UzTlCAycssKdqhp6hjw+ENWe+aUS7TogKRFtptMosTSFeC6R55g==} dev: true /table/6.8.1: @@ -5763,6 +6216,14 @@ packages: readable-stream: 3.6.0 dev: true + /tiny-svg/2.2.4: + resolution: {integrity: sha512-NOi39lBknf4UdDEahNkbEAJnzhu1ZcN2j75IS2vLRmIhsfxdZpTChfLKBcN1ShplVmPIXJAIafk6YY5/Aa80lQ==} + dev: true + + /tiny-svg/3.0.0: + resolution: {integrity: sha512-+u6VomQO7MbI7CQe5q1IwNePpbVKG/HVdUQBmaEpSCdP/QmeyjhrS6WKFsNetXlvf9LWu/f5woRqjMdxBMe/0w==} + dev: false + /tiny-warning/1.0.3: resolution: {integrity: sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==} dev: false @@ -5816,7 +6277,7 @@ packages: engines: {node: '>=8'} dev: true - /ts-node/10.9.1_awa2wsr5thmg3i7jqycphctjfq: + /ts-node/10.9.1_0581ab4a3d99d86da3e98604f38a692c: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -5857,7 +6318,6 @@ packages: /tslib/2.4.1: resolution: {integrity: sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==} - dev: true /tsutils/3.21.0_typescript@4.9.4: resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} @@ -5913,21 +6373,22 @@ packages: resolution: {integrity: sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==} engines: {node: '>=4.2.0'} hasBin: true + dev: true /ufo/1.0.1: resolution: {integrity: sha512-boAm74ubXHY7KJQZLlXrtMz52qFvpsbOxDcZOnw/Wf+LS4Mmyu7JxmzD4tDLtUQtmZECypJ0FrCz4QIe6dvKRA==} dev: true - /unimport/1.2.0_rollup@3.10.0: - resolution: {integrity: sha512-yMok/ubppurBE7Png1QH70Om96AxIoWCcfdxW3J/pziozShMc1UGpPgWpSckfo9ndAO5M74yNnRDdLAZy/gWQg==} + /unimport/2.0.1_rollup@3.11.0: + resolution: {integrity: sha512-hMeDspGrEcocahicTr0AQYUGes24FvJtOxk9QEjeEOGv+n1EdpsDiT6z8t209PWhemPg0T5w/ooTVhup2GdrFA==} dependencies: - '@rollup/pluginutils': 5.0.2_rollup@3.10.0 + '@rollup/pluginutils': 5.0.2_rollup@3.11.0 escape-string-regexp: 5.0.0 fast-glob: 3.2.12 - local-pkg: 0.4.2 + local-pkg: 0.4.3 magic-string: 0.27.0 mlly: 1.1.0 - pathe: 1.0.0 + pathe: 1.1.0 pkg-types: 1.0.1 scule: 1.0.0 strip-literal: 1.0.0 @@ -5951,8 +6412,8 @@ packages: engines: {node: '>= 10.0.0'} dev: true - /unplugin-auto-import/0.12.1_ta7poabqclszbk6bszysx4wo3y: - resolution: {integrity: sha512-J/3ZORq5YGKG+8D5vLLOgqaHNK77izlVN07mQ752yRLqBNDbJiwPRSnUwwYqH5N6rDay1SqnJCHaUdbJ9QMI2w==} + /unplugin-auto-import/0.12.2_f0a1627ed0f26084cd4076d76d79ecd8: + resolution: {integrity: sha512-hC4w0GZjPjmLtrxV0u10XO350V9eCtQyEyifXr7B9UGD7SvbbIvKuOcHt58Zd4FAqZJXKWoXkpr9mdhBp85Usw==} engines: {node: '>=14'} peerDependencies: '@vueuse/core': '*' @@ -5961,24 +6422,24 @@ packages: optional: true dependencies: '@antfu/utils': 0.7.2 - '@rollup/pluginutils': 5.0.2_rollup@3.10.0 - '@vueuse/core': 9.11.0_vue@3.2.45 - local-pkg: 0.4.2 + '@rollup/pluginutils': 5.0.2_rollup@3.11.0 + '@vueuse/core': 9.11.1_vue@3.2.45 + local-pkg: 0.4.3 magic-string: 0.27.0 - unimport: 1.2.0_rollup@3.10.0 + unimport: 2.0.1_rollup@3.11.0 unplugin: 1.0.1 transitivePeerDependencies: - rollup dev: true - /unplugin-element-plus/0.4.1_rollup@3.10.0+vite@4.0.4: + /unplugin-element-plus/0.4.1_rollup@3.11.0+vite@4.0.4: resolution: {integrity: sha512-x8L35sppkbtnAf+aSPXNsLPjCUrM0mWKgujqMIgrHiDQaGbpMlNnbN2kjP5CMclykNOw8fUCreEhtxPyzg8tmw==} engines: {node: '>=14.19.0'} dependencies: '@rollup/pluginutils': 4.2.1 es-module-lexer: 0.10.5 magic-string: 0.26.7 - unplugin: 0.7.2_rollup@3.10.0+vite@4.0.4 + unplugin: 0.7.2_rollup@3.11.0+vite@4.0.4 transitivePeerDependencies: - esbuild - rollup @@ -5986,7 +6447,7 @@ packages: - webpack dev: true - /unplugin-vue-components/0.22.12_rollup@3.10.0+vue@3.2.45: + /unplugin-vue-components/0.22.12_rollup@3.11.0+vue@3.2.45: resolution: {integrity: sha512-FxyzsuBvMCYPIk+8cgscGBQ345tvwVu+qY5IhE++eorkyvA4Z1TiD/HCiim+Kbqozl10i4K+z+NCa2WO2jexRA==} engines: {node: '>=14'} peerDependencies: @@ -5997,7 +6458,7 @@ packages: optional: true dependencies: '@antfu/utils': 0.7.2 - '@rollup/pluginutils': 5.0.2_rollup@3.10.0 + '@rollup/pluginutils': 5.0.2_rollup@3.11.0 chokidar: 3.5.3 debug: 4.3.4 fast-glob: 3.2.12 @@ -6012,7 +6473,7 @@ packages: - supports-color dev: true - /unplugin/0.7.2_rollup@3.10.0+vite@4.0.4: + /unplugin/0.7.2_rollup@3.11.0+vite@4.0.4: resolution: {integrity: sha512-m7thX4jP8l5sETpLdUASoDOGOcHaOVtgNyrYlToyQUvILUtEzEnngRBrHnAX3IKqooJVmXpoa/CwQ/QqzvGaHQ==} peerDependencies: esbuild: '>=0.13' @@ -6031,8 +6492,8 @@ packages: dependencies: acorn: 8.8.1 chokidar: 3.5.3 - rollup: 3.10.0 - vite: 4.0.4_zxbrnrc4iyldik6mikh3pswz4i + rollup: 3.11.0 + vite: 4.0.4_cdc316c45c4616342bcc428fb7cad9e2 webpack-sources: 3.2.3 webpack-virtual-modules: 0.4.6 dev: true @@ -6120,7 +6581,7 @@ packages: chalk: 4.1.2 debug: 4.3.4 fs-extra: 10.1.0 - vite: 4.0.4_zxbrnrc4iyldik6mikh3pswz4i + vite: 4.0.4_cdc316c45c4616342bcc428fb7cad9e2 transitivePeerDependencies: - supports-color dev: true @@ -6141,7 +6602,7 @@ packages: '@types/eslint': 8.4.10 eslint: 8.32.0 rollup: 2.79.1 - vite: 4.0.4_zxbrnrc4iyldik6mikh3pswz4i + vite: 4.0.4_cdc316c45c4616342bcc428fb7cad9e2 dev: true /vite-plugin-progress/0.0.6_vite@4.0.4: @@ -6153,7 +6614,7 @@ packages: picocolors: 1.0.0 progress: 2.0.3 rd: 2.0.1 - vite: 4.0.4_zxbrnrc4iyldik6mikh3pswz4i + vite: 4.0.4_cdc316c45c4616342bcc428fb7cad9e2 dev: true /vite-plugin-purge-icons/0.9.2_vite@4.0.4: @@ -6165,7 +6626,7 @@ packages: '@purge-icons/core': 0.9.1 '@purge-icons/generated': 0.9.0 rollup-plugin-purge-icons: 0.9.1 - vite: 4.0.4_zxbrnrc4iyldik6mikh3pswz4i + vite: 4.0.4_cdc316c45c4616342bcc428fb7cad9e2 transitivePeerDependencies: - encoding - supports-color @@ -6184,7 +6645,7 @@ packages: pathe: 0.2.0 svg-baker: 1.7.0 svgo: 2.8.0 - vite: 4.0.4_zxbrnrc4iyldik6mikh3pswz4i + vite: 4.0.4_cdc316c45c4616342bcc428fb7cad9e2 transitivePeerDependencies: - supports-color dev: true @@ -6196,7 +6657,7 @@ packages: dependencies: '@vue/compiler-sfc': 3.2.45 magic-string: 0.25.9 - vite: 4.0.4_zxbrnrc4iyldik6mikh3pswz4i + vite: 4.0.4_cdc316c45c4616342bcc428fb7cad9e2 dev: true /vite-plugin-windicss/1.8.10_vite@4.0.4: @@ -6207,13 +6668,13 @@ packages: '@windicss/plugin-utils': 1.8.10 debug: 4.3.4 kolorist: 1.6.0 - vite: 4.0.4_zxbrnrc4iyldik6mikh3pswz4i + vite: 4.0.4_cdc316c45c4616342bcc428fb7cad9e2 windicss: 3.5.6 transitivePeerDependencies: - supports-color dev: true - /vite/4.0.4_zxbrnrc4iyldik6mikh3pswz4i: + /vite/4.0.4_cdc316c45c4616342bcc428fb7cad9e2: resolution: {integrity: sha512-xevPU7M8FU0i/80DMR+YhgrzR5KS2ORy1B4xcX/cXLsvnUWvfHuqMmVU6N0YiJ4JWGRJJsLCgjEzKjG9/GKoSw==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -6242,7 +6703,7 @@ packages: esbuild: 0.16.5 postcss: 8.4.21 resolve: 1.22.1 - rollup: 3.10.0 + rollup: 3.11.0 sass: 1.57.1 terser: 5.16.1 optionalDependencies: @@ -6262,6 +6723,7 @@ packages: optional: true dependencies: vue: 3.2.45 + dev: false /vue-eslint-parser/9.1.0_eslint@8.32.0: resolution: {integrity: sha512-NGn/iQy8/Wb7RrRa4aRkokyCZfOUWk19OP5HP6JEozQFX5AoS/t+Z0ZN7FY4LlmWc4FNI922V7cvX28zctN8dQ==} @@ -6292,6 +6754,7 @@ packages: '@intlify/vue-devtools': 9.2.2 '@vue/devtools-api': 6.4.5 vue: 3.2.45 + dev: false /vue-router/4.1.6_vue@3.2.45: resolution: {integrity: sha512-DYWYwsG6xNPmLq/FmZn8Ip+qrhFEzA14EI12MsMgVxvHFDYvlr4NXpVF5hrRH1wVcDP8fGi5F4rxuJSl8/r+EQ==} @@ -6341,6 +6804,24 @@ packages: '@vue/runtime-dom': 3.2.45 '@vue/server-renderer': 3.2.45_vue@3.2.45 '@vue/shared': 3.2.45 + dev: false + + /vue3-treeselect/0.1.10_vue@3.2.45: + resolution: {integrity: sha512-QawdAbzmlZ7T3uBdSU4FRnrnmcV0Q9Jrph5hUBQJcXmM9OZ8lULQo7O7YbKxkOyuDX9Yx2rGjs6L5FKcL1FeXA==} + peerDependencies: + vue: ^3.0.0 + dependencies: + vue: 3.2.45 + dev: false + + /vuedraggable/4.1.0_vue@3.2.45: + resolution: {integrity: sha512-FU5HCWBmsf20GpP3eudURW3WdWTKIbEIQxh9/8GE806hydR9qZqRRxRE3RjqX7PkuLuMQG/A7n3cfj9rCEchww==} + peerDependencies: + vue: ^3.0.1 + dependencies: + sortablejs: 1.14.0 + vue: 3.2.45 + dev: false /vxe-table/4.3.9_vue@3.2.45+xe-utils@3.5.7: resolution: {integrity: sha512-Ns7Ooa7lOHBpks90i0k0BMNyxfMpUo39ryxTgKE41X3xVnI9tGQs2U6+klfDlsuqYfmG3ibyzHN3OCrWbbKo4Q==} @@ -6352,6 +6833,14 @@ packages: xe-utils: 3.5.7 dev: false + /wangeditor/4.7.15: + resolution: {integrity: sha512-aPTdREd8BxXVyJ5MI+LU83FQ7u1EPd341iXIorRNYSOvoimNoZ4nPg+yn3FGbB93/owEa6buLw8wdhYnMCJQLg==} + dependencies: + '@babel/runtime': 7.20.1 + '@babel/runtime-corejs3': 7.20.7 + tslib: 2.4.1 + dev: false + /web-storage-cache/1.1.1: resolution: {integrity: sha512-D0MieGooOs8RpsrK+vnejXnvh4OOv/+lTFB35JRkJJQt+uOjPE08XpaE0QBLMTRu47B1KGT/Nq3Gbag3Orinzw==} dev: false @@ -6447,6 +6936,13 @@ packages: resolution: {integrity: sha512-3H+fDBKBR2wLJgyA7k9C/w1Xljx6Maml5ukV0WDY06HjYyGs2FEz6XhcwRCLIDXX4pBP3Gu0nX9DbCeuuRA2Ew==} dev: false + /xml-js/1.6.11: + resolution: {integrity: sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g==} + hasBin: true + dependencies: + sax: 1.2.4 + dev: false + /xml-name-validator/4.0.0: resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==} engines: {node: '>=12'} diff --git a/yudao-ui-admin-vue3/src/api/bpm/activity/index.ts b/yudao-ui-admin-vue3/src/api/bpm/activity/index.ts new file mode 100644 index 000000000..870d0d6cd --- /dev/null +++ b/yudao-ui-admin-vue3/src/api/bpm/activity/index.ts @@ -0,0 +1,8 @@ +import request from '@/config/axios' + +export const getActivityList = async (params) => { + return await request.get({ + url: '/bpm/activity/list', + params + }) +} diff --git a/yudao-ui-admin-vue3/src/api/bpm/definition/index.ts b/yudao-ui-admin-vue3/src/api/bpm/definition/index.ts new file mode 100644 index 000000000..477d67298 --- /dev/null +++ b/yudao-ui-admin-vue3/src/api/bpm/definition/index.ts @@ -0,0 +1,21 @@ +import request from '@/config/axios' + +export const getProcessDefinitionBpmnXMLApi = async (id: number) => { + return await request.get({ + url: '/bpm/process-definition/get-bpmn-xml?id=' + id + }) +} + +export const getProcessDefinitionPageApi = async (params) => { + return await request.get({ + url: '/bpm/process-definition/page', + params + }) +} + +export const getProcessDefinitionListApi = async (params) => { + return await request.get({ + url: '/bpm/process-definition/list', + params + }) +} diff --git a/yudao-ui-admin-vue3/src/api/bpm/form/index.ts b/yudao-ui-admin-vue3/src/api/bpm/form/index.ts index 15856c5a1..c745201f2 100644 --- a/yudao-ui-admin-vue3/src/api/bpm/form/index.ts +++ b/yudao-ui-admin-vue3/src/api/bpm/form/index.ts @@ -1,5 +1,14 @@ import request from '@/config/axios' -import { FormVO } from './types' + +export type FormVO = { + id: number + name: string + conf: string + fields: string[] + status: number + remark: string + createTime: string +} // 创建工作流的表单定义 export const createFormApi = async (data: FormVO) => { diff --git a/yudao-ui-admin-vue3/src/api/bpm/form/types.ts b/yudao-ui-admin-vue3/src/api/bpm/form/types.ts deleted file mode 100644 index 2bc8b6912..000000000 --- a/yudao-ui-admin-vue3/src/api/bpm/form/types.ts +++ /dev/null @@ -1,9 +0,0 @@ -export type FormVO = { - id: number - name: string - conf: string - fields: string[] - status: number - remark: string - createTime: string -} diff --git a/yudao-ui-admin-vue3/src/api/bpm/leave/index.ts b/yudao-ui-admin-vue3/src/api/bpm/leave/index.ts index 567fa5807..ff6d86a0a 100644 --- a/yudao-ui-admin-vue3/src/api/bpm/leave/index.ts +++ b/yudao-ui-admin-vue3/src/api/bpm/leave/index.ts @@ -1,5 +1,15 @@ import request from '@/config/axios' -import { LeaveVO } from './types' + +export type LeaveVO = { + id: number + result: number + type: number + reason: string + processInstanceId: string + startTime: string + endTime: string + createTime: string +} // 创建请假申请 export const createLeaveApi = async (data: LeaveVO) => { diff --git a/yudao-ui-admin-vue3/src/api/bpm/leave/types.ts b/yudao-ui-admin-vue3/src/api/bpm/leave/types.ts deleted file mode 100644 index 60b4bf831..000000000 --- a/yudao-ui-admin-vue3/src/api/bpm/leave/types.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type LeaveVO = { - id: number - result: number - type: number - reason: string - processInstanceId: string - startTime: string - endTime: string - createTime: string -} diff --git a/yudao-ui-admin-vue3/src/api/bpm/model/index.ts b/yudao-ui-admin-vue3/src/api/bpm/model/index.ts index a2a0c7780..d47b30c10 100644 --- a/yudao-ui-admin-vue3/src/api/bpm/model/index.ts +++ b/yudao-ui-admin-vue3/src/api/bpm/model/index.ts @@ -1,5 +1,28 @@ import request from '@/config/axios' -import { ModelVO } from './types' + +export type ProcessDefinitionVO = { + id: string + version: number + deploymentTIme: string + suspensionState: number +} + +export type ModelVO = { + id: number + formName: string + key: string + name: string + description: string + category: string + formType: number + formId: number + formCustomCreatePath: string + formCustomViewPath: string + processDefinition: ProcessDefinitionVO + status: number + remark: string + createTime: string +} export const getModelPageApi = async (params) => { return await request.get({ url: '/bpm/model/page', params }) diff --git a/yudao-ui-admin-vue3/src/api/bpm/model/types.ts b/yudao-ui-admin-vue3/src/api/bpm/model/types.ts deleted file mode 100644 index 36f4aab1b..000000000 --- a/yudao-ui-admin-vue3/src/api/bpm/model/types.ts +++ /dev/null @@ -1,23 +0,0 @@ -export type ProcessDefinitionVO = { - id: string - version: number - deploymentTIme: string - suspensionState: number -} - -export type ModelVO = { - id: number - formName: string - key: string - name: string - description: string - category: string - formType: number - formId: number - formCustomCreatePath: string - formCustomViewPath: string - processDefinition: ProcessDefinitionVO - status: number - remark: string - createTime: string -} diff --git a/yudao-ui-admin-vue3/src/api/bpm/processInstance/index.ts b/yudao-ui-admin-vue3/src/api/bpm/processInstance/index.ts index a56b1d420..d48253c3a 100644 --- a/yudao-ui-admin-vue3/src/api/bpm/processInstance/index.ts +++ b/yudao-ui-admin-vue3/src/api/bpm/processInstance/index.ts @@ -1,11 +1,29 @@ import request from '@/config/axios' -import { ProcessInstanceVO } from './types' + +export type Task = { + id: string + name: string +} +export type ProcessInstanceVO = { + id: number + name: string + processDefinitionId: string + category: string + result: number + tasks: Task[] + fields: string[] + status: number + remark: string + businessKey: string + createTime: string + endTime: string +} export const getMyProcessInstancePageApi = async (params) => { return await request.get({ url: '/bpm/process-instance/my-page', params }) } -export const createProcessInstanceApi = async (data: ProcessInstanceVO) => { +export const createProcessInstanceApi = async (data) => { return await request.post({ url: '/bpm/process-instance/create', data: data }) } diff --git a/yudao-ui-admin-vue3/src/api/bpm/processInstance/types.ts b/yudao-ui-admin-vue3/src/api/bpm/processInstance/types.ts deleted file mode 100644 index 3ab506389..000000000 --- a/yudao-ui-admin-vue3/src/api/bpm/processInstance/types.ts +++ /dev/null @@ -1,18 +0,0 @@ -export type task = { - id: string - name: string -} -export type ProcessInstanceVO = { - id: number - name: string - processDefinitionId: string - category: string - result: number - tasks: task[] - fields: string[] - status: number - remark: string - businessKey: string - createTime: string - endTime: string -} diff --git a/yudao-ui-admin-vue3/src/api/bpm/task/types.ts b/yudao-ui-admin-vue3/src/api/bpm/task/types.ts deleted file mode 100644 index 8f7722529..000000000 --- a/yudao-ui-admin-vue3/src/api/bpm/task/types.ts +++ /dev/null @@ -1,39 +0,0 @@ -export type FormVO = { - id: number - name: string - conf: string - fields: string[] - status: number - remark: string - createTime: string -} - -export type TaskProcessVO = { - id: string - name: string - startUserId: number - startUserNickname: string - processDefinitionId: string -} - -export type TaskTodoVO = { - id: string - name: string - claimTime: string - createTime: string - suspensionState: number - processInstance: TaskProcessVO -} - -export type TaskDoneVO = { - id: string - name: string - claimTime: string - createTime: string - endTime: string - durationInMillis: number - suspensionState: number - result: number - reason: string - processInstance: TaskProcessVO -} diff --git a/yudao-ui-admin-vue3/src/api/bpm/taskAssignRule/index.ts b/yudao-ui-admin-vue3/src/api/bpm/taskAssignRule/index.ts index 9bdbdf0e2..5fbe342d4 100644 --- a/yudao-ui-admin-vue3/src/api/bpm/taskAssignRule/index.ts +++ b/yudao-ui-admin-vue3/src/api/bpm/taskAssignRule/index.ts @@ -1,5 +1,14 @@ import request from '@/config/axios' -import { TaskAssignVO } from './types' + +export type TaskAssignVO = { + id: number + modelId: string + processDefinitionId: string + taskDefinitionKey: string + taskDefinitionName: string + options: string[] + type: number +} export const getTaskAssignRuleList = async (params) => { return await request.get({ url: '/bpm/task-assign-rule/list', params }) diff --git a/yudao-ui-admin-vue3/src/api/bpm/taskAssignRule/types.ts b/yudao-ui-admin-vue3/src/api/bpm/taskAssignRule/types.ts deleted file mode 100644 index e9340e7ea..000000000 --- a/yudao-ui-admin-vue3/src/api/bpm/taskAssignRule/types.ts +++ /dev/null @@ -1,9 +0,0 @@ -export type TaskAssignVO = { - id: number - modelId: string - processDefinitionId: string - taskDefinitionKey: string - taskDefinitionName: string - options: string[] - type: number -} diff --git a/yudao-ui-admin-vue3/src/api/bpm/userGroup/index.ts b/yudao-ui-admin-vue3/src/api/bpm/userGroup/index.ts index e61ebf36d..88ee96197 100644 --- a/yudao-ui-admin-vue3/src/api/bpm/userGroup/index.ts +++ b/yudao-ui-admin-vue3/src/api/bpm/userGroup/index.ts @@ -1,5 +1,14 @@ import request from '@/config/axios' -import { UserGroupVO } from './types' + +export type UserGroupVO = { + id: number + name: string + description: string + memberUserIds: number[] + status: number + remark: string + createTime: string +} // 创建用户组 export const createUserGroupApi = async (data: UserGroupVO) => { diff --git a/yudao-ui-admin-vue3/src/api/bpm/userGroup/types.ts b/yudao-ui-admin-vue3/src/api/bpm/userGroup/types.ts deleted file mode 100644 index d0d67ad43..000000000 --- a/yudao-ui-admin-vue3/src/api/bpm/userGroup/types.ts +++ /dev/null @@ -1,9 +0,0 @@ -export type UserGroupVO = { - id: number - name: string - description: string - memberUserIds: number[] - status: number - remark: string - createTime: string -} diff --git a/yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue b/yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue index 7f32f6f4e..f70d52bfe 100644 --- a/yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue +++ b/yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue @@ -33,6 +33,9 @@ export default defineComponent({ if (!props.type) { return null } + if (!props.value) { + return null + } getDictObj(props.type, props.value.toString()) return ( +
+
+ + + + +
+
+
+ + +
+ + +
+            
+            
+            {{ previewResult }}
+            
+        
+ +
+
+ + + diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue new file mode 100644 index 000000000..4f22ca521 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue @@ -0,0 +1,594 @@ + + + + + diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/index.ts b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/index.ts new file mode 100644 index 000000000..852284688 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/index.ts @@ -0,0 +1,8 @@ +import MyProcessDesigner from './ProcessDesigner.vue' + +MyProcessDesigner.install = function (Vue) { + Vue.component(MyProcessDesigner.name, MyProcessDesigner) +} + +// 流程图的设计器,可编辑 +export default MyProcessDesigner diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/index2.ts b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/index2.ts new file mode 100644 index 000000000..ebe8ca78c --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/index2.ts @@ -0,0 +1,8 @@ +import MyProcessViewer from './ProcessViewer.vue' + +MyProcessViewer.install = function (Vue) { + Vue.component(MyProcessViewer.name, MyProcessViewer) +} + +// 流程图的查看器,不可编辑 +export default MyProcessViewer diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/content-pad/contentPadProvider.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/content-pad/contentPadProvider.js new file mode 100644 index 000000000..968de3d65 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/content-pad/contentPadProvider.js @@ -0,0 +1,390 @@ +import { assign, forEach, isArray } from 'min-dash' + +import { is } from "bpmn-js/lib/util/ModelUtil" + +import { isExpanded, isEventSubProcess } from "bpmn-js/lib/util/DiUtil" + +import { isAny } from "bpmn-js/lib/features/modeling/util/ModelingUtil" + +import { getChildLanes } from "bpmn-js/lib/features/modeling/util/LaneUtil" + +import { hasPrimaryModifier } from "diagram-js/lib/util/Mouse" + +/** + * A provider for BPMN 2.0 elements context pad + */ +export default function ContextPadProvider ( + config, + injector, + eventBus, + contextPad, + modeling, + elementFactory, + connect, + create, + popupMenu, + canvas, + rules, + translate, + elementRegistry +) { + config = config || {} + + contextPad.registerProvider(this) + + this._contextPad = contextPad + + this._modeling = modeling + + this._elementFactory = elementFactory + this._connect = connect + this._create = create + this._popupMenu = popupMenu + this._canvas = canvas + this._rules = rules + this._translate = translate + + if (config.autoPlace !== false) { + this._autoPlace = injector.get("autoPlace", false) + } + + eventBus.on("create.end", 250, function (event) { + const context = event.context, + shape = context.shape + + if (!hasPrimaryModifier(event) || !contextPad.isOpen(shape)) { + return + } + + const entries = contextPad.getEntries(shape) + + if (entries.replace) { + entries.replace.action.click(event, shape) + } + }) +} + +ContextPadProvider.$inject = [ + "config.contextPad", + "injector", + "eventBus", + "contextPad", + "modeling", + "elementFactory", + "connect", + "create", + "popupMenu", + "canvas", + "rules", + "translate", + "elementRegistry" +] + +ContextPadProvider.prototype.getContextPadEntries = function (element) { + const contextPad = this._contextPad, + modeling = this._modeling, + elementFactory = this._elementFactory, + connect = this._connect, + create = this._create, + popupMenu = this._popupMenu, + canvas = this._canvas, + rules = this._rules, + autoPlace = this._autoPlace, + translate = this._translate + + const actions = {} + + if (element.type === "label") { + return actions + } + + const businessObject = element.businessObject + + function startConnect (event, element) { + connect.start(event, element) + } + + function removeElement () { + modeling.removeElements([element]) + } + + function getReplaceMenuPosition (element) { + const Y_OFFSET = 5 + + const diagramContainer = canvas.getContainer(), + pad = contextPad.getPad(element).html + + const diagramRect = diagramContainer.getBoundingClientRect(), + padRect = pad.getBoundingClientRect() + + const top = padRect.top - diagramRect.top + const left = padRect.left - diagramRect.left + + const pos = { + x: left, + y: top + padRect.height + Y_OFFSET + } + + return pos + } + + /** + * Create an append action + * + * @param {string} type + * @param {string} className + * @param {string} [title] + * @param {Object} [options] + * + * @return {Object} descriptor + */ + function appendAction (type, className, title, options) { + if (typeof title !== "string") { + options = title + title = translate("Append {type}", { type: type.replace(/^bpmn:/, "") }) + } + + function appendStart (event, element) { + const shape = elementFactory.createShape(assign({ type: type }, options)) + create.start(event, shape, { + source: element + }) + } + + const append = autoPlace + ? function (event, element) { + const shape = elementFactory.createShape(assign({ type: type }, options)) + + autoPlace.append(element, shape) + } + : appendStart + + return { + group: "model", + className: className, + title: title, + action: { + dragstart: appendStart, + click: append + } + } + } + + function splitLaneHandler (count) { + return function (event, element) { + // actual split + modeling.splitLane(element, count) + + // refresh context pad after split to + // get rid of split icons + contextPad.open(element, true) + } + } + + if (isAny(businessObject, ["bpmn:Lane", "bpmn:Participant"]) && isExpanded(businessObject)) { + const childLanes = getChildLanes(element) + + assign(actions, { + "lane-insert-above": { + group: "lane-insert-above", + className: "bpmn-icon-lane-insert-above", + title: translate("Add Lane above"), + action: { + click: function (event, element) { + modeling.addLane(element, "top") + } + } + } + }) + + if (childLanes.length < 2) { + if (element.height >= 120) { + assign(actions, { + "lane-divide-two": { + group: "lane-divide", + className: "bpmn-icon-lane-divide-two", + title: translate("Divide into two Lanes"), + action: { + click: splitLaneHandler(2) + } + } + }) + } + + if (element.height >= 180) { + assign(actions, { + "lane-divide-three": { + group: "lane-divide", + className: "bpmn-icon-lane-divide-three", + title: translate("Divide into three Lanes"), + action: { + click: splitLaneHandler(3) + } + } + }) + } + } + + assign(actions, { + "lane-insert-below": { + group: "lane-insert-below", + className: "bpmn-icon-lane-insert-below", + title: translate("Add Lane below"), + action: { + click: function (event, element) { + modeling.addLane(element, "bottom") + } + } + } + }) + } + + if (is(businessObject, "bpmn:FlowNode")) { + if (is(businessObject, "bpmn:EventBasedGateway")) { + assign(actions, { + "append.receive-task": appendAction("bpmn:ReceiveTask", "bpmn-icon-receive-task", translate("Append ReceiveTask")), + "append.message-intermediate-event": appendAction( + "bpmn:IntermediateCatchEvent", + "bpmn-icon-intermediate-event-catch-message", + translate("Append MessageIntermediateCatchEvent"), + { eventDefinitionType: "bpmn:MessageEventDefinition" } + ), + "append.timer-intermediate-event": appendAction( + "bpmn:IntermediateCatchEvent", + "bpmn-icon-intermediate-event-catch-timer", + translate("Append TimerIntermediateCatchEvent"), + { eventDefinitionType: "bpmn:TimerEventDefinition" } + ), + "append.condition-intermediate-event": appendAction( + "bpmn:IntermediateCatchEvent", + "bpmn-icon-intermediate-event-catch-condition", + translate("Append ConditionIntermediateCatchEvent"), + { eventDefinitionType: "bpmn:ConditionalEventDefinition" } + ), + "append.signal-intermediate-event": appendAction( + "bpmn:IntermediateCatchEvent", + "bpmn-icon-intermediate-event-catch-signal", + translate("Append SignalIntermediateCatchEvent"), + { eventDefinitionType: "bpmn:SignalEventDefinition" } + ) + }) + } else if (isEventType(businessObject, "bpmn:BoundaryEvent", "bpmn:CompensateEventDefinition")) { + assign(actions, { + "append.compensation-activity": appendAction("bpmn:Task", "bpmn-icon-task", translate("Append compensation activity"), { + isForCompensation: true + }) + }) + } else if ( + !is(businessObject, "bpmn:EndEvent") && + !businessObject.isForCompensation && + !isEventType(businessObject, "bpmn:IntermediateThrowEvent", "bpmn:LinkEventDefinition") && + !isEventSubProcess(businessObject) + ) { + assign(actions, { + "append.end-event": appendAction("bpmn:EndEvent", "bpmn-icon-end-event-none", translate("Append EndEvent")), + "append.gateway": appendAction("bpmn:ExclusiveGateway", "bpmn-icon-gateway-none", translate("Append Gateway")), + "append.append-task": appendAction("bpmn:UserTask", "bpmn-icon-user-task", translate("Append Task")), + "append.intermediate-event": appendAction( + "bpmn:IntermediateThrowEvent", + "bpmn-icon-intermediate-event-none", + translate("Append Intermediate/Boundary Event") + ) + }) + } + } + + if (!popupMenu.isEmpty(element, "bpmn-replace")) { + // Replace menu entry + assign(actions, { + replace: { + group: "edit", + className: "bpmn-icon-screw-wrench", + title: '修改类型', + action: { + click: function (event, element) { + const position = assign(getReplaceMenuPosition(element), { + cursor: { x: event.x, y: event.y } + }) + + popupMenu.open(element, "bpmn-replace", position) + } + } + } + }) + } + + if (isAny(businessObject, ["bpmn:FlowNode", "bpmn:InteractionNode", "bpmn:DataObjectReference", "bpmn:DataStoreReference"])) { + assign(actions, { + "append.text-annotation": appendAction("bpmn:TextAnnotation", "bpmn-icon-text-annotation"), + + connect: { + group: "connect", + className: "bpmn-icon-connection-multi", + title: translate("Connect using " + (businessObject.isForCompensation ? "" : "Sequence/MessageFlow or ") + "Association"), + action: { + click: startConnect, + dragstart: startConnect + } + } + }) + } + + if (isAny(businessObject, ["bpmn:DataObjectReference", "bpmn:DataStoreReference"])) { + assign(actions, { + connect: { + group: "connect", + className: "bpmn-icon-connection-multi", + title: translate("Connect using DataInputAssociation"), + action: { + click: startConnect, + dragstart: startConnect + } + } + }) + } + + if (is(businessObject, "bpmn:Group")) { + assign(actions, { + "append.text-annotation": appendAction("bpmn:TextAnnotation", "bpmn-icon-text-annotation") + }) + } + + // delete element entry, only show if allowed by rules + let deleteAllowed = rules.allowed('elements.delete', { elements: [element] }) + + if (isArray(deleteAllowed)) { + // was the element returned as a deletion candidate? + deleteAllowed = deleteAllowed[0] === element + } + + if (deleteAllowed) { + assign(actions, { + delete: { + group: "edit", + className: "bpmn-icon-trash", + title: translate("Remove"), + action: { + click: removeElement + } + } + }) + } + + return actions +} + +// helpers ///////// + +function isEventType (eventBo, type, definition) { + const isType = eventBo.$instanceOf(type) + let isDefinition = false + + const definitions = eventBo.eventDefinitions || [] + forEach(definitions, function (def) { + if (def.$type === definition) { + isDefinition = true + } + }) + + return isType && isDefinition +} diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/content-pad/index.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/content-pad/index.js new file mode 100644 index 000000000..a9cf887cc --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/content-pad/index.js @@ -0,0 +1,6 @@ +import CustomContextPadProvider from "./contentPadProvider"; + +export default { + __init__: ["contextPadProvider"], + contextPadProvider: ["type", CustomContextPadProvider] +}; diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/defaultEmpty.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/defaultEmpty.js new file mode 100644 index 000000000..ae96d2416 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/defaultEmpty.js @@ -0,0 +1,24 @@ +export default (key, name, type) => { + if (!type) type = "camunda"; + const TYPE_TARGET = { + activiti: "http://activiti.org/bpmn", + camunda: "http://bpmn.io/schema/bpmn", + flowable: "http://flowable.org/bpmn" + }; + return ` + + + + + + + +`; +}; diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/activitiDescriptor.json b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/activitiDescriptor.json new file mode 100644 index 000000000..9daed5081 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/activitiDescriptor.json @@ -0,0 +1,1071 @@ +{ + "name": "Activiti", + "uri": "http://activiti.org/bpmn", + "prefix": "activiti", + "xml": { + "tagAlias": "lowerCase" + }, + "associations": [], + "types": [ + { + "name": "Definitions", + "isAbstract": true, + "extends": [ + "bpmn:Definitions" + ], + "properties": [ + { + "name": "diagramRelationId", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "InOutBinding", + "superClass": [ + "Element" + ], + "isAbstract": true, + "properties": [ + { + "name": "source", + "isAttr": true, + "type": "String" + }, + { + "name": "sourceExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "target", + "isAttr": true, + "type": "String" + }, + { + "name": "businessKey", + "isAttr": true, + "type": "String" + }, + { + "name": "local", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "variables", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "In", + "superClass": [ + "InOutBinding" + ], + "meta": { + "allowedIn": [ + "bpmn:CallActivity" + ] + } + }, + { + "name": "Out", + "superClass": [ + "InOutBinding" + ], + "meta": { + "allowedIn": [ + "bpmn:CallActivity" + ] + } + }, + { + "name": "AsyncCapable", + "isAbstract": true, + "extends": [ + "bpmn:Activity", + "bpmn:Gateway", + "bpmn:Event" + ], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncBefore", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncAfter", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "exclusive", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "JobPriorized", + "isAbstract": true, + "extends": [ + "bpmn:Process", + "activiti:AsyncCapable" + ], + "properties": [ + { + "name": "jobPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "SignalEventDefinition", + "isAbstract": true, + "extends": [ + "bpmn:SignalEventDefinition" + ], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + } + ] + }, + { + "name": "ErrorEventDefinition", + "isAbstract": true, + "extends": [ + "bpmn:ErrorEventDefinition" + ], + "properties": [ + { + "name": "errorCodeVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "errorMessageVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Error", + "isAbstract": true, + "extends": [ + "bpmn:Error" + ], + "properties": [ + { + "name": "activiti:errorMessage", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "PotentialStarter", + "superClass": [ + "Element" + ], + "properties": [ + { + "name": "resourceAssignmentExpression", + "type": "bpmn:ResourceAssignmentExpression" + } + ] + }, + { + "name": "FormSupported", + "isAbstract": true, + "extends": [ + "bpmn:StartEvent", + "bpmn:UserTask" + ], + "properties": [ + { + "name": "formHandlerClass", + "isAttr": true, + "type": "String" + }, + { + "name": "formKey", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "TemplateSupported", + "isAbstract": true, + "extends": [ + "bpmn:Process", + "bpmn:FlowElement" + ], + "properties": [ + { + "name": "modelerTemplate", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Initiator", + "isAbstract": true, + "extends": [ "bpmn:StartEvent" ], + "properties": [ + { + "name": "initiator", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ScriptTask", + "isAbstract": true, + "extends": [ + "bpmn:ScriptTask" + ], + "properties": [ + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Process", + "isAbstract": true, + "extends": [ + "bpmn:Process" + ], + "properties": [ + { + "name": "candidateStarterGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateStarterUsers", + "isAttr": true, + "type": "String" + }, + { + "name": "versionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "historyTimeToLive", + "isAttr": true, + "type": "String" + }, + { + "name": "isStartableInTasklist", + "isAttr": true, + "type": "Boolean", + "default": true + }, + { + "name":"executionListener", + "isAbstract": true, + "type":"Expression" + } + ] + }, + { + "name": "EscalationEventDefinition", + "isAbstract": true, + "extends": [ + "bpmn:EscalationEventDefinition" + ], + "properties": [ + { + "name": "escalationCodeVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "FormalExpression", + "isAbstract": true, + "extends": [ + "bpmn:FormalExpression" + ], + "properties": [ + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "multiinstance_type", + "superClass":[ + "Element" + ] + }, + { + "name": "multiinstance_condition", + "superClass":[ + "Element" + ] + }, + { + "name": "Assignable", + "extends": [ "bpmn:UserTask" ], + "properties": [ + { + "name": "assignee", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateUsers", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "dueDate", + "isAttr": true, + "type": "String" + }, + { + "name": "followUpDate", + "isAttr": true, + "type": "String" + }, + { + "name": "priority", + "isAttr": true, + "type": "String" + }, + { + "name": "multiinstance_condition", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "CallActivity", + "extends": [ "bpmn:CallActivity" ], + "properties": [ + { + "name": "calledElementBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "calledElementVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementVersionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "caseRef", + "isAttr": true, + "type": "String" + }, + { + "name": "caseBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "caseVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "caseTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingClass", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingDelegateExpression", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ServiceTaskLike", + "extends": [ + "bpmn:ServiceTask", + "bpmn:BusinessRuleTask", + "bpmn:SendTask", + "bpmn:MessageEventDefinition" + ], + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "DmnCapable", + "extends": [ + "bpmn:BusinessRuleTask" + ], + "properties": [ + { + "name": "decisionRef", + "isAttr": true, + "type": "String" + }, + { + "name": "decisionRefBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "decisionRefVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "mapDecisionResult", + "isAttr": true, + "type": "String", + "default": "resultList" + }, + { + "name": "decisionRefTenantId", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ExternalCapable", + "extends": [ + "activiti:ServiceTaskLike" + ], + "properties": [ + { + "name": "type", + "isAttr": true, + "type": "String" + }, + { + "name": "topic", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "TaskPriorized", + "extends": [ + "bpmn:Process", + "activiti:ExternalCapable" + ], + "properties": [ + { + "name": "taskPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Properties", + "superClass": [ + "Element" + ], + "meta": { + "allowedIn": [ "*" ] + }, + "properties": [ + { + "name": "values", + "type": "Property", + "isMany": true + } + ] + }, + { + "name": "Property", + "superClass": [ + "Element" + ], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "value", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "Connector", + "superClass": [ + "Element" + ], + "meta": { + "allowedIn": [ + "activiti:ServiceTaskLike" + ] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + } + ] + }, + { + "name": "InputOutput", + "superClass": [ + "Element" + ], + "meta": { + "allowedIn": [ + "bpmn:FlowNode", + "activiti:Connector" + ] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + }, + { + "name": "inputParameters", + "isMany": true, + "type": "InputParameter" + }, + { + "name": "outputParameters", + "isMany": true, + "type": "OutputParameter" + } + ] + }, + { + "name": "InputOutputParameter", + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "InputOutputParameterDefinition", + "isAbstract": true + }, + { + "name": "List", + "superClass": [ "InputOutputParameterDefinition" ], + "properties": [ + { + "name": "items", + "isMany": true, + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Map", + "superClass": [ "InputOutputParameterDefinition" ], + "properties": [ + { + "name": "entries", + "isMany": true, + "type": "Entry" + } + ] + }, + { + "name": "Entry", + "properties": [ + { + "name": "key", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Value", + "superClass": [ + "InputOutputParameterDefinition" + ], + "properties": [ + { + "name": "id", + "isAttr": true, + "type": "String" + }, + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Script", + "superClass": [ "InputOutputParameterDefinition" ], + "properties": [ + { + "name": "scriptFormat", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Field", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "activiti:ServiceTaskLike", + "activiti:ExecutionListener", + "activiti:TaskListener" + ] + }, + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "expression", + "type": "String" + }, + { + "name": "stringValue", + "isAttr": true, + "type": "String" + }, + { + "name": "string", + "type": "String" + } + ] + }, + { + "name": "InputParameter", + "superClass": [ "InputOutputParameter" ] + }, + { + "name": "OutputParameter", + "superClass": [ "InputOutputParameter" ] + }, + { + "name": "Collectable", + "isAbstract": true, + "extends": [ "bpmn:MultiInstanceLoopCharacteristics" ], + "superClass": [ "activiti:AsyncCapable" ], + "properties": [ + { + "name": "collection", + "isAttr": true, + "type": "String" + }, + { + "name": "elementVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "FailedJobRetryTimeCycle", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "activiti:AsyncCapable", + "bpmn:MultiInstanceLoopCharacteristics" + ] + }, + "properties": [ + { + "name": "body", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "ExecutionListener", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "bpmn:Task", + "bpmn:ServiceTask", + "bpmn:UserTask", + "bpmn:BusinessRuleTask", + "bpmn:ScriptTask", + "bpmn:ReceiveTask", + "bpmn:ManualTask", + "bpmn:ExclusiveGateway", + "bpmn:SequenceFlow", + "bpmn:ParallelGateway", + "bpmn:InclusiveGateway", + "bpmn:EventBasedGateway", + "bpmn:StartEvent", + "bpmn:IntermediateCatchEvent", + "bpmn:IntermediateThrowEvent", + "bpmn:EndEvent", + "bpmn:BoundaryEvent", + "bpmn:CallActivity", + "bpmn:SubProcess", + "bpmn:Process" + ] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + } + ] + }, + { + "name": "TaskListener", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "bpmn:UserTask" + ] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + } + ] + }, + { + "name": "FormProperty", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "bpmn:StartEvent", + "bpmn:UserTask" + ] + }, + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "required", + "type": "String", + "isAttr": true + }, + { + "name": "readable", + "type": "String", + "isAttr": true + }, + { + "name": "writable", + "type": "String", + "isAttr": true + }, + { + "name": "variable", + "type": "String", + "isAttr": true + }, + { + "name": "expression", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "default", + "type": "String", + "isAttr": true + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "FormProperty", + "superClass": [ "Element" ], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "label", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "defaultValue", + "type": "String", + "isAttr": true + }, + { + "name": "properties", + "type": "Properties" + }, + { + "name": "validation", + "type": "Validation" + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "Validation", + "superClass": [ "Element" ], + "properties": [ + { + "name": "constraints", + "type": "Constraint", + "isMany": true + } + ] + }, + { + "name": "Constraint", + "superClass": [ "Element" ], + "properties": [ + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "config", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "ConditionalEventDefinition", + "isAbstract": true, + "extends": [ + "bpmn:ConditionalEventDefinition" + ], + "properties": [ + { + "name": "variableName", + "isAttr": true, + "type": "String" + }, + { + "name": "variableEvent", + "isAttr": true, + "type": "String" + } + ] + } + ], + "emumerations": [ ] +} diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/camundaDescriptor.json b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/camundaDescriptor.json new file mode 100644 index 000000000..a57dbe639 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/camundaDescriptor.json @@ -0,0 +1,1087 @@ +{ + "name": "Camunda", + "uri": "http://camunda.org/schema/1.0/bpmn", + "prefix": "camunda", + "xml": { + "tagAlias": "lowerCase" + }, + "associations": [], + "types": [ + { + "name": "Definitions", + "isAbstract": true, + "extends": [ + "bpmn:Definitions" + ], + "properties": [ + { + "name": "diagramRelationId", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "InOutBinding", + "superClass": [ + "Element" + ], + "isAbstract": true, + "properties": [ + { + "name": "source", + "isAttr": true, + "type": "String" + }, + { + "name": "sourceExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "target", + "isAttr": true, + "type": "String" + }, + { + "name": "businessKey", + "isAttr": true, + "type": "String" + }, + { + "name": "local", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "variables", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "In", + "superClass": [ + "InOutBinding" + ], + "meta": { + "allowedIn": [ + "bpmn:CallActivity", + "bpmn:SignalEventDefinition" + ] + } + }, + { + "name": "Out", + "superClass": [ + "InOutBinding" + ], + "meta": { + "allowedIn": [ + "bpmn:CallActivity" + ] + } + }, + { + "name": "AsyncCapable", + "isAbstract": true, + "extends": [ + "bpmn:Activity", + "bpmn:Gateway", + "bpmn:Event" + ], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncBefore", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncAfter", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "exclusive", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "JobPriorized", + "isAbstract": true, + "extends": [ + "bpmn:Process", + "camunda:AsyncCapable" + ], + "properties": [ + { + "name": "jobPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "SignalEventDefinition", + "isAbstract": true, + "extends": [ + "bpmn:SignalEventDefinition" + ], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + } + ] + }, + { + "name": "ErrorEventDefinition", + "isAbstract": true, + "extends": [ + "bpmn:ErrorEventDefinition" + ], + "properties": [ + { + "name": "errorCodeVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "errorMessageVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Error", + "isAbstract": true, + "extends": [ + "bpmn:Error" + ], + "properties": [ + { + "name": "camunda:errorMessage", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "PotentialStarter", + "superClass": [ + "Element" + ], + "properties": [ + { + "name": "resourceAssignmentExpression", + "type": "bpmn:ResourceAssignmentExpression" + } + ] + }, + { + "name": "FormSupported", + "isAbstract": true, + "extends": [ + "bpmn:StartEvent", + "bpmn:UserTask" + ], + "properties": [ + { + "name": "formHandlerClass", + "isAttr": true, + "type": "String" + }, + { + "name": "formKey", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "TemplateSupported", + "isAbstract": true, + "extends": [ + "bpmn:Process", + "bpmn:FlowElement" + ], + "properties": [ + { + "name": "modelerTemplate", + "isAttr": true, + "type": "String" + }, + { + "name": "modelerTemplateVersion", + "isAttr": true, + "type": "Integer" + } + ] + }, + { + "name": "Initiator", + "isAbstract": true, + "extends": [ "bpmn:StartEvent" ], + "properties": [ + { + "name": "initiator", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ScriptTask", + "isAbstract": true, + "extends": [ + "bpmn:ScriptTask" + ], + "properties": [ + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Process", + "isAbstract": true, + "extends": [ + "bpmn:Process" + ], + "properties": [ + { + "name": "candidateStarterGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateStarterUsers", + "isAttr": true, + "type": "String" + }, + { + "name": "versionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "historyTimeToLive", + "isAttr": true, + "type": "String" + }, + { + "name": "isStartableInTasklist", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "EscalationEventDefinition", + "isAbstract": true, + "extends": [ + "bpmn:EscalationEventDefinition" + ], + "properties": [ + { + "name": "escalationCodeVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "FormalExpression", + "isAbstract": true, + "extends": [ + "bpmn:FormalExpression" + ], + "properties": [ + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Assignable", + "extends": [ "bpmn:UserTask" ], + "properties": [ + { + "name": "assignee", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateUsers", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "dueDate", + "isAttr": true, + "type": "String" + }, + { + "name": "followUpDate", + "isAttr": true, + "type": "String" + }, + { + "name": "priority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "CallActivity", + "extends": [ "bpmn:CallActivity" ], + "properties": [ + { + "name": "calledElementBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "calledElementVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementVersionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "caseRef", + "isAttr": true, + "type": "String" + }, + { + "name": "caseBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "caseVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "caseTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingClass", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingDelegateExpression", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ServiceTaskLike", + "extends": [ + "bpmn:ServiceTask", + "bpmn:BusinessRuleTask", + "bpmn:SendTask", + "bpmn:MessageEventDefinition" + ], + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "DmnCapable", + "extends": [ + "bpmn:BusinessRuleTask" + ], + "properties": [ + { + "name": "decisionRef", + "isAttr": true, + "type": "String" + }, + { + "name": "decisionRefBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "decisionRefVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "mapDecisionResult", + "isAttr": true, + "type": "String", + "default": "resultList" + }, + { + "name": "decisionRefTenantId", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ExternalCapable", + "extends": [ + "camunda:ServiceTaskLike" + ], + "properties": [ + { + "name": "type", + "isAttr": true, + "type": "String" + }, + { + "name": "topic", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "TaskPriorized", + "extends": [ + "bpmn:Process", + "camunda:ExternalCapable" + ], + "properties": [ + { + "name": "taskPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Properties", + "superClass": [ + "Element" + ], + "meta": { + "allowedIn": [ "*" ] + }, + "properties": [ + { + "name": "values", + "type": "Property", + "isMany": true + } + ] + }, + { + "name": "Property", + "superClass": [ + "Element" + ], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "value", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "Connector", + "superClass": [ + "Element" + ], + "meta": { + "allowedIn": [ + "camunda:ServiceTaskLike" + ] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + } + ] + }, + { + "name": "InputOutput", + "superClass": [ + "Element" + ], + "meta": { + "allowedIn": [ + "bpmn:FlowNode", + "camunda:Connector" + ] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + }, + { + "name": "inputParameters", + "isMany": true, + "type": "InputParameter" + }, + { + "name": "outputParameters", + "isMany": true, + "type": "OutputParameter" + } + ] + }, + { + "name": "InputOutputParameter", + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "InputOutputParameterDefinition", + "isAbstract": true + }, + { + "name": "List", + "superClass": [ "InputOutputParameterDefinition" ], + "properties": [ + { + "name": "items", + "isMany": true, + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Map", + "superClass": [ "InputOutputParameterDefinition" ], + "properties": [ + { + "name": "entries", + "isMany": true, + "type": "Entry" + } + ] + }, + { + "name": "Entry", + "properties": [ + { + "name": "key", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Value", + "superClass": [ + "InputOutputParameterDefinition" + ], + "properties": [ + { + "name": "id", + "isAttr": true, + "type": "String" + }, + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Script", + "superClass": [ "InputOutputParameterDefinition" ], + "properties": [ + { + "name": "scriptFormat", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Field", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "camunda:ServiceTaskLike", + "camunda:ExecutionListener", + "camunda:TaskListener" + ] + }, + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "expression", + "type": "String" + }, + { + "name": "stringValue", + "isAttr": true, + "type": "String" + }, + { + "name": "string", + "type": "String" + } + ] + }, + { + "name": "InputParameter", + "superClass": [ "InputOutputParameter" ] + }, + { + "name": "OutputParameter", + "superClass": [ "InputOutputParameter" ] + }, + { + "name": "Collectable", + "isAbstract": true, + "extends": [ "bpmn:MultiInstanceLoopCharacteristics" ], + "superClass": [ "camunda:AsyncCapable" ], + "properties": [ + { + "name": "collection", + "isAttr": true, + "type": "String" + }, + { + "name": "elementVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "FailedJobRetryTimeCycle", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "camunda:AsyncCapable", + "bpmn:MultiInstanceLoopCharacteristics" + ] + }, + "properties": [ + { + "name": "body", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "ExecutionListener", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "bpmn:Task", + "bpmn:ServiceTask", + "bpmn:UserTask", + "bpmn:BusinessRuleTask", + "bpmn:ScriptTask", + "bpmn:ReceiveTask", + "bpmn:ManualTask", + "bpmn:ExclusiveGateway", + "bpmn:SequenceFlow", + "bpmn:ParallelGateway", + "bpmn:InclusiveGateway", + "bpmn:EventBasedGateway", + "bpmn:StartEvent", + "bpmn:IntermediateCatchEvent", + "bpmn:IntermediateThrowEvent", + "bpmn:EndEvent", + "bpmn:BoundaryEvent", + "bpmn:CallActivity", + "bpmn:SubProcess", + "bpmn:Process" + ] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + } + ] + }, + { + "name": "TaskListener", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "bpmn:UserTask" + ] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + }, + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "eventDefinitions", + "type": "bpmn:TimerEventDefinition", + "isMany": true + } + ] + }, + { + "name": "FormProperty", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "bpmn:StartEvent", + "bpmn:UserTask" + ] + }, + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "required", + "type": "String", + "isAttr": true + }, + { + "name": "readable", + "type": "String", + "isAttr": true + }, + { + "name": "writable", + "type": "String", + "isAttr": true + }, + { + "name": "variable", + "type": "String", + "isAttr": true + }, + { + "name": "expression", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "default", + "type": "String", + "isAttr": true + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "FormData", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "bpmn:StartEvent", + "bpmn:UserTask" + ] + }, + "properties": [ + { + "name": "fields", + "type": "FormField", + "isMany": true + }, + { + "name": "businessKey", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "FormField", + "superClass": [ "Element" ], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "label", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "defaultValue", + "type": "String", + "isAttr": true + }, + { + "name": "properties", + "type": "Properties" + }, + { + "name": "validation", + "type": "Validation" + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "Validation", + "superClass": [ "Element" ], + "properties": [ + { + "name": "constraints", + "type": "Constraint", + "isMany": true + } + ] + }, + { + "name": "Constraint", + "superClass": [ "Element" ], + "properties": [ + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "config", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "ConditionalEventDefinition", + "isAbstract": true, + "extends": [ + "bpmn:ConditionalEventDefinition" + ], + "properties": [ + { + "name": "variableName", + "isAttr": true, + "type": "String" + }, + { + "name": "variableEvents", + "isAttr": true, + "type": "String" + } + ] + } + ], + "emumerations": [ ] +} diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/flowableDescriptor.json b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/flowableDescriptor.json new file mode 100644 index 000000000..ef76af47f --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/flowableDescriptor.json @@ -0,0 +1,1210 @@ +{ + "name": "Flowable", + "uri": "http://flowable.org/bpmn", + "prefix": "flowable", + "xml": { + "tagAlias": "lowerCase" + }, + "associations": [], + "types": [ + { + "name": "InOutBinding", + "superClass": ["Element"], + "isAbstract": true, + "properties": [ + { + "name": "source", + "isAttr": true, + "type": "String" + }, + { + "name": "sourceExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "target", + "isAttr": true, + "type": "String" + }, + { + "name": "businessKey", + "isAttr": true, + "type": "String" + }, + { + "name": "local", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "variables", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "In", + "superClass": ["InOutBinding"], + "meta": { + "allowedIn": ["bpmn:CallActivity"] + } + }, + { + "name": "Out", + "superClass": ["InOutBinding"], + "meta": { + "allowedIn": ["bpmn:CallActivity"] + } + }, + { + "name": "AsyncCapable", + "isAbstract": true, + "extends": ["bpmn:Activity", "bpmn:Gateway", "bpmn:Event"], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncBefore", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncAfter", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "exclusive", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "JobPriorized", + "isAbstract": true, + "extends": ["bpmn:Process", "flowable:AsyncCapable"], + "properties": [ + { + "name": "jobPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "SignalEventDefinition", + "isAbstract": true, + "extends": ["bpmn:SignalEventDefinition"], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + } + ] + }, + { + "name": "ErrorEventDefinition", + "isAbstract": true, + "extends": ["bpmn:ErrorEventDefinition"], + "properties": [ + { + "name": "errorCodeVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "errorMessageVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Error", + "isAbstract": true, + "extends": ["bpmn:Error"], + "properties": [ + { + "name": "flowable:errorMessage", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "PotentialStarter", + "superClass": ["Element"], + "properties": [ + { + "name": "resourceAssignmentExpression", + "type": "bpmn:ResourceAssignmentExpression" + } + ] + }, + { + "name": "FormSupported", + "isAbstract": true, + "extends": ["bpmn:StartEvent", "bpmn:UserTask"], + "properties": [ + { + "name": "formHandlerClass", + "isAttr": true, + "type": "String" + }, + { + "name": "formKey", + "isAttr": true, + "type": "String" + }, + { + "name": "formType", + "isAttr": true, + "type": "String" + }, + { + "name": "formReadOnly", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "formInit", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "TemplateSupported", + "isAbstract": true, + "extends": ["bpmn:Process", "bpmn:FlowElement"], + "properties": [ + { + "name": "modelerTemplate", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Initiator", + "isAbstract": true, + "extends": ["bpmn:StartEvent"], + "properties": [ + { + "name": "initiator", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ScriptTask", + "isAbstract": true, + "extends": ["bpmn:ScriptTask"], + "properties": [ + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Process", + "isAbstract": true, + "extends": ["bpmn:Process"], + "properties": [ + { + "name": "candidateStarterGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateStarterUsers", + "isAttr": true, + "type": "String" + }, + { + "name": "versionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "historyTimeToLive", + "isAttr": true, + "type": "String" + }, + { + "name": "isStartableInTasklist", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "EscalationEventDefinition", + "isAbstract": true, + "extends": ["bpmn:EscalationEventDefinition"], + "properties": [ + { + "name": "escalationCodeVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "FormalExpression", + "isAbstract": true, + "extends": ["bpmn:FormalExpression"], + "properties": [ + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Assignable", + "extends": ["bpmn:UserTask"], + "properties": [ + { + "name": "assignee", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateUsers", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "dueDate", + "isAttr": true, + "type": "String" + }, + { + "name": "followUpDate", + "isAttr": true, + "type": "String" + }, + { + "name": "priority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Assignee", + "supperClass": "Element", + "meta": { + "allowedIn": ["*"] + }, + "properties": [ + { + "name": "label", + "type": "String", + "isAttr": true + }, + { + "name": "viewId", + "type": "Number", + "isAttr": true + } + ] + }, + { + "name": "CallActivity", + "extends": ["bpmn:CallActivity"], + "properties": [ + { + "name": "calledElementBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "calledElementVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementVersionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "caseRef", + "isAttr": true, + "type": "String" + }, + { + "name": "caseBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "caseVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "caseTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingClass", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingDelegateExpression", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ServiceTaskLike", + "extends": [ + "bpmn:ServiceTask", + "bpmn:BusinessRuleTask", + "bpmn:SendTask", + "bpmn:MessageEventDefinition" + ], + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "DmnCapable", + "extends": ["bpmn:BusinessRuleTask"], + "properties": [ + { + "name": "decisionRef", + "isAttr": true, + "type": "String" + }, + { + "name": "decisionRefBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "decisionRefVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "mapDecisionResult", + "isAttr": true, + "type": "String", + "default": "resultList" + }, + { + "name": "decisionRefTenantId", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ExternalCapable", + "extends": ["flowable:ServiceTaskLike"], + "properties": [ + { + "name": "type", + "isAttr": true, + "type": "String" + }, + { + "name": "topic", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "TaskPriorized", + "extends": ["bpmn:Process", "flowable:ExternalCapable"], + "properties": [ + { + "name": "taskPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Properties", + "superClass": ["Element"], + "meta": { + "allowedIn": ["*"] + }, + "properties": [ + { + "name": "values", + "type": "Property", + "isMany": true + } + ] + }, + { + "name": "Property", + "superClass": ["Element"], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "value", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "Button", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:UserTask"] + }, + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "code", + "type": "String", + "isAttr": true + }, + { + "name": "isHide", + "type": "String", + "isAttr": true + }, + { + "name": "next", + "type": "String", + "isAttr": true + }, + { + "name": "sort", + "type": "Integer", + "isAttr": true + } + ] + }, + { + "name": "Assignee", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:UserTask"] + }, + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "value", + "type": "String", + "isAttr": true + }, + { + "name": "condition", + "type": "String", + "isAttr": true + }, + { + "name": "operationType", + "type": "String", + "isAttr": true + }, + { + "name": "sort", + "type": "Integer", + "isAttr": true + } + ] + }, + { + "name": "Connector", + "superClass": ["Element"], + "meta": { + "allowedIn": ["flowable:ServiceTaskLike"] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + } + ] + }, + { + "name": "InputOutput", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:FlowNode", "flowable:Connector"] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + }, + { + "name": "inputParameters", + "isMany": true, + "type": "InputParameter" + }, + { + "name": "outputParameters", + "isMany": true, + "type": "OutputParameter" + } + ] + }, + { + "name": "InputOutputParameter", + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "InputOutputParameterDefinition", + "isAbstract": true + }, + { + "name": "List", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "items", + "isMany": true, + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Map", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "entries", + "isMany": true, + "type": "Entry" + } + ] + }, + { + "name": "Entry", + "properties": [ + { + "name": "key", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Value", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "id", + "isAttr": true, + "type": "String" + }, + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Script", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "scriptFormat", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Field", + "superClass": ["Element"], + "meta": { + "allowedIn": [ + "flowable:ServiceTaskLike", + "flowable:ExecutionListener", + "flowable:TaskListener" + ] + }, + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "expression", + "type": "String" + }, + { + "name": "stringValue", + "isAttr": true, + "type": "String" + }, + { + "name": "string", + "type": "String" + } + ] + }, + { + "name": "ChildField", + "superClass": ["Element"], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "required", + "type": "String", + "isAttr": true + }, + { + "name": "readable", + "type": "String", + "isAttr": true + }, + { + "name": "writable", + "type": "String", + "isAttr": true + }, + { + "name": "variable", + "type": "String", + "isAttr": true + }, + { + "name": "expression", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "default", + "type": "String", + "isAttr": true + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "InputParameter", + "superClass": ["InputOutputParameter"] + }, + { + "name": "OutputParameter", + "superClass": ["InputOutputParameter"] + }, + { + "name": "Collectable", + "isAbstract": true, + "extends": ["bpmn:MultiInstanceLoopCharacteristics"], + "superClass": ["flowable:AsyncCapable"], + "properties": [ + { + "name": "collection", + "isAttr": true, + "type": "String" + }, + { + "name": "elementVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "FailedJobRetryTimeCycle", + "superClass": ["Element"], + "meta": { + "allowedIn": [ + "flowable:AsyncCapable", + "bpmn:MultiInstanceLoopCharacteristics" + ] + }, + "properties": [ + { + "name": "body", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "ExecutionListener", + "superClass": ["Element"], + "meta": { + "allowedIn": [ + "bpmn:Task", + "bpmn:ServiceTask", + "bpmn:UserTask", + "bpmn:BusinessRuleTask", + "bpmn:ScriptTask", + "bpmn:ReceiveTask", + "bpmn:ManualTask", + "bpmn:ExclusiveGateway", + "bpmn:SequenceFlow", + "bpmn:ParallelGateway", + "bpmn:InclusiveGateway", + "bpmn:EventBasedGateway", + "bpmn:StartEvent", + "bpmn:IntermediateCatchEvent", + "bpmn:IntermediateThrowEvent", + "bpmn:EndEvent", + "bpmn:BoundaryEvent", + "bpmn:CallActivity", + "bpmn:SubProcess", + "bpmn:Process" + ] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + } + ] + }, + { + "name": "TaskListener", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:UserTask"] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + } + ] + }, + { + "name": "FormProperty", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:StartEvent", "bpmn:UserTask"] + }, + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "required", + "type": "String", + "isAttr": true + }, + { + "name": "readable", + "type": "String", + "isAttr": true + }, + { + "name": "writable", + "type": "String", + "isAttr": true + }, + { + "name": "variable", + "type": "String", + "isAttr": true + }, + { + "name": "expression", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "default", + "type": "String", + "isAttr": true + }, + { + "name": "values", + "type": "Value", + "isMany": true + }, + { + "name": "children", + "type": "ChildField", + "isMany": true + }, + { + "name": "extensionElements", + "type": "bpmn:ExtensionElements", + "isMany": true + } + ] + }, + { + "name": "FormData", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:StartEvent", "bpmn:UserTask"] + }, + "properties": [ + { + "name": "fields", + "type": "FormField", + "isMany": true + }, + { + "name": "businessKey", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "FormField", + "superClass": ["Element"], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "label", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "defaultValue", + "type": "String", + "isAttr": true + }, + { + "name": "properties", + "type": "Properties" + }, + { + "name": "validation", + "type": "Validation" + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "Validation", + "superClass": ["Element"], + "properties": [ + { + "name": "constraints", + "type": "Constraint", + "isMany": true + } + ] + }, + { + "name": "Constraint", + "superClass": ["Element"], + "properties": [ + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "config", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "ConditionalEventDefinition", + "isAbstract": true, + "extends": ["bpmn:ConditionalEventDefinition"], + "properties": [ + { + "name": "variableName", + "isAttr": true, + "type": "String" + }, + { + "name": "variableEvent", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Condition", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:SequenceFlow"] + }, + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "field", + "type": "String", + "isAttr": true + }, + { + "name": "compare", + "type": "String", + "isAttr": true + }, + { + "name": "value", + "type": "String", + "isAttr": true + }, + { + "name": "logic", + "type": "String", + "isAttr": true + }, + { + "name": "sort", + "type": "Integer", + "isAttr": true + } + ] + } + ], + "emumerations": [] +} diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/activiti/activitiExtension.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/activiti/activitiExtension.js new file mode 100644 index 000000000..4d4ae4ee6 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/activiti/activitiExtension.js @@ -0,0 +1,79 @@ +"use strict" + +import { some } from 'min-dash' + +// const some = require('min-dash').some +// const some = some + +const ALLOWED_TYPES = { + FailedJobRetryTimeCycle: ['bpmn:StartEvent', 'bpmn:BoundaryEvent', 'bpmn:IntermediateCatchEvent', 'bpmn:Activity'], + Connector: ['bpmn:EndEvent', 'bpmn:IntermediateThrowEvent'], + Field: ['bpmn:EndEvent', 'bpmn:IntermediateThrowEvent'] +} + +function is (element, type) { + return element && typeof element.$instanceOf === "function" && element.$instanceOf(type) +} + +function exists (element) { + return element && element.length +} + +function includesType (collection, type) { + return ( + exists(collection) && + some(collection, function (element) { + return is(element, type) + }) + ) +} + +function anyType (element, types) { + return some(types, function (type) { + return is(element, type) + }) +} + +function isAllowed (propName, propDescriptor, newElement) { + const name = propDescriptor.name, + types = ALLOWED_TYPES[name.replace(/activiti:/, '')] + + return name === propName && anyType(newElement, types) +} + +function ActivitiModdleExtension (eventBus) { + eventBus.on( + "property.clone", + function (context) { + const newElement = context.newElement, + propDescriptor = context.propertyDescriptor + + this.canCloneProperty(newElement, propDescriptor) + }, + this + ) +} + +ActivitiModdleExtension.$inject = ["eventBus"] + +ActivitiModdleExtension.prototype.canCloneProperty = function (newElement, propDescriptor) { + if (isAllowed("activiti:FailedJobRetryTimeCycle", propDescriptor, newElement)) { + return ( + includesType(newElement.eventDefinitions, "bpmn:TimerEventDefinition") || + includesType(newElement.eventDefinitions, "bpmn:SignalEventDefinition") || + is(newElement.loopCharacteristics, "bpmn:MultiInstanceLoopCharacteristics") + ) + } + + if (isAllowed("activiti:Connector", propDescriptor, newElement)) { + return includesType(newElement.eventDefinitions, "bpmn:MessageEventDefinition") + } + + if (isAllowed("activiti:Field", propDescriptor, newElement)) { + return includesType(newElement.eventDefinitions, "bpmn:MessageEventDefinition") + } +} + +// module.exports = ActivitiModdleExtension; +export default ActivitiModdleExtension + diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/activiti/index.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/activiti/index.js new file mode 100644 index 000000000..1e8486e4d --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/activiti/index.js @@ -0,0 +1,11 @@ +/* + * @author igdianov + * address https://github.com/igdianov/activiti-bpmn-moddle + * */ + +import activitiExtension from "./activitiExtension" + +export default { + __init__: ["ActivitiModdleExtension"], + ActivitiModdleExtension: ["type", activitiExtension] +} diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/camunda/extension.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/camunda/extension.js new file mode 100644 index 000000000..518331509 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/camunda/extension.js @@ -0,0 +1,157 @@ +"use strict" + + +import { + isFunction, + isObject, + some +} from 'min-dash' + +// const isFunction = isFunction, +// isObject = isObject, +// some = some +// const isFunction = require('min-dash').isFunction, +// isObject = require('min-dash').isObject, +// some = require('min-dash').some + +const WILDCARD = '*' + +function CamundaModdleExtension (eventBus) { + const self = this + + eventBus.on("moddleCopy.canCopyProperty", function (context) { + const property = context.property, + parent = context.parent + + return self.canCopyProperty(property, parent) + }) +} + +CamundaModdleExtension.$inject = ["eventBus"] + +/** + * Check wether to disallow copying property. + */ +CamundaModdleExtension.prototype.canCopyProperty = function (property, parent) { + // (1) check wether property is allowed in parent + if (isObject(property) && !isAllowedInParent(property, parent)) { + return false + } + + // (2) check more complex scenarios + + if (is(property, "camunda:InputOutput") && !this.canHostInputOutput(parent)) { + return false + } + + if (isAny(property, ["camunda:Connector", "camunda:Field"]) && !this.canHostConnector(parent)) { + return false + } + + if (is(property, "camunda:In") && !this.canHostIn(parent)) { + return false + } +} + +CamundaModdleExtension.prototype.canHostInputOutput = function (parent) { + // allowed in camunda:Connector + const connector = getParent(parent, 'camunda:Connector') + + if (connector) { + return true + } + + // special rules inside bpmn:FlowNode + const flowNode = getParent(parent, 'bpmn:FlowNode') + + if (!flowNode) { + return false + } + + if (isAny(flowNode, ["bpmn:StartEvent", "bpmn:Gateway", "bpmn:BoundaryEvent"])) { + return false + } + + return !(is(flowNode, "bpmn:SubProcess") && flowNode.get("triggeredByEvent")) + + +} + +CamundaModdleExtension.prototype.canHostConnector = function (parent) { + const serviceTaskLike = getParent(parent, 'camunda:ServiceTaskLike') + + if (is(serviceTaskLike, "bpmn:MessageEventDefinition")) { + // only allow on throw and end events + return getParent(parent, "bpmn:IntermediateThrowEvent") || getParent(parent, "bpmn:EndEvent") + } + + return true +} + +CamundaModdleExtension.prototype.canHostIn = function (parent) { + const callActivity = getParent(parent, 'bpmn:CallActivity') + + if (callActivity) { + return true + } + + const signalEventDefinition = getParent(parent, 'bpmn:SignalEventDefinition') + + if (signalEventDefinition) { + // only allow on throw and end events + return getParent(parent, "bpmn:IntermediateThrowEvent") || getParent(parent, "bpmn:EndEvent") + } + + return true +} + +// module.exports = CamundaModdleExtension; +export default CamundaModdleExtension + +// helpers ////////// + +function is (element, type) { + return element && isFunction(element.$instanceOf) && element.$instanceOf(type) +} + +function isAny (element, types) { + return some(types, function (t) { + return is(element, t) + }) +} + +function getParent (element, type) { + if (!type) { + return element.$parent + } + + if (is(element, type)) { + return element + } + + if (!element.$parent) { + return + } + + return getParent(element.$parent, type) +} + +function isAllowedInParent (property, parent) { + // (1) find property descriptor + const descriptor = property.$type && property.$model.getTypeDescriptor(property.$type) + + const allowedIn = descriptor && descriptor.meta && descriptor.meta.allowedIn + + if (!allowedIn || isWildcard(allowedIn)) { + return true + } + + // (2) check wether property has parent of allowed type + return some(allowedIn, function (type) { + return getParent(parent, type) + }) +} + +function isWildcard (allowedIn) { + return allowedIn.indexOf(WILDCARD) !== -1 +} diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/camunda/index.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/camunda/index.js new file mode 100644 index 000000000..f35b7db28 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/camunda/index.js @@ -0,0 +1,8 @@ +"use strict" + +import extension from "./extension" + +export default { + __init__: ["camundaModdleExtension"], + camundaModdleExtension: ["type", extension] +} diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/flowable/flowableExtension.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/flowable/flowableExtension.js new file mode 100644 index 000000000..50e63ba8f --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/flowable/flowableExtension.js @@ -0,0 +1,80 @@ +"use strict" + +import { some } from 'min-dash' + +// const some = some +// const some = require('min-dash').some + + + +const ALLOWED_TYPES = { + FailedJobRetryTimeCycle: ['bpmn:StartEvent', 'bpmn:BoundaryEvent', 'bpmn:IntermediateCatchEvent', 'bpmn:Activity'], + Connector: ['bpmn:EndEvent', 'bpmn:IntermediateThrowEvent'], + Field: ['bpmn:EndEvent', 'bpmn:IntermediateThrowEvent'] +} + +function is (element, type) { + return element && typeof element.$instanceOf === "function" && element.$instanceOf(type) +} + +function exists (element) { + return element && element.length +} + +function includesType (collection, type) { + return ( + exists(collection) && + some(collection, function (element) { + return is(element, type) + }) + ) +} + +function anyType (element, types) { + return some(types, function (type) { + return is(element, type) + }) +} + +function isAllowed (propName, propDescriptor, newElement) { + const name = propDescriptor.name, + types = ALLOWED_TYPES[name.replace(/flowable:/, '')] + + return name === propName && anyType(newElement, types) +} + +function FlowableModdleExtension (eventBus) { + eventBus.on( + "property.clone", + function (context) { + const newElement = context.newElement, + propDescriptor = context.propertyDescriptor + + this.canCloneProperty(newElement, propDescriptor) + }, + this + ) +} + +FlowableModdleExtension.$inject = ["eventBus"] + +FlowableModdleExtension.prototype.canCloneProperty = function (newElement, propDescriptor) { + if (isAllowed("flowable:FailedJobRetryTimeCycle", propDescriptor, newElement)) { + return ( + includesType(newElement.eventDefinitions, "bpmn:TimerEventDefinition") || + includesType(newElement.eventDefinitions, "bpmn:SignalEventDefinition") || + is(newElement.loopCharacteristics, "bpmn:MultiInstanceLoopCharacteristics") + ) + } + + if (isAllowed("flowable:Connector", propDescriptor, newElement)) { + return includesType(newElement.eventDefinitions, "bpmn:MessageEventDefinition") + } + + if (isAllowed("flowable:Field", propDescriptor, newElement)) { + return includesType(newElement.eventDefinitions, "bpmn:MessageEventDefinition") + } +} + +// module.exports = FlowableModdleExtension; +export default FlowableModdleExtension diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/flowable/index.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/flowable/index.js new file mode 100644 index 000000000..58d6f87c5 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/extension-moddle/flowable/index.js @@ -0,0 +1,10 @@ +/* + * @author igdianov + * address https://github.com/igdianov/activiti-bpmn-moddle + * */ +import flowableExtension from "./flowableExtension" + +export default { + __init__: ["FlowableModdleExtension"], + FlowableModdleExtension: ["type", flowableExtension] +} diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/palette/CustomPalette.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/palette/CustomPalette.js new file mode 100644 index 000000000..74dc8f20a --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/palette/CustomPalette.js @@ -0,0 +1,157 @@ +import PaletteProvider from 'bpmn-js/lib/features/palette/PaletteProvider' +import { assign } from "min-dash" + +export default function CustomPalette (palette, create, elementFactory, spaceTool, lassoTool, handTool, globalConnect, translate) { + PaletteProvider.call(this, palette, create, elementFactory, spaceTool, lassoTool, handTool, globalConnect, translate, 2000) +} + +const F = function () { } // 核心,利用空对象作为中介; +F.prototype = PaletteProvider.prototype // 核心,将父类的原型赋值给空对象F; + +// 利用中介函数重写原型链方法 +F.prototype.getPaletteEntries = function () { + const actions = {}, + create = this._create, + elementFactory = this._elementFactory, + spaceTool = this._spaceTool, + lassoTool = this._lassoTool, + handTool = this._handTool, + globalConnect = this._globalConnect, + translate = this._translate + + function createAction (type, group, className, title, options) { + function createListener (event) { + const shape = elementFactory.createShape(assign({ type: type }, options)) + + if (options) { + shape.businessObject.di.isExpanded = options.isExpanded + } + + create.start(event, shape) + } + + const shortType = type.replace(/^bpmn:/, '') + + return { + group: group, + className: className, + title: title || translate("Create {type}", { type: shortType }), + action: { + dragstart: createListener, + click: createListener + } + } + } + + function createSubprocess (event) { + const subProcess = elementFactory.createShape({ + type: 'bpmn:SubProcess', + x: 0, + y: 0, + isExpanded: true + }) + + const startEvent = elementFactory.createShape({ + type: 'bpmn:StartEvent', + x: 40, + y: 82, + parent: subProcess + }) + + create.start(event, [subProcess, startEvent], { + hints: { + autoSelect: [startEvent] + } + }) + } + + function createParticipant (event) { + create.start(event, elementFactory.createParticipantShape()) + } + + assign(actions, { + "hand-tool": { + group: "tools", + className: "bpmn-icon-hand-tool", + title: '激活抓手工具', + // title: translate("Activate the hand tool"), + action: { + click: function (event) { + handTool.activateHand(event) + } + } + }, + "lasso-tool": { + group: "tools", + className: "bpmn-icon-lasso-tool", + title: translate("Activate the lasso tool"), + action: { + click: function (event) { + lassoTool.activateSelection(event) + } + } + }, + "space-tool": { + group: "tools", + className: "bpmn-icon-space-tool", + title: translate("Activate the create/remove space tool"), + action: { + click: function (event) { + spaceTool.activateSelection(event) + } + } + }, + "global-connect-tool": { + group: "tools", + className: "bpmn-icon-connection-multi", + title: translate("Activate the global connect tool"), + action: { + click: function (event) { + globalConnect.toggle(event) + } + } + }, + "tool-separator": { + group: "tools", + separator: true + }, + "create.start-event": createAction("bpmn:StartEvent", "event", "bpmn-icon-start-event-none", translate("Create StartEvent")), + "create.intermediate-event": createAction( + "bpmn:IntermediateThrowEvent", + "event", + "bpmn-icon-intermediate-event-none", + translate("Create Intermediate/Boundary Event") + ), + "create.end-event": createAction("bpmn:EndEvent", "event", "bpmn-icon-end-event-none", translate("Create EndEvent")), + "create.exclusive-gateway": createAction("bpmn:ExclusiveGateway", "gateway", "bpmn-icon-gateway-none", translate("Create Gateway")), + "create.user-task": createAction("bpmn:UserTask", "activity", "bpmn-icon-user-task", translate("Create User Task")), + "create.data-object": createAction("bpmn:DataObjectReference", "data-object", "bpmn-icon-data-object", translate("Create DataObjectReference")), + "create.data-store": createAction("bpmn:DataStoreReference", "data-store", "bpmn-icon-data-store", translate("Create DataStoreReference")), + "create.subprocess-expanded": { + group: "activity", + className: "bpmn-icon-subprocess-expanded", + title: translate("Create expanded SubProcess"), + action: { + dragstart: createSubprocess, + click: createSubprocess + } + }, + "create.participant-expanded": { + group: "collaboration", + className: "bpmn-icon-participant", + title: translate("Create Pool/Participant"), + action: { + dragstart: createParticipant, + click: createParticipant + } + }, + "create.group": createAction("bpmn:Group", "artifact", "bpmn-icon-group", translate("Create Group")) + }) + + return actions +} + +CustomPalette.$inject = ["palette", "create", "elementFactory", "spaceTool", "lassoTool", "handTool", "globalConnect", "translate"] + +CustomPalette.prototype = new F() // 核心,将 F的实例赋值给子类; +CustomPalette.prototype.constructor = CustomPalette // 修复子类CustomPalette的构造器指向,防止原型链的混乱; diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/palette/index.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/palette/index.js new file mode 100644 index 000000000..7a6b86e91 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/palette/index.js @@ -0,0 +1,22 @@ +// import PaletteModule from "diagram-js/lib/features/palette"; +// import CreateModule from "diagram-js/lib/features/create"; +// import SpaceToolModule from "diagram-js/lib/features/space-tool"; +// import LassoToolModule from "diagram-js/lib/features/lasso-tool"; +// import HandToolModule from "diagram-js/lib/features/hand-tool"; +// import GlobalConnectModule from "diagram-js/lib/features/global-connect"; +// import translate from "diagram-js/lib/i18n/translate"; +// +// import PaletteProvider from "./paletteProvider"; +// +// export default { +// __depends__: [PaletteModule, CreateModule, SpaceToolModule, LassoToolModule, HandToolModule, GlobalConnectModule, translate], +// __init__: ["paletteProvider"], +// paletteProvider: ["type", PaletteProvider] +// }; + +import CustomPalette from "./CustomPalette"; + +export default { + __init__: ["paletteProvider"], + paletteProvider: ["type", CustomPalette] +}; diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/palette/paletteProvider.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/palette/paletteProvider.js new file mode 100644 index 000000000..3939a92c6 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/palette/paletteProvider.js @@ -0,0 +1,160 @@ +import { assign } from "min-dash" + +/** + * A palette provider for BPMN 2.0 elements. + */ +export default function PaletteProvider (palette, create, elementFactory, spaceTool, lassoTool, handTool, globalConnect, translate) { + this._palette = palette + this._create = create + this._elementFactory = elementFactory + this._spaceTool = spaceTool + this._lassoTool = lassoTool + this._handTool = handTool + this._globalConnect = globalConnect + this._translate = translate + + palette.registerProvider(this) +} + +PaletteProvider.$inject = ["palette", "create", "elementFactory", "spaceTool", "lassoTool", "handTool", "globalConnect", "translate"] + +PaletteProvider.prototype.getPaletteEntries = function () { + const actions = {}, + create = this._create, + elementFactory = this._elementFactory, + spaceTool = this._spaceTool, + lassoTool = this._lassoTool, + handTool = this._handTool, + globalConnect = this._globalConnect, + translate = this._translate + + function createAction (type, group, className, title, options) { + function createListener (event) { + const shape = elementFactory.createShape(assign({ type: type }, options)) + + if (options) { + shape.businessObject.di.isExpanded = options.isExpanded + } + + create.start(event, shape) + } + + const shortType = type.replace(/^bpmn:/, '') + + return { + group: group, + className: className, + title: title || translate("Create {type}", { type: shortType }), + action: { + dragstart: createListener, + click: createListener + } + } + } + + function createSubprocess (event) { + const subProcess = elementFactory.createShape({ + type: 'bpmn:SubProcess', + x: 0, + y: 0, + isExpanded: true + }) + + const startEvent = elementFactory.createShape({ + type: 'bpmn:StartEvent', + x: 40, + y: 82, + parent: subProcess + }) + + create.start(event, [subProcess, startEvent], { + hints: { + autoSelect: [startEvent] + } + }) + } + + function createParticipant (event) { + create.start(event, elementFactory.createParticipantShape()) + } + + assign(actions, { + "hand-tool": { + group: "tools", + className: "bpmn-icon-hand-tool", + title: translate("Activate the hand tool"), + action: { + click: function (event) { + handTool.activateHand(event) + } + } + }, + "lasso-tool": { + group: "tools", + className: "bpmn-icon-lasso-tool", + title: translate("Activate the lasso tool"), + action: { + click: function (event) { + lassoTool.activateSelection(event) + } + } + }, + "space-tool": { + group: "tools", + className: "bpmn-icon-space-tool", + title: translate("Activate the create/remove space tool"), + action: { + click: function (event) { + spaceTool.activateSelection(event) + } + } + }, + "global-connect-tool": { + group: "tools", + className: "bpmn-icon-connection-multi", + title: translate("Activate the global connect tool"), + action: { + click: function (event) { + globalConnect.toggle(event) + } + } + }, + "tool-separator": { + group: "tools", + separator: true + }, + "create.start-event": createAction("bpmn:StartEvent", "event", "bpmn-icon-start-event-none", translate("Create StartEvent")), + "create.intermediate-event": createAction( + "bpmn:IntermediateThrowEvent", + "event", + "bpmn-icon-intermediate-event-none", + translate("Create Intermediate/Boundary Event") + ), + "create.end-event": createAction("bpmn:EndEvent", "event", "bpmn-icon-end-event-none", translate("Create EndEvent")), + "create.exclusive-gateway": createAction("bpmn:ExclusiveGateway", "gateway", "bpmn-icon-gateway-none", translate("Create Gateway")), + "create.user-task": createAction("bpmn:UserTask", "activity", "bpmn-icon-user-task", translate("Create User Task")), + "create.data-object": createAction("bpmn:DataObjectReference", "data-object", "bpmn-icon-data-object", translate("Create DataObjectReference")), + "create.data-store": createAction("bpmn:DataStoreReference", "data-store", "bpmn-icon-data-store", translate("Create DataStoreReference")), + "create.subprocess-expanded": { + group: "activity", + className: "bpmn-icon-subprocess-expanded", + title: translate("Create expanded SubProcess"), + action: { + dragstart: createSubprocess, + click: createSubprocess + } + }, + "create.participant-expanded": { + group: "collaboration", + className: "bpmn-icon-participant", + title: translate("Create Pool/Participant"), + action: { + dragstart: createParticipant, + click: createParticipant + } + }, + "create.group": createAction("bpmn:Group", "artifact", "bpmn-icon-group", translate("Create Group")) + }) + + return actions +} diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/translate/customTranslate.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/translate/customTranslate.js new file mode 100644 index 000000000..508040d66 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/translate/customTranslate.js @@ -0,0 +1,41 @@ +// import translations from "./zh"; +// +// export default function customTranslate(template, replacements) { +// replacements = replacements || {}; +// +// // Translate +// template = translations[template] || template; +// +// // Replace +// return template.replace(/{([^}]+)}/g, function(_, key) { +// let str = replacements[key]; +// if ( +// translations[replacements[key]] !== null && +// translations[replacements[key]] !== "undefined" +// ) { +// // eslint-disable-next-line no-mixed-spaces-and-tabs +// str = translations[replacements[key]]; +// // eslint-disable-next-line no-mixed-spaces-and-tabs +// } +// return str || "{" + key + "}"; +// }); +// } + +export default function customTranslate(translations) { + return function(template, replacements) { + replacements = replacements || {}; + // Translate + template = translations[template] || template; + + // Replace + return template.replace(/{([^}]+)}/g, function(_, key) { + let str = replacements[key]; + if (translations[replacements[key]] !== null && translations[replacements[key]] !== undefined) { + // eslint-disable-next-line no-mixed-spaces-and-tabs + str = translations[replacements[key]]; + // eslint-disable-next-line no-mixed-spaces-and-tabs + } + return str || "{" + key + "}"; + }); + }; +} diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/translate/zh.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/translate/zh.js new file mode 100644 index 000000000..855b561ed --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/designer/plugins/translate/zh.js @@ -0,0 +1,238 @@ +/** + * This is a sample file that should be replaced with the actual translation. + * + * Checkout https://github.com/bpmn-io/bpmn-js-i18n for a list of available + * translations and labels to translate. + */ +export default { + // 添加部分 + "Append EndEvent": "追加结束事件", + "Append Gateway": "追加网关", + "Append Task": "追加任务", + "Append Intermediate/Boundary Event": "追加中间抛出事件/边界事件", + + "Activate the global connect tool": "激活全局连接工具", + "Append {type}": "添加 {type}", + "Add Lane above": "在上面添加道", + "Divide into two Lanes": "分割成两个道", + "Divide into three Lanes": "分割成三个道", + "Add Lane below": "在下面添加道", + "Append compensation activity": "追加补偿活动", + "Change type": "修改类型", + "Connect using Association": "使用关联连接", + "Connect using Sequence/MessageFlow or Association": "使用顺序/消息流或者关联连接", + "Connect using DataInputAssociation": "使用数据输入关联连接", + Remove: "移除", + "Activate the hand tool": "激活抓手工具", + "Activate the lasso tool": "激活套索工具", + "Activate the create/remove space tool": "激活创建/删除空间工具", + "Create expanded SubProcess": "创建扩展子过程", + "Create IntermediateThrowEvent/BoundaryEvent": "创建中间抛出事件/边界事件", + "Create Pool/Participant": "创建池/参与者", + "Parallel Multi Instance": "并行多重事件", + "Sequential Multi Instance": "时序多重事件", + DataObjectReference: "数据对象参考", + DataStoreReference: "数据存储参考", + Loop: "循环", + "Ad-hoc": "即席", + "Create {type}": "创建 {type}", + Task: "任务", + "Send Task": "发送任务", + "Receive Task": "接收任务", + "User Task": "用户任务", + "Manual Task": "手工任务", + "Business Rule Task": "业务规则任务", + "Service Task": "服务任务", + "Script Task": "脚本任务", + "Call Activity": "调用活动", + "Sub Process (collapsed)": "子流程(折叠的)", + "Sub Process (expanded)": "子流程(展开的)", + "Start Event": "开始事件", + StartEvent: "开始事件", + "Intermediate Throw Event": "中间事件", + "End Event": "结束事件", + EndEvent: "结束事件", + "Create StartEvent": "创建开始事件", + "Create EndEvent": "创建结束事件", + "Create Task": "创建任务", + "Create User Task": "创建用户任务", + "Create Gateway": "创建网关", + "Create DataObjectReference": "创建数据对象", + "Create DataStoreReference": "创建数据存储", + "Create Group": "创建分组", + "Create Intermediate/Boundary Event": "创建中间/边界事件", + "Message Start Event": "消息开始事件", + "Timer Start Event": "定时开始事件", + "Conditional Start Event": "条件开始事件", + "Signal Start Event": "信号开始事件", + "Error Start Event": "错误开始事件", + "Escalation Start Event": "升级开始事件", + "Compensation Start Event": "补偿开始事件", + "Message Start Event (non-interrupting)": "消息开始事件(非中断)", + "Timer Start Event (non-interrupting)": "定时开始事件(非中断)", + "Conditional Start Event (non-interrupting)": "条件开始事件(非中断)", + "Signal Start Event (non-interrupting)": "信号开始事件(非中断)", + "Escalation Start Event (non-interrupting)": "升级开始事件(非中断)", + "Message Intermediate Catch Event": "消息中间捕获事件", + "Message Intermediate Throw Event": "消息中间抛出事件", + "Timer Intermediate Catch Event": "定时中间捕获事件", + "Escalation Intermediate Throw Event": "升级中间抛出事件", + "Conditional Intermediate Catch Event": "条件中间捕获事件", + "Link Intermediate Catch Event": "链接中间捕获事件", + "Link Intermediate Throw Event": "链接中间抛出事件", + "Compensation Intermediate Throw Event": "补偿中间抛出事件", + "Signal Intermediate Catch Event": "信号中间捕获事件", + "Signal Intermediate Throw Event": "信号中间抛出事件", + "Message End Event": "消息结束事件", + "Escalation End Event": "定时结束事件", + "Error End Event": "错误结束事件", + "Cancel End Event": "取消结束事件", + "Compensation End Event": "补偿结束事件", + "Signal End Event": "信号结束事件", + "Terminate End Event": "终止结束事件", + "Message Boundary Event": "消息边界事件", + "Message Boundary Event (non-interrupting)": "消息边界事件(非中断)", + "Timer Boundary Event": "定时边界事件", + "Timer Boundary Event (non-interrupting)": "定时边界事件(非中断)", + "Escalation Boundary Event": "升级边界事件", + "Escalation Boundary Event (non-interrupting)": "升级边界事件(非中断)", + "Conditional Boundary Event": "条件边界事件", + "Conditional Boundary Event (non-interrupting)": "条件边界事件(非中断)", + "Error Boundary Event": "错误边界事件", + "Cancel Boundary Event": "取消边界事件", + "Signal Boundary Event": "信号边界事件", + "Signal Boundary Event (non-interrupting)": "信号边界事件(非中断)", + "Compensation Boundary Event": "补偿边界事件", + "Exclusive Gateway": "互斥网关", + "Parallel Gateway": "并行网关", + "Inclusive Gateway": "相容网关", + "Complex Gateway": "复杂网关", + "Event based Gateway": "事件网关", + Transaction: "转运", + "Sub Process": "子流程", + "Event Sub Process": "事件子流程", + "Collapsed Pool": "折叠池", + "Expanded Pool": "展开池", + + // Errors + "no parent for {element} in {parent}": "在{parent}里,{element}没有父类", + "no shape type specified": "没有指定的形状类型", + "flow elements must be children of pools/participants": "流元素必须是池/参与者的子类", + "out of bounds release": "out of bounds release", + "more than {count} child lanes": "子道大于{count} ", + "element required": "元素不能为空", + "diagram not part of bpmn:Definitions": "流程图不符合bpmn规范", + "no diagram to display": "没有可展示的流程图", + "no process or collaboration to display": "没有可展示的流程/协作", + "element {element} referenced by {referenced}#{property} not yet drawn": "由{referenced}#{property}引用的{element}元素仍未绘制", + "already rendered {element}": "{element} 已被渲染", + "failed to import {element}": "导入{element}失败", + //属性面板的参数 + Id: "编号", + Name: "名称", + General: "常规", + Details: "详情", + "Message Name": "消息名称", + Message: "消息", + Initiator: "创建者", + "Asynchronous Continuations": "持续异步", + "Asynchronous Before": "异步前", + "Asynchronous After": "异步后", + "Job Configuration": "工作配置", + Exclusive: "排除", + "Job Priority": "工作优先级", + "Retry Time Cycle": "重试时间周期", + Documentation: "文档", + "Element Documentation": "元素文档", + "History Configuration": "历史配置", + "History Time To Live": "历史的生存时间", + Forms: "表单", + "Form Key": "表单key", + "Form Fields": "表单字段", + "Business Key": "业务key", + "Form Field": "表单字段", + ID: "编号", + Type: "类型", + Label: "名称", + "Default Value": "默认值", + "Default Flow": "默认流转路径", + "Conditional Flow": "条件流转路径", + "Sequence Flow": "普通流转路径", + Validation: "校验", + "Add Constraint": "添加约束", + Config: "配置", + Properties: "属性", + "Add Property": "添加属性", + Value: "值", + Listeners: "监听器", + "Execution Listener": "执行监听", + "Event Type": "事件类型", + "Listener Type": "监听器类型", + "Java Class": "Java类", + Expression: "表达式", + "Must provide a value": "必须提供一个值", + "Delegate Expression": "代理表达式", + Script: "脚本", + "Script Format": "脚本格式", + "Script Type": "脚本类型", + "Inline Script": "内联脚本", + "External Script": "外部脚本", + Resource: "资源", + "Field Injection": "字段注入", + Extensions: "扩展", + "Input/Output": "输入/输出", + "Input Parameters": "输入参数", + "Output Parameters": "输出参数", + Parameters: "参数", + "Output Parameter": "输出参数", + "Timer Definition Type": "定时器定义类型", + "Timer Definition": "定时器定义", + Date: "日期", + Duration: "持续", + Cycle: "循环", + Signal: "信号", + "Signal Name": "信号名称", + Escalation: "升级", + Error: "错误", + "Link Name": "链接名称", + Condition: "条件名称", + "Variable Name": "变量名称", + "Variable Event": "变量事件", + "Specify more than one variable change event as a comma separated list.": "多个变量事件以逗号隔开", + "Wait for Completion": "等待完成", + "Activity Ref": "活动参考", + "Version Tag": "版本标签", + Executable: "可执行文件", + "External Task Configuration": "扩展任务配置", + "Task Priority": "任务优先级", + External: "外部", + Connector: "连接器", + "Must configure Connector": "必须配置连接器", + "Connector Id": "连接器编号", + Implementation: "实现方式", + "Field Injections": "字段注入", + Fields: "字段", + "Result Variable": "结果变量", + Topic: "主题", + "Configure Connector": "配置连接器", + "Input Parameter": "输入参数", + Assignee: "代理人", + "Candidate Users": "候选用户", + "Candidate Groups": "候选组", + "Due Date": "到期时间", + "Follow Up Date": "跟踪日期", + Priority: "优先级", + "The follow up date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)": + "跟踪日期必须符合EL表达式,如: ${someDate} ,或者一个ISO标准日期,如:2015-06-26T09:54:00", + "The due date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)": + "跟踪日期必须符合EL表达式,如: ${someDate} ,或者一个ISO标准日期,如:2015-06-26T09:54:00", + Variables: "变量", + "Candidate Starter Configuration": "候选人起动器配置", + "Candidate Starter Groups": "候选人起动器组", + "This maps to the process definition key.": "这映射到流程定义键。", + "Candidate Starter Users": "候选人起动器的用户", + "Specify more than one user as a comma separated list.": "指定多个用户作为逗号分隔的列表。", + "Tasklist Configuration": "Tasklist配置", + Startable: "启动", + "Specify more than one group as a comma separated list.": "指定多个组作为逗号分隔的列表。" +}; diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/index.ts b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/index.ts new file mode 100644 index 000000000..23c773469 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/index.ts @@ -0,0 +1,37 @@ +import { App } from 'vue' +import MyProcessDesigner from './designer' +import MyProcessPenal from './penal' +import MyProcessViewer from './designer/index2' + +const components = [MyProcessDesigner, MyProcessPenal, MyProcessViewer] + +// const install = function (Vue) { +// components.forEach(component => { +// Vue.component(component.name, component) +// }) +// } + +// if (typeof window !== "undefined" && window.Vue) { +// install(window.Vue) +// } +// components.forEach(component => { +// Vue.component(component.name, component) +// }) +const componentss = { + install: (Vue: App): void => { + components.forEach((component) => { + Vue.component(component.name, component) + }) + } +} +// let version = "0.0.1" +export const MyPD = (app) => { + // export default { + // app.use(version) + // app.use(install) + // app.use(MyProcessDesigner) + // app.use(MyProcessPenal) + // app.use(MyProcessViewer) + // app.use(components) + app.use(componentss) +} diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/palette/ProcessPalette.vue b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/palette/ProcessPalette.vue new file mode 100644 index 000000000..f52728408 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/palette/ProcessPalette.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue new file mode 100644 index 000000000..eef832669 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue @@ -0,0 +1,204 @@ + + diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue new file mode 100644 index 000000000..1ffbd6dcf --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue @@ -0,0 +1,176 @@ + + diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue new file mode 100644 index 000000000..f508ee42b --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue @@ -0,0 +1,188 @@ + + + diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/form/ElementForm.vue b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/form/ElementForm.vue new file mode 100644 index 000000000..c475a17b3 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/form/ElementForm.vue @@ -0,0 +1,458 @@ + + + diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/index.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/index.js new file mode 100644 index 000000000..6cb0c77c9 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/index.js @@ -0,0 +1,7 @@ +import MyPropertiesPanel from "./PropertiesPanel.vue"; + +MyPropertiesPanel.install = function(Vue) { + Vue.component(MyPropertiesPanel.name, MyPropertiesPanel); +}; + +export default MyPropertiesPanel; diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/listeners/ElementListeners.vue b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/listeners/ElementListeners.vue new file mode 100644 index 000000000..bc261fb8f --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/listeners/ElementListeners.vue @@ -0,0 +1,416 @@ + + diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/listeners/UserTaskListeners.vue b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/listeners/UserTaskListeners.vue new file mode 100644 index 000000000..2b559a842 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/listeners/UserTaskListeners.vue @@ -0,0 +1,460 @@ + + diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/listeners/template.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/listeners/template.js new file mode 100644 index 000000000..07c2187bd --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/listeners/template.js @@ -0,0 +1,177 @@ +export const template = isTaskListener => { + return ` +
+ + + + + + + + +
+ 添加监听器 +
+ + + + + + + + + + + + + + + + + + + + + + + + + + ${isTaskListener + ? "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + : "" + } + + +

+ 注入字段: + 添加字段 +

+ + + + + + + + + + +
+ 取 消 + 保 存 +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ ` +} diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/listeners/utilSelf.ts b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/listeners/utilSelf.ts new file mode 100644 index 000000000..5f46abd05 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/listeners/utilSelf.ts @@ -0,0 +1,62 @@ +// 初始化表单数据 +export function initListenerForm(listener) { + let self = { + ...listener + } + if (listener.script) { + self = { + ...listener, + ...listener.script, + scriptType: listener.script.resource ? 'externalScript' : 'inlineScript' + } + } + if (listener.event === 'timeout' && listener.eventDefinitions) { + if (listener.eventDefinitions.length) { + let k = '' + for (const key in listener.eventDefinitions[0]) { + console.log(listener.eventDefinitions, key) + if (key.indexOf('time') !== -1) { + k = key + self.eventDefinitionType = key.replace('time', '').toLowerCase() + } + } + console.log(k) + self.eventTimeDefinitions = listener.eventDefinitions[0][k].body + } + } + return self +} + +export function initListenerType(listener) { + let listenerType + if (listener.class) listenerType = 'classListener' + if (listener.expression) listenerType = 'expressionListener' + if (listener.delegateExpression) listenerType = 'delegateExpressionListener' + if (listener.script) listenerType = 'scriptListener' + return { + ...JSON.parse(JSON.stringify(listener)), + ...(listener.script ?? {}), + listenerType: listenerType + } +} + +export const listenerType = { + classListener: 'Java 类', + expressionListener: '表达式', + delegateExpressionListener: '代理表达式', + scriptListener: '脚本' +} + +export const eventType = { + create: '创建', + assignment: '指派', + complete: '完成', + delete: '删除', + update: '更新', + timeout: '超时' +} + +export const fieldType = { + string: '字符串', + expression: '表达式' +} diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/multi-instance/ElementMultiInstance.vue b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/multi-instance/ElementMultiInstance.vue new file mode 100644 index 000000000..d187684d1 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/multi-instance/ElementMultiInstance.vue @@ -0,0 +1,255 @@ + + + diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/other/ElementOtherConfig.vue b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/other/ElementOtherConfig.vue new file mode 100644 index 000000000..2ba1ee710 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/other/ElementOtherConfig.vue @@ -0,0 +1,55 @@ + + + diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/properties/ElementProperties.vue b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/properties/ElementProperties.vue new file mode 100644 index 000000000..bb5656101 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/properties/ElementProperties.vue @@ -0,0 +1,177 @@ + + + diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/signal-message/SignalAndMessage.vue b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/signal-message/SignalAndMessage.vue new file mode 100644 index 000000000..8f3b9fb7c --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/signal-message/SignalAndMessage.vue @@ -0,0 +1,120 @@ + + diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/task/ElementTask.vue b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/task/ElementTask.vue new file mode 100644 index 000000000..946daaeab --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/task/ElementTask.vue @@ -0,0 +1,85 @@ + + + diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/task/task-components/ReceiveTask.vue b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/task/task-components/ReceiveTask.vue new file mode 100644 index 000000000..52c0a59e4 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/task/task-components/ReceiveTask.vue @@ -0,0 +1,122 @@ + + + diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/task/task-components/ScriptTask.vue b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/task/task-components/ScriptTask.vue new file mode 100644 index 000000000..f8583ff0c --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/task/task-components/ScriptTask.vue @@ -0,0 +1,98 @@ + + + diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/task/task-components/UserTask.vue b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/task/task-components/UserTask.vue new file mode 100644 index 000000000..7d279c952 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/penal/task/task-components/UserTask.vue @@ -0,0 +1,97 @@ + + + diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/theme/element-variables.scss b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/theme/element-variables.scss new file mode 100644 index 000000000..b61f30fde --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/theme/element-variables.scss @@ -0,0 +1,70 @@ +/* 改变主题色变量 */ +$--color-primary: #1890ff; +$--color-danger: #ff4d4f; + +/* 改变 icon 字体路径变量,必需 */ +$--font-path: '~element-ui/lib/theme-chalk/fonts'; + +@import "~element-ui/packages/theme-chalk/src/index"; + +.el-table td, +.el-table th { + color: #333; +} +.el-drawer__header { + padding: 16px 16px 8px 16px; + margin: 0; + line-height: 24px; + font-size: 18px; + color: #303133; + box-sizing: border-box; + border-bottom: 1px solid #e8e8e8; +} +div[class^="el-drawer"]:focus, +span:focus { + outline: none; +} +.el-drawer__body { + box-sizing: border-box; + padding: 16px; + width: 100%; + overflow-y: auto; +} + +.el-dialog { + margin-top: 50vh !important; + transform: translateY(-50%); + overflow: hidden; +} +.el-dialog__wrapper { + overflow: hidden; + max-height: 100vh; +} +.el-dialog__header { + padding: 16px 16px 8px 16px; + box-sizing: border-box; + border-bottom: 1px solid #e8e8e8; +} +.el-dialog__body { + padding: 16px; + max-height: 80vh; + box-sizing: border-box; + overflow-y: auto; +} +.el-dialog__footer { + padding: 16px; + box-sizing: border-box; + border-top: 1px solid #e8e8e8; +} +.el-dialog__close { + font-weight: 600; +} +.el-select { + width: 100%; +} +.el-divider:not(.el-divider--horizontal) { + margin: 0 8px ; +} +.el-divider.el-divider--horizontal { + margin: 16px 0; +} diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/theme/index.scss b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/theme/index.scss new file mode 100644 index 000000000..21a388a90 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/theme/index.scss @@ -0,0 +1,2 @@ +@import "./process-designer.scss"; +@import "./process-panel.scss"; \ No newline at end of file diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/theme/process-designer.scss b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/theme/process-designer.scss new file mode 100644 index 000000000..6af945dac --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/theme/process-designer.scss @@ -0,0 +1,161 @@ +@import 'bpmn-js-token-simulation/assets/css/bpmn-js-token-simulation.css'; +@import 'bpmn-js-token-simulation/assets/css/font-awesome.min.css'; +@import 'bpmn-js-token-simulation/assets/css/normalize.css'; + +// 边框被 token-simulation 样式覆盖了 +.djs-palette { + background: var(--palette-background-color); + border: solid 1px var(--palette-border-color) !important; + border-radius: 2px; +} + +.my-process-designer { + display: flex; + flex-direction: column; + width: 100%; + height: 100%; + box-sizing: border-box; + .my-process-designer__header { + width: 100%; + min-height: 36px; + .el-button { + text-align: center; + } + .el-button-group { + margin: 4px; + } + .el-tooltip__popper { + .el-button { + width: 100%; + text-align: left; + padding-left: 8px; + padding-right: 8px; + } + .el-button:hover { + background: rgba(64, 158, 255, 0.8); + color: #ffffff; + } + } + .align { + position: relative; + i { + &:after { + content: '|'; + position: absolute; + // transform: rotate(90deg) translate(200%, 60%); + transform: rotate(180deg) translate(271%, -10%); + } + } + } + .align.align-left i { + transform: rotate(90deg); + } + .align.align-right i { + transform: rotate(-90deg); + } + .align.align-top i { + transform: rotate(180deg); + } + .align.align-bottom i { + transform: rotate(0deg); + } + .align.align-center i { + transform: rotate(0deg); + &:after { + // transform: rotate(90deg) translate(0, 60%); + transform: rotate(0deg) translate(-0%, -5%); + } + } + .align.align-middle i { + transform: rotate(-90deg); + &:after { + // transform: rotate(90deg) translate(0, 60%); + transform: rotate(0deg) translate(0, -10%); + } + } + } + .my-process-designer__container { + display: inline-flex; + width: 100%; + flex: 1; + .my-process-designer__canvas { + flex: 1; + height: 100%; + position: relative; + background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImEiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTTAgMTBoNDBNMTAgMHY0ME0wIDIwaDQwTTIwIDB2NDBNMCAzMGg0ME0zMCAwdjQwIiBmaWxsPSJub25lIiBzdHJva2U9IiNlMGUwZTAiIG9wYWNpdHk9Ii4yIi8+PHBhdGggZD0iTTQwIDBIMHY0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZTBlMGUwIi8+PC9wYXR0ZXJuPjwvZGVmcz48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI2EpIi8+PC9zdmc+') + repeat !important; + div.toggle-mode { + display: none; + } + } + .my-process-designer__property-panel { + height: 100%; + overflow: scroll; + overflow-y: auto; + z-index: 10; + * { + box-sizing: border-box; + } + } + svg { + width: 100%; + height: 100%; + min-height: 100%; + overflow: hidden; + } + } +} + +//侧边栏配置 +// .djs-palette .two-column .open { +.open { + // .djs-palette.open { + .djs-palette-entries { + div[class^='bpmn-icon-']:before, + div[class*='bpmn-icon-']:before { + line-height: unset; + } + div.entry { + position: relative; + } + div.entry:hover { + &::after { + width: max-content; + content: attr(title); + vertical-align: text-bottom; + position: absolute; + right: -10px; + top: 0; + bottom: 0; + overflow: hidden; + transform: translateX(100%); + font-size: 0.5em; + display: inline-block; + text-decoration: inherit; + font-variant: normal; + text-transform: none; + background: #fafafa; + box-shadow: 0 0 6px #eeeeee; + border: 1px solid #cccccc; + box-sizing: border-box; + padding: 0 16px; + border-radius: 4px; + z-index: 100; + } + } + } +} +pre { + margin: 0; + height: 100%; + overflow: hidden; + max-height: calc(80vh - 32px); + overflow-y: auto; +} +.hljs { + word-break: break-word; + white-space: pre-wrap; +} +.hljs * { + font-family: Consolas, Monaco, monospace; +} diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/theme/process-panel.scss b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/theme/process-panel.scss new file mode 100644 index 000000000..f840cdde6 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/theme/process-panel.scss @@ -0,0 +1,107 @@ +.process-panel__container { + box-sizing: border-box; + padding: 0 8px; + border-left: 1px solid #eeeeee; + box-shadow: 0 0 8px #cccccc; + max-height: 100%; + overflow-y: scroll; +} +.panel-tab__title { + font-weight: 600; + padding: 0 8px; + font-size: 1.1em; + line-height: 1.2em; + i { + margin-right: 8px; + font-size: 1.2em; + } +} +.panel-tab__content { + width: 100%; + box-sizing: border-box; + border-top: 1px solid #eeeeee; + padding: 8px 16px; + .panel-tab__content--title { + display: flex; + justify-content: space-between; + padding-bottom: 8px; + span { + flex: 1; + text-align: left; + } + } +} +.element-property { + width: 100%; + display: flex; + align-items: flex-start; + margin: 8px 0; + .element-property__label { + display: block; + width: 90px; + text-align: right; + overflow: hidden; + padding-right: 12px; + line-height: 32px; + font-size: 14px; + box-sizing: border-box; + } + .element-property__value { + flex: 1; + line-height: 32px; + } + .el-form-item { + width: 100%; + margin-bottom: 0; + padding-bottom: 18px; + } +} +.list-property { + flex-direction: column; + .element-listener-item { + width: 100%; + display: inline-grid; + grid-template-columns: 16px auto 32px 32px; + grid-column-gap: 8px; + } + .element-listener-item + .element-listener-item { + margin-top: 8px; + } +} +.listener-filed__title { + display: inline-flex; + width: 100%; + justify-content: space-between; + align-items: center; + margin-top: 0; + span { + width: 200px; + text-align: left; + font-size: 14px; + } + i { + margin-right: 8px; + } +} +.element-drawer__button { + margin-top: 8px; + width: 100%; + display: inline-flex; + justify-content: space-around; +} +.element-drawer__button > .el-button { + width: 100%; +} + +.el-collapse-item__content { + padding-bottom: 0; +} +.el-input.is-disabled .el-input__inner { + color: #999999; +} +.el-form-item.el-form-item--mini { + margin-bottom: 0; + & + .el-form-item { + margin-top: 16px; + } +} diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/utils.ts b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/utils.ts new file mode 100644 index 000000000..41f068011 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/package/utils.ts @@ -0,0 +1,76 @@ +import { toRaw } from 'vue' +// 创建监听器实例 +export function createListenerObject(options, isTask, prefix) { + const listenerObj = Object.create(null) + listenerObj.event = options.event + isTask && (listenerObj.id = options.id) // 任务监听器特有的 id 字段 + switch (options.listenerType) { + case 'scriptListener': + listenerObj.script = createScriptObject(options, prefix) + break + case 'expressionListener': + listenerObj.expression = options.expression + break + case 'delegateExpressionListener': + listenerObj.delegateExpression = options.delegateExpression + break + default: + listenerObj.class = options.class + } + // 注入字段 + if (options.fields) { + listenerObj.fields = options.fields.map((field) => { + return createFieldObject(field, prefix) + }) + } + // 任务监听器的 定时器 设置 + if (isTask && options.event === 'timeout' && !!options.eventDefinitionType) { + const timeDefinition = window.bpmnInstances.moddle.create('bpmn:FormalExpression', { + body: options.eventTimeDefinitions + }) + const TimerEventDefinition = window.bpmnInstances.moddle.create('bpmn:TimerEventDefinition', { + id: `TimerEventDefinition_${uuid(8)}`, + [`time${options.eventDefinitionType.replace(/^\S/, (s) => s.toUpperCase())}`]: timeDefinition + }) + listenerObj.eventDefinitions = [TimerEventDefinition] + } + return window.bpmnInstances.moddle.create( + `${prefix}:${isTask ? 'TaskListener' : 'ExecutionListener'}`, + listenerObj + ) +} + +// 创建 监听器的注入字段 实例 +export function createFieldObject(option, prefix) { + const { name, fieldType, string, expression } = option + const fieldConfig = fieldType === 'string' ? { name, string } : { name, expression } + return window.bpmnInstances.moddle.create(`${prefix}:Field`, fieldConfig) +} + +// 创建脚本实例 +export function createScriptObject(options, prefix) { + const { scriptType, scriptFormat, value, resource } = options + const scriptConfig = + scriptType === 'inlineScript' ? { scriptFormat, value } : { scriptFormat, resource } + return window.bpmnInstances.moddle.create(`${prefix}:Script`, scriptConfig) +} + +// 更新元素扩展属性 +export function updateElementExtensions(element, extensionList) { + const extensions = window.bpmnInstances.moddle.create('bpmn:ExtensionElements', { + values: extensionList + }) + window.bpmnInstances.modeling.updateProperties(toRaw(element), { + extensionElements: extensions + }) +} + +// 创建一个id +export function uuid(length = 8, chars) { + let result = '' + const charsString = chars || '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' + for (let i = length; i > 0; --i) { + result += charsString[Math.floor(Math.random() * charsString.length)] + } + return result +} diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/highlight/index.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/highlight/index.js new file mode 100644 index 000000000..bff9211b5 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/highlight/index.js @@ -0,0 +1,5 @@ +const hljs = require("highlight.js/lib/core"); +hljs.registerLanguage("xml", require("highlight.js/lib/languages/xml")); +hljs.registerLanguage("json", require("highlight.js/lib/languages/json")); + +module.exports = hljs; diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/modules/custom-renderer/CustomRenderer.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/modules/custom-renderer/CustomRenderer.js new file mode 100644 index 000000000..92919f63e --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/modules/custom-renderer/CustomRenderer.js @@ -0,0 +1,14 @@ +import BpmnRenderer from "bpmn-js/lib/draw/BpmnRenderer"; + +export default function CustomRenderer(config, eventBus, styles, pathMap, canvas, textRenderer) { + BpmnRenderer.call(this, config, eventBus, styles, pathMap, canvas, textRenderer, 2000); + + this.handlers["label"] = function() { + return null; + }; +} + +const F = function() {}; // 核心,利用空对象作为中介; +F.prototype = BpmnRenderer.prototype; // 核心,将父类的原型赋值给空对象F; +CustomRenderer.prototype = new F(); // 核心,将 F的实例赋值给子类; +CustomRenderer.prototype.constructor = CustomRenderer; // 修复子类CustomRenderer的构造器指向,防止原型链的混乱; diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/modules/custom-renderer/index.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/modules/custom-renderer/index.js new file mode 100644 index 000000000..5e573f13c --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/modules/custom-renderer/index.js @@ -0,0 +1,6 @@ +import CustomRenderer from "./CustomRenderer"; + +export default { + __init__: ["customRenderer"], + customRenderer: ["type", CustomRenderer] +}; diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/modules/rules/CustomRules.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/modules/rules/CustomRules.js new file mode 100644 index 000000000..d46078b3c --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/modules/rules/CustomRules.js @@ -0,0 +1,16 @@ +import BpmnRules from "bpmn-js/lib/features/rules/BpmnRules"; +import inherits from "inherits"; + +export default function CustomRules(eventBus) { + BpmnRules.call(this, eventBus); +} + +inherits(CustomRules, BpmnRules); + +CustomRules.prototype.canDrop = function() { + return false; +}; + +CustomRules.prototype.canMove = function() { + return false; +}; diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/modules/rules/index.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/modules/rules/index.js new file mode 100644 index 000000000..ac6a7863a --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/modules/rules/index.js @@ -0,0 +1,6 @@ +import CustomRules from "./CustomRules"; + +export default { + __init__: ["customRules"], + customRules: ["type", CustomRules] +}; diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/translations.ts b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/translations.ts new file mode 100644 index 000000000..5f9b9a513 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/translations.ts @@ -0,0 +1,25 @@ +/** + * This is a sample file that should be replaced with the actual translation. + * + * Checkout https://github.com/bpmn-io/bpmn-js-i18n for a list of available + * translations and labels to translate. + */ +export default { + 'Exclusive Gateway': 'Exklusives Gateway', + 'Parallel Gateway': 'Paralleles Gateway', + 'Inclusive Gateway': 'Inklusives Gateway', + 'Complex Gateway': 'Komplexes Gateway', + 'Event based Gateway': 'Ereignis-basiertes Gateway', + 'Message Start Event': '消息启动事件', + 'Timer Start Event': '定时启动事件', + 'Conditional Start Event': '条件启动事件', + 'Signal Start Event': '信号启动事件', + 'Error Start Event': '错误启动事件', + 'Escalation Start Event': '升级启动事件', + 'Compensation Start Event': '补偿启动事件', + 'Message Start Event (non-interrupting)': '消息启动事件 (非中断)', + 'Timer Start Event (non-interrupting)': '定时启动事件 (非中断)', + 'Conditional Start Event (non-interrupting)': '条件启动事件 (非中断)', + 'Signal Start Event (non-interrupting)': '信号启动事件 (非中断)', + 'Escalation Start Event (non-interrupting)': '升级启动事件 (非中断)' +} diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/utils/directive/clickOutSide.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/utils/directive/clickOutSide.js new file mode 100644 index 000000000..fc8644ee5 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/utils/directive/clickOutSide.js @@ -0,0 +1,39 @@ +//outside.js + +const ctx = "@@clickoutsideContext"; + +export default { + bind(el, binding, vnode) { + const ele = el; + const documentHandler = e => { + if (!vnode.context || ele.contains(e.target)) { + return false; + } + // 调用指令回调 + if (binding.expression) { + vnode.context[el[ctx].methodName](e); + } else { + el[ctx].bindingFn(e); + } + }; + // 将方法添加到ele + ele[ctx] = { + documentHandler, + methodName: binding.expression, + bindingFn: binding.value + }; + + setTimeout(() => { + document.addEventListener("touchstart", documentHandler); // 为document绑定事件 + }); + }, + update(el, binding) { + const ele = el; + ele[ctx].methodName = binding.expression; + ele[ctx].bindingFn = binding.value; + }, + unbind(el) { + document.removeEventListener("touchstart", el[ctx].documentHandler); // 解绑 + delete el[ctx]; + } +}; diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/utils/index.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/utils/index.js new file mode 100644 index 000000000..18fe3dddb --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/utils/index.js @@ -0,0 +1,10 @@ +export function debounce(fn, delay = 500) { + let timer; + return function(...args) { + if (timer) { + clearTimeout(timer); + timer = null; + } + timer = setTimeout(fn.bind(this, ...args), delay); + }; +} diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/utils/log.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/utils/log.js new file mode 100644 index 000000000..350e29070 --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/utils/log.js @@ -0,0 +1,63 @@ +class Log { + static type = ["primary", "success", "warn", "error", "info"]; + + static typeColor(type = "default") { + let color = ""; + switch (type) { + case "primary": + color = "#2d8cf0"; + break; + case "success": + color = "#19be6b"; + break; + case "info": + color = "#909399"; + break; + case "warn": + color = "#ff9900"; + break; + case "error": + color = "#f03f14"; + break; + case "default": + color = "#35495E"; + break; + default: + color = type; + break; + } + return color; + } + + static print(text, type = "default", back = false) { + if (typeof text === "object") { + // 如果是對象則調用打印對象方式 + console.dir(text); + return; + } + if (back) { + // 如果是打印帶背景圖的 + console.log(`%c ${text} `, `background:${this.typeColor(type)}; padding: 2px; border-radius: 4px;color: #fff;`); + } else { + console.log(`%c ${text} `, `color: ${this.typeColor(type)};`); + } + } + + static pretty(title, text, type = "primary") { + if (typeof text === "object") { + console.log( + `%c ${title} %c`, + `background:${this.typeColor(type)};border:1px solid ${this.typeColor(type)}; padding: 1px; border-radius: 4px 0 0 4px; color: #fff;` + ); + console.dir(text); + return; + } + console.log( + `%c ${title} %c ${text} %c`, + `background:${this.typeColor(type)};border:1px solid ${this.typeColor(type)}; padding: 1px; border-radius: 4px 0 0 4px; color: #fff;`, + `border:1px solid ${this.typeColor(type)}; padding: 1px; border-radius: 0 4px 4px 0; color: ${this.typeColor(type)};`, + "background:transparent" + ); + } +} +export default Log; diff --git a/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/utils/xml2json.js b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/utils/xml2json.js new file mode 100644 index 000000000..01b38cafd --- /dev/null +++ b/yudao-ui-admin-vue3/src/components/bpmnProcessDesigner/src/utils/xml2json.js @@ -0,0 +1,50 @@ +function xmlStr2XmlObj(xmlStr) { + let xmlObj = {}; + if (document.all) { + const xmlDom = new window.ActiveXObject("Microsoft.XMLDOM"); + xmlDom.loadXML(xmlStr); + xmlObj = xmlDom; + } else { + xmlObj = new DOMParser().parseFromString(xmlStr, "text/xml"); + } + return xmlObj; +} + +function xml2json(xml) { + try { + let obj = {}; + if (xml.children.length > 0) { + for (let i = 0; i < xml.children.length; i++) { + const item = xml.children.item(i); + const nodeName = item.nodeName; + if (typeof obj[nodeName] == "undefined") { + obj[nodeName] = xml2json(item); + } else { + if (typeof obj[nodeName].push == "undefined") { + const old = obj[nodeName]; + obj[nodeName] = []; + obj[nodeName].push(old); + } + obj[nodeName].push(xml2json(item)); + } + } + } else { + obj = xml.textContent; + } + return obj; + } catch (e) { + console.log(e.message); + } +} + +function xmlObj2json(xml) { + const xmlObj = xmlStr2XmlObj(xml); + console.log(xmlObj); + let jsonObj = {}; + if (xmlObj.childNodes.length > 0) { + jsonObj = xml2json(xmlObj); + } + return jsonObj; +} + +export default xmlObj2json; diff --git a/yudao-ui-admin-vue3/src/main.ts b/yudao-ui-admin-vue3/src/main.ts index f5e3c024e..6e32beff3 100644 --- a/yudao-ui-admin-vue3/src/main.ts +++ b/yudao-ui-admin-vue3/src/main.ts @@ -13,12 +13,15 @@ import { setupStore } from '@/store' // 全局组件 import { setupGlobCom } from '@/components' -// 引入element-plus +// 引入 element-plus import { setupElementPlus } from '@/plugins/elementPlus' -// 引入vxe-table +// 引入 vxe-table import { setupVxeTable } from '@/plugins/vxeTable' +// 引入 form-create +import { setupFormCreate } from '@/plugins/formCreate' + // 引入全局样式 import '@/styles/index.scss' @@ -39,6 +42,17 @@ import './permission' import { isDevMode } from '@/utils/env' +import { MyPD } from '@/components/bpmnProcessDesigner/package/index.js' +import '@/components/bpmnProcessDesigner/package/theme/index.scss' +import 'bpmn-js/dist/assets/diagram-js.css' +import 'bpmn-js/dist/assets/bpmn-font/css/bpmn.css' +import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css' +import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css' + +import hljs from 'highlight.js' //导入代码高亮文件 +import 'highlight.js/styles/github.css' //导入代码高亮样式 新版 + +// 本地开发模式 全局引入 element-plus 样式,加快第一次进入速度 if (isDevMode()) { console.info(isDevMode()) import('element-plus/dist/index.css') @@ -48,8 +62,18 @@ if (isDevMode()) { const setupAll = async () => { const app = createApp(App) + //自定义一个代码高亮指令 + app.directive('highlight', function (el) { + const blocks = el.querySelectorAll('code') + blocks.forEach((block: any) => { + hljs.highlightElement(block) + }) + }) + await setupI18n(app) + MyPD(app) + setupStore(app) setupGlobCom(app) @@ -58,6 +82,8 @@ const setupAll = async () => { setupVxeTable(app) + setupFormCreate(app) + setupRouter(app) setupAuth(app) diff --git a/yudao-ui-admin-vue3/src/plugins/formCreate/index.ts b/yudao-ui-admin-vue3/src/plugins/formCreate/index.ts new file mode 100644 index 000000000..69816d8a7 --- /dev/null +++ b/yudao-ui-admin-vue3/src/plugins/formCreate/index.ts @@ -0,0 +1,43 @@ +import type { App } from 'vue' +// 👇使用 form-create 需额外全局引入 element plus 组件 +import { + ElAside, + ElPopconfirm, + ElHeader, + ElMain, + ElContainer, + ElDivider, + ElTransfer, + ElAlert, + ElTabs, + ElTabPane +} from 'element-plus' + +import formCreate from '@form-create/element-ui' +import install from '@form-create/element-ui/auto-import' +import FcDesigner from '@form-create/designer' + +const components = [ + ElAside, + ElPopconfirm, + ElHeader, + ElMain, + ElContainer, + ElDivider, + ElTransfer, + ElAlert, + ElTabs, + ElTabPane +] + +export const setupFormCreate = (app: App) => { + components.forEach((component) => { + app.component(component.name, component) + }) + + formCreate.use(install) + + app.use(formCreate) + + app.use(FcDesigner) +} diff --git a/yudao-ui-admin-vue3/src/plugins/vxeTable/index.ts b/yudao-ui-admin-vue3/src/plugins/vxeTable/index.ts index 9576e8175..6b61bb5c6 100644 --- a/yudao-ui-admin-vue3/src/plugins/vxeTable/index.ts +++ b/yudao-ui-admin-vue3/src/plugins/vxeTable/index.ts @@ -135,7 +135,15 @@ VXETable.setup({ }) // 自定义全局的格式化处理函数 VXETable.formats.mixin({ - // 格式日期,默认 yyyy-MM-dd HH:mm:ss + // 格式精简日期,默认 yyyy-MM-dd HH:mm:ss + formatDay({ cellValue }, format) { + if (cellValue != null) { + return XEUtils.toDateString(cellValue, format || 'yyyy-MM-dd') + } else { + return '' + } + }, + // 格式完整日期,默认 yyyy-MM-dd HH:mm:ss formatDate({ cellValue }, format) { if (cellValue != null) { return XEUtils.toDateString(cellValue, format || 'yyyy-MM-dd HH:mm:ss') diff --git a/yudao-ui-admin-vue3/src/router/modules/remaining.ts b/yudao-ui-admin-vue3/src/router/modules/remaining.ts index edaace6a4..433759612 100644 --- a/yudao-ui-admin-vue3/src/router/modules/remaining.ts +++ b/yudao-ui-admin-vue3/src/router/modules/remaining.ts @@ -189,6 +189,111 @@ const remainingRouter: AppRouteRecordRaw[] = [ title: '500', noTagsView: true } + }, + { + path: '/bpm', + component: Layout, + name: 'bpm', + meta: { + hidden: true + }, + children: [ + { + path: '/manager/form/edit', + component: () => import('@/views/bpm/form/formEditor.vue'), + name: 'bpmFormEditor', + meta: { + noCache: true, + hidden: true, + canTo: true, + title: '设计流程表单', + activeMenu: 'bpm/manager/form/formEditor' + } + }, + { + path: '/manager/model/edit', + component: () => import('@/views/bpm/model/modelEditor.vue'), + name: 'modelEditor', + meta: { + noCache: true, + hidden: true, + canTo: true, + title: '设计流程', + activeMenu: 'bpm/manager/model/design' + } + }, + { + path: '/manager/definition', + component: () => import('@/views/bpm/definition/index.vue'), + name: 'BpmProcessDefinitionList', + meta: { + noCache: true, + hidden: true, + canTo: true, + title: '流程定义', + activeMenu: 'bpm/definition/index' + } + }, + { + path: '/manager/task-assign-rule', + component: () => import('@/views/bpm/taskAssignRule/index.vue'), + name: 'BpmTaskAssignRuleList', + meta: { + noCache: true, + hidden: true, + canTo: true, + title: '任务分配规则' + } + }, + { + path: '/process-instance/create', + component: () => import('@/views/bpm/processInstance/create.vue'), + name: 'BpmProcessInstanceCreate', + meta: { + noCache: true, + hidden: true, + canTo: true, + title: '发起流程', + activeMenu: 'bpm/processInstance/create' + } + }, + { + path: '/process-instance/detail', + component: () => import('@/views/bpm/processInstance/detail.vue'), + name: 'BpmProcessInstanceDetail', + meta: { + noCache: true, + hidden: true, + canTo: true, + title: '流程详情', + activeMenu: 'bpm/processInstance/detail' + } + }, + { + path: '/bpm/oa/leave/create', + component: () => import('@/views/bpm/oa/leave/create.vue'), + name: 'OALeaveCreate', + meta: { + noCache: true, + hidden: true, + canTo: true, + title: '发起 OA 请假', + activeMenu: 'bpm/oa/leave/create' + } + }, + { + path: '/bpm/oa/leave/detail', + component: () => import('@/views/bpm/oa/leave/detail.vue'), + name: 'OALeaveDetail', + meta: { + noCache: true, + hidden: true, + canTo: true, + title: '查看 OA 请假', + activeMenu: 'bpm/oa/leave/detail' + } + } + ] } ] diff --git a/yudao-ui-admin-vue3/src/types/auto-components.d.ts b/yudao-ui-admin-vue3/src/types/auto-components.d.ts index 46a1ae56c..b8419b5b6 100644 --- a/yudao-ui-admin-vue3/src/types/auto-components.d.ts +++ b/yudao-ui-admin-vue3/src/types/auto-components.d.ts @@ -21,7 +21,6 @@ declare module '@vue/runtime-core' { DictTag: typeof import('./../components/DictTag/src/DictTag.vue')['default'] Echart: typeof import('./../components/Echart/src/Echart.vue')['default'] Editor: typeof import('./../components/Editor/src/Editor.vue')['default'] - ElAvatar: typeof import('element-plus/es')['ElAvatar'] ElBadge: typeof import('element-plus/es')['ElBadge'] ElButton: typeof import('element-plus/es')['ElButton'] ElCard: typeof import('element-plus/es')['ElCard'] @@ -31,16 +30,21 @@ declare module '@vue/runtime-core' { ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] ElDescriptions: typeof import('element-plus/es')['ElDescriptions'] ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem'] - ElDialog: typeof import('element-plus/es')['ElDialog'] ElDivider: typeof import('element-plus/es')['ElDivider'] ElDrawer: typeof import('element-plus/es')['ElDrawer'] ElDropdown: typeof import('element-plus/es')['ElDropdown'] ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu'] + ElementBaseInfo: typeof import('./../components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue')['default'] + ElementForm: typeof import('./../components/bpmnProcessDesigner/package/penal/form/ElementForm.vue')['default'] + ElementListeners: typeof import('./../components/bpmnProcessDesigner/package/penal/listeners/ElementListeners.vue')['default'] + ElementMultiInstance: typeof import('./../components/bpmnProcessDesigner/package/penal/multi-instance/ElementMultiInstance.vue')['default'] + ElementOtherConfig: typeof import('./../components/bpmnProcessDesigner/package/penal/other/ElementOtherConfig.vue')['default'] + ElementProperties: typeof import('./../components/bpmnProcessDesigner/package/penal/properties/ElementProperties.vue')['default'] + ElementTask: typeof import('./../components/bpmnProcessDesigner/package/penal/task/ElementTask.vue')['default'] ElForm: typeof import('element-plus/es')['ElForm'] ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElIcon: typeof import('element-plus/es')['ElIcon'] - ElImage: typeof import('element-plus/es')['ElImage'] ElImageViewer: typeof import('element-plus/es')['ElImageViewer'] ElInput: typeof import('element-plus/es')['ElInput'] ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] @@ -51,23 +55,21 @@ declare module '@vue/runtime-core' { ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRow: typeof import('element-plus/es')['ElRow'] - ElScroll: typeof import('element-plus/es')['ElScroll'] - ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElSelect: typeof import('element-plus/es')['ElSelect'] ElSkeleton: typeof import('element-plus/es')['ElSkeleton'] - ElSpace: typeof import('element-plus/es')['ElSpace'] ElSwitch: typeof import('element-plus/es')['ElSwitch'] - ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTabPane: typeof import('element-plus/es')['ElTabPane'] ElTabs: typeof import('element-plus/es')['ElTabs'] ElTag: typeof import('element-plus/es')['ElTag'] + ElTimeline: typeof import('element-plus/es')['ElTimeline'] + ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] - ElTransfer: typeof import('element-plus/es')['ElTransfer'] ElTree: typeof import('element-plus/es')['ElTree'] ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect'] ElUpload: typeof import('element-plus/es')['ElUpload'] Error: typeof import('./../components/Error/src/Error.vue')['default'] + FlowCondition: typeof import('./../components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue')['default'] Form: typeof import('./../components/Form/src/Form.vue')['default'] Highlight: typeof import('./../components/Highlight/src/Highlight.vue')['default'] Icon: typeof import('./../components/Icon/src/Icon.vue')['default'] @@ -76,16 +78,25 @@ declare module '@vue/runtime-core' { ImageViewer: typeof import('./../components/ImageViewer/src/ImageViewer.vue')['default'] Infotip: typeof import('./../components/Infotip/src/Infotip.vue')['default'] InputPassword: typeof import('./../components/InputPassword/src/InputPassword.vue')['default'] + ProcessDesigner: typeof import('./../components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue')['default'] + ProcessPalette: typeof import('./../components/bpmnProcessDesigner/package/palette/ProcessPalette.vue')['default'] + ProcessViewer: typeof import('./../components/bpmnProcessDesigner/package/designer/ProcessViewer.vue')['default'] + PropertiesPanel: typeof import('./../components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue')['default'] Qrcode: typeof import('./../components/Qrcode/src/Qrcode.vue')['default'] + ReceiveTask: typeof import('./../components/bpmnProcessDesigner/package/penal/task/task-components/ReceiveTask.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] + ScriptTask: typeof import('./../components/bpmnProcessDesigner/package/penal/task/task-components/ScriptTask.vue')['default'] Search: typeof import('./../components/Search/src/Search.vue')['default'] + SignalAndMessage: typeof import('./../components/bpmnProcessDesigner/package/penal/signal-message/SignalAndMessage.vue')['default'] Sticky: typeof import('./../components/Sticky/src/Sticky.vue')['default'] Table: typeof import('./../components/Table/src/Table.vue')['default'] Tooltip: typeof import('./../components/Tooltip/src/Tooltip.vue')['default'] UploadFile: typeof import('./../components/UploadFile/src/UploadFile.vue')['default'] UploadImg: typeof import('./../components/UploadFile/src/UploadImg.vue')['default'] UploadImgs: typeof import('./../components/UploadFile/src/UploadImgs.vue')['default'] + UserTask: typeof import('./../components/bpmnProcessDesigner/package/penal/task/task-components/UserTask.vue')['default'] + UserTaskListeners: typeof import('./../components/bpmnProcessDesigner/package/penal/listeners/UserTaskListeners.vue')['default'] Verify: typeof import('./../components/Verifition/src/Verify.vue')['default'] VerifyPoints: typeof import('./../components/Verifition/src/Verify/VerifyPoints.vue')['default'] VerifySlide: typeof import('./../components/Verifition/src/Verify/VerifySlide.vue')['default'] diff --git a/yudao-ui-admin-vue3/src/utils/formCreate.ts b/yudao-ui-admin-vue3/src/utils/formCreate.ts new file mode 100644 index 000000000..6d7dbc7ff --- /dev/null +++ b/yudao-ui-admin-vue3/src/utils/formCreate.ts @@ -0,0 +1,54 @@ +/** + * 针对 https://github.com/xaboy/form-create-designer 封装的工具类 + */ + +// 编码表单 Conf +export const encodeConf = (designerRef: object) => { + // @ts-ignore + return JSON.stringify(designerRef.value.getOption()) +} + +// 编码表单 Fields +export const encodeFields = (designerRef: object) => { + // @ts-ignore + const rule = designerRef.value.getRule() + const fields: string[] = [] + rule.forEach((item) => { + fields.push(JSON.stringify(item)) + }) + return fields +} + +// 解码表单 Fields +export const decodeFields = (fields: string[]) => { + const rule: object[] = [] + fields.forEach((item) => { + rule.push(JSON.parse(item)) + }) + return rule +} + +// 设置表单的 Conf 和 Fields +export const setConfAndFields = (designerRef: object, conf: string, fields: string) => { + // @ts-ignore + designerRef.value.setOption(JSON.parse(conf)) + // @ts-ignore + designerRef.value.setRule(decodeFields(fields)) +} + +// 设置表单的 Conf 和 Fields +export const setConfAndFields2 = ( + detailPreview: object, + conf: string, + fields: string, + value?: object +) => { + // @ts-ignore + detailPreview.value.option = JSON.parse(conf) + // @ts-ignore + detailPreview.value.rule = decodeFields(fields) + if (value) { + // @ts-ignore + detailPreview.value.value = value + } +} diff --git a/yudao-ui-admin-vue3/src/utils/formatTime.ts b/yudao-ui-admin-vue3/src/utils/formatTime.ts index 3b799139d..9b0e4465c 100644 --- a/yudao-ui-admin-vue3/src/utils/formatTime.ts +++ b/yudao-ui-admin-vue3/src/utils/formatTime.ts @@ -147,3 +147,30 @@ export function formatAxis(param: Date): string { else if (hour < 22) return '晚上好' else return '夜里好' } + +/** + * 将毫秒,转换成时间字符串。例如说,xx 分钟 + * + * @param ms 毫秒 + * @returns {string} 字符串 + */ +export function formatPast2(ms) { + const day = Math.floor(ms / (24 * 60 * 60 * 1000)) + const hour = Math.floor(ms / (60 * 60 * 1000) - day * 24) + const minute = Math.floor(ms / (60 * 1000) - day * 24 * 60 - hour * 60) + const second = Math.floor(ms / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - minute * 60) + if (day > 0) { + return day + '天' + hour + '小时' + minute + '分钟' + } + if (hour > 0) { + return hour + '小时' + minute + '分钟' + } + if (minute > 0) { + return minute + '分钟' + } + if (second > 0) { + return second + '秒' + } else { + return 0 + '秒' + } +} diff --git a/yudao-ui-admin-vue3/src/views/bpm/definition/definition.data.ts b/yudao-ui-admin-vue3/src/views/bpm/definition/definition.data.ts new file mode 100644 index 000000000..4e25b6c3c --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/bpm/definition/definition.data.ts @@ -0,0 +1,76 @@ +import { reactive } from 'vue' +import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' + +import { DICT_TYPE } from '@/utils/dict' + +// CrudSchema +const crudSchemas = reactive({ + primaryKey: 'id', + primaryType: null, + action: true, + columns: [ + { + title: '定义编号', + field: 'id', + table: { + width: 360 + } + }, + { + title: '定义名称', + field: 'name', + table: { + width: 120, + slots: { + default: 'name_default' + } + } + }, + { + title: '流程分类', + field: 'category', + dictType: DICT_TYPE.BPM_MODEL_CATEGORY, + dictClass: 'number' + }, + { + title: '表单信息', + field: 'formId', + table: { + width: 120, + slots: { + default: 'formId_default' + } + } + }, + { + title: '流程版本', + field: 'version', + table: { + width: 80, + slots: { + default: 'version_default' + } + } + }, + { + title: '激活状态', + field: 'suspensionState', + table: { + width: 80, + slots: { + default: 'suspensionState_default' + } + } + }, + { + title: '部署时间', + field: 'deploymentTime', + isForm: false, + formatter: 'formatDate', + table: { + width: 180 + } + } + ] +}) +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/yudao-ui-admin-vue3/src/views/bpm/definition/index.vue b/yudao-ui-admin-vue3/src/views/bpm/definition/index.vue new file mode 100644 index 000000000..3021c0e2a --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/bpm/definition/index.vue @@ -0,0 +1,108 @@ + + diff --git a/yudao-ui-admin-vue3/src/views/bpm/form/form.data.ts b/yudao-ui-admin-vue3/src/views/bpm/form/form.data.ts index 8e2ed896c..b228ac95f 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/form/form.data.ts +++ b/yudao-ui-admin-vue3/src/views/bpm/form/form.data.ts @@ -1,4 +1,5 @@ -import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas' +import { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' + const { t } = useI18n() // 国际化 // 表单校验 @@ -7,52 +8,36 @@ export const rules = reactive({ }) // CrudSchema -const crudSchemas = reactive([ - { - label: t('common.index'), - field: 'id', - type: 'index', - form: { - show: false +const crudSchemas = reactive({ + primaryKey: 'id', + primaryType: 'seq', + primaryTitle: '表单编号', + action: true, + columns: [ + { + title: '表单名', + field: 'name', + isSearch: true }, - detail: { - show: false - } - }, - { - label: '表单名', - field: 'name', - search: { - show: true - } - }, - { - label: t('common.status'), - field: 'status', - dictType: DICT_TYPE.COMMON_STATUS, - dictClass: 'number' - }, - { - label: '备注', - field: 'remark' - }, - { - label: t('common.createTime'), - field: 'createTime', - form: { - show: false - } - }, - { - label: t('table.action'), - field: 'action', - width: '240px', - form: { - show: false + { + title: t('common.status'), + field: 'status', + dictType: DICT_TYPE.COMMON_STATUS, + dictClass: 'number' }, - detail: { - show: false + { + title: '备注', + field: 'remark' + }, + { + title: t('common.createTime'), + field: 'createTime', + formatter: 'formatDate', + isForm: false, + table: { + width: 180 + } } - } -]) -export const { allSchemas } = useCrudSchemas(crudSchemas) + ] +}) +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/yudao-ui-admin-vue3/src/views/bpm/form/formEditor.vue b/yudao-ui-admin-vue3/src/views/bpm/form/formEditor.vue new file mode 100644 index 000000000..52b3709dd --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/bpm/form/formEditor.vue @@ -0,0 +1,115 @@ + + diff --git a/yudao-ui-admin-vue3/src/views/bpm/form/index.vue b/yudao-ui-admin-vue3/src/views/bpm/form/index.vue index eff394704..67c788e62 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/form/index.vue +++ b/yudao-ui-admin-vue3/src/views/bpm/form/index.vue @@ -1,165 +1,96 @@ - - - diff --git a/yudao-ui-admin-vue3/src/views/bpm/group/group.data.ts b/yudao-ui-admin-vue3/src/views/bpm/group/group.data.ts index 1964b1f8b..07f9b6aaf 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/group/group.data.ts +++ b/yudao-ui-admin-vue3/src/views/bpm/group/group.data.ts @@ -1,69 +1,63 @@ -import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas' +import { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' + const { t } = useI18n() // 国际化 // 表单校验 export const rules = reactive({ - name: [required] + name: [required], + description: [required], + memberUserIds: [required], + status: [required] }) // CrudSchema -const crudSchemas = reactive([ - { - label: t('common.index'), - field: 'id', - type: 'index', - form: { - show: false +const crudSchemas = reactive({ + primaryKey: 'id', + primaryType: 'id', + primaryTitle: '编号', + action: true, + columns: [ + { + title: '组名', + field: 'name', + isSearch: true }, - detail: { - show: false - } - }, - { - label: '组名', - field: 'name', - search: { - show: true - } - }, - { - label: '成员', - field: 'memberUserIds' - }, - { - label: '描述', - field: 'description' - }, - { - label: t('common.status'), - field: 'status', - dictType: DICT_TYPE.COMMON_STATUS, - dictClass: 'number' - }, - { - label: '备注', - field: 'remark', - table: { - show: false - } - }, - { - label: t('common.createTime'), - field: 'createTime', - form: { - show: false - } - }, - { - label: t('table.action'), - field: 'action', - width: '240px', - form: { - show: false + { + title: '成员', + field: 'memberUserIds', + table: { + slots: { + default: 'memberUserIds_default' + } + } }, - detail: { - show: false + { + title: '描述', + field: 'description' + }, + { + title: t('common.status'), + field: 'status', + dictType: DICT_TYPE.COMMON_STATUS, + dictClass: 'number', + isSearch: true + }, + { + title: t('common.createTime'), + field: 'createTime', + formatter: 'formatDate', + isForm: false, + isSearch: true, + search: { + show: true, + itemRender: { + name: 'XDataTimePicker' + } + }, + table: { + width: 180 + } } - } -]) -export const { allSchemas } = useCrudSchemas(crudSchemas) + ] +}) +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/yudao-ui-admin-vue3/src/views/bpm/group/index.vue b/yudao-ui-admin-vue3/src/views/bpm/group/index.vue index ee3355f93..7aa2ca4a5 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/group/index.vue +++ b/yudao-ui-admin-vue3/src/views/bpm/group/index.vue @@ -1,23 +1,116 @@ - - - diff --git a/yudao-ui-admin-vue3/src/views/bpm/model/index.vue b/yudao-ui-admin-vue3/src/views/bpm/model/index.vue index d232846b1..5fafb9606 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/model/index.vue +++ b/yudao-ui-admin-vue3/src/views/bpm/model/index.vue @@ -1,214 +1,586 @@ - - - diff --git a/yudao-ui-admin-vue3/src/views/bpm/model/model.data.ts b/yudao-ui-admin-vue3/src/views/bpm/model/model.data.ts index ac813738d..371b14f10 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/model/model.data.ts +++ b/yudao-ui-admin-vue3/src/views/bpm/model/model.data.ts @@ -1,78 +1,105 @@ -import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas' +import { reactive } from 'vue' +import { useI18n } from '@/hooks/web/useI18n' +import { required } from '@/utils/formRules' +import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' + +import { DICT_TYPE } from '@/utils/dict' const { t } = useI18n() // 国际化 // 表单校验 export const rules = reactive({ - name: [required] + key: [required], + name: [required], + category: [required], + formType: [required], + formId: [required], + formCustomCreatePath: [required], + formCustomViewPath: [required] }) // CrudSchema -const crudSchemas = reactive([ - { - label: t('common.index'), - field: 'id', - type: 'index', - form: { - show: false +const crudSchemas = reactive({ + primaryKey: 'key', + primaryType: null, + action: true, + actionWidth: '540px', + columns: [ + { + title: '流程标识', + field: 'key', + isSearch: true, + table: { + width: 120 + } }, - detail: { - show: false - } - }, - { - label: '流程标识', - field: 'key', - search: { - show: true - } - }, - { - label: '流程名称', - field: 'name', - search: { - show: true - } - }, - { - label: '流程分类', - field: 'category', - dictType: DICT_TYPE.BPM_MODEL_CATEGORY, - dictClass: 'number', - search: { - show: true - } - }, - { - label: '表单信息', - field: 'formId' - }, - { - label: '最新部署的流程定义', - field: 'processDefinition', - form: { - show: false + { + title: '流程名称', + field: 'name', + isSearch: true, + table: { + width: 120, + slots: { + default: 'name_default' + } + } }, - detail: { - show: false - } - }, - { - label: t('common.createTime'), - field: 'createTime', - form: { - show: false - } - }, - { - label: t('table.action'), - field: 'action', - width: '240px', - form: { - show: false + { + title: '流程分类', + field: 'category', + dictType: DICT_TYPE.BPM_MODEL_CATEGORY, + dictClass: 'number', + isSearch: true }, - detail: { - show: false + { + title: '表单信息', + field: 'formId', + table: { + width: 180, + slots: { + default: 'formId_default' + } + } + }, + { + title: '最新部署的流程定义', + field: 'processDefinition', + isForm: false, + table: { + children: [ + { + title: '流程版本', + field: 'version', + slots: { + default: 'version_default' + }, + width: 80 + }, + { + title: '激活状态', + field: 'status', + slots: { + default: 'status_default' + }, + width: 80 + }, + { + title: '部署时间', + field: 'processDefinition.deploymentTime', + formatter: 'formatDate', + width: 180 + } + ] + } + }, + { + title: t('common.createTime'), + field: 'createTime', + isForm: false, + formatter: 'formatDate', + table: { + width: 180 + } } - } -]) -export const { allSchemas } = useCrudSchemas(crudSchemas) + ] +}) +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/yudao-ui-admin-vue3/src/views/bpm/model/modelEditor.vue b/yudao-ui-admin-vue3/src/views/bpm/model/modelEditor.vue new file mode 100644 index 000000000..7ad2e0e85 --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/bpm/model/modelEditor.vue @@ -0,0 +1,210 @@ + + + + + diff --git a/yudao-ui-admin-vue3/src/views/bpm/oa/index.vue b/yudao-ui-admin-vue3/src/views/bpm/oa/index.vue deleted file mode 100644 index 2292e1c95..000000000 --- a/yudao-ui-admin-vue3/src/views/bpm/oa/index.vue +++ /dev/null @@ -1,4 +0,0 @@ - - diff --git a/yudao-ui-admin-vue3/src/views/bpm/oa/leave/create.vue b/yudao-ui-admin-vue3/src/views/bpm/oa/leave/create.vue new file mode 100644 index 000000000..60ee85ea1 --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/bpm/oa/leave/create.vue @@ -0,0 +1,58 @@ + + diff --git a/yudao-ui-admin-vue3/src/views/bpm/oa/leave/detail.vue b/yudao-ui-admin-vue3/src/views/bpm/oa/leave/detail.vue new file mode 100644 index 000000000..4699dc0be --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/bpm/oa/leave/detail.vue @@ -0,0 +1,36 @@ + + + diff --git a/yudao-ui-admin-vue3/src/views/bpm/oa/leave/index.vue b/yudao-ui-admin-vue3/src/views/bpm/oa/leave/index.vue new file mode 100644 index 000000000..a08ecbf16 --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/bpm/oa/leave/index.vue @@ -0,0 +1,83 @@ + + + diff --git a/yudao-ui-admin-vue3/src/views/bpm/oa/leave/leave.data.ts b/yudao-ui-admin-vue3/src/views/bpm/oa/leave/leave.data.ts new file mode 100644 index 000000000..288f744ae --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/bpm/oa/leave/leave.data.ts @@ -0,0 +1,90 @@ +import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' + +const { t } = useI18n() // 国际化 + +// 表单校验 +export const rules = reactive({ + startTime: [{ required: true, message: '开始时间不能为空', trigger: 'blur' }], + endTime: [{ required: true, message: '结束时间不能为空', trigger: 'blur' }], + type: [{ required: true, message: '请假类型不能为空', trigger: 'change' }] +}) + +// crudSchemas +const crudSchemas = reactive({ + primaryKey: 'id', + primaryType: 'id', + primaryTitle: '申请编号', + action: true, + actionWidth: '260', + columns: [ + { + title: t('common.status'), + field: 'result', + dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, + dictClass: 'number', + isSearch: true, + isForm: false + }, + { + title: t('common.startTimeText'), + field: 'startTime', + formatter: 'formatDay', + table: { + width: 180 + }, + detail: { + dateFormat: 'YYYY-MM-DD' + }, + form: { + component: 'DatePicker' + } + }, + { + title: t('common.endTimeText'), + field: 'endTime', + formatter: 'formatDay', + table: { + width: 180 + }, + detail: { + dateFormat: 'YYYY-MM-DD' + }, + form: { + component: 'DatePicker' + } + }, + { + title: '请假类型', + field: 'type', + dictType: DICT_TYPE.BPM_OA_LEAVE_TYPE, + dictClass: 'number', + isSearch: true + }, + { + title: '原因', + field: 'reason', + isSearch: true, + componentProps: { + type: 'textarea', + rows: 4 + } + }, + { + title: '申请时间', + field: 'createTime', + formatter: 'formatDate', + table: { + width: 180 + }, + isSearch: true, + search: { + show: true, + itemRender: { + name: 'XDataTimePicker' + } + }, + isForm: false + } + ] +}) +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/yudao-ui-admin-vue3/src/views/bpm/processInstance/create.vue b/yudao-ui-admin-vue3/src/views/bpm/processInstance/create.vue new file mode 100644 index 000000000..c0542b227 --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/bpm/processInstance/create.vue @@ -0,0 +1,149 @@ + + + + diff --git a/yudao-ui-admin-vue3/src/views/bpm/processInstance/detail.vue b/yudao-ui-admin-vue3/src/views/bpm/processInstance/detail.vue new file mode 100644 index 000000000..255e1d0c6 --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/bpm/processInstance/detail.vue @@ -0,0 +1,490 @@ + + + + diff --git a/yudao-ui-admin-vue3/src/views/bpm/processInstance/index.vue b/yudao-ui-admin-vue3/src/views/bpm/processInstance/index.vue index e71498df0..d2f817532 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/processInstance/index.vue +++ b/yudao-ui-admin-vue3/src/views/bpm/processInstance/index.vue @@ -1,113 +1,88 @@ - - - diff --git a/yudao-ui-admin-vue3/src/views/bpm/processInstance/process.create.ts b/yudao-ui-admin-vue3/src/views/bpm/processInstance/process.create.ts new file mode 100644 index 000000000..ff70fe56c --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/bpm/processInstance/process.create.ts @@ -0,0 +1,34 @@ +import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' + +// crudSchemas +const crudSchemas = reactive({ + primaryKey: 'id', + primaryType: null, + action: true, + columns: [ + { + title: '流程名称', + field: 'name' + }, + { + title: '流程分类', + field: 'category', + dictType: DICT_TYPE.BPM_MODEL_CATEGORY, + dictClass: 'number' + }, + { + title: '流程版本', + field: 'version', + table: { + slots: { + default: 'version_default' + } + } + }, + { + title: '流程描述', + field: 'description' + } + ] +}) +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/yudao-ui-admin-vue3/src/views/bpm/processInstance/process.data.ts b/yudao-ui-admin-vue3/src/views/bpm/processInstance/process.data.ts index 7be3f1fe7..c5ce76715 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/processInstance/process.data.ts +++ b/yudao-ui-admin-vue3/src/views/bpm/processInstance/process.data.ts @@ -1,84 +1,91 @@ -import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas' +import { reactive } from 'vue' +import { useI18n } from '@/hooks/web/useI18n' +import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' +import { DICT_TYPE } from '@/utils/dict' const { t } = useI18n() // 国际化 // CrudSchema -const crudSchemas = reactive([ - { - label: t('common.index'), - field: 'id', - type: 'index', - form: { - show: false +const crudSchemas = reactive({ + primaryKey: 'id', + primaryType: null, + primaryTitle: '编号', + action: true, + actionWidth: '200px', + columns: [ + { + title: '编号', + field: 'id', + table: { + width: 320 + } }, - detail: { - show: false - } - }, - { - label: '流程名', - field: 'name', - search: { - show: true - } - }, - { - label: '流程分类', - field: 'category', - dictType: DICT_TYPE.BPM_MODEL_CATEGORY, - dictClass: 'number', - search: { - show: true - } - }, - { - label: '当前审批任务', - field: 'tasks' - }, - { - label: t('common.status'), - field: 'status', - dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS, - dictClass: 'number', - search: { - show: true - } - }, - { - label: '结果', - field: 'result', - dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, - dictClass: 'number', - search: { - show: true - } - }, - { - label: '提交时间', - field: 'createTime', - form: { - show: false + { + title: '流程名', + field: 'name', + isSearch: true }, - search: { - show: true - } - }, - { - label: '结束时间', - field: 'endTime', - form: { - show: false - } - }, - { - label: t('table.action'), - field: 'action', - width: '240px', - form: { - show: false + { + title: '所属流程', + field: 'processDefinitionId', + isSearch: true, + isTable: false }, - detail: { - show: false + { + title: '流程分类', + field: 'category', + dictType: DICT_TYPE.BPM_MODEL_CATEGORY, + dictClass: 'number', + isSearch: true + }, + { + title: '当前审批任务', + field: 'tasks', + table: { + width: 140, + slots: { + default: 'tasks_default' + } + } + }, + { + title: t('common.status'), + field: 'status', + dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS, + dictClass: 'number', + isSearch: true + }, + { + title: '结果', + field: 'result', + dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, + dictClass: 'number', + isSearch: true + }, + { + title: '提交时间', + field: 'createTime', + formatter: 'formatDate', + table: { + width: 180 + }, + isForm: false, + isSearch: true, + search: { + show: true, + itemRender: { + name: 'XDataTimePicker' + } + } + }, + { + title: '结束时间', + field: 'endTime', + formatter: 'formatDate', + table: { + width: 180 + }, + isForm: false } - } -]) -export const { allSchemas } = useCrudSchemas(crudSchemas) + ] +}) +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/yudao-ui-admin-vue3/src/views/bpm/task/done/done.data.ts b/yudao-ui-admin-vue3/src/views/bpm/task/done/done.data.ts index d28391cf1..295165e7f 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/task/done/done.data.ts +++ b/yudao-ui-admin-vue3/src/views/bpm/task/done/done.data.ts @@ -1,92 +1,52 @@ -import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas' +import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' + const { t } = useI18n() // 国际化 -// CrudSchema -const crudSchemas = reactive([ - { - label: t('common.index'), - field: 'id', - type: 'index' - }, - { - label: '任务名称', - field: 'name', - search: { - show: true - } - }, - { - label: '所属流程', - field: 'processInstance.name' - }, - { - label: '流程发起人', - field: 'processInstance.startUserNickname' - }, - { - label: '结果', - field: 'result', - dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, - dictClass: 'number' - }, - { - label: '审批意见', - field: 'reason' - }, - { - label: t('common.createTime'), - field: 'createTime', - search: { - show: true, - component: 'DatePicker', - componentProps: { - type: 'datetimerange', - valueFormat: 'YYYY-MM-DD HH:mm:ss', - defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)], - shortcuts: [ - { - text: '近一周', - value: () => { - const end = new Date() - const start = new Date() - start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) - return [start, end] - } - }, - { - text: '近一个月', - value: () => { - const end = new Date() - const start = new Date() - start.setTime(start.getTime() - 3600 * 1000 * 24 * 30) - return [start, end] - } - }, - { - text: '近三个月', - value: () => { - const end = new Date() - const start = new Date() - start.setTime(start.getTime() - 3600 * 1000 * 24 * 90) - return [start, end] - } - } - ] +// crudSchemas +const crudSchemas = reactive({ + primaryKey: 'id', + primaryType: null, + action: true, + columns: [ + { + title: '任务编号', + field: 'id', + table: { + width: 320 + } + }, + { + title: '任务名称', + field: 'name', + isSearch: true + }, + { + title: '所属流程', + field: 'processInstance.name' + }, + { + title: '流程发起人', + field: 'processInstance.startUserNickname' + }, + { + title: t('common.status'), + field: 'result', + dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, + dictClass: 'number', + isSearch: true + }, + { + title: '原因', + field: 'reason' + }, + { + title: t('common.createTime'), + field: 'createTime', + formatter: 'formatDate', + table: { + width: 180 } } - }, - { - label: '审批时间', - field: 'endTime' - }, - { - label: '耗时', - field: 'durationInMillis' - }, - { - label: t('table.action'), - field: 'action', - width: '100px' - } -]) -export const { allSchemas } = useCrudSchemas(crudSchemas) + ] +}) +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/yudao-ui-admin-vue3/src/views/bpm/task/done/index.vue b/yudao-ui-admin-vue3/src/views/bpm/task/done/index.vue index db4b36832..978aa2e58 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/task/done/index.vue +++ b/yudao-ui-admin-vue3/src/views/bpm/task/done/index.vue @@ -1,65 +1,37 @@ - -