签到功能加入了总天数记录。
This commit is contained in:
@@ -84,7 +84,8 @@ class SignInRedisDB:
|
||||
"""增加用户签到总次数"""
|
||||
key = self.get_user_total_sign_count_key(wx_id, group_id)
|
||||
with self.get_redis_connection() as redis_client:
|
||||
return redis_client.incr(key)
|
||||
count = redis_client.incr(key)
|
||||
return count
|
||||
|
||||
def get_user_total_sign_count(self, wx_id: str, group_id: str) -> int:
|
||||
"""获取用户签到总次数"""
|
||||
@@ -96,5 +97,9 @@ class SignInRedisDB:
|
||||
def set_user_total_sign_count(self, wx_id: str, group_id: str, count: int) -> bool:
|
||||
"""设置用户签到总次数"""
|
||||
key = self.get_user_total_sign_count_key(wx_id, group_id)
|
||||
with self.get_redis_connection() as redis_client:
|
||||
return redis_client.set(key, count)
|
||||
try:
|
||||
with self.get_redis_connection() as redis_client:
|
||||
redis_client.set(key, count)
|
||||
return True
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user