将开始匹配接口改为服务端调用
This commit is contained in:
parent
5baf4ddeb5
commit
32f91d29cd
48
docs/api.md
48
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
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -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 {}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user