2025-10-15 17:38:13 +08:00
|
|
|
|
package com.cdzy.user.controller;
|
|
|
|
|
|
|
2025-10-16 11:39:47 +08:00
|
|
|
|
import com.cdzy.common.model.response.JsonResult;
|
2025-10-17 17:32:20 +08:00
|
|
|
|
import com.cdzy.user.model.entity.EbikeOrderTransaction;
|
|
|
|
|
|
import com.cdzy.user.service.EbikeOrderTransactionService;
|
2025-10-15 17:38:13 +08:00
|
|
|
|
import jakarta.annotation.Resource;
|
2025-10-16 11:39:47 +08:00
|
|
|
|
import jakarta.validation.constraints.NotBlank;
|
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
2025-10-15 17:38:13 +08:00
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
2025-10-16 11:39:47 +08:00
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
2025-10-15 17:38:13 +08:00
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 用户订单 控制层
|
|
|
|
|
|
*
|
|
|
|
|
|
* @Author: yanglei
|
|
|
|
|
|
* @Since: 2025-10-15 17:15
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
@RestController
|
2025-10-17 17:32:20 +08:00
|
|
|
|
@RequestMapping("/ebikeOrderTransaction")
|
|
|
|
|
|
public class EbikeOrderTransactionController {
|
2025-10-15 17:38:13 +08:00
|
|
|
|
|
|
|
|
|
|
@Resource
|
2025-10-17 17:32:20 +08:00
|
|
|
|
private EbikeOrderTransactionService ebikeOrderTransactionService;
|
2025-10-15 17:38:13 +08:00
|
|
|
|
|
2025-10-16 11:39:47 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 查看用户是否有未完成订单。
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param userId 用户id
|
|
|
|
|
|
* @ {@code 200} 添加成功,{@code 500} 添加失败
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("checkHistoryOrder")
|
|
|
|
|
|
public JsonResult<?> checkHistoryOrder(@Validated @NotBlank(message = "用户id不能为空") @RequestParam("userId") Long userId) {
|
2025-10-17 17:32:20 +08:00
|
|
|
|
EbikeOrderTransaction userOrders = ebikeOrderTransactionService.checkHistoryOrder(userId);
|
2025-10-16 11:39:47 +08:00
|
|
|
|
return JsonResult.success(userOrders);
|
|
|
|
|
|
}
|
2025-10-15 17:38:13 +08:00
|
|
|
|
|
|
|
|
|
|
}
|