refactor(mall): 优化分类查询接口参数类型和逻辑
- 将 ApiProdController 中 categoryByAncestors 方法的参数类型从 Long 改为 String - 修改 ITzCategoryService 接口中 listByAncestors 方法的参数类型从 Long 改为 String- 更新 TzCategoryServiceImpl 中 listByAncestors 方法,移除对 subset 字段的查询条件- 优化 listByParentId 方法,移除对 subset 字段的查询条件
This commit is contained in:
@@ -74,5 +74,5 @@ public interface ITzCategoryService {
|
||||
* @param ancestors
|
||||
* @return
|
||||
*/
|
||||
List<TzCategoryVo> listByAncestors(Long ancestors);
|
||||
List<TzCategoryVo> listByAncestors(String ancestors);
|
||||
}
|
||||
|
||||
@@ -124,15 +124,15 @@ public class TzCategoryServiceImpl implements ITzCategoryService {
|
||||
*/
|
||||
@Override
|
||||
public List<TzCategoryVo> listByParentId(Long parentId) {
|
||||
return baseMapper.selectVoList(new LambdaQueryWrapper<TzCategory>().eq(TzCategory::getParentId, parentId).eq(TzCategory::getStatus,1).eq(TzCategory::getSubset,1));
|
||||
return baseMapper.selectVoList(new LambdaQueryWrapper<TzCategory>().eq(TzCategory::getParentId, parentId).eq(TzCategory::getStatus,1));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分类信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<TzCategoryVo> listByAncestors(Long ancestors) {
|
||||
return baseMapper.selectVoList(new LambdaQueryWrapper<TzCategory>().like(TzCategory::getAncestors, ancestors).eq(TzCategory::getStatus,1).eq(TzCategory::getSubset,1));
|
||||
public List<TzCategoryVo> listByAncestors(String ancestors) {
|
||||
return baseMapper.selectVoList(new LambdaQueryWrapper<TzCategory>().like(TzCategory::getAncestors, ancestors).eq(TzCategory::getStatus,1));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user