有些接口没有实现,前端拿不到数据,控制台已经报错了,所以按下去没有反应。
F12 ---> consle控制台 ;按下按钮后会报错红字显示前端页面哪个数据没有拿到,然后检查相应的接口有没有写
我的是这个接口没有写,“根据房间id获取可选支付方式列表”,在“package com.atguigu.lease.web.app.controller.payment;”包下
编写Controller层逻辑
在PaymentTypeController
中增加如下内容
@Operation(summary = "根据房间id获取可选支付方式列表")
@GetMapping("listByRoomId")
public Result<List<PaymentType>> list(@RequestParam Long id) {
List<PaymentType> list = service.listByRoomId(id);
return Result.ok(list);
}
编写Service层逻辑
在PaymentTypeService
中增加如下内容
List<PaymentType> listByRoomId(Long id);
在PaymentTypeServiceImpl
中增加如下内容
@Override
public List<PaymentType> listByRoomId(Long id) {
return paymentTypeMapper.selectListByRoomId(id);
}
推荐阅读:
尚硅谷尚庭公寓
在SpringMVC中接收枚举类型参数
Mybatis-Plus更新策略修改
慎用 rm -rf命令
RedistTemplate类型选择和使用
redis缓存一致性问题
阿里云短信验证码服务
SpringBoot方法启动新的线程异步执行的注解
xml文件`<`和`>`的转义
mybatis collection解析以及和association的区别
行动消除疑虑