老师,前台商品列表报20000的错,商品详情postman报404

来源:6-11 商品模块测试与总结

慕婉清5162727

2022-02-03 16:17:01

老师,前台商品列表报20000的错,商品详情postman报404,商品详情日志有记录

https://img.mukewang.com/climg/61fb8ec70901d8b512990236.jpg

https://img.mukewang.com/climg/61fb8ec709a7c97309080544.jpg

https://img.mukewang.com/climg/61fb8ec70906d55909020488.jpg


其中代码如下

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是访问路径不正确,建议同学对比课程里老师演示的路径检查一下自己书写的内容是否正确?

祝学习愉快~

0

0 学习 · 9886 问题

查看课程