package com.ruoyi.order.controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
/**
|
* <p>
|
* 订单表 前端控制器
|
* </p>
|
*
|
* @author mitao
|
* @since 2024-05-16
|
*/
|
@Slf4j
|
@RestController
|
@RequestMapping("/order")
|
@AllArgsConstructor
|
public class OrderController {
|
|
private final IOrderService orderService;
|
@PostMapping("/saveOrderOne")
|
@ResponseBody
|
public R<T> saveOrderOne(@RequestBody OrderDTO OrderDTO) {
|
orderService.saveOrderOne(OrderDTO);
|
|
return R.ok();
|
|
}
|
|
|
/**
|
* 获取某个商品的已购会员数
|
*
|
* @param id 秒杀商品id
|
* @return 已购会员数
|
*/
|
@InnerAuth
|
@GetMapping("/seckill-members/{id}")
|
R<Integer> getSeckillMembers(@PathVariable("id") Long id) {
|
return R.ok(orderService.getSeckillMembers(id));
|
}
|
}
|