获取用户交易信息接口 - @RequestMapping("/tradeinfo")
获取用户交易信息接口
该接口使用 @RequestMapping("/tradeinfo") 注解进行映射,用于获取指定用户ID (uid) 的交易信息列表。
@RequestMapping("/tradeinfo")
public CounterRes tradeQuery(@RequestParam long uid)
throws Exception {
List<TradeInfo> tradeList = orderService.getTradeList(uid);
return new CounterRes(tradeList);
}
接口参数:
- uid: 用户ID,long 类型
接口逻辑:
- 接收名为 'uid' 的 long 类型参数。
- 调用 orderService 的
getTradeList方法,传入 'uid' 参数,获取与该用户 ID 相关的交易信息列表。 - 将获取到的交易信息列表作为参数传递给
CounterRes的构造函数,创建一个新的CounterRes对象。 - 返回创建的
CounterRes对象作为响应。
返回值:
CounterRes对象,包含获取到的交易信息列表。
原文地址: https://www.cveoy.top/t/topic/oTEA 著作权归作者所有。请勿转载和采集!