diff --git a/src/main/java/com/huoran/iasf/controller/CategoryController.java b/src/main/java/com/huoran/iasf/controller/CategoryController.java index c1af9db..989188a 100644 --- a/src/main/java/com/huoran/iasf/controller/CategoryController.java +++ b/src/main/java/com/huoran/iasf/controller/CategoryController.java @@ -19,7 +19,9 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; /** * 产品与课程分类表控制类 @@ -100,18 +102,20 @@ public class CategoryController { public R hasBeenCitedInTheArticle(@ApiParam(value = "类型标识") @RequestParam(required = false) Integer type, @ApiParam(value = "站点id") @RequestParam(required = false) Integer siteId) { - List categories = new ArrayList<>(); - if (type == 0) { - //类型 + Set categories = new HashSet<>(); - categories = service.lookUpTheTypeOfReferenceBySite(siteId); + if (type == 0) { + // 类型 + List categoriesList = service.lookUpTheTypeOfReferenceBySite(siteId); + // 将List转换为Set + categories.addAll(categoriesList); } else { - //分类、标签 + // 分类、标签 String tagIds = service.queryLabelsReferencedWithinSite(siteId); if (!StringUtils.isEmpty(tagIds)) { - //逗号循环分隔设置到集合中 + // 逗号循环分隔设置到集合中 String[] tagArray = tagIds.split(","); for (String tagId : tagArray) { Category category = service.getById(tagId); @@ -119,14 +123,13 @@ public class CategoryController { categories.add(category); } } - } - } return R.success(categories); } + /** * 查询分类详情 * diff --git a/src/main/java/com/huoran/iasf/entity/Logo.java b/src/main/java/com/huoran/iasf/entity/Logo.java index b2497aa..25119e1 100644 --- a/src/main/java/com/huoran/iasf/entity/Logo.java +++ b/src/main/java/com/huoran/iasf/entity/Logo.java @@ -31,6 +31,9 @@ public class Logo implements Serializable { @ApiModelProperty(value = "图标") private String logoUrl; + @ApiModelProperty(value = "白底图标") + private String whiteUrl; + @ApiModelProperty(value = "站点id") private Integer siteId;