package com.ylx.order.controller; import com.ylx.common.core.domain.R; import com.ylx.order.domain.dto.OrderSubmitDTO; import com.ylx.order.service.TOrderService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; 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 @RequestMapping("/order") @Api(tags = {"订单模块"}) @Slf4j public class OrderController { @Resource private TOrderService orderService; @PreAuthorize("@customerAuth.isCustomer()") @ApiOperation("客户端用户提交订单") @PostMapping("/submit") public R submitOrder(@Validated @RequestBody OrderSubmitDTO dto) { this.orderService.submitOrder(dto); return R.ok(); } }