Skip to content

Commit

Permalink
[FIX] V3 배지 목록 조회 Controller 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
unanchoi committed Apr 22, 2024
1 parent 22d419e commit 3967edc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.smeem.api.badge.api.v3;

import com.smeem.api.badge.api.dto.response.BadgeListResponseV3;
import com.smeem.api.badge.service.dto.response.v3.BadgeListServiceResponseV3;
import com.smeem.api.common.FailureResponse;
import com.smeem.api.common.SuccessResponse;
Expand All @@ -25,6 +26,6 @@ public interface BadgeV3Api {
@ApiResponse(responseCode = "500", description = "서버 내부 오류", content = @Content(schema = @Schema(implementation = FailureResponse.class)))
})
@GetMapping
ResponseEntity<SuccessResponse<BadgeListServiceResponseV3>> getBadges(@Parameter(hidden = true) Principal principal);
ResponseEntity<SuccessResponse<BadgeListResponseV3>> getBadges(@Parameter(hidden = true) Principal principal);

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,25 @@
import lombok.val;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

import static com.smeem.common.code.success.BadgeSuccessCode.SUCCESS_GET_BADGES;

@RestController("api/v3/members/badges")
@RestController
@RequiredArgsConstructor
public class BadgeV3Controller {
@RequestMapping("/api/v3/members/badges")
public class BadgeV3Controller implements BadgeV3Api {

private final BadgeService badgeService;

@GetMapping
public ResponseEntity<SuccessResponse<BadgeListResponseV3>> getBadges(Principal principal) {
val memberId = PrincipalConverter.getMemberId(principal);
val response = BadgeListResponseV3.from(badgeService.getBadgesV3(BadgeListServiceRequestV3.of(memberId)));
return ApiResponseGenerator.success(SUCCESS_GET_BADGES, response);
@GetMapping
public ResponseEntity<SuccessResponse<BadgeListResponseV3>> getBadges(Principal principal) {
val memberId = PrincipalConverter.getMemberId(principal);
val response = BadgeListResponseV3.from(badgeService.getBadgesV3(BadgeListServiceRequestV3.of(memberId)));
return ApiResponseGenerator.success(SUCCESS_GET_BADGES, response);
}

}

0 comments on commit 3967edc

Please sign in to comment.