苍穹外卖--用户下单功能实现

This commit is contained in:
2025-11-25 14:22:59 +08:00
parent 7379722375
commit bafbea94df
7 changed files with 197 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
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.beans.factory.annotation.Autowired;
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;
@RestController
@Slf4j
@RequestMapping("/user/order")
@Api(tags = "用户端订单相关的接口")
public class OrderController {
@Autowired
private OrderService orderService;
@PostMapping("/submit")
@ApiOperation("用户下单")
public Result<OrderSubmitVO> submit(@RequestBody OrdersSubmitDTO ordersSubmitDTO) {
log.info("用户下单:{}",ordersSubmitDTO);
//调用业务端接口
OrderSubmitVO orderSubmitVO = orderService.submit(ordersSubmitDTO);
return Result.success(orderSubmitVO);
}
}