沸点(短内容)
沸点(ShortMsg)是类微博的短内容:支持图片、话题、隐私(公开/仅自己)、引用转发(Repost)、草稿,并同步到 MeiliSearch 检索。
沸点(ShortMsgController,/api/cms/short-msg)
核心服务
IShortMsgService:沸点 CRUD 与查询。CreateAsync/UpdateAsync/DeleteAsync/GetAsync、GetQueryShortMsgListAsync、SetPrivacyTypeAsync、GetDraftAsync、ExtractTopicAsync(从正文抽取话题)。IShortMsgMeiliSearchService:MeiliSearch 沸点检索(GetQueryShortMsgListAsync)。IPostRepostManager:引用/转发(Repost)的跨形态解析与更新。
HTTP API
| 方法 | 路由 | 说明 |
|---|---|---|
| GET | /query | 沸点分页列表 |
| GET | /following | 我关注的人的沸点 |
| GET | /{id} | 沸点详情 |
| POST | / | 发布沸点(CreateUpdateShortMsgReq) |
| PUT | /{id} | 更新沸点 |
| DELETE | /{id} | 删除沸点 |
| GET | /query-by-meili | 走 MeiliSearch 检索 |
| PUT | /set-privacy-type | 修改可见性(SetShortMsgPrivacyTypeReq) |
| GET | /draft | 当前用户草稿 |
| POST | /repost/{subjectKind}/{subjectId} | 引用转发(RepostDto) |
| DELETE | /repost/{subjectKind}/{subjectId} | 取消转发 |
| GET | /{shortMsgId}/reshares | 该沸点的转发列表 |
| POST | /{id}/extract-topic | AI/规则抽取话题(ShortMsgTopicExtractResult) |
开发示例
// 发布沸点
var sm = await _shortMsgService.CreateAsync(new CreateUpdateShortMsgReq
{
Content = "今天天气真好 ☀️",
PrivacyType = PrivacyType.Public
});
// 引用转发
var repost = await _shortMsgService.RepostAsync(PostKind.ShortMsg, sm.Id);
// 切换可见性
await _shortMsgService.SetPrivacyTypeAsync(new SetShortMsgPrivacyTypeReq
{
Id = sm.Id, PrivacyType = PrivacyType.Private
});
curl -X POST https://localhost:5000/kit_api/api/cms/short-msg \
-H "Content-Type: application/json" \
-d '{"content":"第一条沸点","privacyType":0}'
关联能力
- 话题 / 标签:沸点可关联
Topic与Tag,分别见 发现:搜索/推荐/话题/标签。 - MeiliSearch 检索:
/query-by-meili与文章检索共用一套索引机制,见 MeiliSearch 搜索。 - 互动:沸点上的评论、点赞、投票、收藏复用 互动 中的服务(
EntityType传ShortMsg)。