39 lines
1.2 KiB
Java
39 lines
1.2 KiB
Java
|
package com.sky.controller.user;
|
||
|
|
||
|
import com.sky.dto.OrdersSubmitDTO;
|
||
|
import com.sky.result.Result;
|
||
|
import com.sky.service.OrderService;
|
||
|
import com.sky.vo.OrderSubmitVO;
|
||
|
import io.swagger.annotations.Api;
|
||
|
import io.swagger.annotations.ApiOperation;
|
||
|
import lombok.extern.slf4j.Slf4j;
|
||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||
|
import org.springframework.web.bind.annotation.RestController;
|
||
|
|
||
|
import javax.annotation.Resource;
|
||
|
|
||
|
@RestController("userOrderController")
|
||
|
@RequestMapping("/user/order")
|
||
|
@Api(tags = "用户端订单相关接口")
|
||
|
@Slf4j
|
||
|
public class OrderController {
|
||
|
@Resource
|
||
|
private OrderService orderService;
|
||
|
|
||
|
/**
|
||
|
* 用户下单
|
||
|
*
|
||
|
* @param ordersSubmitDTO 订单请求数据
|
||
|
* @return Result<OrderSubmitVO>
|
||
|
*/
|
||
|
@ApiOperation("用户下单")
|
||
|
@PostMapping("/submit")
|
||
|
public Result<OrderSubmitVO> submit(@RequestBody OrdersSubmitDTO ordersSubmitDTO) {
|
||
|
log.info("用户下单:{}", ordersSubmitDTO);
|
||
|
OrderSubmitVO orderSubmitVO = orderService.submitOrder(ordersSubmitDTO);
|
||
|
return Result.success(orderSubmitVO);
|
||
|
}
|
||
|
}
|