Skip to content

Commit

Permalink
Feat: 콜백 단건 조회 기능 추가 (#80)
Browse files Browse the repository at this point in the history
* feat: 콜백 단건 조회 기능 추가

* refactor: 포인트 로그 멘트 수정
  • Loading branch information
zzoe2346 authored Oct 17, 2024
1 parent bb1cc88 commit e7b3a4d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,12 @@ public ResponseEntity<Page<CallbackUsageHistoryResponse>> getAcceptedCallback(@M

return ResponseEntity.ok(callbackService.getCallbackHistoryOfGuard(memberId, pageable));
}

@Operation(summary = "콜백 단건 조회", description = "콜백 id 로 콜백을 단건 조회합니다.")
@GetMapping("/{callbackId}")
public ResponseEntity<CallbackResponse> getCallback(@PathVariable("callbackId") Long callbackId) {

return ResponseEntity.ok(callbackService.getCallback(callbackId));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -226,4 +226,13 @@ public Page<CallbackUsageHistoryResponse> getCallbackHistoryOfGuard(Long memberI
return callbackRepository.findAllBySeniorIn(seniors, pageable)
.map(callback -> new CallbackUsageHistoryResponse(callback.getId(), callback.getSeniorName(), callback.getPostTime(), callback.getStatus()));
}

public CallbackResponse getCallback(Long callbackId) {

Callback callback = callbackRepository.findById(callbackId)
.orElseThrow(() -> new NotExistCallbackException("해당 콜백 id에 해당하는 콜백이 없습니다."));

return new CallbackResponse(callback.getId(), callback.getSeniorName(), callback.getPostTime(), callback.getStatus(), callback.getSeniorId());
}

}

0 comments on commit e7b3a4d

Please sign in to comment.