目录 定义 说明 身份验证 接口定义注册 (/use...">
美文网首页
2019-03-06

2019-03-06

作者: 我就是杨过 | 来源:发表于2019-03-06 16:14 被阅读0次

<span id="table-of-contents" />目录

<span id="define"></span>定义

  • Host: http://api.test.findxapp.com
  • Path: 资源地址,根据接口不同
  • Params: 参数列表
  • Token: 登录用户的唯一标识(token={token} 形式附加到header里)

Back to TOC

<span id="description"></span>说明

  1. 接口请求方式: curl [-G] {Host}+{Path} -d {Params}
  2. 返回数据格式: JSON (接口只定义data内的内容)
    {
        "meta":{
            "code":2000,
            "message":"操作成功"
        },
        "data":[]
    }
  1. 通用header: token

Back to TOC

<span id="auth"></span>身份验证

  1. /user/register 或者 /user/login 获取token
  2. 需要验证的接口附加token, 如,curl -H "token: {token}"

Back to TOC


<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

Back to TOC

<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

Back to TOC

<span id="/user/info-GET"></span>用户信息(别人看到的)

/user/info GET

Params

Arg Type Desc Require
uid int 用户ID

Returns

Arg Type Desc Require
friend Friend 用户信息

Back to TOC

<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> 列表

Back to TOC

<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> 列表

Back to TOC

<span id="/play/detail-GET"></span>剧本详情

/play/detail GET

Params

Arg Type Desc Require
id int 剧本ID

Returns

Arg Type Desc Require
play Play 剧本

Back to TOC

<span id="/play/buy-POST"></span>购买剧本

/play/buy POST

Params

Arg Type Desc Require
playId int 剧本ID

Returns

Arg Type Desc Require

Back to TOC

<span id="/play/collect-POST"></span>收藏

/play/collect POST

Params

Arg Type Desc Require
playId int 剧本ID

Returns

Arg Type Desc Require

Back to TOC

<span id="/play/collection-GET"></span>收藏列表

/play/collection GET

Params

Arg Type Desc Require

Returns

Arg Type Desc Require
plays array<Play> 列表

Back to TOC

<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 房间信息

Back to TOC

<span id="/room/choose/play-POST"></span>选择剧本

/room/choose/play POST

Params

Arg Type Desc Require
playId int 剧本ID

Returns

Arg Type Desc Require

Back to TOC

<span id="/room/info-POST"></span>房间信息

/room/info POST

Params

Arg Type Desc Require

Returns

Arg Type Desc Require
room Room 房间信息

Back to TOC

<span id="/room/join-POST"></span>加入房间

/room/join POST

Params

Arg Type Desc Require
id int 房间ID

Returns

Arg Type Desc Require
room Room 房间信息

Back to TOC

<span id="/room/ready-POST"></span>准备

/room/ready POST

Params

Arg Type Desc Require

Returns

Arg Type Desc Require

Back to TOC

<span id="/room/start-POST"></span>开始游戏

/room/start POST

Params

Arg Type Desc Require

Returns

Arg Type Desc Require

Back to TOC

<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 真相

Back to TOC

<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> 投票结果列表

Back to TOC

<span id="/room/play/character-POST"></span>选角色

/room/play/character POST

Params

Arg Type Desc Require
roleId int 角色ID

Returns

Arg Type Desc Require

Back to TOC

<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 线索

Back to TOC

<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> 线索列表

Back to TOC

<span id="/room/clue/public-POST"></span>公开线索

/room/clue/public POST

Params

Arg Type Desc Require
clueId int 线索ID

Returns

Arg Type Desc Require

Back to TOC

<span id="/room/clue/archive-POST"></span>回收线索

/room/clue/archive POST

Params

Arg Type Desc Require
clueId int 线索ID

Returns

Arg Type Desc Require

Back to TOC

<span id="/room/clue/cancelArchive-POST"></span>取消回收线索

/room/clue/cancelArchive POST

Params

Arg Type Desc Require
clueId int 线索ID

Returns

Arg Type Desc Require

Back to TOC

<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

Back to TOC

<span id="/room/continue-GET"></span>继续游戏 --- 待完成

/room/continue GET

Params

Arg Type Desc Require

Returns

Arg Type Desc Require

Back to TOC

<span id="/room/kickout-POST"></span>踢人

/room/kickout POST

Params

Arg Type Desc Require
uid int 踢出的用户ID

Returns

Arg Type Desc Require

Back to TOC

<span id="/room/leave-POST"></span>离开房间(不包括投票解散)

/room/leave POST

Params

Arg Type Desc Require

Returns

Arg Type Desc Require

Back to TOC


<span id="model"></span>Model 列表

Clue
Play
Room
User
Vote
Scene
Truth
Friend
Player
Discuss
Process
VoteInfo
Character
Storyline

Back to TOC

<span id="errorcode"></span>错误码

Arg Type Value Desc
SUCCESS int 2000 操作成功
NOTFOUND int 404 接口错误
FAILED int 500 服务器错误

Back to TOC

相关文章

网友评论

      本文标题:2019-03-06

      本文链接:https://www.haomeiwen.com/subject/wyhxpqtx.html