@a335031
2017-07-01T09:04:45.000000Z
字数 18557
阅读 2527
V.Fine
进度
PATCH /admin/takeout/<uuid>/
{"status": "SUCCESS"}
GET /takeout/total/
{"requesting": 3,"waiting": 5,"total": 8}
GET /works/total/
{"waiting": 5}
GET /admin/certificates/
response:
{"results": [{"uuid": "6a038e1b-818c-47f5-aa43-bebe0c59c779","author": "Joy Ike","licensee": "测试用户","work_name": "Happy","work_path": "songs/Joy%20Ike-Happy.mp3","work": {"uuid": "0029eeaf-c48e-446b-9aa7-c2650191b4be","producer": {"uuid": "6936b33a-c540-45ac-a9e6-599eb7052ee2","name": "Joy Ike"},"name": "Happy","path": "songs/Joy%20Ike-Happy.mp3","pricing_mode": "UNITIVE"},"purchase_date": "2017-06-21T09:06:50.586467Z","purpose": "广告/宣传片","detail": "电视广告","price": "0.01","order": "8caf7f17-9dd1-4087-9ca7-9238f9305bd6"}],...}
当前版本为 v1
OPS所有接口需要管理员登录才能操作
统一错误说明:
{"message": "Not found:406e146c24fa473ab8685f4673da2611!","code": "object_not_found"}
{"message": "Missing required field in request body","code": "missing_body_field"}
{"message": "Invalid value xx, possible choices: xx","code": "invalid_value"}
404时返回的,无需处理response信息, 下面有些接口错误返回信息不完整,后续持续补充
管理员登陆接口和普通话用户登陆一致,可参考API文档
GET /admin/users/
Query Parmas:
Response 200:
{"count": 567,"next": "http://tapi.vfinemusic.com/v1/admin/users?page=2","previous": null,"results": [{"uuid": "41658763-8aee-4807-b816-921feee52be9","last_login": "2017-02-24T07:49:56.187000Z","name": "OliviaS粟丹","email": "","email_activated": false,"phone": "+8613790448339","type": "MUSICIAN","location": {"city": "","country": "中国香港"},"avatar": "default/FRkMilLKVoe3rfzxwtzD7UQY7GDAq2RydqeFSBEoHNpXelIw8O.png","login_redirect": "","created_at": "2016-12-07T10:38:09.534000Z","updated_at": "2017-02-24T07:50:24.671000Z","is_admin": false},...]}
如果是音乐人的话,则type='MUSICIAN'
以后返回列表时,如果没有作特别说明相应的参数都如下所示,后面不在说明
GET /admin/musicians/
Query Parmas:
<empty>NEWESTHOTTEST<empty>(不传或空字符串)NORMALSTARResponse 200:
{"count": 360,"next": "http://tapi.vfinemusic.com/v1/admin/musicians?page=2","previous": null,"results": [{"uuid": "953bf8f6-fd67-49dc-87f8-6edc33894fbf","name": "1212121","email": "","email_activated": false,"phone": "+8615184474640","location": {"city": "","country": "中国"},"avatar": "","created_at": "2017-05-09T09:10:54.284000Z","updated_at": "2017-05-09T09:13:13.898000Z","is_admin": false,"level": "NORMAL","works_likes": 0,"desc": "","is_visible": true,"categories": [],"careers": [],"is_musician": true}]}
GET /admin/users/<uuid>/
Response 200:
{"phone": "","uuid": "406e146c-24fa-473a-b868-5f4673da2611","login_redirect": "","name": "谭维维","country": "China","created_at": "2016-09-10T01:35:23.724Z","avatar": "/test/pics/musician_profile.png","email": "yanhangyhyd7@icloud.com","location": {}}
GET /admin/musicians/<uuid>/
POST /admin/users/
Request Body:
{"name": "xxxxxxxxxxxx","email": "xxx@icloud.com","phone": "+86123547657765","avatar": "/test/pics/xx","password": "123",}
上面3项暂定为必须的,下面的项为可选的
Response 200 :
{"uuid": "59bc2df4-ead0-485a-b6ae-d85c264f3ccd","last_login": null,"name": "xxxxxxxxxxxx","email": "xxx@icloud.com","email_activated": false,"phone": "123547657765","location": null,"avatar": "/test/pics/xx","created_at": "2016-11-17T09:33:47.559067Z","updated_at": "2016-11-17T09:33:47.559095Z","is_admin": false,}
POST /admin/musicians/
Request body
{"name": "xxxxxxxxxxxx","email": "xxx@xxx.com","phone": "+8618600132648","avatar": "/test/pics/xx","password": "123","desc": "kkkkkkkkk","categories": [2,],}
上述必传
其他用户信息和音乐人信息选填
Resopnse 200:
{"user": "cd147e67-a125-4b1f-a48c-641cc862b326","photo": "","level": "NORMAL","works_likes": 0,"created_at": "2017-03-14T08:36:51.281667Z","desc": "","is_visible": true,"categories": [{"id": 2,"name": "爵士"}]}
PUT /admin/users/<uuid>/
目前用户支持修改的字段如下:
Request Body:
{"name": "冯远征xxx","email": "xxx@icloud.com","email_activated": false,"phone": "+8612342345454","avatar": "/test/pics/xx","password": "123"}
Respose 200
{"uuid": "a62ebcf4-a812-49f1-a5c6-c1b0991d17f3","last_login": "2016-09-10T01:35:24.725839Z","name": "冯远征xxx","email": "xxx@icloud.com","email_activated": false,"phone": "+8612342345454","location": null,"avatar": "/test/pics/xx","created_at": "2016-09-10T01:35:23.724150Z","updated_at": "2016-09-10T01:35:23.724190Z","is_admin": false,}
Response 400 用户不存在:
{"message": "Not found:406e146c24fa473ab8685f4673da2611!","code": "object_not_found"}
PUT /admin/musicians/<uuid>/
Request Body:
{"categories": [2]}
其他支持的选项
Response 200
{"uuid": "36aff233-627c-4a8b-92dd-45f2d463102a","photo": "","level": "NORMAL","works_likes": 0,"created_at": "2017-03-14T09:27:02.912961Z","desc": "","is_visible": true,"categories": [{"id": 2,"name": "dj_sub","main_category": 1}]}
DELETE /admin/users/<uuid>/
Response 204: 删除成功
PUT /admin/users/<uuid>/to_musician/
Response 200
{"id": 1,"photo": "","type": "","level": "NORMAL","works_likes": 0,"created_at": "2017-03-02T05:52:20.453695Z","desc": "","is_visible": true,"user": "794364b2-248e-497c-a996-d487a27d5438"}
POST /admin/sms/
Request body:
{'phone': '+8618600132648','username': 'xx','password': base64.b64encode('123456')}
Response 204 发送成功
Response 400 : The user is not mp, 该用户还不是音乐人
获取申请用户列表
GET /admin/apply/?type=APPLY_FOR_MP
Query Params:
Response 200:
{"count": 2,"next": null,"previous": null,"results": [{"phone": "","data": {"work": 'work',"id_photo": 'photo','type': 'PRODUCER'},"uuid": "a62ebcf4-a812-49f1-a5c6-c1b0991d17f3","name": "冯远征","created_at": "2016-09-10T01:35:23.724150Z","is_done": false,"location": {},"type": "APPLY_FOR_MP","email": "yanhangyhy@icloud.com","avatar": "/test/pics/musician_profile.png","applying_id":1},......]}
PUT /admin/apply/<id>
Request Body:
{'id': 132}
Response 204:更新成功
DELETE /admin/apply/<id>
response 204 拒绝(删除该用户申请)
PUT /admin/stars/
Request Body:
{'uuid': 'a62ebcf4a81249f1a5c6c1b0991d17f3',"type": 'MUSICIAN'}
Response
204: +V成功
400: 用户需要先通过apply审核才能加V
{"message": "Please apply for MusicProducer first","code": "object_not_found"}
GET /admin/banners/?type=SLIDER&status=ONLINE
Query Params:
Response 200
{"count": 2,"next": null,"previous": null,"results": [{"id": 1,"name": "banne1","href": "x1.jpg","created_at": "2016-09-10T01:35:23.724150Z","status": "ONLINE","type": "SLIDER"},{"id": 2,"name": "banne2","href": "x2.jpg","created_at": "2016-09-10T01:35:23.724150Z","status": "ONLINE","type": "SLIDER"}]}
POST /admin/banners/
Request Body:
{'status': 'ONLINE','name': 'pic1','href': 'x1.jpg','type': 'SLIDER'}
这里需要注意的是如果添加banner超过后台限制的话会返回400:exceed banner num limit:
Response 200:
{'id': 2,"created_at": "2016-09-10T01:35:23.724150Z",'status': 'ONLINE','name': 'pic1','href': 'x1.jpg','type': 'SLIDER'}
Response 400:
{"message": "exceed banner num limit: xx","code": "exceed_num_limit"}
PUT /admin/banners/<id>
Request Body:
{'href': 'modify.href','name': 'shaaa'}
Response 200:
{'id': 2,"created_at": "2016-09-10T01:35:23.724150Z",'status': 'ONLINE','name': 'pic1','href': 'modify.pic','type': 'SLIDER'}
DELETE /admin/banners/<id>
Response 204: 删除成功
GET /admin/example/songs/
Query params
Response 200
[{"id": 1,"name": "_name_","href": "","cover_path": "","color": "RED","group": "CHINA","created_at": "2016-12-19T06:46:32.275000Z","status": "ONLINE"}]
POST /admin/example/songs/
Request Body:
{'status': 'ONLINE','name': 'song1','href': 'x1.x1','group': 'GROUP1','color': 'RED'}
上面几项是必须的
Response 200:
{"id":5,"name":"song1","href":"x1.x1","created_at":"2016-11-02T03:53:23.622626Z","status":"ONLINE"}
PUT /admin/example_songs/<id>
Request Body:
{'status': 'OFFLINE','href': 'modify.href','group': 'GROUP2'}
Response 200:
{"id":1,"name":"song1","href":"modify.href","cover_path":"","color":"RED","group":"GROUP2","created_at":"2016-11-02T03:24:30.318266Z","status":"OFFLINE"}
DELETE /admin/example_songs/<id>
Response 204 删除成功
GET projects/?category=TV&status=APPLYING
Query Params:
Response 200:
{"count": 2,"next": null,"previous": null,"results": [{"status": "APPLYING","category": "TV","project_name": "project_name","uuid": "2f21f671-a9f2-4e3a-a186-6becf83e60d2","end_date": "2016-09-12","level": "NORMAL","cover": "pics/26bDSBM5wD.png","created_at": "2016-09-10T01:35:23.724Z","works": [{"path": "/songs/Example.ogg","length": 6,"name": "Example.ogg"}],"short_desc": "short_desc","budget": 200,"producers": [{"name": "谭维维","uuid": "406e146c-24fa-473a-b868-5f4673da2611"},{"name": "Sungwoo Park","uuid": "a63dbcf4-a812-49f1-a5c6-c1b0991d17f3"}],"main_producer": {"name": "谭维维","uuid": "406e146c-24fa-473a-b868-5f4673da2611"},"owner":{"name": 'xx',"uuid": 'a63dbcf4-a812-49f1-a5c6-c1b0991d17f3',"phone": '18611112222'"email": '3423rfew@qq.com'},"desc": "desc","type": "WORKS","start_date": "2016-09-11","name": "name"},]}
上述消息中,不同状态的项目包,可能会没有 works, producers,main_producer,
PUT /admin/projects/
Request body:
{'uuid':'ea33b582f8ad486a8aa75d2a07c9606f','budget': '55555555','category': 'TV','content_category': 'FILM','cover': '/pics/26bDSBM5wD.png','desc': '5435353451dsf','director_name': '44444444444444','end_date': '2016-10-24','episode_count': '1','length': '133','name': '3333333333333','need_all_copyright': true,'need_sound_design': true,'project_name': '22222222222,'short_desc': '111111111','start_date': '2016-10-24','sub_category': 'COMEDY','status': 'FINISHED',"sound_design" : {"special_sound_effect": false,"post_remix": false,"actual_sound_handle": false,"background_noise": true},"scenes": [{"name": "THEME‐SONG","picked": "/path/to/picked‐song.mp3"},{"name": "THEME‐SONG-1","picked": "/path/to/picked‐1.mp3"}],}
其他参数请参照创建项目包时所给定的选项
上述内容除了UUID为必填之外,其他的可以选填,可以修改多个项目包
这里需要注意下,这里有几个功能复用此url:
如果要上线项目包的话,只需要提供uuid和status,将status改为ACCEPTED (审核项目包)
将项目包提升为精品项目包(前提需通过审核项目包),只需要提供uuid和type
如果要添加或者修改视频的话只需提供uuid和video字段
如果将项目包的状态从已开始变为待分配的话,则以前的该项目音乐人包含项目负责人都会清除
请求的数据只需携带uuid 和status字段
Response 200:
{"uuid": "55b62ec5-e04a-4d20-b7f7-4d58de885edc","cover": "default/mcKl3QqR4uiFxdyGjEzY0Ae3HaM920B1ZZCJRfIDNxJ0amT1Vk.png","category": "GAME","name": "123","project_name": "2233q","short_desc": "1123","desc": "asgfdhgdfsfasdgdfg","start_date": "2016-11-22","end_date": "2016-12-08","budget": 100,"currency": "RMB","level": "NORMAL","type": "WORKS","created_at": "2017-02-28T07:29:20.953147Z","status": "APPLYING","video": "xx.path"}
DELETE /admin/packages/<uuid>
Response 204 删除成功
POST /projects/
Request Body:
{'owner':'a62ebcf4a81249f1a5c6c1b0991d17f3','manager':'1','budget': '45','works':['dd3b44f8ef4641b9beb9dfdc3a9353db', ],'category': 'TV','content_category': 'FILM','cover': '/pics/26bDSBM5wD.png','desc': '5435353451dsf','director_name': 'ewqe','end_date': '2016-10-24','episode_count': '1','length': '133','name': 'wqeq','need_all_copyright': true,'need_sound_design': false,'project_name': 'ewqeq','scenes': [],'short_desc': 'wqeqwe','start_date': '2016-10-24','sub_category': 'COMEDY','status': 'FINISHED'}
其他参数请参照API文档创建项目包流程
Response 200:
{"category": "TV","status": "FINISHED","project_name": "ewqeq","uuid": "e7849946-21cc-4217-8d70-464896e5ca60","end_date": "2016-10-24","level": "NORMAL","cover": "/pics/26bDSBM5wD.png","created_at": "2016-11-25T02:26:07.022188Z","short_desc": "wqeqwe","budget": 45,"currency": "RMB","desc": "5435353451dsf","type": "WORKS","start_date": "2016-10-24","name": "wqeq"}
Response 400:添加的作品不是该manager的
{"message": "Invalid musicproducer works!","code": "unsupported"}
GET /admin/projects/<uuid>/
Response 200:
{"status": "FINISHED","category": "TV","project_name": "ewqeq","uuid": "4f1849d2-4234-402d-8219-3b162901f3eb","end_date": "2016-10-24","level": "NORMAL","cover": "/pics/26bDSBM5wD.png","created_at": "2016-11-25T08:23:19.662Z","works": [{"path": "/songs/le.ogg","length": 6,"name": "ple2222222.ogg"}],"short_desc": "wqeqwe","scene": [{"name": "THEME‐SONG","picked": 1},{"name": "THEME‐SONG-1","picked": 2}],"sound_design": {"actual_sound_handle": true,"post_remix": true,"special_sound_effect": true,"id": 1,"background_noise": true},"pack_content": {"sub_category": "COMEDY","length": 133,"episode_count": 1,"director_name": "ewqe","project": "4f1849d2-4234-402d-8219-3b162901f3eb","content_category": "FILM","need_sound_design": true,"sound_design": 1,"need_all_copyright": true,"id": 1},"main_producer": {"name": "谭维维","uuid": "406e146c-24fa-473a-b868-5f4673da2611"},"budget": 45,"desc": "5435353451dsf","type": "WORKS","start_date": "2016-10-24","name": "wqeq"}
上述有些字段不同的项目包可能没有
POST /admin/packages/works/
Request Body:
{'project_id': '2f21f671a9f24e3aa1866becf83e60d2','works_id': ['9b2386abf1404d8aab52ce12345c5806', '9b2386abf1234d8aab52ce94872c5806',]}
Response 204:添加成功
DELETE /admin/projects/<uuid>/works/
Request Body:
{'works': ['9b2386abf1404d8aab52ce12345c5806', '9b2386abf1234d8aab52ce94872c5806',]}
Response 204:删除成功
POST /admin/packages/producers/
Request Body:
{'project_id': '2f21f671a9f24e3aa1866becf83e60d2','producers_id': ['1', '2',]}
Response 204:添加成功
DELETE /admin/packages/producers/
Request Body:
{'project_id': '2f21f671a9f24e3aa1866becf83e60d2','producers_id': ['1', '2',]}
可以删除main_producer,只需将id放入上面producers_id列表即可
Response 204:删除成功
GET /songs/works/
默认查询参数为 ?type=PERSONAL&status=ONLINE
Query Params
Response 200:
{"count": 4,"next": null,"previous": null,"results": [{"uuid": "5ca135ab-3b76-4979-aa0a-c0f90674338e","producer": 1,"length": 0,"essence_start": 0,"essence_end": 0,"name": "","path": "333","desc": "4444","avatar": "","tags": [],"categories": [{"id": 3,"name": "流行1","main_category": 2}],"size": 0,"status": "ONLINE","username": "","photo": "","type": "",}]}
GET /songs/works/?category='流行'&search='年华'
Response 200
{"count": 1,"next": null,"previous": null,"results": [{"uuid": "ae91f363-2153-44ab-a830-a51a7484d75c","producer": 1,"length": 12,"essence_start": 0,"essence_end": 0,"name": "虚度年华","path": "333","desc": "4444","avatar": "","tags": [],"categories": [{"id": 3,"name": "pop","main_category": 2}],"size": 0,"status": "ONLINE","created_at": "2017-01-16 02:01","type": "","username": "","photo": ""}]}
POST /admin/works/
Request Body:
{'producer': 1,'length': 20,'essence_start': 2,'name': 'de2.ogg','path': '/songs/ed2.ogg','desc': 'xxx2','avatar': '','categories': [2],'tags': [1, ],'status':'ONLINE','size':88,'type':'PROJECT','can_sell': True}
Response 200:
{"uuid": "68840c3e-69b6-4579-8ef6-f2ed45f54d86","producer": 1,"length": 20,"essence_start": 2,"essence_end": 0,"name": "de2.ogg","path": "/songs/ed2.ogg","desc": "xxx2","avatar": "","tags": [{"id": 1,"name": "work"}],"categories": [{"id": 2,"name": "dj1","main_category": 1}],"size": 88,"status": "ONLINE","created_at": "2017-01-11 03:01","type": "PROJECT","can_sell": true}
PUT /admin/works/<uuid>
Requset Body:
{'length': 17,'avatar': 'xxxx.path','categories': [1, ],'status': 'OFFLINE'}
支持修改的字段:
上下线操作, 打标签,设置风格等可以复用此接口,只传相应的字段即可
Response 200
{"uuid": "7142ee93-bd8e-46ec-a302-2525da6dd068","producer": 1,"length": 17,"essence_start": 0,"essence_end": 0,"name": "","path": "xx","desc": "xx","avatar": "xxxx.path","tags": [],"categories": [{"id": 1,"name": "dj","main_category": null}],"size": 0,"status": "OFFLINE"}
DELETE /admin/works/<uuid>/
Response 204:删除成功
POST /categories/
Request Body:
{"name": "jazz","real": true,"parent": 1}
Response 200:
{"id": 3,"name": "jazz","real": true,"parent": 1}
DELETE /categories/<id>/
Response 204 删除成功
PUT /categories/<id>/
Request Body:
{"name": "jazz","real": true,"parent": 1}
Response 200:
{"id": 3,"name": "jazz","real": true,"parent": 1}
GET /categories/
params:
Response 200:
{"results": [{"id": 1,"name": "主风格","parent": null,"real": false,"children": [{"id": 3,"name": "jazz","real": true,"parent": 1,"children": []},...]},...]}
PATCH /works/<uuid>/
Request Body:
{'categories': [<c1>, <c2>]}
<c1>: <id> or {'id': <id>}Response 200 设定成功
GET /works/<uuid>/
Response 200:
{"name": "_name_","categories": [{"id": 3,"name": "jazz","parent": 1,"real": true},...],...}
GET /suggestions/
Response 200
{"count": 1,"next": null,"previous": null,"results": [{"id": 1,"username": "xxx","text": "xzczz","date": "2016-12-01"}]}
DELETE /suggestions/<id>/
Response 204 删除成功
GET /admin/purchases/
Query params:
Response body:
{"results": [{"status": "APPLY","remark": "","date": "2017-01-19","id": 1,"purchaser": {"email": "","avatar": "","uuid": "ac20265d-91b7-4375-a689-b5d0f4e6fa2c","phone": "","name": ""},"work": {"name": "","path": "xx","uuid": "21e94ee8-9af8-4772-a0eb-be1d9812562f","producer": {"name": "","uuid": <uuid>,"phone": "","avatar": "","email": ""},}},....],...}
GET /admin/purchases/<id>/
PATCH /admin/purchases/<id>/
Request body:
{"status": "FAIL"}