<span id="table-of-contents" />目录
- 定义
- 说明
- 身份验证
- 接口定义
-
注册 (
/user/register
POST) -
登录 (
/user/login
POST) -
用户信息(别人看到的) (
/user/info
GET) -
好友列表 (
/friend/list
POST) -
剧本列表 (
/play/list
GET) -
剧本详情 (
/play/detail
GET) -
购买剧本 (
/play/buy
POST) -
收藏 (
/play/collect
POST) -
收藏列表 (
/play/collection
GET) -
创建房间 (
/room/create
POST) -
选择剧本 (
/room/choose/play
POST) -
房间信息 (
/room/info
POST) -
加入房间 (
/room/join
POST) -
准备 (
/room/ready
POST) -
开始游戏 (
/room/start
POST) -
真相页面 (
/room/play/truth
GET) -
复盘 (
/room/play/review
GET) -
选角色 (
/room/play/character
POST) -
探索(获取线索) (
/room/clue/explore
POST) -
获取我的线索 (
/room/clue
GET) -
公开线索 (
/room/clue/public
POST) -
回收线索 (
/room/clue/archive
POST) -
取消回收线索 (
/room/clue/cancelArchive
POST) -
投票 (
/room/play/vote
POST) -
继续游戏 --- 待完成 (
/room/continue
GET) -
踢人 (
/room/kickout
POST) -
离开房间(不包括投票解散) (
/room/leave
POST)
-
注册 (
- Model 列表
- 类型定义 列表
- 错误码
<span id="define"></span>定义
- Host: http://api.test.findxapp.com
- Path: 资源地址,根据接口不同
- Params: 参数列表
- Token: 登录用户的唯一标识(token={token} 形式附加到header里)
<span id="description"></span>说明
- 接口请求方式: curl [-G] {Host}+{Path} -d {Params}
- 返回数据格式: JSON (接口只定义data内的内容)
{
"meta":{
"code":2000,
"message":"操作成功"
},
"data":[]
}
- 通用header: token
<span id="auth"></span>身份验证
- /user/register 或者 /user/login 获取token
- 需要验证的接口附加token, 如,curl -H "token: {token}"
<span id="/user/register-POST"></span>注册
/user/register
POST
Params
Arg | Type | Desc | Require |
---|---|---|---|
mobile | string | 手机号 | 是 |
code | string | 验证码 | 是 |
invite | string | 邀请码 | 是 |
Returns
Arg | Type | Desc | Require |
---|---|---|---|
user | User | 用户信息 | 是 |
token | string | token | 是 |
<span id="/user/login-POST"></span>登录
/user/login
POST
Params
Arg | Type | Desc | Require |
---|---|---|---|
mobile | string | 手机号 | 是 |
Returns
Arg | Type | Desc | Require |
---|---|---|---|
user | User | 用户信息 | 是 |
token | string | token | 是 |
<span id="/user/info-GET"></span>用户信息(别人看到的)
/user/info
GET
Params
Arg | Type | Desc | Require |
---|---|---|---|
uid | int | 用户ID | 是 |
Returns
Arg | Type | Desc | Require |
---|---|---|---|
friend | Friend | 用户信息 | 是 |
<span id="/friend/list-POST"></span>好友列表
/friend/list
POST
Params
Arg | Type | Desc | Require |
---|---|---|---|
offset | int | 偏移量 从0开始 | 否 |
Returns
Arg | Type | Desc | Require |
---|---|---|---|
friends | array<Friend> | 列表 | 是 |
<span id="/play/list-GET"></span>剧本列表
/play/list
GET
Params
Arg | Type | Desc | Require |
---|---|---|---|
playerCnt | int | 剧本人数 0或者不传 all | 否 |
level | int | 难度等级 0或者不传 all | 否 |
pay | int | 是否付费 0 否 1 是 -1或者不传 all | 否 |
offset | int | 偏移量 从0开始 | 否 |
Returns
Arg | Type | Desc | Require |
---|---|---|---|
plays | array<Play> | 列表 | 是 |
<span id="/play/detail-GET"></span>剧本详情
/play/detail
GET
Params
Arg | Type | Desc | Require |
---|---|---|---|
id | int | 剧本ID | 是 |
Returns
Arg | Type | Desc | Require |
---|---|---|---|
play | Play | 剧本 | 是 |
<span id="/play/buy-POST"></span>购买剧本
/play/buy
POST
Params
Arg | Type | Desc | Require |
---|---|---|---|
playId | int | 剧本ID | 是 |
Returns
Arg | Type | Desc | Require |
---|
<span id="/play/collect-POST"></span>收藏
/play/collect
POST
Params
Arg | Type | Desc | Require |
---|---|---|---|
playId | int | 剧本ID | 是 |
Returns
Arg | Type | Desc | Require |
---|
<span id="/play/collection-GET"></span>收藏列表
/play/collection
GET
Params
Arg | Type | Desc | Require |
---|
Returns
Arg | Type | Desc | Require |
---|---|---|---|
plays | array<Play> | 列表 | 是 |
<span id="/room/create-POST"></span>创建房间
/room/create
POST
Params
Arg | Type | Desc | Require |
---|---|---|---|
playId | int | 剧本ID | 是 |
match | int | 是否允许随机匹配 | 是 |
Returns
Arg | Type | Desc | Require |
---|---|---|---|
room | Room | 房间信息 | 是 |
<span id="/room/choose/play-POST"></span>选择剧本
/room/choose/play
POST
Params
Arg | Type | Desc | Require |
---|---|---|---|
playId | int | 剧本ID | 是 |
Returns
Arg | Type | Desc | Require |
---|
<span id="/room/info-POST"></span>房间信息
/room/info
POST
Params
Arg | Type | Desc | Require |
---|
Returns
Arg | Type | Desc | Require |
---|---|---|---|
room | Room | 房间信息 | 是 |
<span id="/room/join-POST"></span>加入房间
/room/join
POST
Params
Arg | Type | Desc | Require |
---|---|---|---|
id | int | 房间ID | 是 |
Returns
Arg | Type | Desc | Require |
---|---|---|---|
room | Room | 房间信息 | 是 |
<span id="/room/ready-POST"></span>准备
/room/ready
POST
Params
Arg | Type | Desc | Require |
---|
Returns
Arg | Type | Desc | Require |
---|
<span id="/room/start-POST"></span>开始游戏
/room/start
POST
Params
Arg | Type | Desc | Require |
---|
Returns
Arg | Type | Desc | Require |
---|
<span id="/room/play/truth-GET"></span>真相页面
/room/play/truth
GET
Params
Arg | Type | Desc | Require |
---|
Returns
Arg | Type | Desc | Require |
---|---|---|---|
iswin | int | 选择是否正确 | 是 |
truth | Truth | 真相 | 是 |
<span id="/room/play/review-GET"></span>复盘
/room/play/review
GET
Params
Arg | Type | Desc | Require |
---|
Returns
Arg | Type | Desc | Require |
---|---|---|---|
exp | int | 获得积分 | 是 |
coin | int | 获得金币 | 是 |
votes | array<Vote> | 投票结果列表 | 是 |
<span id="/room/play/character-POST"></span>选角色
/room/play/character
POST
Params
Arg | Type | Desc | Require |
---|---|---|---|
roleId | int | 角色ID | 是 |
Returns
Arg | Type | Desc | Require |
---|
<span id="/room/clue/explore-POST"></span>探索(获取线索)
/room/clue/explore
POST
Params
Arg | Type | Desc | Require |
---|---|---|---|
sceneId | int | 场景ID | 是 |
Returns
Arg | Type | Desc | Require |
---|---|---|---|
clue | Clue | 线索 | 是 |
<span id="/room/clue-GET"></span>获取我的线索
/room/clue
GET
Params
Arg | Type | Desc | Require |
---|---|---|---|
type | int | 类型 1 我的 2 公开 3 回收站 | 是 |
Returns
Arg | Type | Desc | Require |
---|---|---|---|
clues | array<Clue> | 线索列表 | 是 |
<span id="/room/clue/public-POST"></span>公开线索
/room/clue/public
POST
Params
Arg | Type | Desc | Require |
---|---|---|---|
clueId | int | 线索ID | 是 |
Returns
Arg | Type | Desc | Require |
---|
<span id="/room/clue/archive-POST"></span>回收线索
/room/clue/archive
POST
Params
Arg | Type | Desc | Require |
---|---|---|---|
clueId | int | 线索ID | 是 |
Returns
Arg | Type | Desc | Require |
---|
<span id="/room/clue/cancelArchive-POST"></span>取消回收线索
/room/clue/cancelArchive
POST
Params
Arg | Type | Desc | Require |
---|---|---|---|
clueId | int | 线索ID | 是 |
Returns
Arg | Type | Desc | Require |
---|
<span id="/room/play/vote-POST"></span>投票
/room/play/vote
POST
Params
Arg | Type | Desc | Require |
---|---|---|---|
ids | array<int> | 用户ID数组 | 是 |
Returns
Arg | Type | Desc | Require |
---|
<span id="/room/continue-GET"></span>继续游戏 --- 待完成
/room/continue
GET
Params
Arg | Type | Desc | Require |
---|
Returns
Arg | Type | Desc | Require |
---|
<span id="/room/kickout-POST"></span>踢人
/room/kickout
POST
Params
Arg | Type | Desc | Require |
---|---|---|---|
uid | int | 踢出的用户ID | 是 |
Returns
Arg | Type | Desc | Require |
---|
<span id="/room/leave-POST"></span>离开房间(不包括投票解散)
/room/leave
POST
Params
Arg | Type | Desc | Require |
---|
Returns
Arg | Type | Desc | Require |
---|
<span id="model"></span>Model 列表
Clue
Play
Room
User
Vote
Scene
Truth
Friend
Player
Discuss
Process
VoteInfo
Character
Storyline
<span id="errorcode"></span>错误码
Arg | Type | Value | Desc |
---|---|---|---|
SUCCESS | int | 2000 | 操作成功 |
NOTFOUND | int | 404 | 接口错误 |
FAILED | int | 500 | 服务器错误 |
网友评论