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 ) } }