Showing
4 changed files
with
8 additions
and
6 deletions
No preview for this file type
| ... | @@ -27,10 +27,10 @@ public class CategoryController { | ... | @@ -27,10 +27,10 @@ public class CategoryController { |
| 27 | private final CategoriesService categoriesService; | 27 | private final CategoriesService categoriesService; |
| 28 | 28 | ||
| 29 | @ApiOperation(value = "根据enterpriseId获取CategoriesAll") | 29 | @ApiOperation(value = "根据enterpriseId获取CategoriesAll") |
| 30 | - @GetMapping("/enterprise/{enterpriseId}/categories") | 30 | + @GetMapping("/enterprise/categories") |
| 31 | @ResponseStatus(HttpStatus.OK) | 31 | @ResponseStatus(HttpStatus.OK) |
| 32 | - public List<CategoryDto> queryCategoriesAll(@PathVariable Integer enterpriseId) { | 32 | + public List<CategoryDto> queryCategoriesAll() { |
| 33 | - return categoriesService.queryCategoriesAll(enterpriseId); | 33 | + return categoriesService.queryCategoriesAll(); |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | } | 36 | } | ... | ... |
| 1 | package com.infoloop.tianting.service.impl; | 1 | package com.infoloop.tianting.service.impl; |
| 2 | 2 | ||
| 3 | +import com.infoloop.tianting.context.LoginContextHolder; | ||
| 3 | import com.infoloop.tianting.model.dto.CategoryDbDTO.CategoryDto; | 4 | import com.infoloop.tianting.model.dto.CategoryDbDTO.CategoryDto; |
| 4 | import com.infoloop.tianting.service.CategoriesService; | 5 | import com.infoloop.tianting.service.CategoriesService; |
| 5 | import com.infoloop.tianting.service.client.CategoriesServiceRpcClient; | 6 | import com.infoloop.tianting.service.client.CategoriesServiceRpcClient; |
| ... | @@ -19,9 +20,10 @@ public class CategoriesServiceImpl implements CategoriesService { | ... | @@ -19,9 +20,10 @@ public class CategoriesServiceImpl implements CategoriesService { |
| 19 | private final CategoriesServiceRpcClient categoriesServiceRpcClient; | 20 | private final CategoriesServiceRpcClient categoriesServiceRpcClient; |
| 20 | 21 | ||
| 21 | @Override | 22 | @Override |
| 22 | - public List<CategoryDto> queryCategoriesAll(Integer enterpriseId) { | 23 | + public List<CategoryDto> queryCategoriesAll() { |
| 23 | 24 | ||
| 24 | - final var response = categoriesServiceRpcClient.queryCategoriesAll(enterpriseId); | 25 | + final var operatorLoginInfo = LoginContextHolder.getLoginInfo(); |
| 26 | + final var response = categoriesServiceRpcClient.queryCategoriesAll(operatorLoginInfo.getEnterpriseId()); | ||
| 25 | return response.getResponsesList().stream().map(category -> | 27 | return response.getResponsesList().stream().map(category -> |
| 26 | CategoryDto.builder() | 28 | CategoryDto.builder() |
| 27 | .id(category.getId()) | 29 | .id(category.getId()) | ... | ... |
-
Please register or login to post a comment