perf:【INFRA 基础设施】优化一些 todo 提到的问题
This commit is contained in:
parent
064fecf4ee
commit
b9ffa1820d
|
@ -53,4 +53,14 @@ public abstract class BaseDO implements Serializable, TransPojo {
|
|||
@TableLogic
|
||||
private Boolean deleted;
|
||||
|
||||
/**
|
||||
* 把 creator、createTime、updateTime、updater 都清空,避免前端直接传递 creator 之类的字段,直接就被更新了。
|
||||
*/
|
||||
public void clean(){
|
||||
this.creator = null;
|
||||
this.createTime = null;
|
||||
this.updater = null;
|
||||
this.updateTime = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 基于数据库的表结构,创建代码生成器的表和字段定义 Request VO")
|
||||
|
|
|
@ -3,10 +3,10 @@ package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo;
|
|||
import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column.CodegenColumnSaveReqVO;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table.CodegenTableSaveReqVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 代码生成表和字段的修改 Request VO")
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.column;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 代码生成字段定义创建/修改 Request VO")
|
||||
@Data
|
||||
|
|
|
@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.codegen.vo.table;
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||
|
||||
@Schema(description = "管理后台 - 表定义分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CodegenTablePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "表名称,模糊匹配", example = "yudao")
|
||||
|
|
|
@ -5,10 +5,9 @@ import cn.iocoder.yudao.module.infra.enums.codegen.CodegenSceneEnum;
|
|||
import cn.iocoder.yudao.module.infra.enums.codegen.CodegenTemplateTypeEnum;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.AssertTrue;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 代码生成表定义创建/修改 Response VO")
|
||||
@Data
|
||||
|
|
|
@ -5,7 +5,9 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.config.vo.*;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigPageReqVO;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigRespVO;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigSaveReqVO;
|
||||
import cn.iocoder.yudao.module.infra.convert.config.ConfigConvert;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.config.ConfigDO;
|
||||
import cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants;
|
||||
|
@ -13,13 +15,13 @@ import cn.iocoder.yudao.module.infra.service.config.ConfigService;
|
|||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.config.vo;
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||
|
||||
@Schema(description = "管理后台 - 参数配置分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ConfigPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "数据源名称,模糊匹配", example = "名称")
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package cn.iocoder.yudao.module.infra.controller.admin.config.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 参数配置创建/修改 Request VO")
|
||||
@Data
|
||||
|
|
|
@ -9,12 +9,12 @@ import cn.iocoder.yudao.module.infra.service.db.DataSourceConfigService;
|
|||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package cn.iocoder.yudao.module.infra.controller.admin.db.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 数据源配置创建/修改 Request VO")
|
||||
@Data
|
||||
|
|
|
@ -60,12 +60,12 @@ public class Demo01ContactController {
|
|||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-batch")
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除示例联系人")
|
||||
@PreAuthorize("@ss.hasPermission('infra:demo01-contact:delete')")
|
||||
public CommonResult<Boolean> deleteDemo01Contact(@RequestParam("ids") List<Long> ids) {
|
||||
demo01ContactService.deleteDemo01ContactByIds(ids);
|
||||
public CommonResult<Boolean> deleteDemo0iContactList(@RequestParam("ids") List<Long> ids) {
|
||||
demo01ContactService.deleteDemo0iContactListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.demo.demo01.vo;
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||
|
||||
@Schema(description = "管理后台 - 示例联系人分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class Demo01ContactPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "名字", example = "张三")
|
||||
|
|
|
@ -62,12 +62,12 @@ public class Demo03StudentErpController {
|
|||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-batch")
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除学生")
|
||||
@PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
||||
public CommonResult<Boolean> deleteDemo03Student(@RequestParam("ids") List<Long> ids) {
|
||||
demo03StudentErpService.deleteDemo03StudentByIds(ids);
|
||||
public CommonResult<Boolean> deleteDemo03StudentList(@RequestParam("ids") List<Long> ids) {
|
||||
demo03StudentErpService.deleteDemo03StudentListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
@ -136,12 +136,12 @@ public class Demo03StudentErpController {
|
|||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/demo03-course/delete-batch")
|
||||
@DeleteMapping("/demo03-course/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除学生课程")
|
||||
@PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
||||
public CommonResult<Boolean> deleteDemo03Course(@RequestParam("ids") List<Long> ids) {
|
||||
demo03StudentErpService.deleteDemo03CourseByIds(ids);
|
||||
public CommonResult<Boolean> deleteDemo03CourseList(@RequestParam("ids") List<Long> ids) {
|
||||
demo03StudentErpService.deleteDemo03CourseListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
@ -188,12 +188,12 @@ public class Demo03StudentErpController {
|
|||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/demo03-grade/delete-batch")
|
||||
@DeleteMapping("/demo03-grade/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除学生班级")
|
||||
@PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
||||
public CommonResult<Boolean> deleteDemo03Grade(@RequestParam("ids") List<Long> ids) {
|
||||
demo03StudentErpService.deleteDemo03GradeByIds(ids);
|
||||
public CommonResult<Boolean> deleteDemo03GradeList(@RequestParam("ids") List<Long> ids) {
|
||||
demo03StudentErpService.deleteDemo03GradeListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.erp.vo;
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||
|
||||
@Schema(description = "管理后台 - 学生分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class Demo03StudentErpPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "名字", example = "芋艿")
|
||||
|
|
|
@ -62,12 +62,12 @@ public class Demo03StudentInnerController {
|
|||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-batch")
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除学生")
|
||||
@PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
||||
public CommonResult<Boolean> deleteDemo03Student(@RequestParam("ids") List<Long> ids) {
|
||||
demo03StudentInnerService.deleteDemo03StudentByIds(ids);
|
||||
public CommonResult<Boolean> deleteDemo03StudentList(@RequestParam("ids") List<Long> ids) {
|
||||
demo03StudentInnerService.deleteDemo03StudentListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.inner.vo;
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||
|
||||
@Schema(description = "管理后台 - 学生分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class Demo03StudentInnerPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "名字", example = "芋艿")
|
||||
|
|
|
@ -62,12 +62,12 @@ public class Demo03StudentNormalController {
|
|||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-batch")
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除学生")
|
||||
@PreAuthorize("@ss.hasPermission('infra:demo03-student:delete')")
|
||||
public CommonResult<Boolean> deleteDemo03Student(@RequestParam("ids") List<Long> ids) {
|
||||
demo03StudentNormalService.deleteDemo03StudentByIds(ids);
|
||||
public CommonResult<Boolean> deleteDemo03StudentList(@RequestParam("ids") List<Long> ids) {
|
||||
demo03StudentNormalService.deleteDemo03StudentListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.demo.demo03.normal.vo;
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||
|
||||
@Schema(description = "管理后台 - 学生分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class Demo03StudentNormalPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "名字", example = "芋艿")
|
||||
|
|
|
@ -11,13 +11,12 @@ import cn.iocoder.yudao.module.infra.service.file.FileConfigService;
|
|||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 文件配置")
|
||||
|
|
|
@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config;
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||
|
||||
@Schema(description = "管理后台 - 文件配置分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FileConfigPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "配置名", example = "S3 - 阿里云")
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "管理后台 - 文件配置创建/修改 Request VO")
|
||||
|
|
|
@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.file.vo.file;
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||
|
||||
@Schema(description = "管理后台 - 文件分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class FilePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "文件路径,模糊匹配", example = "yudao")
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
package cn.iocoder.yudao.module.infra.controller.admin.file.vo.file;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "管理后台 - 上传文件 Request VO")
|
||||
@Data
|
||||
public class FileUploadReqVO {
|
||||
|
|
|
@ -71,10 +71,10 @@ public class JobController {
|
|||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除定时任务")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('infra:job:delete')")
|
||||
@PreAuthorize("@ss.hasPermission('infra:job:delete')")
|
||||
public CommonResult<Boolean> deleteJob(@RequestParam("id") Long id)
|
||||
throws SchedulerException {
|
||||
jobService.deleteJob(id);
|
||||
|
|
|
@ -3,13 +3,9 @@ package cn.iocoder.yudao.module.infra.controller.admin.job.vo.job;
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - 定时任务分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class JobPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "任务名称,模糊匹配", example = "测试任务")
|
||||
|
|
|
@ -6,9 +6,9 @@ import cn.iocoder.yudao.module.infra.enums.DictTypeConstants;
|
|||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 定时任务 Response VO")
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
package cn.iocoder.yudao.module.infra.controller.admin.job.vo.job;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 定时任务创建/修改 Request VO")
|
||||
@Data
|
||||
|
|
|
@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.job.vo.log;
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||
|
||||
@Schema(description = "管理后台 - 定时任务日志分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class JobLogPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "任务编号", example = "10")
|
||||
|
|
|
@ -12,15 +12,15 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiAccessLogDO;
|
|||
import cn.iocoder.yudao.module.infra.service.logger.ApiAccessLogService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -14,13 +14,13 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -63,7 +63,7 @@ public class ApiErrorLogController {
|
|||
@PreAuthorize("@ss.hasPermission('infra:api-error-log:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportApiErrorLogExcel(@Valid ApiErrorLogPageReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
HttpServletResponse response) throws IOException {
|
||||
exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ApiErrorLogDO> list = apiErrorLogService.getApiErrorLogPage(exportReqVO).getList();
|
||||
// 导出 Excel
|
||||
|
|
|
@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apiaccesslog;
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||
|
||||
@Schema(description = "管理后台 - API 访问日志分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ApiAccessLogPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "用户编号", example = "666")
|
||||
|
|
|
@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog;
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
@ -13,8 +11,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||
|
||||
@Schema(description = "管理后台 - API 错误日志分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ApiErrorLogPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "用户编号", example = "666")
|
||||
|
|
|
@ -5,6 +5,7 @@ import cn.iocoder.yudao.module.infra.controller.admin.redis.vo.RedisMonitorRespV
|
|||
import cn.iocoder.yudao.module.infra.convert.redis.RedisConvert;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.data.redis.connection.RedisServerCommands;
|
||||
import org.springframework.data.redis.core.RedisCallback;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
|
@ -13,7 +14,6 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.Properties;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
package cn.iocoder.yudao.module.infra.controller.app.file.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "用户 App - 上传文件 Request VO")
|
||||
@Data
|
||||
public class AppFileUploadReqVO {
|
||||
|
|
|
@ -79,7 +79,8 @@ public class FileConfigDO extends BaseDO {
|
|||
|
||||
@Override
|
||||
public Object parse(String json) {
|
||||
FileClientConfig config = JsonUtils.parseObjectQuietly(json, new TypeReference<>() {});
|
||||
FileClientConfig config = JsonUtils.parseObjectQuietly(json, new TypeReference<>() {
|
||||
});
|
||||
if (config != null) {
|
||||
return config;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public interface JobLogMapper extends BaseMapperX<JobLogDO> {
|
|||
* 物理删除指定时间之前的日志
|
||||
*
|
||||
* @param createTime 最大时间
|
||||
* @param limit 删除条数,防止一次删除太多
|
||||
* @param limit 删除条数,防止一次删除太多
|
||||
* @return 删除条数
|
||||
*/
|
||||
@Delete("DELETE FROM infra_job_log WHERE create_time < #{createTime} LIMIT #{limit}")
|
||||
|
|
|
@ -36,7 +36,7 @@ public interface ApiAccessLogMapper extends BaseMapperX<ApiAccessLogDO> {
|
|||
* 物理删除指定时间之前的日志
|
||||
*
|
||||
* @param createTime 最大时间
|
||||
* @param limit 删除条数,防止一次删除太多
|
||||
* @param limit 删除条数,防止一次删除太多
|
||||
* @return 删除条数
|
||||
*/
|
||||
@Delete("DELETE FROM infra_api_access_log WHERE create_time < #{createTime} LIMIT #{limit}")
|
||||
|
|
|
@ -35,10 +35,10 @@ public interface ApiErrorLogMapper extends BaseMapperX<ApiErrorLogDO> {
|
|||
* 物理删除指定时间之前的日志
|
||||
*
|
||||
* @param createTime 最大时间
|
||||
* @param limit 删除条数,防止一次删除太多
|
||||
* @param limit 删除条数,防止一次删除太多
|
||||
* @return 删除条数
|
||||
*/
|
||||
@Delete("DELETE FROM infra_api_error_log WHERE create_time < #{createTime} LIMIT #{limit}")
|
||||
Integer deleteByCreateTimeLt(@Param("createTime") LocalDateTime createTime, @Param("limit")Integer limit);
|
||||
Integer deleteByCreateTimeLt(@Param("createTime") LocalDateTime createTime, @Param("limit") Integer limit);
|
||||
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ public interface CodegenService {
|
|||
* 基于数据库的表结构,创建代码生成器的表定义
|
||||
*
|
||||
* @param author 作者
|
||||
* @param reqVO 表信息
|
||||
* @param reqVO 表信息
|
||||
* @return 创建的表定义的编号数组
|
||||
*/
|
||||
List<Long> createCodegenList(String author, CodegenCreateListReqVO reqVO);
|
||||
|
@ -92,8 +92,8 @@ public interface CodegenService {
|
|||
* 获得数据库自带的表定义列表
|
||||
*
|
||||
* @param dataSourceConfigId 数据源的配置编号
|
||||
* @param name 表名称
|
||||
* @param comment 表描述
|
||||
* @param name 表名称
|
||||
* @param comment 表描述
|
||||
* @return 表定义列表
|
||||
*/
|
||||
List<DatabaseTableRespVO> getDatabaseTableList(Long dataSourceConfigId, String name, String comment);
|
||||
|
|
|
@ -214,7 +214,6 @@ public class CodegenBuilder {
|
|||
// description、memo、remark
|
||||
if (StrUtil.endWithAnyIgnoreCase(column.getColumnName(), "description", "memo", "remark")) {
|
||||
column.setExample(randomEle(new String[]{"你猜", "随便", "你说的对"}));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -221,7 +221,7 @@ public class CodegenEngine {
|
|||
this.templateEngine = new VelocityEngine(config);
|
||||
// 设置 javaxEnable,按照是否使用 JDK17 来判断
|
||||
this.jakartaEnable = SystemUtil.getJavaInfo().isJavaVersionAtLeast(1700) // 17.00 * 100
|
||||
&& ClassUtils.isPresent("jakarta.annotation.Resource", ClassUtils.getDefaultClassLoader());
|
||||
&& ClassUtils.isPresent("jakarta.annotation.Resource", ClassUtils.getDefaultClassLoader());
|
||||
// 设置 cloudEnable,按照是否使用 Spring Cloud 来判断
|
||||
this.cloudEnable = ClassUtils.isPresent("cn.iocoder.yudao.module.infra.framework.rpc.config.RpcConfiguration",
|
||||
ClassUtils.getDefaultClassLoader());
|
||||
|
@ -264,9 +264,9 @@ public class CodegenEngine {
|
|||
/**
|
||||
* 生成代码
|
||||
*
|
||||
* @param table 表定义
|
||||
* @param columns table 的字段定义数组
|
||||
* @param subTables 子表数组,当且仅当主子表时使用
|
||||
* @param table 表定义
|
||||
* @param columns table 的字段定义数组
|
||||
* @param subTables 子表数组,当且仅当主子表时使用
|
||||
* @param subColumnsList subTables 的字段定义数组
|
||||
* @return 生成的代码,key 是路径,value 是对应代码
|
||||
*/
|
||||
|
|
|
@ -4,7 +4,6 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|||
import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigPageReqVO;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.config.vo.ConfigSaveReqVO;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.config.ConfigDO;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,12 +8,11 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.config.ConfigDO;
|
|||
import cn.iocoder.yudao.module.infra.dal.mysql.config.ConfigMapper;
|
||||
import cn.iocoder.yudao.module.infra.enums.config.ConfigTypeEnum;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.*;
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.infra.service.db;
|
|||
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.db.vo.DataSourceConfigSaveReqVO;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.db.DataSourceConfigDO;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,10 +7,10 @@ import cn.iocoder.yudao.module.infra.dal.dataobject.db.DataSourceConfigDO;
|
|||
import cn.iocoder.yudao.module.infra.dal.mysql.db.DataSourceConfigMapper;
|
||||
import com.baomidou.dynamic.datasource.creator.DataSourceProperty;
|
||||
import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@ public interface DatabaseTableService {
|
|||
* 获得表列表,基于表名称 + 表描述进行模糊匹配
|
||||
*
|
||||
* @param dataSourceConfigId 数据源配置的编号
|
||||
* @param nameLike 表名称,模糊匹配
|
||||
* @param commentLike 表描述,模糊匹配
|
||||
* @param nameLike 表名称,模糊匹配
|
||||
* @param commentLike 表描述,模糊匹配
|
||||
* @return 表列表
|
||||
*/
|
||||
List<TableInfo> getTableList(Long dataSourceConfigId, String nameLike, String commentLike);
|
||||
|
@ -25,7 +25,7 @@ public interface DatabaseTableService {
|
|||
* 获得指定表名
|
||||
*
|
||||
* @param dataSourceConfigId 数据源配置的编号
|
||||
* @param tableName 表名称
|
||||
* @param tableName 表名称
|
||||
* @return 表
|
||||
*/
|
||||
TableInfo getTable(Long dataSourceConfigId, String tableName);
|
||||
|
|
|
@ -42,7 +42,7 @@ public interface Demo01ContactService {
|
|||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteDemo01ContactByIds(List<Long> ids);
|
||||
void deleteDemo0iContactListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得示例联系人
|
||||
|
|
|
@ -55,7 +55,7 @@ public class Demo01ContactServiceImpl implements Demo01ContactService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void deleteDemo01ContactByIds(List<Long> ids) {
|
||||
public void deleteDemo0iContactListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateDemo01ContactExists(ids);
|
||||
// 删除
|
||||
|
|
|
@ -45,7 +45,7 @@ public interface Demo03StudentErpService {
|
|||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteDemo03StudentByIds(List<Long> ids);
|
||||
void deleteDemo03StudentListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得学生
|
||||
|
@ -101,7 +101,7 @@ public interface Demo03StudentErpService {
|
|||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteDemo03CourseByIds(List<Long> ids);
|
||||
void deleteDemo03CourseListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得学生课程
|
||||
|
@ -149,7 +149,7 @@ public interface Demo03StudentErpService {
|
|||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteDemo03GradeByIds(List<Long> ids);
|
||||
void deleteDemo03GradeListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得学生班级
|
||||
|
|
|
@ -71,7 +71,7 @@ public class Demo03StudentErpServiceImpl implements Demo03StudentErpService {
|
|||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteDemo03StudentByIds(List<Long> ids) {
|
||||
public void deleteDemo03StudentListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateDemo03StudentExists(ids);
|
||||
// 删除
|
||||
|
@ -123,7 +123,7 @@ public class Demo03StudentErpServiceImpl implements Demo03StudentErpService {
|
|||
// 校验存在
|
||||
validateDemo03CourseExists(demo03Course.getId());
|
||||
// 更新
|
||||
demo03Course.setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新
|
||||
demo03Course.clean();
|
||||
demo03CourseErpMapper.updateById(demo03Course);
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ public class Demo03StudentErpServiceImpl implements Demo03StudentErpService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void deleteDemo03CourseByIds(List<Long> ids) {
|
||||
public void deleteDemo03CourseListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateDemo03CourseExists(ids);
|
||||
// 删除
|
||||
|
@ -192,7 +192,7 @@ public class Demo03StudentErpServiceImpl implements Demo03StudentErpService {
|
|||
// 校验存在
|
||||
validateDemo03GradeExists(demo03Grade.getId());
|
||||
// 更新
|
||||
demo03Grade.setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新
|
||||
demo03Grade.clean();
|
||||
demo03GradeErpMapper.updateById(demo03Grade);
|
||||
}
|
||||
|
||||
|
@ -205,7 +205,7 @@ public class Demo03StudentErpServiceImpl implements Demo03StudentErpService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void deleteDemo03GradeByIds(List<Long> ids) {
|
||||
public void deleteDemo03GradeListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateDemo03GradeExists(ids);
|
||||
// 删除
|
||||
|
|
|
@ -44,7 +44,7 @@ public interface Demo03StudentInnerService {
|
|||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteDemo03StudentByIds(List<Long> ids);
|
||||
void deleteDemo03StudentListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得学生
|
||||
|
|
|
@ -83,7 +83,7 @@ public class Demo03StudentInnerServiceImpl implements Demo03StudentInnerService
|
|||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteDemo03StudentByIds(List<Long> ids) {
|
||||
public void deleteDemo03StudentListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateDemo03StudentExists(ids);
|
||||
// 删除
|
||||
|
@ -125,17 +125,17 @@ public class Demo03StudentInnerServiceImpl implements Demo03StudentInnerService
|
|||
}
|
||||
|
||||
private void createDemo03CourseList(Long studentId, List<Demo03CourseDO> list) {
|
||||
list.forEach(o -> o.setStudentId(studentId));
|
||||
list.forEach(o -> o.setStudentId(studentId).clean());
|
||||
demo03CourseInnerMapper.insertBatch(list);
|
||||
}
|
||||
|
||||
private void updateDemo03CourseList(Long studentId, List<Demo03CourseDO> list) {
|
||||
list.forEach(o -> o.setStudentId(studentId));
|
||||
list.forEach(o -> o.setStudentId(studentId).clean());
|
||||
List<Demo03CourseDO> oldList = demo03CourseInnerMapper.selectListByStudentId(studentId);
|
||||
List<List<Demo03CourseDO>> diffList = diffList(oldList, list, (oldVal, newVal) -> {
|
||||
boolean same = ObjectUtil.equal(oldVal.getId(), newVal.getId());
|
||||
if (same) {
|
||||
newVal.setId(oldVal.getId()).setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新
|
||||
newVal.setId(oldVal.getId());
|
||||
}
|
||||
return same;
|
||||
});
|
||||
|
@ -179,8 +179,7 @@ public class Demo03StudentInnerServiceImpl implements Demo03StudentInnerService
|
|||
if (demo03Grade == null) {
|
||||
return;
|
||||
}
|
||||
demo03Grade.setStudentId(studentId);
|
||||
demo03Grade.setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新
|
||||
demo03Grade.setStudentId(studentId).clean();
|
||||
demo03GradeInnerMapper.insertOrUpdate(demo03Grade);
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ public interface Demo03StudentNormalService {
|
|||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteDemo03StudentByIds(List<Long> ids);
|
||||
void deleteDemo03StudentListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得学生
|
||||
|
|
|
@ -83,7 +83,7 @@ public class Demo03StudentNormalServiceImpl implements Demo03StudentNormalServic
|
|||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteDemo03StudentByIds(List<Long> ids) {
|
||||
public void deleteDemo03StudentListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateDemo03StudentExists(ids);
|
||||
// 删除
|
||||
|
@ -125,17 +125,17 @@ public class Demo03StudentNormalServiceImpl implements Demo03StudentNormalServic
|
|||
}
|
||||
|
||||
private void createDemo03CourseList(Long studentId, List<Demo03CourseDO> list) {
|
||||
list.forEach(o -> o.setStudentId(studentId));
|
||||
list.forEach(o -> o.setStudentId(studentId).clean());
|
||||
demo03CourseNormalMapper.insertBatch(list);
|
||||
}
|
||||
|
||||
private void updateDemo03CourseList(Long studentId, List<Demo03CourseDO> list) {
|
||||
list.forEach(o -> o.setStudentId(studentId));
|
||||
list.forEach(o -> o.setStudentId(studentId).clean());
|
||||
List<Demo03CourseDO> oldList = demo03CourseNormalMapper.selectListByStudentId(studentId);
|
||||
List<List<Demo03CourseDO>> diffList = diffList(oldList, list, (oldVal, newVal) -> {
|
||||
boolean same = ObjectUtil.equal(oldVal.getId(), newVal.getId());
|
||||
if (same) {
|
||||
newVal.setId(oldVal.getId()).setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新
|
||||
newVal.setId(oldVal.getId());
|
||||
}
|
||||
return same;
|
||||
});
|
||||
|
@ -179,8 +179,7 @@ public class Demo03StudentNormalServiceImpl implements Demo03StudentNormalServic
|
|||
if (demo03Grade == null) {
|
||||
return;
|
||||
}
|
||||
demo03Grade.setStudentId(studentId);
|
||||
demo03Grade.setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新
|
||||
demo03Grade.setStudentId(studentId).clean();
|
||||
demo03GradeNormalMapper.insertOrUpdate(demo03Grade);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
package cn.iocoder.yudao.module.infra.service.file;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigPageReqVO;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigSaveReqVO;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileConfigDO;
|
||||
|
||||
import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,25 +5,25 @@ import cn.hutool.core.util.IdUtil;
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
|
||||
import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient;
|
||||
import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientConfig;
|
||||
import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientFactory;
|
||||
import cn.iocoder.yudao.module.infra.framework.file.core.enums.FileStorageEnum;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigPageReqVO;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigSaveReqVO;
|
||||
import cn.iocoder.yudao.module.infra.convert.file.FileConfigConvert;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileConfigDO;
|
||||
import cn.iocoder.yudao.module.infra.dal.mysql.file.FileConfigMapper;
|
||||
import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient;
|
||||
import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientConfig;
|
||||
import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientFactory;
|
||||
import cn.iocoder.yudao.module.infra.framework.file.core.enums.FileStorageEnum;
|
||||
import com.google.common.cache.CacheLoader;
|
||||
import com.google.common.cache.LoadingCache;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Validator;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Validator;
|
||||
import java.time.Duration;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
@ -137,7 +137,7 @@ public class FileConfigServiceImpl implements FileConfigService {
|
|||
/**
|
||||
* 清空指定文件配置
|
||||
*
|
||||
* @param id 配置编号
|
||||
* @param id 配置编号
|
||||
* @param master 是否主配置
|
||||
*/
|
||||
private void clearCache(Long id, Boolean master) {
|
||||
|
|
|
@ -25,10 +25,10 @@ public interface FileService {
|
|||
/**
|
||||
* 保存文件,并返回文件的访问路径
|
||||
*
|
||||
* @param content 文件内容
|
||||
* @param name 文件名称,允许空
|
||||
* @param content 文件内容
|
||||
* @param name 文件名称,允许空
|
||||
* @param directory 目录,允许空
|
||||
* @param type 文件的 MIME 类型,允许空
|
||||
* @param type 文件的 MIME 类型,允许空
|
||||
* @return 文件路径
|
||||
*/
|
||||
String createFile(@NotEmpty(message = "文件内容不能为空") byte[] content,
|
||||
|
@ -37,7 +37,7 @@ public interface FileService {
|
|||
/**
|
||||
* 生成文件预签名地址信息
|
||||
*
|
||||
* @param name 文件名
|
||||
* @param name 文件名
|
||||
* @param directory 目录
|
||||
* @return 预签名地址信息
|
||||
*/
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface JobLogService extends JobLogFrameworkService {
|
|||
/**
|
||||
* 清理 exceedDay 天前的任务日志
|
||||
*
|
||||
* @param exceedDay 超过多少天就进行清理
|
||||
* @param exceedDay 超过多少天就进行清理
|
||||
* @param deleteLimit 清理的间隔条数
|
||||
*/
|
||||
Integer cleanJobLog(Integer exceedDay, Integer deleteLimit);
|
||||
|
|
|
@ -5,12 +5,12 @@ import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.JobLogPageReqVO
|
|||
import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobLogDO;
|
||||
import cn.iocoder.yudao.module.infra.dal.mysql.job.JobLogMapper;
|
||||
import cn.iocoder.yudao.module.infra.enums.job.JobLogStatusEnum;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,9 +4,8 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|||
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.JobPageReqVO;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.job.vo.job.JobSaveReqVO;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobDO;
|
||||
import org.quartz.SchedulerException;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
import org.quartz.SchedulerException;
|
||||
|
||||
/**
|
||||
* 定时任务 Service 接口
|
||||
|
@ -33,7 +32,7 @@ public interface JobService {
|
|||
/**
|
||||
* 更新定时任务的状态
|
||||
*
|
||||
* @param id 任务编号
|
||||
* @param id 任务编号
|
||||
* @param status 状态
|
||||
*/
|
||||
void updateJobStatus(Long id, Integer status) throws SchedulerException;
|
||||
|
|
|
@ -190,7 +190,7 @@ public class JobServiceImpl implements JobService {
|
|||
|
||||
@Override
|
||||
public PageResult<JobDO> getJobPage(JobPageReqVO pageReqVO) {
|
||||
return jobMapper.selectPage(pageReqVO);
|
||||
return jobMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
private static void fillJobMonitorTimeoutEmpty(JobDO job) {
|
||||
|
|
|
@ -30,7 +30,7 @@ public interface ApiAccessLogService {
|
|||
/**
|
||||
* 清理 exceedDay 天前的访问日志
|
||||
*
|
||||
* @param exceedDay 超过多少天就进行清理
|
||||
* @param exceedDay 超过多少天就进行清理
|
||||
* @param deleteLimit 清理的间隔条数
|
||||
*/
|
||||
Integer cleanAccessLog(Integer exceedDay, Integer deleteLimit);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.iocoder.yudao.module.infra.service.logger;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.biz.infra.logger.dto.ApiErrorLogCreateReqDTO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogPageReqVO;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiErrorLogDO;
|
||||
|
||||
|
@ -30,7 +30,7 @@ public interface ApiErrorLogService {
|
|||
/**
|
||||
* 更新 API 错误日志已处理
|
||||
*
|
||||
* @param id API 日志编号
|
||||
* @param id API 日志编号
|
||||
* @param processStatus 处理结果
|
||||
* @param processUserId 处理人
|
||||
*/
|
||||
|
@ -39,7 +39,7 @@ public interface ApiErrorLogService {
|
|||
/**
|
||||
* 清理 exceedDay 天前的错误日志
|
||||
*
|
||||
* @param exceedDay 超过多少天就进行清理
|
||||
* @param exceedDay 超过多少天就进行清理
|
||||
* @param deleteLimit 清理的间隔条数
|
||||
*/
|
||||
Integer cleanErrorLog(Integer exceedDay, Integer deleteLimit);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package cn.iocoder.yudao.module.infra.service.logger;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.biz.infra.logger.dto.ApiErrorLogCreateReqDTO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.string.StrUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
|
||||
import cn.iocoder.yudao.framework.common.biz.infra.logger.dto.ApiErrorLogCreateReqDTO;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.logger.vo.apierrorlog.ApiErrorLogPageReqVO;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.logger.ApiErrorLogDO;
|
||||
import cn.iocoder.yudao.module.infra.dal.mysql.logger.ApiErrorLogMapper;
|
||||
|
|
|
@ -75,14 +75,14 @@ public class ${sceneEnum.prefixClass}${table.className}Controller {
|
|||
}
|
||||
|
||||
#if ( $table.templateType != 2 && $deleteBatchEnable)
|
||||
@DeleteMapping("/delete-batch")
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除${table.classComment}")
|
||||
#if ($sceneEnum.scene == 1)
|
||||
@PreAuthorize("@ss.hasPermission('${permissionPrefix}:delete')")
|
||||
#end
|
||||
public CommonResult<Boolean> delete${simpleClassName}(@RequestParam("ids") List<${primaryColumn.javaType}> ids) {
|
||||
${classNameVar}Service.delete${simpleClassName}ByIds(ids);
|
||||
public CommonResult<Boolean> delete${simpleClassName}List(@RequestParam("ids") List<${primaryColumn.javaType}> ids) {
|
||||
${classNameVar}Service.delete${simpleClassName}ListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
#end
|
||||
|
@ -244,14 +244,14 @@ public class ${sceneEnum.prefixClass}${table.className}Controller {
|
|||
}
|
||||
|
||||
#if ($deleteBatchEnable)
|
||||
@DeleteMapping("/${subSimpleClassName_strikeCase}/delete-batch")
|
||||
@DeleteMapping("/${subSimpleClassName_strikeCase}/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除${subTable.classComment}")
|
||||
#if ($sceneEnum.scene == 1)
|
||||
@PreAuthorize("@ss.hasPermission('${permissionPrefix}:delete')")
|
||||
#end
|
||||
public CommonResult<Boolean> delete${subSimpleClassName}(@RequestParam("ids") List<${subPrimaryColumn.javaType}> ids) {
|
||||
${classNameVar}Service.delete${subSimpleClassName}ByIds(ids);
|
||||
public CommonResult<Boolean> delete${subSimpleClassName}List(@RequestParam("ids") List<${subPrimaryColumn.javaType}> ids) {
|
||||
${classNameVar}Service.delete${subSimpleClassName}ListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
#end
|
||||
|
|
|
@ -28,8 +28,6 @@ import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
|||
|
||||
@Schema(description = "${sceneEnum.name} - ${table.classComment}分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ${sceneEnum.prefixClass}${table.className}PageReqVO extends PageParam {
|
||||
|
||||
#foreach ($column in $columns)
|
||||
|
|
|
@ -77,17 +77,23 @@ public class ${table.className}DO extends BaseDO {
|
|||
private ${column.javaType} ${column.javaField};
|
||||
#end
|
||||
#end
|
||||
|
||||
## 特殊:主子表专属逻辑(非 ERP 模式)
|
||||
#if ( $voType == 20 && $subTables && $subTables.size() > 0 && $table.templateType != 11 )
|
||||
#foreach ($subTable in $subTables)
|
||||
#set ($index = $foreach.count - 1)
|
||||
#if ( $subTable.subJoinMany)
|
||||
/**
|
||||
* ${subTable.classComment}列表
|
||||
*/
|
||||
@Schema(description = "${subTable.classComment}列表")
|
||||
@TableField(exist = false)
|
||||
private List<${subTable.className}DO> ${subClassNameVars.get($index)}s;
|
||||
|
||||
#else
|
||||
/**
|
||||
* ${subTable.classComment}
|
||||
*/
|
||||
@Schema(description = "${subTable.classComment}")
|
||||
@TableField(exist = false)
|
||||
private ${subTable.className}DO ${subClassNameVars.get($index)};
|
||||
#end
|
||||
#end
|
||||
|
|
|
@ -46,7 +46,7 @@ public interface ${table.className}Service {
|
|||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void delete${simpleClassName}ByIds(List<${primaryColumn.javaType}> ids);
|
||||
void delete${simpleClassName}ListByIds(List<${primaryColumn.javaType}> ids);
|
||||
#end
|
||||
|
||||
/**
|
||||
|
@ -149,7 +149,7 @@ public interface ${table.className}Service {
|
|||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void delete${subSimpleClassName}ByIds(List<${subPrimaryColumn.javaType}> ids);
|
||||
void delete${subSimpleClassName}ListByIds(List<${subPrimaryColumn.javaType}> ids);
|
||||
#end
|
||||
|
||||
/**
|
||||
|
|
|
@ -169,7 +169,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
|
|||
#if ( $subTables && $subTables.size() > 0)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
#end
|
||||
public void delete${simpleClassName}ByIds(List<${primaryColumn.javaType}> ids) {
|
||||
public void delete${simpleClassName}ListByIds(List<${primaryColumn.javaType}> ids) {
|
||||
// 校验存在
|
||||
validate${simpleClassName}Exists(ids);
|
||||
// 删除
|
||||
|
@ -328,7 +328,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
|
|||
// 校验存在
|
||||
validate${subSimpleClassName}Exists(${subClassNameVar}.getId());
|
||||
// 更新
|
||||
${subClassNameVar}.setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新
|
||||
${subClassNameVar}.clean(); // 解决更新情况下:updateTime 不更新
|
||||
${subClassNameVars.get($index)}Mapper.updateById(${subClassNameVar});
|
||||
}
|
||||
|
||||
|
@ -342,7 +342,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
|
|||
|
||||
#if ($deleteBatchEnable)
|
||||
@Override
|
||||
public void delete${subSimpleClassName}ByIds(List<${subPrimaryColumn.javaType}> ids) {
|
||||
public void delete${subSimpleClassName}ListByIds(List<${subPrimaryColumn.javaType}> ids) {
|
||||
// 校验存在
|
||||
validate${subSimpleClassName}Exists(ids);
|
||||
// 删除
|
||||
|
@ -374,17 +374,17 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
|
|||
#else
|
||||
#if ( $subTable.subJoinMany)
|
||||
private void create${subSimpleClassName}List(${primaryColumn.javaType} ${subJoinColumn.javaField}, List<${subTable.className}DO> list) {
|
||||
list.forEach(o -> o.set${SubJoinColumnName}(${subJoinColumn.javaField}));
|
||||
list.forEach(o -> o.set${SubJoinColumnName}(${subJoinColumn.javaField}).clean());
|
||||
${subClassNameVars.get($index)}Mapper.insertBatch(list);
|
||||
}
|
||||
|
||||
private void update${subSimpleClassName}List(${primaryColumn.javaType} ${subJoinColumn.javaField}, List<${subTable.className}DO> list) {
|
||||
list.forEach(o -> o.set${SubJoinColumnName}(${subJoinColumn.javaField}));
|
||||
list.forEach(o -> o.set${SubJoinColumnName}(${subJoinColumn.javaField}).clean());
|
||||
List<${subTable.className}DO> oldList = ${subClassNameVar}Mapper.selectListBy${SubJoinColumnName}(${subJoinColumn.javaField});
|
||||
List<List<${subTable.className}DO>> diffList = diffList(oldList, list, (oldVal, newVal) -> {
|
||||
boolean same = ObjectUtil.equal(oldVal.getId(), newVal.getId());
|
||||
if (same) {
|
||||
newVal.setId(oldVal.getId()).setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新
|
||||
newVal.setId(oldVal.getId()).clean(); // 解决更新情况下:updateTime 不更新
|
||||
}
|
||||
return same;
|
||||
});
|
||||
|
@ -414,8 +414,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
|
|||
if (${subClassNameVar} == null) {
|
||||
return;
|
||||
}
|
||||
${subClassNameVar}.set$SubJoinColumnName(${subJoinColumn.javaField});
|
||||
${subClassNameVar}.setUpdater(null).setUpdateTime(null); // 解决更新情况下:updateTime 不更新
|
||||
${subClassNameVar}.set$SubJoinColumnName(${subJoinColumn.javaField}).clean();// 解决更新情况下:updateTime 不更新
|
||||
${subClassNameVars.get($index)}Mapper.insertOrUpdate(${subClassNameVar});
|
||||
}
|
||||
|
||||
|
|
|
@ -90,9 +90,9 @@ export function delete${simpleClassName}(id: number) {
|
|||
}
|
||||
|
||||
#if ( $table.templateType != 2 && $deleteBatchEnable)
|
||||
// 批量删除${table.classComment}
|
||||
export function delete${simpleClassName}ByIds(ids: number[]) {
|
||||
return requestClient.delete(`${baseURL}/delete-batch?ids=${ids.join(',')}`)
|
||||
/** 批量删除${table.classComment} */
|
||||
export function delete${simpleClassName}ListByIds(ids: number[]) {
|
||||
return requestClient.delete(`${baseURL}/delete-list?ids=${ids.join(',')}`)
|
||||
}
|
||||
#end
|
||||
|
||||
|
@ -152,9 +152,9 @@ export function delete${subSimpleClassName}(id: number) {
|
|||
}
|
||||
|
||||
#if ($deleteBatchEnable)
|
||||
// 批量删除${subTable.classComment}
|
||||
export function delete${subSimpleClassName}ByIds(ids: number[]) {
|
||||
return requestClient.delete(`${baseURL}/${subSimpleClassName_strikeCase}/delete-batch?ids=${ids.join(',')}`)
|
||||
/** 批量删除${subTable.classComment} */
|
||||
export function delete${subSimpleClassName}ListByIds(ids: number[]) {
|
||||
return requestClient.delete(`${baseURL}/${subSimpleClassName_strikeCase}/delete-list?ids=${ids.join(',')}`)
|
||||
}
|
||||
#end
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
|||
#if (${table.templateType} == 2)## 树表接口
|
||||
import { get${simpleClassName}List, delete${simpleClassName}, export${simpleClassName} } from '#/api/${table.moduleName}/${table.businessName}';
|
||||
#else## 标准表接口
|
||||
import { get${simpleClassName}Page, delete${simpleClassName},#if ($deleteBatchEnable) delete${simpleClassName}ByIds,#end export${simpleClassName} } from '#/api/${table.moduleName}/${table.businessName}';
|
||||
import { get${simpleClassName}Page, delete${simpleClassName},#if ($deleteBatchEnable) delete${simpleClassName}ListByIds,#end export${simpleClassName} } from '#/api/${table.moduleName}/${table.businessName}';
|
||||
#end
|
||||
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
|
||||
|
||||
|
@ -93,15 +93,6 @@ async function onDelete(row: ${simpleClassName}Api.${simpleClassName}) {
|
|||
}
|
||||
|
||||
#if ($table.templateType != 2 && $deleteBatchEnable)
|
||||
const deleteIds = ref<number[]>([]) // 待删除${table.classComment} ID
|
||||
const showDeleteBatchBtn = computed(() => isEmpty(deleteIds.value));
|
||||
function setDeleteIds({
|
||||
records,
|
||||
}: {
|
||||
records: ${simpleClassName}Api.${simpleClassName}[];
|
||||
}) {
|
||||
deleteIds.value = records.map((item) => item.id);
|
||||
}
|
||||
/** 批量删除${table.classComment} */
|
||||
async function onDeleteBatch() {
|
||||
const hideLoading = message.loading({
|
||||
|
@ -110,13 +101,22 @@ async function onDeleteBatch() {
|
|||
key: 'action_process_msg',
|
||||
});
|
||||
try {
|
||||
await delete${simpleClassName}ByIds(deleteIds.value);
|
||||
await delete${simpleClassName}ListByIds(deleteIds.value);
|
||||
message.success( $t('ui.actionMessage.deleteSuccess') );
|
||||
onRefresh();
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
const deleteIds = ref<number[]>([]) // 待删除${table.classComment} ID
|
||||
function setDeleteIds({
|
||||
records,
|
||||
}: {
|
||||
records: ${simpleClassName}Api.${simpleClassName}[];
|
||||
}) {
|
||||
deleteIds.value = records.map((item) => item.id);
|
||||
}
|
||||
#end
|
||||
|
||||
/** 导出表格 */
|
||||
|
@ -268,7 +268,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||
type="primary"
|
||||
danger
|
||||
class="ml-2"
|
||||
:disabled="showDeleteBatchBtn"
|
||||
:disabled="isEmpty(deleteIds)"
|
||||
@click="onDeleteBatch"
|
||||
v-access:code="['${table.moduleName}:${simpleClassName_strikeCase}:delete']"
|
||||
>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
|
||||
#if ($table.templateType == 11) ## erp
|
||||
import { delete${subSimpleClassName},#if ($deleteBatchEnable) delete${subSimpleClassName}ByIds,#end get${subSimpleClassName}Page } from '#/api/${table.moduleName}/${table.businessName}';
|
||||
import { delete${subSimpleClassName},#if ($deleteBatchEnable) delete${subSimpleClassName}ListByIds,#end get${subSimpleClassName}Page } from '#/api/${table.moduleName}/${table.businessName}';
|
||||
import { use${subSimpleClassName}GridFormSchema, use${subSimpleClassName}GridColumns } from '../data';
|
||||
import { isEmpty } from '@vben/utils';
|
||||
#else
|
||||
|
@ -74,15 +74,6 @@ async function onDelete(row: ${simpleClassName}Api.${subSimpleClassName}) {
|
|||
}
|
||||
|
||||
#if ($deleteBatchEnable)
|
||||
const deleteIds = ref<number[]>([]) // 待删除${subTable.classComment} ID
|
||||
const showDeleteBatchBtn = computed(() => isEmpty(deleteIds.value));
|
||||
function setDeleteIds({
|
||||
records,
|
||||
}: {
|
||||
records: ${simpleClassName}Api.${subSimpleClassName}[];
|
||||
}) {
|
||||
deleteIds.value = records.map((item) => item.id);
|
||||
}
|
||||
/** 批量删除${subTable.classComment} */
|
||||
async function onDeleteBatch() {
|
||||
const hideLoading = message.loading({
|
||||
|
@ -91,13 +82,22 @@ async function onDeleteBatch() {
|
|||
key: 'action_process_msg',
|
||||
});
|
||||
try {
|
||||
await delete${subSimpleClassName}ByIds(deleteIds.value);
|
||||
await delete${subSimpleClassName}ListByIds(deleteIds.value);
|
||||
message.success( $t('ui.actionMessage.deleteSuccess') );
|
||||
onRefresh();
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
const deleteIds = ref<number[]>([]) // 待删除${subTable.classComment} ID
|
||||
function setDeleteIds({
|
||||
records,
|
||||
}: {
|
||||
records: ${simpleClassName}Api.${subSimpleClassName}[];
|
||||
}) {
|
||||
deleteIds.value = records.map((item) => item.id);
|
||||
}
|
||||
#end
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
|
@ -213,7 +213,7 @@ const onRefresh = async ()=> {
|
|||
type="primary"
|
||||
danger
|
||||
class="ml-2"
|
||||
:disabled="showDeleteBatchBtn"
|
||||
:disabled="isEmpty(deleteIds)"
|
||||
@click="onDeleteBatch"
|
||||
v-access:code="['${table.moduleName}:${simpleClassName_strikeCase}:delete']"
|
||||
>
|
||||
|
|
Loading…
Reference in New Issue