mitao
2024-05-21 17ecaecf46d5497aec0fcb9d9fcacb8591003285
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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));
    }
}