Skip to content

Instantly share code, notes, and snippets.

@sonus21
Created April 9, 2023 10:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sonus21/3deb8ef03ea4be53005a9100091edd33 to your computer and use it in GitHub Desktop.
Save sonus21/3deb8ef03ea4be53005a9100091edd33 to your computer and use it in GitHub Desktop.
OrderController
@RequestMapping("/api/v1/orders")
@RestController
@Database(Constants.SECONDARY)
public class OrderController {
private final OrderService orderService;
public OrderController(OrderService orderService) {
this.orderService = orderService;
}
@PostMapping("")
@Database(Constants.PRIMARY)
public CreateOrderResponse createOrder(@RequestBody @Valid CreateOrderRequest request) {
return orderService.createOrder(request);
}
@GetMapping("/{id}")
public CreateOrderResponse orderDetail(@PathVariable Long id) {
return orderService.orderDetail(id);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment