增加用户信息上报接口
This commit is contained in:
parent
4f1f91e828
commit
d2588bf792
30
doc/api.md
30
doc/api.md
@ -328,6 +328,7 @@
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 9. 用户统计信息
|
### 9. 用户统计信息
|
||||||
|
|
||||||
1. Method: POST
|
1. Method: POST
|
||||||
@ -384,3 +385,32 @@
|
|||||||
"examCount": 21 // 参与挑战数量
|
"examCount": 21 // 参与挑战数量
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 10. 用户信息上报
|
||||||
|
|
||||||
|
1. Method: POST
|
||||||
|
2. URI: /api/:accountid/login
|
||||||
|
|
||||||
|
| 字段 | 说明 |
|
||||||
|
| -------- | -------------------------------------- |
|
||||||
|
| accountid | 帐号id |
|
||||||
|
|
||||||
|
> POST参数
|
||||||
|
|
||||||
|
|
||||||
|
| 字段 | 说明 |
|
||||||
|
| -------- | -------------------------------------- |
|
||||||
|
| nickname | 昵称 |
|
||||||
|
| avatar | 头像 |
|
||||||
|
| sex | 性别 |
|
||||||
|
| country | 国家 |
|
||||||
|
| province | 省份 |
|
||||||
|
| city | 城市 |
|
||||||
|
|
||||||
|
3. Response: JSON
|
||||||
|
|
||||||
|
```js
|
||||||
|
{
|
||||||
|
token: '1231231aasa'
|
||||||
|
}
|
||||||
|
```
|
@ -7,6 +7,7 @@ import { getRandom } from '../../utils/number.util'
|
|||||||
class GameUserController extends BaseController {
|
class GameUserController extends BaseController {
|
||||||
// TODO:: 增加返回未使用的券
|
// TODO:: 增加返回未使用的券
|
||||||
@role('anon')
|
@role('anon')
|
||||||
|
@router('post /api/:accountid/login')
|
||||||
@router('post /weapp/login')
|
@router('post /weapp/login')
|
||||||
async gameUserLogin(req, res) {
|
async gameUserLogin(req, res) {
|
||||||
const {accountId} = req.params
|
const {accountId} = req.params
|
||||||
|
@ -32,7 +32,6 @@ class GameUserClass extends BaseModule {
|
|||||||
public lockedTime?: Date;
|
public lockedTime?: Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const GameUser = getModelForClass(GameUserClass, {existingConnection: GameUserClass.db});
|
export const GameUser = getModelForClass(GameUserClass, {existingConnection: GameUserClass.db});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user