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