[关闭]
@a335031 2017-07-01T17:04:45.000000Z 字数 18557 阅读 2038

OPS详细文档

V.Fine


进度

转账完成

PATCH /admin/takeout/<uuid>/

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

提现计数

GET /takeout/total/

  1. {
  2. "requesting": 3,
  3. "waiting": 5,
  4. "total": 8
  5. }

音乐计数

GET /works/total/

  1. {
  2. "waiting": 5
  3. }

获取单曲售卖记录

GET /admin/certificates/

response:

  1. {
  2. "results": [
  3. {
  4. "uuid": "6a038e1b-818c-47f5-aa43-bebe0c59c779",
  5. "author": "Joy Ike",
  6. "licensee": "测试用户",
  7. "work_name": "Happy",
  8. "work_path": "songs/Joy%20Ike-Happy.mp3",
  9. "work": {
  10. "uuid": "0029eeaf-c48e-446b-9aa7-c2650191b4be",
  11. "producer": {
  12. "uuid": "6936b33a-c540-45ac-a9e6-599eb7052ee2",
  13. "name": "Joy Ike"
  14. },
  15. "name": "Happy",
  16. "path": "songs/Joy%20Ike-Happy.mp3",
  17. "pricing_mode": "UNITIVE"
  18. },
  19. "purchase_date": "2017-06-21T09:06:50.586467Z",
  20. "purpose": "广告/宣传片",
  21. "detail": "电视广告",
  22. "price": "0.01",
  23. "order": "8caf7f17-9dd1-4087-9ca7-9238f9305bd6"
  24. }
  25. ],
  26. ...
  27. }

说明

  1. 当前版本为 v1

  2. OPS所有接口需要管理员登录才能操作

  3. 统一错误说明:

    • 请求操作的对象不存在 400
    1. {
    2. "message": "Not found:406e146c24fa473ab8685f4673da2611!",
    3. "code": "object_not_found"
    4. }
    • 缺少必要的参数(非get请求)
    1. {
    2. "message": "Missing required field in request body",
    3. "code": "missing_body_field"
    4. }
    • 请求的参数不匹配
    1. {
    2. "message": "Invalid value xx, possible choices: xx",
    3. "code": "invalid_value"
    4. }

    404时返回的,无需处理response信息, 下面有些接口错误返回信息不完整,后续持续补充

1. 登陆登出

管理员登陆接口和普通话用户登陆一致,可参考API文档

2. 会员管理

获取用户列表

GET /admin/users/

Query Parmas:

Response 200:

  1. {
  2. "count": 567,
  3. "next": "http://tapi.vfinemusic.com/v1/admin/users?page=2",
  4. "previous": null,
  5. "results": [
  6. {
  7. "uuid": "41658763-8aee-4807-b816-921feee52be9",
  8. "last_login": "2017-02-24T07:49:56.187000Z",
  9. "name": "OliviaS粟丹",
  10. "email": "",
  11. "email_activated": false,
  12. "phone": "+8613790448339",
  13. "type": "MUSICIAN",
  14. "location": {
  15. "city": "",
  16. "country": "中国香港"
  17. },
  18. "avatar": "default/FRkMilLKVoe3rfzxwtzD7UQY7GDAq2RydqeFSBEoHNpXelIw8O.png",
  19. "login_redirect": "",
  20. "created_at": "2016-12-07T10:38:09.534000Z",
  21. "updated_at": "2017-02-24T07:50:24.671000Z",
  22. "is_admin": false
  23. },
  24. ...
  25. ]
  26. }

如果是音乐人的话,则type='MUSICIAN'

以后返回列表时,如果没有作特别说明相应的参数都如下所示,后面不在说明

获取音乐人列表

GET /admin/musicians/

Query Parmas:

Response 200:

  1. {
  2. "count": 360,
  3. "next": "http://tapi.vfinemusic.com/v1/admin/musicians?page=2",
  4. "previous": null,
  5. "results": [
  6. {
  7. "uuid": "953bf8f6-fd67-49dc-87f8-6edc33894fbf",
  8. "name": "1212121",
  9. "email": "",
  10. "email_activated": false,
  11. "phone": "+8615184474640",
  12. "location": {
  13. "city": "",
  14. "country": "中国"
  15. },
  16. "avatar": "",
  17. "created_at": "2017-05-09T09:10:54.284000Z",
  18. "updated_at": "2017-05-09T09:13:13.898000Z",
  19. "is_admin": false,
  20. "level": "NORMAL",
  21. "works_likes": 0,
  22. "desc": "",
  23. "is_visible": true,
  24. "categories": [],
  25. "careers": [],
  26. "is_musician": true
  27. }
  28. ]
  29. }

获取用户详情

GET /admin/users/<uuid>/

Response 200:

  1. {
  2. "phone": "",
  3. "uuid": "406e146c-24fa-473a-b868-5f4673da2611",
  4. "login_redirect": "",
  5. "name": "谭维维",
  6. "country": "China",
  7. "created_at": "2016-09-10T01:35:23.724Z",
  8. "avatar": "/test/pics/musician_profile.png",
  9. "email": "yanhangyhyd7@icloud.com",
  10. "location": {}
  11. }

获取音乐人详情

GET /admin/musicians/<uuid>/

添加用户

POST /admin/users/

Request Body:

  1. {
  2. "name": "xxxxxxxxxxxx",
  3. "email": "xxx@icloud.com",
  4. "phone": "+86123547657765",
  5. "avatar": "/test/pics/xx",
  6. "password": "123",
  7. }

上面3项暂定为必须的,下面的项为可选的

Response 200 :

  1. {
  2. "uuid": "59bc2df4-ead0-485a-b6ae-d85c264f3ccd",
  3. "last_login": null,
  4. "name": "xxxxxxxxxxxx",
  5. "email": "xxx@icloud.com",
  6. "email_activated": false,
  7. "phone": "123547657765",
  8. "location": null,
  9. "avatar": "/test/pics/xx",
  10. "created_at": "2016-11-17T09:33:47.559067Z",
  11. "updated_at": "2016-11-17T09:33:47.559095Z",
  12. "is_admin": false,
  13. }

添加音乐人

POST /admin/musicians/

Request body

  1. {
  2. "name": "xxxxxxxxxxxx",
  3. "email": "xxx@xxx.com",
  4. "phone": "+8618600132648",
  5. "avatar": "/test/pics/xx",
  6. "password": "123",
  7. "desc": "kkkkkkkkk",
  8. "categories": [2,],
  9. }

上述必传

其他用户信息和音乐人信息选填

Resopnse 200:

  1. {
  2. "user": "cd147e67-a125-4b1f-a48c-641cc862b326",
  3. "photo": "",
  4. "level": "NORMAL",
  5. "works_likes": 0,
  6. "created_at": "2017-03-14T08:36:51.281667Z",
  7. "desc": "",
  8. "is_visible": true,
  9. "categories": [
  10. {
  11. "id": 2,
  12. "name": "爵士"
  13. }
  14. ]
  15. }

修改用户

PUT /admin/users/<uuid>/

目前用户支持修改的字段如下:

Request Body:

  1. {
  2. "name": "冯远征xxx",
  3. "email": "xxx@icloud.com",
  4. "email_activated": false,
  5. "phone": "+8612342345454",
  6. "avatar": "/test/pics/xx",
  7. "password": "123"
  8. }

Respose 200

  1. {
  2. "uuid": "a62ebcf4-a812-49f1-a5c6-c1b0991d17f3",
  3. "last_login": "2016-09-10T01:35:24.725839Z",
  4. "name": "冯远征xxx",
  5. "email": "xxx@icloud.com",
  6. "email_activated": false,
  7. "phone": "+8612342345454",
  8. "location": null,
  9. "avatar": "/test/pics/xx",
  10. "created_at": "2016-09-10T01:35:23.724150Z",
  11. "updated_at": "2016-09-10T01:35:23.724190Z",
  12. "is_admin": false,
  13. }

Response 400 用户不存在:

  1. {
  2. "message": "Not found:406e146c24fa473ab8685f4673da2611!",
  3. "code": "object_not_found"
  4. }

修改音乐人

PUT /admin/musicians/<uuid>/

Request Body:

  1. {
  2. "categories": [2]
  3. }

其他支持的选项

Response 200

  1. {
  2. "uuid": "36aff233-627c-4a8b-92dd-45f2d463102a",
  3. "photo": "",
  4. "level": "NORMAL",
  5. "works_likes": 0,
  6. "created_at": "2017-03-14T09:27:02.912961Z",
  7. "desc": "",
  8. "is_visible": true,
  9. "categories": [
  10. {
  11. "id": 2,
  12. "name": "dj_sub",
  13. "main_category": 1
  14. }
  15. ]
  16. }

删除用户或音乐人

DELETE /admin/users/<uuid>/

Response 204: 删除成功

将用户变成音乐人

PUT /admin/users/<uuid>/to_musician/

Response 200

  1. {
  2. "id": 1,
  3. "photo": "",
  4. "type": "",
  5. "level": "NORMAL",
  6. "works_likes": 0,
  7. "created_at": "2017-03-02T05:52:20.453695Z",
  8. "desc": "",
  9. "is_visible": true,
  10. "user": "794364b2-248e-497c-a996-d487a27d5438"
  11. }

给音乐人发送账户信息短信

POST /admin/sms/

Request body:

  1. {
  2. 'phone': '+8618600132648',
  3. 'username': 'xx',
  4. 'password': base64.b64encode('123456')
  5. }

Response 204 发送成功

Response 400 : The user is not mp, 该用户还不是音乐人

3. 用户权限相关

用户申请

获取申请用户列表
GET /admin/apply/?type=APPLY_FOR_MP

Query Params:

Response 200:

  1. {
  2. "count": 2,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "phone": "",
  8. "data": {
  9. "work": 'work',
  10. "id_photo": 'photo',
  11. 'type': 'PRODUCER'
  12. },
  13. "uuid": "a62ebcf4-a812-49f1-a5c6-c1b0991d17f3",
  14. "name": "冯远征",
  15. "created_at": "2016-09-10T01:35:23.724150Z",
  16. "is_done": false,
  17. "location": {},
  18. "type": "APPLY_FOR_MP",
  19. "email": "yanhangyhy@icloud.com",
  20. "avatar": "/test/pics/musician_profile.png"
  21. "applying_id":1
  22. },
  23. ......
  24. ]
  25. }

批准用户申请

PUT /admin/apply/<id>

Request Body:

  1. {
  2. 'id': 132
  3. }

Response 204:更新成功

拒绝用户申请

DELETE /admin/apply/<id>

response 204 拒绝(删除该用户申请)

申请成为星级用户(+V)

PUT /admin/stars/

Request Body:

  1. {
  2. 'uuid': 'a62ebcf4a81249f1a5c6c1b0991d17f3',
  3. "type": 'MUSICIAN'
  4. }

Response

4. Banner

获取banner列表

GET /admin/banners/?type=SLIDER&status=ONLINE

Query Params:

Response 200

  1. {
  2. "count": 2,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "id": 1,
  8. "name": "banne1",
  9. "href": "x1.jpg",
  10. "created_at": "2016-09-10T01:35:23.724150Z",
  11. "status": "ONLINE",
  12. "type": "SLIDER"
  13. },
  14. {
  15. "id": 2,
  16. "name": "banne2",
  17. "href": "x2.jpg",
  18. "created_at": "2016-09-10T01:35:23.724150Z",
  19. "status": "ONLINE",
  20. "type": "SLIDER"
  21. }
  22. ]
  23. }

添加banner列表

POST /admin/banners/

Request Body:

  1. {
  2. 'status': 'ONLINE',
  3. 'name': 'pic1',
  4. 'href': 'x1.jpg',
  5. 'type': 'SLIDER'
  6. }

这里需要注意的是如果添加banner超过后台限制的话会返回400:exceed banner num limit:

Response 200:

  1. {
  2. 'id': 2,
  3. "created_at": "2016-09-10T01:35:23.724150Z",
  4. 'status': 'ONLINE',
  5. 'name': 'pic1',
  6. 'href': 'x1.jpg',
  7. 'type': 'SLIDER'
  8. }

Response 400:

  1. {
  2. "message": "exceed banner num limit: xx",
  3. "code": "exceed_num_limit"
  4. }

修改banner列表

PUT /admin/banners/<id>

Request Body:

  1. {
  2. 'href': 'modify.href',
  3. 'name': 'shaaa'
  4. }

Response 200:

  1. {
  2. 'id': 2,
  3. "created_at": "2016-09-10T01:35:23.724150Z",
  4. 'status': 'ONLINE',
  5. 'name': 'pic1',
  6. 'href': 'modify.pic',
  7. 'type': 'SLIDER'
  8. }

删除banner

DELETE /admin/banners/<id>

Response 204: 删除成功

5. 示例歌曲

获取示例歌曲列表

GET /admin/example/songs/

Query params

Response 200

  1. [{
  2. "id": 1,
  3. "name": "_name_",
  4. "href": "",
  5. "cover_path": "",
  6. "color": "RED",
  7. "group": "CHINA",
  8. "created_at": "2016-12-19T06:46:32.275000Z",
  9. "status": "ONLINE"
  10. }]

添加示例歌曲

POST /admin/example/songs/

Request Body:

  1. {
  2. 'status': 'ONLINE',
  3. 'name': 'song1',
  4. 'href': 'x1.x1',
  5. 'group': 'GROUP1',
  6. 'color': 'RED'
  7. }

上面几项是必须的

Response 200:

  1. {
  2. "id":5,
  3. "name":"song1",
  4. "href":"x1.x1",
  5. "created_at":"2016-11-02T03:53:23.622626Z",
  6. "status":"ONLINE"
  7. }

修改示例歌曲

PUT /admin/example_songs/<id>

Request Body:

  1. {
  2. 'status': 'OFFLINE',
  3. 'href': 'modify.href',
  4. 'group': 'GROUP2'
  5. }

Response 200:

  1. {
  2. "id":1,
  3. "name":"song1",
  4. "href":"modify.href",
  5. "cover_path":"",
  6. "color":"RED",
  7. "group":"GROUP2",
  8. "created_at":"2016-11-02T03:24:30.318266Z",
  9. "status":"OFFLINE"
  10. }

删除示例歌曲

DELETE /admin/example_songs/<id>

Response 204 删除成功

6. 项目包部分

获取项目包

GET projects/?category=TV&status=APPLYING

Query Params:

Response 200:

  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. "works": [
  16. {
  17. "path": "/songs/Example.ogg",
  18. "length": 6,
  19. "name": "Example.ogg"
  20. }
  21. ],
  22. "short_desc": "short_desc",
  23. "budget": 200,
  24. "producers": [
  25. {
  26. "name": "谭维维",
  27. "uuid": "406e146c-24fa-473a-b868-5f4673da2611"
  28. },
  29. {
  30. "name": "Sungwoo Park",
  31. "uuid": "a63dbcf4-a812-49f1-a5c6-c1b0991d17f3"
  32. }
  33. ],
  34. "main_producer": {
  35. "name": "谭维维",
  36. "uuid": "406e146c-24fa-473a-b868-5f4673da2611"
  37. },
  38. "owner":{
  39. "name": 'xx',
  40. "uuid": 'a63dbcf4-a812-49f1-a5c6-c1b0991d17f3',
  41. "phone": '18611112222'
  42. "email": '3423rfew@qq.com'
  43. },
  44. "desc": "desc",
  45. "type": "WORKS",
  46. "start_date": "2016-09-11",
  47. "name": "name"
  48. },
  49. ]
  50. }

上述消息中,不同状态的项目包,可能会没有 works, producers,main_producer,

修改项目包

PUT /admin/projects/

Request body:

  1. {
  2. 'uuid':'ea33b582f8ad486a8aa75d2a07c9606f',
  3. 'budget': '55555555',
  4. 'category': 'TV',
  5. 'content_category': 'FILM',
  6. 'cover': '/pics/26bDSBM5wD.png',
  7. 'desc': '5435353451dsf',
  8. 'director_name': '44444444444444',
  9. 'end_date': '2016-10-24',
  10. 'episode_count': '1',
  11. 'length': '133',
  12. 'name': '3333333333333',
  13. 'need_all_copyright': true,
  14. 'need_sound_design': true,
  15. 'project_name': '22222222222,
  16. 'short_desc': '111111111',
  17. 'start_date': '2016-10-24',
  18. 'sub_category': 'COMEDY',
  19. 'status': 'FINISHED',
  20. "sound_design" : {
  21. "special_sound_effect": false,
  22. "post_remix": false,
  23. "actual_sound_handle": false,
  24. "background_noise": true
  25. },
  26. "scenes": [
  27. {
  28. "name": "THEME‐SONG",
  29. "picked": "/path/to/picked‐song.mp3"
  30. },
  31. {
  32. "name": "THEME‐SONG-1",
  33. "picked": "/path/to/picked‐1.mp3"
  34. }
  35. ],
  36. }

其他参数请参照创建项目包时所给定的选项

上述内容除了UUID为必填之外,其他的可以选填,可以修改多个项目包

这里需要注意下,这里有几个功能复用此url:

Response 200:

  1. {
  2. "uuid": "55b62ec5-e04a-4d20-b7f7-4d58de885edc",
  3. "cover": "default/mcKl3QqR4uiFxdyGjEzY0Ae3HaM920B1ZZCJRfIDNxJ0amT1Vk.png",
  4. "category": "GAME",
  5. "name": "123",
  6. "project_name": "2233q",
  7. "short_desc": "1123",
  8. "desc": "asgfdhgdfsfasdgdfg",
  9. "start_date": "2016-11-22",
  10. "end_date": "2016-12-08",
  11. "budget": 100,
  12. "currency": "RMB",
  13. "level": "NORMAL",
  14. "type": "WORKS",
  15. "created_at": "2017-02-28T07:29:20.953147Z",
  16. "status": "APPLYING",
  17. "video": "xx.path"
  18. }

删除项目包(只删除被拒绝的项目包)

DELETE /admin/packages/<uuid>

Response 204 删除成功

创建项目包

POST /projects/

Request Body:

  1. {
  2. 'owner':'a62ebcf4a81249f1a5c6c1b0991d17f3',
  3. 'manager':'1',
  4. 'budget': '45',
  5. 'works':['dd3b44f8ef4641b9beb9dfdc3a9353db', ],
  6. 'category': 'TV',
  7. 'content_category': 'FILM',
  8. 'cover': '/pics/26bDSBM5wD.png',
  9. 'desc': '5435353451dsf',
  10. 'director_name': 'ewqe',
  11. 'end_date': '2016-10-24',
  12. 'episode_count': '1',
  13. 'length': '133',
  14. 'name': 'wqeq',
  15. 'need_all_copyright': true,
  16. 'need_sound_design': false,
  17. 'project_name': 'ewqeq',
  18. 'scenes': [],
  19. 'short_desc': 'wqeqwe',
  20. 'start_date': '2016-10-24',
  21. 'sub_category': 'COMEDY',
  22. 'status': 'FINISHED'
  23. }

其他参数请参照API文档创建项目包流程

Response 200:

  1. {
  2. "category": "TV",
  3. "status": "FINISHED",
  4. "project_name": "ewqeq",
  5. "uuid": "e7849946-21cc-4217-8d70-464896e5ca60",
  6. "end_date": "2016-10-24",
  7. "level": "NORMAL",
  8. "cover": "/pics/26bDSBM5wD.png",
  9. "created_at": "2016-11-25T02:26:07.022188Z",
  10. "short_desc": "wqeqwe",
  11. "budget": 45,
  12. "currency": "RMB",
  13. "desc": "5435353451dsf",
  14. "type": "WORKS",
  15. "start_date": "2016-10-24",
  16. "name": "wqeq"
  17. }

Response 400:添加的作品不是该manager的

  1. {
  2. "message": "Invalid musicproducer works!",
  3. "code": "unsupported"
  4. }

获取单个项目包详情

GET /admin/projects/<uuid>/

Response 200:

  1. {
  2. "status": "FINISHED",
  3. "category": "TV",
  4. "project_name": "ewqeq",
  5. "uuid": "4f1849d2-4234-402d-8219-3b162901f3eb",
  6. "end_date": "2016-10-24",
  7. "level": "NORMAL",
  8. "cover": "/pics/26bDSBM5wD.png",
  9. "created_at": "2016-11-25T08:23:19.662Z",
  10. "works": [
  11. {
  12. "path": "/songs/le.ogg",
  13. "length": 6,
  14. "name": "ple2222222.ogg"
  15. }
  16. ],
  17. "short_desc": "wqeqwe",
  18. "scene": [
  19. {
  20. "name": "THEME‐SONG",
  21. "picked": 1
  22. },
  23. {
  24. "name": "THEME‐SONG-1",
  25. "picked": 2
  26. }
  27. ],
  28. "sound_design": {
  29. "actual_sound_handle": true,
  30. "post_remix": true,
  31. "special_sound_effect": true,
  32. "id": 1,
  33. "background_noise": true
  34. },
  35. "pack_content": {
  36. "sub_category": "COMEDY",
  37. "length": 133,
  38. "episode_count": 1,
  39. "director_name": "ewqe",
  40. "project": "4f1849d2-4234-402d-8219-3b162901f3eb",
  41. "content_category": "FILM",
  42. "need_sound_design": true,
  43. "sound_design": 1,
  44. "need_all_copyright": true,
  45. "id": 1
  46. },
  47. "main_producer": {
  48. "name": "谭维维",
  49. "uuid": "406e146c-24fa-473a-b868-5f4673da2611"
  50. },
  51. "budget": 45,
  52. "desc": "5435353451dsf",
  53. "type": "WORKS",
  54. "start_date": "2016-10-24",
  55. "name": "wqeq"
  56. }

上述有些字段不同的项目包可能没有

添加works到Package

POST /admin/packages/works/

Request Body:

  1. {
  2. 'project_id': '2f21f671a9f24e3aa1866becf83e60d2',
  3. 'works_id': ['9b2386abf1404d8aab52ce12345c5806', '9b2386abf1234d8aab52ce94872c5806',]
  4. }

Response 204:添加成功

从Package中删除works

DELETE /admin/projects/<uuid>/works/

Request Body:

  1. {
  2. 'works': ['9b2386abf1404d8aab52ce12345c5806', '9b2386abf1234d8aab52ce94872c5806',]
  3. }

Response 204:删除成功

添加音乐人到Package

POST /admin/packages/producers/

Request Body:

  1. {
  2. 'project_id': '2f21f671a9f24e3aa1866becf83e60d2',
  3. 'producers_id': ['1', '2',]
  4. }

Response 204:添加成功

从Package中删除音乐人

DELETE /admin/packages/producers/

Request Body:

  1. {
  2. 'project_id': '2f21f671a9f24e3aa1866becf83e60d2',
  3. 'producers_id': ['1', '2',]
  4. }

可以删除main_producer,只需将id放入上面producers_id列表即可

Response 204:删除成功

7. 音乐人作品

获取作品曲库

GET /songs/works/

默认查询参数为 ?type=PERSONAL&status=ONLINE

Query Params

Response 200:

  1. {
  2. "count": 4,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "uuid": "5ca135ab-3b76-4979-aa0a-c0f90674338e",
  8. "producer": 1,
  9. "length": 0,
  10. "essence_start": 0,
  11. "essence_end": 0,
  12. "name": "",
  13. "path": "333",
  14. "desc": "4444",
  15. "avatar": "",
  16. "tags": [],
  17. "categories": [
  18. {
  19. "id": 3,
  20. "name": "流行1",
  21. "main_category": 2
  22. }
  23. ],
  24. "size": 0,
  25. "status": "ONLINE",
  26. "username": "",
  27. "photo": "",
  28. "type": "",
  29. }
  30. ]
  31. }

GET /songs/works/?category='流行'&search='年华'

Response 200

  1. {
  2. "count": 1,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "uuid": "ae91f363-2153-44ab-a830-a51a7484d75c",
  8. "producer": 1,
  9. "length": 12,
  10. "essence_start": 0,
  11. "essence_end": 0,
  12. "name": "虚度年华",
  13. "path": "333",
  14. "desc": "4444",
  15. "avatar": "",
  16. "tags": [],
  17. "categories": [
  18. {
  19. "id": 3,
  20. "name": "pop",
  21. "main_category": 2
  22. }
  23. ],
  24. "size": 0,
  25. "status": "ONLINE",
  26. "created_at": "2017-01-16 02:01",
  27. "type": "",
  28. "username": "",
  29. "photo": ""
  30. }
  31. ]
  32. }

音乐人添加曲目

POST /admin/works/

Request Body:

  1. {
  2. 'producer': 1,
  3. 'length': 20,
  4. 'essence_start': 2,
  5. 'name': 'de2.ogg',
  6. 'path': '/songs/ed2.ogg',
  7. 'desc': 'xxx2',
  8. 'avatar': '',
  9. 'categories': [2],
  10. 'tags': [1, ],
  11. 'status':'ONLINE',
  12. 'size':88,
  13. 'type':'PROJECT',
  14. 'can_sell': True
  15. }

Response 200:

  1. {
  2. "uuid": "68840c3e-69b6-4579-8ef6-f2ed45f54d86",
  3. "producer": 1,
  4. "length": 20,
  5. "essence_start": 2,
  6. "essence_end": 0,
  7. "name": "de2.ogg",
  8. "path": "/songs/ed2.ogg",
  9. "desc": "xxx2",
  10. "avatar": "",
  11. "tags": [
  12. {
  13. "id": 1,
  14. "name": "work"
  15. }
  16. ],
  17. "categories": [
  18. {
  19. "id": 2,
  20. "name": "dj1",
  21. "main_category": 1
  22. }
  23. ],
  24. "size": 88,
  25. "status": "ONLINE",
  26. "created_at": "2017-01-11 03:01",
  27. "type": "PROJECT",
  28. "can_sell": true
  29. }

修改曲目

PUT /admin/works/<uuid>

Requset Body:

  1. {
  2. 'length': 17,
  3. 'avatar': 'xxxx.path',
  4. 'categories': [1, ],
  5. 'status': 'OFFLINE'
  6. }

支持修改的字段:

上下线操作, 打标签,设置风格等可以复用此接口,只传相应的字段即可

Response 200

  1. {
  2. "uuid": "7142ee93-bd8e-46ec-a302-2525da6dd068",
  3. "producer": 1,
  4. "length": 17,
  5. "essence_start": 0,
  6. "essence_end": 0,
  7. "name": "",
  8. "path": "xx",
  9. "desc": "xx",
  10. "avatar": "xxxx.path",
  11. "tags": [],
  12. "categories": [
  13. {
  14. "id": 1,
  15. "name": "dj",
  16. "main_category": null
  17. }
  18. ],
  19. "size": 0,
  20. "status": "OFFLINE"
  21. }

删除曲目

DELETE /admin/works/<uuid>/

Response 204:删除成功

风格标签管理

添加标签

POST /categories/

Request Body:

  1. {
  2. "name": "jazz",
  3. "real": true,
  4. "parent": 1
  5. }

Response 200:

  1. {
  2. "id": 3,
  3. "name": "jazz",
  4. "real": true,
  5. "parent": 1
  6. }

删除标签

DELETE /categories/<id>/

Response 204 删除成功

更新标签

PUT /categories/<id>/

Request Body:

  1. {
  2. "name": "jazz",
  3. "real": true,
  4. "parent": 1
  5. }

Response 200:

  1. {
  2. "id": 3,
  3. "name": "jazz",
  4. "real": true,
  5. "parent": 1
  6. }

获取标签列表

GET /categories/

params:

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": "jazz",
  12. "real": true,
  13. "parent": 1,
  14. "children": []
  15. },
  16. ...
  17. ]
  18. },
  19. ...
  20. ]
  21. }

给音乐设定风格标签

PATCH /works/<uuid>/

Request Body:

  1. {
  2. 'categories': [<c1>, <c2>]
  3. }

Response 200 设定成功

获取音乐风格标签

GET /works/<uuid>/

Response 200:

  1. {
  2. "name": "_name_",
  3. "categories": [
  4. {
  5. "id": 3,
  6. "name": "jazz",
  7. "parent": 1,
  8. "real": true
  9. },
  10. ...
  11. ],
  12. ...
  13. }

10. 留言

获取客户建议

GET /suggestions/

Response 200

  1. {
  2. "count": 1,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "id": 1,
  8. "username": "xxx",
  9. "text": "xzczz",
  10. "date": "2016-12-01"
  11. }
  12. ]
  13. }

删除客户留言

DELETE /suggestions/<id>/

Response 204 删除成功

购买申请

获取购买申请列表

GET /admin/purchases/

Query params:

Response body:

  1. {
  2. "results": [
  3. {
  4. "status": "APPLY",
  5. "remark": "",
  6. "date": "2017-01-19",
  7. "id": 1,
  8. "purchaser": {
  9. "email": "",
  10. "avatar": "",
  11. "uuid": "ac20265d-91b7-4375-a689-b5d0f4e6fa2c",
  12. "phone": "",
  13. "name": ""
  14. },
  15. "work": {
  16. "name": "",
  17. "path": "xx",
  18. "uuid": "21e94ee8-9af8-4772-a0eb-be1d9812562f",
  19. "producer": {
  20. "name": "",
  21. "uuid": <uuid>,
  22. "phone": "",
  23. "avatar": "",
  24. "email": ""
  25. },
  26. }
  27. },
  28. ....
  29. ],
  30. ...
  31. }

删除指定购买申请

GET /admin/purchases/<id>/

审核指定购买申请

PATCH /admin/purchases/<id>/

Request body:

  1. {
  2. "status": "FAIL"
  3. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注