| | |
| | | package cn.lili.controller.goods; |
| | | |
| | | import cn.lili.common.enums.ResultUtil; |
| | | import cn.lili.common.security.AuthUser; |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.common.vo.ResultMessage; |
| | | import cn.lili.modules.goods.entity.vos.CategoryBrandVO; |
| | | import cn.lili.modules.goods.entity.vos.CategoryVO; |
| | | import cn.lili.modules.goods.service.CategoryBrandService; |
| | | import cn.lili.modules.goods.service.CategoryService; |
| | | import cn.lili.modules.member.entity.dos.Clerk; |
| | | import cn.lili.modules.member.service.ClerkService; |
| | | import cn.lili.modules.store.service.StoreDetailService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | */ |
| | | @Autowired |
| | | private StoreDetailService storeDetailService; |
| | | @Autowired |
| | | private ClerkService clerkService; |
| | | |
| | | @ApiOperation(value = "获取店铺经营的分类") |
| | | @GetMapping(value = "/all") |
| | | public ResultMessage<List<CategoryVO>> getListAll() { |
| | | |
| | | String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId(); |
| | | if (StringUtils.isEmpty(storeId)) { |
| | | Clerk clerk = clerkService.getClerkByMemberId(UserContext.getCurrentUserId()); |
| | | storeId = clerk.getStoreId(); |
| | | } |
| | | |
| | | //获取店铺经营范围 |
| | | String goodsManagementCategory = storeDetailService.getStoreDetail(storeId).getGoodsManagementCategory(); |
| | | return ResultUtil.data(this.categoryService.getStoreCategory(goodsManagementCategory.split(","))); |