From d2588bf792369b524a252993eb35aa51ce3e77b8 Mon Sep 17 00:00:00 2001 From: zhl Date: Thu, 20 May 2021 16:11:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=A8=E6=88=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E4=B8=8A=E6=8A=A5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/api.md | 30 +++++++++++++++++++++ src/api/controllers/game_user.controller.ts | 1 + src/models/GameUser.ts | 1 - 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/doc/api.md b/doc/api.md index 747f89e..3ea47fc 100644 --- a/doc/api.md +++ b/doc/api.md @@ -328,6 +328,7 @@ ``` + ### 9. 用户统计信息 1. Method: POST @@ -384,3 +385,32 @@ "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' +} +``` \ No newline at end of file diff --git a/src/api/controllers/game_user.controller.ts b/src/api/controllers/game_user.controller.ts index 53e3d10..b52355c 100644 --- a/src/api/controllers/game_user.controller.ts +++ b/src/api/controllers/game_user.controller.ts @@ -7,6 +7,7 @@ import { getRandom } from '../../utils/number.util' class GameUserController extends BaseController { // TODO:: 增加返回未使用的券 @role('anon') + @router('post /api/:accountid/login') @router('post /weapp/login') async gameUserLogin(req, res) { const {accountId} = req.params diff --git a/src/models/GameUser.ts b/src/models/GameUser.ts index 5eb18bb..d5e2961 100644 --- a/src/models/GameUser.ts +++ b/src/models/GameUser.ts @@ -32,7 +32,6 @@ class GameUserClass extends BaseModule { public lockedTime?: Date; - } export const GameUser = getModelForClass(GameUserClass, {existingConnection: GameUserClass.db});