Skip to content

Commit

Permalink
refactor: Card 관련 기능 리팩토링 (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
xxoznge authored Jul 4, 2024
1 parent d5d0efc commit 81aca25
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,9 @@ public ApiResponse<CardDetailGetResponse> getCardDetail(
return ApiResponse.onSuccess(cardQueryService.getCardDetail(cardId));
}

@DeleteMapping("/{cardId}")
public ApiResponse<String> deleteCard(
@UserResolver User authUser,
@PathVariable Long cardId) {
cardService.deleteCard(authUser, cardId);
return ApiResponse.onSuccess("삭제 성공");
@GetMapping("/top")
public ApiResponse<List<CardSummaryGetResponse>> getTopCardToday() {
return ApiResponse.onSuccess(cardQueryService.getTopCardToday());
}

@GetMapping("")
Expand All @@ -81,7 +78,6 @@ public ApiResponse<List<CardSummaryGetResponse>> getTypeCard(
@RequestParam(name = "type") FortuneType type,
@RequestParam(name = "sort") CardStatus sortStatus
) {

if (sortStatus == CardStatus.RECENT) {
return ApiResponse.onSuccess(cardQueryService.getRecentTypeCard(type));
}
Expand All @@ -92,8 +88,11 @@ public ApiResponse<List<CardSummaryGetResponse>> getTypeCard(
return ApiResponse.onSuccess(Collections.emptyList());
}

@GetMapping("/top")
public ApiResponse<List<CardSummaryGetResponse>> getTopCardToday() {
return ApiResponse.onSuccess(cardQueryService.getTopCardToday());
@DeleteMapping("/{cardId}")
public ApiResponse<String> deleteCard(
@UserResolver User authUser,
@PathVariable Long cardId) {
cardService.deleteCard(authUser, cardId);
return ApiResponse.onSuccess("삭제 성공");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public record CardCreateRequest(
public Card toEntity(
User cardUser
) {

return Card.builder()
.title(title)
.mood(mood)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.ddabong.ddabongdotchiBE.domain.card.entity;

public enum FortuneType {

LUCK,
LOVE,
WEALTH,
Expand Down

0 comments on commit 81aca25

Please sign in to comment.