5416 【工具】兑换码优化(兑换码邮件内容文件json支持不同的appID独立文件配置;)
New file |
| | |
| | | {
|
| | | "VIP666": {
|
| | | "MailSender": "Hệ thống thư",
|
| | | "MailTitle": "<gcode>VIP666 gói quà",
|
| | | "MailText": "Cảm ơn bạn đã hỗ trợ các trò chơi, xin vui lòng nhận được gói quà VIP666.",
|
| | | "Items": [[4680,1],[1128,1],[3801,1,1],[4501,2]],
|
| | | "LV":100,
|
| | | "VIPLV":5,
|
| | | },
|
| | | |
| | | "g001": {
|
| | | "MailSender": "系统邮件",
|
| | | "MailTitle": "<gcode>历史累计返利活动",
|
| | | "MailText": "累积充值1000元返利,感谢您对游戏的支持,请及时领取礼包。",
|
| | | "Items": [[1015,1],[15177,2],[1128,2]],
|
| | | "Prefix":"CuuThien"
|
| | | },
|
| | | |
| | | "h001": {
|
| | | "MailSender": "Hệ thống thư",
|
| | | "MailTitle": "<gcode>gói quà h001",
|
| | | "MailText": "Cảm ơn bạn đã hỗ trợ các trò chơi, xin vui lòng nhận được gói quà h001",
|
| | | "Items": [[1015,10],[15177,20],[1128,20]],
|
| | | "Prefix":"CuuThien"
|
| | | }
|
| | | } |
| | |
| | | PushTimeout = ConfigIO.GetInt("Coupon", "PushTimeout", 5)
|
| | | CommonCards = eval(ConfigIO.GetValue("Coupon", "CommonCards"))
|
| | |
|
| | | g_mailJsonDict = {} # {channel:MailJson, ...}
|
| | | # 发放奖励邮件内容json,utf8编码
|
| | | f = open(os.getcwd() + "\\..\\Coupon\\CodeMail.json", "r")
|
| | | MailJson = eval(f.read())
|
| | | f.close()
|
| | | def GetMailJson(channel):
|
| | | global g_mailJsonDict
|
| | | if channel in g_mailJsonDict:
|
| | | return g_mailJsonDict[channel]
|
| | | jsonPath = os.getcwd() + ("\\..\\Coupon\\CodeMail_%s.json" % channel)
|
| | | if not os.path.isfile(jsonPath):
|
| | | jsonPath = os.getcwd() + "\\..\\Coupon\\CodeMail.json"
|
| | | f = open(jsonPath, "r")
|
| | | MailJson = eval(f.read())
|
| | | f.close()
|
| | | g_mailJsonDict[channel] = MailJson
|
| | | return MailJson
|
| | |
|
| | | # 礼包使用返回结果码定义
|
| | | ErrCode_OK = 0 # 成功,非0的码均代表错误
|
| | |
| | | return SendGm(ErrCode_Invalid, gmresult, pushurl)[1]
|
| | |
|
| | | prefix = "" # 固定前缀
|
| | | MailJson = GetMailJson(agentName)
|
| | | if couponType in MailJson:
|
| | | mailInfo = MailJson[couponType]
|
| | | prefix = mailInfo.get("Prefix", "")
|
| | |
| | | def CommCheck(dataDict, coupontype):
|
| | | ## 通用常规检查
|
| | |
|
| | | MailJson = GetMailJson(dataDict.get("channel", ""))
|
| | | if coupontype in MailJson:
|
| | | mailInfo = MailJson[coupontype]
|
| | | lvLimit = mailInfo.get("LV", 0)
|
| | |
| | | return errcode, CouponCodeResponse(errcode)
|
| | |
|
| | | coupontype = gmresult["coupontype"]
|
| | | MailJson = GetMailJson(gmresult["channel"])
|
| | | if coupontype in MailJson:
|
| | | mailInfo = MailJson[coupontype]
|
| | | mailTitle = mailInfo.get("MailTitle", "MailTitle")
|