跳到主要内容

沸点(短内容)

沸点(ShortMsg)是类微博的短内容:支持图片、话题、隐私(公开/仅自己)、引用转发(Repost)、草稿,并同步到 MeiliSearch 检索。

沸点(ShortMsgController,/api/cms/short-msg

核心服务

  • IShortMsgService:沸点 CRUD 与查询。CreateAsync / UpdateAsync / DeleteAsync / GetAsyncGetQueryShortMsgListAsyncSetPrivacyTypeAsyncGetDraftAsyncExtractTopicAsync(从正文抽取话题)。
  • 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-topicAI/规则抽取话题(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}'

关联能力

  • 话题 / 标签:沸点可关联 TopicTag,分别见 发现:搜索/推荐/话题/标签
  • MeiliSearch 检索/query-by-meili 与文章检索共用一套索引机制,见 MeiliSearch 搜索
  • 互动:沸点上的评论、点赞、投票、收藏复用 互动 中的服务(EntityTypeShortMsg)。

相关文档