@yangxitian
2017-05-20T14:11:27.000000Z
字数 23668
阅读 1254
OKMAN
X-Requested-With:XMLHttpRequest
status说明:
401: forbidden 尚未登陆/请先退出登陆
403: 业务逻辑上权限不足
422: 参数错误或者业务逻辑上的错误
423: 请输入验证码或验证码错误
500: 系统错误
503: 系统维护中
后台统一了错误信息的返回,格式如下:
{"status": xxx, //http码"position": "XXXXXXXXXX", //错误位置,debug模式才存在"inform": "XXX" //需要显示的错误通知,为数组或字符串}
邮箱验证流程说明:
1.用户填写基本信息
2.注册成功(此时系统自动发送邮箱认证到用户邮箱)
3.选择talent,genere等等。
4.用户可以点击邮件认证中的连接,跳转到平台认证页面。
5.该页面根据code、email,请求 用户邮箱认证 API进行验证
6.用户邮箱认证完毕。
POST
auth/register
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| first_name | 用户名 | Y | |
| last_name | 用户姓 | Y | |
| name | 用户昵称 | Y | |
| 注册的邮箱 | Y | ||
| password | 用户密码 | Y | |
| password_confirmation | 用户确定密码 | Y | |
| gender | 性别 | N | 1 男 0 女 |
| age | 年龄 | N | |
| province_code | 省份编号 | N | |
| city_code | 城市编号 | N | |
| bio | 自我简介 | N |
Response
status 200
{"message": "操作成功"}
GET
auth/sendActivateEmail
防止用户不小心把认证邮件删了
Response
status 200
{"message": "操作成功"}
POST
auth/activateEmail
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| 邮箱 | Y | ||
| code | 验证码 | Y |
Response
status 200
{"message": "操作成功"}
GET
captcha
Response
status 200
返回一张图片
example
<img id="login_img" onclick="refresh_login_img();"><script type="text/javascript">function refresh_login_img() {$('#login_img').attr('src', base_url + 'captcha?random=' + Math.random());}refresh_login_img();</script>
POST
auth/login
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| 邮箱 | Y | ||
| password | 用户密码 | Y | |
| code | 验证码 | N | 登陆失败过后,需要 |
Response
status 200
{"message": "操作成功","data": 15 //认证成功的 user id}
GET
auth/logout
Response
status 200
{"message": "操作成功"}
GET
listUser
按照被关注人数排序
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| count | 每页显示的条数 | N | 默认8 |
| page | 页数 | N | 默认1 |
Response
{"message": "操作成功","data": {"total": 6,"per_page": 8,"current_page": 1,"last_page": 1,"next_page_url": null,"prev_page_url": null,"from": 1,"to": 6,"data": [{"id": 15,"first_name": "shelter","last_name": "ya","profile_pic": "upload/img/user-head/7ZqtihxR.jpg","follower_project_number": 0, //关注project 数目"collaboration_number": 0, //参与项目数量"followers": 1, //被多少人关注"roles": [{"id": 7,"name": "Arranger","pivot": {"user_id": 15,"role_id": 7}}],"genres": [{"id": 19,"name": "great","pivot": {"user_id": 15,"genre_id": 19}}],"instruments": [{"id": 9,"name": "Piano","pivot": {"user_id": 15,"instrument_id": 9}}],"daws": [{"id": 6,"name": "Fruity","pivot": {"user_id": 24,"daw_id": 6}}]}]}}
GET
listGenres
Response
status 200
{"message": "操作成功","data": [{"id": 12,"name": "genre 123","children": [{"id": 19,"name": "great"}]}]}
GET
listRoles
Response
status 200
{"message": "操作成功","data": [{"id": 4,"name": "Music Composer"}]}
GET
listInstruments
Response
status 200
{"message": "操作成功","data": [{"id": 9,"name": "piano"}]}
GET
listDAW
Response
status 200
{"message": "操作成功","data": [{"id": 1,"name": "test0"}]}
GET
listProject
按照关注数量进行排序
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| count | 每页显示的条数 | N | 默认30 |
| page | 页数 | N | 默认1 |
| status | 状态 | N | 为以下值 1 制作中(默认) 2 制作完成 |
Response
status 200
{"message": "操作成功","data": {"total": 7,"per_page": 30,"current_page": 1,"last_page": 1,"next_page_url": null,"prev_page_url": null,"from": 1,"to": 7,"data": [{"id": 4,"name": "test project","status": "1","is_public": true,"show_sound": "upload/video/project/6/zpIMiaqY.mp3", //完成project 才有此字段。即最终作品"followers": 0, //关注人数量"play_count": 0, //播放次数"comment_count": 0, //评论数量"cover_pic": "upload/img/project-cover/ePFCRKQW.jpg","deleted_at": null,"created_at": "1 day ago","has_follower": false, //是否以及关注"users": [{"id": 15,"first_name": "shelter","last_name": "ya","profile_pic": "upload/img/user-head/7ZqtihxR.jpg","pivot": {"project_id": 4,"user_id": 15,"role_id": 4,"created_at": "2017-03-30 14:47:33","is_admin": 1}}],"roles": [{"id": 4,"name": "Music Composer","pivot": {"project_id": 4,"role_id": 4,"note": "aerfasdrfaev","created_at": "2017-03-30 14:55:17"}}],"genres": [{"id": 20,"name": "Romance","pivot": {"project_id": 4,"genre_id": 20}}],"instruments": [{"id": 11,"name": "Saxophone","pivot": {"project_id": 18,"instrument_id": 11,"note": "","created_at": "2017-04-07 12:02:41"}}]}]}}
GET
addProjectPlayCount/{project_id}
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加url |
Response
status 200
{"message": "操作成功"}
PUT
user/0
ajax header头
Content-Type:application/x-www-form-urlencoded
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| first_name | 用户名 | N | |
| last_name | 用户姓 | N | |
| name | 用户昵称 | N | |
| gender | 性别 | N | 1 男 0 女 |
| age | 年龄 | N | |
| province_code | 省份编号 | N | |
| city_code | 城市编号 | N | |
| bio | 自我简介 | N | |
| role_ids | 用户角色id | N | 将用户选中的id 拼接起来 eg. 1,2,3,4, |
| instrument_ids | instrument ids | N | 将用户选中的id 拼接起来 eg. 1,2,3,4, |
| genre_ids | 风格id | N | 将用户选中的id 拼接起来 eg. 1,2,3,4, |
| daw_ids | DAW id | N | 将用户选中的id 拼接起来 eg. 1,2,3,4, |
Response
status 200
{"message": "操作成功"}
POST
user/uploadProfile
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| head | img文件 | Y | png jpg 小于2M |
Response
status 200
{"head_url": "upload/img/user-head/MgIBhLoF.jpg"}
GET
user
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| id | 用户 id | N | 默认当前登陆用户 |
Response
status 200
{"message": {"id": 15,"first_name": "shelter","last_name": "ya","name": "assassin","email": "2581318149@qq.com","email_activate": true,"profile_pic": "upload/img/user-head/7ZqtihxR.jpg", //默认空字符串"gender": 1,"age": 22,"province_code": 440000,"city_code": 440700,"bio": "A MAN","has_follower": true, //当用户已经登陆,而且读取的不是本人的信息,会有此字段,判断是否已经关注此人。"collaboration_number": 5,"followers": 2, //被关注人数"roles": [{"id": 7,"name": "Arranger"}],"instruments": [{"id": 9,"name": "piano"}],"genres": [{"id": 20,"name": "shelter"}],"daws": [{"id": 1,"name": "test0"}]}}
GET
user/follow/{user_id}
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| user_id | 要关注的用户ID | Y | 附url |
Response
{"message": "操作成功"}
GET
user/cancelFollow/{user_id}
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| user_id | 要取消关注的用户ID | Y | 附url |
Response
{"message": "操作成功"}
GET
user/listFollower
Response
{"message": "操作成功","data": [{"id": 22,"first_name": "John","last_name": "Zhang","profile_pic": "upload/img/user-head/LUu5FDhm.jpg","pivot": {"user_id": 15,"follower_id": 22}}]}
GET
user/listMyFollow
Response
{"message": "操作成功","data": [{"id": 16,"first_name": "June","last_name": "ya","profile_pic": "upload/img/user-head/2Ovb4jiN.jpg","pivot": {"follower_id": 23,"user_id": 16},"genres": [{"id": 25,"name": "Chinese Folk","pivot": {"user_id": 16,"genre_id": 25}}],"roles": [{"id": 5,"name": "Lyricist","pivot": {"user_id": 16,"role_id": 5}}]}]}
POST
user/chat/{user_id}
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| user_id | 用户id | Y | 附加url |
| content | 消息内容 | Y | 不得超过255字 |
Response
{"message": "操作成功"}
GET
user/chat
Response
{"message": "操作成功","data": [{"id": 5, // chat_id"user1_id": 16,"user2_id": 15,"show_status": "0","last_at": 1493216908 //上一条消息时间}]}
GET
user/chat/{chat_id}
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| chat_id | 聊天 id | Y | 附加url |
Response
{"message": "操作成功","data": [{"id": 6,"chat_id": 5,"content": "hello", //消息内容"user_id": 15, //哪个用户发送的,可以根据这个判断,决定显示的位置"created_at": 1493216908 //发送时间}]}
DELETE
user/chat/{chat_id}
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| chat_id | 聊天 id | Y | 附加url |
Response
{"message": "操作成功"}
GET
user/postbox/isNew
Response
{"message": "操作成功","data": true/false //是否拥有新消息}
GET
user/postbox/list
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| page | 页数 | N | 默认1 |
| count | 每页显示的条数 | N | 默认5 |
Response
{"message": "操作成功","data": {"total": 1,"per_page": 5,"current_page": 1,"last_page": 1,"next_page_url": null,"prev_page_url": null,"from": 1,"to": 1,"data": [{"id": 9,"action": 0, //查看下表"content": null,"target_id": null, //目标id"target_type": null, //查看下表"sender_id": 15,"user_id": 20,"is_read": 0, //是否已经阅读 0否 / 1是"created_at": 1493364123,"sender": { //消息发起者,如私信发送人"id": 15,"first_name": "shelter","last_name": "ya"},"project": { //当目标为项目时,有此值"id": 12,"name": "xxxx","cover_pic": "xxx","bio": "xxxx",}}]}}
| ACTION | 值 | 备注 |
|---|---|---|
| 有用户关注 | 0 | |
| 有新私信 | 1 | |
| 有项目邀请 | 2 | |
| 有项目有新文件上传 | 3 | |
| 有项目有新的feature文件 | 4 | |
| 有项目完成了 | 5 | |
| 有项目有新成员加入 | 6 | sender 即新成员信息 |
| 有项目有成员退出 | 7 | sender 即退出成员信息 |
| 收到新评论(项目) | 8 |
| TARGET_TYPE | 值 | 备注 |
|---|---|---|
| 项目 | 10 | target_id 即 project_id |
POST
user/project
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_name | 项目名字 | Y | |
| is_public | 是否公开 | Y | 1 是 2 否 (默认) |
| bio | 项目简介 | Y | |
| composition_type | 组成类型 | Y | 1 Keep all Composition rights exclusively 2 Based on a split sheet 3 Equally with other collaborators |
| sound_recording_type | 录音权限 | Y | 1 Share Sound Recording rights based on a split sheet 2 Share Sound Recording rights equally with other collaborators |
Response
status 200
{"message": "操作成功","data": {"id": 6}}
PUT
user/project/{project_id}
ajax header头
Content-Type:application/x-www-form-urlencoded
项目拥有者专用api
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加在url后面 |
| project_name | 项目名字 | N | |
| is_public | 是否公开 | N | 1 是 2 否 |
| bio | 项目简介 | N | |
| composition_type | 组成类型 | N | 1 Keep all Composition rights exclusively 2 Based on a split sheet 3 Equally with other collaborators |
| sound_recording_type | 录音权限 | N | 1 Share Sound Recording rights based on a split sheet 2 Share Sound Recording rights equally with other collaborators |
Response
status 200
{"message": "操作成功"}
POST
user/project/{project_id}/uploadCover
项目拥有者专用api
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加在url后面 |
| cover | 封面图片 | Y | png jpg 不大于2M |
Response
status 200
{"message": "操作成功"}
DELETE
user/project/{project_id}
项目拥有者专用api
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加在url后面 |
Response
status 200
{"message": "操作成功"}
get
user/project
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| type | 类型 | Y | 为以下值: All(默认) Created Joined Released Archive |
| id | 用户id | N | 默认是当前登陆用户 |
| page | 页码 | N | 附加url |
Response
status 200
{"message": "操作成功","data": {"total": 5, //总条数"per_page": 30, //每页展示条数"current_page": 1, //当前页码"last_page": 1,"next_page_url": "","prev_page_url": null,"from": 1, //起始id"to": 5, //最后id"data": [{"id": 4,"is_public": true,"name": "test project","cover_pic": "upload/img/project-cover/ePFCRKQW.jpg","bio": "just test","status": "1", // 1 制作中 2 制作完成"deleted_at": null,"created_at": "1 day ago","composition_type": "1","sound_recording_type": "1","show_sound": "upload/video/project/6/zpIMiaqY.mp3","followers": 0, //关注 数量"has_follower": false //是否已经关注此项目"users": [{"id": 15,"first_name": "shelter","last_name": "ya","profile_pic": "upload/img/user-head/7ZqtihxR.jpg","pivot": {"project_id": 4,"user_id": 15,"role_id": 4,"created_at": "2017-03-30 14:47:33","is_admin": 1}}],"genres": [{"id": 20,"name": "shelter","pivot": {"project_id": 4,"genre_id": 20}}],"pivot": {"user_id": 15,"project_id": 4,"is_admin": 1,"role_id": 4,"created_at": "2017-03-30 14:47:33"}}]}}
get
user/project/{project_id}
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加在url后面 |
Response
status 200
{"message": "操作成功","data": {"id": 4,"is_public": true,"name": "test project","cover_pic": "upload/img/project-cover/ePFCRKQW.jpg","bio": "just test","status": "1", // 1 制作中 2 制作完成"deleted_at": null,"created_at": "19 hours ago","composition_type": "1","sound_recording_type": "1","show_sound": "upload/video/project/6/zpIMiaqY.mp3","followers": 1, //关注项目人数"play_count": 5,"comment_count": 2,"is_admin": true, //是否项目拥有者"is_member": true, //是否项目成员"roles": [{"id": 4,"name": "Music Composer","pivot": {"project_id": 4,"role_id": 4,"note": "aerfasdrfaev", //备注"created_at": "2017-03-30 14:55:17"}},{"id": 6,"name": "Singer","pivot": {"project_id": 4,"role_id": 6,"note": "aerfasdrfaev","created_at": "2017-03-30 14:55:15"}}],"genres": [{"id": 20,"name": "shelter","pivot": {"project_id": 4,"genre_id": 20}},{"id": 21,"name": "Eunice","pivot": {"project_id": 4,"genre_id": 21}},{"id": 22,"name": "Dance-Pop","pivot": {"project_id": 4,"genre_id": 22}}],"instruments": [{"id": 10,"name": "violin","pivot": {"project_id": 4,"instrument_id": 10,"note": "update test", //备注"created_at": "2017-04-07 11:24:09"}}],"users": [{"id": 15,"first_name": "shelter","last_name": "ya","email": "2581318149@qq.com","profile_pic": "upload/img/user-head/7ZqtihxR.jpg","pivot": {"project_id": 4,"user_id": 15,"role_id": null, //用户担任的角色id"created_at": "2017-03-30 14:47:33","is_admin": 1 //是否项目管理员},"roles_in_project": [ //用户担任的角色{"id": 4,"name": "Music Composer","pivot": {"user_id": 15,"role_id": 4}}]}]}}
POST
user/project/{project_id}/updateOther
项目拥有者专用api
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| role_ids | 所需角色id | N | 将用户选中的id 拼接起来 eg. 1,2,3,4, |
| instrument_ids | instrument ids | N | 将用户选中的id 拼接起来 eg. 1,2,3,4, |
| genre_ids | 风格id | N | 将用户选中的id 拼接起来 eg. 1,2,3,4, |
Response
status 200
{"message": "操作成功"}
GET
user/project/{project_id}/finish
项目拥有者专用api
项目必须存在 feature mix 文件
Response
status 200
{"message": "操作成功"}
GET
user/project/{project_id}/role
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加在url后面 |
Response
status 200
{"message": "操作成功","data": [{"id": 4,"name": "Music Composer","note": "update test 2"}]}
POST
user/project/{project_id}/role
项目拥有者专用api
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加在url后面 |
| role_id | 角色ID | Y | |
| note | 备注 | N | 最长128字节 |
Response
status 200
{"message": "操作成功"}
PUT
user/project/{project_id}/role/{role_id}
ajax header头
Content-Type:application/x-www-form-urlencoded
项目拥有者专用api
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加在url后面 |
| role_id | 角色 id | Y | 附加在url后面 |
| note | 备注 | N | 修改的备注内容 |
Response
status 200
{"message": "操作成功"}
DELETE
user/project/{project_id}/role/{role_id}
项目拥有者专用api
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加在url后面 |
| role_id | 角色 id | Y | 附加在url后面 |
Response
status 200
{"message": "操作成功"}
GET
user/project/{project_id}/role/listRoleExpectHas
项目拥有者专用api
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加在url后面 |
Response
status 200
{"message": "操作成功","data": [{"id": 5,"name": "Lyricist"}]}
GET
user/project/{project_id}/genre
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加在url后面 |
Response
status 200
{"message": "操作成功","data": [{"id": 8,"name": "genre 3"}]}
POST
user/project/{project_id}/genre
项目拥有者专用api
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加在url后面 |
| genre_id | 风格ID | Y |
Response
status 200
{"message": "操作成功"}
DELETE
user/project/{project_id}/genre/{genre_id}
项目拥有者专用api
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加在url后面 |
| genre_id | 风格ID | Y | 附加在url后面 |
Response
status 200
{"message": "操作成功"}
GET
user/project/{project_id}/genre/listGenreExceptHas
项目拥有者专用api
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加在url |
Response
status 200
{"message": "操作成功","data": [{"id": 12,"name": "Classical","children": {"1": {"id": 20,"name": "shelter"}},{"id": 7,"name": "Blues","children": null}]}
GET
user/project/{project_id}/instrument
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加在url后面 |
Response
status 200
{"message": "操作成功","data": [{"id": 10,"name": "violin","note": "xxxx"}]}
POST
user/project/{project_id}/instrument
项目拥有者专用api
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加在url后面 |
| instrument_id | instrument ID | Y | |
| note | 备注 | N | 默认空 |
Response
status 200
{"message": "操作成功"}
PUT
user/project/{project_id}/instrument/{instrument_id}
ajax header头
Content-Type:application/x-www-form-urlencoded
项目拥有者专用api
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加在url后面 |
| instrument_id | instrument id | Y | 附加在url后面 |
| note | 备注 | N | 修改的备注内容 |
Response
status 200
{"message": "操作成功"}
DELETE
user/project/{project_id}/instrument/{instrument_id}
项目拥有者专用api
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加在url后面 |
| instrument_id | instrument id | Y | 附加在url后面 |
Response
status 200
{"message": "操作成功"}
GET
user/project/{project_id}/instrument/listInstrumentExceptHas
项目拥有者专用api
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加在url |
Response
status 200
{"message": "操作成功","data": [{"id": 9,"name": "piano"}]}
GET
user/project_mixes_type
Response
status 200
{"message": "操作成功","data": {"10": "Engineering","11": "Engineering-Mastering","12": "Engineering-Mixing","13": "Engineering-Scratch Bedtrack","14": "Engineering-Scratch Demo"}}
GET
user/project_document_type
Response
status 200
{"message": "操作成功","data": {"20": "Songwriting","21": "Songwriting-Arrangement","22": "Songwriting-Lyrics"}}
POST
user/project/{project_id}/uploadVideo
项目成员允许
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加在url |
| file | 文件 | Y | 'wav', 'aif', 'flac', 'mp3', 'mid', 'ma4' 格式 最大10M |
| type | 上传类型 | N | seps、mixes |
| name | 为文件命名 | N | file_id为空时,必须 |
| instrument_id | 乐器ID | N | 当type为seps时,必须 |
| mix_id | miexs id | N | 当type为mixes时,必须 调用得到Mixes类型接口得到此id |
| file_id | 文件id | N | 当提交高版本的文件时,传递此字段 上面四个字段会失效 |
Response
status 200
{"message": "操作成功","data": {"path": "upload/video/project/4/dWIKUJaI.WAV"}}
POST
user/project/{project_id}/uploadDocument
项目成员允许
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加在url |
| file | 文件 | Y | 'pdf', 'txt', 'midi' 格式 最大10M |
| name | 文件名字 | N | 当file_id不存在时,必须 |
| document_type_id | 文件类型 | N | 当file_id不存在时,必须 调用得到Document类型接口得到此id |
| file_id | 文件id | N | 当提交高版本的文件时,传递此字段,上面2个字段会失效 |
Response
status 200
{"message": "操作成功","data": {"path": "upload/video/project/4/ho6wWyQM.txt"}}
POST
user/project/{project_id}/uploadIMG
项目成员允许
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加在url |
| file | 文件 | Y | 'png', 'jpg', 'gif' 格式 最大10M |
| name | 文件名字 | N | 当file_id不存在时,必须 |
| file_id | 文件id | N | 当提交高版本的文件时,传递此字段 |
Response
status 200
{"message": "操作成功"}
GET
user/project/{project_id}/file
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附于url |
| type | 类型 | N | 为下列值: All(默认) Mixes Seps Documents |
Response
当不是All的时候,统一以下格式
status 200
{"message": "操作成功","data": [{"name": "Piano", //这里是分类,seps mixes documents 都有自己的子类。"data": [ //子类下的文件{"id": 1,"type": 1,"name": "test file","status": 0, //是否已经完成 0否 1是"is_featured": 0, //是否被采用 0否 1是"instrument_id": 9,"mix_id": null,"document_type_id": null,"created_at": "1 week ago","project_id": 4,"user_id": 15,"user": {"id": 15,"first_name": "shelter","last_name": "ya","profile_pic": "upload/img/user-head/7ZqtihxR.jpg"}}]},{"name": "Saxophone","data": [] //有可能为空 空直接可以参照那个平台,不显示}]}
当为All类型的时候
{"message": "操作成功","data": {"Seps": [ //分类{"name": "Piano", //子分类"data": [ //这里面的字段,跟上面一样{"id": 1,"type": 1,"name": "test file","status": 0,"is_featured": 0,"instrument_id": 9,"mix_id": null,"document_type_id": null,"created_at": "1 week ago","project_id": 4,"user_id": 15,"user": {"id": 15,"first_name": "shelter","last_name": "ya","profile_pic": "upload/img/user-head/7ZqtihxR.jpg"}}]}],"Mixes": [{"name": "Engineering-Mixing","data": [{"id": 9,"type": 2,"name": "test file 7","status": 0,"is_featured": 0,"instrument_id": null,"mix_id": 12,"document_type_id": null,"created_at": "1 week ago","project_id": 4,"user_id": 15,"user": {"id": 15,"first_name": "shelter","last_name": "ya","profile_pic": "upload/img/user-head/7ZqtihxR.jpg"}}]}],"Documents": [{"name": "Songwriting","data": [{"id": 12,"type": 3,"name": "test document 1","status": 0,"is_featured": 0,"instrument_id": null,"mix_id": null,"document_type_id": 20,"created_at": "1 week ago","project_id": 4,"user_id": 15,"user": {"id": 15,"first_name": "shelter","last_name": "ya","profile_pic": "upload/img/user-head/7ZqtihxR.jpg"}}]}]}}
GET
user/project/{project_id}/file/{file_id}/listVersion
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目 id | Y | 附于url |
| file_id | 文件 id | Y | 附于url |
Response
status 200
{"message": "操作成功","data": ["project_base_info": { //项目基本信息"id": 6,"name": "test project 2","cover_pic": "","bio": "just test"},"version": [{"id": 12, //version_id 删除的时候会用到"path": "upload/video/project/4/ho6wWyQM.txt", //各个版本路径"version": 1,"file_id": 12}]}
DELETE
user/project/{project_id}/file/{file_id}
ajax header头
Content-Type:application/x-www-form-urlencoded
必须项目管理员才可调用此api,否则会报错,返回401
删除后,服务器会删除资源,不可恢复,需要提醒管理员
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目 id | Y | 附于url |
| file_id | 文件 id | Y | 附于url |
| type | 删除类型 | Y | 为以下值: file 删除某个文件以及所有版本 file_version 删除文件中的某个版本 |
| version_id | 版本id | N | 当tpye == file_version 时,必须 |
GET
user/project/{project_id}/file/{file_id}/finish
文件上传者才可以调用此api,不然会没有任何效果。
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目 id | Y | 附于url |
| file_id | 文件 id | Y | 附于url |
Response
status 200
{"message": "操作成功"}
GET
user/project/{project_id}/file/{file_id}/feature
项目admin 才可以调用此api,不然会没有任何效果。
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目 id | Y | 附于url |
| file_id | 文件 id | Y | 附于url |
Response
status 200
{"message": "操作成功"}
POST
user/projectLike
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y |
Response
status 200
{"message": "操作成功"}
DELETE
user/projectLike/{project_id}
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加url |
Response
status 200
{"message": "操作成功"}
GET
user/projectLike
Response
status 200
{"message": "操作成功","data": [{"id": 18,"is_public": true,"name": "test3","cover_pic": "upload/img/project-cover/m1A2ttm0.jpg","bio": "test3","status": "1","deleted_at": null,"created_at": "1 hour ago","composition_type": "3","sound_recording_type": "1","followers": 1, //关注人数"play_count": 0, //播放次数"pivot": {"user_id": 15,"project_id": 18},"genres": [{"id": 20,"name": "shelter","pivot": {"project_id": 18,"genre_id": 20}}]}]}
GET
user/project/{project_id}/nominator
项目管理员才能调用此api
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| page | 页数 | N | 默认第一页 |
Response
{"message": "操作成功","data": {"total": 2, //总条数"per_page": 15, //每页显示的条数"current_page": 1, //当前页"last_page": 1,"next_page_url": null,"prev_page_url": null,"from": 1,"to": 2,"data": [{"id": 16,"first_name": "June","last_name": "ya","profile_pic": "upload/img/user-head/2Ovb4jiN.jpg", //默认空字符串"genres": [{"id": 20,"name": "Romance","pivot": {"user_id": 16,"genre_id": 20}}],"roles": [{"id": 5,"name": "Lyricist","pivot": {"user_id": 16,"role_id": 5}}],"instruments": [{"id": 9,"name": "Piano","pivot": {"user_id": 16,"instrument_id": 9}}]}]}}
POST
user/project/{project_id}/invite
项目管理员才能调用此api
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加url |
| user_id | 邀请的用户Id | Y | 推过推荐api获得 |
| note | 留言 | N | 最大128 |
Response
{"message": "操作成功"}
GET
user/project_invite
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| type | 项目id | N | 为以下值: 1 收到的邀请(默认) 2 发出的申请 |
Response
{"message": "操作成功","data": [{"project_id": 20,"user_id": 16,"note": "Do you want to join our team?","created_at": "4 hours ago","is_agree": 1, //是否同意邀请 0 默认 1 已同意 2 拒绝"project": { //project 信息"id": 20,"name": "add new fields", //project name"cover_pic": "","bio": "just test" //project 简介}}]}
GET
user/project/{project_id}/invite
项目管理员才能调用此api
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加url |
| type | 项目id | N | 为以下值: 1 发出的邀请(默认) 2 收到的申请 |
Response
{"message": "操作成功","data": [{"project_id": 20,"user_id": 16,"note": "Do you want to join our team?","created_at": "4 hours ago","is_agree": 1, //是否同意邀请 0 默认 1 已同意 2 拒绝"type": "1", // 1 project 邀请用户 2 用户申请 project"user": { //user 信息"id": 16,"email": "582604267@qq.com","first_name": "June","last_name": "ya","profile_pic": "upload/img/user-head/2Ovb4jiN.jpg"}}]}
GET
user/project/{project_id}/agreeInvite
注意判断invite 消息的 status,同意已经同意的邀请,会返回422错误。
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加url |
Response
{"message": "操作成功"}
GET
user/project/{project_id}/disagreeInvite
注意判断invite 消息的 status,拒绝已经拒绝的邀请,会返回422错误。
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加url |
Response
{"message": "操作成功"}
GET
user/project/{project_id}/quit
管理员不可退出项目
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加url |
Response
{"message": "操作成功"}
DELETE
user/project_invite
ajax header头
Content-Type:application/x-www-form-urlencoded
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| ids | 选中的 project ids | Y | 用逗号隔开,如 1,2,3,4 |
Response
{"message": "操作成功"}
DELETE
user/project/{project_id}/invite
ajax header头
Content-Type:application/x-www-form-urlencoded
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目ID | Y | 附于 url 上 |
| ids | 选中的 ids | Y | 用逗号隔开,如 1,2,3,4 |
Response
{"message": "操作成功"}
PUT
user/project/{project_id}/role/set
ajax header头
Content-Type:application/x-www-form-urlencoded
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目ID | Y | 附于 url 上 |
| user_id | 成员 id | Y | |
| role_id | 设置的角色Id | Y | 调用user/project/{project_id}/role得到 |
Response
{"message": "操作成功"}
POST
user/project/{project_id}/apply
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加url |
| note | 自我备注 | N | 用户可以自我描述,提高参与成功率 |
Response
{"message": "操作成功"}
查看此子类第2个api
查看此子类第3个api
GET
user/project/{project_id}/agreeApply/{user_id}
注意判断invite 消息的 is_agree,同意已经同意的申请,会返回422错误。
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加url |
| user_id | 用户id | Y | 附加url |
Response
{"message": "操作成功"}
GET
user/project/{project_id}/disagreeApply/{user_id}
注意判断invite 消息的 is_aggree,拒绝已经拒绝的申请,会返回422错误。
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 附加url |
| user_id | 用户id | Y | 附加url |
Response
{"message": "操作成功"}
POST
user/comment/project
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | |
| content | 评论内容 | Y | 最大126个字 (不够可以调节) 如果是二级评论,建议前面自动拼接 @用户名 |
| emotion | 存放表情 | N | 最大45字节 |
| parent_id | 父级评论 id | N | 此时必须发送 parent_user_id |
| parent_user_id | 父级评论 的发出 用户id | N |
Response
{"message": "操作成功"}
GET
listProjectComment/{project_id}
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目 id | Y | 附于 url |
| page | 页数 | N | 默认第一页 |
| count | 每页显示的条数 | N | 默认10 |
Response
{"message": "操作成功","data": {"total": 2,"per_page": 10,"current_page": 1,"last_page": 1,"next_page_url": null,"prev_page_url": null,"from": 1,"to": 2,"data": [{"id": 18,"parent_id": null,"user_id": 15,"content": "针对项目评论测试","project_id": 5,"version_id": null,"point_start": null,"point_end": null,"emotion": "6666","page": null,"created_at": "4 hours ago","user": {"id": 15,"name": "assassin","profile_pic": "upload/img/user-head/FuXzkWfE.png"},"children": [{"id": 19,"content": "针对项目评论测试","created_at": "4 hours ago","user_id": 15,"emotion": "6666","parent_id": 18,"user": {"id": 15,"name": "assassin","profile_pic": "upload/img/user-head/FuXzkWfE.png"}}]}]}}
POST
user/comment/version
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| project_id | 项目id | Y | 统计数目需要 |
| version_id | 具体文件id | Y | |
| content | 评论内容 | Y | 最大126个字 (不够可以调节) |
| emotion | 存放表情 | N | 最大45字节 |
| point_start | 开始时间 | N | 什么时候开始评论 精确到秒s |
| point_end | 结束时间 | N | 什么时候结束评论 精确到秒。 |
| page | 页数 | N | 针对pdf等文件的评论 |
Response
{"message": "操作成功"}
GET
listVersionComment/{version_id}
| 字段 | 描述 | 是否必须 | 备注 |
|---|---|---|---|
| version_id | 具体文件id | Y | 附于 url |
自动根据评论开始时间排序返回
Response
{"message": "操作成功","data": [{"id": 2,"user_id": 15,"content": "文件评论测试","project_id": null,"version_id": 35,"point_start": 3,"point_end": 10,"emotion": "test", //表情存储"page": null,"created_at": "8 seconds ago","user": { //发起评论的用户的基本信息"id": 15,"name": "assassin", //这里只返回昵称(可增加)"profile_pic": "upload/img/user-head/7ZqtihxR.jpg"}}]}