发现:搜索 / 推荐 / 话题 / 标签 / 统计
「发现」层负责让用户找到内容:MeiliSearch 全文检索与建议、个性化推荐流、话题/标签聚合、作者中心与站点统计。
搜索(SearchController,/api/cms/search)
ISearchSuggestionService 提供建议、热搜、历史与高亮;实际文章/沸点检索走 MeiliSearch(见 MeiliSearch 搜索)。
| 方法 | 路由 | 说明 |
|---|---|---|
| GET | /suggestions(AllowAnonymous) | 搜索建议(keyword/limit) |
| GET | /hot(AllowAnonymous) | 热搜榜(HotSearchDto) |
| GET | /history(Authorize) | 当前用户搜索历史 |
| POST | /history/clear(Authorize) | 清空搜索历史 |
| POST | /record(AllowAnonymous) | 记录一次搜索(keyword) |
| POST | /highlight(AllowAnonymous) | 对文本按关键词高亮(SearchHighlightHelper.HighlightText) |
| POST | /extract-highlight(AllowAnonymous) | 抽取片段并高亮(SearchHighlightHelper.ExtractAndHighlight) |
curl "https://localhost:5000/kit_api/api/cms/search/suggestions?keyword=cms&limit=10"
推荐(RecommendationController,/api/cms/recommend)
沸点推荐流由 IShortMsgFeedMixer + IShortMsgRecommendationPoolStore + IShortMsgExposureStore 等组件构成(语义池读写、曝光去重、会话、混排)。
| 方法 | 路由 | 说明 |
|---|---|---|
| GET | /article | 文章推荐流(ArticleFeedQuery) |
| GET | /article/{id}/related | 文章相关推荐(limit 默认 10) |
| GET | /shortmsg | 沸点推荐流(ShortMsgFeedQuery) |
| GET | /shortmsg/{id}/related | 沸点相关推荐(limit 默认 10) |
话题(TopicController)
话题聚合内容,由 ITopicService 管理。
用户端 /api/cms/topics
| 方法 | 路由 | 说明 |
|---|---|---|
| POST | / | 创建并返回话题(CreateUpdateTopicReq) |
| GET | / | 话题列表 |
| GET | /{id} | 话题详情 |
| GET | /hot | 热门话题(HotTopicQuery) |
管理端 /api/cms/admin/topics(需 CmsKit.Topics.*)
| 方法 | 路由 | 说明 |
|---|---|---|
| GET | / | 列表 |
| POST | / | 新建 |
| PUT | /{id} | 更新 |
| DELETE | /{id} | 删除 |
标签(TagController)
标签由 ITagService 管理,支持计数校正。
用户端 /api/cms/tags
| 方法 | 路由 | 说明 |
|---|---|---|
| GET | / | 标签列表 |
| GET | /{id} | 标签详情 |
| POST | / | 创建并返回标签(CreateUpdateTagReq) |
管理端 /api/cms/admin/tags(需 CmsKit.Tags.*)
| 方法 | 路由 | 说明 |
|---|---|---|
| GET | / | 列表 |
| POST | / | 新建 |
| PUT | /{id} | 更新 |
| DELETE | /{id} | 删除 |
| PUT | /correct/{tagId} | 校正单个标签计数 |
| PUT | /correct-tag-counts | 全量校正标签计数 |
作者中心(AuthorCenterController,/api/cms/author-center)
IAuthorCenterService 提供作者维度的统计。
| 方法 | 路由 | 说明 |
|---|---|---|
| POST | /count | 作者计数(CountReq) |
| POST | /trend-chart | 作者趋势图(CmsKitLogChartRequest) |
站点统计(SiteStatisticsController,/api/cms/statistics)
ISiteStatisticsService 汇总全站数据。
| 方法 | 路由 | 说明 |
|---|---|---|
| GET | /get-site-stat | 站点概览统计(SiteStatDto) |
| POST | /trend-chart | 全站趋势图 |
| POST | /daily-stats | 每日统计明细(SiteDailyStatDto) |
AI 资讯(AINewsController,/api/cms/ai-news)
IAINewsService 提供 AI 资讯流列表。
| 方法 | 路由 | 说明 |
|---|---|---|
| GET | / | AI 资讯分页列表(AINewsQuery) |
AI 探活(AiController,/api/cms/ai)
IAiContentManager 提供 AI 能力探活。
| 方法 | 路由 | 说明 |
|---|---|---|
| POST | /ping | 探活(AiPingResult) |