From 2f6d5118729673e7ef5add3c2ebcbeb3e5a0414d Mon Sep 17 00:00:00 2001 From: zhl Date: Fri, 21 May 2021 10:43:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=88=B8=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=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 | 4 +-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/doc/api.md b/doc/api.md index 38a6e1f..19eaff9 100644 --- a/doc/api.md +++ b/doc/api.md @@ -423,4 +423,34 @@ { token: '1231231aasa' } +``` + +### 11. 用户券列表 + +1. Method: POST +2. URI: /api/:accountid/tickets + +| 字段 | 说明 | +| -------- | -------------------------------------- | +| accountid | 帐号id | + +> POST参数 + + +| 字段 | 说明 | +| -------- | -------------------------------------- | +| sid | 店铺id, 不传的话, 获取所有 | + +3. Response: JSON + +```js +{ + id: '记录id', + shop: '店铺id', + shopName: '店铺名', + coupon: '券id', + couponName: '券名', + couponUrl: '券图片url', + status: '状态' //0: 未使用 , 1: 已使用 9: 已过期 +} ``` \ 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 06421ef..0b72207 100644 --- a/src/api/controllers/game_user.controller.ts +++ b/src/api/controllers/game_user.controller.ts @@ -48,8 +48,8 @@ class GameUserController extends BaseController { @role('anon') @router('post /api/:accountid/tickets') async userTickets(req: any) { - const { accountid } = req.params - return await UserReward.ticketList( accountid ) + const { accountid, sid } = req.params + return await UserReward.ticketList( accountid, sid ) } }