def get_code(self, bid, gtype): """ 获取兑换码 :param bid: :return: """ s = RedeemCodeServer(bid) return s.get_codes(1, gtype)
def get_codes(self, bid, quantity, gtype): """ 获取指定数量兑换码 :param bid: :param quantity: :return: """ s = RedeemCodeServer(bid) return s.get_codes(quantity, gtype)
def load_codes(self, bid, codes): """ 加载兑换码 :param bid: :param codes: :param mark: :return: """ s = RedeemCodeServer(bid) return s.load_codes(codes)
def code_redeem(self, bid, code): """ 兑换码使用、销毁 :param bid: :param code: :return: """ s = RedeemCodeServer(bid) rnum = s.code_redeem(code) return True if rnum else False
def create_codes(self, bid, quantity, bits, ctype, mark): """ 生成兑换码 :param bid: :param quantity: :param bits: :param ctype: :param mark: :return: """ s = RedeemCodeServer(bid) return s.create_codes(quantity, bits, ctype, mark)