refactor: 修改头像接口调整为 Patch 请求方式

This commit is contained in:
jasmine
2025-04-08 07:39:21 +00:00
committed by Charles7c
parent 67e6507240
commit aed27533a6

View File

@@ -72,7 +72,7 @@ public class UserProfileController {
private final AuthRequestFactory authRequestFactory;
@Operation(summary = "修改头像", description = "用户修改个人头像")
@PostMapping("/avatar")
@PatchMapping("/avatar")
public AvatarResp updateAvatar(@NotNull(message = "头像不能为空") MultipartFile avatarFile) throws IOException {
ValidationUtils.throwIf(avatarFile::isEmpty, "头像不能为空");
String newAvatar = userService.updateAvatar(avatarFile, UserContextHolder.getUserId());