diff --git a/docs/api.md b/docs/api.md index dc3c754..d3b1ce6 100644 --- a/docs/api.md +++ b/docs/api.md @@ -479,32 +479,6 @@ ``` -### 18. 开始比赛 -1. Method: POST -2. URI: /api/:accountid/beginmatch - -| 字段 | 说明 | -| -------- | -------------------------------------- | -| accountid | 帐号id | - -> POST参数 - - -| 字段 | 说明 | -| -------- | -------------------------------------- | -| matchid |10_match.xlsx里的id | - - -3. Response: JSON - -```js -{ - ticket: '123123123' //匹配的时候须带上此ticket -} - -``` - - @@ -525,6 +499,28 @@ ``` +### 2. 开始比赛 +1. Method: POST +2. URI: /svr/:accountid/beginmatch + +| 字段 | 说明 | +| -------- | -------------------------------------- | +| accountid | 帐号id | + +> POST参数 + + +| 字段 | 说明 | +| -------- | -------------------------------------- | +| matchid |10_match.xlsx里的id | + + +3. Response: JSON + +```js + +``` + diff --git a/src/controllers/MatchController.ts b/src/controllers/MatchController.ts index 9a5f292..15d56ad 100644 --- a/src/controllers/MatchController.ts +++ b/src/controllers/MatchController.ts @@ -7,7 +7,7 @@ import { BagItem } from '../models/BagItem' export default class MatchController extends BaseController { - @router('post /api/:accountid/beginmatch') + @router('post /svr/:accountid/beginmatch') async beginMatch(req: any) { let {accountid, matchid} = req.params let cfg: MatchCfg = global.$cfg.get(BaseConst.MATCH).get(matchid << 0) @@ -26,6 +26,6 @@ export default class MatchController extends BaseController { } record.count -= count await record.save() - return {ticket: '123123123123'} + return {} } }