[关闭]
@chengxuyuan 2020-05-15T03:12:33.000000Z 字数 6351 阅读 339

开公司文档

社区


新建公司

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
POST /server/company/create_company/ 新建公司 YES

Request

  1. {
  2. "name":"公司的名字",
  3. "content":"公司的介绍",
  4. "logo":"公司 logo"
  5. }

Response Parameters

Name Description
owner 公司创始人信息
name 名称
content 介绍
logo logo 图
total_income 总收入
exist_income 现有收入

Response

  1. {
  2. "pk": 5,
  3. "owner": {
  4. "name": "勿问情殇",
  5. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/5690023e83a72af4ff5be0badaadfbe4_k.gif-658x658",
  6. "user": "15201052252",
  7. "nickname": "chen",
  8. "user_id": 367,
  9. "is_staff": false,
  10. "segment": {
  11. "name": "白银",
  12. "image": "https://static1.bcjiaoyu.com/community/touxiangkuangking.png"
  13. }
  14. },
  15. "name": "公司的名字",
  16. "content": "公司的介绍",
  17. "logo": "公司 logo",
  18. "total_income": 0,
  19. "exist_income": 0,
  20. "company_grade": {
  21. "id": 1,
  22. "deleted": false,
  23. "create_time": "2020-05-11T17:42:03.820155",
  24. "order_index": 1000,
  25. "name": "初创公司",
  26. "least_number": 0,
  27. "most_number": 100000,
  28. "image": ""
  29. }
  30. }

加入某司

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
PUT /server/company/join_company/${pk}/ 加入某司 YES

Response

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

离开某司

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
PUT /server/company/quit_company/${pk}/ 离开某司 YES

Response

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

公司列表

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

  1. {
  2. "count": 1,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 11,
  8. "owner": {
  9. "name": "勿问情殇_1111_23",
  10. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/5690023e83a72af4ff5be0badaadfbe4_k.gif-658x658",
  11. "user": "15201052252",
  12. "nickname": "chen",
  13. "realname": "陈微",
  14. "user_id": 367,
  15. "is_staff": false,
  16. "segment": {
  17. "name": "黄金",
  18. "image": "https://static1.bcjiaoyu.com/community/touxiangkuang/king.png"
  19. },
  20. "job_title": "讲师"
  21. },
  22. "name": "11111",
  23. "content": "11111111",
  24. "logo": "https://static1.bcjiaoyu.com/bcgame_face2face/367/0fd923cf39cb244b3b0f9de86afb9984_f.gif-658x658",
  25. "total_income": 1200,
  26. "exist_income": 0,
  27. "is_member": false,
  28. "is_ceo": false,
  29. "product_count": 0,
  30. "member_count": 2,
  31. "company_grade": {
  32. "id": 1,
  33. "deleted": false,
  34. "create_time": "2020-05-11T17:42:03.820155",
  35. "order_index": 1000,
  36. "name": "初创公司",
  37. "least_number": 0,
  38. "most_number": 2000,
  39. "image": ""
  40. }
  41. }
  42. ]
  43. }

ceo修改职员信息

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
PUT /server/company/update_member/${pk}/ 修改职员 YES

pk 职员的 pk

cURL Example

  1. 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

  1. {
  2. "free_job":"会话"
  3. }

Response

  1. {
  2. "pk": 34,
  3. "owner": {
  4. "name": "小橙子_xgl1wb",
  5. "avatar": "https://static1.bcjiaoyu.com/head1@3x.png",
  6. "user": "13301257976",
  7. "nickname": null,
  8. "realname": null,
  9. "user_id": 8528,
  10. "is_staff": true,
  11. "segment": {
  12. "name": "青铜",
  13. "image": "https://static1.bcjiaoyu.com/silver.png"
  14. }
  15. },
  16. "company": 11,
  17. "position_display": "程序员",
  18. "position": "programmer",
  19. "is_member": true,
  20. "is_ceo": true,
  21. "free_job": "会话"
  22. }

公司成员列表

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

  1. {
  2. "count": 2,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 6,
  8. "owner": {
  9. "name": "小橙子_xgl1wb",
  10. "avatar": "https://static1.bcjiaoyu.com/head1@3x.png",
  11. "user": "13301257976",
  12. "nickname": "",
  13. "user_id": 8528,
  14. "is_staff": true,
  15. "segment": {
  16. "name": "青铜",
  17. "image": "https://static1.bcjiaoyu.com/silver.png"
  18. }
  19. },
  20. "company": 5,
  21. "position_display": "程序员",
  22. "position": "programmer"
  23. },
  24. {
  25. "pk": 3,
  26. "owner": {
  27. "name": "勿问情殇",
  28. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/5690023e83a72af4ff5be0badaadfbe4_k.gif-658x658",
  29. "user": "15201052252",
  30. "nickname": "chen",
  31. "user_id": 367,
  32. "is_staff": false,
  33. "segment": {
  34. "name": "白银",
  35. "image": "https://static1.bcjiaoyu.com/community/touxiangkuangking.png"
  36. }
  37. },
  38. "company": 5,
  39. "position_display": "CEO",
  40. "position": "ceo"
  41. }
  42. ]
  43. }

公司产品列表

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

  1. {
  2. "count": 3,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 3,
  8. "company": 6,
  9. "showwork": {
  10. "pk": 856,
  11. "student": {
  12. "name": "18801114248",
  13. "avatar": "https://static1.bcjiaoyu.com/head1@3x.png",
  14. "user": "18801114248",
  15. "nickname": "",
  16. "user_id": 8210,
  17. "is_staff": false,
  18. "segment": {
  19. "name": "青铜",
  20. "image": "https://static1.bcjiaoyu.com/silver.png"
  21. }
  22. },
  23. "name": "我的书架我做主",
  24. "other": "上上下下左左右右,鼠标点击查看。",
  25. "islike": false,
  26. "likes": 1,
  27. "content": "点击书籍名可查看详情,滑动可查看完整简介。可根据环境亮度调整夜晚白天模式,保护眼睛,让人在任何环境下都可进行学习。",
  28. "activity_number": "n84tda7d4m9ippqa",
  29. "works": "https://applab.coding61.com/projects/applab/ymeq5w129ddb6a9cgrncwz6zvcbbe4ef?from=groupmessage&isappinstalled=0",
  30. "images": "https://static1.bcjiaoyu.com/a83aade575051eb42c20f63b7fc306ca_y.-794x1123",
  31. "html": null,
  32. "js": null,
  33. "css": null,
  34. "top": false,
  35. "work_type": "applab",
  36. "status": 0,
  37. "status_display": "待核审",
  38. "create_time": "2019-03-23T15:50:34",
  39. "isowner": false,
  40. "work_nature": null,
  41. "share_code": false
  42. },
  43. "price": 100,
  44. "sell_count": 0,
  45. "is_buy": false
  46. }
  47. ]
  48. }

公司等级列表

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/company/list_grade/ 公司等级列表 YES

Response

  1. {
  2. "count": 1,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "id": 1,
  8. "top_2_company": [
  9. {
  10. "pk": 11,
  11. "owner": {
  12. "name": "勿问情殇_1111_23",
  13. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/5690023e83a72af4ff5be0badaadfbe4_k.gif-658x658",
  14. "user": "15201052252",
  15. "nickname": "chen",
  16. "realname": "陈微",
  17. "user_id": 367,
  18. "is_staff": false,
  19. "segment": {
  20. "name": "黄金",
  21. "image": "https://static1.bcjiaoyu.com/community/touxiangkuang/king.png"
  22. },
  23. "job_title": "讲师"
  24. },
  25. "name": "11111",
  26. "content": "11111111",
  27. "logo": "https://static1.bcjiaoyu.com/bcgame_face2face/367/0fd923cf39cb244b3b0f9de86afb9984_f.gif-658x658",
  28. "total_income": 1200,
  29. "exist_income": 0,
  30. "is_member": false,
  31. "is_ceo": false,
  32. "product_count": 0,
  33. "member_count": 2,
  34. "company_grade": {
  35. "id": 1,
  36. "deleted": false,
  37. "create_time": "2020-05-11T17:42:03.820155",
  38. "order_index": 1000,
  39. "name": "初创公司",
  40. "least_number": 0,
  41. "most_number": 2000,
  42. "image": ""
  43. }
  44. }
  45. ],
  46. "deleted": false,
  47. "create_time": "2020-05-11T17:42:03.820155",
  48. "order_index": 1000,
  49. "name": "初创公司",
  50. "least_number": 0,
  51. "most_number": 2000,
  52. "image": ""
  53. }
  54. ]
  55. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注