1.更新平台对接文档

This commit is contained in:
2026-05-25 09:57:48 +08:00
parent cde5a851e5
commit 77db2357ba
4 changed files with 99 additions and 32 deletions

View File

@@ -19,6 +19,7 @@
- **请求方法**:项目路由多数使用 `Route::any`,对接建议统一使用 **POST**(便于 body 传参);个别接口文档中标注了 GET 参数。
- **编码**`UTF-8`
- **Content-Type**:建议 `application/x-www-form-urlencoded``application/json`(以平台实际实现为准)
- **必带凭证**:所有 `/api/v1/*` 接口均需带 `api-key`(与服务端 `.env``API_KEY` 一致);除 `/api/v1/authToken` 外另需 `auth-token`。详见 §2.2。
### 1.3 统一返回结构
@@ -127,7 +128,7 @@ signature = md5(agent_id + secret + time)
- **路径**`/api/v1/getGameUrl`
- **方法**POST
- **请求头**`auth-token`
- **请求头**`api-key``auth-token`
- **说明**:根据平台用户名创建/登录玩家并生成登录 JWT返回可直接打开的游戏地址。
#### 请求参数body
@@ -155,7 +156,7 @@ signature = md5(agent_id + secret + time)
- **路径**`/api/v1/getPlayerInfo`
- **方法**POST
- **请求头**`auth-token`
- **请求头**`api-key``auth-token`
#### 请求参数
@@ -171,7 +172,7 @@ signature = md5(agent_id + secret + time)
- **路径**`/api/v1/getPlayerGameRecord`
- **方法**POST
- **请求头**`auth-token`
- **请求头**`api-key``auth-token`
#### 请求参数
@@ -192,7 +193,7 @@ signature = md5(agent_id + secret + time)
- **路径**`/api/v1/getPlayerWalletRecord`
- **方法**POST
- **请求头**`auth-token`
- **请求头**`api-key``auth-token`
参数与时间规则同 3.3(无 `page`,仅 `limit` 限制条数),返回钱包流水列表(附带 `dice_player`)。
@@ -200,7 +201,7 @@ signature = md5(agent_id + secret + time)
- **路径**`/api/v1/getPlayerTicketRecord`
- **方法**POST
- **请求头**`auth-token`
- **请求头**`api-key``auth-token`
参数与时间规则同 3.3,返回中奖券记录列表(附带 `dice_player`)。
@@ -208,7 +209,7 @@ signature = md5(agent_id + secret + time)
- **路径**`/api/v1/setPlayerWallet`
- **方法**POST
- **请求头**`auth-token`
- **请求头**`api-key``auth-token`
- **说明**:平台为玩家加币/扣币,生成钱包流水。
#### 请求参数
@@ -267,9 +268,9 @@ signature = md5(agent_id + secret + time)
| --- | --- | --- |
| 200 | 成功 | 请求成功 |
| 400 | 请求参数错误 | 缺参、参数格式不合法、范围错误 |
| 401 | 未授权 | 未携带 `auth-token``token` |
| 401 | 未授权 | 未携带 `api-key``auth-token``token` |
| 402 | token 无效或已过期 | `auth-token/token` 过期、签名错误、被挤下线等 |
| 403 | 鉴权失败 | `secret` 错误、签名验证失败、时间戳无效等 |
| 403 | 鉴权失败 | `api-key` 无效、`secret` 错误、签名验证失败、时间戳无效等 |
| 404 | 资源不存在 | 用户不存在等 |
| 422 | 业务逻辑错误 | 余额不足、业务校验失败等 |
| 500 | 服务器内部错误 | 服务端异常或配置缺失 |