根据商品等级查询商品分类信息(三层嵌套)
1.实现商品分类
1.1设计数据库表
商品类表item_cat
1.2项目改造
1.2.1导入mybatis-puls的jar包
1.2.2编辑项目中ItemCat 在包Pojo中
1.2.2编辑项目中ItemCatMapper
1.2.3编辑YML配置文件
模块的层级项目的创建
1.3前端商品模块的跳转
1.4前端分类列表的展现
1.4.1 前端页面的分析
1.生命周期函数
2.页面跳转axio请求
1.4.2 业务接口文档分析
1.4.3 编辑ItemCatController
使用的get请求和restful数据请求,需要在接受参数前面加注解@PathVariable
//等级查询商品分类信息
@GetMapping("/findItemCatList/{level}")
public SysResult findItemCatList(@PathVariable Integer level) {
return SysResult.success(itemCatService.findItemCatList(level));
}
1.4.4 编辑ItemCatServiceImpl—常规利用mybatis-plus(效率较低)
@Service
public class ItemCatServiceImpl implements ItemCatService {
@Autowired
ItemCatMapper itemCatMapper;
public List<ItemCat> findItemCatList(Integer level) {
long startTime =System.currentTimeMillis();
//查询一级商品分类信息
QueryWrapper<ItemCat> queryWrapper=new QueryWrapper