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