[关闭]
@chengxuyuan 2020-04-20T02:44:27.000000Z 字数 19371 阅读 364

社区文档

学管系统


帖子列表

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/community/list_post/ 帖子列表 YES

按条件过滤列表释义如下 :
1. owner用户账号:
/server/community/list_post/?owner=15201052252
2. user_id用户 id:
/server/community/list_post/?user_id=123
3. types帖子类型:
/server/community/list_post/?types=oj
4. is_top是否置顶:
/server/community/list_post/?is_top=True
5. is_essence是否精华:
/server/community/list_post/?is_essence=True

排序字段(is_top, create_time)释义如下:
1. is_top是否置顶:
如果置顶的在前的话(逆序),ordering=-is_top
如果置顶的在后的话(顺序): ordering=is_top
2. create_time帖子创建时间:
逆序: ordering=-create_time
顺序: ordering=create_time
3. 排序字段的组合:
/server/community/list_post/?ordering=-is_top,-create_time

Response Parameters

Name Description
pk 帖子 id
owner 用户信息
title 帖子标题
content 帖子描述(有可能是富文本)
photos 帖子图片组,逗号分开
videos 帖子视频
link_url 链接
poster_url 视频封面图
like_count 点赞数
comment_count 评论数
create_time 帖子创建时间
comments 帖子下的评论组
is_like 是否点赞
is_self 是否是本人的帖子
types 帖子类型 (oj 圈oj、朋友圈common、作品圈work)
flower_count 鲜花数
is_flower 是否送了鲜花
error_msg oj题的错误信息
code oj题的代码
is_top 是否置顶
is_essence 是否加精

Response

  1. {
  2. "count": 25,
  3. "next": "http://127.0.0.1:8000/server/community/list_post/?page=2&page_size=1",
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 32,
  8. "owner": {
  9. "name": "勿问情殇",
  10. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  11. "user": "15201052252",
  12. "nickname": "chen",
  13. "user_id": 367,
  14. "is_staff": false
  15. },
  16. "title": "打印数字 10",
  17. "content": "用输出函数打印数字 10",
  18. "photos": "",
  19. "videos": "",
  20. "link_url": "https://oj.coding61.com/problem/Python%20L1-10",
  21. "poster_url": "",
  22. "like_count": 0,
  23. "comment_count": 0,
  24. "create_time": "2019-12-20T11:04:29.150059",
  25. "comments": [],
  26. "is_like": false,
  27. "is_self": true,
  28. "types": "oj",
  29. "flower_count": 0,
  30. "is_flower": false,
  31. "error_msg": "错误信息",
  32. "code": "代码信息",
  33. "is_top": false
  34. }
  35. ]
  36. }

评论列表

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/community/list_comment/ 评论列表 YES

按条件过滤列表释义如下 :
1. post帖子 id:
/server/community/list_post/?post=32

Response Parameters

Name Description
pk 评论id
owner 用户信息
post 帖子id
content 评论描述
photos 评论图片组,逗号分开(暂时不支持)
like_count 点赞数
is_like 是否点赞
reply_count 回复数
create_time 评论创建时间
replys 评论下的回复数据
is_self 是否是本人的
flower_count 鲜花数
is_flower 是否送了鲜花

Response

  1. {
  2. "count": 1,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 27,
  8. "owner": {
  9. "name": "勿问情殇",
  10. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  11. "user": "15201052252",
  12. "nickname": "chen",
  13. "user_id": 367,
  14. "is_staff": false
  15. },
  16. "post": 32,
  17. "content": "风空空洞洞地吹过。一年又这么过去。而来年,还要这么过去。我不知道是安稳的背后隐藏着沮丧,还是沮丧里终归有安稳。只是我们,无法找到。",
  18. "photos": "",
  19. "like_count": 1,
  20. "is_like": true,
  21. "reply_count": 0,
  22. "create_time": "2019-12-20T14:12:36.978303",
  23. "replys": [
  24. {
  25. "pk": 27,
  26. "owner": {
  27. "name": "勿问情殇",
  28. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  29. "user": "15201052252",
  30. "nickname": "chen",
  31. "user_id": 367,
  32. "is_staff": false
  33. },
  34. "comment": 27,
  35. "reply_user": {
  36. "name": "勿问情殇",
  37. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  38. "user": "15201052252",
  39. "nickname": "chen",
  40. "user_id": 367,
  41. "is_staff": false
  42. },
  43. "content": "我是回复了。",
  44. "like_count": 1,
  45. "is_like": true,
  46. "create_time": "2019-12-20T14:18:54.425244",
  47. "is_self": true,
  48. "flower_count": 0,
  49. "is_flower": false
  50. }
  51. ],
  52. "is_self": true,
  53. "flower_count": 1,
  54. "is_flower": true
  55. }
  56. ]
  57. }

帖子详情

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/community/detail_post/${pk}/ 帖子详情 YES

Response

  1. {
  2. "pk": 32,
  3. "owner": {
  4. "name": "勿问情殇",
  5. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  6. "user": "15201052252",
  7. "nickname": "chen",
  8. "user_id": 367,
  9. "is_staff": false
  10. },
  11. "title": "打印数字 10",
  12. "content": "用输出函数打印数字 10",
  13. "photos": "",
  14. "videos": "",
  15. "link_url": "https://oj.coding61.com/problem/Python%20L1-10",
  16. "poster_url": "",
  17. "like_count": 0,
  18. "comment_count": 2,
  19. "create_time": "2019-12-20T11:04:29.150059",
  20. "comments": [
  21. {
  22. "pk": 27,
  23. "owner": {
  24. "name": "勿问情殇",
  25. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  26. "user": "15201052252",
  27. "nickname": "chen",
  28. "user_id": 367,
  29. "is_staff": false
  30. },
  31. "post": 32,
  32. "content": "风空空洞洞地吹过。一年又这么过去。而来年,还要这么过去。我不知道是安稳的背后隐藏着沮丧,还是沮丧里终归有安稳。只是我们,无法找到。",
  33. "photos": "",
  34. "like_count": 1,
  35. "is_like": true,
  36. "reply_count": 0,
  37. "create_time": "2019-12-20T14:12:36.978303",
  38. "replys": [
  39. {
  40. "pk": 27,
  41. "owner": {
  42. "name": "勿问情殇",
  43. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  44. "user": "15201052252",
  45. "nickname": "chen",
  46. "user_id": 367,
  47. "is_staff": false
  48. },
  49. "comment": 27,
  50. "reply_user": {
  51. "name": "勿问情殇",
  52. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  53. "user": "15201052252",
  54. "nickname": "chen",
  55. "user_id": 367,
  56. "is_staff": false
  57. },
  58. "content": "我是回复了。",
  59. "like_count": 1,
  60. "is_like": true,
  61. "create_time": "2019-12-20T14:18:54.425244",
  62. "is_self": true,
  63. "flower_count": 0,
  64. "is_flower": false
  65. }
  66. ],
  67. "is_self": true,
  68. "flower_count": 1,
  69. "is_flower": true
  70. }
  71. ],
  72. "is_like": false,
  73. "is_self": true,
  74. "types": "oj",
  75. "flower_count": 0,
  76. "is_flower": false,
  77. "error_msg": "错误信息",
  78. "code": "代码信息",
  79. "is_top": false
  80. }

新建帖子

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
POST /server/community/create_post/ 新建帖子 YES

Request

  1. {
  2. "title": "打印数字 10",
  3. "content": "用输出函数打印数字 10",
  4. "photos": "http://123.jpg,http://23.jpg",
  5. "videos": "http://12.mp4",
  6. "link_url": "https://oj.coding61.com/problem/Python%20L1-10",
  7. "poster_url": "http://video.png",
  8. "types": "oj",
  9. "error_msg": "错误信息",
  10. "code": "代码信息",
  11. "is_top": false
  12. }

Response

  1. {
  2. "pk": 33,
  3. "owner": {
  4. "name": "勿问情殇",
  5. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  6. "user": "15201052252",
  7. "nickname": "chen",
  8. "user_id": 367,
  9. "is_staff": false
  10. },
  11. "title": "打印数字 10",
  12. "content": "用输出函数打印数字 10",
  13. "photos": "",
  14. "videos": "",
  15. "link_url": "https://oj.coding61.com/problem/Python%20L1-10",
  16. "poster_url": "",
  17. "like_count": 0,
  18. "comment_count": 0,
  19. "create_time": "2019-12-20T13:59:18.862274",
  20. "comments": [],
  21. "is_like": false,
  22. "is_self": true,
  23. "types": "oj",
  24. "flower_count": 0,
  25. "is_flower": false,
  26. "error_msg": "错误信息",
  27. "code": "代码信息",
  28. "is_top": false
  29. }

帖子置顶

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
PUT /server/community/sticky_post/${pk}/ 帖子置顶 YES

Response

  1. {
  2. "pk": 33,
  3. "owner": {
  4. "name": "勿问情殇",
  5. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  6. "user": "15201052252",
  7. "nickname": "chen",
  8. "user_id": 367,
  9. "is_staff": false
  10. },
  11. "title": "打印数字 10",
  12. "content": "用输出函数打印数字 10",
  13. "photos": "",
  14. "videos": "",
  15. "link_url": "https://oj.coding61.com/problem/Python%20L1-10",
  16. "poster_url": "",
  17. "like_count": 0,
  18. "comment_count": 0,
  19. "create_time": "2019-12-20T13:59:18.862274",
  20. "comments": [],
  21. "is_like": false,
  22. "is_self": true,
  23. "types": "oj",
  24. "flower_count": 0,
  25. "is_flower": false,
  26. "error_msg": "错误信息",
  27. "code": "代码信息",
  28. "is_top": true
  29. }

帖子加精

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
PUT /server/community/essence_post/${pk}/ 帖子加精 YES

Response

  1. {
  2. "pk": 33,
  3. "owner": {
  4. "name": "勿问情殇",
  5. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  6. "user": "15201052252",
  7. "nickname": "chen",
  8. "user_id": 367,
  9. "is_staff": false
  10. },
  11. "title": "打印数字 10",
  12. "content": "用输出函数打印数字 10",
  13. "photos": "",
  14. "videos": "",
  15. "link_url": "https://oj.coding61.com/problem/Python%20L1-10",
  16. "poster_url": "",
  17. "like_count": 0,
  18. "comment_count": 0,
  19. "create_time": "2019-12-20T13:59:18.862274",
  20. "comments": [],
  21. "is_like": false,
  22. "is_self": true,
  23. "types": "oj",
  24. "flower_count": 0,
  25. "is_flower": false,
  26. "error_msg": "错误信息",
  27. "code": "代码信息",
  28. "is_essence": true
  29. }

新建评论

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
POST /server/community/create_comment/ 新建评论 YES

Request Parameters

Name Description
post 帖子 id
content 评论内容

Request

  1. {
  2. "post":32,
  3. "content":"风空空洞洞地吹过。一年又这么过去。而来年,还要这么过去。我不知道是安稳的背后隐藏着沮丧,还是沮丧里终归有安稳。只是我们,无法找到。"
  4. }

Response Parameters

Name Description
pk 评论id
owner 用户信息
post 帖子id
content 评论描述
photos 评论图片组,逗号分开(暂时不支持)
like_count 点赞数
is_like 是否点赞
reply_count 回复数
create_time 评论创建时间
replys 评论下的回复数据
is_self 是否是本人的
flower_count 鲜花数
is_flower 是否送了鲜花

Response

  1. {
  2. "pk": 27,
  3. "owner": {
  4. "name": "勿问情殇",
  5. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  6. "user": "15201052252",
  7. "nickname": "chen",
  8. "user_id": 367,
  9. "is_staff": false
  10. },
  11. "post": 32,
  12. "content": "风空空洞洞地吹过。一年又这么过去。而来年,还要这么过去。我不知道是安稳的背后隐藏着沮丧,还是沮丧里终归有安稳。只是我们,无法找到。",
  13. "photos": "",
  14. "like_count": 0,
  15. "is_like": false,
  16. "reply_count": 0,
  17. "create_time": "2019-12-20T14:12:36.978303",
  18. "replys": [],
  19. "is_self": true,
  20. "flower_count": 0,
  21. "is_flower": false
  22. }

新建回复

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
POST /server/community/create_reply/ 新建回复 YES

Request Parameters

Name Description
comment 评论 id
reply_user 对某人的回复,某人的账号
content 回复内容

Request

  1. {
  2. "comment":27,
  3. "reply_user":"15201052252",
  4. "content":"我是回复了。"
  5. }

Response Parameters

Name Description
pk 回复id
owner 用户信息
comment 评论id
reply_user 对某人回复的某人的信息
content 回复的内容
like_count 点赞数
is_like 是否点赞
create_time 创建时间
is_self 是否是本人的
flower_count 鲜花数
is_flower 是否送了鲜花

Response

  1. {
  2. "pk": 27,
  3. "owner": {
  4. "name": "勿问情殇",
  5. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  6. "user": "15201052252",
  7. "nickname": "chen",
  8. "user_id": 367,
  9. "is_staff": false
  10. },
  11. "comment": 27,
  12. "reply_user": {
  13. "name": "勿问情殇",
  14. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  15. "user": "15201052252",
  16. "nickname": "chen",
  17. "user_id": 367,
  18. "is_staff": false
  19. },
  20. "content": "我是回复了。",
  21. "like_count": 0,
  22. "is_like": false,
  23. "create_time": "2019-12-20T14:18:54.425244",
  24. "is_self": true,
  25. "flower_count": 0,
  26. "is_flower": false
  27. }

帖子的点赞与取消

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/community/like_post/${pk}/ 点赞帖子 YES

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/community/unlike_post/${pk}/ 取消点赞帖子 YES

Response

  1. {
  2. "pk": 33,
  3. "owner": {
  4. "name": "勿问情殇",
  5. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  6. "user": "15201052252",
  7. "nickname": "chen",
  8. "user_id": 367,
  9. "is_staff": false
  10. },
  11. "title": "打印数字 10",
  12. "content": "用输出函数打印数字 10",
  13. "photos": "",
  14. "videos": "",
  15. "link_url": "https://oj.coding61.com/problem/Python%20L1-10",
  16. "poster_url": "",
  17. "like_count": 1,
  18. "comment_count": 0,
  19. "create_time": "2019-12-20T13:59:18.862274",
  20. "comments": [],
  21. "is_like": true,
  22. "is_self": true,
  23. "types": "oj",
  24. "flower_count": 0,
  25. "is_flower": false,
  26. "error_msg": "错误信息",
  27. "code": "代码信息",
  28. "is_top": false
  29. }

评论的点赞与取消

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/community/like_comment/${pk}/ 点赞评论 YES

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/community/unlike_comment/${pk}/ 取消点赞评论 YES

Response

  1. {
  2. "pk": 27,
  3. "owner": {
  4. "name": "勿问情殇",
  5. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  6. "user": "15201052252",
  7. "nickname": "chen",
  8. "user_id": 367,
  9. "is_staff": false
  10. },
  11. "post": 32,
  12. "content": "风空空洞洞地吹过。一年又这么过去。而来年,还要这么过去。我不知道是安稳的背后隐藏着沮丧,还是沮丧里终归有安稳。只是我们,无法找到。",
  13. "photos": "",
  14. "like_count": 1,
  15. "is_like": true,
  16. "reply_count": 0,
  17. "create_time": "2019-12-20T14:12:36.978303",
  18. "replys": [
  19. {
  20. "pk": 27,
  21. "owner": {
  22. "name": "勿问情殇",
  23. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  24. "user": "15201052252",
  25. "nickname": "chen",
  26. "user_id": 367,
  27. "is_staff": false
  28. },
  29. "comment": 27,
  30. "reply_user": {
  31. "name": "勿问情殇",
  32. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  33. "user": "15201052252",
  34. "nickname": "chen",
  35. "user_id": 367,
  36. "is_staff": false
  37. },
  38. "content": "我是回复了。",
  39. "like_count": 0,
  40. "is_like": false,
  41. "create_time": "2019-12-20T14:18:54.425244",
  42. "is_self": true,
  43. "flower_count": 0,
  44. "is_flower": false
  45. }
  46. ],
  47. "is_self": true,
  48. "flower_count": 0,
  49. "is_flower": false
  50. }

回复的点赞与取消

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/community/like_reply/${pk}/ 点赞回复 YES

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/community/unlike_reply/${pk}/ 取消点赞回复 YES

Response

  1. {
  2. "pk": 27,
  3. "owner": {
  4. "name": "勿问情殇",
  5. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  6. "user": "15201052252",
  7. "nickname": "chen",
  8. "user_id": 367,
  9. "is_staff": false
  10. },
  11. "comment": 27,
  12. "reply_user": {
  13. "name": "勿问情殇",
  14. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  15. "user": "15201052252",
  16. "nickname": "chen",
  17. "user_id": 367,
  18. "is_staff": false
  19. },
  20. "content": "我是回复了。",
  21. "like_count": 1,
  22. "is_like": true,
  23. "create_time": "2019-12-20T14:18:54.425244",
  24. "is_self": true,
  25. "flower_count": 0,
  26. "is_flower": false
  27. }

送花

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
PUT /server/community/send_flower/ 送花 YES

Request Parameters

Name Description
pk 送花对象的 id
types 对象的类型 (帖子送花post)、(评论送花comment)、(回复送花reply)

Request

  1. {
  2. "types":"comment",
  3. "pk":27
  4. }

Response Parameters

Name Description
pk 送花记录的 id
owner 送花者的用户信息
receiver 被送者的用户信息
types 送花对象类型(代号)
types_display 送花对象类型(中文)
create_time 送花记录创建时间
record_data 送花对象的序列数据
record_id 送花对象的 id

Response

  1. {
  2. "pk": 8,
  3. "owner": {
  4. "name": "勿问情殇",
  5. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  6. "user": "15201052252",
  7. "nickname": "chen",
  8. "user_id": 367,
  9. "is_staff": false
  10. },
  11. "receiver": {
  12. "name": "勿问情殇",
  13. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  14. "user": "15201052252",
  15. "nickname": "chen",
  16. "user_id": 367,
  17. "is_staff": false
  18. },
  19. "types": "comment",
  20. "types_display": "评论送花",
  21. "create_time": "2019-12-20T14:48:39.588956",
  22. "record_data": {
  23. "pk": 27,
  24. "owner": {
  25. "name": "勿问情殇",
  26. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  27. "user": "15201052252",
  28. "nickname": "chen",
  29. "user_id": 367,
  30. "is_staff": false
  31. },
  32. "content": "风空空洞洞地吹过。一年又这么过去。而来年,还要这么过去。我不知道是安稳的背后隐藏着沮丧,还是沮丧里终归有安稳。只是我们,无法找到。",
  33. "post": {
  34. "pk": 32,
  35. "owner": {
  36. "name": "勿问情殇",
  37. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
  38. "user": "15201052252",
  39. "nickname": "chen",
  40. "user_id": 367,
  41. "is_staff": false
  42. },
  43. "title": "打印数字 10",
  44. "content": "用输出函数打印数字 10",
  45. "photos": "",
  46. "poster_url": ""
  47. },
  48. "like_count": 1,
  49. "is_like": true
  50. },
  51. "record_id": 27
  52. }

关注用户

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
PUT /server/community/add_followers/ 关注用户 YES

Request Parameters

Name Description
followers 要关注的用户的账号列表

Request

  1. {
  2. "followers":["18516271364"]
  3. }

Response

  1. {
  2. "status": 0,
  3. "message": ""
  4. }

取关用户

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
PUT /server/community/remove_followers/ 取关用户 YES

Request Parameters

Name Description
followers 要关注的用户的账号列表

Request

  1. {
  2. "followers":["18516271364"]
  3. }

Response

  1. {
  2. "status": 0,
  3. "message": ""
  4. }

我的关注列表

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/community/list_myfollower/ 我的关注列表 YES

按条件过滤列表释义如下 :
1. owner我所关注的用户列表:
/server/community/list_myfollower/?owner=15201052252&is_follow=True
2. follower关注我的用户列表:
/server/community/list_myfollower/?follower=15201052252&is_follow=True

Response Parameters

Name Description
pk 关注记录的id
owner 关注者的用户信息
follower 被关注者的用户信息
is_follow 关注者是否关注了被关注者的标记信息
is_followed 被关注者是否关注了关注者的标记信息

Response

  1. {
  2. "count": 56,
  3. "next": "http://app.bcjiaoyu.com/server/community/list_myfollower/?page=2",
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 59,
  8. "owner": {
  9. "name": "镭哥",
  10. "avatar": "https://static1.bcjiaoyu.com/head1@3x.png",
  11. "user": "13301257976",
  12. "nickname": null,
  13. "user_id": 8528,
  14. "is_staff": true,
  15. "segment": {
  16. "name": "青铜",
  17. "image": "https://static1.bcjiaoyu.com/community/touxiangkuangbronze.png"
  18. }
  19. },
  20. "follower": {
  21. "name": "WTNJJ HDB",
  22. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/2371b4cef7f5c481d9aa428355a2412c_d.gif-255x202",
  23. "user": "15201052252",
  24. "nickname": "chen",
  25. "user_id": 367,
  26. "is_staff": true,
  27. "segment": {
  28. "name": "青铜",
  29. "image": "https://static1.bcjiaoyu.com/community/touxiangkuangbronze.png"
  30. }
  31. },
  32. "is_follow": true,
  33. "is_followed": true
  34. }]
  35. }

消息列表

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/community/list_message/ 消息列表 YES

按条件过滤列表释义如下 :
1. type消息类型(create:评论消息,like:点赞消息,notification:通知消息, comment:@评论消息和@回复消息):
/server/community/list_message/?type=create
2. tag 标志收到的还是发出的消息:
/server/community/list_message/?tag=receive 收到
/server/community/list_message/?tag=send 发出
3. post_type 过滤属于某种类型帖子的消息,比如 oj、common、work
/server/community/list_message/?post_type=oj

Response Parameters

Name Description
pk 关注记录的id
owner 消息接受者的用户信息
sender 消息发送者的用户信息
status 消息的状态,已读/未读
types 消息的类型(create_commentcreate_replylike_postlike_commentlike_replynotification)
record_id 消息相关记录的 id
record_data 消息相关记录的数据
create_time 消息的创建时间
content 消息的描述内容

Response

  1. {
  2. "count": 22,
  3. "next": "http://127.0.0.1:8000/server/community/list_message/?page=2",
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 24,
  8. "owner": {
  9. "name": "勿问情殇",
  10. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/5690023e83a72af4ff5be0badaadfbe4_k.gif-658x658",
  11. "user": "15201052252",
  12. "nickname": "chen",
  13. "user_id": 367,
  14. "is_staff": false,
  15. "segment": {
  16. "name": "白银",
  17. "image": "https://static1.bcjiaoyu.com/community/touxiangkuangking.png"
  18. }
  19. },
  20. "sender": {
  21. "name": "小橙子_xgl1wb",
  22. "avatar": "https://static1.bcjiaoyu.com/head1@3x.png",
  23. "user": "13301257976",
  24. "nickname": "",
  25. "user_id": 8528,
  26. "is_staff": false,
  27. "segment": {
  28. "name": "青铜",
  29. "image": "https://static1.bcjiaoyu.com/silver.png"
  30. }
  31. },
  32. "status": "read",
  33. "types": "like_comment",
  34. "record_id": 11,
  35. "record_data": {
  36. "pk": 11,
  37. "owner": {
  38. "name": "小橙子_xgl1wb",
  39. "avatar": "https://static1.bcjiaoyu.com/head1@3x.png",
  40. "user": "13301257976",
  41. "nickname": "",
  42. "user_id": 8528,
  43. "is_staff": false,
  44. "segment": {
  45. "name": "青铜",
  46. "image": "https://static1.bcjiaoyu.com/silver.png"
  47. }
  48. },
  49. "comment": {
  50. "pk": 28,
  51. "owner": {
  52. "name": "勿问情殇",
  53. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/5690023e83a72af4ff5be0badaadfbe4_k.gif-658x658",
  54. "user": "15201052252",
  55. "nickname": "chen",
  56. "user_id": 367,
  57. "is_staff": false,
  58. "segment": {
  59. "name": "白银",
  60. "image": "https://static1.bcjiaoyu.com/community/touxiangkuangking.png"
  61. }
  62. },
  63. "content": "你好,我是评论",
  64. "post": {
  65. "pk": 35,
  66. "owner": {
  67. "name": "勿问情殇",
  68. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/5690023e83a72af4ff5be0badaadfbe4_k.gif-658x658",
  69. "user": "15201052252",
  70. "nickname": "chen",
  71. "user_id": 367,
  72. "is_staff": false,
  73. "segment": {
  74. "name": "白银",
  75. "image": "https://static1.bcjiaoyu.com/community/touxiangkuangking.png"
  76. }
  77. },
  78. "title": "",
  79. "content": "测试帖子的删除功能",
  80. "photos": "",
  81. "poster_url": ""
  82. },
  83. "like_count": 1,
  84. "is_like": false
  85. },
  86. "create_time": "2020-01-21T11:10:04.314656"
  87. },
  88. "create_time": "2020-01-21T11:10:04.319538",
  89. "content": null
  90. }
  91. ]
  92. }

我的未读消息数

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/community/my_unread_message/ 未读消息 YES

按条件过滤列表释义如下 :
1. username 用户账号:
/server/community/my_unread_message/?username=15201052252
2. user_id 用户的 id:
/server/community/my_unread_message/?user_id=13
3. from 未读社区消息的来源:
/server/community/my_unread_message/?from=oj
4. 优先级:
user_id > username > token
5. 当 from === oj 时,所获取的unread_comment_countunread_like_count unread_attention_comment_count unread_attention_post_count是针对 oj 帖子的数值

Response Parameters

Name Description
unread_total_count 消息未读总数
unread_comment_count 未读评论数
unread_like_count 未读点赞数
unread_attention_comment_count 未读@评论数
unread_notification_count 未读通知数
post_count 帖子数
work_count 作品数
segment 段位相关数据集
prestige_number 声望值
flower_number 鲜花值
diamond 蓝钻值
name 段位名称
image 段位图像

Response

  1. {
  2. "unread_total_count": 1,
  3. "unread_comment_count": 0,
  4. "unread_like_count": 0,
  5. "unread_attention_comment_count":0,
  6. "unread_attention_post_count":0,
  7. "unread_notification_count": 0,
  8. "post_count": 21,
  9. "work_count": 7,
  10. "segment": {
  11. "prestige_number": 24,
  12. "flower_number": 18,
  13. "diamond": 10160,
  14. "pk": 2,
  15. "name": "白银",
  16. "least_number": 21,
  17. "most_number": 100,
  18. "image": "https://static1.bcjiaoyu.com/community/touxiangkuangking.png"
  19. }
  20. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注