💩 feat: 改成restful风格;修复测试经过问题
This commit is contained in:
parent
28cbfb2c81
commit
b26a0bb54b
|
@ -1,5 +1,5 @@
|
|||
FROM openjdk:24-ea-17-jdk-oraclelinux9
|
||||
MAINTAINER server
|
||||
LABEL maintainer="server"
|
||||
|
||||
#系统编码
|
||||
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
|
||||
|
|
|
@ -31,11 +31,21 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<!-- <plugin> -->
|
||||
<!-- <groupId>org.apache.maven.plugins</groupId> -->
|
||||
<!-- <artifactId>maven-surefire-plugin</artifactId> -->
|
||||
<!-- <configuration> -->
|
||||
<!-- <skip>true</skip> -->
|
||||
<!-- </configuration> -->
|
||||
<!-- </plugin> -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.5.2</version>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
<argLine>
|
||||
-javaagent:"${settings.localRepository}/org/mockito/mockito-core/5.14.2/mockito-core-5.14.2.jar"
|
||||
</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
|
|
@ -24,7 +24,7 @@ public class IndexController {
|
|||
}
|
||||
|
||||
@Operation(summary = "生成验证码", description = "生成验证码")
|
||||
@GetMapping("public/checkCode")
|
||||
@GetMapping("public/check-code")
|
||||
public ResponseEntity<byte[]> checkCode() {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.IMAGE_JPEG);
|
||||
|
|
|
@ -22,7 +22,7 @@ public class ConfigurationController {
|
|||
private ConfigurationService configurationService;
|
||||
|
||||
@Operation(summary = "获取web配置文件", description = "读取web配置文件并返回给前端")
|
||||
@GetMapping("public/webConfig")
|
||||
@GetMapping("public/web-config")
|
||||
public WebConfiguration webConfig() {
|
||||
return configurationService.webConfig();
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ import java.util.Map;
|
|||
@Tag(name = "邮件模板", description = "邮件模板相关接口")
|
||||
@PermissionTag(permission = "emailTemplate:*")
|
||||
@RestController
|
||||
@RequestMapping("api/emailTemplate")
|
||||
@RequestMapping("api/email-template")
|
||||
public class EmailTemplateController {
|
||||
|
||||
@Resource
|
||||
|
|
|
@ -32,7 +32,7 @@ import java.util.Map;
|
|||
@Tag(name = "邮箱用户配置", description = "邮箱用户发送配置相关接口")
|
||||
@PermissionTag(permission = "emailUsers:*")
|
||||
@RestController
|
||||
@RequestMapping("api/emailUsers")
|
||||
@RequestMapping("api/email-users")
|
||||
public class EmailUsersController {
|
||||
|
||||
@Resource
|
||||
|
|
|
@ -27,7 +27,7 @@ import java.util.List;
|
|||
@Tag(name = "多语言类型", description = "多语言类型相关接口")
|
||||
@PermissionTag(permission = "i18n:*")
|
||||
@RestController
|
||||
@RequestMapping("api/i18nType")
|
||||
@RequestMapping("api/i18n-type")
|
||||
public class I18nTypeController {
|
||||
|
||||
@Resource
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.List;
|
|||
@Tag(name = "菜单图标", description = "菜单图标相关接口")
|
||||
@PermissionTag(permission = "menuIcon:*")
|
||||
@RestController
|
||||
@RequestMapping("api/menuIcon")
|
||||
@RequestMapping("api/menu-icon")
|
||||
public class MenuIconController {
|
||||
|
||||
@Resource
|
||||
|
|
|
@ -87,7 +87,7 @@ public class FilesController {
|
|||
}
|
||||
|
||||
@Operation(summary = "获取所有文件存储基础路径", description = "获取所有文件存储基础路径")
|
||||
@GetMapping("private/getAllFilesStoragePath")
|
||||
@GetMapping("private/file-storage-paths")
|
||||
public Result<List<String>> getAllFilesStoragePath() {
|
||||
Map<String, String> typeMap = FileStorageConstant.typeMap;
|
||||
List<String> list = typeMap.keySet().stream().toList();
|
||||
|
@ -96,14 +96,14 @@ public class FilesController {
|
|||
}
|
||||
|
||||
@Operation(summary = "上传文件", description = "上传文件")
|
||||
@PostMapping("private/upload")
|
||||
@PostMapping("private/file")
|
||||
public Result<FileInfoVo> upload(FileUploadDto dto) {
|
||||
FileInfoVo vo = filesService.upload(dto);
|
||||
return Result.success(vo, ResultCodeEnum.SUCCESS_UPLOAD);
|
||||
}
|
||||
|
||||
@Operation(summary = "上传图片文件", description = "上传图片文件")
|
||||
@PostMapping("private/uploadImage")
|
||||
@PostMapping("private/image")
|
||||
public Result<FileInfoVo> uploadImage(FileUploadDto dto) {
|
||||
FileInfoVo vo = filesService.uploadFileByThumbnail(dto);
|
||||
return Result.success(vo, ResultCodeEnum.SUCCESS_UPLOAD);
|
||||
|
|
|
@ -29,7 +29,7 @@ import java.util.List;
|
|||
@Tag(name = "文件分片信息表,仅在手动分片上传时使用", description = "文件分片信息表,仅在手动分片上传时使用相关接口")
|
||||
@PermissionTag(permission = "filesParDetail:*")
|
||||
@RestController
|
||||
@RequestMapping("/api/filesParDetail")
|
||||
@RequestMapping("/api/files-par-detail")
|
||||
public class FilesParDetailController {
|
||||
|
||||
@Resource
|
||||
|
|
|
@ -28,7 +28,7 @@ import java.util.List;
|
|||
@Tag(name = "任务调度执行日志", description = "调度任务执行日志相关接口")
|
||||
@PermissionTag(permission = "scheduleExecuteLog:*")
|
||||
@RestController
|
||||
@RequestMapping("api/scheduleExecuteLog")
|
||||
@RequestMapping("api/schedule-execute-log")
|
||||
public class ScheduleExecuteLogController {
|
||||
|
||||
@Resource
|
||||
|
|
|
@ -29,7 +29,7 @@ import java.util.List;
|
|||
@Tag(name = "用户登录日志", description = "用户登录日志相关接口")
|
||||
@PermissionTag(permission = "userLoginLog:*")
|
||||
@RestController
|
||||
@RequestMapping("api/userLoginLog")
|
||||
@RequestMapping("api/user-login-log")
|
||||
public class UserLoginLogController {
|
||||
|
||||
@Resource
|
||||
|
|
|
@ -75,15 +75,15 @@ public class MessageController {
|
|||
}
|
||||
|
||||
@Operation(summary = "根据消息id查询消息详情", description = "根据消息id查询消息详情")
|
||||
@GetMapping("private/getMessageDetailById")
|
||||
public Result<MessageDetailVo> getMessageDetailById(Long id) {
|
||||
@GetMapping("private/message/{id}")
|
||||
public Result<MessageDetailVo> getMessageDetailById(@PathVariable Long id) {
|
||||
MessageDetailVo vo = messageService.getMessageDetailById(id);
|
||||
return Result.success(vo);
|
||||
}
|
||||
|
||||
@Operation(summary = "根据消息id获取接收人信息", description = "根据消息id获取接收人信息")
|
||||
@GetMapping("private/getReceivedUserinfoByMessageId")
|
||||
public Result<List<MessageReceivedWithUserVo>> getReceivedUserinfoByMessageId(Long messageId) {
|
||||
@GetMapping("private/messages/{message-id}/recipients")
|
||||
public Result<List<MessageReceivedWithUserVo>> getReceivedUserinfoByMessageId(Long messageId, @PathVariable("message-id") String parameter) {
|
||||
List<MessageReceivedWithUserVo> voList = messageService.getReceivedUserinfoByMessageId(messageId);
|
||||
return Result.success(voList);
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ import java.util.List;
|
|||
@Tag(name = "消息接收(用户消息)", description = "消息接收(用户消息)相关接口")
|
||||
@PermissionTag(permission = "messageReceived:*")
|
||||
@RestController
|
||||
@RequestMapping("/api/messageReceived")
|
||||
@RequestMapping("/api/message-received")
|
||||
public class MessageReceivedController {
|
||||
|
||||
@Resource
|
||||
|
@ -82,14 +82,14 @@ public class MessageReceivedController {
|
|||
}
|
||||
|
||||
@Operation(summary = "用户将消息标为已读", description = "用户将消息标为已读")
|
||||
@PutMapping("private/markAsRead")
|
||||
@PutMapping("private/user/messages/read-status")
|
||||
public Result<String> markAsReadByUser(@Valid @RequestBody List<Long> ids) {
|
||||
messageReceivedService.markAsReadByUser(ids);
|
||||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@Operation(summary = "用户删除消息", description = "用户删除消息")
|
||||
@DeleteMapping("private/deleteMessage")
|
||||
@DeleteMapping("private/user/messages")
|
||||
public Result<String> deleteMessageByUser(@RequestBody List<Long> ids) {
|
||||
messageReceivedService.deleteMessageByUser(ids);
|
||||
return Result.success(ResultCodeEnum.DELETE_SUCCESS);
|
||||
|
|
|
@ -76,7 +76,7 @@ public class MessageTypeController {
|
|||
}
|
||||
|
||||
@Operation(summary = "所有消息列表", description = "获取所有消息列表")
|
||||
@GetMapping("private/getMessageList")
|
||||
@GetMapping("private/messages")
|
||||
public Result<List<MessageTypeVo>> getMessageList() {
|
||||
List<MessageTypeVo> voList = messageTypeService.getMessageList();
|
||||
return Result.success(voList);
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.List;
|
|||
@Tag(name = "任务调度分组", description = "任务调度分组相关接口")
|
||||
@PermissionTag(permission = "schedulersGroup:*")
|
||||
@RestController
|
||||
@RequestMapping("api/schedulersGroup")
|
||||
@RequestMapping("api/schedulers-group")
|
||||
public class SchedulersGroupController {
|
||||
|
||||
@Resource
|
||||
|
@ -77,7 +77,7 @@ public class SchedulersGroupController {
|
|||
|
||||
@Operation(summary = "获取所有任务调度分组", description = "获取所有任务调度分组")
|
||||
@PermissionTag(permission = "schedulersGroup:query")
|
||||
@GetMapping("getSchedulersGroupList")
|
||||
@GetMapping("scheduler-groups")
|
||||
public Result<List<SchedulersGroupVo>> getSchedulersGroupList() {
|
||||
List<SchedulersGroupVo> voList = schedulersGroupService.getSchedulersGroupList();
|
||||
return Result.success(voList);
|
||||
|
|
|
@ -76,7 +76,7 @@ public class DeptController {
|
|||
}
|
||||
|
||||
@Operation(summary = "获取所有部门", description = "获取所有部门")
|
||||
@GetMapping("private/getDeptList")
|
||||
@GetMapping("private/departments")
|
||||
public Result<List<DeptVo>> getDeptPage() {
|
||||
List<DeptVo> voList = deptService.getDeptPage();
|
||||
return Result.success(voList);
|
||||
|
|
|
@ -96,14 +96,14 @@ public class PermissionController {
|
|||
}
|
||||
|
||||
@Operation(summary = "获取所有权限", description = "获取所有权限")
|
||||
@GetMapping("private/getPermissionList")
|
||||
@GetMapping("private/permissions")
|
||||
public Result<List<PermissionVo>> getPermissionList() {
|
||||
List<PermissionVo> voList = permissionService.getPermissionList();
|
||||
return Result.success(voList);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取系统API信息列表", description = "系统接口API信息列表")
|
||||
@GetMapping("private/getSystemApiInfoList")
|
||||
@GetMapping("private/system/apis")
|
||||
public Result<List<ScannerControllerInfoVo>> getSystemApiInfoList() {
|
||||
List<ScannerControllerInfoVo> list = ControllerApiPermissionScanner.scanControllerInfo();
|
||||
return Result.success(list);
|
||||
|
@ -111,7 +111,7 @@ public class PermissionController {
|
|||
|
||||
@Operation(summary = "批量修改权限父级", description = "批量修改权限父级")
|
||||
@PermissionTag(permission = "permission::update")
|
||||
@PatchMapping("update/permissionListByParentId")
|
||||
@PatchMapping("update/permissions/parent")
|
||||
public Result<String> updatePermissionListByParentId(@RequestBody @Valid PermissionUpdateBatchByParentIdDto dto) {
|
||||
permissionService.updatePermissionListByParentId(dto);
|
||||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
|
@ -119,7 +119,7 @@ public class PermissionController {
|
|||
|
||||
@Operation(summary = "批量修改权", description = "批量修改权")
|
||||
@PermissionTag(permission = "permission::update")
|
||||
@PatchMapping("update/permissionBatch")
|
||||
@PatchMapping("update/permissions/batch")
|
||||
public Result<String> updatePermissionBatch(@RequestBody List<PermissionUpdateDto> list) {
|
||||
permissionService.updatePermissionBatch(list);
|
||||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
|
|
|
@ -30,8 +30,8 @@ public class RolePermissionController {
|
|||
private RolePermissionService rolePermissionService;
|
||||
|
||||
@Operation(summary = "根据角色id获取权限内容", description = "根据角色id获取权限内容")
|
||||
@GetMapping("private/getPermissionListByRoleId")
|
||||
public Result<List<String>> getPermissionListByRoleId(Long id) {
|
||||
@GetMapping("private/permissions/{id}")
|
||||
public Result<List<String>> getPermissionListByRoleId(@PathVariable Long id) {
|
||||
List<String> voList = rolePermissionService.getPermissionListByRoleId(id);
|
||||
return Result.success(voList);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ public class RouterController {
|
|||
|
||||
@Operation(summary = "获取用户菜单", description = "获取用户菜单")
|
||||
@PermissionTag(permission = "router:query")
|
||||
@GetMapping("private/routerAsync")
|
||||
@GetMapping("private/router-async")
|
||||
public Result<List<WebUserRouterVo>> routerAsync() {
|
||||
List<WebUserRouterVo> voList = routerService.routerAsync();
|
||||
return Result.success(voList);
|
||||
|
@ -43,7 +43,7 @@ public class RouterController {
|
|||
|
||||
@Operation(summary = "查询管理路由菜单", description = "查询管理菜单列表")
|
||||
@PermissionTag(permission = "router:query")
|
||||
@GetMapping("routerList")
|
||||
@GetMapping("routers")
|
||||
public Result<List<RouterManageVo>> routerList() {
|
||||
List<RouterManageVo> voPageResult = routerService.routerList();
|
||||
return Result.success(voPageResult);
|
||||
|
|
|
@ -21,22 +21,22 @@ import java.util.List;
|
|||
@Tag(name = "路由菜单和角色", description = "路由和角色相关接口")
|
||||
@PermissionTag(permission = "routerRole:*")
|
||||
@RestController
|
||||
@RequestMapping("api/routerRole")
|
||||
@RequestMapping("api/router-role")
|
||||
public class RouterRoleController {
|
||||
|
||||
@Resource
|
||||
private RouterRoleService routerRoleService;
|
||||
|
||||
@Operation(summary = "根据菜单id获取所有角色", description = "根据菜单id获取所有角色")
|
||||
@GetMapping("private/getRoleListByRouterId")
|
||||
public Result<List<String>> getRoleListByRouterId(Long routerId) {
|
||||
@GetMapping("private/roles/{routerId}")
|
||||
public Result<List<String>> getRoleListByRouterId(@PathVariable Long routerId) {
|
||||
List<String> roleListByRouterId = routerRoleService.getRoleListByRouterId(routerId);
|
||||
return Result.success(roleListByRouterId);
|
||||
}
|
||||
|
||||
@Operation(summary = "清除选中菜单所有角色", description = "清除选中菜单所有角色")
|
||||
@PermissionTag(permission = "routerRole:delete")
|
||||
@DeleteMapping("clearRouterRole")
|
||||
@DeleteMapping("/batch")
|
||||
public Result<String> clearRouterRole(@RequestBody List<Long> routerIds) {
|
||||
routerRoleService.clearRouterRole(routerIds);
|
||||
return Result.success();
|
||||
|
|
|
@ -74,14 +74,14 @@ public class UserController {
|
|||
}
|
||||
|
||||
@Operation(summary = "根据用户id查询用户", description = "根据用户ID获取用户信息,不包含Redis中的信息")
|
||||
@GetMapping("private/getUserinfoById")
|
||||
public Result<UserVo> getUserinfoById(Long id) {
|
||||
@GetMapping("private/users/{id}")
|
||||
public Result<UserVo> getUserinfoById(@PathVariable Long id) {
|
||||
UserVo vo = userService.getUserinfoById(id);
|
||||
return Result.success(vo);
|
||||
}
|
||||
|
||||
@Operation(summary = "根据关键字查询用户", description = "根据用户名查询用户列表")
|
||||
@GetMapping("private/getUserListByKeyword")
|
||||
@GetMapping("private/users/search")
|
||||
public Result<List<UserVo>> getUserListByKeyword(String keyword) {
|
||||
List<UserVo> voList = userService.getUserListByKeyword(keyword);
|
||||
return Result.success(voList);
|
||||
|
@ -89,15 +89,15 @@ public class UserController {
|
|||
|
||||
@Operation(summary = "强制退出用户", description = "强制退出")
|
||||
@PermissionTag(permission = "user:update")
|
||||
@PutMapping("forcedOffline")
|
||||
public Result<String> forcedOfflineByAdmin(@RequestBody Long id) {
|
||||
@PutMapping("{id}/force-logout")
|
||||
public Result<String> forcedOfflineByAdmin(@PathVariable Long id) {
|
||||
userService.forcedOfflineByAdmin(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "已登录用户", description = "查询缓存中已登录用户")
|
||||
@PermissionTag(permission = "user:query")
|
||||
@GetMapping("getCacheUserPage/{page}/{limit}")
|
||||
@GetMapping("/users/logged-in/{page}/{limit}")
|
||||
public Result<PageResult<UserVo>> getCacheUserPage(
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
@PathVariable("page") Integer page,
|
||||
|
|
|
@ -33,7 +33,7 @@ public class UserLoginController {
|
|||
}
|
||||
|
||||
@Operation(summary = "普通用户登录发送邮件验证码", description = "登录发送邮件验证码")
|
||||
@PostMapping("public/sendLoginEmail")
|
||||
@PostMapping("public/email-code")
|
||||
public Result<String> sendLoginEmail(String email) {
|
||||
if (!StringUtils.hasText(email)) throw new AuthCustomerException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
|
||||
|
@ -42,7 +42,7 @@ public class UserLoginController {
|
|||
}
|
||||
|
||||
@Operation(summary = "普通用户登录刷新token", description = "刷新用户token")
|
||||
@PostMapping("private/refreshToken")
|
||||
@PostMapping("private/refresh-token")
|
||||
public Result<RefreshTokenVo> refreshToken(@Valid @RequestBody RefreshTokenDto dto) {
|
||||
RefreshTokenVo vo = userLoginService.refreshToken(dto);
|
||||
return Result.success(vo);
|
||||
|
|
|
@ -22,15 +22,15 @@ import java.util.List;
|
|||
@Tag(name = "用户和角色", description = "用户和角色相关接口")
|
||||
@PermissionTag(permission = "userRole:*")
|
||||
@RestController
|
||||
@RequestMapping("api/userRole")
|
||||
@RequestMapping("api/user-role")
|
||||
public class UserRoleController {
|
||||
|
||||
@Resource
|
||||
private UserRoleService userRoleService;
|
||||
|
||||
@Operation(summary = "根据用户id获取角色列", description = "根据用户id获取角色列")
|
||||
@GetMapping("private/getRoleListByUserId")
|
||||
public Result<List<String>> getRoleListByUserId(Long userId) {
|
||||
@GetMapping("private/roles/{userId}")
|
||||
public Result<List<String>> getRoleListByUserId(@PathVariable Long userId) {
|
||||
List<String> roleVoList = userRoleService.getRoleListByUserId(userId);
|
||||
return Result.success(roleVoList);
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ dromara:
|
|||
# 访问路径,使用本地在SpringSecurity中要配置权限,如果是和我一样就不用修改了,如果不是api开头,上线需要配置nginx
|
||||
path-patterns: /api/local-file/**
|
||||
storage-path: D:/Temp # 存储路径
|
||||
# storage-path: ~/bunny-admin/temp # 存储路径
|
||||
base-path: "" # 基础路径
|
||||
minio:
|
||||
endpointUrl: "http://192.168.3.137:9000" # 连接地址
|
||||
|
|
|
@ -55,11 +55,3 @@ bunny:
|
|||
port: 6379
|
||||
database: 0
|
||||
password: "123456"
|
||||
|
||||
minio:
|
||||
endpointUrl: "http://192.168.3.98:9000"
|
||||
accessKey: bunny
|
||||
secretKey: "02120212"
|
||||
bucket-name: auth-admin
|
||||
|
||||
backPath: "/www/root/backup"
|
|
@ -260,23 +260,14 @@ public class ControllerApiPermissionScanner extends AbstractAnnotationScanner {
|
|||
return false;
|
||||
}
|
||||
|
||||
// 登录路径特殊处理
|
||||
if (path.equals("login")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 检查用户认证路径
|
||||
for (String userAuth : WebSecurityConfig.userAuths) {
|
||||
if (path.contains(userAuth)) {
|
||||
return true;
|
||||
}
|
||||
if (path.contains(userAuth)) return true;
|
||||
}
|
||||
|
||||
// 检查不需要权限的注解路径
|
||||
for (String annotation : WebSecurityConfig.annotations) {
|
||||
if (PATH_MATCHER.match(annotation, path) || PATH_MATCHER.match(annotation, "/" + path)) {
|
||||
return true;
|
||||
}
|
||||
if (PATH_MATCHER.match(annotation, path) || PATH_MATCHER.match(annotation, "/" + path)) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -52,7 +52,6 @@ public class PermissionCheckService {
|
|||
}
|
||||
|
||||
// 根据角色列表查询权限信息
|
||||
// List<Permission> permissionList = permissionMapper.selectListByUserId(userId);
|
||||
List<Permission> permissionList = authorizationCacheService.getPermissionsByUser(userId, username);
|
||||
|
||||
// 判断是否与请求路径匹配
|
||||
|
@ -61,9 +60,7 @@ public class PermissionCheckService {
|
|||
.filter(permission -> {
|
||||
String method = permission.getRequestMethod();
|
||||
if (StringUtils.hasText(method)) {
|
||||
|
||||
return method.equalsIgnoreCase(requestMethod)
|
||||
|| requestURI.contains("*");
|
||||
return method.equalsIgnoreCase(requestMethod) || requestURI.contains("*");
|
||||
}
|
||||
return false;
|
||||
})
|
||||
|
|
|
@ -108,6 +108,14 @@ public class FilesServiceImpl extends ServiceImpl<FilesMapper, Files> implements
|
|||
throw new AuthCustomerException(ResultCodeEnum.FILE_NOT_EXIST);
|
||||
}
|
||||
|
||||
// 更新数据
|
||||
dto.setFilepath(files.getFilepath());
|
||||
BeanUtils.copyProperties(dto, files);
|
||||
updateById(files);
|
||||
|
||||
// 文件存在上傳文件并更新
|
||||
if (file == null) return;
|
||||
|
||||
// 删除原来文件
|
||||
boolean delete = fileStorageService.delete(files.getUrl());
|
||||
if (!delete) {
|
||||
|
@ -123,6 +131,7 @@ public class FilesServiceImpl extends ServiceImpl<FilesMapper, Files> implements
|
|||
// 如果有缩略图的话
|
||||
.setSaveThFilename(files.getThFilename())
|
||||
.upload();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue