Commit b9ffa1820dcaa20b4e8741b4dc5d02d8f03473e0
1 parent
064fecf4
perf:【INFRA 基础设施】优化一些 todo 提到的问题
Showing
73 changed files
with
177 additions
and
223 deletions
yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/dataobject/BaseDO.java
| ... | ... | @@ -53,4 +53,14 @@ public abstract class BaseDO implements Serializable, TransPojo { |
| 53 | 53 | @TableLogic |
| 54 | 54 | private Boolean deleted; |
| 55 | 55 | |
| 56 | + /** | |
| 57 | + * 把 creator、createTime、updateTime、updater 都清空,避免前端直接传递 creator 之类的字段,直接就被更新了。 | |
| 58 | + */ | |
| 59 | + public void clean(){ | |
| 60 | + this.creator = null; | |
| 61 | + this.createTime = null; | |
| 62 | + this.updater = null; | |
| 63 | + this.updateTime = null; | |
| 64 | + } | |
| 65 | + | |
| 56 | 66 | } | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenCreateListReqVO.java
| 1 | 1 | package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo; |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | +import jakarta.validation.constraints.NotNull; | |
| 4 | 5 | import lombok.Data; |
| 5 | 6 | |
| 6 | -import jakarta.validation.constraints.NotNull; | |
| 7 | 7 | import java.util.List; |
| 8 | 8 | |
| 9 | 9 | @Schema(description = "管理后台 - 基于数据库的表结构,创建代码生成器的表和字段定义 Request VO") | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/CodegenUpdateReqVO.java
| ... | ... | @@ -3,10 +3,10 @@ package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo; |
| 3 | 3 | import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column.CodegenColumnSaveReqVO; |
| 4 | 4 | import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table.CodegenTableSaveReqVO; |
| 5 | 5 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | -import lombok.Data; | |
| 7 | - | |
| 8 | 6 | import jakarta.validation.Valid; |
| 9 | 7 | import jakarta.validation.constraints.NotNull; |
| 8 | +import lombok.Data; | |
| 9 | + | |
| 10 | 10 | import java.util.List; |
| 11 | 11 | |
| 12 | 12 | @Schema(description = "管理后台 - 代码生成表和字段的修改 Request VO") | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/column/CodegenColumnSaveReqVO.java
| 1 | 1 | package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column; |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | -import lombok.Data; | |
| 5 | - | |
| 6 | 4 | import jakarta.validation.constraints.NotNull; |
| 5 | +import lombok.Data; | |
| 7 | 6 | |
| 8 | 7 | @Schema(description = "管理后台 - 代码生成字段定义创建/修改 Request VO") |
| 9 | 8 | @Data | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTablePageReqVO.java
| ... | ... | @@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | 5 | import lombok.Data; |
| 6 | -import lombok.EqualsAndHashCode; | |
| 7 | -import lombok.ToString; | |
| 8 | 6 | import org.springframework.format.annotation.DateTimeFormat; |
| 9 | 7 | |
| 10 | 8 | import java.time.LocalDateTime; |
| ... | ... | @@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 13 | 11 | |
| 14 | 12 | @Schema(description = "管理后台 - 表定义分页 Request VO") |
| 15 | 13 | @Data |
| 16 | -@EqualsAndHashCode(callSuper = true) | |
| 17 | -@ToString(callSuper = true) | |
| 18 | 14 | public class CodegenTablePageReqVO extends PageParam { |
| 19 | 15 | |
| 20 | 16 | @Schema(description = "表名称,模糊匹配", example = "yudao") | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/codegen/vo/table/CodegenTableSaveReqVO.java
| ... | ... | @@ -5,10 +5,9 @@ import cn.iocoder.yudao.module.infra.enums.codegen.CodegenSceneEnum; |
| 5 | 5 | import cn.iocoder.yudao.module.infra.enums.codegen.CodegenTemplateTypeEnum; |
| 6 | 6 | import com.fasterxml.jackson.annotation.JsonIgnore; |
| 7 | 7 | import io.swagger.v3.oas.annotations.media.Schema; |
| 8 | -import lombok.Data; | |
| 9 | - | |
| 10 | 8 | import jakarta.validation.constraints.AssertTrue; |
| 11 | 9 | import jakarta.validation.constraints.NotNull; |
| 10 | +import lombok.Data; | |
| 12 | 11 | |
| 13 | 12 | @Schema(description = "管理后台 - 代码生成表定义创建/修改 Response VO") |
| 14 | 13 | @Data | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/ConfigController.java
| ... | ... | @@ -5,7 +5,9 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 6 | 6 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 7 | 7 | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| 8 | -import cn.iocoder.yudao.module.infra.controller.admin.config.vo.*; | |
| 8 | +import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigPageReqVO; | |
| 9 | +import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigRespVO; | |
| 10 | +import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigSaveReqVO; | |
| 9 | 11 | import cn.iocoder.yudao.module.infra.convert.config.ConfigConvert; |
| 10 | 12 | import cn.iocoder.yudao.module.infra.dal.dataobject.config.ConfigDO; |
| 11 | 13 | import cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants; |
| ... | ... | @@ -13,13 +15,13 @@ import cn.iocoder.yudao.module.infra.service.config.ConfigService; |
| 13 | 15 | import io.swagger.v3.oas.annotations.Operation; |
| 14 | 16 | import io.swagger.v3.oas.annotations.Parameter; |
| 15 | 17 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 18 | +import jakarta.annotation.Resource; | |
| 19 | +import jakarta.servlet.http.HttpServletResponse; | |
| 20 | +import jakarta.validation.Valid; | |
| 16 | 21 | import org.springframework.security.access.prepost.PreAuthorize; |
| 17 | 22 | import org.springframework.validation.annotation.Validated; |
| 18 | 23 | import org.springframework.web.bind.annotation.*; |
| 19 | 24 | |
| 20 | -import jakarta.annotation.Resource; | |
| 21 | -import jakarta.servlet.http.HttpServletResponse; | |
| 22 | -import jakarta.validation.Valid; | |
| 23 | 25 | import java.io.IOException; |
| 24 | 26 | import java.util.List; |
| 25 | 27 | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigPageReqVO.java
| ... | ... | @@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.config.vo; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | 5 | import lombok.Data; |
| 6 | -import lombok.EqualsAndHashCode; | |
| 7 | -import lombok.ToString; | |
| 8 | 6 | import org.springframework.format.annotation.DateTimeFormat; |
| 9 | 7 | |
| 10 | 8 | import java.time.LocalDateTime; |
| ... | ... | @@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 13 | 11 | |
| 14 | 12 | @Schema(description = "管理后台 - 参数配置分页 Request VO") |
| 15 | 13 | @Data |
| 16 | -@EqualsAndHashCode(callSuper = true) | |
| 17 | -@ToString(callSuper = true) | |
| 18 | 14 | public class ConfigPageReqVO extends PageParam { |
| 19 | 15 | |
| 20 | 16 | @Schema(description = "数据源名称,模糊匹配", example = "名称") | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/config/vo/ConfigSaveReqVO.java
| 1 | 1 | package cn.iocoder.yudao.module.infra.controller.admin.config.vo; |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | -import lombok.Data; | |
| 5 | - | |
| 6 | 4 | import jakarta.validation.constraints.NotBlank; |
| 7 | 5 | import jakarta.validation.constraints.NotEmpty; |
| 8 | 6 | import jakarta.validation.constraints.NotNull; |
| 9 | 7 | import jakarta.validation.constraints.Size; |
| 8 | +import lombok.Data; | |
| 10 | 9 | |
| 11 | 10 | @Schema(description = "管理后台 - 参数配置创建/修改 Request VO") |
| 12 | 11 | @Data | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/DataSourceConfigController.java
| ... | ... | @@ -9,12 +9,12 @@ import cn.iocoder.yudao.module.infra.service.db.DataSourceConfigService; |
| 9 | 9 | import io.swagger.v3.oas.annotations.Operation; |
| 10 | 10 | import io.swagger.v3.oas.annotations.Parameter; |
| 11 | 11 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 12 | +import jakarta.annotation.Resource; | |
| 13 | +import jakarta.validation.Valid; | |
| 12 | 14 | import org.springframework.security.access.prepost.PreAuthorize; |
| 13 | 15 | import org.springframework.validation.annotation.Validated; |
| 14 | 16 | import org.springframework.web.bind.annotation.*; |
| 15 | 17 | |
| 16 | -import jakarta.annotation.Resource; | |
| 17 | -import jakarta.validation.Valid; | |
| 18 | 18 | import java.util.List; |
| 19 | 19 | |
| 20 | 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/db/vo/DataSourceConfigSaveReqVO.java
| 1 | 1 | package cn.iocoder.yudao.module.infra.controller.admin.db.vo; |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | -import lombok.*; | |
| 5 | -import jakarta.validation.constraints.*; | |
| 4 | +import jakarta.validation.constraints.NotNull; | |
| 5 | +import lombok.Data; | |
| 6 | 6 | |
| 7 | 7 | @Schema(description = "管理后台 - 数据源配置创建/修改 Request VO") |
| 8 | 8 | @Data | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/Demo01ContactController.java
| ... | ... | @@ -60,12 +60,12 @@ public class Demo01ContactController { |
| 60 | 60 | return success(true); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - @DeleteMapping("/delete-batch") | |
| 63 | + @DeleteMapping("/delete-list") | |
| 64 | 64 | @Parameter(name = "ids", description = "编号", required = true) |
| 65 | 65 | @Operation(summary = "批量删除示例联系人") |
| 66 | 66 | @PreAuthorize("@ss.hasPermission('infra:demo01-contact:delete')") |
| 67 | - public CommonResult<Boolean> deleteDemo01Contact(@RequestParam("ids") List<Long> ids) { | |
| 68 | - demo01ContactService.deleteDemo01ContactByIds(ids); | |
| 67 | + public CommonResult<Boolean> deleteDemo0iContactList(@RequestParam("ids") List<Long> ids) { | |
| 68 | + demo01ContactService.deleteDemo0iContactListByIds(ids); | |
| 69 | 69 | return success(true); |
| 70 | 70 | } |
| 71 | 71 | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo01/vo/Demo01ContactPageReqVO.java
| ... | ... | @@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.demo.demo01.vo; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | 5 | import lombok.Data; |
| 6 | -import lombok.EqualsAndHashCode; | |
| 7 | -import lombok.ToString; | |
| 8 | 6 | import org.springframework.format.annotation.DateTimeFormat; |
| 9 | 7 | |
| 10 | 8 | import java.time.LocalDateTime; |
| ... | ... | @@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 13 | 11 | |
| 14 | 12 | @Schema(description = "管理后台 - 示例联系人分页 Request VO") |
| 15 | 13 | @Data |
| 16 | -@EqualsAndHashCode(callSuper = true) | |
| 17 | -@ToString(callSuper = true) | |
| 18 | 14 | public class Demo01ContactPageReqVO extends PageParam { |
| 19 | 15 | |
| 20 | 16 | @Schema(description = "名字", example = "张三") | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/erp/Demo03StudentErpController.java
| ... | ... | @@ -62,12 +62,12 @@ public class Demo03StudentErpController { |
| 62 | 62 | return success(true); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - @DeleteMapping("/delete-batch") | |
| 65 | + @DeleteMapping("/delete-list") | |
| 66 | 66 | @Parameter(name = "ids", description = "编号", required = true) |
| 67 | 67 | @Operation(summary = "批量删除学生") |
| 68 | 68 | @PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')") |
| 69 | - public CommonResult<Boolean> deleteDemo03Student(@RequestParam("ids") List<Long> ids) { | |
| 70 | - demo03StudentErpService.deleteDemo03StudentByIds(ids); | |
| 69 | + public CommonResult<Boolean> deleteDemo03StudentList(@RequestParam("ids") List<Long> ids) { | |
| 70 | + demo03StudentErpService.deleteDemo03StudentListByIds(ids); | |
| 71 | 71 | return success(true); |
| 72 | 72 | } |
| 73 | 73 | |
| ... | ... | @@ -136,12 +136,12 @@ public class Demo03StudentErpController { |
| 136 | 136 | return success(true); |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - @DeleteMapping("/demo03-course/delete-batch") | |
| 139 | + @DeleteMapping("/demo03-course/delete-list") | |
| 140 | 140 | @Parameter(name = "ids", description = "编号", required = true) |
| 141 | 141 | @Operation(summary = "批量删除学生课程") |
| 142 | 142 | @PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')") |
| 143 | - public CommonResult<Boolean> deleteDemo03Course(@RequestParam("ids") List<Long> ids) { | |
| 144 | - demo03StudentErpService.deleteDemo03CourseByIds(ids); | |
| 143 | + public CommonResult<Boolean> deleteDemo03CourseList(@RequestParam("ids") List<Long> ids) { | |
| 144 | + demo03StudentErpService.deleteDemo03CourseListByIds(ids); | |
| 145 | 145 | return success(true); |
| 146 | 146 | } |
| 147 | 147 | |
| ... | ... | @@ -188,12 +188,12 @@ public class Demo03StudentErpController { |
| 188 | 188 | return success(true); |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | - @DeleteMapping("/demo03-grade/delete-batch") | |
| 191 | + @DeleteMapping("/demo03-grade/delete-list") | |
| 192 | 192 | @Parameter(name = "ids", description = "编号", required = true) |
| 193 | 193 | @Operation(summary = "批量删除学生班级") |
| 194 | 194 | @PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')") |
| 195 | - public CommonResult<Boolean> deleteDemo03Grade(@RequestParam("ids") List<Long> ids) { | |
| 196 | - demo03StudentErpService.deleteDemo03GradeByIds(ids); | |
| 195 | + public CommonResult<Boolean> deleteDemo03GradeList(@RequestParam("ids") List<Long> ids) { | |
| 196 | + demo03StudentErpService.deleteDemo03GradeListByIds(ids); | |
| 197 | 197 | return success(true); |
| 198 | 198 | } |
| 199 | 199 | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/erp/vo/Demo03StudentErpPageReqVO.java
| ... | ... | @@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.erp.vo; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | 5 | import lombok.Data; |
| 6 | -import lombok.EqualsAndHashCode; | |
| 7 | -import lombok.ToString; | |
| 8 | 6 | import org.springframework.format.annotation.DateTimeFormat; |
| 9 | 7 | |
| 10 | 8 | import java.time.LocalDateTime; |
| ... | ... | @@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 13 | 11 | |
| 14 | 12 | @Schema(description = "管理后台 - 学生分页 Request VO") |
| 15 | 13 | @Data |
| 16 | -@EqualsAndHashCode(callSuper = true) | |
| 17 | -@ToString(callSuper = true) | |
| 18 | 14 | public class Demo03StudentErpPageReqVO extends PageParam { |
| 19 | 15 | |
| 20 | 16 | @Schema(description = "名字", example = "芋艿") | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/inner/Demo03StudentInnerController.java
| ... | ... | @@ -62,12 +62,12 @@ public class Demo03StudentInnerController { |
| 62 | 62 | return success(true); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - @DeleteMapping("/delete-batch") | |
| 65 | + @DeleteMapping("/delete-list") | |
| 66 | 66 | @Parameter(name = "ids", description = "编号", required = true) |
| 67 | 67 | @Operation(summary = "批量删除学生") |
| 68 | 68 | @PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')") |
| 69 | - public CommonResult<Boolean> deleteDemo03Student(@RequestParam("ids") List<Long> ids) { | |
| 70 | - demo03StudentInnerService.deleteDemo03StudentByIds(ids); | |
| 69 | + public CommonResult<Boolean> deleteDemo03StudentList(@RequestParam("ids") List<Long> ids) { | |
| 70 | + demo03StudentInnerService.deleteDemo03StudentListByIds(ids); | |
| 71 | 71 | return success(true); |
| 72 | 72 | } |
| 73 | 73 | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/inner/vo/Demo03StudentInnerPageReqVO.java
| ... | ... | @@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.inner.vo; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | 5 | import lombok.Data; |
| 6 | -import lombok.EqualsAndHashCode; | |
| 7 | -import lombok.ToString; | |
| 8 | 6 | import org.springframework.format.annotation.DateTimeFormat; |
| 9 | 7 | |
| 10 | 8 | import java.time.LocalDateTime; |
| ... | ... | @@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 13 | 11 | |
| 14 | 12 | @Schema(description = "管理后台 - 学生分页 Request VO") |
| 15 | 13 | @Data |
| 16 | -@EqualsAndHashCode(callSuper = true) | |
| 17 | -@ToString(callSuper = true) | |
| 18 | 14 | public class Demo03StudentInnerPageReqVO extends PageParam { |
| 19 | 15 | |
| 20 | 16 | @Schema(description = "名字", example = "芋艿") | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/normal/Demo03StudentNormalController.java
| ... | ... | @@ -62,12 +62,12 @@ public class Demo03StudentNormalController { |
| 62 | 62 | return success(true); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - @DeleteMapping("/delete-batch") | |
| 65 | + @DeleteMapping("/delete-list") | |
| 66 | 66 | @Parameter(name = "ids", description = "编号", required = true) |
| 67 | 67 | @Operation(summary = "批量删除学生") |
| 68 | 68 | @PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')") |
| 69 | - public CommonResult<Boolean> deleteDemo03Student(@RequestParam("ids") List<Long> ids) { | |
| 70 | - demo03StudentNormalService.deleteDemo03StudentByIds(ids); | |
| 69 | + public CommonResult<Boolean> deleteDemo03StudentList(@RequestParam("ids") List<Long> ids) { | |
| 70 | + demo03StudentNormalService.deleteDemo03StudentListByIds(ids); | |
| 71 | 71 | return success(true); |
| 72 | 72 | } |
| 73 | 73 | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/demo/demo03/normal/vo/Demo03StudentNormalPageReqVO.java
| ... | ... | @@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.normal.vo; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | 5 | import lombok.Data; |
| 6 | -import lombok.EqualsAndHashCode; | |
| 7 | -import lombok.ToString; | |
| 8 | 6 | import org.springframework.format.annotation.DateTimeFormat; |
| 9 | 7 | |
| 10 | 8 | import java.time.LocalDateTime; |
| ... | ... | @@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 13 | 11 | |
| 14 | 12 | @Schema(description = "管理后台 - 学生分页 Request VO") |
| 15 | 13 | @Data |
| 16 | -@EqualsAndHashCode(callSuper = true) | |
| 17 | -@ToString(callSuper = true) | |
| 18 | 14 | public class Demo03StudentNormalPageReqVO extends PageParam { |
| 19 | 15 | |
| 20 | 16 | @Schema(description = "名字", example = "芋艿") | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileConfigController.java
| ... | ... | @@ -11,13 +11,12 @@ import cn.iocoder.yudao.module.infra.service.file.FileConfigService; |
| 11 | 11 | import io.swagger.v3.oas.annotations.Operation; |
| 12 | 12 | import io.swagger.v3.oas.annotations.Parameter; |
| 13 | 13 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 14 | +import jakarta.annotation.Resource; | |
| 15 | +import jakarta.validation.Valid; | |
| 14 | 16 | import org.springframework.security.access.prepost.PreAuthorize; |
| 15 | 17 | import org.springframework.validation.annotation.Validated; |
| 16 | 18 | import org.springframework.web.bind.annotation.*; |
| 17 | 19 | |
| 18 | -import jakarta.annotation.Resource; | |
| 19 | -import jakarta.validation.Valid; | |
| 20 | - | |
| 21 | 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 22 | 21 | |
| 23 | 22 | @Tag(name = "管理后台 - 文件配置") | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigPageReqVO.java
| ... | ... | @@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | 5 | import lombok.Data; |
| 6 | -import lombok.EqualsAndHashCode; | |
| 7 | -import lombok.ToString; | |
| 8 | 6 | import org.springframework.format.annotation.DateTimeFormat; |
| 9 | 7 | |
| 10 | 8 | import java.time.LocalDateTime; |
| ... | ... | @@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 13 | 11 | |
| 14 | 12 | @Schema(description = "管理后台 - 文件配置分页 Request VO") |
| 15 | 13 | @Data |
| 16 | -@EqualsAndHashCode(callSuper = true) | |
| 17 | -@ToString(callSuper = true) | |
| 18 | 14 | public class FileConfigPageReqVO extends PageParam { |
| 19 | 15 | |
| 20 | 16 | @Schema(description = "配置名", example = "S3 - 阿里云") | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigSaveReqVO.java
| 1 | 1 | package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config; |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | +import jakarta.validation.constraints.NotNull; | |
| 4 | 5 | import lombok.Data; |
| 5 | 6 | |
| 6 | -import jakarta.validation.constraints.NotNull; | |
| 7 | 7 | import java.util.Map; |
| 8 | 8 | |
| 9 | 9 | @Schema(description = "管理后台 - 文件配置创建/修改 Request VO") | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FilePageReqVO.java
| ... | ... | @@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.file.vo.file; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | 5 | import lombok.Data; |
| 6 | -import lombok.EqualsAndHashCode; | |
| 7 | -import lombok.ToString; | |
| 8 | 6 | import org.springframework.format.annotation.DateTimeFormat; |
| 9 | 7 | |
| 10 | 8 | import java.time.LocalDateTime; |
| ... | ... | @@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 13 | 11 | |
| 14 | 12 | @Schema(description = "管理后台 - 文件分页 Request VO") |
| 15 | 13 | @Data |
| 16 | -@EqualsAndHashCode(callSuper = true) | |
| 17 | -@ToString(callSuper = true) | |
| 18 | 14 | public class FilePageReqVO extends PageParam { |
| 19 | 15 | |
| 20 | 16 | @Schema(description = "文件路径,模糊匹配", example = "yudao") | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/file/FileUploadReqVO.java
| 1 | 1 | package cn.iocoder.yudao.module.infra.controller.admin.file.vo.file; |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | +import jakarta.validation.constraints.NotNull; | |
| 4 | 5 | import lombok.Data; |
| 5 | 6 | import org.springframework.web.multipart.MultipartFile; |
| 6 | 7 | |
| 7 | -import jakarta.validation.constraints.NotNull; | |
| 8 | - | |
| 9 | 8 | @Schema(description = "管理后台 - 上传文件 Request VO") |
| 10 | 9 | @Data |
| 11 | 10 | public class FileUploadReqVO { | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/JobController.java
| ... | ... | @@ -71,10 +71,10 @@ public class JobController { |
| 71 | 71 | return success(true); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - @DeleteMapping("/delete") | |
| 74 | + @DeleteMapping("/delete") | |
| 75 | 75 | @Operation(summary = "删除定时任务") |
| 76 | 76 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 77 | - @PreAuthorize("@ss.hasPermission('infra:job:delete')") | |
| 77 | + @PreAuthorize("@ss.hasPermission('infra:job:delete')") | |
| 78 | 78 | public CommonResult<Boolean> deleteJob(@RequestParam("id") Long id) |
| 79 | 79 | throws SchedulerException { |
| 80 | 80 | jobService.deleteJob(id); | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobPageReqVO.java
| ... | ... | @@ -3,13 +3,9 @@ package cn.iocoder.yudao.module.infra.controller.admin.job.vo.job; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | 5 | import lombok.Data; |
| 6 | -import lombok.EqualsAndHashCode; | |
| 7 | -import lombok.ToString; | |
| 8 | 6 | |
| 9 | 7 | @Schema(description = "管理后台 - 定时任务分页 Request VO") |
| 10 | 8 | @Data |
| 11 | -@EqualsAndHashCode(callSuper = true) | |
| 12 | -@ToString(callSuper = true) | |
| 13 | 9 | public class JobPageReqVO extends PageParam { |
| 14 | 10 | |
| 15 | 11 | @Schema(description = "任务名称,模糊匹配", example = "测试任务") | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobRespVO.java
| ... | ... | @@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.infra.enums.DictTypeConstants; |
| 6 | 6 | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| 7 | 7 | import com.alibaba.excel.annotation.ExcelProperty; |
| 8 | 8 | import io.swagger.v3.oas.annotations.media.Schema; |
| 9 | +import jakarta.validation.constraints.NotNull; | |
| 9 | 10 | import lombok.Data; |
| 10 | 11 | |
| 11 | -import jakarta.validation.constraints.NotNull; | |
| 12 | 12 | import java.time.LocalDateTime; |
| 13 | 13 | |
| 14 | 14 | @Schema(description = "管理后台 - 定时任务 Response VO") | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/job/JobSaveReqVO.java
| 1 | 1 | package cn.iocoder.yudao.module.infra.controller.admin.job.vo.job; |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | -import lombok.Data; | |
| 5 | - | |
| 6 | 4 | import jakarta.validation.constraints.NotEmpty; |
| 7 | 5 | import jakarta.validation.constraints.NotNull; |
| 6 | +import lombok.Data; | |
| 8 | 7 | |
| 9 | 8 | @Schema(description = "管理后台 - 定时任务创建/修改 Request VO") |
| 10 | 9 | @Data | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/job/vo/log/JobLogPageReqVO.java
| ... | ... | @@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.job.vo.log; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | 5 | import lombok.Data; |
| 6 | -import lombok.EqualsAndHashCode; | |
| 7 | -import lombok.ToString; | |
| 8 | 6 | import org.springframework.format.annotation.DateTimeFormat; |
| 9 | 7 | |
| 10 | 8 | import java.time.LocalDateTime; |
| ... | ... | @@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 13 | 11 | |
| 14 | 12 | @Schema(description = "管理后台 - 定时任务日志分页 Request VO") |
| 15 | 13 | @Data |
| 16 | -@EqualsAndHashCode(callSuper = true) | |
| 17 | -@ToString(callSuper = true) | |
| 18 | 14 | public class JobLogPageReqVO extends PageParam { |
| 19 | 15 | |
| 20 | 16 | @Schema(description = "任务编号", example = "10") | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiAccessLogController.java
| ... | ... | @@ -12,15 +12,15 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiAccessLogDO; |
| 12 | 12 | import cn.iocoder.yudao.module.infra.service.logger.ApiAccessLogService; |
| 13 | 13 | import io.swagger.v3.oas.annotations.Operation; |
| 14 | 14 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 15 | +import jakarta.annotation.Resource; | |
| 16 | +import jakarta.servlet.http.HttpServletResponse; | |
| 17 | +import jakarta.validation.Valid; | |
| 15 | 18 | import org.springframework.security.access.prepost.PreAuthorize; |
| 16 | 19 | import org.springframework.validation.annotation.Validated; |
| 17 | 20 | import org.springframework.web.bind.annotation.GetMapping; |
| 18 | 21 | import org.springframework.web.bind.annotation.RequestMapping; |
| 19 | 22 | import org.springframework.web.bind.annotation.RestController; |
| 20 | 23 | |
| 21 | -import jakarta.annotation.Resource; | |
| 22 | -import jakarta.servlet.http.HttpServletResponse; | |
| 23 | -import jakarta.validation.Valid; | |
| 24 | 24 | import java.io.IOException; |
| 25 | 25 | import java.util.List; |
| 26 | 26 | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/ApiErrorLogController.java
| ... | ... | @@ -14,13 +14,13 @@ import io.swagger.v3.oas.annotations.Operation; |
| 14 | 14 | import io.swagger.v3.oas.annotations.Parameter; |
| 15 | 15 | import io.swagger.v3.oas.annotations.Parameters; |
| 16 | 16 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 17 | +import jakarta.annotation.Resource; | |
| 18 | +import jakarta.servlet.http.HttpServletResponse; | |
| 19 | +import jakarta.validation.Valid; | |
| 17 | 20 | import org.springframework.security.access.prepost.PreAuthorize; |
| 18 | 21 | import org.springframework.validation.annotation.Validated; |
| 19 | 22 | import org.springframework.web.bind.annotation.*; |
| 20 | 23 | |
| 21 | -import jakarta.annotation.Resource; | |
| 22 | -import jakarta.servlet.http.HttpServletResponse; | |
| 23 | -import jakarta.validation.Valid; | |
| 24 | 24 | import java.io.IOException; |
| 25 | 25 | import java.util.List; |
| 26 | 26 | |
| ... | ... | @@ -63,7 +63,7 @@ public class ApiErrorLogController { |
| 63 | 63 | @PreAuthorize("@ss.hasPermission('infra:api-error-log:export')") |
| 64 | 64 | @ApiAccessLog(operateType = EXPORT) |
| 65 | 65 | public void exportApiErrorLogExcel(@Valid ApiErrorLogPageReqVO exportReqVO, |
| 66 | - HttpServletResponse response) throws IOException { | |
| 66 | + HttpServletResponse response) throws IOException { | |
| 67 | 67 | exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); |
| 68 | 68 | List<ApiErrorLogDO> list = apiErrorLogService.getApiErrorLogPage(exportReqVO).getList(); |
| 69 | 69 | // 导出 Excel | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apiaccesslog/ApiAccessLogPageReqVO.java
| ... | ... | @@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | 5 | import lombok.Data; |
| 6 | -import lombok.EqualsAndHashCode; | |
| 7 | -import lombok.ToString; | |
| 8 | 6 | import org.springframework.format.annotation.DateTimeFormat; |
| 9 | 7 | |
| 10 | 8 | import java.time.LocalDateTime; |
| ... | ... | @@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 13 | 11 | |
| 14 | 12 | @Schema(description = "管理后台 - API 访问日志分页 Request VO") |
| 15 | 13 | @Data |
| 16 | -@EqualsAndHashCode(callSuper = true) | |
| 17 | -@ToString(callSuper = true) | |
| 18 | 14 | public class ApiAccessLogPageReqVO extends PageParam { |
| 19 | 15 | |
| 20 | 16 | @Schema(description = "用户编号", example = "666") | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/logger/vo/apierrorlog/ApiErrorLogPageReqVO.java
| ... | ... | @@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | 5 | import lombok.Data; |
| 6 | -import lombok.EqualsAndHashCode; | |
| 7 | -import lombok.ToString; | |
| 8 | 6 | import org.springframework.format.annotation.DateTimeFormat; |
| 9 | 7 | |
| 10 | 8 | import java.time.LocalDateTime; |
| ... | ... | @@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 13 | 11 | |
| 14 | 12 | @Schema(description = "管理后台 - API 错误日志分页 Request VO") |
| 15 | 13 | @Data |
| 16 | -@EqualsAndHashCode(callSuper = true) | |
| 17 | -@ToString(callSuper = true) | |
| 18 | 14 | public class ApiErrorLogPageReqVO extends PageParam { |
| 19 | 15 | |
| 20 | 16 | @Schema(description = "用户编号", example = "666") | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/RedisController.java
| ... | ... | @@ -5,6 +5,7 @@ import cn.iocoder.yudao.module.infra.controller.admin.redis.vo.RedisMonitorRespV |
| 5 | 5 | import cn.iocoder.yudao.module.infra.convert.redis.RedisConvert; |
| 6 | 6 | import io.swagger.v3.oas.annotations.Operation; |
| 7 | 7 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 8 | +import jakarta.annotation.Resource; | |
| 8 | 9 | import org.springframework.data.redis.connection.RedisServerCommands; |
| 9 | 10 | import org.springframework.data.redis.core.RedisCallback; |
| 10 | 11 | import org.springframework.data.redis.core.StringRedisTemplate; |
| ... | ... | @@ -13,7 +14,6 @@ import org.springframework.web.bind.annotation.GetMapping; |
| 13 | 14 | import org.springframework.web.bind.annotation.RequestMapping; |
| 14 | 15 | import org.springframework.web.bind.annotation.RestController; |
| 15 | 16 | |
| 16 | -import jakarta.annotation.Resource; | |
| 17 | 17 | import java.util.Properties; |
| 18 | 18 | |
| 19 | 19 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/app/file/vo/AppFileUploadReqVO.java
| 1 | 1 | package cn.iocoder.yudao.module.infra.controller.app.file.vo; |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | +import jakarta.validation.constraints.NotNull; | |
| 4 | 5 | import lombok.Data; |
| 5 | 6 | import org.springframework.web.multipart.MultipartFile; |
| 6 | 7 | |
| 7 | -import jakarta.validation.constraints.NotNull; | |
| 8 | - | |
| 9 | 8 | @Schema(description = "用户 App - 上传文件 Request VO") |
| 10 | 9 | @Data |
| 11 | 10 | public class AppFileUploadReqVO { | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileConfigDO.java
| ... | ... | @@ -79,7 +79,8 @@ public class FileConfigDO extends BaseDO { |
| 79 | 79 | |
| 80 | 80 | @Override |
| 81 | 81 | public Object parse(String json) { |
| 82 | - FileClientConfig config = JsonUtils.parseObjectQuietly(json, new TypeReference<>() {}); | |
| 82 | + FileClientConfig config = JsonUtils.parseObjectQuietly(json, new TypeReference<>() { | |
| 83 | + }); | |
| 83 | 84 | if (config != null) { |
| 84 | 85 | return config; |
| 85 | 86 | } | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/job/JobLogMapper.java
| ... | ... | @@ -34,7 +34,7 @@ public interface JobLogMapper extends BaseMapperX<JobLogDO> { |
| 34 | 34 | * 物理删除指定时间之前的日志 |
| 35 | 35 | * |
| 36 | 36 | * @param createTime 最大时间 |
| 37 | - * @param limit 删除条数,防止一次删除太多 | |
| 37 | + * @param limit 删除条数,防止一次删除太多 | |
| 38 | 38 | * @return 删除条数 |
| 39 | 39 | */ |
| 40 | 40 | @Delete("DELETE FROM infra_job_log WHERE create_time < #{createTime} LIMIT #{limit}") | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/logger/ApiAccessLogMapper.java
| ... | ... | @@ -36,7 +36,7 @@ public interface ApiAccessLogMapper extends BaseMapperX<ApiAccessLogDO> { |
| 36 | 36 | * 物理删除指定时间之前的日志 |
| 37 | 37 | * |
| 38 | 38 | * @param createTime 最大时间 |
| 39 | - * @param limit 删除条数,防止一次删除太多 | |
| 39 | + * @param limit 删除条数,防止一次删除太多 | |
| 40 | 40 | * @return 删除条数 |
| 41 | 41 | */ |
| 42 | 42 | @Delete("DELETE FROM infra_api_access_log WHERE create_time < #{createTime} LIMIT #{limit}") | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/logger/ApiErrorLogMapper.java
| ... | ... | @@ -35,10 +35,10 @@ public interface ApiErrorLogMapper extends BaseMapperX<ApiErrorLogDO> { |
| 35 | 35 | * 物理删除指定时间之前的日志 |
| 36 | 36 | * |
| 37 | 37 | * @param createTime 最大时间 |
| 38 | - * @param limit 删除条数,防止一次删除太多 | |
| 38 | + * @param limit 删除条数,防止一次删除太多 | |
| 39 | 39 | * @return 删除条数 |
| 40 | 40 | */ |
| 41 | 41 | @Delete("DELETE FROM infra_api_error_log WHERE create_time < #{createTime} LIMIT #{limit}") |
| 42 | - Integer deleteByCreateTimeLt(@Param("createTime") LocalDateTime createTime, @Param("limit")Integer limit); | |
| 42 | + Integer deleteByCreateTimeLt(@Param("createTime") LocalDateTime createTime, @Param("limit") Integer limit); | |
| 43 | 43 | |
| 44 | 44 | } | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenService.java
| ... | ... | @@ -22,7 +22,7 @@ public interface CodegenService { |
| 22 | 22 | * 基于数据库的表结构,创建代码生成器的表定义 |
| 23 | 23 | * |
| 24 | 24 | * @param author 作者 |
| 25 | - * @param reqVO 表信息 | |
| 25 | + * @param reqVO 表信息 | |
| 26 | 26 | * @return 创建的表定义的编号数组 |
| 27 | 27 | */ |
| 28 | 28 | List<Long> createCodegenList(String author, CodegenCreateListReqVO reqVO); |
| ... | ... | @@ -92,8 +92,8 @@ public interface CodegenService { |
| 92 | 92 | * 获得数据库自带的表定义列表 |
| 93 | 93 | * |
| 94 | 94 | * @param dataSourceConfigId 数据源的配置编号 |
| 95 | - * @param name 表名称 | |
| 96 | - * @param comment 表描述 | |
| 95 | + * @param name 表名称 | |
| 96 | + * @param comment 表描述 | |
| 97 | 97 | * @return 表定义列表 |
| 98 | 98 | */ |
| 99 | 99 | List<DatabaseTableRespVO> getDatabaseTableList(Long dataSourceConfigId, String name, String comment); | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenBuilder.java
| ... | ... | @@ -214,7 +214,6 @@ public class CodegenBuilder { |
| 214 | 214 | // description、memo、remark |
| 215 | 215 | if (StrUtil.endWithAnyIgnoreCase(column.getColumnName(), "description", "memo", "remark")) { |
| 216 | 216 | column.setExample(randomEle(new String[]{"你猜", "随便", "你说的对"})); |
| 217 | - return; | |
| 218 | 217 | } |
| 219 | 218 | } |
| 220 | 219 | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngine.java
| ... | ... | @@ -221,7 +221,7 @@ public class CodegenEngine { |
| 221 | 221 | this.templateEngine = new VelocityEngine(config); |
| 222 | 222 | // 设置 javaxEnable,按照是否使用 JDK17 来判断 |
| 223 | 223 | this.jakartaEnable = SystemUtil.getJavaInfo().isJavaVersionAtLeast(1700) // 17.00 * 100 |
| 224 | - && ClassUtils.isPresent("jakarta.annotation.Resource", ClassUtils.getDefaultClassLoader()); | |
| 224 | + && ClassUtils.isPresent("jakarta.annotation.Resource", ClassUtils.getDefaultClassLoader()); | |
| 225 | 225 | // 设置 cloudEnable,按照是否使用 Spring Cloud 来判断 |
| 226 | 226 | this.cloudEnable = ClassUtils.isPresent("cn.iocoder.yudao.module.infra.framework.rpc.config.RpcConfiguration", |
| 227 | 227 | ClassUtils.getDefaultClassLoader()); |
| ... | ... | @@ -264,9 +264,9 @@ public class CodegenEngine { |
| 264 | 264 | /** |
| 265 | 265 | * 生成代码 |
| 266 | 266 | * |
| 267 | - * @param table 表定义 | |
| 268 | - * @param columns table 的字段定义数组 | |
| 269 | - * @param subTables 子表数组,当且仅当主子表时使用 | |
| 267 | + * @param table 表定义 | |
| 268 | + * @param columns table 的字段定义数组 | |
| 269 | + * @param subTables 子表数组,当且仅当主子表时使用 | |
| 270 | 270 | * @param subColumnsList subTables 的字段定义数组 |
| 271 | 271 | * @return 生成的代码,key 是路径,value 是对应代码 |
| 272 | 272 | */ | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/config/ConfigService.java
| ... | ... | @@ -4,7 +4,6 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | 4 | import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigPageReqVO; |
| 5 | 5 | import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigSaveReqVO; |
| 6 | 6 | import cn.iocoder.yudao.module.infra.dal.dataobject.config.ConfigDO; |
| 7 | - | |
| 8 | 7 | import jakarta.validation.Valid; |
| 9 | 8 | |
| 10 | 9 | /** | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/config/ConfigServiceImpl.java
| ... | ... | @@ -8,12 +8,11 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.config.ConfigDO; |
| 8 | 8 | import cn.iocoder.yudao.module.infra.dal.mysql.config.ConfigMapper; |
| 9 | 9 | import cn.iocoder.yudao.module.infra.enums.config.ConfigTypeEnum; |
| 10 | 10 | import com.google.common.annotations.VisibleForTesting; |
| 11 | +import jakarta.annotation.Resource; | |
| 11 | 12 | import lombok.extern.slf4j.Slf4j; |
| 12 | 13 | import org.springframework.stereotype.Service; |
| 13 | 14 | import org.springframework.validation.annotation.Validated; |
| 14 | 15 | |
| 15 | -import jakarta.annotation.Resource; | |
| 16 | - | |
| 17 | 16 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 18 | 17 | import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.*; |
| 19 | 18 | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigService.java
| ... | ... | @@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.infra.service.db; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.module.infra.controller.admin.db.vo.DataSourceConfigSaveReqVO; |
| 4 | 4 | import cn.iocoder.yudao.module.infra.dal.dataobject.db.DataSourceConfigDO; |
| 5 | - | |
| 6 | 5 | import jakarta.validation.Valid; |
| 6 | + | |
| 7 | 7 | import java.util.List; |
| 8 | 8 | |
| 9 | 9 | /** | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigServiceImpl.java
| ... | ... | @@ -7,10 +7,10 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.db.DataSourceConfigDO; |
| 7 | 7 | import cn.iocoder.yudao.module.infra.dal.mysql.db.DataSourceConfigMapper; |
| 8 | 8 | import com.baomidou.dynamic.datasource.creator.DataSourceProperty; |
| 9 | 9 | import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties; |
| 10 | +import jakarta.annotation.Resource; | |
| 10 | 11 | import org.springframework.stereotype.Service; |
| 11 | 12 | import org.springframework.validation.annotation.Validated; |
| 12 | 13 | |
| 13 | -import jakarta.annotation.Resource; | |
| 14 | 14 | import java.util.List; |
| 15 | 15 | import java.util.Objects; |
| 16 | 16 | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/db/DatabaseTableService.java
| ... | ... | @@ -15,8 +15,8 @@ public interface DatabaseTableService { |
| 15 | 15 | * 获得表列表,基于表名称 + 表描述进行模糊匹配 |
| 16 | 16 | * |
| 17 | 17 | * @param dataSourceConfigId 数据源配置的编号 |
| 18 | - * @param nameLike 表名称,模糊匹配 | |
| 19 | - * @param commentLike 表描述,模糊匹配 | |
| 18 | + * @param nameLike 表名称,模糊匹配 | |
| 19 | + * @param commentLike 表描述,模糊匹配 | |
| 20 | 20 | * @return 表列表 |
| 21 | 21 | */ |
| 22 | 22 | List<TableInfo> getTableList(Long dataSourceConfigId, String nameLike, String commentLike); |
| ... | ... | @@ -25,7 +25,7 @@ public interface DatabaseTableService { |
| 25 | 25 | * 获得指定表名 |
| 26 | 26 | * |
| 27 | 27 | * @param dataSourceConfigId 数据源配置的编号 |
| 28 | - * @param tableName 表名称 | |
| 28 | + * @param tableName 表名称 | |
| 29 | 29 | * @return 表 |
| 30 | 30 | */ |
| 31 | 31 | TableInfo getTable(Long dataSourceConfigId, String tableName); | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo01/Demo01ContactService.java
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo01/Demo01ContactServiceImpl.java
| ... | ... | @@ -55,7 +55,7 @@ public class Demo01ContactServiceImpl implements Demo01ContactService { |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | @Override |
| 58 | - public void deleteDemo01ContactByIds(List<Long> ids) { | |
| 58 | + public void deleteDemo0iContactListByIds(List<Long> ids) { | |
| 59 | 59 | // 校验存在 |
| 60 | 60 | validateDemo01ContactExists(ids); |
| 61 | 61 | // 删除 | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/erp/Demo03StudentErpService.java
| ... | ... | @@ -45,7 +45,7 @@ public interface Demo03StudentErpService { |
| 45 | 45 | * |
| 46 | 46 | * @param ids 编号 |
| 47 | 47 | */ |
| 48 | - void deleteDemo03StudentByIds(List<Long> ids); | |
| 48 | + void deleteDemo03StudentListByIds(List<Long> ids); | |
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | 51 | * 获得学生 |
| ... | ... | @@ -101,7 +101,7 @@ public interface Demo03StudentErpService { |
| 101 | 101 | * |
| 102 | 102 | * @param ids 编号 |
| 103 | 103 | */ |
| 104 | - void deleteDemo03CourseByIds(List<Long> ids); | |
| 104 | + void deleteDemo03CourseListByIds(List<Long> ids); | |
| 105 | 105 | |
| 106 | 106 | /** |
| 107 | 107 | * 获得学生课程 |
| ... | ... | @@ -149,7 +149,7 @@ public interface Demo03StudentErpService { |
| 149 | 149 | * |
| 150 | 150 | * @param ids 编号 |
| 151 | 151 | */ |
| 152 | - void deleteDemo03GradeByIds(List<Long> ids); | |
| 152 | + void deleteDemo03GradeListByIds(List<Long> ids); | |
| 153 | 153 | |
| 154 | 154 | /** |
| 155 | 155 | * 获得学生班级 | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/erp/Demo03StudentErpServiceImpl.java
| ... | ... | @@ -71,7 +71,7 @@ public class Demo03StudentErpServiceImpl implements Demo03StudentErpService { |
| 71 | 71 | |
| 72 | 72 | @Override |
| 73 | 73 | @Transactional(rollbackFor = Exception.class) |
| 74 | - public void deleteDemo03StudentByIds(List<Long> ids) { | |
| 74 | + public void deleteDemo03StudentListByIds(List<Long> ids) { | |
| 75 | 75 | // 校验存在 |
| 76 | 76 | validateDemo03StudentExists(ids); |
| 77 | 77 | // 删除 |
| ... | ... | @@ -123,7 +123,7 @@ public class Demo03StudentErpServiceImpl implements Demo03StudentErpService { |
| 123 | 123 | // 校验存在 |
| 124 | 124 | validateDemo03CourseExists(demo03Course.getId()); |
| 125 | 125 | // 更新 |
| 126 | - demo03Course.setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新 | |
| 126 | + demo03Course.clean(); | |
| 127 | 127 | demo03CourseErpMapper.updateById(demo03Course); |
| 128 | 128 | } |
| 129 | 129 | |
| ... | ... | @@ -136,7 +136,7 @@ public class Demo03StudentErpServiceImpl implements Demo03StudentErpService { |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | @Override |
| 139 | - public void deleteDemo03CourseByIds(List<Long> ids) { | |
| 139 | + public void deleteDemo03CourseListByIds(List<Long> ids) { | |
| 140 | 140 | // 校验存在 |
| 141 | 141 | validateDemo03CourseExists(ids); |
| 142 | 142 | // 删除 |
| ... | ... | @@ -192,7 +192,7 @@ public class Demo03StudentErpServiceImpl implements Demo03StudentErpService { |
| 192 | 192 | // 校验存在 |
| 193 | 193 | validateDemo03GradeExists(demo03Grade.getId()); |
| 194 | 194 | // 更新 |
| 195 | - demo03Grade.setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新 | |
| 195 | + demo03Grade.clean(); | |
| 196 | 196 | demo03GradeErpMapper.updateById(demo03Grade); |
| 197 | 197 | } |
| 198 | 198 | |
| ... | ... | @@ -205,7 +205,7 @@ public class Demo03StudentErpServiceImpl implements Demo03StudentErpService { |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | @Override |
| 208 | - public void deleteDemo03GradeByIds(List<Long> ids) { | |
| 208 | + public void deleteDemo03GradeListByIds(List<Long> ids) { | |
| 209 | 209 | // 校验存在 |
| 210 | 210 | validateDemo03GradeExists(ids); |
| 211 | 211 | // 删除 | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/inner/Demo03StudentInnerService.java
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/inner/Demo03StudentInnerServiceImpl.java
| ... | ... | @@ -83,7 +83,7 @@ public class Demo03StudentInnerServiceImpl implements Demo03StudentInnerService |
| 83 | 83 | |
| 84 | 84 | @Override |
| 85 | 85 | @Transactional(rollbackFor = Exception.class) |
| 86 | - public void deleteDemo03StudentByIds(List<Long> ids) { | |
| 86 | + public void deleteDemo03StudentListByIds(List<Long> ids) { | |
| 87 | 87 | // 校验存在 |
| 88 | 88 | validateDemo03StudentExists(ids); |
| 89 | 89 | // 删除 |
| ... | ... | @@ -125,17 +125,17 @@ public class Demo03StudentInnerServiceImpl implements Demo03StudentInnerService |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | private void createDemo03CourseList(Long studentId, List<Demo03CourseDO> list) { |
| 128 | - list.forEach(o -> o.setStudentId(studentId)); | |
| 128 | + list.forEach(o -> o.setStudentId(studentId).clean()); | |
| 129 | 129 | demo03CourseInnerMapper.insertBatch(list); |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | private void updateDemo03CourseList(Long studentId, List<Demo03CourseDO> list) { |
| 133 | - list.forEach(o -> o.setStudentId(studentId)); | |
| 133 | + list.forEach(o -> o.setStudentId(studentId).clean()); | |
| 134 | 134 | List<Demo03CourseDO> oldList = demo03CourseInnerMapper.selectListByStudentId(studentId); |
| 135 | 135 | List<List<Demo03CourseDO>> diffList = diffList(oldList, list, (oldVal, newVal) -> { |
| 136 | 136 | boolean same = ObjectUtil.equal(oldVal.getId(), newVal.getId()); |
| 137 | 137 | if (same) { |
| 138 | - newVal.setId(oldVal.getId()).setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新 | |
| 138 | + newVal.setId(oldVal.getId()); | |
| 139 | 139 | } |
| 140 | 140 | return same; |
| 141 | 141 | }); |
| ... | ... | @@ -179,8 +179,7 @@ public class Demo03StudentInnerServiceImpl implements Demo03StudentInnerService |
| 179 | 179 | if (demo03Grade == null) { |
| 180 | 180 | return; |
| 181 | 181 | } |
| 182 | - demo03Grade.setStudentId(studentId); | |
| 183 | - demo03Grade.setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新 | |
| 182 | + demo03Grade.setStudentId(studentId).clean(); | |
| 184 | 183 | demo03GradeInnerMapper.insertOrUpdate(demo03Grade); |
| 185 | 184 | } |
| 186 | 185 | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/normal/Demo03StudentNormalService.java
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/demo/demo03/normal/Demo03StudentNormalServiceImpl.java
| ... | ... | @@ -83,7 +83,7 @@ public class Demo03StudentNormalServiceImpl implements Demo03StudentNormalServic |
| 83 | 83 | |
| 84 | 84 | @Override |
| 85 | 85 | @Transactional(rollbackFor = Exception.class) |
| 86 | - public void deleteDemo03StudentByIds(List<Long> ids) { | |
| 86 | + public void deleteDemo03StudentListByIds(List<Long> ids) { | |
| 87 | 87 | // 校验存在 |
| 88 | 88 | validateDemo03StudentExists(ids); |
| 89 | 89 | // 删除 |
| ... | ... | @@ -125,17 +125,17 @@ public class Demo03StudentNormalServiceImpl implements Demo03StudentNormalServic |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | private void createDemo03CourseList(Long studentId, List<Demo03CourseDO> list) { |
| 128 | - list.forEach(o -> o.setStudentId(studentId)); | |
| 128 | + list.forEach(o -> o.setStudentId(studentId).clean()); | |
| 129 | 129 | demo03CourseNormalMapper.insertBatch(list); |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | private void updateDemo03CourseList(Long studentId, List<Demo03CourseDO> list) { |
| 133 | - list.forEach(o -> o.setStudentId(studentId)); | |
| 133 | + list.forEach(o -> o.setStudentId(studentId).clean()); | |
| 134 | 134 | List<Demo03CourseDO> oldList = demo03CourseNormalMapper.selectListByStudentId(studentId); |
| 135 | 135 | List<List<Demo03CourseDO>> diffList = diffList(oldList, list, (oldVal, newVal) -> { |
| 136 | 136 | boolean same = ObjectUtil.equal(oldVal.getId(), newVal.getId()); |
| 137 | 137 | if (same) { |
| 138 | - newVal.setId(oldVal.getId()).setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新 | |
| 138 | + newVal.setId(oldVal.getId()); | |
| 139 | 139 | } |
| 140 | 140 | return same; |
| 141 | 141 | }); |
| ... | ... | @@ -179,8 +179,7 @@ public class Demo03StudentNormalServiceImpl implements Demo03StudentNormalServic |
| 179 | 179 | if (demo03Grade == null) { |
| 180 | 180 | return; |
| 181 | 181 | } |
| 182 | - demo03Grade.setStudentId(studentId); | |
| 183 | - demo03Grade.setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新 | |
| 182 | + demo03Grade.setStudentId(studentId).clean(); | |
| 184 | 183 | demo03GradeNormalMapper.insertOrUpdate(demo03Grade); |
| 185 | 184 | } |
| 186 | 185 | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigService.java
| 1 | 1 | package cn.iocoder.yudao.module.infra.service.file; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | -import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient; | |
| 5 | 4 | import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigPageReqVO; |
| 6 | 5 | import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigSaveReqVO; |
| 7 | 6 | import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileConfigDO; |
| 8 | - | |
| 7 | +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient; | |
| 9 | 8 | import jakarta.validation.Valid; |
| 10 | 9 | |
| 11 | 10 | /** | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImpl.java
| ... | ... | @@ -5,25 +5,25 @@ import cn.hutool.core.util.IdUtil; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 6 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; |
| 7 | 7 | import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils; |
| 8 | -import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient; | |
| 9 | -import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientConfig; | |
| 10 | -import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientFactory; | |
| 11 | -import cn.iocoder.yudao.module.infra.framework.file.core.enums.FileStorageEnum; | |
| 12 | 8 | import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigPageReqVO; |
| 13 | 9 | import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigSaveReqVO; |
| 14 | 10 | import cn.iocoder.yudao.module.infra.convert.file.FileConfigConvert; |
| 15 | 11 | import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileConfigDO; |
| 16 | 12 | import cn.iocoder.yudao.module.infra.dal.mysql.file.FileConfigMapper; |
| 13 | +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient; | |
| 14 | +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientConfig; | |
| 15 | +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientFactory; | |
| 16 | +import cn.iocoder.yudao.module.infra.framework.file.core.enums.FileStorageEnum; | |
| 17 | 17 | import com.google.common.cache.CacheLoader; |
| 18 | 18 | import com.google.common.cache.LoadingCache; |
| 19 | +import jakarta.annotation.Resource; | |
| 20 | +import jakarta.validation.Validator; | |
| 19 | 21 | import lombok.Getter; |
| 20 | 22 | import lombok.extern.slf4j.Slf4j; |
| 21 | 23 | import org.springframework.stereotype.Service; |
| 22 | 24 | import org.springframework.transaction.annotation.Transactional; |
| 23 | 25 | import org.springframework.validation.annotation.Validated; |
| 24 | 26 | |
| 25 | -import jakarta.annotation.Resource; | |
| 26 | -import jakarta.validation.Validator; | |
| 27 | 27 | import java.time.Duration; |
| 28 | 28 | import java.util.Map; |
| 29 | 29 | import java.util.Objects; |
| ... | ... | @@ -137,7 +137,7 @@ public class FileConfigServiceImpl implements FileConfigService { |
| 137 | 137 | /** |
| 138 | 138 | * 清空指定文件配置 |
| 139 | 139 | * |
| 140 | - * @param id 配置编号 | |
| 140 | + * @param id 配置编号 | |
| 141 | 141 | * @param master 是否主配置 |
| 142 | 142 | */ |
| 143 | 143 | private void clearCache(Long id, Boolean master) { | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileService.java
| ... | ... | @@ -25,10 +25,10 @@ public interface FileService { |
| 25 | 25 | /** |
| 26 | 26 | * 保存文件,并返回文件的访问路径 |
| 27 | 27 | * |
| 28 | - * @param content 文件内容 | |
| 29 | - * @param name 文件名称,允许空 | |
| 28 | + * @param content 文件内容 | |
| 29 | + * @param name 文件名称,允许空 | |
| 30 | 30 | * @param directory 目录,允许空 |
| 31 | - * @param type 文件的 MIME 类型,允许空 | |
| 31 | + * @param type 文件的 MIME 类型,允许空 | |
| 32 | 32 | * @return 文件路径 |
| 33 | 33 | */ |
| 34 | 34 | String createFile(@NotEmpty(message = "文件内容不能为空") byte[] content, |
| ... | ... | @@ -37,7 +37,7 @@ public interface FileService { |
| 37 | 37 | /** |
| 38 | 38 | * 生成文件预签名地址信息 |
| 39 | 39 | * |
| 40 | - * @param name 文件名 | |
| 40 | + * @param name 文件名 | |
| 41 | 41 | * @param directory 目录 |
| 42 | 42 | * @return 预签名地址信息 |
| 43 | 43 | */ | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobLogService.java
| ... | ... | @@ -31,7 +31,7 @@ public interface JobLogService extends JobLogFrameworkService { |
| 31 | 31 | /** |
| 32 | 32 | * 清理 exceedDay 天前的任务日志 |
| 33 | 33 | * |
| 34 | - * @param exceedDay 超过多少天就进行清理 | |
| 34 | + * @param exceedDay 超过多少天就进行清理 | |
| 35 | 35 | * @param deleteLimit 清理的间隔条数 |
| 36 | 36 | */ |
| 37 | 37 | Integer cleanJobLog(Integer exceedDay, Integer deleteLimit); | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobLogServiceImpl.java
| ... | ... | @@ -5,12 +5,12 @@ import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.JobLogPageReqVO |
| 5 | 5 | import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobLogDO; |
| 6 | 6 | import cn.iocoder.yudao.module.infra.dal.mysql.job.JobLogMapper; |
| 7 | 7 | import cn.iocoder.yudao.module.infra.enums.job.JobLogStatusEnum; |
| 8 | +import jakarta.annotation.Resource; | |
| 8 | 9 | import lombok.extern.slf4j.Slf4j; |
| 9 | 10 | import org.springframework.scheduling.annotation.Async; |
| 10 | 11 | import org.springframework.stereotype.Service; |
| 11 | 12 | import org.springframework.validation.annotation.Validated; |
| 12 | 13 | |
| 13 | -import jakarta.annotation.Resource; | |
| 14 | 14 | import java.time.LocalDateTime; |
| 15 | 15 | |
| 16 | 16 | /** | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobService.java
| ... | ... | @@ -4,9 +4,8 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | 4 | import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.JobPageReqVO; |
| 5 | 5 | import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.JobSaveReqVO; |
| 6 | 6 | import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobDO; |
| 7 | -import org.quartz.SchedulerException; | |
| 8 | - | |
| 9 | 7 | import jakarta.validation.Valid; |
| 8 | +import org.quartz.SchedulerException; | |
| 10 | 9 | |
| 11 | 10 | /** |
| 12 | 11 | * 定时任务 Service 接口 |
| ... | ... | @@ -33,7 +32,7 @@ public interface JobService { |
| 33 | 32 | /** |
| 34 | 33 | * 更新定时任务的状态 |
| 35 | 34 | * |
| 36 | - * @param id 任务编号 | |
| 35 | + * @param id 任务编号 | |
| 37 | 36 | * @param status 状态 |
| 38 | 37 | */ |
| 39 | 38 | void updateJobStatus(Long id, Integer status) throws SchedulerException; | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/job/JobServiceImpl.java
| ... | ... | @@ -190,7 +190,7 @@ public class JobServiceImpl implements JobService { |
| 190 | 190 | |
| 191 | 191 | @Override |
| 192 | 192 | public PageResult<JobDO> getJobPage(JobPageReqVO pageReqVO) { |
| 193 | - return jobMapper.selectPage(pageReqVO); | |
| 193 | + return jobMapper.selectPage(pageReqVO); | |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | private static void fillJobMonitorTimeoutEmpty(JobDO job) { | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogService.java
| ... | ... | @@ -30,7 +30,7 @@ public interface ApiAccessLogService { |
| 30 | 30 | /** |
| 31 | 31 | * 清理 exceedDay 天前的访问日志 |
| 32 | 32 | * |
| 33 | - * @param exceedDay 超过多少天就进行清理 | |
| 33 | + * @param exceedDay 超过多少天就进行清理 | |
| 34 | 34 | * @param deleteLimit 清理的间隔条数 |
| 35 | 35 | */ |
| 36 | 36 | Integer cleanAccessLog(Integer exceedDay, Integer deleteLimit); | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogService.java
| 1 | 1 | package cn.iocoder.yudao.module.infra.service.logger; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | 3 | import cn.iocoder.yudao.framework.common.biz.infra.logger.dto.ApiErrorLogCreateReqDTO; |
| 4 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 5 | 5 | import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogPageReqVO; |
| 6 | 6 | import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiErrorLogDO; |
| 7 | 7 | |
| ... | ... | @@ -30,7 +30,7 @@ public interface ApiErrorLogService { |
| 30 | 30 | /** |
| 31 | 31 | * 更新 API 错误日志已处理 |
| 32 | 32 | * |
| 33 | - * @param id API 日志编号 | |
| 33 | + * @param id API 日志编号 | |
| 34 | 34 | * @param processStatus 处理结果 |
| 35 | 35 | * @param processUserId 处理人 |
| 36 | 36 | */ |
| ... | ... | @@ -39,7 +39,7 @@ public interface ApiErrorLogService { |
| 39 | 39 | /** |
| 40 | 40 | * 清理 exceedDay 天前的错误日志 |
| 41 | 41 | * |
| 42 | - * @param exceedDay 超过多少天就进行清理 | |
| 42 | + * @param exceedDay 超过多少天就进行清理 | |
| 43 | 43 | * @param deleteLimit 清理的间隔条数 |
| 44 | 44 | */ |
| 45 | 45 | Integer cleanErrorLog(Integer exceedDay, Integer deleteLimit); | ... | ... |
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImpl.java
| 1 | 1 | package cn.iocoder.yudao.module.infra.service.logger; |
| 2 | 2 | |
| 3 | +import cn.iocoder.yudao.framework.common.biz.infra.logger.dto.ApiErrorLogCreateReqDTO; | |
| 3 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | 5 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 5 | 6 | import cn.iocoder.yudao.framework.common.util.string.StrUtils; |
| 6 | 7 | import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; |
| 7 | 8 | import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils; |
| 8 | -import cn.iocoder.yudao.framework.common.biz.infra.logger.dto.ApiErrorLogCreateReqDTO; | |
| 9 | 9 | import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogPageReqVO; |
| 10 | 10 | import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiErrorLogDO; |
| 11 | 11 | import cn.iocoder.yudao.module.infra.dal.mysql.logger.ApiErrorLogMapper; | ... | ... |
yudao-module-infra/src/main/resources/codegen/java/controller/controller.vm
| ... | ... | @@ -75,14 +75,14 @@ public class ${sceneEnum.prefixClass}${table.className}Controller { |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | #if ( $table.templateType != 2 && $deleteBatchEnable) |
| 78 | - @DeleteMapping("/delete-batch") | |
| 78 | + @DeleteMapping("/delete-list") | |
| 79 | 79 | @Parameter(name = "ids", description = "编号", required = true) |
| 80 | 80 | @Operation(summary = "批量删除${table.classComment}") |
| 81 | 81 | #if ($sceneEnum.scene == 1) |
| 82 | 82 | @PreAuthorize("@ss.hasPermission('${permissionPrefix}:delete')") |
| 83 | 83 | #end |
| 84 | - public CommonResult<Boolean> delete${simpleClassName}(@RequestParam("ids") List<${primaryColumn.javaType}> ids) { | |
| 85 | - ${classNameVar}Service.delete${simpleClassName}ByIds(ids); | |
| 84 | + public CommonResult<Boolean> delete${simpleClassName}List(@RequestParam("ids") List<${primaryColumn.javaType}> ids) { | |
| 85 | + ${classNameVar}Service.delete${simpleClassName}ListByIds(ids); | |
| 86 | 86 | return success(true); |
| 87 | 87 | } |
| 88 | 88 | #end |
| ... | ... | @@ -244,14 +244,14 @@ public class ${sceneEnum.prefixClass}${table.className}Controller { |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | #if ($deleteBatchEnable) |
| 247 | - @DeleteMapping("/${subSimpleClassName_strikeCase}/delete-batch") | |
| 247 | + @DeleteMapping("/${subSimpleClassName_strikeCase}/delete-list") | |
| 248 | 248 | @Parameter(name = "ids", description = "编号", required = true) |
| 249 | 249 | @Operation(summary = "批量删除${subTable.classComment}") |
| 250 | 250 | #if ($sceneEnum.scene == 1) |
| 251 | 251 | @PreAuthorize("@ss.hasPermission('${permissionPrefix}:delete')") |
| 252 | 252 | #end |
| 253 | - public CommonResult<Boolean> delete${subSimpleClassName}(@RequestParam("ids") List<${subPrimaryColumn.javaType}> ids) { | |
| 254 | - ${classNameVar}Service.delete${subSimpleClassName}ByIds(ids); | |
| 253 | + public CommonResult<Boolean> delete${subSimpleClassName}List(@RequestParam("ids") List<${subPrimaryColumn.javaType}> ids) { | |
| 254 | + ${classNameVar}Service.delete${subSimpleClassName}ListByIds(ids); | |
| 255 | 255 | return success(true); |
| 256 | 256 | } |
| 257 | 257 | #end | ... | ... |
yudao-module-infra/src/main/resources/codegen/java/controller/vo/pageReqVO.vm
| ... | ... | @@ -28,8 +28,6 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| 28 | 28 | |
| 29 | 29 | @Schema(description = "${sceneEnum.name} - ${table.classComment}分页 Request VO") |
| 30 | 30 | @Data |
| 31 | -@EqualsAndHashCode(callSuper = true) | |
| 32 | -@ToString(callSuper = true) | |
| 33 | 31 | public class ${sceneEnum.prefixClass}${table.className}PageReqVO extends PageParam { |
| 34 | 32 | |
| 35 | 33 | #foreach ($column in $columns) | ... | ... |
yudao-module-infra/src/main/resources/codegen/java/dal/do.vm
| ... | ... | @@ -77,17 +77,23 @@ public class ${table.className}DO extends BaseDO { |
| 77 | 77 | private ${column.javaType} ${column.javaField}; |
| 78 | 78 | #end |
| 79 | 79 | #end |
| 80 | - | |
| 81 | 80 | ## 特殊:主子表专属逻辑(非 ERP 模式) |
| 82 | 81 | #if ( $voType == 20 && $subTables && $subTables.size() > 0 && $table.templateType != 11 ) |
| 83 | 82 | #foreach ($subTable in $subTables) |
| 84 | 83 | #set ($index = $foreach.count - 1) |
| 85 | 84 | #if ( $subTable.subJoinMany) |
| 85 | + /** | |
| 86 | + * ${subTable.classComment}列表 | |
| 87 | + */ | |
| 86 | 88 | @Schema(description = "${subTable.classComment}列表") |
| 89 | + @TableField(exist = false) | |
| 87 | 90 | private List<${subTable.className}DO> ${subClassNameVars.get($index)}s; |
| 88 | - | |
| 89 | 91 | #else |
| 92 | + /** | |
| 93 | + * ${subTable.classComment} | |
| 94 | + */ | |
| 90 | 95 | @Schema(description = "${subTable.classComment}") |
| 96 | + @TableField(exist = false) | |
| 91 | 97 | private ${subTable.className}DO ${subClassNameVars.get($index)}; |
| 92 | 98 | #end |
| 93 | 99 | #end | ... | ... |
yudao-module-infra/src/main/resources/codegen/java/service/service.vm
| ... | ... | @@ -46,7 +46,7 @@ public interface ${table.className}Service { |
| 46 | 46 | * |
| 47 | 47 | * @param ids 编号 |
| 48 | 48 | */ |
| 49 | - void delete${simpleClassName}ByIds(List<${primaryColumn.javaType}> ids); | |
| 49 | + void delete${simpleClassName}ListByIds(List<${primaryColumn.javaType}> ids); | |
| 50 | 50 | #end |
| 51 | 51 | |
| 52 | 52 | /** |
| ... | ... | @@ -149,7 +149,7 @@ public interface ${table.className}Service { |
| 149 | 149 | * |
| 150 | 150 | * @param ids 编号 |
| 151 | 151 | */ |
| 152 | - void delete${subSimpleClassName}ByIds(List<${subPrimaryColumn.javaType}> ids); | |
| 152 | + void delete${subSimpleClassName}ListByIds(List<${subPrimaryColumn.javaType}> ids); | |
| 153 | 153 | #end |
| 154 | 154 | |
| 155 | 155 | /** | ... | ... |
yudao-module-infra/src/main/resources/codegen/java/service/serviceImpl.vm
| ... | ... | @@ -169,7 +169,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service |
| 169 | 169 | #if ( $subTables && $subTables.size() > 0) |
| 170 | 170 | @Transactional(rollbackFor = Exception.class) |
| 171 | 171 | #end |
| 172 | - public void delete${simpleClassName}ByIds(List<${primaryColumn.javaType}> ids) { | |
| 172 | + public void delete${simpleClassName}ListByIds(List<${primaryColumn.javaType}> ids) { | |
| 173 | 173 | // 校验存在 |
| 174 | 174 | validate${simpleClassName}Exists(ids); |
| 175 | 175 | // 删除 |
| ... | ... | @@ -328,7 +328,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service |
| 328 | 328 | // 校验存在 |
| 329 | 329 | validate${subSimpleClassName}Exists(${subClassNameVar}.getId()); |
| 330 | 330 | // 更新 |
| 331 | - ${subClassNameVar}.setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新 | |
| 331 | + ${subClassNameVar}.clean(); // 解决更新情况下:updateTime 不更新 | |
| 332 | 332 | ${subClassNameVars.get($index)}Mapper.updateById(${subClassNameVar}); |
| 333 | 333 | } |
| 334 | 334 | |
| ... | ... | @@ -342,7 +342,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service |
| 342 | 342 | |
| 343 | 343 | #if ($deleteBatchEnable) |
| 344 | 344 | @Override |
| 345 | - public void delete${subSimpleClassName}ByIds(List<${subPrimaryColumn.javaType}> ids) { | |
| 345 | + public void delete${subSimpleClassName}ListByIds(List<${subPrimaryColumn.javaType}> ids) { | |
| 346 | 346 | // 校验存在 |
| 347 | 347 | validate${subSimpleClassName}Exists(ids); |
| 348 | 348 | // 删除 |
| ... | ... | @@ -374,17 +374,17 @@ public class ${table.className}ServiceImpl implements ${table.className}Service |
| 374 | 374 | #else |
| 375 | 375 | #if ( $subTable.subJoinMany) |
| 376 | 376 | private void create${subSimpleClassName}List(${primaryColumn.javaType} ${subJoinColumn.javaField}, List<${subTable.className}DO> list) { |
| 377 | - list.forEach(o -> o.set${SubJoinColumnName}(${subJoinColumn.javaField})); | |
| 377 | + list.forEach(o -> o.set${SubJoinColumnName}(${subJoinColumn.javaField}).clean()); | |
| 378 | 378 | ${subClassNameVars.get($index)}Mapper.insertBatch(list); |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | private void update${subSimpleClassName}List(${primaryColumn.javaType} ${subJoinColumn.javaField}, List<${subTable.className}DO> list) { |
| 382 | - list.forEach(o -> o.set${SubJoinColumnName}(${subJoinColumn.javaField})); | |
| 382 | + list.forEach(o -> o.set${SubJoinColumnName}(${subJoinColumn.javaField}).clean()); | |
| 383 | 383 | List<${subTable.className}DO> oldList = ${subClassNameVar}Mapper.selectListBy${SubJoinColumnName}(${subJoinColumn.javaField}); |
| 384 | 384 | List<List<${subTable.className}DO>> diffList = diffList(oldList, list, (oldVal, newVal) -> { |
| 385 | 385 | boolean same = ObjectUtil.equal(oldVal.getId(), newVal.getId()); |
| 386 | 386 | if (same) { |
| 387 | - newVal.setId(oldVal.getId()).setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新 | |
| 387 | + newVal.setId(oldVal.getId()).clean(); // 解决更新情况下:updateTime 不更新 | |
| 388 | 388 | } |
| 389 | 389 | return same; |
| 390 | 390 | }); |
| ... | ... | @@ -414,8 +414,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service |
| 414 | 414 | if (${subClassNameVar} == null) { |
| 415 | 415 | return; |
| 416 | 416 | } |
| 417 | - ${subClassNameVar}.set$SubJoinColumnName(${subJoinColumn.javaField}); | |
| 418 | - ${subClassNameVar}.setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新 | |
| 417 | + ${subClassNameVar}.set$SubJoinColumnName(${subJoinColumn.javaField}).clean();// 解决更新情况下:updateTime 不更新 | |
| 419 | 418 | ${subClassNameVars.get($index)}Mapper.insertOrUpdate(${subClassNameVar}); |
| 420 | 419 | } |
| 421 | 420 | ... | ... |
yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/schema/api/api.ts.vm
| ... | ... | @@ -90,9 +90,9 @@ export function delete${simpleClassName}(id: number) { |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | #if ( $table.templateType != 2 && $deleteBatchEnable) |
| 93 | -// 批量删除${table.classComment} | |
| 94 | -export function delete${simpleClassName}ByIds(ids: number[]) { | |
| 95 | - return requestClient.delete(`${baseURL}/delete-batch?ids=${ids.join(',')}`) | |
| 93 | +/** 批量删除${table.classComment} */ | |
| 94 | +export function delete${simpleClassName}ListByIds(ids: number[]) { | |
| 95 | + return requestClient.delete(`${baseURL}/delete-list?ids=${ids.join(',')}`) | |
| 96 | 96 | } |
| 97 | 97 | #end |
| 98 | 98 | |
| ... | ... | @@ -152,9 +152,9 @@ export function delete${subSimpleClassName}(id: number) { |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | #if ($deleteBatchEnable) |
| 155 | -// 批量删除${subTable.classComment} | |
| 156 | -export function delete${subSimpleClassName}ByIds(ids: number[]) { | |
| 157 | - return requestClient.delete(`${baseURL}/${subSimpleClassName_strikeCase}/delete-batch?ids=${ids.join(',')}`) | |
| 155 | +/** 批量删除${subTable.classComment} */ | |
| 156 | +export function delete${subSimpleClassName}ListByIds(ids: number[]) { | |
| 157 | + return requestClient.delete(`${baseURL}/${subSimpleClassName_strikeCase}/delete-list?ids=${ids.join(',')}`) | |
| 158 | 158 | } |
| 159 | 159 | #end |
| 160 | 160 | ... | ... |
yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/schema/views/index.vue.vm
| ... | ... | @@ -22,7 +22,7 @@ import { useVbenVxeGrid } from '#/adapter/vxe-table'; |
| 22 | 22 | #if (${table.templateType} == 2)## 树表接口 |
| 23 | 23 | import { get${simpleClassName}List, delete${simpleClassName}, export${simpleClassName} } from '#/api/${table.moduleName}/${table.businessName}'; |
| 24 | 24 | #else## 标准表接口 |
| 25 | -import { get${simpleClassName}Page, delete${simpleClassName},#if ($deleteBatchEnable) delete${simpleClassName}ByIds,#end export${simpleClassName} } from '#/api/${table.moduleName}/${table.businessName}'; | |
| 25 | +import { get${simpleClassName}Page, delete${simpleClassName},#if ($deleteBatchEnable) delete${simpleClassName}ListByIds,#end export${simpleClassName} } from '#/api/${table.moduleName}/${table.businessName}'; | |
| 26 | 26 | #end |
| 27 | 27 | import { downloadFileFromBlobPart, isEmpty } from '@vben/utils'; |
| 28 | 28 | |
| ... | ... | @@ -93,15 +93,6 @@ async function onDelete(row: ${simpleClassName}Api.${simpleClassName}) { |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | #if ($table.templateType != 2 && $deleteBatchEnable) |
| 96 | -const deleteIds = ref<number[]>([]) // 待删除${table.classComment} ID | |
| 97 | -const showDeleteBatchBtn = computed(() => isEmpty(deleteIds.value)); | |
| 98 | -function setDeleteIds({ | |
| 99 | - records, | |
| 100 | -}: { | |
| 101 | - records: ${simpleClassName}Api.${simpleClassName}[]; | |
| 102 | -}) { | |
| 103 | - deleteIds.value = records.map((item) => item.id); | |
| 104 | -} | |
| 105 | 96 | /** 批量删除${table.classComment} */ |
| 106 | 97 | async function onDeleteBatch() { |
| 107 | 98 | const hideLoading = message.loading({ |
| ... | ... | @@ -110,13 +101,22 @@ async function onDeleteBatch() { |
| 110 | 101 | key: 'action_process_msg', |
| 111 | 102 | }); |
| 112 | 103 | try { |
| 113 | - await delete${simpleClassName}ByIds(deleteIds.value); | |
| 104 | + await delete${simpleClassName}ListByIds(deleteIds.value); | |
| 114 | 105 | message.success( $t('ui.actionMessage.deleteSuccess') ); |
| 115 | 106 | onRefresh(); |
| 116 | 107 | } finally { |
| 117 | 108 | hideLoading(); |
| 118 | 109 | } |
| 119 | 110 | } |
| 111 | + | |
| 112 | +const deleteIds = ref<number[]>([]) // 待删除${table.classComment} ID | |
| 113 | +function setDeleteIds({ | |
| 114 | + records, | |
| 115 | +}: { | |
| 116 | + records: ${simpleClassName}Api.${simpleClassName}[]; | |
| 117 | +}) { | |
| 118 | + deleteIds.value = records.map((item) => item.id); | |
| 119 | +} | |
| 120 | 120 | #end |
| 121 | 121 | |
| 122 | 122 | /** 导出表格 */ |
| ... | ... | @@ -268,7 +268,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ |
| 268 | 268 | type="primary" |
| 269 | 269 | danger |
| 270 | 270 | class="ml-2" |
| 271 | - :disabled="showDeleteBatchBtn" | |
| 271 | + :disabled="isEmpty(deleteIds)" | |
| 272 | 272 | @click="onDeleteBatch" |
| 273 | 273 | v-access:code="['${table.moduleName}:${simpleClassName_strikeCase}:delete']" |
| 274 | 274 | > | ... | ... |
yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/schema/views/modules/list_sub_erp.vue.vm
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | #if ($table.templateType == 11) ## erp |
| 24 | - import { delete${subSimpleClassName},#if ($deleteBatchEnable) delete${subSimpleClassName}ByIds,#end get${subSimpleClassName}Page } from '#/api/${table.moduleName}/${table.businessName}'; | |
| 24 | + import { delete${subSimpleClassName},#if ($deleteBatchEnable) delete${subSimpleClassName}ListByIds,#end get${subSimpleClassName}Page } from '#/api/${table.moduleName}/${table.businessName}'; | |
| 25 | 25 | import { use${subSimpleClassName}GridFormSchema, use${subSimpleClassName}GridColumns } from '../data'; |
| 26 | 26 | import { isEmpty } from '@vben/utils'; |
| 27 | 27 | #else |
| ... | ... | @@ -74,15 +74,6 @@ async function onDelete(row: ${simpleClassName}Api.${subSimpleClassName}) { |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | #if ($deleteBatchEnable) |
| 77 | -const deleteIds = ref<number[]>([]) // 待删除${subTable.classComment} ID | |
| 78 | -const showDeleteBatchBtn = computed(() => isEmpty(deleteIds.value)); | |
| 79 | -function setDeleteIds({ | |
| 80 | - records, | |
| 81 | -}: { | |
| 82 | - records: ${simpleClassName}Api.${subSimpleClassName}[]; | |
| 83 | -}) { | |
| 84 | - deleteIds.value = records.map((item) => item.id); | |
| 85 | -} | |
| 86 | 77 | /** 批量删除${subTable.classComment} */ |
| 87 | 78 | async function onDeleteBatch() { |
| 88 | 79 | const hideLoading = message.loading({ |
| ... | ... | @@ -91,13 +82,22 @@ async function onDeleteBatch() { |
| 91 | 82 | key: 'action_process_msg', |
| 92 | 83 | }); |
| 93 | 84 | try { |
| 94 | - await delete${subSimpleClassName}ByIds(deleteIds.value); | |
| 85 | + await delete${subSimpleClassName}ListByIds(deleteIds.value); | |
| 95 | 86 | message.success( $t('ui.actionMessage.deleteSuccess') ); |
| 96 | 87 | onRefresh(); |
| 97 | 88 | } finally { |
| 98 | 89 | hideLoading(); |
| 99 | 90 | } |
| 100 | 91 | } |
| 92 | + | |
| 93 | +const deleteIds = ref<number[]>([]) // 待删除${subTable.classComment} ID | |
| 94 | +function setDeleteIds({ | |
| 95 | + records, | |
| 96 | +}: { | |
| 97 | + records: ${simpleClassName}Api.${subSimpleClassName}[]; | |
| 98 | +}) { | |
| 99 | + deleteIds.value = records.map((item) => item.id); | |
| 100 | +} | |
| 101 | 101 | #end |
| 102 | 102 | |
| 103 | 103 | /** 表格操作按钮的回调函数 */ |
| ... | ... | @@ -213,7 +213,7 @@ const onRefresh = async ()=> { |
| 213 | 213 | type="primary" |
| 214 | 214 | danger |
| 215 | 215 | class="ml-2" |
| 216 | - :disabled="showDeleteBatchBtn" | |
| 216 | + :disabled="isEmpty(deleteIds)" | |
| 217 | 217 | @click="onDeleteBatch" |
| 218 | 218 | v-access:code="['${table.moduleName}:${simpleClassName_strikeCase}:delete']" |
| 219 | 219 | > | ... | ... |