#/usr/bin/env python
# coding: utf-8

from __future__ import unicode_literals, absolute_import, print_function

from api.models.game import GameGoddessClient

def get_discount(user_id, service_id):
    redis_client = GameGoddessClient()
    redis_key = '%s:%s' % (user_id, service_id)
    bargin = redis_client.get(key=redis_key)
    return bargin['total_discount']


def clean_discount(user_id, service_id):
    redis_client = GameGoddessClient()
    redis_key = '%s:%s' % (user_id, service_id)
    bargin = redis_client.delete(key=redis_key)
