From a3d8e8726aaf2c3d88f0c4fd8e1cafc1babacaff Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 16 Jan 2022 00:08:43 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91codegen=20?= =?UTF-8?q?=E7=94=9F=E6=88=90=E4=BB=A3=E7=A0=81=E6=97=B6=EF=BC=8Cdelete=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=A1=A5=E5=85=85=20dataTypeClass=20?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=EF=BC=8C=E9=81=BF=E5=85=8D=20Swagger=20?= =?UTF-8?q?=E6=89=93=E5=8D=B0=20WARN=20=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bpm/controller/definition/BpmFormController.java | 2 +- .../bpm/controller/definition/BpmUserGroupController.java | 2 +- .../modules/bpm/controller/oa/OALeaveController.java | 2 +- .../modules/infra/controller/file/InfFileController.java | 2 +- .../controller/errorcode/SysErrorCodeController.java | 2 +- .../system/controller/sms/SysSmsChannelController.java | 2 +- .../system/controller/sms/SysSmsTemplateController.java | 2 +- .../system/controller/tenant/SysTenantController.java | 2 +- yudao-admin-server/src/main/resources/application.yaml | 8 ++++---- .../main/resources/codegen/java/controller/controller.vm | 2 +- 更新日志.md | 1 + 11 files changed, 14 insertions(+), 13 deletions(-) diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/definition/BpmFormController.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/definition/BpmFormController.java index 3025f13db..cb22db342 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/definition/BpmFormController.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/definition/BpmFormController.java @@ -45,7 +45,7 @@ public class BpmFormController { @DeleteMapping("/delete") @ApiOperation("删除动态表单") - @ApiImplicitParam(name = "id", value = "编号", required = true) + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) @PreAuthorize("@ss.hasPermission('bpm:form:delete')") public CommonResult deleteForm(@RequestParam("id") Long id) { formService.deleteForm(id); diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/definition/BpmUserGroupController.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/definition/BpmUserGroupController.java index fc97a0112..00a31e8b8 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/definition/BpmUserGroupController.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/definition/BpmUserGroupController.java @@ -53,7 +53,7 @@ public class BpmUserGroupController { @DeleteMapping("/delete") @ApiOperation("删除用户组") - @ApiImplicitParam(name = "id", value = "编号", required = true) + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) @PreAuthorize("@ss.hasPermission('bpm:user-group:delete')") public CommonResult deleteUserGroup(@RequestParam("id") Long id) { userGroupService.deleteUserGroup(id); diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/OALeaveController.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/OALeaveController.java index 0c8861a28..6a3ef12fa 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/OALeaveController.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/OALeaveController.java @@ -61,7 +61,7 @@ public class OALeaveController { @DeleteMapping("/delete") @ApiOperation("删除请假申请") - @ApiImplicitParam(name = "id", value = "编号", required = true) + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) @PreAuthorize("@ss.hasPermission('oa:leave:delete')") public CommonResult deleteLeave(@RequestParam("id") Long id) { leaveService.deleteLeave(id); diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/infra/controller/file/InfFileController.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/infra/controller/file/InfFileController.java index 29337e462..f0c85ddce 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/infra/controller/file/InfFileController.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/infra/controller/file/InfFileController.java @@ -54,7 +54,7 @@ public class InfFileController { @DeleteMapping("/delete") @ApiOperation("删除文件") - @ApiImplicitParam(name = "id", value = "编号", required = true) + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = String.class) @PreAuthorize("@ss.hasPermission('infra:file:delete')") public CommonResult deleteFile(@RequestParam("id") String id) { fileCoreService.deleteFile(id); diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/errorcode/SysErrorCodeController.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/errorcode/SysErrorCodeController.java index 04c88ebf3..f7dd4a411 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/errorcode/SysErrorCodeController.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/errorcode/SysErrorCodeController.java @@ -50,7 +50,7 @@ public class SysErrorCodeController { @DeleteMapping("/delete") @ApiOperation("删除错误码") - @ApiImplicitParam(name = "id", value = "编号", required = true) + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) @PreAuthorize("@ss.hasPermission('system:error-code:delete')") public CommonResult deleteErrorCode(@RequestParam("id") Long id) { errorCodeService.deleteErrorCode(id); diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/sms/SysSmsChannelController.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/sms/SysSmsChannelController.java index b7a98a1c2..3fbb47e6e 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/sms/SysSmsChannelController.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/sms/SysSmsChannelController.java @@ -44,7 +44,7 @@ public class SysSmsChannelController { @DeleteMapping("/delete") @ApiOperation("删除短信渠道") - @ApiImplicitParam(name = "id", value = "编号", required = true) + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) @PreAuthorize("@ss.hasPermission('system:sms-channel:delete')") public CommonResult deleteSmsChannel(@RequestParam("id") Long id) { smsChannelService.deleteSmsChannel(id); diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/sms/SysSmsTemplateController.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/sms/SysSmsTemplateController.java index 4743cfdb8..5b9d8bc6e 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/sms/SysSmsTemplateController.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/sms/SysSmsTemplateController.java @@ -51,7 +51,7 @@ public class SysSmsTemplateController { @DeleteMapping("/delete") @ApiOperation("删除短信模板") - @ApiImplicitParam(name = "id", value = "编号", required = true) + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) @PreAuthorize("@ss.hasPermission('system:sms-template:delete')") public CommonResult deleteSmsTemplate(@RequestParam("id") Long id) { smsTemplateService.deleteSmsTemplate(id); diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/tenant/SysTenantController.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/tenant/SysTenantController.java index 85c51b134..54db21e9b 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/tenant/SysTenantController.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/tenant/SysTenantController.java @@ -57,7 +57,7 @@ public class SysTenantController { @DeleteMapping("/delete") @ApiOperation("删除租户") - @ApiImplicitParam(name = "id", value = "编号", required = true) + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) @PreAuthorize("@ss.hasPermission('system:tenant:delete')") public CommonResult deleteTenant(@RequestParam("id") Long id) { tenantService.deleteTenant(id); diff --git a/yudao-admin-server/src/main/resources/application.yaml b/yudao-admin-server/src/main/resources/application.yaml index 159ceb56b..fdb435e87 100644 --- a/yudao-admin-server/src/main/resources/application.yaml +++ b/yudao-admin-server/src/main/resources/application.yaml @@ -22,10 +22,10 @@ spring: # 工作流 Activiti 配置 activiti: - # 1.false: 默认值,activiti启动时,对比数据库表中保存的版本,如果不匹配。将抛出异常 - # 2.true: 启动时会对数据库中所有表进行更新操作,如果表存在,不做处理,反之,自动创建表 - # 3.create_drop: 启动时自动创建表,关闭时自动删除表 - # 4.drop_create: 启动时,删除旧表,再创建新表 + # 1. false: 默认值,activiti启动时,对比数据库表中保存的版本,如果不匹配。将抛出异常 + # 2. true: 启动时会对数据库中所有表进行更新操作,如果表存在,不做处理,反之,自动创建表 + # 3. create_drop: 启动时自动创建表,关闭时自动删除表 + # 4. drop_create: 启动时,删除旧表,再创建新表 database-schema-update: false # 设置为 false,可通过 sql/activiti.sql 初始化 # activiti7 默认不生成历史信息表,需手动设置开启 db-history-used: true diff --git a/yudao-admin-server/src/main/resources/codegen/java/controller/controller.vm b/yudao-admin-server/src/main/resources/codegen/java/controller/controller.vm index a0a033b65..6038d3937 100644 --- a/yudao-admin-server/src/main/resources/codegen/java/controller/controller.vm +++ b/yudao-admin-server/src/main/resources/codegen/java/controller/controller.vm @@ -54,7 +54,7 @@ public class ${table.className}Controller { @DeleteMapping("/delete") @ApiOperation("删除${table.classComment}") - @ApiImplicitParam(name = "id", value = "编号", required = true) + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = ${primaryColumn.javaType}.class) @PreAuthorize("@ss.hasPermission('${permissionPrefix}:delete')") public CommonResult delete${simpleClassName}(@RequestParam("id") ${primaryColumn.javaType} id) { ${classNameVar}Service.delete${simpleClassName}(id); diff --git a/更新日志.md b/更新日志.md index 3eb0e5fdb..8f298834d 100644 --- a/更新日志.md +++ b/更新日志.md @@ -46,6 +46,7 @@ ### 🐞 Bug Fixes * 【修复】biz-data-permission 组件的缓存机制,导致部分 SQL 未进行数据过滤 +* 【修复】codegen 生成代码时,delete 接口补充 dataTypeClass 属性,避免 Swagger 打印 WARN 日志 ### 🔨 Dependency Upgrades