Skip to content

Commit 5abc38f

Browse files
committed
feat: 로그인한 사용자 프로필 조회 API 추가
1 parent 835799c commit 5abc38f

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.back.domain.profile.controller;
2+
3+
import com.back.domain.profile.dto.ProfileResponseDto;
4+
import com.back.domain.profile.service.ProfileService;
5+
import com.back.domain.user.service.UserService;
6+
import com.back.global.rsData.RsData;
7+
import lombok.RequiredArgsConstructor;
8+
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;
12+
13+
@RestController
14+
@RequestMapping("/me/profile")
15+
@RequiredArgsConstructor
16+
public class ProfileController {
17+
18+
private final UserService userService;
19+
private final ProfileService profileService;
20+
21+
@GetMapping
22+
public RsData<ProfileResponseDto> getProfile(@AuthenticationPrincipal(expression = "id") Long userId) {
23+
ProfileResponseDto body = profileService.getProfile(userId);
24+
return RsData.successOf(body); // code=200, message="success"
25+
}
26+
}

0 commit comments

Comments
 (0)