Skip to content

Commit

Permalink
[fix] 유저 프로필 변경 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
MinchoGreenT committed Jun 1, 2024
1 parent 4cfd53f commit 60fda1c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.modernfarmer.farmusspring.domain.auth.entity.CustomUser;
import com.modernfarmer.farmusspring.domain.user.dto.request.SetLevelRequest;
import com.modernfarmer.farmusspring.domain.user.dto.request.UpdateProfileDto;
import com.modernfarmer.farmusspring.domain.user.dto.response.SetLevelResponse;
import com.modernfarmer.farmusspring.domain.user.dto.response.UserProfileResponse;
import com.modernfarmer.farmusspring.domain.user.service.UserService;
Expand Down Expand Up @@ -38,14 +39,13 @@ public BaseResponseDto<Void> deleteProfleImage(@AuthenticationPrincipal CustomUs
return userService.deleteProfleImage(user.getUserId());
}

@PostMapping(value = "/profile", produces = MediaType.APPLICATION_JSON_VALUE)
@PostMapping(value = "/profile")
public BaseResponseDto<Void> settingProfile(
@AuthenticationPrincipal CustomUser user,
@RequestPart(value = "file", required = false) MultipartFile multipartFile,
@RequestParam("nickName") String nickName) throws IOException {

return userService.settingProfile(user.getUserId(), multipartFile,nickName);

@RequestPart UpdateProfileDto requestDto,
@RequestPart(value = "file", required = false) MultipartFile file
) throws IOException {
return userService.settingProfile(user.getUserId(), file, requestDto.nickname());
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.modernfarmer.farmusspring.domain.user.dto.request;

public record UpdateProfileDto(
String nickname
) {
}

0 comments on commit 60fda1c

Please sign in to comment.