Skip to content

Commit

Permalink
[Feature] - 여행기 상세 조회 Controller 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
nak-honest authored Jul 15, 2024
1 parent c6a2dd6 commit cbe808c
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package woowacourse.touroot.travelogue.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import woowacourse.touroot.travelogue.dto.TravelogueResponse;
import woowacourse.touroot.travelogue.service.TravelogueService;

@RequiredArgsConstructor
@RestController
@RequestMapping("api/v1/travelogues")
public class TravelogueController {

private final TravelogueService travelogueService;

@GetMapping("/{id}")
public ResponseEntity<TravelogueResponse> findTravelogue(@PathVariable Long id) {
return ResponseEntity.ok(travelogueService.findTravelogueById(id));
}
}

0 comments on commit cbe808c

Please sign in to comment.