Entity - BB9z/API-Documentation-Sample GitHub Wiki

模型

< Back

未标明可选的字段都是必有的。

目录

AccountEntity 账户信息

{
  "id": "UAnOiIAvB1keXOBFfvUezgIQ",
  "name": "用户昵称",
  "introduction": "纯文本介绍信息,多行",
  "sex": 1,
  "avatar": "https://usercontent.example.com/avatars/oeDabefYIMlT52eIW_3rOxIM2exlrwPgADbC1g",
  "create_time": "2000-01-01T00:00:00Z"
}
  • introduction, 可选字符串,用户介绍信息
  • sex, 枚举整型,-1 未设置,0 男,1 女,2 保密
  • avatar, 可选字符串,头像图片地址
  • create_time, 时间戳,注册时间

:up:

AttachmentEntity 附件

{
  "type": "image",
  "url": "https://usercontent.example.com/a3efa4d/6Br3kigfxdhOKd5xQqoz2FrKidITvIurB2rtzw"
}
  • type, 枚举字符串
    • image, 图片
    • video, 视频
    • text, 纯文本
  • url, 资源获取路径

:up:

CommentEntity 评论

{
  "id": "CMjdERlo0Em4tad2FXy7Y3dc6-atML85yTF1PQTA",
  "from": UserEntity,
  "to": UserEntity,
  "create_time": "2000-01-01T00:00:00Z",
  "content": "评论内容纯文本",
  "replies": [CommentEntity]
}
  • from, 留下评论的用户,UserEntity基本信息
  • to, 可选,回复的用户,UserEntity基本信息
  • create_time, 时间戳,创建时间
  • replies, 可选,评论下面的回复评论列表

:up:

TopicEntity 帖子

{
  "id": "TP4bl6sJQ-ndMYZHpAxuLTsSw-GcQRpVET0a69nA",
  "title": "标题",
  "content": "文本",
  "author": UserEntity,
  "create_time": "2000-01-01T00:00:00Z",
  "edit_time": "2000-01-01T00:02:00Z",
  "attachments": [AttachmentEntity],
  "status": [],
  "allow_operations": ["comment", "like"],
  "comment_count": 0,
  "like_count": 0,
  "is_liked": false,
  "last_comment": CommentEntity
}
  • author, 作者,UserEntity基本信息
  • create_time, 时间戳,创建时间
  • edit_time, 可选时间戳,最后编辑时间
  • attachments, 可选AttachmentEntity数组
  • status, 枚举字符串数组,帖子状态
    • locked, 锁定状态,不允许操作
    • pinned, 置顶状态
  • allow_operations, 枚举字符串数组,允许的操作
    • comment, 留言
    • edit, 对内容进行编辑
    • like, 喜欢
    • forward, 转发
    • moderate, 管理员操作
  • comment_count, 整型,留言数
  • like_count, 整型,点赞数
  • is_liked, 可选,布尔值,是否已点赞
  • last_comment, 可选,最近评论CommentEntity

:up:

UserEntity 用户

{
  "id": "UAnOiIAvB1keXOBFfvUezgIQ",
  "name": "用户昵称",
  "introduction": "纯文本介绍信息,多行",
  "avatar": "https://usercontent.example.com/avatars/oeDabefYIMlT52eIW_3rOxIM2exlrwPgADbC1g",
  "topic_count": 10,
  "liked_count": 5
}
  • introduction, 可选字符串,用户介绍信息
  • avatar, 可选字符串,头像图片地址
  • topic_count, 整型,帖子数
  • liked_count, 整型,获赞数

:up: