|
|
|
@ -106,27 +106,29 @@ public class CategoryController { |
|
|
|
|
|
|
|
|
|
if (type == 0) { |
|
|
|
|
// 类型
|
|
|
|
|
List<Category> categoriesList = service.lookUpTheTypeOfReferenceBySite(siteId); |
|
|
|
|
List<Category> categoriesList = service.lookUpTheTypeOfReferenceBySite(siteId, type); |
|
|
|
|
|
|
|
|
|
// 将List转换为Set
|
|
|
|
|
categories.addAll(categoriesList); |
|
|
|
|
return R.success(categories); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
// 分类、标签
|
|
|
|
|
String tagIds = service.queryLabelsReferencedWithinSite(siteId); |
|
|
|
|
String tagIds = service.queryLabelsReferencedWithinSite(siteId, type); |
|
|
|
|
if (!StringUtils.isEmpty(tagIds)) { |
|
|
|
|
// 逗号循环分隔设置到集合中
|
|
|
|
|
String[] tagArray = tagIds.split(","); |
|
|
|
|
for (String tagId : tagArray) { |
|
|
|
|
Category category = service.getById(tagId); |
|
|
|
|
if (!ObjectUtils.isEmpty(category)) { |
|
|
|
|
if (!ObjectUtils.isEmpty(category) && category.getType() == 1) { |
|
|
|
|
categories.add(category); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return R.success(categories); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return R.success(categories); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|