| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- package com.example.hotel.controller.order;
- import com.example.hotel.blImpl.order.OrderServiceImpl;
- import com.example.hotel.vo.OrderVO;
- import com.example.hotel.vo.ResponseVO;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.util.List;
- /**
- * @Author: chenyizong
- * @Date: 2020-02-29
- */
- @RestController()
- @RequestMapping("/api/order")
- public class OrderController {
- @Autowired
- private OrderServiceImpl orderService;
- @PostMapping("/addOrder")
- public ResponseVO reserveHotel(@RequestBody OrderVO orderVO){
- // clientService.addOrder(orderVO);
- return ResponseVO.buildSuccess(orderVO);
- }
- @GetMapping("/getAllOrders")
- public ResponseVO retrieveAllOrders(){
- return ResponseVO.buildSuccess(orderService.getAllOrders());
- }
- @GetMapping("/{userid}/getUserOrders")
- public ResponseVO retrieveUserOrders(@PathVariable int userid){
- return ResponseVO.buildSuccess(orderService.getUserOrders(userid));
- }
- }
|