[关闭]
@a335031 2017-10-27T08:08:17.000000Z 字数 33581 阅读 2156

API文档

V.Fine


撤回作品审核

作品增加两个状态
- UNSUBMIT # 待提交
- DELETE # 伪删除

音乐人撤回作品:
PATCH /works/<uuid>/

Request body:

  1. {
  2. "status": "UNSUBMIT"
  3. }

音乐人上下架作品:
PATCH /works/<uuid>/

Request body:

  1. {
  2. "status": "ONLINE", # or OFFLINE
  3. }

音乐人删除作品:
DELETE /works/<uuid>/

OPS普通拒绝:
PATCH /works/<uuid>/

Request body:

  1. {
  2. "status": "UNSUBMIT"
  3. }

音乐人上传音乐

POST /works/

原有内容不变,添加 owner 字段,所有音乐获取相关的接口的 response 都需要添加这一字段

  1. owner:
  2. name: 姓名
  3. phone: 手机
  4. address: 通讯地址

音乐人更新个人作品

PUT /works/<uuid>/

更改音乐的元数据并将音乐状态变为待审核

OPS 编辑音乐

PATCH /works/<uuid>/

OPS 音乐审核

PATCH /works/<uuid>/

  1. {
  2. "status": "FAIL",
  3. "remark": "low"
  4. }

获取音乐人自己的作品

GET /mps/works/

返回所有状态的作品

获取指定音乐人的作品

GET /mps/<uuid>/works/

仅返回在线的作品

提现记录

GET /admin/takeout/

增加个人所得税

提现审核

PUT /admin/takeout/<uuid>/

  1. {
  2. "status": "FAIL",
  3. "remark": "low"
  4. }

API详细文档

说明:
<1> api版本为 /v1/
<2> 如果api返回错误信息,格式统一如下:

  1. {
  2. "message": "Wrong..."
  3. }

只有error message(不需要code来细分错误)

  1. {
  2. "message": "wrong...",
  3. "code": "a_b_c"
  4. }

有code,用于错误细分,具体如下:

  1. phone_unique, email_unique: 该手机号或邮箱已存在
  2. invalid_value: 号码不规范
  3. time_limit_exceeded: 验证码已经超时,请重新发送
  4. identify failed: 验证失败
  5. action_already_done: 当前操作已完成
  6. time_limit_exceeded: 输入验证码超过时间限制
  7. require_captcha: 登录失败次数过多,需要验证码
  8. email_not_activated: 邮箱未激活
  9. unsupported: 当前对象不支持该操作
  10. upstream_error: 上游服务错误,包括发送频率过高,发送次数达到上限
  11. too_many_requests: 调用频率过高,例如手机验证码发送频率
  12. unsent_code: 请先发送验证码
  13. wrong_code: 错误的验证码
  14. wrong_auth: 请先验证身份
  15. wrong_password: 密码错误
  1. {
  2. "detail": "Not found."
  3. }

404时返回的,无需处理response信息

<3> 有的API开始定的不合理,会尽量都在下面补充上修正计划,前端可以先以文档中所说做好兼容

分页策略:

所有分页的接口都可设置参数page_size,用于指定每页的个数。例如:

/accounts/?page=4&page_size=6

1. auth

注册

POST /users/

Request:

  1. {
  2. "phone": "+8617778059999",
  3. "password": "123223",
  4. }

Response 200:

  1. {
  2. "email": "yanhangyhy@icloud.com",
  3. "email_activated": false,
  4. "phone": "",
  5. "type": "Visitor",
  6. "uuid": "D81E059E-30ED-471A-A836-42C9E963323B"
  7. }

Response 400: 传入参数不规范

Response 401:验证失败

检查用户是否存在

GET /users/check

Query Params:

返回200, Response如下:

  1. {
  2. 'result': True/False
  3. }

分别表示用户存在和不存在的状况

登录

POST /users/login

Request:

  1. {
  2. "phone": "+8618566669999",
  3. "email": "",
  4. "password": "123223"
  5. }

Response 204

Response 401: 登陆失败
Response 400:

登出

PUT /users/logout

Response 204: 登出成功

Response 401: 未认证

发送验证码

PUT /auth/send/

  1. {
  2. "phone": "+8618566669999",
  3. "email": ""
  4. }

Response 204:

Response 400

检查验证码

PUT /auth/verify/

Request:

  1. {
  2. "phone": "+86123456788901",
  3. "code": "1234"
  4. }

Response 204

Response 400:

2. 用户个人管理

login required)

检查密码是否正确

GET /users/check-password?password=<xxxx>

Response:

更改密码

PUT /users/password

  1. {
  2. "old_password":"123223",
  3. "new_password":"22333"
  4. }

发送的密码均为明文

Response

更换手机

PUT /users/change-phone

Request Body:

  1. {
  2. "phone": "+8612312341234",
  3. "password": "123223"
  4. }

Response:

更换邮箱

PUT /users/change-email

Request Body:

  1. {
  2. "email": "new_email@163.com",
  3. "password": "123223"
  4. }

Response:

更新用户profile

PUT /v1/users/profile

Request:

  1. {
  2. 'name': '崔老师',
  3. 'location': {
  4. },
  5. 'avatar': '/path/to/avatar.jpg'
  6. }

暂时支持这三个字段,可只传部分字段。其中 location为json串,后端不做验证,由前端自己决定格式。

Response 204

Response 404 用户不存在

Response 401

获取用户profile

GET /users/profile

Response 200:

  1. {
  2. 'name': 'a',
  3. 'avatar': '/path',
  4. 'location': {},
  5. "uuid": "BBC6E384-29B0-42E0-B37F-2D57B6837392",
  6. "email": "a@163.com",
  7. "phone": "+86123456779",
  8. "type": "MUSICIAN",
  9. "musician": {
  10. "type": "SINGER",
  11. "today_profit": 100,
  12. "level": "STAR"
  13. }
  14. }

更新用户关系(关注/取关)

PUT /users/update-relation

  1. {
  2. 'type': 'FOLLOW',
  3. 'uuid': '7ECE1B98-4A3B-482C-8604-4D8E45A75AD9'
  4. }

Response:

收藏或者取消收藏work

PUT /users/collect-work/

Request body:

  1. {
  2. 'uuid': str(works.uuid),
  3. 'type': 'LIKE'
  4. }

Response 204 收藏或取消收藏成功

获取用户收藏歌曲的列表

GET /users/<uuid>/collection-works/

Response 200

  1. {
  2. "count": 1,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "uuid": "0c527003-3372-47ac-a2db-0f07381dae9f",
  8. "producer": "2197a343-8209-4e00-b7ba-fafe25d68169",
  9. "length": 0,
  10. "essence_start": 0,
  11. "essence_end": 0,
  12. "name": "x1",
  13. "path": "xx.path",
  14. "desc": "",
  15. "avatar": "",
  16. "tags": [],
  17. "categories": [],
  18. "size": 0,
  19. "status": "ONLINE",
  20. "created_at": "2017-02-06 03:02",
  21. "type": "PERSONAL",
  22. "can_sell": true
  23. }
  24. ]
  25. }

获取粉丝列表

只对音乐人有效,并且返回的列表里只包含音乐人,且以作品被收藏数量排名

GET /users/followers

Response 200

  1. {
  2. "data":[
  3. {
  4. "location":{
  5. },
  6. "musician":{
  7. "type":"SINGER"
  8. },
  9. "works_likes":5,
  10. "avatar":"/test/pics/musician_profile.png",
  11. "name":"ZhangSan"
  12. },
  13. {
  14. "location":{
  15. },
  16. "musician":{
  17. "type":"SINGER"
  18. },
  19. "works_likes":4,
  20. "avatar":"/test/pics/musician_profile.png",
  21. "name":"ZhangSan"
  22. },
  23. {
  24. "location":{
  25. },
  26. "musician":{
  27. "type":"SINGER"
  28. },
  29. "works_likes":2,
  30. "avatar":"/test/pics/musician_profile.png",
  31. "name":"ZhangSan"
  32. }
  33. ]
  34. }

获取关注列表

目前只对音乐人有效,只显示其关注的音乐人,按作品被收藏数量排序

GET /users/following

Response 200:

  1. {
  2. "data":[
  3. {
  4. "location":{
  5. },
  6. "musician":{
  7. "type":"SINGER"
  8. },
  9. "works_likes":5,
  10. "avatar":"/test/pics/musician_profile.png",
  11. "name":"ZhangSan"
  12. }
  13. ]
  14. }

获取个人创建的项目包列表

GET /users/projects/

Repsonse 200:

  1. {
  2. "count": 14,
  3. "next": "http://host/v1/users/projects?page=2",
  4. "previous": null,
  5. "results": [
  6. {
  7. "category": "TV",
  8. "uuid": "2f21f671-a9f2-4e3a-a186-6becf83e60d2",
  9. "level": "NORMAL",
  10. "created_at": "2016-10-09T05:59:55.717Z",
  11. "desc": "......",
  12. "type": "CASE",
  13. "name": "可口可乐,
  14. "cover": "/path/to/cover",
  15. "status": "APPLYING/ACCEPTED/REJECTED/STARTED/FISHISED"
  16. },
  17. ...
  18. ]
  19. }

删除个人创建的项目包(只删除被后台拒绝的项目包)

DELETE /projects/<uuid>/

Response 204: 删除成功

Response 400: This project does not belong you.

通过手机或邮箱来修改密码

  1. 发送验证码
  2. 检查验证码
  3. 调用本接口

PUT /users/forget-password/

Request Body:

  1. {
  2. "phone": "+8617778051213",
  3. "email": "",
  4. "password": "123"
  5. }

Response 204 修改成功

Response 400:

  1. {
  2. "message": "Verify your account first"
  3. "code": "precondition_failed"
  4. }

3. 用户信息

获取其他用户profile

GET /users/<uuid>/

Response 404: 用户不存在

Response 200:

  1. {
  2. "uuid": "48b475fb-a796-41bc-8fe4-d8b7497aee4d",
  3. "level": "STAR",
  4. "name": "eigenTunes亦听",
  5. "location": {
  6. "city": "广东省",
  7. "country": "中国"
  8. },
  9. "is_musician": true,
  10. "desc": "这是一段描述",
  11. "type": "PRODUCER",
  12. "categories": [
  13. {
  14. "id": 222,
  15. "name": "交响",
  16. "real": false,
  17. "parent": 219
  18. },
  19. ...
  20. ],
  21. "avatar": "default/nbJvfOaMreqqNmVNMESExxNMU0iBoLkDjY4sY6OTX47bJRuEgj.png"
  22. }

4. 文件存储

此目录下api在另一个项目 neptunus

获取存储服务相关信息

GET /storage/upload-info

Query Params:

Response 200:

  1. {
  2. "config": {
  3. "accessid": "99roeiWDhKO0McAY",
  4. "callback": "eyJjYWxsYmFja0JvZHlUeXBlIjogImFwcGxpY2F0aW9uL2pzb24iLCAiY2FsbGJhY2tCb2R5IjogIntcIm1pbWVUeXBlXCI6JHttaW1lVHlwZX0sXCJzaXplXCI6JHtzaXplfSxcImZpbGVuYW1lXCI6JHtvYmplY3R9fSIsICJjYWxsYmFja1VybCI6ICJodHRwOi8vNTIuMTc1LjI2LjE3Ojk1MzAvdjEvY2FsbGJhY2sifQ==",
  5. "host": "http://vfine.oss-cn-beijing.aliyuncs.com",
  6. "expire": 1472103817,
  7. "signature": "s6m44WCovRKDZzpUMebuL2i82Es=",
  8. "policy": "eyJjb25kaXRpb25zIjogW1sic3RhcnRzLXdpdGgiLCAiJGtleSIsICJkZWZhdWx0LyJdXSwgImV4cGlyYXRpb24iOiAiMjAxNi0wOC0yNVQwNTo0MzozN1oifQ==",
  9. "dir": "default/"
  10. },
  11. "storage": "oss"
  12. }

response处理及后续操作请参考 neptunus/tests/index.html文件.

CALLBACK 返回的Response为:

  1. {
  2. "mimeType": "image/png",
  3. "filename": "default/TCWt7CZ8fD.png",
  4. "size": 415533
  5. }

5. 组

(login_required)

创建组

POST /groups/

Request Body:

  1. {
  2. "name": "group1"
  3. }

Response 200:

  1. {
  2. "name": "group1"
  3. }

将其他用户添加进组

PUT /groups/add-user

Request Body:

  1. {
  2. "user_id": "BBC6E384-29B0-42E0-B37F-2D57B6837392",
  3. "group_name": "group1"
  4. }

Response:

6. 音乐人相关

(login required)

音乐人认证

PUT /mps/identification

Rquest body:

  1. {
  2. "avatar": "/path",
  3. "name": "lee",
  4. "occupations": ["singer"],
  5. "id": "13010419xxxxx1234",
  6. "id_card_": "/path",
  7. "id_card_": "/path",
  8. "music": "music path"
  9. }

Response:

获取认证状态

GET /mps/identification

注意只有当用户类型为游客时才需要调用此API

Response 200:

  1. {
  2. "is_done": null or true/false
  3. }

筛选定制音乐人

(no login required)

GET /mps/

Query params:

Response 200:

  1. {
  2. "results": [
  3. {
  4. "uuid": "929898b3-b715-4e7d-ba9e-cf31edfa8213",
  5. "name": "李天衣",
  6. "avatar": "default/sS6MITzuYrCUrQKVzhAUp0de0GOM4aCKeo4K4xqqZfqXdYTAOu.png",
  7. "location": {
  8. "city": "北京市",
  9. "country": "中国"
  10. },
  11. "categories": [
  12. {
  13. "id": 222,
  14. "name": "交响",
  15. "real": false,
  16. "parent": 219
  17. },
  18. ...
  19. ],
  20. "theme_song": null,
  21. "projects": [
  22. {
  23. "uuid": "721fc2ec-5fc1-46a9-a316-1306404c6469",
  24. "created_at": "2017-05-04T09:36:52.417000Z",
  25. "updated_at": "2017-05-04T09:36:52.417000Z",
  26. "owner": null,
  27. "works": [
  28. {
  29. "uuid": "199e4638-f37d-46c0-ab7a-1ef99135f056",
  30. "name": "易到用车TVC企业宣传片-徐小平篇",
  31. "path": "default/qhBbsehenlxJaZGreXZWHSnIGTHWRrOSWCnaotfYNzEhVAkdZR.mp3",
  32. "avatar": ""
  33. },
  34. {
  35. "uuid": "5d3028e3-b200-4751-9561-e73f0ec31e2b",
  36. "name": "易到用车TVC企业宣传片-姬十三篇",
  37. "path": "default/79bTO9byjOqIFUO491Jav9zGkBDoNntpadl3X2Kkly2Swy76mo.mp3",
  38. "avatar": ""
  39. }
  40. ],
  41. "is_outside": true,
  42. "cover": "default/TqRRsZrXOzFtWKP2ivDj8Q7N5CkoHUnrZTDpAhwRcGMYDRk0JA.png",
  43. "category": "AD",
  44. "name": "易到用车TVC企业宣传片",
  45. "desc": "我为易到用车企业宣传片制作音乐。",
  46. "start_date": "2016-01-30",
  47. "end_date": "2016-02-09",
  48. "budget": 30,
  49. "currency": "RMB",
  50. "status": "FINISHED",
  51. "video": "video/徐小平.mp4",
  52. "sub_category": "PROMO",
  53. "need_all_copyright": true,
  54. "need_sound_design": false,
  55. "length": 121,
  56. "period": 10
  57. },
  58. ...
  59. ]
  60. },
  61. ...
  62. ],
  63. ...
  64. }

获取所有音乐人列表

(no login required)

GET /mps/

Query Pramas:

Response 200 :

  1. {
  2. "count": 2,
  3. "next": "http://api.vfinemusic.com/v1/mps/?page=2&sort=HOTTEST&type=BANDSMAN",
  4. "previous": null,
  5. "results": [
  6. {
  7. "location": {},
  8. "works_likes": 4,
  9. "name": "刘德华",
  10. "avatar": "/path",
  11. "uuid": "2EA852B2-C109-407C-BC40-CA3DF70F3E7E",
  12. "level": "NORMAL",
  13. "desc": "我有多么牛逼balabala",
  14. "county": "China"
  15. },
  16. ...
  17. ]
  18. }

获取音乐人作品列表(非项目类)

(no login required)

GET /mps/<uuid>/works

Response 404: 用户不存在

Response 200:

  1. {
  2. "results": [
  3. {
  4. "uuid": "3c3ddde2-e47f-4bb9-802b-8dc6e020a84b",
  5. "producer": "bbee6da4-39aa-4769-8b51-4191d2c8805e",
  6. "length": 0,
  7. "essence_start": 0,
  8. "essence_end": 0,
  9. "name": "xxx",
  10. "path": "",
  11. "desc": "",
  12. "avatar": "",
  13. "tags": [],
  14. "categories": [],
  15. "size": 0,
  16. "status": "ONLINE",
  17. "created_at": "2017-02-21 05:02",
  18. "type": "",
  19. "can_sell": false,
  20. "collect_count": 0,
  21. "username": "",
  22. "photo": ""
  23. }
  24. ],
  25. ...
  26. }

2、 remarks 管理员审核备注

response 要增加版权所有者信息、上传音频信息

音乐人上传音乐

获取音乐人项目列表

(no login required)

GET /mps/<uuid>/projects

Response 404: 用户不存在

Response 200:

  1. {
  2. "count": 14,
  3. "next": "http://host/v1/mps/<uuid>/projects?page=2",
  4. "previous": null,
  5. "results": [
  6. {
  7. "category": "TV",
  8. "uuid": "2f21f671-a9f2-4e3a-a186-6becf83e60d2",
  9. "level": "NORMAL",
  10. "created_at": "2016-10-09T05:59:55.717Z",
  11. "desc": "......",
  12. "type": "CASE",
  13. "name": "可口可乐,
  14. "cover": "/path/to/cover",
  15. "status": "APPLYING/ACCEPTED/REJECTED/STARTED/FISHISED"
  16. },
  17. ...
  18. ]
  19. }

获取音乐人申请项目包列表

GET /mps/projects/applying/

Query params:

不传的话获取音乐人申请的所有项目包列表

  1. {
  2. "count": 2,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "status": "APPLYING",
  8. "category": "TV",
  9. "project_name": "project_name",
  10. "uuid": "2f21f671-a9f2-4e3a-a186-6becf83e60d2",
  11. "end_date": "2016-09-12",
  12. "level": "NORMAL",
  13. "cover": "pics/26bDSBM5wD.png",
  14. "created_at": "2016-09-10T01:35:23.724Z",
  15. "short_desc": "short_desc",
  16. "budget": 200,
  17. "owner":{
  18. "name": 'xx',
  19. "uuid": 'a63dbcf4-a812-49f1-a5c6-c1b0991d17f3',
  20. "phone": '18611112222'
  21. "email": '3423rfew@qq.com'
  22. },
  23. "desc": "desc",
  24. "type": "WORKS",
  25. "start_date": "2016-09-11",
  26. "name": "name"
  27. },
  28. .....
  29. ]
  30. }

获取音乐人申请的某一项目包的状态

GET /mp/<project_uuid>/applying

response 200

  1. {
  2. "id": 1,
  3. "created_at": "2016-12-22T08:35:05.332000Z",
  4. "updated_at": "2016-12-22T08:35:05.332000Z",
  5. "status": "APPLYING",
  6. "project": "5dbee382-cd33-40fe-8c49-5fda3b08ffb7",
  7. "mp": 1
  8. }

音乐人添加个人作品

POST /works/

Request body:

  1. {
  2. 'name': 'xxx',
  3. 'path': 'sdas.path',
  4. 'can_sell': True
  5. }

Response 200

  1. {
  2. "uuid": "957f1f09-cfee-446a-ac33-c05f0a15e24f",
  3. "producer": "e2d2fc7c-b0e2-4fe0-ba8a-4c53ea0e8fec",
  4. "length": 0,
  5. "name": "xxx",
  6. "path": "sdas.path",
  7. "desc": "",
  8. "avatar": "",
  9. "categories": [],
  10. "size": 0,
  11. "status": "ONLINE",
  12. "created_at": "2017-02-21 05:02",
  13. "can_sell": true,
  14. "collect_count": 0,
  15. "owner": {
  16. }
  17. }

音乐人删除个人作品

DELETE /works/<uuid>/

Response 204删除成功

音乐人更新个人作品

PUT /works/<uuid>/

Request body:

  1. {
  2. 'status': 'OFFLINE',
  3. 'name': 'hehe',
  4. 'tags': [tag1.id],
  5. 'can_sell': True
  6. }

Response:

  1. {
  2. "uuid": "1736588e-8b68-4030-9f0c-dfa67a3c97dd",
  3. "producer": 1,
  4. "length": 0,
  5. "essence_start": 0,
  6. "essence_end": 0,
  7. "name": "hehe",
  8. "path": "",
  9. "desc": "",
  10. "avatar": "",
  11. "tags": [
  12. {
  13. "id": 1,
  14. "name": "tag1"
  15. }
  16. ],
  17. "categories": [],
  18. "size": 0,
  19. "status": "OFFLINE",
  20. "created_at": "2017-01-21 05:01",
  21. "type": "PERSONAL",
  22. "can_sell": true
  23. }

Response 400:

其他的选项参照上面创建works的参数,可填可不填,

音乐人风格

GET /categories/?root=musician_style

Response:

  1. {
  2. "results": [
  3. {
  4. "id": 234,
  5. "name": "Hip-Hop",
  6. "real": true,
  7. "parent": 219,
  8. "children": []
  9. },
  10. ...
  11. ]
  12. }

音乐人职业

GET /categories/?root=career

Response:

  1. {
  2. "results": [
  3. {
  4. "id": 231,
  5. "name": "乐手",
  6. "real": false,
  7. "parent": 229,
  8. "children": [
  9. {
  10. "id": 242,
  11. "name": "手风琴",
  12. "real": true,
  13. "parent": 231,
  14. "children": []
  15. },
  16. ...
  17. ]
  18. },
  19. ...
  20. ]
  21. }

获取实名资料

GET /users/real_name/

Response 200:

  1. {
  2. "status": "SUCCESS",
  3. "created_at": "2016-12-02T11:46:15.433164Z",
  4. "name": "大姨夫",
  5. "id_card": "1234**********1234",
  6. "id_card_facade": "/path",
  7. "id_card_obverse": "/path"
  8. }

Response 404: 当前用户未提交申请资料
Response 200:

提交实名资料

POST /users/real_name/

Resquest body

  1. {
  2. "name": "大姨夫",
  3. "id_card": "362227199501012022",
  4. "id_card_facade": "/path",
  5. "id_card_obverse": "/path"
  6. }

通过指定用户的实名资料

PATCH /users/<uuid>/real_name/

Request body:

  1. {
  2. "status": "SUCCESS"
  3. }

7. 项目包

创建项目包

(login required)

POST /projects/

通用字段

广告类

  1. {
  2. "cover": "/path/to/cover",
  3. "category": "AD",
  4. "name": "可口可乐",
  5. "project_name": "项目名称",
  6. "short_desc": "释放你的激情",
  7. "start_date": "2016-09-10",
  8. "end_date": "2016-09-11",
  9. "budget": 1000,
  10. "desc": "呵呵...",
  11. "need_all_copyright": true,
  12. "need_sound_design": true,
  13. "sound_design" : {
  14. "special_sound_effect": true,
  15. "post_remix": true,
  16. "actual_sound_handle": true,
  17. "background_noise": true
  18. }
  19. }

个人类

  1. {
  2. "cover": "/path/to/cover",
  3. "category": "PERSONAL",
  4. "name": "私人",
  5. "project_name": "项目名称",
  6. "short_desc": "个人定制",
  7. "start_date": "2016-09-10",
  8. "end_date": "2016-09-11",
  9. "budget": 1000,
  10. "desc": "呵呵...",
  11. "need_all_copyright": true,
  12. "need_sound_design": false,
  13. "sub_category": "MIX"
  14. }

跨界类

  1. {
  2. "cover": "/path/to/cover",
  3. "category": "COOPERATION",
  4. "name": "跨界",
  5. "project_name": "项目名称",
  6. "short_desc": "释放你的激情",
  7. "start_date": "2016-09-10",
  8. "end_date": "2016-09-11",
  9. "budget": 1000,
  10. "desc": "呵呵...",
  11. "need_all_copyright": true,
  12. "need_sound_design": false,
  13. "sub_category": "MUSIC-TECH"
  14. }

影视类(动画电影,电影,电视剧,动画电视剧):

  1. {
  2. "cover": "/path/to/cover",
  3. "category": "TV/ANIMATION",
  4. "name": "八恶人",
  5. "project_name": "项目名称",
  6. "short_desc": "释放你的激情",
  7. "start_date": "2016-09-10",
  8. "end_date": "2016-09-11",
  9. "budget": 1000,
  10. "desc": "呵呵...",
  11. "need_all_copyright": true,
  12. "need_sound_design": false,
  13. "content_category": "FILM",
  14. "director_name": "张艺谋",
  15. "length": 100,
  16. "episode_count": 1,
  17. "scenes": [
  18. {
  19. "name": "THEME-SONG",
  20. "picked": "/path/to/picked-song.mp3"
  21. }
  22. ]
  23. }

游戏类

  1. {
  2. "cover": "/path/to/cover",
  3. "category": "GAME",
  4. "name": "私人",
  5. "project_name": "项目名称",
  6. "short_desc": "释放你的激情",
  7. "start_date": "2016-09-10",
  8. "end_date": "2016-09-11",
  9. "budget": 1000,
  10. "desc": "呵呵...",
  11. "need_all_copyright": true,
  12. "need_sound_design": false,
  13. "platform": "WEB",
  14. "gender": "ALL",
  15. "age_area": "3+",
  16. "sub_category": "AA"
  17. }

获取项目包详情

(no login required)

GET /projects/<uuid>/

Response 404: 相关对象不存在

Response 200:

  1. {
  2. "name": "可口可乐",
  3. "cover": "/path/to/cover",
  4. "producers": [
  5. {
  6. "type": "SINGER",
  7. "name": "ZhangSan",
  8. "avatar": "/test/pics/musician_profile.png"
  9. },
  10. {
  11. "type": "SINGER",
  12. "name": "ZhangSan",
  13. "avatar": "/test/pics/musician_profile.png"
  14. }
  15. ],
  16. "owner": {
  17. "location": {},
  18. "avatar": "/test/pics/musician_profile.png",
  19. "name": "ZhangSan",
  20. "level": "NORMAL"
  21. },
  22. "works": [
  23. {
  24. "length": 6,
  25. "author": "Taylor Swift",
  26. "essence_start": 1,
  27. "name": "Example.ogg",
  28. "essence_end": 3,
  29. "avatar": ""
  30. }
  31. ],
  32. "desc": "......"
  33. }

获取项目包列表

GET projects/?category=TV

Query Params:

Response 200:(分页)

  1. {
  2. "count": 1,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "category": "TV",
  8. "created_at": "2016-09-20T09:59:49.852Z",
  9. "desc": "......",
  10. "level": "NORMAL",
  11. "main_producer": {
  12. "name": "ZhangSan"
  13. },
  14. "name": "可口可乐",
  15. "type": "CASE",
  16. "uuid": "2F21F671-A9F2-4E3A-A186-6BECF83E60D2",
  17. "works": {
  18. "length": 6,
  19. "name": "Example.ogg",
  20. "path": "/songs/Example.ogg"
  21. }
  22. }
  23. ]
  24. }

获取精品项目包列表

固定数量四个

GET /projects?type=CASE

Response 200:

  1. {
  2. "data": [
  3. {
  4. "cover": "/path/to/cover",
  5. "name": "可口可乐",
  6. "uuid": "2F21F671-A9F2-4E3A-A186-6BECF83E60D2"
  7. }
  8. ]
  9. }

8. 曲库

GET /songs/example/

Query Params

Resopnse 200

  1. {
  2. "count": 2,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "id": 20,
  8. "name": "654654",
  9. "href": "default/5TcuiXqerUuTuMVH1Nk1VReLpPue7dS9KSV4SsGnCGCVDTalzD.exe",
  10. "cover_path": "",
  11. "color": "RED",
  12. "group": "CHINA",
  13. "created_at": "2016-12-02T11:46:15.433164Z",
  14. "status": "ONLINE"
  15. },
  16. {
  17. "id": 19,
  18. "name": "其味无穷二",
  19. "href": "default/LoPtSwgft0khP4fgTtiTxjaXP6YMCEaYgNqAh8MzD41DQbtS7r.jpeg",
  20. "cover_path": "",
  21. "color": "RED",
  22. "group": "CHINA",
  23. "created_at": "2016-12-02T11:43:42.730316Z",
  24. "status": "ONLINE"
  25. }
  26. ]
  27. }

9. Banner

获取banner

GET /v1/banner/?type=SLIDER

Query Params:

type banner分类

Response 200:

  1. {
  2. "data": [
  3. {
  4. "href": "x1.jpg",
  5. "type": "SLIDER",
  6. "name": "banne1"
  7. },
  8. {
  9. "href": "x2.jpg",
  10. "type": "SLIDER",
  11. "name": "banne2"
  12. },
  13. {
  14. "href": "x3.jpg",
  15. "type": "SLIDER",
  16. "name": "banne3"
  17. },
  18. {
  19. "href": "x4.jpg",
  20. "type": "SLIDER",
  21. "name": "banne4"
  22. }
  23. ]
  24. }

10. 消息

login required

获取个人消息列表

GET /messages/

注意:该接口会附带把所有消息置为已读。

Params:

Response 200:

  1. {
  2. "results":[
  3. {
  4. "type": "SYSTEM",
  5. "args": {"email": "support@vfinemusic.com"}
  6. "content": "SUCCESS_TO_MUSICIAN",
  7. "read": true,
  8. "created_at": "2016-12-26T07:27:47.393000Z",
  9. "id": 2,
  10. "title": "SUCCESS_TO_MUSICIAN"
  11. },
  12. ...
  13. ],
  14. ...
  15. }

按时间排序,最新的在最前面.

获取未读消息数量

GET /messages/count/?read=false

Response body:

  1. {
  2. "count": 3
  3. }

删除指定消息

DELETE /messages/<id>/

Response:


注意:以下是已废弃接口。

将消息标记为已读状态

PUT /messages/<id>/read/

Response:

发送信息

POST /messages/

Request body:

  1. {
  2. "title": "xx",
  3. "content": "vvv",
  4. "receiver": "xxxxxxxxxxxxxx"
  5. }

Response 200:

  1. {
  2. "content":"vvv",
  3. "read":false,
  4. "created_at":"2016-12-26T07:27:47.393000Z",
  5. "id":1,
  6. "title":"xx"
  7. }

11. 工作台

后台创建检查点

POST /admin/checkpoints/

Request Body:

  1. {
  2. 'date': '2016-12-30',
  3. 'project_uuid': '2f21f671a9f24e3aa1866becf83e60d2',
  4. 'text': 'to do',
  5. 'mp_id': 'mp.id'
  6. }

以上几个字段都是必须的,时间格式前端需要检验下

需要注意的是,一个项目包当天只有一个检查点,如果在创建的话,会覆盖前一个检查点

Response 200:

  1. {
  2. "uuid": "1c42ac46-2833-4679-8d14-06ee7ce9aecd",
  3. "works": [],
  4. "date": "2016-12-30",
  5. "text": "to do",
  6. "status": "UNFINISHED",
  7. "producer": 1,
  8. "project": "b6f8d42c-ee7c-4175-92c7-97421a1c6009"
  9. }

Response 400

后台修改检查点

PUT /admin/checkpoints/<uuid>

Request body:

  1. {
  2. 'text': 'sss',
  3. 'date': '2016-12-29'
  4. }

Response 200

  1. {
  2. "uuid": "1c42ac46-2833-4679-8d14-06ee7ce9aecd",
  3. "works": [],
  4. "date": "2016-12-29",
  5. "text": "sss",
  6. "status": "UNFINISHED",
  7. "producer": 1,
  8. "project": "b6f8d42c-ee7c-4175-92c7-97421a1c6009"
  9. }

删除检查点

DELETE /admin/checkpoints/<uuid>

Response 204 删除成功

后台获取项目包检查点的状态

GET /admin/package/<uuid>/checkpoints/

Response 200:

  1. {
  2. "checkpoints": [
  3. {
  4. "uuid": "7d77e1b6-d29a-4568-9613-d0253d02208d",
  5. "works": [],
  6. "date": "2016-12-24",
  7. "text": "to-do",
  8. "status": "UNFINISHED",
  9. "producer": 1,
  10. "project": "247f75d8-a5b2-475f-b23c-537783793264"
  11. }
  12. ]
  13. }

获取当前登录用户某年某月的检查点

GET /workbenches/checkpoints/

Query Params:

status(不传的话获取下面两种情况的集合)

Response 200:

  1. {
  2. "data": [
  3. {
  4. "uuid": "76ca7d14-2984-4490-97dc-fc1eed497426",
  5. "works": [],
  6. "date": "2016-06-23",
  7. "text": null,
  8. "status": "UNFINISHED",
  9. "producer": 1,
  10. "project": "c7aa106f-bc23-4440-9882-3b2cc1ca0f8f"
  11. },
  12. {
  13. "uuid": "b423d4d2-2743-4138-8c42-74aad4aeb992",
  14. "works": [],
  15. "date": "2016-12-23",
  16. "text": "to-do",
  17. "status": "UNFINISHED",
  18. "producer": 1,
  19. "project": "c7aa106f-bc23-4440-9882-3b2cc1ca0f8f"
  20. }
  21. ]
  22. }

音乐人在某一检查点上添加works

POST /workbenches/checkpoints/<uuid>/work/

Request Body:

  1. {
  2. 'name': 'name1',
  3. 'path': 'work1'
  4. }

后台admin可以复用此接口

Response 200:

  1. {
  2. "uuid": "6efe8012-e708-4ecc-a84e-1b2e9eb0e132",
  3. "works": [
  4. {
  5. "uuid": "ac63a9a2-2475-4257-a324-f72d8f530b56",
  6. "producer": 1,
  7. "length": 0,
  8. "essence_start": 0,
  9. "essence_end": 0,
  10. "name": "name1",
  11. "path": "work1",
  12. "desc": "",
  13. "avatar": "",
  14. "tags": [],
  15. "categories": [],
  16. "size": 0,
  17. "status": "ONLINE",
  18. "created_at": "2016-12-26 07:12"
  19. }
  20. ],
  21. "date": "2016-12-23",
  22. "text": "xxx",
  23. "status": "UNFINISHED",
  24. "producer": 1,
  25. "project": "2e0eafab-0e3d-43c4-a5fa-50bfda00b3d7"
  26. }

Respose 400:

音乐人删除某一检查点上的works

后台admin可以复用此借口

DELETE /workbenches/checkpoints/<uuid>/work/

Request body:

  1. {
  2. 'works': ['ac63a9a2-2475-4257-a324-f72d8f530b56', '99832ecb-9a7c-4275-8a89-3672fa8bd64a']
  3. }

Response 204: 删除成功

Response 400:

获取某一个检查点的验收情况

GET /workbenches/checkpoints/<uuid>/acceptance/

Response 200:

  1. [
  2. {
  3. "id": 1,
  4. "created_at": "2016-12-26T07:27:47.393000Z",
  5. "updated_at": "2016-12-26T07:27:47.393000Z",
  6. "mp_message": "demo-1",
  7. "client_message": "demo-1 unsatisfied",
  8. "status": "UNSATISFIED",
  9. "cp": "2eaa07b8-7073-4398-b062-6fae5ea61e09",
  10. "client": "6100915e-d7b6-4a5a-b46f-a089557a2106"
  11. },
  12. {
  13. "id": 2,
  14. "created_at": "2016-12-26T07:27:47.393000Z",
  15. "updated_at": "2016-12-26T07:27:47.393000Z",
  16. "mp_message": "demo-2",
  17. "client_message": "ok",
  18. "status": "SATISFIED",
  19. "cp": "2eaa07b8-7073-4398-b062-6fae5ea61e09",
  20. "client": "6100915e-d7b6-4a5a-b46f-a089557a2106"
  21. }
  22. ]

音乐人提交验收

POST /workbenches/checkpoints/<uuid>/acceptance/

Request body:

  1. {
  2. 'message': 'demo-1'
  3. }

Response 200:

  1. {
  2. "id": 1,
  3. "created_at": "2016-12-26T07:31:44.717000Z",
  4. "updated_at": "2016-12-26T07:31:44.717000Z",
  5. "mp_message": "",
  6. "client_message": "demo-1",
  7. "status": "UNSATISFIED",
  8. "cp": "8c870d1b-5931-4386-96ad-ca19dfee6152",
  9. "client": "33d50f03-f6fd-4ad0-88a5-7cc4ce5625c7"
  10. }

Response 400:

客户获取某一项目下面的检查点状态

GET /projects/<uuid>/checkpoints/

Response 200:

  1. {
  2. "checkpoints": [
  3. {
  4. "uuid": "c0fd39c0-3b4c-4cf6-86ab-f73559f967c3",
  5. "works": [
  6. {
  7. "uuid": "ff61c576-ba0b-4524-9c82-fc33ba32f237",
  8. "producer": 1,
  9. "length": 0,
  10. "essence_start": 0,
  11. "essence_end": 0,
  12. "name": "work1",
  13. "path": "",
  14. "desc": "",
  15. "avatar": "",
  16. "tags": [],
  17. "categories": [],
  18. "size": 0,
  19. "status": "ONLINE",
  20. "created_at": "2016-12-26 07:12"
  21. }
  22. ],
  23. "date": "2016-12-23",
  24. "text": "xxx",
  25. "status": "UNFINISHED",
  26. "producer": 1,
  27. "project": "247f75d8-a5b2-475f-b23c-537783793264"
  28. },
  29. {
  30. "uuid": "7d77e1b6-d29a-4568-9613-d0253d02208d",
  31. "works": [],
  32. "date": "2016-12-24",
  33. "text": "to-do",
  34. "status": "UNFINISHED",
  35. "producer": 1,
  36. "project": "247f75d8-a5b2-475f-b23c-537783793264"
  37. }
  38. ]
  39. }

Response 400

客户验收某一检查点

PUT /workbenchs/acceptance/<id>/

Request body:

  1. {
  2. 'message': 'demo is ok',
  3. 'status': 'SATISFIED'
  4. }

满意的时候 message 可以为空字符串

不满意的时候, message 不能为空

Response 200:

  1. {
  2. "id": 1,
  3. "created_at": "2016-12-26T07:42:45.977000Z",
  4. "updated_at": "2016-12-26T07:42:45.991000Z",
  5. "mp_message": "demo-1",
  6. "client_message": "demo is ok",
  7. "status": "SATISFIED",
  8. "cp": "a0adcc4d-15db-4669-9d67-17b3176ba7b0",
  9. "client": "24755426-c056-45c6-9a85-548d4ec9eb36"
  10. }

Response 400:

获取某一项目的进度

GET /workbenches/project/checkpoints/

Query Params

Response 200

  1. {
  2. "data": "2/6"
  3. }

12. 版权曲库销售前端

获取全部标签列表

GET /categories/

Response 200:

  1. {
  2. "results": [
  3. {
  4. "id": 1,
  5. "name": "风格",
  6. "parent": null,
  7. "real": false,
  8. "children": [
  9. {
  10. "id": 3,
  11. "name": "摇滚",
  12. "real": true,
  13. "parent": 1,
  14. "children": []
  15. },
  16. ...
  17. ]
  18. },
  19. ...
  20. ]
  21. }

获取风格列表

GET /categories/?root=风格&struct=flat

Response 200:

  1. {
  2. "results": [
  3. {
  4. "id": 29,
  5. "name": "摇滚",
  6. "real": false,
  7. "parent": 163
  8. },
  9. ...
  10. ]
  11. }

获取平台作品

GET /works/

params:

Response 200:

  1. {
  2. "count": 4,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "username": "谭维维",
  8. "photo": "/test/pics/musician_profile.png",
  9. "path": "/songs/Example.ogg",
  10. "essence_start": 1,
  11. "desc": "测试音频文件",
  12. "name": "Example.ogg",
  13. "uuid": "dd3b44f8-ef46-41b9-beb9-dfdc3a9353db",
  14. "essence_end": 3,
  15. "length": 6,
  16. "avatar": "",
  17. "type": "PRODUCER"
  18. },
  19. ...
  20. ]
  21. }

获取统一定价方案

GET /pricing/

Response body:

  1. {
  2. "purpose": [
  3. {
  4. "name": "广告/宣传片",
  5. "question": "请选择您的投放渠道",
  6. "detail": [
  7. {
  8. "name": "全渠道投放",
  9. "price": 500.0
  10. },
  11. ...
  12. ]
  13. },
  14. ...
  15. ]
  16. }

添加音乐到购物车

POST /cart/

Request body:

  1. {
  2. "work": <work uuid>,
  3. "purpose": "广告/宣传片",
  4. "detail": "全渠道投放"
  5. }

Response 201: 添加成功

获取购物车列表

GET /cart/

Response body:

  1. {
  2. results: [
  3. {
  4. "id": 1,
  5. "purpose": "广告/宣传片",
  6. "detail": "全渠道投放",
  7. "pricing": 500.0,
  8. "work": {
  9. "uuid": <uuid>,
  10. "name": "_name_",
  11. "path": "/path.mp3",
  12. "producer": {
  13. "uuid": <uuid>,
  14. "name": "_name_"
  15. }
  16. }
  17. },
  18. ...
  19. ]
  20. }

从购物车删除音乐

DELETE /cart/<id>/

Response 204: 删除成功

生成订单

POST /orders/

Request body:

  1. {
  2. "name": <name>,
  3. "phone": <phone>,
  4. "mode": "COMPANY",
  5. "company": <company name>,
  6. "address": <company address>,
  7. "works": [
  8. {
  9. "uuid": <uuid>,
  10. "purpose": "商业广告/宣传片",
  11. "channel": "全渠道投放"
  12. },
  13. ...
  14. ]
  15. }

Response 200:

  1. {
  2. 支付服务返回的结果
  3. }

获取订单列表

POST /orders/

Request params:

Response body:

  1. {
  2. "count": 2,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "uuid": "9b44d5ae-f099-4ae1-846e-34e4c8a7b458",
  8. ...
  9. },
  10. ...
  11. ]
  12. }

获取订单详情

POST /orders/<uuid>/

Response body:

  1. {
  2. "uuid": "9b44d5ae-f099-4ae1-846e-34e4c8a7b458",
  3. "name": "大姨夫",
  4. "phone": "+8618515355024",
  5. "company": "音未",
  6. "address": "五道口",
  7. "price": "500.00",
  8. "payment_method": null,
  9. "payment_number": null,
  10. "certificates": [
  11. {
  12. "uuid": "68e01d72-3959-4463-bc66-b09405615ea2",
  13. "author": "富宇",
  14. "licensee": "Admin",
  15. "work_name": "saxsmooth",
  16. "work_path": "songs/SIk4YzGuA84R0yoYkl3156eJocbpGJdCpsEvf2xMmvUpjpjUBx.mp3",
  17. "work": {
  18. "uuid": "06fbadf2-2d19-4fad-b57d-ac4f51c2c077",
  19. "avatar": "/path"
  20. },
  21. "purpose": "商业广告/宣传片",
  22. "channel": "全渠道投放",
  23. "price": "500.00",
  24. "income": "0.00",
  25. "order": "9b44d5ae-f099-4ae1-846e-34e4c8a7b458"
  26. }
  27. ]
  28. }

uuid: 订单号

去支付

GET /orders/<uuid>/pay/

取消订单

DELETE /orders/<uuid>/

Response 204 : 取消成功

获取已购买音乐授权

GET /certificates/

Response body:

  1. {
  2. results: [<certificate>, ...],
  3. ...
  4. }

获取指定授权

GET /certificates/<uuid>/

Response body:

  1. {
  2. "uuid": "4f08e0ad-8475-462b-9371-48e541eafaa8",
  3. "author": "eigenTunes亦听",
  4. "licensee": "Admin",
  5. "work_name": "漫步星空",
  6. "work_path": "/path.mp3",
  7. "work": {
  8. "uuid": "2dc065a3-239f-45ae-ba6c-cf17636b8dd3",
  9. "name": "漫步星空",
  10. "path": "/path.mp3",
  11. "avatar": "/path.jpg",
  12. "producer": {
  13. "uuid": <uuid>,
  14. "name": "eigenTunes亦听"
  15. }
  16. },
  17. "purchase_date": "2017-05-08T10:15:02.402000Z",
  18. "purpose": "广告/宣传片",
  19. "detail": "全渠道投放",
  20. "price": "0.01",
  21. "income": "0.00",
  22. "order": "184d37c2-b836-479e-aa8b-2991ff3781d3"
  23. }

下载证书

GET /certificates/<uuid>[.txt|.pdf]

收益总计

GET /income/total/

Response body:

  1. {
  2. "data": {
  3. "balance": "898.00",
  4. "total_income": "1000.00",
  5. "current_month_income": "26.00",
  6. "total_order": 5,
  7. "current_month_order": 3
  8. }
  9. }

收益明细

GET /income/

Response body:

  1. {
  2. results: [
  3. {
  4. "uuid": "4f08e0ad-8475-462b-9371-48e541eafaa8",
  5. "purchase_date": "2017-05-08T10:15:02.402000Z",
  6. "work_name": "漫步星空",
  7. "licensee": "Admin",
  8. "price": "100.00",
  9. "income": "89.00"
  10. }
  11. ],
  12. ...
  13. }

绑定收款账户

POST /pay_account/

Request body:

  1. {
  2. "type": "alipay”,
  3. "account": "dayifu"
  4. }

获取收款账户

GET /pay_account/

Response body:

  1. {
  2. "type": "alipay”,
  3. "account": "da*ifu"
  4. }

Response 404: 未绑定

修改支付账户

PUT /pay_account/

Request body:

  1. {
  2. "type": "alipay",
  3. "account": "dayifu"
  4. }

申请提现

POST /takeout/

Request body:

  1. {
  2. money: 100.0
  3. }

提现明细

GET /takeout/

  1. {
  2. "count": 3,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "uuid": <uuid>,
  8. "status": "REQUESTING",
  9. "created_at": "2016-12-02T11:46:15.433164Z",
  10. "money": "100.00",
  11. "transfer_money": "90.00",
  12. "name": "dayifu",
  13. "id_card": "345678905678",
  14. "balance": 300
  15. }
  16. ]
  17. }

13. 用戶提交建议

提交建议

POST /suggestions/

Request body

  1. {
  2. "username": "xx",
  3. "text": "xzcz",
  4. }

Response 200

14. 购买歌曲相关

用户提交购买申请

需要登录才能购买

POST /users/purchase-work/

Request body:

  1. {
  2. 'uuid': 'ac20265d-91b7-4375-a689-b5d0f4e6fa2c',
  3. 'remark': 'xxxx'
  4. }

Response body:

  1. {
  2. "id": 1,
  3. "remark": "xxxx",
  4. "date": "2017-01-19",
  5. "status": "APPLY",
  6. "user": "e1d6054f-8e97-4569-b3f0-4a654a9bd1ec",
  7. "work": "7f6552a7-fc19-4ebc-a23b-1bf6a408514b"
  8. }

Response 400

15. 下单接单相关

音乐人接单

POST /projects/<uuid>/order/

Request body:

  1. {
  2. quote: 222,
  3. message: "xx",
  4. demo: {
  5. "xx": 'xx'
  6. }
  7. }

Response 200

  1. {
  2. "id": 1,
  3. "project": "44e5d65a-d3c5-46c8-9d01-ed2bb0d7112d",
  4. "quote": 222,
  5. "message": "xxx",
  6. "is_candidate": false,
  7. "backend": {},
  8. "weight": 0,
  9. "mp_id": "1",
  10. "mp_uuid": "22fdbdc1-acc9-42e2-9b6a-1b74a9b63026",
  11. "username": "jason",
  12. "avatar": "",
  13. "demo": {
  14. "xx": "xx"
  15. },
  16. "created_at": "2017-02-23T08:32:10.130912Z",
  17. "status": "APPLYING"
  18. }

Response 400

音乐人取消接单

DELETE /projects/<uuid>/order/

Response 204 取消接单成功

Response 400 You did not have applied before(该音乐人没有申请接单)

获取一个项目包申请接单的列表

GET /projects/<uuid>/applying/

Query params 默认的排序是weight从大到小

Response 200:

  1. [
  2. {
  3. "id": 1,
  4. "project": "7513f3f8-0b56-4c0d-955f-127a0be3f818",
  5. "quote": 0,
  6. "message": "",
  7. "is_candidate": true,
  8. "backend": null,
  9. "weight": 22,
  10. "mp_id": "1",
  11. "mp_uuid": "654649ad-4010-4a61-a544-d469487fbd37",
  12. "username": "",
  13. "avatar": "",
  14. "demo": null,
  15. "created_at": "2017-02-23T07:32:00.986719Z",
  16. "status": "APPLYING"
  17. }, {
  18. "id": 2,
  19. "project": "7513f3f8-0b56-4c0d-955f-127a0be3f818",
  20. "quote": 0,
  21. "message": "",
  22. "is_candidate": false,
  23. "backend": null,
  24. "weight": 11,
  25. "mp_id": "2",
  26. "mp_uuid": "4cc5f71d-706b-4b95-b787-eee03f302847",
  27. "username": "",
  28. "avatar": "",
  29. "demo": null,
  30. "created_at": "2017-02-23T07:32:00.987064Z",
  31. "status": "APPLYING"
  32. }
  33. ]

后台对项目包添加申请人

POST /admin/projects/<uuid>/applying/

Request data:

  1. {
  2. 'mp': mp.id,
  3. 'quote': 444,
  4. 'backend': {
  5. 'xx': 'ss'
  6. }
  7. }

其他支持的选项为

Response 200:

  1. {
  2. "id": 1,
  3. "project": "1e0d1ed9-495a-41a3-acb1-12fd6ab5171b",
  4. "quote": 444,
  5. "message": "",
  6. "is_candidate": false,
  7. "backend": {
  8. "xx": "ss"
  9. },
  10. "weight": 0,
  11. "mp_id": "1",
  12. "mp_uuid": "2e04e008-a402-49bc-8c6a-7dfe917b1881",
  13. "username": "",
  14. "avatar": "",
  15. "demo": {},
  16. "created_at": "2017-03-15T07:17:41.629533Z",
  17. "status": "APPLYING"
  18. }

后台对申请接单列表排序或修改

PUT /admin/projects/applying/

Request body:

  1. {
  2. 'applying': str(applying1.id),
  3. 'weight': 22,
  4. 'backend': {
  5. 'xx': 'xx'
  6. },
  7. 'status': const.PROJECT_APPLY_FAIL
  8. }

Response body

  1. {
  2. "id": 1,
  3. "project": "7016c2da-3f37-4288-b1fe-382807c85f65",
  4. "quote": 0,
  5. "message": "",
  6. "is_candidate": false,
  7. "backend": {
  8. "xx": "xx"
  9. },
  10. "weight": 22,
  11. "mp_id": "1",
  12. "mp_uuid": "e83532a0-a561-4a82-b3db-e10050a4a30a",
  13. "username": "",
  14. "avatar": "",
  15. "demo": {},
  16. "created_at": "2017-02-23T09:17:31.518870Z",
  17. "status": "FAIL"
  18. }

客户从接单列表里面选择候选人

PUT /projects/<uuid>/applying/

Request body:

  1. {
  2. 'applying': [1, 2]
  3. }

Response 204 (挑选成功)

从项目包接单的音乐人中选取一个作为项目包最后的接单人

POST /admin/packages/manager/

Request Body:

  1. {
  2. 'project_id': '2f21f671a9f24e3aa1866becf8311111',
  3. 'manager_id': '1'
  4. }

Response 204 接单成功

Response 400 这个项目包已经有人接了

  1. {
  2. "message": "Manager has been add",
  3. "code": "action_already_done"
  4. }

获取一个项目包下面所属检查点的所有works

GET /projects/<uuid>/cps/works/

Response 200

  1. [
  2. {
  3. "uuid": "c4d07336-53fc-441c-abaa-d8b74c4cd678",
  4. "producer": "f1462bad-7fdd-49ef-89bd-3f19e824e442",
  5. "length": 0,
  6. "essence_start": 0,
  7. "essence_end": 0,
  8. "name": "",
  9. "path": "",
  10. "desc": "",
  11. "avatar": "",
  12. "tags": [],
  13. "categories": [],
  14. "size": 0,
  15. "status": "ONLINE",
  16. "created_at": "2017-03-06 09:03",
  17. "type": "",
  18. "can_sell": false,
  19. "collect_count": 0,
  20. "username": "jason",
  21. "photo": ""
  22. }
  23. ]

客户从中检查点的works挑选几个作为项目包的works

POST /projects/<uuid>/cps/works/

Request body:

  1. {
  2. 'works': ["c4d07336-53fc-441c-abaa-d8b74c4cd678", ]
  3. }

Response 204 添加成功

Response 400 This project is not for you

Response 400 This work can not be add to project. ,该works不属于该项包下的检查点

16. 下载

下载歌曲

加不加水印自动做了处理,前端无需判断

GET /songs/<uuid>/download/

Response 302 重定向到歌曲资源处

Response 400 Have no permission for this song 没有权限


获取强推音乐列表

GET /works/star/
按照统一的音乐格式返回即可

获取强推音乐人列表

GET /mps/star/

Response body:

  1. {
  2. "results": [
  3. {
  4. "name": "Musician1",
  5. "another_musician_info": "a",
  6. "can_sell_list": [
  7. "work",
  8. "work"
  9. ]
  10. }
  11. ]
  12. }

需给出音乐人列表和该音乐人可售卖音乐列表

OPS 删除强推音乐

DELETE /works/star/

Request body:

  1. {
  2. "pk": <uuid>
  3. }

OPS 添加强推音乐

POST /works/star

Request body:

  1. {
  2. "pk": <uuid>
  3. }

OPS 删除强推音乐人

DELETE /mps/star/

Request body:

  1. {
  2. "pk": <uuid>
  3. }

OPS 添加强推音乐人

POST /mps/star/

Request body:

  1. {
  2. "pk": <uuid>
  3. }

获取待审核实名列表

获取待审核的实名列表

GET /real_name/

Response 200:

  1. {
  2. "results": [
  3. {
  4. "user": {
  5. "uuid": "3c3ddde2-e47f-4bb9-802b-8dc6e020a84b",
  6. "name": "大姨夫"
  7. },
  8. "name": "李四",
  9. "created_at": "2016-12-02T11:46:15.433164Z",
  10. "id_card": "1234**********1234",
  11. "id_card_facade": "/path",
  12. "id_card_obverse": "/path"
  13. }
  14. ],
  15. ...
  16. }

审核实名资料

PATCH /users/<uuid>/real_name/

之前的接口是一个SUCCESS的状态, 只允许通过,现在需要有拒绝的操作

Request body:

  1. {
  2. "status": " SUCCESS / FAIL"
  3. }

音乐人曲库

GET /songs/works/

售卖音乐增加审核状态筛选 status:

每个音乐增加售卖次数和最近售卖时间:

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注