diff --git a/auth-api/src/main/java/cn/bunny/services/controller/configuration/EmailTemplateController.java b/auth-api/src/main/java/cn/bunny/services/controller/configuration/EmailTemplateController.java index 4421a9e..a9bf42c 100644 --- a/auth-api/src/main/java/cn/bunny/services/controller/configuration/EmailTemplateController.java +++ b/auth-api/src/main/java/cn/bunny/services/controller/configuration/EmailTemplateController.java @@ -54,9 +54,9 @@ public class EmailTemplateController { @Operation(summary = "添加邮件模板", description = "添加邮件模板") @PermissionTag(permission = "emailTemplate:add") @PostMapping() - public Result saveEmailTemplate(@Validated(ValidationGroups.Add.class) @RequestBody EmailTemplateDto dto) { - emailTemplateService.saveEmailTemplate(dto); - return Result.success(ResultCodeEnum.ADD_SUCCESS); + public Result createEmailTemplate(@Validated(ValidationGroups.Add.class) @RequestBody EmailTemplateDto dto) { + emailTemplateService.createEmailTemplate(dto); + return Result.success(ResultCodeEnum.CREATE_SUCCESS); } @Operation(summary = "更新邮件模板", description = "更新邮件模板") diff --git a/auth-api/src/main/java/cn/bunny/services/controller/configuration/EmailUsersController.java b/auth-api/src/main/java/cn/bunny/services/controller/configuration/EmailUsersController.java index 38d2e6b..d639527 100644 --- a/auth-api/src/main/java/cn/bunny/services/controller/configuration/EmailUsersController.java +++ b/auth-api/src/main/java/cn/bunny/services/controller/configuration/EmailUsersController.java @@ -54,9 +54,9 @@ public class EmailUsersController { @Operation(summary = "添加邮箱用户配置", description = "添加邮箱用户配置") @PermissionTag(permission = "emailUsers:add") @PostMapping() - public Result saveEmailUsers(@Validated(ValidationGroups.Add.class) @RequestBody EmailUsersDto dto) { - emailUsersService.saveEmailUsers(dto); - return Result.success(ResultCodeEnum.ADD_SUCCESS); + public Result createEmailUsers(@Validated(ValidationGroups.Add.class) @RequestBody EmailUsersDto dto) { + emailUsersService.createEmailUsers(dto); + return Result.success(ResultCodeEnum.CREATE_SUCCESS); } @Operation(summary = "更新邮箱用户配置", description = "更新邮箱用户配置") diff --git a/auth-api/src/main/java/cn/bunny/services/controller/configuration/I18nController.java b/auth-api/src/main/java/cn/bunny/services/controller/configuration/I18nController.java index cb43611..41d422c 100644 --- a/auth-api/src/main/java/cn/bunny/services/controller/configuration/I18nController.java +++ b/auth-api/src/main/java/cn/bunny/services/controller/configuration/I18nController.java @@ -57,9 +57,9 @@ public class I18nController { @Operation(summary = "添加多语言", description = "添加多语言") @PermissionTag(permission = "i18n:add") @PostMapping() - public Result saveI18n(@Validated(ValidationGroups.Update.class) @RequestBody I18nDto dto) { - i18nService.saveI18n(dto); - return Result.success(ResultCodeEnum.ADD_SUCCESS); + public Result createI18n(@Validated(ValidationGroups.Update.class) @RequestBody I18nDto dto) { + i18nService.createI18n(dto); + return Result.success(ResultCodeEnum.CREATE_SUCCESS); } @Operation(summary = "更新多语言", description = "更新多语言") diff --git a/auth-api/src/main/java/cn/bunny/services/controller/configuration/I18nTypeController.java b/auth-api/src/main/java/cn/bunny/services/controller/configuration/I18nTypeController.java index c6da741..cc744b7 100644 --- a/auth-api/src/main/java/cn/bunny/services/controller/configuration/I18nTypeController.java +++ b/auth-api/src/main/java/cn/bunny/services/controller/configuration/I18nTypeController.java @@ -35,9 +35,9 @@ public class I18nTypeController { @Operation(summary = "添加多语言类型", description = "添加多语言类型") @PermissionTag(permission = "i18n:query") @PostMapping() - public Result saveI18nType(@Validated(ValidationGroups.Add.class) @RequestBody I18nTypeDto dto) { - i18nTypeService.saveI18nType(dto); - return Result.success(ResultCodeEnum.ADD_SUCCESS); + public Result createI18nType(@Validated(ValidationGroups.Add.class) @RequestBody I18nTypeDto dto) { + i18nTypeService.createI18nType(dto); + return Result.success(ResultCodeEnum.CREATE_SUCCESS); } @Operation(summary = "更新多语言类型", description = "更新多语言类型") diff --git a/auth-api/src/main/java/cn/bunny/services/controller/configuration/MenuIconController.java b/auth-api/src/main/java/cn/bunny/services/controller/configuration/MenuIconController.java index d7570af..748813e 100644 --- a/auth-api/src/main/java/cn/bunny/services/controller/configuration/MenuIconController.java +++ b/auth-api/src/main/java/cn/bunny/services/controller/configuration/MenuIconController.java @@ -53,9 +53,9 @@ public class MenuIconController { @Operation(summary = "添加菜单图标", description = "添加系统菜单图标") @PermissionTag(permission = "menuIcon:add") @PostMapping() - public Result saveMenuIcon(@Validated(ValidationGroups.Add.class) @RequestBody MenuIconDto dto) { - menuIconService.saveMenuIcon(dto); - return Result.success(ResultCodeEnum.ADD_SUCCESS); + public Result createMenuIcon(@Validated(ValidationGroups.Add.class) @RequestBody MenuIconDto dto) { + menuIconService.createMenuIcon(dto); + return Result.success(ResultCodeEnum.CREATE_SUCCESS); } @Operation(summary = "更新菜单图标", description = "更新系统菜单图标") diff --git a/auth-api/src/main/java/cn/bunny/services/controller/file/FilesController.java b/auth-api/src/main/java/cn/bunny/services/controller/file/FilesController.java index 17f5b1d..972d3db 100644 --- a/auth-api/src/main/java/cn/bunny/services/controller/file/FilesController.java +++ b/auth-api/src/main/java/cn/bunny/services/controller/file/FilesController.java @@ -1,12 +1,13 @@ package cn.bunny.services.controller.file; import cn.bunny.services.aop.annotation.PermissionTag; +import cn.bunny.services.domain.common.ValidationGroups; import cn.bunny.services.domain.common.constant.FileStorageConstant; import cn.bunny.services.domain.common.enums.ResultCodeEnum; import cn.bunny.services.domain.common.model.vo.result.PageResult; import cn.bunny.services.domain.common.model.vo.result.Result; import cn.bunny.services.domain.files.dto.FileUploadDto; -import cn.bunny.services.domain.files.dto.FilesAddOrUpdateDto; +import cn.bunny.services.domain.files.dto.FilesCreateOrUpdateDto; import cn.bunny.services.domain.files.dto.FilesDto; import cn.bunny.services.domain.files.entity.Files; import cn.bunny.services.domain.files.vo.FileInfoVo; @@ -19,6 +20,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; import jakarta.validation.Valid; import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.util.List; @@ -58,7 +60,7 @@ public class FilesController { @Operation(summary = "更新文件", description = "更新系统文件") @PermissionTag(permission = "files:update") @PutMapping() - public Result updateFiles(@Valid FilesAddOrUpdateDto dto) { + public Result updateFiles(@Validated(ValidationGroups.Update.class) FilesCreateOrUpdateDto dto) { filesService.updateFiles(dto); return Result.success(ResultCodeEnum.UPDATE_SUCCESS); } @@ -66,9 +68,9 @@ public class FilesController { @Operation(summary = "添加文件", description = "添加系统文件") @PermissionTag(permission = "files:add") @PostMapping() - public Result addFiles(@Valid FilesAddOrUpdateDto dto) { - filesService.addFiles(dto); - return Result.success(ResultCodeEnum.ADD_SUCCESS); + public Result createFiles(@Validated(ValidationGroups.Add.class) FilesCreateOrUpdateDto dto) { + filesService.createFiles(dto); + return Result.success(ResultCodeEnum.CREATE_SUCCESS); } @Operation(summary = "删除文件", description = "删除系统文件") @@ -97,14 +99,14 @@ public class FilesController { @Operation(summary = "上传文件", description = "上传文件") @PostMapping("private/file") - public Result upload(FileUploadDto dto) { + public Result upload(@Valid FileUploadDto dto) { FileInfoVo vo = filesService.upload(dto); return Result.success(vo, ResultCodeEnum.SUCCESS_UPLOAD); } @Operation(summary = "上传图片文件", description = "上传图片文件") @PostMapping("private/image") - public Result uploadImage(FileUploadDto dto) { + public Result uploadImage(@Valid FileUploadDto dto) { FileInfoVo vo = filesService.uploadFileByThumbnail(dto); return Result.success(vo, ResultCodeEnum.SUCCESS_UPLOAD); } diff --git a/auth-api/src/main/java/cn/bunny/services/controller/file/FilesParDetailController.java b/auth-api/src/main/java/cn/bunny/services/controller/file/FilesParDetailController.java index 50f4ca1..7409202 100644 --- a/auth-api/src/main/java/cn/bunny/services/controller/file/FilesParDetailController.java +++ b/auth-api/src/main/java/cn/bunny/services/controller/file/FilesParDetailController.java @@ -52,9 +52,9 @@ public class FilesParDetailController { @Operation(summary = "添加文件分片信息表,仅在手动分片上传时使用", description = "添加文件分片信息表,仅在手动分片上传时使用") @PermissionTag(permission = "filesParDetail:add") @PostMapping() - public Result addFilesParDetail(@Valid @RequestBody FilesParDetailDto dto) { - filesPardetailService.addFilesParDetail(dto); - return Result.success(ResultCodeEnum.ADD_SUCCESS); + public Result createFilesParDetail(@Valid @RequestBody FilesParDetailDto dto) { + filesPardetailService.createFilesParDetail(dto); + return Result.success(ResultCodeEnum.CREATE_SUCCESS); } @Operation(summary = "更新文件分片信息表,仅在手动分片上传时使用", description = "更新文件分片信息表,仅在手动分片上传时使用") diff --git a/auth-api/src/main/java/cn/bunny/services/controller/message/MessageController.java b/auth-api/src/main/java/cn/bunny/services/controller/message/MessageController.java index d954909..9ecffc7 100644 --- a/auth-api/src/main/java/cn/bunny/services/controller/message/MessageController.java +++ b/auth-api/src/main/java/cn/bunny/services/controller/message/MessageController.java @@ -57,7 +57,7 @@ public class MessageController { @PostMapping() public Result addMessage(@Valid @RequestBody MessageAddDto dto) { messageService.addMessage(dto); - return Result.success(ResultCodeEnum.ADD_SUCCESS); + return Result.success(ResultCodeEnum.CREATE_SUCCESS); } @Operation(summary = "更系统消息", description = "更新系统消息") diff --git a/auth-api/src/main/java/cn/bunny/services/controller/message/MessageTypeController.java b/auth-api/src/main/java/cn/bunny/services/controller/message/MessageTypeController.java index 23ebd58..4f55aba 100644 --- a/auth-api/src/main/java/cn/bunny/services/controller/message/MessageTypeController.java +++ b/auth-api/src/main/java/cn/bunny/services/controller/message/MessageTypeController.java @@ -56,7 +56,7 @@ public class MessageTypeController { @PostMapping() public Result addMessageType(@Valid @RequestBody MessageTypeAddDto dto) { messageTypeService.addMessageType(dto); - return Result.success(ResultCodeEnum.ADD_SUCCESS); + return Result.success(ResultCodeEnum.CREATE_SUCCESS); } @Operation(summary = "更新消息类型", description = "更新系统消息类型") diff --git a/auth-api/src/main/java/cn/bunny/services/controller/schedule/SchedulersController.java b/auth-api/src/main/java/cn/bunny/services/controller/schedule/SchedulersController.java index 6d544f7..d0be795 100644 --- a/auth-api/src/main/java/cn/bunny/services/controller/schedule/SchedulersController.java +++ b/auth-api/src/main/java/cn/bunny/services/controller/schedule/SchedulersController.java @@ -58,7 +58,7 @@ public class SchedulersController { @PostMapping() public Result addSchedulers(@Valid @RequestBody SchedulersAddDto dto) { schedulersService.addSchedulers(dto); - return Result.success(ResultCodeEnum.ADD_SUCCESS); + return Result.success(ResultCodeEnum.CREATE_SUCCESS); } @Operation(summary = "更新任务调度", description = "更新任务") diff --git a/auth-api/src/main/java/cn/bunny/services/controller/schedule/SchedulersGroupController.java b/auth-api/src/main/java/cn/bunny/services/controller/schedule/SchedulersGroupController.java index 4e57a21..9bd2e40 100644 --- a/auth-api/src/main/java/cn/bunny/services/controller/schedule/SchedulersGroupController.java +++ b/auth-api/src/main/java/cn/bunny/services/controller/schedule/SchedulersGroupController.java @@ -56,7 +56,7 @@ public class SchedulersGroupController { @PostMapping() public Result addSchedulersGroup(@Valid @RequestBody SchedulersGroupAddDto dto) { schedulersGroupService.addSchedulersGroup(dto); - return Result.success(ResultCodeEnum.ADD_SUCCESS); + return Result.success(ResultCodeEnum.CREATE_SUCCESS); } @Operation(summary = "更新任务调度分组", description = "更新任务调度分组") diff --git a/auth-api/src/main/java/cn/bunny/services/controller/system/DeptController.java b/auth-api/src/main/java/cn/bunny/services/controller/system/DeptController.java index ea5e0b1..82074b2 100644 --- a/auth-api/src/main/java/cn/bunny/services/controller/system/DeptController.java +++ b/auth-api/src/main/java/cn/bunny/services/controller/system/DeptController.java @@ -56,7 +56,7 @@ public class DeptController { @PostMapping() public Result addDept(@Valid @RequestBody DeptAddDto dto) { deptService.addDept(dto); - return Result.success(ResultCodeEnum.ADD_SUCCESS); + return Result.success(ResultCodeEnum.CREATE_SUCCESS); } @Operation(summary = "更新部门", description = "更新部门") diff --git a/auth-api/src/main/java/cn/bunny/services/controller/system/PermissionController.java b/auth-api/src/main/java/cn/bunny/services/controller/system/PermissionController.java index b35df20..6c8a150 100644 --- a/auth-api/src/main/java/cn/bunny/services/controller/system/PermissionController.java +++ b/auth-api/src/main/java/cn/bunny/services/controller/system/PermissionController.java @@ -61,7 +61,7 @@ public class PermissionController { @PostMapping() public Result addPermission(@Valid @RequestBody PermissionAddDto dto) { permissionService.addPermission(dto); - return Result.success(ResultCodeEnum.ADD_SUCCESS); + return Result.success(ResultCodeEnum.CREATE_SUCCESS); } @Operation(summary = "更新权限", description = "更新权限") diff --git a/auth-api/src/main/java/cn/bunny/services/controller/system/RoleController.java b/auth-api/src/main/java/cn/bunny/services/controller/system/RoleController.java index cd052fd..9deb144 100644 --- a/auth-api/src/main/java/cn/bunny/services/controller/system/RoleController.java +++ b/auth-api/src/main/java/cn/bunny/services/controller/system/RoleController.java @@ -58,7 +58,7 @@ public class RoleController { @PostMapping() public Result addRole(@Valid @RequestBody RoleAddDto dto) { roleService.addRole(dto); - return Result.success(ResultCodeEnum.ADD_SUCCESS); + return Result.success(ResultCodeEnum.CREATE_SUCCESS); } @Operation(summary = "更新角色", description = "更新角色") diff --git a/auth-api/src/main/java/cn/bunny/services/controller/system/RouterController.java b/auth-api/src/main/java/cn/bunny/services/controller/system/RouterController.java index 4f34bd6..06df4bd 100644 --- a/auth-api/src/main/java/cn/bunny/services/controller/system/RouterController.java +++ b/auth-api/src/main/java/cn/bunny/services/controller/system/RouterController.java @@ -54,7 +54,7 @@ public class RouterController { @PostMapping() public Result addRouter(@Valid @RequestBody RouterAddDto dto) { routerService.addRouter(dto); - return Result.success(ResultCodeEnum.ADD_SUCCESS); + return Result.success(ResultCodeEnum.CREATE_SUCCESS); } @Operation(summary = "更新路由菜单", description = "更新路由菜单") diff --git a/auth-api/src/main/java/cn/bunny/services/controller/system/UserController.java b/auth-api/src/main/java/cn/bunny/services/controller/system/UserController.java index 417b910..24114bd 100644 --- a/auth-api/src/main/java/cn/bunny/services/controller/system/UserController.java +++ b/auth-api/src/main/java/cn/bunny/services/controller/system/UserController.java @@ -51,7 +51,7 @@ public class UserController { @PostMapping() public Result addUserByAdmin(@Valid @RequestBody AdminUserAddDto dto) { userService.addUserByAdmin(dto); - return Result.success(ResultCodeEnum.ADD_SUCCESS); + return Result.success(ResultCodeEnum.CREATE_SUCCESS); } @Operation(summary = "更新用户", description = "更新用户信息,需要更新Redis中的内容") diff --git a/auth-core/src/main/java/cn/bunny/services/domain/common/enums/ResultCodeEnum.java b/auth-core/src/main/java/cn/bunny/services/domain/common/enums/ResultCodeEnum.java index a055478..069456d 100644 --- a/auth-core/src/main/java/cn/bunny/services/domain/common/enums/ResultCodeEnum.java +++ b/auth-core/src/main/java/cn/bunny/services/domain/common/enums/ResultCodeEnum.java @@ -9,7 +9,7 @@ import lombok.Getter; public enum ResultCodeEnum { // 成功操作 200 SUCCESS(200, "操作成功"), - ADD_SUCCESS(200, "添加成功"), + CREATE_SUCCESS(200, "添加成功"), UPDATE_SUCCESS(200, "修改成功"), DELETE_SUCCESS(200, "删除成功"), SORT_SUCCESS(200, "排序成功"), @@ -54,7 +54,7 @@ public enum ResultCodeEnum { AUTHENTICATION_EXPIRED(208, "身份验证过期"), SESSION_EXPIRATION(208, "会话过期"), FAIL_NO_ACCESS_DENIED_USER_LOCKED(208, "该账户已封禁"), - + // 209 THE_SAME_USER_HAS_LOGGED_IN(209, "相同用户已登录"), diff --git a/auth-core/src/main/java/cn/bunny/services/domain/files/dto/FilesAddOrUpdateDto.java b/auth-core/src/main/java/cn/bunny/services/domain/files/dto/FilesCreateOrUpdateDto.java similarity index 52% rename from auth-core/src/main/java/cn/bunny/services/domain/files/dto/FilesAddOrUpdateDto.java rename to auth-core/src/main/java/cn/bunny/services/domain/files/dto/FilesCreateOrUpdateDto.java index bddbd37..6d540fa 100644 --- a/auth-core/src/main/java/cn/bunny/services/domain/files/dto/FilesAddOrUpdateDto.java +++ b/auth-core/src/main/java/cn/bunny/services/domain/files/dto/FilesCreateOrUpdateDto.java @@ -1,8 +1,11 @@ package cn.bunny.services.domain.files.dto; +import cn.bunny.services.domain.common.ValidationGroups; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.Min; import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -13,24 +16,27 @@ import java.util.List; @Data @AllArgsConstructor @NoArgsConstructor -@Schema(name = "FilesAddDto对象", title = "添加文件", description = "添加文件") -public class FilesAddOrUpdateDto { +@Schema(name = "FilesSaveOrUpdateDto对象", title = "添加/更新文件", description = "添加/更新文件") +public class FilesCreateOrUpdateDto { @Schema(name = "id", title = "主键") + @NotNull(message = "更新id不为空", groups = {ValidationGroups.Update.class}) private Long id; @Schema(name = "filepath", title = "文件在服务器上的存储路径") - @NotBlank(message = "存储路径不能为空") + @NotBlank(message = "存储路径不能为空", groups = {ValidationGroups.Add.class, ValidationGroups.Update.class}) private String filepath; @Schema(name = "downloadCount", title = "下载数量") - @Min(value = 0L, message = "最小值为0") + @Min(value = 0L, message = "最小值为0", groups = {ValidationGroups.Add.class, ValidationGroups.Update.class}) private Integer downloadCount = 0; @Schema(name = "files", title = "文件列表,添加时为列表") + @NotEmpty(message = "文件不能为空", groups = {ValidationGroups.Add.class}) private List files; @Schema(name = "file", title = "文件,修改时为 file") + @NotNull(message = "文件不能为空", groups = {ValidationGroups.Update.class}) private MultipartFile file; } \ No newline at end of file diff --git a/service/src/main/java/cn/bunny/services/service/configuration/EmailTemplateService.java b/service/src/main/java/cn/bunny/services/service/configuration/EmailTemplateService.java index 63294c6..0bda51b 100644 --- a/service/src/main/java/cn/bunny/services/service/configuration/EmailTemplateService.java +++ b/service/src/main/java/cn/bunny/services/service/configuration/EmailTemplateService.java @@ -33,7 +33,7 @@ public interface EmailTemplateService extends IService { * * @param dto 添加表单 */ - void saveEmailTemplate(@Valid EmailTemplateDto dto); + void createEmailTemplate(@Valid EmailTemplateDto dto); /** * 更新邮件模板表 diff --git a/service/src/main/java/cn/bunny/services/service/configuration/EmailUsersService.java b/service/src/main/java/cn/bunny/services/service/configuration/EmailUsersService.java index 6593238..1ee315d 100644 --- a/service/src/main/java/cn/bunny/services/service/configuration/EmailUsersService.java +++ b/service/src/main/java/cn/bunny/services/service/configuration/EmailUsersService.java @@ -33,7 +33,7 @@ public interface EmailUsersService extends IService { * * @param dto 添加表单 */ - void saveEmailUsers(@Valid EmailUsersDto dto); + void createEmailUsers(@Valid EmailUsersDto dto); /** * 更新邮箱用户发送配置 diff --git a/service/src/main/java/cn/bunny/services/service/configuration/I18nService.java b/service/src/main/java/cn/bunny/services/service/configuration/I18nService.java index 265e461..37e5b44 100644 --- a/service/src/main/java/cn/bunny/services/service/configuration/I18nService.java +++ b/service/src/main/java/cn/bunny/services/service/configuration/I18nService.java @@ -43,7 +43,7 @@ public interface I18nService extends IService { * * @param dto 添加表单 */ - void saveI18n(I18nDto dto); + void createI18n(I18nDto dto); /** * * 更新多语言 diff --git a/service/src/main/java/cn/bunny/services/service/configuration/I18nTypeService.java b/service/src/main/java/cn/bunny/services/service/configuration/I18nTypeService.java index 2d12cd3..e816fdc 100644 --- a/service/src/main/java/cn/bunny/services/service/configuration/I18nTypeService.java +++ b/service/src/main/java/cn/bunny/services/service/configuration/I18nTypeService.java @@ -30,7 +30,7 @@ public interface I18nTypeService extends IService { * * @param dto 多语言类型添加 */ - void saveI18nType(@Valid I18nTypeDto dto); + void createI18nType(@Valid I18nTypeDto dto); /** * 更新多语言类型 diff --git a/service/src/main/java/cn/bunny/services/service/configuration/MenuIconService.java b/service/src/main/java/cn/bunny/services/service/configuration/MenuIconService.java index 451f56d..a61f226 100644 --- a/service/src/main/java/cn/bunny/services/service/configuration/MenuIconService.java +++ b/service/src/main/java/cn/bunny/services/service/configuration/MenuIconService.java @@ -31,7 +31,7 @@ public interface MenuIconService extends IService { * * @param dto 添加表单 */ - void saveMenuIcon(MenuIconDto dto); + void createMenuIcon(MenuIconDto dto); /** * * 更新系统菜单图标 diff --git a/service/src/main/java/cn/bunny/services/service/configuration/impl/EmailTemplateServiceImpl.java b/service/src/main/java/cn/bunny/services/service/configuration/impl/EmailTemplateServiceImpl.java index 41421a0..9cc8866 100644 --- a/service/src/main/java/cn/bunny/services/service/configuration/impl/EmailTemplateServiceImpl.java +++ b/service/src/main/java/cn/bunny/services/service/configuration/impl/EmailTemplateServiceImpl.java @@ -71,7 +71,7 @@ public class EmailTemplateServiceImpl extends ServiceImpl implements I1 */ @Override @CacheEvict(cacheNames = CACHE_NAMES, key = "'i18nMap'", beforeInvocation = true) - public void saveI18n(I18nDto dto) { + public void createI18n(I18nDto dto) { String keyName = dto.getKeyName(); String typeName = dto.getTypeName(); diff --git a/service/src/main/java/cn/bunny/services/service/configuration/impl/I18nTypeServiceImpl.java b/service/src/main/java/cn/bunny/services/service/configuration/impl/I18nTypeServiceImpl.java index f95eca3..971cf53 100644 --- a/service/src/main/java/cn/bunny/services/service/configuration/impl/I18nTypeServiceImpl.java +++ b/service/src/main/java/cn/bunny/services/service/configuration/impl/I18nTypeServiceImpl.java @@ -58,7 +58,7 @@ public class I18nTypeServiceImpl extends ServiceImpl i @CacheEvict(cacheNames = CACHE_NAMES, key = "'i18nMap'", beforeInvocation = true), @CacheEvict(cacheNames = CACHE_NAMES, key = "'i18nTypeList'", beforeInvocation = true), }) - public void saveI18nType(@Valid I18nTypeDto dto) { + public void createI18nType(@Valid I18nTypeDto dto) { String typeName = dto.getTypeName(); Boolean isDefault = dto.getIsDefault(); I18nType i18nType = new I18nType(); diff --git a/service/src/main/java/cn/bunny/services/service/configuration/impl/MenuIconServiceImpl.java b/service/src/main/java/cn/bunny/services/service/configuration/impl/MenuIconServiceImpl.java index 4b848b4..3a4f390 100644 --- a/service/src/main/java/cn/bunny/services/service/configuration/impl/MenuIconServiceImpl.java +++ b/service/src/main/java/cn/bunny/services/service/configuration/impl/MenuIconServiceImpl.java @@ -74,7 +74,7 @@ public class MenuIconServiceImpl extends ServiceImpl i */ @Override @CacheEvict(cacheNames = "menuIcon", key = "'menuIconList'", beforeInvocation = true) - public void saveMenuIcon(MenuIconDto dto) { + public void createMenuIcon(MenuIconDto dto) { MenuIcon menuIcon = new MenuIcon(); BeanUtils.copyProperties(dto, menuIcon); save(menuIcon); diff --git a/service/src/main/java/cn/bunny/services/service/file/FilesParDetailService.java b/service/src/main/java/cn/bunny/services/service/file/FilesParDetailService.java index 1db6d5f..a60a148 100644 --- a/service/src/main/java/cn/bunny/services/service/file/FilesParDetailService.java +++ b/service/src/main/java/cn/bunny/services/service/file/FilesParDetailService.java @@ -31,7 +31,7 @@ public interface FilesParDetailService extends IService { * * @param dto 添加表单 */ - void addFilesParDetail(FilesParDetailDto dto); + void createFilesParDetail(FilesParDetailDto dto); /** * 更新文件分片信息表,仅在手动分片上传时使用 diff --git a/service/src/main/java/cn/bunny/services/service/file/FilesService.java b/service/src/main/java/cn/bunny/services/service/file/FilesService.java index 364fb0f..6e51b30 100644 --- a/service/src/main/java/cn/bunny/services/service/file/FilesService.java +++ b/service/src/main/java/cn/bunny/services/service/file/FilesService.java @@ -2,7 +2,7 @@ package cn.bunny.services.service.file; import cn.bunny.services.domain.common.model.vo.result.PageResult; import cn.bunny.services.domain.files.dto.FileUploadDto; -import cn.bunny.services.domain.files.dto.FilesAddOrUpdateDto; +import cn.bunny.services.domain.files.dto.FilesCreateOrUpdateDto; import cn.bunny.services.domain.files.dto.FilesDto; import cn.bunny.services.domain.files.dto.UploadThumbnail; import cn.bunny.services.domain.files.entity.Files; @@ -37,14 +37,14 @@ public interface FilesService extends IService { * * @param dto 添加表单 */ - void addFiles(FilesAddOrUpdateDto dto); + void createFiles(FilesCreateOrUpdateDto dto); /** * * 更新系统文件表 * * @param dto 更新表单 */ - void updateFiles(FilesAddOrUpdateDto dto); + void updateFiles(FilesCreateOrUpdateDto dto); /** * * 上传文件 diff --git a/service/src/main/java/cn/bunny/services/service/file/impl/FilesParDetailServiceImpl.java b/service/src/main/java/cn/bunny/services/service/file/impl/FilesParDetailServiceImpl.java index db6f712..e5a0afa 100644 --- a/service/src/main/java/cn/bunny/services/service/file/impl/FilesParDetailServiceImpl.java +++ b/service/src/main/java/cn/bunny/services/service/file/impl/FilesParDetailServiceImpl.java @@ -53,7 +53,7 @@ public class FilesParDetailServiceImpl extends ServiceImpl implements * @param dto 系统文件表添加 */ @Override - public void addFiles(FilesAddOrUpdateDto dto) { + public void createFiles(FilesCreateOrUpdateDto dto) { // 上传文件类型,设置自定义路径 String preType = dto.getFilepath(); String filepath = FileStorageConstant.getType(preType) + DateUtil.format(new Date(), "yyyy-MM-dd") + "/"; - dto.getFiles().forEach(file -> { - fileStorageService.of(file).setPath(filepath).upload(); - }); + dto.getFiles().forEach(file -> fileStorageService.of(file).setPath(filepath).upload()); } /** @@ -95,7 +93,7 @@ public class FilesServiceImpl extends ServiceImpl implements * @param dto 系统文件表更新 */ @Override - public void updateFiles(FilesAddOrUpdateDto dto) { + public void updateFiles(FilesCreateOrUpdateDto dto) { MultipartFile file = dto.getFile(); // 先查询文件 Long id = dto.getId();