From 32f91d29cd3f59e2a7584907d87d190f2577871a Mon Sep 17 00:00:00 2001 From: zhl Date: Fri, 22 Jan 2021 14:08:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E5=BC=80=E5=A7=8B=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=94=B9=E4=B8=BA=E6=9C=8D=E5=8A=A1=E7=AB=AF?= =?UTF-8?q?=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/api.md | 48 ++++++++++++++---------------- src/controllers/MatchController.ts | 4 +-- 2 files changed, 24 insertions(+), 28 deletions(-) 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 {} } }