Skip to content

Commit

Permalink
chore: validated message 설정 (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
gahyuun committed Jan 16, 2025
1 parent b69a80c commit f57e190
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.acon.server.spot.api.response.MenuListResponse;
import com.acon.server.spot.application.service.SpotService;
import jakarta.validation.constraints.Positive;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
Expand All @@ -10,18 +11,20 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v1")
@RestController
public class SpotController {

private final SpotService spotService;

@GetMapping("/spot/{spotId}/menus")
public ResponseEntity<MenuListResponse> getMenus(
@PathVariable(name = "spotId") Long spotId
@Positive(message = "spotId는 양수여야 합니다.")
@Validated @PathVariable(name = "spotId") Long spotId
) {
return ResponseEntity.ok(spotService.fetchMenus(spotId));
return ResponseEntity.ok(
spotService.fetchMenus(spotId)
);
}
}

0 comments on commit f57e190

Please sign in to comment.