Commit ed3c1e58 authored by Lanseria's avatar Lanseria

update upms

parent e1d1a453
......@@ -26,5 +26,5 @@ $ npm install -g aglio
## 生成
```
$ aglio -i demo/go-game.apib -o demo/go-game.html
$ aglio -i demo/index.apib -o demo/index.html
```
This diff is collapsed.
FORMAT: 1A
HOST: http://localhost:3000
# Go Game
# 接口规范
This is a simple API for a small game server handling the game of Go. For the rules used as a reference when building this application,
方便设计API的文档规范. For the rules used as a reference when building this application,
see [The Rules of Go](https://en.wikipedia.org/wiki/Rules_of_go)
# Group upms
A match is the unit of active gameplay within Go. Each match is assigned a unique GUID upon creation, and all references to the match
via this API are thereafter keyed by the match ID.
这是个例子用UMPS用户模块来说明通用接口规范如何定义
## upms user
The matches collection represents the matches currently ongoing being handled by the server at the time. It does not cover historical access to old game records.
用户模块
### user page [GET /admin/user/page]
### user page [GET /admin/user/page{?current,size,other}]
用户分页.
用户分页
+ Parameters
+ current (number, optional) - 当前页
+ Default: `1`
+ size (number, optional) - 每页几条
+ Default: `20`
+ other (number, optional) - 这里是搜索参数, 如 `username` 用户名搜索.
+ Default: `张超`
+ Response 200 (application/json)
......@@ -27,13 +35,22 @@ The matches collection represents the matches currently ongoing being handled by
用户新增.
+ Request (application/json)
{
"username" : "zhangchao",
"playerWhite" : "bob",
"playerBlack" : "alfred"
}
+ Response 200 (application/json)
{"code":0,"msg":"success","data":true}
### delete user [POST /admin/user/delete/{id}]
Liberties are positions adjacent to a player chain. You might use this resource if your game client implements a hint or cheat functionality that highlights potential positions onto which a player can place a stone.
用户删除
+ Parameters
......@@ -44,15 +61,19 @@ Liberties are positions adjacent to a player chain. You might use this resource
{"code":0,"msg":"success","data":true}
### update user [POST /admin/user/update/{id}]
### update user [POST /admin/user/update]
A chain is a list of adjacent stones. See Go rules for a definition of adjacent. Note that a single stone can be considered a chain.
You might want to use this resource if your game client implements handy functionality that might highlight any
given player's chains to aid them in strategy.
+ Parameters
+ id: `6` (string) - The id of the user.
+ Response 200 (application/json)
用户更新
+ Request (application/json)
{
"id": 1,
"username" : "zhangchao",
"playerWhite" : "bob",
"playerBlack" : "alfred"
}
+ Response 200 (application/json)
{"code":0,"msg":"success","data":true}
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment