From 790ac8d692016c2b9d259a036f809db3ae3b7790 Mon Sep 17 00:00:00 2001 From: "Ray.Hao" <1490493387@qq.com> Date: Fri, 13 Sep 2024 12:45:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../youlai/boot/common/base/BasePageQuery.java | 10 ++++++++-- .../boot/system/controller/UserController.java | 6 +++--- .../templates/codegen/controller.java.vm | 6 +++--- .../resources/templates/codegen/index.vue.vm | 18 ++++++++---------- .../resources/templates/codegen/query.java.vm | 4 +--- 5 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/youlai/boot/common/base/BasePageQuery.java b/src/main/java/com/youlai/boot/common/base/BasePageQuery.java index ab8deac4..edb32fd3 100644 --- a/src/main/java/com/youlai/boot/common/base/BasePageQuery.java +++ b/src/main/java/com/youlai/boot/common/base/BasePageQuery.java @@ -1,9 +1,11 @@ package com.youlai.boot.common.base; - import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import java.io.Serial; +import java.io.Serializable; + /** * 基础分页请求对象 * @@ -12,7 +14,11 @@ import lombok.Data; */ @Data @Schema -public class BasePageQuery { +public class BasePageQuery implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + @Schema(description = "页码", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") private int pageNum = 1; diff --git a/src/main/java/com/youlai/boot/system/controller/UserController.java b/src/main/java/com/youlai/boot/system/controller/UserController.java index 90586df2..a17dd63d 100644 --- a/src/main/java/com/youlai/boot/system/controller/UserController.java +++ b/src/main/java/com/youlai/boot/system/controller/UserController.java @@ -99,7 +99,7 @@ public class UserController { @Operation(summary = "删除用户") @DeleteMapping("/{ids}") @PreAuthorize("@ss.hasPerm('sys:user:delete')") - public Result deleteUsers( + public Result deleteUsers( @Parameter(description = "用户ID,多个以英文逗号(,)分割") @PathVariable String ids ) { boolean result = userService.deleteUsers(ids); @@ -108,7 +108,7 @@ public class UserController { @Operation(summary = "修改用户状态") @PatchMapping(value = "/{userId}/status") - public Result updateUserStatus( + public Result updateUserStatus( @Parameter(description = "用户ID") @PathVariable Long userId, @Parameter(description = "用户状态(1:启用;0:禁用)") @RequestParam Integer status ) { @@ -144,7 +144,7 @@ public class UserController { @Operation(summary = "导入用户") @PostMapping("/import") - public Result importUsers(MultipartFile file) throws IOException { + public Result importUsers(MultipartFile file) throws IOException { UserImportListener listener = new UserImportListener(); String msg = ExcelUtils.importExcel(file.getInputStream(), UserImportDTO.class, listener); return Result.success(msg); diff --git a/src/main/resources/templates/codegen/controller.java.vm b/src/main/resources/templates/codegen/controller.java.vm index e0272aaa..792db37a 100644 --- a/src/main/resources/templates/codegen/controller.java.vm +++ b/src/main/resources/templates/codegen/controller.java.vm @@ -43,7 +43,7 @@ public class ${entityName}Controller { @Operation(summary = "新增${businessName}") @PostMapping @PreAuthorize("@ss.hasPerm('${moduleName}:${lowerFirstEntityName}:add')") - public Result save${entityName}(@RequestBody @Valid ${entityName}Form formData ) { + public Result save${entityName}(@RequestBody @Valid ${entityName}Form formData ) { boolean result = ${lowerFirstEntityName}Service.save${entityName}(formData); return Result.judge(result); } @@ -61,7 +61,7 @@ public class ${entityName}Controller { @Operation(summary = "修改${businessName}") @PutMapping(value = "/{id}") @PreAuthorize("@ss.hasPerm('${moduleName}:${lowerFirstEntityName}:edit')") - public Result update${entityName}( + public Result update${entityName}( @Parameter(description = "$!{businessName}ID") @PathVariable Long id, @RequestBody @Validated ${entityName}Form formData ) { @@ -72,7 +72,7 @@ public class ${entityName}Controller { @Operation(summary = "删除${businessName}") @DeleteMapping("/{ids}") @PreAuthorize("@ss.hasPerm('${moduleName}:${lowerFirstEntityName}:delete')") - public Result delete${entityName}s( + public Result delete${entityName}s( @Parameter(description = "$!{businessName}ID,多个以英文逗号(,)分割") @PathVariable String ids ) { boolean result = ${lowerFirstEntityName}Service.delete${entityName}s(ids); diff --git a/src/main/resources/templates/codegen/index.vue.vm b/src/main/resources/templates/codegen/index.vue.vm index 247a8ba2..14153069 100644 --- a/src/main/resources/templates/codegen/index.vue.vm +++ b/src/main/resources/templates/codegen/index.vue.vm @@ -174,10 +174,8 @@ #if($fieldConfig.formType == "INPUT") #elseif($fieldConfig.formType == "SELECT") #if($fieldConfig.dictType != "") @@ -189,34 +187,34 @@ #end #elseif($fieldConfig.formType == "RADIO") - + 选项一 选项二 #elseif($fieldConfig.formType == "CHECK_BOX") - + 选项一 选项二 #elseif($fieldConfig.formType == "INPUT_NUMBER") #elseif($fieldConfig.formType == "SWITCH") #elseif($fieldConfig.formType == "TEXT_AREA") #elseif($fieldConfig.formType == "DATE_TIME")