
from django.conf import settings


# class SsdbHelper(object):
#
#     TYPE_DIARY = "diary"
#     TYPE_ANSWER = "answer"
#     TYPE_ARTICLE = "article"
#
#     def __init__(self, ssdb_client):
#         self.ssdb_client = ssdb_client
#
#     @classmethod
#     def getQueueKey(cls, type, device_id, read=False):
#         """
#
#         :param type:
#         :param device_id:
#         :param read:
#         :return:
#         """
#         return "{}:{}:{}:{}".format(settings.FEED_CACHE_VERSION, type, device_id, int(read))
#
#     @staticmethod
#     def getZsetKey(element_id, content_level, city_id):
#         """
#
#         :param element_id:
#         :param content_level:
#         :param city_id:
#         :return:
#         """
#         return "{}:{}:{}".format(element_id, content_level, city_id)
#
#     def updateCache(self, key, kv_tuple):
#         self.ssdb_client.zclear(key)
#         v = []
#         for i in kv_tuple:
#             v.append(i[0])
#             v.append(i[1])
#         if len(v):
#             print(key, v)
#             self.ssdb_client.multi_zset(key, *v)
