@a335031
2017-10-27T16:08:17.000000Z
字数 33581
阅读 2267
V.Fine
作品增加两个状态
- UNSUBMIT
# 待提交
- DELETE
# 伪删除
音乐人撤回作品:
PATCH /works/<uuid>/
Request body:
{
"status": "UNSUBMIT"
}
音乐人上下架作品:
PATCH /works/<uuid>/
Request body:
{
"status": "ONLINE", # or OFFLINE
}
音乐人删除作品:
DELETE /works/<uuid>/
OPS普通拒绝:
PATCH /works/<uuid>/
Request body:
{
"status": "UNSUBMIT"
}
POST /works/
原有内容不变,添加 owner
字段,所有音乐获取相关的接口的 response 都需要添加这一字段
owner:
name: 姓名
phone: 手机
address: 通讯地址
PUT /works/<uuid>/
更改音乐的元数据并将音乐状态变为待审核
PATCH /works/<uuid>/
PATCH /works/<uuid>/
{
"status": "FAIL",
"remark": "low"
}
GET /mps/works/
返回所有状态的作品
GET /mps/<uuid>/works/
仅返回在线的作品
GET /admin/takeout/
增加个人所得税
PUT /admin/takeout/<uuid>/
{
"status": "FAIL",
"remark": "low"
}
说明:
<1> api版本为 /v1/
<2> 如果api返回错误信息,格式统一如下:
{
"message": "Wrong..."
}
只有error message(不需要code来细分错误)
{
"message": "wrong...",
"code": "a_b_c"
}
有code,用于错误细分,具体如下:
phone_unique
, email_unique
: 该手机号或邮箱已存在invalid_value
: 号码不规范time_limit_exceeded
: 验证码已经超时,请重新发送identify failed
: 验证失败action_already_done
: 当前操作已完成time_limit_exceeded
: 输入验证码超过时间限制require_captcha
: 登录失败次数过多,需要验证码email_not_activated
: 邮箱未激活unsupported
: 当前对象不支持该操作upstream_error
: 上游服务错误,包括发送频率过高,发送次数达到上限too_many_requests
: 调用频率过高,例如手机验证码发送频率unsent_code
: 请先发送验证码wrong_code
: 错误的验证码wrong_auth
: 请先验证身份wrong_password
: 密码错误
{
"detail": "Not found."
}
404时返回的,无需处理response信息
<3> 有的API开始定的不合理,会尽量都在下面补充上修正计划,前端可以先以文档中所说做好兼容
分页策略:
所有分页的接口都可设置参数page_size
,用于指定每页的个数。例如:
/accounts/?page=4&page_size=6
POST /users/
Request:
{
"phone": "+8617778059999",
"password": "123223",
}
Response 200:
{
"email": "yanhangyhy@icloud.com",
"email_activated": false,
"phone": "",
"type": "Visitor",
"uuid": "D81E059E-30ED-471A-A836-42C9E963323B"
}
Response 400: 传入参数不规范
missing_body_field
invalid_value
传入的邮箱或者手机号为空,邮箱格式不合法等db_integrity_error
创建用户时失败,重复的手机号/邮箱注册等(最好在之前已检查过)Response 401:验证失败
GET /users/check
Query Params:
email / phone
返回200, Response如下:
{
'result': True/False
}
分别表示用户存在和不存在的状况
POST /users/login
Request:
{
"phone": "+8618566669999",
"email": "",
"password": "123223"
}
Response 204
Response 401: 登陆失败
Response 400:
missing_body_field
require_captcha
页面自己应该在失败两次之后自动加入验证码。后端服务器在检测到上一分钟内有三次登录失败会返回此错误码(主要是为了防止非浏览器的登录)PUT /users/logout
Response 204: 登出成功
Response 401: 未认证
PUT /auth/send/
{
"phone": "+8618566669999",
"email": ""
}
Response 204:
Response 400
invalid_value
: 号码不规范missing_body_field
缺少字段too_many_requests
发送频率太高upstream_error
调用第三方服务失败PUT /auth/verify/
Request:
{
"phone": "+86123456788901",
"code": "1234"
}
code
字符串类型Response 204
Response 400:
time_limit_exceeded
超过时间限制(30分钟)missing_body_field
缺少字段phone_verify_failed
验证失败(login required)
GET /users/check-password?password=<xxxx>
Response:
204 正确
400
precondition_failed
密码不正确
missing_query_params
PUT /users/password
{
"old_password":"123223",
"new_password":"22333"
}
发送的密码均为明文
Response
precondition_failed
前置条件不满足,即旧密码输入的不对missing_body_field
PUT /users/change-phone
Request Body:
{
"phone": "+8612312341234",
"password": "123223"
}
phone
: 新手机号Response:
missing_body_field
precondition_failed
密码错误phone_unique
该手机号已被绑定到其它账号PUT /users/change-email
Request Body:
{
"email": "new_email@163.com",
"password": "123223"
}
Response:
missing_body_field
precondition_failed
密码错误email_unique
该邮箱已被绑定到其它账号PUT /v1/users/profile
Request:
{
'name': '崔老师',
'location': {
},
'avatar': '/path/to/avatar.jpg'
}
暂时支持这三个字段,可只传部分字段。其中 location为json串,后端不做验证,由前端自己决定格式。
Response 204
Response 404 用户不存在
Response 401
GET /users/profile
Response 200:
{
'name': 'a',
'avatar': '/path',
'location': {},
"uuid": "BBC6E384-29B0-42E0-B37F-2D57B6837392",
"email": "a@163.com",
"phone": "+86123456779",
"type": "MUSICIAN",
"musician": {
"type": "SINGER",
"today_profit": 100,
"level": "STAR"
}
}
musician
: 当type为MUSICIAN
时才会有此字段PUT /users/update-relation
{
'type': 'FOLLOW',
'uuid': '7ECE1B98-4A3B-482C-8604-4D8E45A75AD9'
}
type
: 动作类型: FOLLOW/UN-FOLLOW
uuid
: 目标用户uuidResponse:
missing_body_field
invalid_value
type取值不对PUT /users/collect-work/
Request body:
{
'uuid': str(works.uuid),
'type': 'LIKE'
}
Response 204 收藏或取消收藏成功
GET /users/<uuid>/collection-works/
Response 200
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"uuid": "0c527003-3372-47ac-a2db-0f07381dae9f",
"producer": "2197a343-8209-4e00-b7ba-fafe25d68169",
"length": 0,
"essence_start": 0,
"essence_end": 0,
"name": "x1",
"path": "xx.path",
"desc": "",
"avatar": "",
"tags": [],
"categories": [],
"size": 0,
"status": "ONLINE",
"created_at": "2017-02-06 03:02",
"type": "PERSONAL",
"can_sell": true
}
]
}
只对音乐人有效,并且返回的列表里只包含音乐人,且以作品被收藏数量排名
GET /users/followers
Response 200
{
"data":[
{
"location":{
},
"musician":{
"type":"SINGER"
},
"works_likes":5,
"avatar":"/test/pics/musician_profile.png",
"name":"ZhangSan"
},
{
"location":{
},
"musician":{
"type":"SINGER"
},
"works_likes":4,
"avatar":"/test/pics/musician_profile.png",
"name":"ZhangSan"
},
{
"location":{
},
"musician":{
"type":"SINGER"
},
"works_likes":2,
"avatar":"/test/pics/musician_profile.png",
"name":"ZhangSan"
}
]
}
目前只对音乐人有效,只显示其关注的音乐人,按作品被收藏数量排序
GET /users/following
Response 200:
{
"data":[
{
"location":{
},
"musician":{
"type":"SINGER"
},
"works_likes":5,
"avatar":"/test/pics/musician_profile.png",
"name":"ZhangSan"
}
]
}
GET /users/projects/
Repsonse 200:
{
"count": 14,
"next": "http://host/v1/users/projects?page=2",
"previous": null,
"results": [
{
"category": "TV",
"uuid": "2f21f671-a9f2-4e3a-a186-6becf83e60d2",
"level": "NORMAL",
"created_at": "2016-10-09T05:59:55.717Z",
"desc": "......",
"type": "CASE",
"name": "可口可乐,
"cover": "/path/to/cover",
"status": "APPLYING/ACCEPTED/REJECTED/STARTED/FISHISED"
},
...
]
}
DELETE /projects/<uuid>/
Response 204: 删除成功
Response 400: This project does not belong you.
PUT /users/forget-password/
Request Body:
{
"phone": "+8617778051213",
"email": "",
"password": "123"
}
Response 204 修改成功
Response 400:
{
"message": "Verify your account first"
"code": "precondition_failed"
}
GET /users/<uuid>/
Response 404: 用户不存在
Response 200:
{
"uuid": "48b475fb-a796-41bc-8fe4-d8b7497aee4d",
"level": "STAR",
"name": "eigenTunes亦听",
"location": {
"city": "广东省",
"country": "中国"
},
"is_musician": true,
"desc": "这是一段描述",
"type": "PRODUCER",
"categories": [
{
"id": 222,
"name": "交响",
"real": false,
"parent": 219
},
...
],
"avatar": "default/nbJvfOaMreqqNmVNMESExxNMU0iBoLkDjY4sY6OTX47bJRuEgj.png"
}
music_producer
当用户是音乐人时有此字段,否则没有
is_following
当前用户(已登录) 是否已关注目标用户,未登录时无此字段works_collected_count
音乐人作品被收藏统计level
音乐人等级, 取值范围: STAR/NORMAL
此目录下api在另一个项目 neptunus
中
GET /storage/upload-info
Query Params:
file_type
支持default/pics/songs
默认为default
Response 200:
{
"config": {
"accessid": "99roeiWDhKO0McAY",
"callback": "eyJjYWxsYmFja0JvZHlUeXBlIjogImFwcGxpY2F0aW9uL2pzb24iLCAiY2FsbGJhY2tCb2R5IjogIntcIm1pbWVUeXBlXCI6JHttaW1lVHlwZX0sXCJzaXplXCI6JHtzaXplfSxcImZpbGVuYW1lXCI6JHtvYmplY3R9fSIsICJjYWxsYmFja1VybCI6ICJodHRwOi8vNTIuMTc1LjI2LjE3Ojk1MzAvdjEvY2FsbGJhY2sifQ==",
"host": "http://vfine.oss-cn-beijing.aliyuncs.com",
"expire": 1472103817,
"signature": "s6m44WCovRKDZzpUMebuL2i82Es=",
"policy": "eyJjb25kaXRpb25zIjogW1sic3RhcnRzLXdpdGgiLCAiJGtleSIsICJkZWZhdWx0LyJdXSwgImV4cGlyYXRpb24iOiAiMjAxNi0wOC0yNVQwNTo0MzozN1oifQ==",
"dir": "default/"
},
"storage": "oss"
}
response处理及后续操作请参考 neptunus/tests/index.html
文件.
CALLBACK 返回的Response为:
{
"mimeType": "image/png",
"filename": "default/TCWt7CZ8fD.png",
"size": 415533
}
filename
文件路径 最终加上上面的host
地址即构成了文件的绝对路径(login_required)
POST /groups/
Request Body:
{
"name": "group1"
}
Response 200:
{
"name": "group1"
}
PUT /groups/add-user
Request Body:
{
"user_id": "BBC6E384-29B0-42E0-B37F-2D57B6837392",
"group_name": "group1"
}
Response:
(login required)
PUT /mps/identification
Rquest body:
{
"avatar": "/path",
"name": "lee",
"occupations": ["singer"],
"id": "13010419xxxxx1234",
"id_card_": "/path",
"id_card_": "/path",
"music": "music path"
}
Response:
missing_body_field
invalid_value
action_already_done
已经申请过了GET /mps/identification
注意只有当用户类型为游客时才需要调用此API
Response 200:
{
"is_done": null or true/false
}
(no login required)
GET /mps/
Query params:
level
: STARpurpose
: 项目类型country
: China
or Overseas
Response 200:
{
"results": [
{
"uuid": "929898b3-b715-4e7d-ba9e-cf31edfa8213",
"name": "李天衣",
"avatar": "default/sS6MITzuYrCUrQKVzhAUp0de0GOM4aCKeo4K4xqqZfqXdYTAOu.png",
"location": {
"city": "北京市",
"country": "中国"
},
"categories": [
{
"id": 222,
"name": "交响",
"real": false,
"parent": 219
},
...
],
"theme_song": null,
"projects": [
{
"uuid": "721fc2ec-5fc1-46a9-a316-1306404c6469",
"created_at": "2017-05-04T09:36:52.417000Z",
"updated_at": "2017-05-04T09:36:52.417000Z",
"owner": null,
"works": [
{
"uuid": "199e4638-f37d-46c0-ab7a-1ef99135f056",
"name": "易到用车TVC企业宣传片-徐小平篇",
"path": "default/qhBbsehenlxJaZGreXZWHSnIGTHWRrOSWCnaotfYNzEhVAkdZR.mp3",
"avatar": ""
},
{
"uuid": "5d3028e3-b200-4751-9561-e73f0ec31e2b",
"name": "易到用车TVC企业宣传片-姬十三篇",
"path": "default/79bTO9byjOqIFUO491Jav9zGkBDoNntpadl3X2Kkly2Swy76mo.mp3",
"avatar": ""
}
],
"is_outside": true,
"cover": "default/TqRRsZrXOzFtWKP2ivDj8Q7N5CkoHUnrZTDpAhwRcGMYDRk0JA.png",
"category": "AD",
"name": "易到用车TVC企业宣传片",
"desc": "我为易到用车企业宣传片制作音乐。",
"start_date": "2016-01-30",
"end_date": "2016-02-09",
"budget": 30,
"currency": "RMB",
"status": "FINISHED",
"video": "video/徐小平.mp4",
"sub_category": "PROMO",
"need_all_copyright": true,
"need_sound_design": false,
"length": 121,
"period": 10
},
...
]
},
...
],
...
}
(no login required)
GET /mps/
Query Pramas:
type
: 音乐人类型 PRODUCER
BANDSMAN
SINGER
sort
: 排序方式(必填) ALL
NEWEST
HOTTEST
Response 200 :
{
"count": 2,
"next": "http://api.vfinemusic.com/v1/mps/?page=2&sort=HOTTEST&type=BANDSMAN",
"previous": null,
"results": [
{
"location": {},
"works_likes": 4,
"name": "刘德华",
"avatar": "/path",
"uuid": "2EA852B2-C109-407C-BC40-CA3DF70F3E7E",
"level": "NORMAL",
"desc": "我有多么牛逼balabala",
"county": "China"
},
...
]
}
(no login required)
GET /mps/<uuid>/works
Response 404: 用户不存在
Response 200:
{
"results": [
{
"uuid": "3c3ddde2-e47f-4bb9-802b-8dc6e020a84b",
"producer": "bbee6da4-39aa-4769-8b51-4191d2c8805e",
"length": 0,
"essence_start": 0,
"essence_end": 0,
"name": "xxx",
"path": "",
"desc": "",
"avatar": "",
"tags": [],
"categories": [],
"size": 0,
"status": "ONLINE",
"created_at": "2017-02-21 05:02",
"type": "",
"can_sell": false,
"collect_count": 0,
"username": "",
"photo": ""
}
],
...
}
length
音频时长,单位为秒essence_start
: 精华开始时间essence_end
: 精华截止时间status
审核状态 WAITING
等待审核ONLINE
审核通过FAIL
审核失败OFFLINE
已下架2、 remarks 管理员审核备注
response 要增加版权所有者信息、上传音频信息
(no login required)
GET /mps/<uuid>/projects
Response 404: 用户不存在
Response 200:
{
"count": 14,
"next": "http://host/v1/mps/<uuid>/projects?page=2",
"previous": null,
"results": [
{
"category": "TV",
"uuid": "2f21f671-a9f2-4e3a-a186-6becf83e60d2",
"level": "NORMAL",
"created_at": "2016-10-09T05:59:55.717Z",
"desc": "......",
"type": "CASE",
"name": "可口可乐,
"cover": "/path/to/cover",
"status": "APPLYING/ACCEPTED/REJECTED/STARTED/FISHISED"
},
...
]
}
GET /mps/projects/applying/
Query params:
不传的话获取音乐人申请的所有项目包列表
{
"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",
"short_desc": "short_desc",
"budget": 200,
"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"
},
.....
]
}
GET /mp/<project_uuid>/applying
response 200
{
"id": 1,
"created_at": "2016-12-22T08:35:05.332000Z",
"updated_at": "2016-12-22T08:35:05.332000Z",
"status": "APPLYING",
"project": "5dbee382-cd33-40fe-8c49-5fda3b08ffb7",
"mp": 1
}
POST /works/
Request body:
{
'name': 'xxx',
'path': 'sdas.path',
'can_sell': True
}
Response 200
{
"uuid": "957f1f09-cfee-446a-ac33-c05f0a15e24f",
"producer": "e2d2fc7c-b0e2-4fe0-ba8a-4c53ea0e8fec",
"length": 0,
"name": "xxx",
"path": "sdas.path",
"desc": "",
"avatar": "",
"categories": [],
"size": 0,
"status": "ONLINE",
"created_at": "2017-02-21 05:02",
"can_sell": true,
"collect_count": 0,
"owner": {
}
}
DELETE /works/<uuid>/
Response 204删除成功
PUT /works/<uuid>/
Request body:
{
'status': 'OFFLINE',
'name': 'hehe',
'tags': [tag1.id],
'can_sell': True
}
Response:
{
"uuid": "1736588e-8b68-4030-9f0c-dfa67a3c97dd",
"producer": 1,
"length": 0,
"essence_start": 0,
"essence_end": 0,
"name": "hehe",
"path": "",
"desc": "",
"avatar": "",
"tags": [
{
"id": 1,
"name": "tag1"
}
],
"categories": [],
"size": 0,
"status": "OFFLINE",
"created_at": "2017-01-21 05:01",
"type": "PERSONAL",
"can_sell": true
}
Response 400:
其他的选项参照上面创建works的参数,可填可不填,
GET /categories/?root=musician_style
Response:
{
"results": [
{
"id": 234,
"name": "Hip-Hop",
"real": true,
"parent": 219,
"children": []
},
...
]
}
GET /categories/?root=career
Response:
{
"results": [
{
"id": 231,
"name": "乐手",
"real": false,
"parent": 229,
"children": [
{
"id": 242,
"name": "手风琴",
"real": true,
"parent": 231,
"children": []
},
...
]
},
...
]
}
GET /users/real_name/
Response 200:
{
"status": "SUCCESS",
"created_at": "2016-12-02T11:46:15.433164Z",
"name": "大姨夫",
"id_card": "1234**********1234",
"id_card_facade": "/path",
"id_card_obverse": "/path"
}
WAITING
SUCCESS
FAIL
Response 404: 当前用户未提交申请资料
Response 200:
POST /users/real_name/
Resquest body
{
"name": "大姨夫",
"id_card": "362227199501012022",
"id_card_facade": "/path",
"id_card_obverse": "/path"
}
PATCH /users/<uuid>/real_name/
Request body:
{
"status": "SUCCESS"
}
(login required)
POST /projects/
通用字段
cover
封面category
大类, 取值范围:AD
广告GAME
游戏TV
影视ANIMATION
动漫PERSONAL
个人COOPERATION
跨界name
项目包名称project_name
项目名称short_desc
一句话描述desc
需求详细描述start_date
起始日期end_date
截止日期budget
预算(数字)need_all_copyright
是否需要独家版权need_sound_design
是否需要声音设计sound_design
: 只有need_sound_design
为true
时需要special_sound_effect
特殊音效补充actual_sound_handle
同期声处理background_noise
底噪补充制作post_remix
后期混音scenes
: (可选) 场景信息,目前影视类和游戏有。数据类型为列表: name
场景名称,比如主题曲之类的picked
用户选择的音乐路径style
广告类
{
"cover": "/path/to/cover",
"category": "AD",
"name": "可口可乐",
"project_name": "项目名称",
"short_desc": "释放你的激情",
"start_date": "2016-09-10",
"end_date": "2016-09-11",
"budget": 1000,
"desc": "呵呵...",
"need_all_copyright": true,
"need_sound_design": true,
"sound_design" : {
"special_sound_effect": true,
"post_remix": true,
"actual_sound_handle": true,
"background_noise": true
}
}
个人类
{
"cover": "/path/to/cover",
"category": "PERSONAL",
"name": "私人",
"project_name": "项目名称",
"short_desc": "个人定制",
"start_date": "2016-09-10",
"end_date": "2016-09-11",
"budget": 1000,
"desc": "呵呵...",
"need_all_copyright": true,
"need_sound_design": false,
"sub_category": "MIX"
}
sub_category
声音需求 COMPOSE
作曲ARRANGEMENT
编曲MIX
混音跨界类
{
"cover": "/path/to/cover",
"category": "COOPERATION",
"name": "跨界",
"project_name": "项目名称",
"short_desc": "释放你的激情",
"start_date": "2016-09-10",
"end_date": "2016-09-11",
"budget": 1000,
"desc": "呵呵...",
"need_all_copyright": true,
"need_sound_design": false,
"sub_category": "MUSIC-TECH"
}
sub_category
声音需求
MUSIC-TECH
音频技术解决方案MUSIC-CONTENT
音乐内容解决方案影视类(动画电影,电影,电视剧,动画电视剧):
{
"cover": "/path/to/cover",
"category": "TV/ANIMATION",
"name": "八恶人",
"project_name": "项目名称",
"short_desc": "释放你的激情",
"start_date": "2016-09-10",
"end_date": "2016-09-11",
"budget": 1000,
"desc": "呵呵...",
"need_all_copyright": true,
"need_sound_design": false,
"content_category": "FILM",
"director_name": "张艺谋",
"length": 100,
"episode_count": 1,
"scenes": [
{
"name": "THEME-SONG",
"picked": "/path/to/picked-song.mp3"
}
]
}
content_category
区分影视还是连续剧,取值范围:
FILM
电影/动画电影SERIES
电视连续剧/动画电视剧director_name
导演名字
length
影片长度或者单集电视长度
episode_count
: (可选) 电影类的默认为1,可不传,电视剧类的需要传此参数
sub_category
详细分类,取值范围: 'FANTASY', 'SPORTS', 'FEATURE', 'SUSPENSE', 'SCIENCE_FICTION', 'BIOGRAPHY', 'MARTIAL_ARTS', 'ACTION', 'HISTORY', 'WESTERN', 'CRIME', 'MUSIC', 'WAR', 'COMEDY', 'HORROR', 'LOVE', 'FAMILY', 'ADVENTURE', 'THRILLER', 'DISASTER', 'ETHIC'
游戏类
{
"cover": "/path/to/cover",
"category": "GAME",
"name": "私人",
"project_name": "项目名称",
"short_desc": "释放你的激情",
"start_date": "2016-09-10",
"end_date": "2016-09-11",
"budget": 1000,
"desc": "呵呵...",
"need_all_copyright": true,
"need_sound_design": false,
"platform": "WEB",
"gender": "ALL",
"age_area": "3+",
"sub_category": "AA"
}
platform
游戏平台: WEB/MOBILE/CLIENT
gender
角色性别: ALL/MALE/FEMALE
age_area
适用人群: 3+/7+/12+/16+/18+/ALL
sub_category
内容分类,取值范围: 'CARD', 'FIGHTING', 'RAC', 'PUZZLE', 'BSM', 'STRATEGY', 'MUSIC', 'SPG', 'PARKOUR', 'SHOOTER', 'RPG', 'RTS', 'MOBA', 'EDU'
(no login required)
GET /projects/<uuid>/
Response 404: 相关对象不存在
Response 200:
{
"name": "可口可乐",
"cover": "/path/to/cover",
"producers": [
{
"type": "SINGER",
"name": "ZhangSan",
"avatar": "/test/pics/musician_profile.png"
},
{
"type": "SINGER",
"name": "ZhangSan",
"avatar": "/test/pics/musician_profile.png"
}
],
"owner": {
"location": {},
"avatar": "/test/pics/musician_profile.png",
"name": "ZhangSan",
"level": "NORMAL"
},
"works": [
{
"length": 6,
"author": "Taylor Swift",
"essence_start": 1,
"name": "Example.ogg",
"essence_end": 3,
"avatar": ""
}
],
"desc": "......"
}
GET projects/?category=TV
Query Params:
category
即项目包大类,参考上面status
项目包的状态 Response 200:(分页)
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"category": "TV",
"created_at": "2016-09-20T09:59:49.852Z",
"desc": "......",
"level": "NORMAL",
"main_producer": {
"name": "ZhangSan"
},
"name": "可口可乐",
"type": "CASE",
"uuid": "2F21F671-A9F2-4E3A-A186-6BECF83E60D2",
"works": {
"length": 6,
"name": "Example.ogg",
"path": "/songs/Example.ogg"
}
}
]
}
固定数量四个
GET /projects?type=CASE
Response 200:
{
"data": [
{
"cover": "/path/to/cover",
"name": "可口可乐",
"uuid": "2F21F671-A9F2-4E3A-A186-6BECF83E60D2"
}
]
}
GET /songs/example
/
Query Params
Resopnse 200
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 20,
"name": "654654",
"href": "default/5TcuiXqerUuTuMVH1Nk1VReLpPue7dS9KSV4SsGnCGCVDTalzD.exe",
"cover_path": "",
"color": "RED",
"group": "CHINA",
"created_at": "2016-12-02T11:46:15.433164Z",
"status": "ONLINE"
},
{
"id": 19,
"name": "其味无穷二",
"href": "default/LoPtSwgft0khP4fgTtiTxjaXP6YMCEaYgNqAh8MzD41DQbtS7r.jpeg",
"cover_path": "",
"color": "RED",
"group": "CHINA",
"created_at": "2016-12-02T11:43:42.730316Z",
"status": "ONLINE"
}
]
}
GET /v1/banner/?type=SLIDER
Query Params:
type
banner分类
Response 200:
{
"data": [
{
"href": "x1.jpg",
"type": "SLIDER",
"name": "banne1"
},
{
"href": "x2.jpg",
"type": "SLIDER",
"name": "banne2"
},
{
"href": "x3.jpg",
"type": "SLIDER",
"name": "banne3"
},
{
"href": "x4.jpg",
"type": "SLIDER",
"name": "banne4"
}
]
}
(login required)
GET /messages/
注意:该接口会附带把所有消息置为已读。
Params:
read
: <empty>
全部true
已读false
未读Response 200:
{
"results":[
{
"type": "SYSTEM",
"args": {"email": "support@vfinemusic.com"}
"content": "SUCCESS_TO_MUSICIAN",
"read": true,
"created_at": "2016-12-26T07:27:47.393000Z",
"id": 2,
"title": "SUCCESS_TO_MUSICIAN"
},
...
],
...
}
按时间排序,最新的在最前面.
read
已读/未读状态GET /messages/count/?read=false
Response body:
{
"count": 3
}
DELETE /messages/<id>/
Response:
注意:以下是已废弃接口。
PUT /messages/<id>/read/
Response:
object_not_found
POST /messages/
Request body:
{
"title": "xx",
"content": "vvv",
"receiver": "xxxxxxxxxxxxxx"
}
Response 200:
{
"content":"vvv",
"read":false,
"created_at":"2016-12-26T07:27:47.393000Z",
"id":1,
"title":"xx"
}
POST /admin/checkpoints/
Request Body:
{
'date': '2016-12-30',
'project_uuid': '2f21f671a9f24e3aa1866becf83e60d2',
'text': 'to do',
'mp_id': 'mp.id'
}
以上几个字段都是必须的,时间格式前端需要检验下
需要注意的是,一个项目包当天只有一个检查点,如果在创建的话,会覆盖前一个检查点
Response 200:
{
"uuid": "1c42ac46-2833-4679-8d14-06ee7ce9aecd",
"works": [],
"date": "2016-12-30",
"text": "to do",
"status": "UNFINISHED",
"producer": 1,
"project": "b6f8d42c-ee7c-4175-92c7-97421a1c6009"
}
Response 400
PUT /admin/checkpoints/<uuid>
Request body:
{
'text': 'sss',
'date': '2016-12-29'
}
Response 200
{
"uuid": "1c42ac46-2833-4679-8d14-06ee7ce9aecd",
"works": [],
"date": "2016-12-29",
"text": "sss",
"status": "UNFINISHED",
"producer": 1,
"project": "b6f8d42c-ee7c-4175-92c7-97421a1c6009"
}
DELETE /admin/checkpoints/<uuid>
Response 204 删除成功
GET /admin/package/<uuid>/checkpoints/
Response 200:
{
"checkpoints": [
{
"uuid": "7d77e1b6-d29a-4568-9613-d0253d02208d",
"works": [],
"date": "2016-12-24",
"text": "to-do",
"status": "UNFINISHED",
"producer": 1,
"project": "247f75d8-a5b2-475f-b23c-537783793264"
}
]
}
GET /workbenches/checkpoints/
Query Params:
status(不传的话获取下面两种情况的集合)
Response 200:
{
"data": [
{
"uuid": "76ca7d14-2984-4490-97dc-fc1eed497426",
"works": [],
"date": "2016-06-23",
"text": null,
"status": "UNFINISHED",
"producer": 1,
"project": "c7aa106f-bc23-4440-9882-3b2cc1ca0f8f"
},
{
"uuid": "b423d4d2-2743-4138-8c42-74aad4aeb992",
"works": [],
"date": "2016-12-23",
"text": "to-do",
"status": "UNFINISHED",
"producer": 1,
"project": "c7aa106f-bc23-4440-9882-3b2cc1ca0f8f"
}
]
}
POST /workbenches/checkpoints/<uuid>/work/
Request Body:
{
'name': 'name1',
'path': 'work1'
}
后台admin可以复用此接口
Response 200:
{
"uuid": "6efe8012-e708-4ecc-a84e-1b2e9eb0e132",
"works": [
{
"uuid": "ac63a9a2-2475-4257-a324-f72d8f530b56",
"producer": 1,
"length": 0,
"essence_start": 0,
"essence_end": 0,
"name": "name1",
"path": "work1",
"desc": "",
"avatar": "",
"tags": [],
"categories": [],
"size": 0,
"status": "ONLINE",
"created_at": "2016-12-26 07:12"
}
],
"date": "2016-12-23",
"text": "xxx",
"status": "UNFINISHED",
"producer": 1,
"project": "2e0eafab-0e3d-43c4-a5fa-50bfda00b3d7"
}
Respose 400:
后台admin可以复用此借口
DELETE /workbenches/checkpoints/<uuid>/work/
Request body:
{
'works': ['ac63a9a2-2475-4257-a324-f72d8f530b56', '99832ecb-9a7c-4275-8a89-3672fa8bd64a']
}
Response 204: 删除成功
Response 400:
GET /workbenches/checkpoints/<uuid>/acceptance/
Response 200:
[
{
"id": 1,
"created_at": "2016-12-26T07:27:47.393000Z",
"updated_at": "2016-12-26T07:27:47.393000Z",
"mp_message": "demo-1",
"client_message": "demo-1 unsatisfied",
"status": "UNSATISFIED",
"cp": "2eaa07b8-7073-4398-b062-6fae5ea61e09",
"client": "6100915e-d7b6-4a5a-b46f-a089557a2106"
},
{
"id": 2,
"created_at": "2016-12-26T07:27:47.393000Z",
"updated_at": "2016-12-26T07:27:47.393000Z",
"mp_message": "demo-2",
"client_message": "ok",
"status": "SATISFIED",
"cp": "2eaa07b8-7073-4398-b062-6fae5ea61e09",
"client": "6100915e-d7b6-4a5a-b46f-a089557a2106"
}
]
POST /workbenches/checkpoints/<uuid>/acceptance/
Request body:
{
'message': 'demo-1'
}
Response 200:
{
"id": 1,
"created_at": "2016-12-26T07:31:44.717000Z",
"updated_at": "2016-12-26T07:31:44.717000Z",
"mp_message": "",
"client_message": "demo-1",
"status": "UNSATISFIED",
"cp": "8c870d1b-5931-4386-96ad-ca19dfee6152",
"client": "33d50f03-f6fd-4ad0-88a5-7cc4ce5625c7"
}
Response 400:
GET /projects/<uuid>/checkpoints/
Response 200:
{
"checkpoints": [
{
"uuid": "c0fd39c0-3b4c-4cf6-86ab-f73559f967c3",
"works": [
{
"uuid": "ff61c576-ba0b-4524-9c82-fc33ba32f237",
"producer": 1,
"length": 0,
"essence_start": 0,
"essence_end": 0,
"name": "work1",
"path": "",
"desc": "",
"avatar": "",
"tags": [],
"categories": [],
"size": 0,
"status": "ONLINE",
"created_at": "2016-12-26 07:12"
}
],
"date": "2016-12-23",
"text": "xxx",
"status": "UNFINISHED",
"producer": 1,
"project": "247f75d8-a5b2-475f-b23c-537783793264"
},
{
"uuid": "7d77e1b6-d29a-4568-9613-d0253d02208d",
"works": [],
"date": "2016-12-24",
"text": "to-do",
"status": "UNFINISHED",
"producer": 1,
"project": "247f75d8-a5b2-475f-b23c-537783793264"
}
]
}
Response 400
PUT /workbenchs/acceptance/<id>/
Request body:
{
'message': 'demo is ok',
'status': 'SATISFIED'
}
满意的时候 message 可以为空字符串
不满意的时候, message 不能为空
Response 200:
{
"id": 1,
"created_at": "2016-12-26T07:42:45.977000Z",
"updated_at": "2016-12-26T07:42:45.991000Z",
"mp_message": "demo-1",
"client_message": "demo is ok",
"status": "SATISFIED",
"cp": "a0adcc4d-15db-4669-9d67-17b3176ba7b0",
"client": "24755426-c056-45c6-9a85-548d4ec9eb36"
}
Response 400:
GET /workbenches/project/checkpoints/
Query Params
Response 200
{
"data": "2/6"
}
GET /categories/
Response 200:
{
"results": [
{
"id": 1,
"name": "风格",
"parent": null,
"real": false,
"children": [
{
"id": 3,
"name": "摇滚",
"real": true,
"parent": 1,
"children": []
},
...
]
},
...
]
}
GET /categories/?root=风格&struct=flat
Response 200:
{
"results": [
{
"id": 29,
"name": "摇滚",
"real": false,
"parent": 163
},
...
]
}
GET /works/
params:
Response 200:
{
"count": 4,
"next": null,
"previous": null,
"results": [
{
"username": "谭维维",
"photo": "/test/pics/musician_profile.png",
"path": "/songs/Example.ogg",
"essence_start": 1,
"desc": "测试音频文件",
"name": "Example.ogg",
"uuid": "dd3b44f8-ef46-41b9-beb9-dfdc3a9353db",
"essence_end": 3,
"length": 6,
"avatar": "",
"type": "PRODUCER"
},
...
]
}
GET /pricing/
Response body:
{
"purpose": [
{
"name": "广告/宣传片",
"question": "请选择您的投放渠道",
"detail": [
{
"name": "全渠道投放",
"price": 500.0
},
...
]
},
...
]
}
POST /cart/
Request body:
{
"work": <work uuid>,
"purpose": "广告/宣传片",
"detail": "全渠道投放"
}
Response 201: 添加成功
GET /cart/
Response body:
{
results: [
{
"id": 1,
"purpose": "广告/宣传片",
"detail": "全渠道投放",
"pricing": 500.0,
"work": {
"uuid": <uuid>,
"name": "_name_",
"path": "/path.mp3",
"producer": {
"uuid": <uuid>,
"name": "_name_"
}
}
},
...
]
}
DELETE /cart/<id>/
Response 204: 删除成功
POST /orders/
COMPANY
PERSONAL
Request body:
{
"name": <name>,
"phone": <phone>,
"mode": "COMPANY",
"company": <company name>,
"address": <company address>,
"works": [
{
"uuid": <uuid>,
"purpose": "商业广告/宣传片",
"channel": "全渠道投放"
},
...
]
}
Response 200:
{
支付服务返回的结果
}
POST /orders/
Request params:
<empty>
所有FINISHED
已完成UNFINISHED
未完成CANCELED
已取消Response body:
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"uuid": "9b44d5ae-f099-4ae1-846e-34e4c8a7b458",
...
},
...
]
}
POST /orders/<uuid>/
Response body:
{
"uuid": "9b44d5ae-f099-4ae1-846e-34e4c8a7b458",
"name": "大姨夫",
"phone": "+8618515355024",
"company": "音未",
"address": "五道口",
"price": "500.00",
"payment_method": null,
"payment_number": null,
"certificates": [
{
"uuid": "68e01d72-3959-4463-bc66-b09405615ea2",
"author": "富宇",
"licensee": "Admin",
"work_name": "saxsmooth",
"work_path": "songs/SIk4YzGuA84R0yoYkl3156eJocbpGJdCpsEvf2xMmvUpjpjUBx.mp3",
"work": {
"uuid": "06fbadf2-2d19-4fad-b57d-ac4f51c2c077",
"avatar": "/path"
},
"purpose": "商业广告/宣传片",
"channel": "全渠道投放",
"price": "500.00",
"income": "0.00",
"order": "9b44d5ae-f099-4ae1-846e-34e4c8a7b458"
}
]
}
uuid: 订单号
GET /orders/<uuid>/pay/
DELETE /orders/<uuid>/
Response 204 : 取消成功
GET /certificates/
Response body:
{
results: [<certificate>, ...],
...
}
GET /certificates/<uuid>/
Response body:
{
"uuid": "4f08e0ad-8475-462b-9371-48e541eafaa8",
"author": "eigenTunes亦听",
"licensee": "Admin",
"work_name": "漫步星空",
"work_path": "/path.mp3",
"work": {
"uuid": "2dc065a3-239f-45ae-ba6c-cf17636b8dd3",
"name": "漫步星空",
"path": "/path.mp3",
"avatar": "/path.jpg",
"producer": {
"uuid": <uuid>,
"name": "eigenTunes亦听"
}
},
"purchase_date": "2017-05-08T10:15:02.402000Z",
"purpose": "广告/宣传片",
"detail": "全渠道投放",
"price": "0.01",
"income": "0.00",
"order": "184d37c2-b836-479e-aa8b-2991ff3781d3"
}
GET /certificates/<uuid>[.txt|.pdf]
GET /income/total/
Response body:
{
"data": {
"balance": "898.00",
"total_income": "1000.00",
"current_month_income": "26.00",
"total_order": 5,
"current_month_order": 3
}
}
GET /income/
Response body:
{
results: [
{
"uuid": "4f08e0ad-8475-462b-9371-48e541eafaa8",
"purchase_date": "2017-05-08T10:15:02.402000Z",
"work_name": "漫步星空",
"licensee": "Admin",
"price": "100.00",
"income": "89.00"
}
],
...
}
POST /pay_account/
Request body:
{
"type": "alipay”,
"account": "dayifu"
}
GET /pay_account/
Response body:
{
"type": "alipay”,
"account": "da*ifu"
}
Response 404: 未绑定
PUT /pay_account/
Request body:
{
"type": "alipay",
"account": "dayifu"
}
POST /takeout/
Request body:
{
money: 100.0
}
GET /takeout/
status
: 提现状态 REQUESTING
申请中WAITING
待转账SUCCESS
提现成功FAIL
申请失败CANCEL
已取消
{
"count": 3,
"next": null,
"previous": null,
"results": [
{
"uuid": <uuid>,
"status": "REQUESTING",
"created_at": "2016-12-02T11:46:15.433164Z",
"money": "100.00",
"transfer_money": "90.00",
"name": "dayifu",
"id_card": "345678905678",
"balance": 300
}
]
}
POST /suggestions/
Request body
{
"username": "xx",
"text": "xzcz",
}
Response 200
需要登录才能购买
POST /users/purchase-work/
Request body:
{
'uuid': 'ac20265d-91b7-4375-a689-b5d0f4e6fa2c',
'remark': 'xxxx'
}
Response body:
{
"id": 1,
"remark": "xxxx",
"date": "2017-01-19",
"status": "APPLY",
"user": "e1d6054f-8e97-4569-b3f0-4a654a9bd1ec",
"work": "7f6552a7-fc19-4ebc-a23b-1bf6a408514b"
}
Response 400
POST /projects/<uuid>/order/
Request body:
{
quote: 222,
message: "xx",
demo: {
"xx": 'xx'
}
}
Response 200
{
"id": 1,
"project": "44e5d65a-d3c5-46c8-9d01-ed2bb0d7112d",
"quote": 222,
"message": "xxx",
"is_candidate": false,
"backend": {},
"weight": 0,
"mp_id": "1",
"mp_uuid": "22fdbdc1-acc9-42e2-9b6a-1b74a9b63026",
"username": "jason",
"avatar": "",
"demo": {
"xx": "xx"
},
"created_at": "2017-02-23T08:32:10.130912Z",
"status": "APPLYING"
}
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:
[
{
"id": 1,
"project": "7513f3f8-0b56-4c0d-955f-127a0be3f818",
"quote": 0,
"message": "",
"is_candidate": true,
"backend": null,
"weight": 22,
"mp_id": "1",
"mp_uuid": "654649ad-4010-4a61-a544-d469487fbd37",
"username": "",
"avatar": "",
"demo": null,
"created_at": "2017-02-23T07:32:00.986719Z",
"status": "APPLYING"
}, {
"id": 2,
"project": "7513f3f8-0b56-4c0d-955f-127a0be3f818",
"quote": 0,
"message": "",
"is_candidate": false,
"backend": null,
"weight": 11,
"mp_id": "2",
"mp_uuid": "4cc5f71d-706b-4b95-b787-eee03f302847",
"username": "",
"avatar": "",
"demo": null,
"created_at": "2017-02-23T07:32:00.987064Z",
"status": "APPLYING"
}
]
POST /admin/projects/<uuid>/applying/
Request data:
{
'mp': mp.id,
'quote': 444,
'backend': {
'xx': 'ss'
}
}
其他支持的选项为
Response 200:
{
"id": 1,
"project": "1e0d1ed9-495a-41a3-acb1-12fd6ab5171b",
"quote": 444,
"message": "",
"is_candidate": false,
"backend": {
"xx": "ss"
},
"weight": 0,
"mp_id": "1",
"mp_uuid": "2e04e008-a402-49bc-8c6a-7dfe917b1881",
"username": "",
"avatar": "",
"demo": {},
"created_at": "2017-03-15T07:17:41.629533Z",
"status": "APPLYING"
}
PUT /admin/projects/applying/
Request body:
{
'applying': str(applying1.id),
'weight': 22,
'backend': {
'xx': 'xx'
},
'status': const.PROJECT_APPLY_FAIL
}
Response body
{
"id": 1,
"project": "7016c2da-3f37-4288-b1fe-382807c85f65",
"quote": 0,
"message": "",
"is_candidate": false,
"backend": {
"xx": "xx"
},
"weight": 22,
"mp_id": "1",
"mp_uuid": "e83532a0-a561-4a82-b3db-e10050a4a30a",
"username": "",
"avatar": "",
"demo": {},
"created_at": "2017-02-23T09:17:31.518870Z",
"status": "FAIL"
}
PUT /projects/<uuid>/applying/
Request body:
{
'applying': [1, 2]
}
Response 204 (挑选成功)
POST /admin/packages/manager/
Request Body:
{
'project_id': '2f21f671a9f24e3aa1866becf8311111',
'manager_id': '1'
}
Response 204 接单成功
Response 400 这个项目包已经有人接了
{
"message": "Manager has been add",
"code": "action_already_done"
}
GET /projects/<uuid>/cps/works/
Response 200
[
{
"uuid": "c4d07336-53fc-441c-abaa-d8b74c4cd678",
"producer": "f1462bad-7fdd-49ef-89bd-3f19e824e442",
"length": 0,
"essence_start": 0,
"essence_end": 0,
"name": "",
"path": "",
"desc": "",
"avatar": "",
"tags": [],
"categories": [],
"size": 0,
"status": "ONLINE",
"created_at": "2017-03-06 09:03",
"type": "",
"can_sell": false,
"collect_count": 0,
"username": "jason",
"photo": ""
}
]
POST /projects/<uuid>/cps/works/
Request body:
{
'works': ["c4d07336-53fc-441c-abaa-d8b74c4cd678", ]
}
Response 204 添加成功
Response 400 This project is not for you
Response 400 This work can not be add to project. ,该works不属于该项包下的检查点
加不加水印自动做了处理,前端无需判断
GET /songs/<uuid>/download/
Response 302 重定向到歌曲资源处
Response 400 Have no permission for this song 没有权限
GET /works/star/
按照统一的音乐格式返回即可
GET /mps/star/
Response body:
{
"results": [
{
"name": "Musician1",
"another_musician_info": "a",
"can_sell_list": [
"work",
"work"
]
}
]
}
需给出音乐人列表和该音乐人可售卖音乐列表
DELETE /works/star/
Request body:
{
"pk": <uuid>
}
POST /works/star
Request body:
{
"pk": <uuid>
}
DELETE /mps/star/
Request body:
{
"pk": <uuid>
}
POST /mps/star/
Request body:
{
"pk": <uuid>
}
获取待审核的实名列表
GET /real_name/
Response 200:
{
"results": [
{
"user": {
"uuid": "3c3ddde2-e47f-4bb9-802b-8dc6e020a84b",
"name": "大姨夫"
},
"name": "李四",
"created_at": "2016-12-02T11:46:15.433164Z",
"id_card": "1234**********1234",
"id_card_facade": "/path",
"id_card_obverse": "/path"
}
],
...
}
PATCH /users/<uuid>/real_name/
之前的接口是一个SUCCESS
的状态, 只允许通过,现在需要有拒绝的操作
SUCCESS
审核通过FAIL
审核失败Request body:
{
"status": " SUCCESS / FAIL"
}
GET /songs/works/
售卖音乐增加审核状态筛选 status:
每个音乐增加售卖次数和最近售卖时间: