xuhy
2024-08-09 2bae01db4eab159eb004ebf1e2d7fa3ae40fbeb9
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
package com.ruoyi.order.controller;
 
 
import com.ruoyi.common.core.domain.R;
import com.ruoyi.order.api.model.TChargingOrder;
import com.ruoyi.order.service.TChargingOrderService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
 
/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xiaochen
 * @since 2024-08-07
 */
@Api(tags = "充电订单")
@RestController
@RequestMapping("/t-charging-order")
public class TChargingOrderController {
 
    @Resource
    private TChargingOrderService chargingOrderService;
    //用户订单数量
    @PostMapping(value = "/useOrderCount")
    public R<Long> useOrderCount(@RequestParam Long userId) {
        Long count = chargingOrderService.lambdaQuery().eq(TChargingOrder::getAppUserId, userId).count();
 
        return R.ok(count);
    }
    //订单详情
    @PostMapping(value = "/detail")
    public R<TChargingOrder> detail(@RequestParam Long orderId) {
        return R.ok(chargingOrderService.getById(orderId));
    }
 
}