社区文档
学管系统
帖子列表
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
{
"count": 25,
"next": "http://127.0.0.1:8000/server/community/list_post/?page=2&page_size=1",
"previous": null,
"results": [
{
"pk": 32,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"title": "打印数字 10",
"content": "用输出函数打印数字 10",
"photos": "",
"videos": "",
"link_url": "https://oj.coding61.com/problem/Python%20L1-10",
"poster_url": "",
"like_count": 0,
"comment_count": 0,
"create_time": "2019-12-20T11:04:29.150059",
"comments": [],
"is_like": false,
"is_self": true,
"types": "oj",
"flower_count": 0,
"is_flower": false,
"error_msg": "错误信息",
"code": "代码信息",
"is_top": false
}
]
}
评论列表
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
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"pk": 27,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"post": 32,
"content": "风空空洞洞地吹过。一年又这么过去。而来年,还要这么过去。我不知道是安稳的背后隐藏着沮丧,还是沮丧里终归有安稳。只是我们,无法找到。",
"photos": "",
"like_count": 1,
"is_like": true,
"reply_count": 0,
"create_time": "2019-12-20T14:12:36.978303",
"replys": [
{
"pk": 27,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"comment": 27,
"reply_user": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"content": "我是回复了。",
"like_count": 1,
"is_like": true,
"create_time": "2019-12-20T14:18:54.425244",
"is_self": true,
"flower_count": 0,
"is_flower": false
}
],
"is_self": true,
"flower_count": 1,
"is_flower": true
}
]
}
帖子详情
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
GET |
/server/community/detail_post/${pk}/ |
帖子详情 |
YES |
Response
{
"pk": 32,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"title": "打印数字 10",
"content": "用输出函数打印数字 10",
"photos": "",
"videos": "",
"link_url": "https://oj.coding61.com/problem/Python%20L1-10",
"poster_url": "",
"like_count": 0,
"comment_count": 2,
"create_time": "2019-12-20T11:04:29.150059",
"comments": [
{
"pk": 27,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"post": 32,
"content": "风空空洞洞地吹过。一年又这么过去。而来年,还要这么过去。我不知道是安稳的背后隐藏着沮丧,还是沮丧里终归有安稳。只是我们,无法找到。",
"photos": "",
"like_count": 1,
"is_like": true,
"reply_count": 0,
"create_time": "2019-12-20T14:12:36.978303",
"replys": [
{
"pk": 27,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"comment": 27,
"reply_user": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"content": "我是回复了。",
"like_count": 1,
"is_like": true,
"create_time": "2019-12-20T14:18:54.425244",
"is_self": true,
"flower_count": 0,
"is_flower": false
}
],
"is_self": true,
"flower_count": 1,
"is_flower": true
}
],
"is_like": false,
"is_self": true,
"types": "oj",
"flower_count": 0,
"is_flower": false,
"error_msg": "错误信息",
"code": "代码信息",
"is_top": false
}
新建帖子
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
POST |
/server/community/create_post/ |
新建帖子 |
YES |
Request
{
"title": "打印数字 10",
"content": "用输出函数打印数字 10",
"photos": "http://123.jpg,http://23.jpg",
"videos": "http://12.mp4",
"link_url": "https://oj.coding61.com/problem/Python%20L1-10",
"poster_url": "http://video.png",
"types": "oj",
"error_msg": "错误信息",
"code": "代码信息",
"is_top": false
}
Response
{
"pk": 33,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"title": "打印数字 10",
"content": "用输出函数打印数字 10",
"photos": "",
"videos": "",
"link_url": "https://oj.coding61.com/problem/Python%20L1-10",
"poster_url": "",
"like_count": 0,
"comment_count": 0,
"create_time": "2019-12-20T13:59:18.862274",
"comments": [],
"is_like": false,
"is_self": true,
"types": "oj",
"flower_count": 0,
"is_flower": false,
"error_msg": "错误信息",
"code": "代码信息",
"is_top": false
}
帖子置顶
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
PUT |
/server/community/sticky_post/${pk}/ |
帖子置顶 |
YES |
Response
{
"pk": 33,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"title": "打印数字 10",
"content": "用输出函数打印数字 10",
"photos": "",
"videos": "",
"link_url": "https://oj.coding61.com/problem/Python%20L1-10",
"poster_url": "",
"like_count": 0,
"comment_count": 0,
"create_time": "2019-12-20T13:59:18.862274",
"comments": [],
"is_like": false,
"is_self": true,
"types": "oj",
"flower_count": 0,
"is_flower": false,
"error_msg": "错误信息",
"code": "代码信息",
"is_top": true
}
帖子加精
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
PUT |
/server/community/essence_post/${pk}/ |
帖子加精 |
YES |
Response
{
"pk": 33,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"title": "打印数字 10",
"content": "用输出函数打印数字 10",
"photos": "",
"videos": "",
"link_url": "https://oj.coding61.com/problem/Python%20L1-10",
"poster_url": "",
"like_count": 0,
"comment_count": 0,
"create_time": "2019-12-20T13:59:18.862274",
"comments": [],
"is_like": false,
"is_self": true,
"types": "oj",
"flower_count": 0,
"is_flower": false,
"error_msg": "错误信息",
"code": "代码信息",
"is_essence": true
}
新建评论
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
{
"post":32,
"content":"风空空洞洞地吹过。一年又这么过去。而来年,还要这么过去。我不知道是安稳的背后隐藏着沮丧,还是沮丧里终归有安稳。只是我们,无法找到。"
}
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
{
"pk": 27,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"post": 32,
"content": "风空空洞洞地吹过。一年又这么过去。而来年,还要这么过去。我不知道是安稳的背后隐藏着沮丧,还是沮丧里终归有安稳。只是我们,无法找到。",
"photos": "",
"like_count": 0,
"is_like": false,
"reply_count": 0,
"create_time": "2019-12-20T14:12:36.978303",
"replys": [],
"is_self": true,
"flower_count": 0,
"is_flower": false
}
新建回复
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
{
"comment":27,
"reply_user":"15201052252",
"content":"我是回复了。"
}
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
{
"pk": 27,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"comment": 27,
"reply_user": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"content": "我是回复了。",
"like_count": 0,
"is_like": false,
"create_time": "2019-12-20T14:18:54.425244",
"is_self": true,
"flower_count": 0,
"is_flower": false
}
帖子的点赞与取消
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
{
"pk": 33,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"title": "打印数字 10",
"content": "用输出函数打印数字 10",
"photos": "",
"videos": "",
"link_url": "https://oj.coding61.com/problem/Python%20L1-10",
"poster_url": "",
"like_count": 1,
"comment_count": 0,
"create_time": "2019-12-20T13:59:18.862274",
"comments": [],
"is_like": true,
"is_self": true,
"types": "oj",
"flower_count": 0,
"is_flower": false,
"error_msg": "错误信息",
"code": "代码信息",
"is_top": false
}
评论的点赞与取消
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
{
"pk": 27,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"post": 32,
"content": "风空空洞洞地吹过。一年又这么过去。而来年,还要这么过去。我不知道是安稳的背后隐藏着沮丧,还是沮丧里终归有安稳。只是我们,无法找到。",
"photos": "",
"like_count": 1,
"is_like": true,
"reply_count": 0,
"create_time": "2019-12-20T14:12:36.978303",
"replys": [
{
"pk": 27,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"comment": 27,
"reply_user": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"content": "我是回复了。",
"like_count": 0,
"is_like": false,
"create_time": "2019-12-20T14:18:54.425244",
"is_self": true,
"flower_count": 0,
"is_flower": false
}
],
"is_self": true,
"flower_count": 0,
"is_flower": false
}
回复的点赞与取消
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
{
"pk": 27,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"comment": 27,
"reply_user": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"content": "我是回复了。",
"like_count": 1,
"is_like": true,
"create_time": "2019-12-20T14:18:54.425244",
"is_self": true,
"flower_count": 0,
"is_flower": false
}
送花
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
{
"types":"comment",
"pk":27
}
Response Parameters
Name |
Description |
pk |
送花记录的 id |
owner |
送花者的用户信息 |
receiver |
被送者的用户信息 |
types |
送花对象类型(代号) |
types_display |
送花对象类型(中文) |
create_time |
送花记录创建时间 |
record_data |
送花对象的序列数据 |
record_id |
送花对象的 id |
Response
{
"pk": 8,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"receiver": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"types": "comment",
"types_display": "评论送花",
"create_time": "2019-12-20T14:48:39.588956",
"record_data": {
"pk": 27,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"content": "风空空洞洞地吹过。一年又这么过去。而来年,还要这么过去。我不知道是安稳的背后隐藏着沮丧,还是沮丧里终归有安稳。只是我们,无法找到。",
"post": {
"pk": 32,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/b'2963b2bd1a472a44dd5ae33429a65363'_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"title": "打印数字 10",
"content": "用输出函数打印数字 10",
"photos": "",
"poster_url": ""
},
"like_count": 1,
"is_like": true
},
"record_id": 27
}
关注用户
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
PUT |
/server/community/add_followers/ |
关注用户 |
YES |
Request Parameters
Name |
Description |
followers |
要关注的用户的账号列表 |
Request
{
"followers":["18516271364"]
}
Response
{
"status": 0,
"message": ""
}
取关用户
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
PUT |
/server/community/remove_followers/ |
取关用户 |
YES |
Request Parameters
Name |
Description |
followers |
要关注的用户的账号列表 |
Request
{
"followers":["18516271364"]
}
Response
{
"status": 0,
"message": ""
}
我的关注列表
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
{
"count": 56,
"next": "http://app.bcjiaoyu.com/server/community/list_myfollower/?page=2",
"previous": null,
"results": [
{
"pk": 59,
"owner": {
"name": "镭哥",
"avatar": "https://static1.bcjiaoyu.com/head1@3x.png",
"user": "13301257976",
"nickname": null,
"user_id": 8528,
"is_staff": true,
"segment": {
"name": "青铜",
"image": "https://static1.bcjiaoyu.com/community/touxiangkuangbronze.png"
}
},
"follower": {
"name": "WTNJJ HDB",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/2371b4cef7f5c481d9aa428355a2412c_d.gif-255x202",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": true,
"segment": {
"name": "青铜",
"image": "https://static1.bcjiaoyu.com/community/touxiangkuangbronze.png"
}
},
"is_follow": true,
"is_followed": true
}]
}
消息列表
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_comment 、create_reply 、like_post 、like_comment 、like_reply 、notification ) |
record_id |
消息相关记录的 id |
record_data |
消息相关记录的数据 |
create_time |
消息的创建时间 |
content |
消息的描述内容 |
Response
{
"count": 22,
"next": "http://127.0.0.1:8000/server/community/list_message/?page=2",
"previous": null,
"results": [
{
"pk": 24,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/5690023e83a72af4ff5be0badaadfbe4_k.gif-658x658",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false,
"segment": {
"name": "白银",
"image": "https://static1.bcjiaoyu.com/community/touxiangkuangking.png"
}
},
"sender": {
"name": "小橙子_xgl1wb",
"avatar": "https://static1.bcjiaoyu.com/head1@3x.png",
"user": "13301257976",
"nickname": "",
"user_id": 8528,
"is_staff": false,
"segment": {
"name": "青铜",
"image": "https://static1.bcjiaoyu.com/silver.png"
}
},
"status": "read",
"types": "like_comment",
"record_id": 11,
"record_data": {
"pk": 11,
"owner": {
"name": "小橙子_xgl1wb",
"avatar": "https://static1.bcjiaoyu.com/head1@3x.png",
"user": "13301257976",
"nickname": "",
"user_id": 8528,
"is_staff": false,
"segment": {
"name": "青铜",
"image": "https://static1.bcjiaoyu.com/silver.png"
}
},
"comment": {
"pk": 28,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/5690023e83a72af4ff5be0badaadfbe4_k.gif-658x658",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false,
"segment": {
"name": "白银",
"image": "https://static1.bcjiaoyu.com/community/touxiangkuangking.png"
}
},
"content": "你好,我是评论",
"post": {
"pk": 35,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/5690023e83a72af4ff5be0badaadfbe4_k.gif-658x658",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false,
"segment": {
"name": "白银",
"image": "https://static1.bcjiaoyu.com/community/touxiangkuangking.png"
}
},
"title": "",
"content": "测试帖子的删除功能",
"photos": "",
"poster_url": ""
},
"like_count": 1,
"is_like": false
},
"create_time": "2020-01-21T11:10:04.314656"
},
"create_time": "2020-01-21T11:10:04.319538",
"content": null
}
]
}
我的未读消息数
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_count
、unread_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
{
"unread_total_count": 1,
"unread_comment_count": 0,
"unread_like_count": 0,
"unread_attention_comment_count":0,
"unread_attention_post_count":0,
"unread_notification_count": 0,
"post_count": 21,
"work_count": 7,
"segment": {
"prestige_number": 24,
"flower_number": 18,
"diamond": 10160,
"pk": 2,
"name": "白银",
"least_number": 21,
"most_number": 100,
"image": "https://static1.bcjiaoyu.com/community/touxiangkuangking.png"
}
}