-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[FEAT] Member 관련 기능 구현
- Loading branch information
Showing
11 changed files
with
168 additions
and
16 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
plu-api/src/main/kotlin/com/th/plu/api/controller/member/MemberController.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.th.plu.api.controller.member | ||
|
||
import com.th.plu.api.config.interceptor.Auth | ||
import com.th.plu.api.config.resolver.MemberId | ||
import com.th.plu.api.controller.member.dto.request.CheckNicknameRequestDto | ||
import com.th.plu.api.controller.member.dto.request.UpdateNicknameRequestDto | ||
import com.th.plu.api.controller.member.dto.response.CheckNicknameResponse | ||
import com.th.plu.api.controller.member.dto.response.MyPageResponseDto | ||
import com.th.plu.api.service.member.MemberService | ||
import com.th.plu.common.dto.response.ApiResponse | ||
import io.swagger.v3.oas.annotations.Operation | ||
import io.swagger.v3.oas.annotations.tags.Tag | ||
import org.springframework.web.bind.annotation.* | ||
|
||
@Tag(name = "Member") | ||
@RestController | ||
class MemberController( | ||
private val memberService: MemberService, | ||
) { | ||
@Operation(summary = "닉네임 중복 체크") | ||
@PostMapping("/api/v1/member/nickname/dupl") | ||
fun checkNicknameDuplication(@RequestBody request: CheckNicknameRequestDto): ApiResponse<CheckNicknameResponse> { | ||
val response = memberService.checkNicknameDuplication(request) | ||
return ApiResponse.success(response) | ||
} | ||
|
||
@Auth | ||
@Operation(summary = "[인증] 닉네임 수정") | ||
@PutMapping("/api/v1/member/{memberId}/nickname") | ||
fun updateNickname( | ||
@PathVariable memberId: Long, | ||
@RequestBody request: UpdateNicknameRequestDto | ||
): ApiResponse<Any> { | ||
memberService.updateNickname(memberId, request.newNickname) | ||
return ApiResponse.success() | ||
} | ||
|
||
@Auth | ||
@Operation(summary = "[인증] 회원 탈퇴") | ||
@DeleteMapping("/api/v1/member") | ||
fun deleteMember(@MemberId memberId: Long): ApiResponse<Any> { | ||
memberService.deleteMember(memberId) | ||
return ApiResponse.success() | ||
} | ||
|
||
@Auth | ||
@Operation(summary = "[인증] 마이페이지 조회") | ||
@GetMapping("/api/v1/mypage") | ||
fun getMyPageInfo(@MemberId memberId: Long): ApiResponse<MyPageResponseDto> { | ||
val myPageInfo = memberService.getMyPageInfo(memberId) | ||
return ApiResponse.success(data = myPageInfo) | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...i/src/main/kotlin/com/th/plu/api/controller/member/dto/request/CheckNicknameRequestDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.th.plu.api.controller.member.dto.request | ||
|
||
data class CheckNicknameRequestDto( | ||
val nickname: String | ||
) |
5 changes: 5 additions & 0 deletions
5
.../src/main/kotlin/com/th/plu/api/controller/member/dto/request/UpdateNicknameRequestDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.th.plu.api.controller.member.dto.request | ||
|
||
data class UpdateNicknameRequestDto( | ||
val newNickname: String | ||
) |
5 changes: 5 additions & 0 deletions
5
...src/main/kotlin/com/th/plu/api/controller/member/dto/response/CheckNickNameResponseDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.th.plu.api.controller.member.dto.response | ||
|
||
data class CheckNicknameResponse( | ||
val isAvailable: Boolean | ||
) |
6 changes: 6 additions & 0 deletions
6
plu-api/src/main/kotlin/com/th/plu/api/controller/member/dto/response/MyPageResponseDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 MyPageResponseDto( | ||
val nickname: String, | ||
val notificationStatus: Boolean | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters