From 0fb31faeee5ffa788a18da10f9bb51601f5d9e7e Mon Sep 17 00:00:00 2001 From: yeseul106 <20191037@sungshin.ac.kr> Date: Thu, 9 Nov 2023 13:08:59 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[FEAT]=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=8B=9C,=20memberId=EB=8F=84=20=EA=B0=99=EC=9D=B4=20=EB=82=B4?= =?UTF-8?q?=EB=A0=A4=EC=A3=BC=EB=8F=84=EB=A1=9D=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/auth/dto/response/AuthLoginResponseDto.java | 2 ++ .../katchupserver/api/auth/service/Impl/AuthServiceImpl.java | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/site/katchup/katchupserver/api/auth/dto/response/AuthLoginResponseDto.java b/src/main/java/site/katchup/katchupserver/api/auth/dto/response/AuthLoginResponseDto.java index de8719b..d2e7d03 100644 --- a/src/main/java/site/katchup/katchupserver/api/auth/dto/response/AuthLoginResponseDto.java +++ b/src/main/java/site/katchup/katchupserver/api/auth/dto/response/AuthLoginResponseDto.java @@ -11,6 +11,8 @@ public class AuthLoginResponseDto { @Schema(description = "닉네임", example = "unan") private String nickname; + @Schema(description = "멤버 고유 id", example = "382") + private Long memberId; @Schema(description = "Katchup Access Token", example = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1bmFuIiwiaWF0IjoxNjI0NjQ0NjY2LCJleHAiOj") private String accessToken; @Schema(description = "Katchup Refresh Token", example = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1bmFuIiwiaWF0IjoxNjI0NjQ0NjY2LCJleHAiOj") diff --git a/src/main/java/site/katchup/katchupserver/api/auth/service/Impl/AuthServiceImpl.java b/src/main/java/site/katchup/katchupserver/api/auth/service/Impl/AuthServiceImpl.java index 2ca354c..7d0c280 100644 --- a/src/main/java/site/katchup/katchupserver/api/auth/service/Impl/AuthServiceImpl.java +++ b/src/main/java/site/katchup/katchupserver/api/auth/service/Impl/AuthServiceImpl.java @@ -52,7 +52,9 @@ public AuthLoginResponseDto socialLogin(AuthRequestDto authRequestDto) { Member signedMember = memberRepository.findByEmailOrThrow(email); - Authentication authentication = new UserAuthentication(signedMember.getId(), null, null); + Long memberId = signedMember.getId(); + + Authentication authentication = new UserAuthentication(memberId, null, null); String accessToken = jwtTokenProvider.generateAccessToken(authentication); @@ -60,6 +62,7 @@ public AuthLoginResponseDto socialLogin(AuthRequestDto authRequestDto) { return AuthLoginResponseDto.builder() .nickname(nickname) + .memberId(memberId) .accessToken(accessToken) .refreshToken(refreshToken) .isNewUser(signedMember.isNewUser()) From b6eb99d8e6070d40e781803e2f7bdd7e8f38ea9c Mon Sep 17 00:00:00 2001 From: yeseul106 <20191037@sungshin.ac.kr> Date: Thu, 9 Nov 2023 13:35:03 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[FIX]=20=EC=B9=B4=ED=85=8C=EA=B3=A0?= =?UTF-8?q?=EB=A6=AC=20=EB=AA=A9=EB=A1=9D=20=EC=A1=B0=ED=9A=8C=20=EC=8B=9C?= =?UTF-8?q?,=20=EC=9E=91=EC=84=B1=ED=95=9C=20=EC=9C=A0=EC=A0=80=EC=9D=98?= =?UTF-8?q?=20id=EC=97=90=20=EB=94=B0=EB=9D=BC=20=EC=A1=B0=ED=9A=8C?= =?UTF-8?q?=EB=90=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/category/controller/CategoryController.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/site/katchup/katchupserver/api/category/controller/CategoryController.java b/src/main/java/site/katchup/katchupserver/api/category/controller/CategoryController.java index 947e2e4..a0212a0 100644 --- a/src/main/java/site/katchup/katchupserver/api/category/controller/CategoryController.java +++ b/src/main/java/site/katchup/katchupserver/api/category/controller/CategoryController.java @@ -52,11 +52,10 @@ public ApiResponseDto createCategoryName(Principal principal, @ApiResponse(responseCode = "400", description = "카테고리 목록 조회 실패", content = @Content), @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) }) - @GetMapping() + @GetMapping("/{memberId}") @ResponseStatus(HttpStatus.OK) - public ApiResponseDto> getAllCategory(Principal principal, + public ApiResponseDto> getAllCategory(@PathVariable final Long memberId, @RequestParam(name = "isShared", required = false) Boolean isShared) { - Long memberId = MemberUtil.getMemberId(principal); if (isShared != null && isShared) { return ApiResponseDto.success(categoryService.getSharedCategories(memberId)); }