OrderController.java 834 B

1234567891011121314151617181920212223242526272829
  1. package com.sf.controller;
  2. import com.sf.domain.CommonResult;
  3. import com.sf.domain.Order;
  4. import com.sf.service.OrderService;
  5. import lombok.extern.slf4j.Slf4j;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.web.bind.annotation.GetMapping;
  8. import org.springframework.web.bind.annotation.RequestMapping;
  9. import org.springframework.web.bind.annotation.RequestMethod;
  10. import org.springframework.web.bind.annotation.RestController;
  11. import javax.print.attribute.standard.PrinterURI;
  12. @RestController
  13. @Slf4j
  14. public class OrderController {
  15. @Autowired
  16. private OrderService orderService;
  17. @GetMapping(value = "/order/create")
  18. public CommonResult<Object> create(Order order){
  19. orderService.create(order);
  20. return new CommonResult<>(200,"订单创建成功");
  21. }
  22. }