开公司文档
社区
新建公司
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
POST |
/server/company/create_company/ |
新建公司 |
YES |
Request
{
"name":"公司的名字",
"content":"公司的介绍",
"logo":"公司 logo"
}
Response Parameters
Name |
Description |
owner |
公司创始人信息 |
name |
名称 |
content |
介绍 |
logo |
logo 图 |
total_income |
总收入 |
exist_income |
现有收入 |
Response
{
"pk": 5,
"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"
}
},
"name": "公司的名字",
"content": "公司的介绍",
"logo": "公司 logo",
"total_income": 0,
"exist_income": 0,
"company_grade": {
"id": 1,
"deleted": false,
"create_time": "2020-05-11T17:42:03.820155",
"order_index": 1000,
"name": "初创公司",
"least_number": 0,
"most_number": 100000,
"image": ""
}
}
加入某司
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
PUT |
/server/company/join_company/${pk}/ |
加入某司 |
YES |
Response
{
"status": 0,
"message": ""
}
离开某司
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
PUT |
/server/company/quit_company/${pk}/ |
离开某司 |
YES |
Response
{
"status": 0,
"message": ""
}
公司列表
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
GET |
/server/company/list_company/ |
公司列表 |
YES |
按条件过滤列表释义如下 :
1. grade_id
公司等级id:
/server/company/list_company/?grade_id=1
Response
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"pk": 11,
"owner": {
"name": "勿问情殇_1111_23",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/5690023e83a72af4ff5be0badaadfbe4_k.gif-658x658",
"user": "15201052252",
"nickname": "chen",
"realname": "陈微",
"user_id": 367,
"is_staff": false,
"segment": {
"name": "黄金",
"image": "https://static1.bcjiaoyu.com/community/touxiangkuang/king.png"
},
"job_title": "讲师"
},
"name": "11111",
"content": "11111111",
"logo": "https://static1.bcjiaoyu.com/bcgame_face2face/367/0fd923cf39cb244b3b0f9de86afb9984_f.gif-658x658",
"total_income": 1200,
"exist_income": 0,
"is_member": false,
"is_ceo": false,
"product_count": 0,
"member_count": 2,
"company_grade": {
"id": 1,
"deleted": false,
"create_time": "2020-05-11T17:42:03.820155",
"order_index": 1000,
"name": "初创公司",
"least_number": 0,
"most_number": 2000,
"image": ""
}
}
]
}
ceo修改职员信息
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
PUT |
/server/company/update_member/${pk}/ |
修改职员 |
YES |
pk
职员的 pk
cURL Example
curl -X PUT http://127.0.0.1:8000/server/company/update_member/34/ -H 'Content-Type: application/json' -H 'Authorization: Token f5d99e3acf2b3e76d63d4a8a8a2389d86e43d9cc' --data '{"free_job":"创意总监"}'
Request Parameters
Name |
Description |
Required |
Default |
free_job |
职称 |
YES |
|
Request
{
"free_job":"会话"
}
Response
{
"pk": 34,
"owner": {
"name": "小橙子_xgl1wb",
"avatar": "https://static1.bcjiaoyu.com/head1@3x.png",
"user": "13301257976",
"nickname": null,
"realname": null,
"user_id": 8528,
"is_staff": true,
"segment": {
"name": "青铜",
"image": "https://static1.bcjiaoyu.com/silver.png"
}
},
"company": 11,
"position_display": "程序员",
"position": "programmer",
"is_member": true,
"is_ceo": true,
"free_job": "会话"
}
公司成员列表
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
GET |
/server/company/list_member/ |
公司成员列表 |
YES |
按条件过滤列表释义如下 :
1. company
公司 id:
/server/company/list_member/?company=1
Response Parameters
Name |
Description |
pk |
成员 id |
owner |
成员用户信息 |
company |
公司的 id |
position_display |
成员的职位名称 |
position |
成员的职位代号 |
Response
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"pk": 6,
"owner": {
"name": "小橙子_xgl1wb",
"avatar": "https://static1.bcjiaoyu.com/head1@3x.png",
"user": "13301257976",
"nickname": "",
"user_id": 8528,
"is_staff": true,
"segment": {
"name": "青铜",
"image": "https://static1.bcjiaoyu.com/silver.png"
}
},
"company": 5,
"position_display": "程序员",
"position": "programmer"
},
{
"pk": 3,
"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"
}
},
"company": 5,
"position_display": "CEO",
"position": "ceo"
}
]
}
公司产品列表
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
GET |
/server/company/list_product/ |
公司产品列表 |
YES |
按条件过滤列表释义如下 :
1. company
公司 id:
/server/company/list_product/?company=1
Response Parameters
Name |
Description |
pk |
产品 id |
showwork |
作品信息 |
company |
公司的 id |
price |
产品的价格 |
sell_count |
作品的销量 |
is_buy |
是否已购买此作品 |
Response
{
"count": 3,
"next": null,
"previous": null,
"results": [
{
"pk": 3,
"company": 6,
"showwork": {
"pk": 856,
"student": {
"name": "18801114248",
"avatar": "https://static1.bcjiaoyu.com/head1@3x.png",
"user": "18801114248",
"nickname": "",
"user_id": 8210,
"is_staff": false,
"segment": {
"name": "青铜",
"image": "https://static1.bcjiaoyu.com/silver.png"
}
},
"name": "我的书架我做主",
"other": "上上下下左左右右,鼠标点击查看。",
"islike": false,
"likes": 1,
"content": "点击书籍名可查看详情,滑动可查看完整简介。可根据环境亮度调整夜晚白天模式,保护眼睛,让人在任何环境下都可进行学习。",
"activity_number": "n84tda7d4m9ippqa",
"works": "https://applab.coding61.com/projects/applab/ymeq5w129ddb6a9cgrncwz6zvcbbe4ef?from=groupmessage&isappinstalled=0",
"images": "https://static1.bcjiaoyu.com/a83aade575051eb42c20f63b7fc306ca_y.-794x1123",
"html": null,
"js": null,
"css": null,
"top": false,
"work_type": "applab",
"status": 0,
"status_display": "待核审",
"create_time": "2019-03-23T15:50:34",
"isowner": false,
"work_nature": null,
"share_code": false
},
"price": 100,
"sell_count": 0,
"is_buy": false
}
]
}
公司等级列表
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
GET |
/server/company/list_grade/ |
公司等级列表 |
YES |
Response
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"top_2_company": [
{
"pk": 11,
"owner": {
"name": "勿问情殇_1111_23",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/5690023e83a72af4ff5be0badaadfbe4_k.gif-658x658",
"user": "15201052252",
"nickname": "chen",
"realname": "陈微",
"user_id": 367,
"is_staff": false,
"segment": {
"name": "黄金",
"image": "https://static1.bcjiaoyu.com/community/touxiangkuang/king.png"
},
"job_title": "讲师"
},
"name": "11111",
"content": "11111111",
"logo": "https://static1.bcjiaoyu.com/bcgame_face2face/367/0fd923cf39cb244b3b0f9de86afb9984_f.gif-658x658",
"total_income": 1200,
"exist_income": 0,
"is_member": false,
"is_ceo": false,
"product_count": 0,
"member_count": 2,
"company_grade": {
"id": 1,
"deleted": false,
"create_time": "2020-05-11T17:42:03.820155",
"order_index": 1000,
"name": "初创公司",
"least_number": 0,
"most_number": 2000,
"image": ""
}
}
],
"deleted": false,
"create_time": "2020-05-11T17:42:03.820155",
"order_index": 1000,
"name": "初创公司",
"least_number": 0,
"most_number": 2000,
"image": ""
}
]
}