|
|
@ -19,7 +19,9 @@ import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.HashSet; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 产品与课程分类表控制类 |
|
|
|
* 产品与课程分类表控制类 |
|
|
@ -100,12 +102,14 @@ public class CategoryController { |
|
|
|
public R hasBeenCitedInTheArticle(@ApiParam(value = "类型标识") @RequestParam(required = false) Integer type, |
|
|
|
public R hasBeenCitedInTheArticle(@ApiParam(value = "类型标识") @RequestParam(required = false) Integer type, |
|
|
|
@ApiParam(value = "站点id") @RequestParam(required = false) Integer siteId) { |
|
|
|
@ApiParam(value = "站点id") @RequestParam(required = false) Integer siteId) { |
|
|
|
|
|
|
|
|
|
|
|
List<Category> categories = new ArrayList<>(); |
|
|
|
Set<Category> categories = new HashSet<>(); |
|
|
|
|
|
|
|
|
|
|
|
if (type == 0) { |
|
|
|
if (type == 0) { |
|
|
|
// 类型
|
|
|
|
// 类型
|
|
|
|
|
|
|
|
List<Category> categoriesList = service.lookUpTheTypeOfReferenceBySite(siteId); |
|
|
|
|
|
|
|
|
|
|
|
categories = service.lookUpTheTypeOfReferenceBySite(siteId); |
|
|
|
// 将List转换为Set
|
|
|
|
|
|
|
|
categories.addAll(categoriesList); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// 分类、标签
|
|
|
|
// 分类、标签
|
|
|
@ -119,14 +123,13 @@ public class CategoryController { |
|
|
|
categories.add(category); |
|
|
|
categories.add(category); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return R.success(categories); |
|
|
|
return R.success(categories); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 查询分类详情 |
|
|
|
* 查询分类详情 |
|
|
|
* |
|
|
|
* |
|
|
|