From 7ea5d11708160c4947998f1c3c6ff1f386a0c5ec Mon Sep 17 00:00:00 2001 From: "rong.liu" Date: Fri, 26 Jul 2024 11:51:48 +0800 Subject: [PATCH] =?UTF-8?q?Logo=E5=A2=9E=E5=8A=A0=E7=99=BD=E8=89=B2?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=20=E5=89=8D=E5=8F=B0=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E3=80=81=E6=A0=87=E7=AD=BE=E6=95=B0=E6=8D=AE=E5=A4=84=E7=90=86?= =?UTF-8?q?=E5=8E=BB=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iasf/controller/CategoryController.java | 19 +++++++++++-------- .../java/com/huoran/iasf/entity/Logo.java | 3 +++ 2 files changed, 14 insertions(+), 8 deletions(-) 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;