|
@@ -26,6 +26,8 @@ import java.text.ParseException;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+import java.util.stream.Stream;
|
|
|
|
|
|
/**
|
|
|
* 社区文章管理
|
|
@@ -81,6 +83,8 @@ public class CommunityArticleController extends BaseController {
|
|
|
@Autowired
|
|
|
private CommunityCollectionMapper communityCollectionMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CommunityTagMapper communityTagMapper;
|
|
|
|
|
|
/**
|
|
|
* 获取文章列表信息
|
|
@@ -876,5 +880,21 @@ public class CommunityArticleController extends BaseController {
|
|
|
return AjaxResult.success(collectionArticleVos);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 搜索关键字
|
|
|
+ * @param content
|
|
|
+ * @return 内容
|
|
|
+ */
|
|
|
+ @ApiOperation("查询关键词")
|
|
|
+ @GetMapping("/TrendingTopic")
|
|
|
+ //@Anonymous
|
|
|
+ public AjaxResult TrendingTopic(@RequestParam(required = false) String content) {
|
|
|
+ List<TrendingTop> trendingTops = null;
|
|
|
+ try {
|
|
|
+ trendingTops = communityArticleMapper.selectTrendingTopByContent(content);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new ProjectException();
|
|
|
+ }
|
|
|
+ return AjaxResult.success("获取成功!",trendingTops);
|
|
|
+ }
|
|
|
}
|