兑换码 - GiftCodeService
礼包/兑换码业务接口
sgt.GiftCodeService.getGiftByCode(code, callback)
- code: string 兑换码
- callback: Function 回调函数
- return: Gift 礼包详情
通过兑换码获取礼包详情
sgt.GiftCodeService.getGifts(callback)
- callback: Function 回调函数
- return: Gift[] 有效的礼包集合
获取有效的礼包
sgt.GiftCodeService.getRecord(playerId, giftId, start, limit, callback)
- playerId: string 角色ID
- giftId: string 礼包ID
- start: number 起始页码
- limit: number 每页显示条目数
- callback: Function 回调函数
- return: GiftRecord[] GiftRecord集合
获取兑换记录, playerId和giftId至少有一个不为空。 playerId为null则返回该礼包的所有记录 giftId为null则返回该角色所有兑换记录
sgt.GiftCodeService.redeem(playerId, giftId, code, callback)
- playerId: string 角色ID
- giftId: string 礼包ID
- code: string 兑换码
- callback: Function 回调函数
- return: string 奖品
兑换并返回奖品
sgt.GiftCodeService.redeemGiftByCodeOverMail(playerId, code, callback)
- playerId: string 角色ID
- code: string 兑奖码
- callback: Function 回调函数
- return: Gift 成功返回gift,失败返回null
兑奖并使用邮件直接发送奖励给角色
sgt.GiftCodeService.redeemOverMail(playerId, giftId, code, callback)
- playerId: string 角色ID
- giftId: string 礼包ID
- code: string 兑换码
- callback: Function 回调函数
- return: null
兑换奖励,奖励通过邮件发送