老师,前台商品列表报20000的错,商品详情postman报404
来源:6-11 商品模块测试与总结
慕婉清5162727
2022-02-03 16:17:01
老师,前台商品列表报20000的错,商品详情postman报404,商品详情日志有记录



其中代码如下
Product (Integer id){
Product product=.selectByPrimaryKey(id)product}
PageInfo (ProductListReq productListReq){
ProductListQuery productListQuery=ProductListQuery()(!StringUtils.(productListReq.getKeyword())){
String keyword=StringBuilder().append().append(productListReq.getKeyword())
.append().toString()productListQuery.setKeyword(keyword)}
(productListReq.getCategoryId() !=){
List<CategoryVo> categoryVoList= .listCategoryForCustomer(productListReq.getCategoryId())ArrayList<Integer> categoryIds=ArrayList<>()categoryIds.add(productListReq.getCategoryId())getCategoryIds(categoryVoListcategoryIds)productListQuery.setCategoryIds(categoryIds)}
String orderBy = productListReq.getOrderBy()(ProductListOrderBy..contains(orderBy)){
PageHelper.(productListReq.getPageNum()productListReq.getPageSize()orderBy)}{
PageHelper.(productListReq.getPageNum()productListReq.getPageSize())}
List<Product> productList=.selectList(productListQuery)PageInfo pageInfo=PageInfo(productList)pageInfo}
(List<CategoryVo> categoryVOListArrayList<Integer> categoryIds){
(i=i<categoryVOList.size()i++){
CategoryVo categoryVO=categoryVOList.get(i)(categoryVO !=){
categoryIds.add(categoryVO.getId())getCategoryIds(categoryVO.getChildCategory()categoryIds)}
}
}
ProductController {
ProductService ()
()
ApiRestResponse (Integer id){
Product product=.detail(id)ApiRestResponse.(product)}
()
()
ApiRestResponse (ProductListReq productListReq){
PageInfo list=.list(productListReq)ApiRestResponse.(list)}
}1回答
好帮手慕小脸
2022-02-05
同学你好,
1、建议查看idea控制台是否出现报错信息,如果有,建议同学将报错信息反馈
2、404是访问路径不正确,建议同学对比课程里老师演示的路径检查一下自己书写的内容是否正确?
祝学习愉快~
相似问题