[Enhance] PTT record & log DB cleaner

- Add support for recording users' potential each day
- Add a log database cleaner tool
- A small change: `/user/<user_id> PUT` API can ban user now.
This commit is contained in:
Lost-MSth
2023-05-03 00:37:41 +08:00
parent 880b66a995
commit bd74d96250
9 changed files with 226 additions and 9 deletions

View File

@@ -1,5 +1,7 @@
import hashlib
import os
from datetime import date
from time import mktime
def md5(code: str) -> str:
@@ -37,3 +39,8 @@ def try_rename(path: str, new_path: str) -> str:
os.rename(path, final_path)
return final_path
def get_today_timestamp():
'''相对于本机本地时间的今天0点的时间戳'''
return int(mktime(date.today().timetuple()))