Skip to content

Commit

Permalink
✨: feat 마이페이지 조회 API 추가 #24
Browse files Browse the repository at this point in the history
  • Loading branch information
sookyungg committed Mar 3, 2024
1 parent d90f083 commit 99bb755
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,12 @@ class MemberController(
memberService.deleteMember(memberId)
return ApiResponse.success()
}


@Auth
@Operation(summary = "[인증] 마이페이지 조회")
@GetMapping("/api/v1/mypage")
fun getMyPageInfo(@MemberId memberId: Long): ApiResponse<MyPageResponse> {
val myPageInfo = memberService.getMyPageInfo(memberId)
return ApiResponse.success(data = myPageInfo)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.th.plu.api.controller.member.dto.response

data class MyPageResponse(
val nickname: String,
val notificationStatus: Boolean
)
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,13 @@ class MemberService(
memberRepository.delete(member)
}

@Transactional(readOnly = true)
fun getMyPageInfo(memberId: Long): MyPageResponse {
val member = memberExplorer.findMemberById(memberId)
return MyPageResponse(
nickname = member.onboarding?.nickname ?: "",
notificationStatus = member.setting.notificationStatus
)
}

}

0 comments on commit 99bb755

Please sign in to comment.