ClientController.java 901 B

123456789101112131415161718192021222324252627282930
  1. package com.example.hotel.controller.user;
  2. import com.example.hotel.bl.user.ClientService;
  3. import com.example.hotel.util.Result;
  4. import com.example.hotel.vo.OrderVO;
  5. import com.example.hotel.vo.ResponseVO;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.web.bind.annotation.PostMapping;
  8. import org.springframework.web.bind.annotation.RequestBody;
  9. import org.springframework.web.bind.annotation.RequestMapping;
  10. import org.springframework.web.bind.annotation.RestController;
  11. /**
  12. * @Author: chenyizong
  13. * @Date: 2020-02-29
  14. */
  15. @RestController()
  16. @RequestMapping("/api")
  17. public class ClientController {
  18. @Autowired
  19. private ClientService clientService;
  20. @PostMapping("/hotel/reserve")
  21. public ResponseVO reserveHotel(@RequestBody OrderVO orderVO){
  22. clientService.addOrder(orderVO);
  23. return ResponseVO.buildSuccess(orderVO);
  24. }
  25. }