老师这张里面获取currentShop不做currentShop为空的情况的处理吗
来源:7-3 商品类别批量添加后端开发

夜Y
2018-12-07
RT
写回答
1回答
-
翔仔
2018-12-07
同学好,咱们做了呀
private Result<List<ProductCategory>> getProductCategoryList(HttpServletRequest request) { Shop currentShop = (Shop) request.getSession().getAttribute("currentShop"); List<ProductCategory> list = null; if (currentShop != null && currentShop.getShopId() > 0) { list = productCategoryService.getProductCategoryList(currentShop.getShopId()); return new Result<List<ProductCategory>>(true, list); } else { ProductCategoryStateEnum ps = ProductCategoryStateEnum.INNER_ERROR; return new Result<List<ProductCategory>>(false, ps.getState(), ps.getStateInfo()); } }
012018-12-07
相似问题