Skip to content

Commit 5638bca

Browse files
committed
feat: 사용자 프로필 수정 API 추가
1 parent a6fd975 commit 5638bca

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/main/java/com/back/domain/profile/controller/ProfileController.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package com.back.domain.profile.controller;
22

33
import com.back.domain.profile.dto.ProfileResponseDto;
4+
import com.back.domain.profile.dto.ProfileUpdateRequestDto;
45
import com.back.domain.profile.service.ProfileService;
56
import com.back.domain.user.service.UserService;
67
import com.back.global.rsData.RsData;
8+
import jakarta.validation.Valid;
79
import lombok.RequiredArgsConstructor;
810
import org.springframework.security.core.annotation.AuthenticationPrincipal;
9-
import org.springframework.web.bind.annotation.GetMapping;
10-
import org.springframework.web.bind.annotation.RequestMapping;
11-
import org.springframework.web.bind.annotation.RestController;
11+
import org.springframework.web.bind.annotation.*;
1212

1313
@RestController
1414
@RequestMapping("/me/profile")
@@ -23,4 +23,10 @@ public RsData<ProfileResponseDto> getProfile(@AuthenticationPrincipal(expression
2323
ProfileResponseDto body = profileService.getProfile(userId);
2424
return RsData.successOf(body); // code=200, message="success"
2525
}
26+
27+
@PutMapping
28+
public RsData<ProfileResponseDto> updateProfile(@AuthenticationPrincipal(expression = "id") Long userId, @Valid @RequestBody ProfileUpdateRequestDto profileUpdateRequestDto) {
29+
ProfileResponseDto body = profileService.updateProfile(userId, profileUpdateRequestDto);
30+
return RsData.successOf(body); // code=200
31+
}
2632
}

0 commit comments

Comments
 (0)