update: 更新了函数注释

This commit is contained in:
MarkusJoe
2022-11-11 18:47:24 +08:00
parent 98ce0251d8
commit a52902f43e
1 file changed
+3 -2
+3 -2
View File
@@ -11,7 +11,8 @@ from src.db import Database
async def resp(_id: str, length: int = 7, theme: str = 'lewd') -> dict:
"""
return a dict
generate dict response
include all information
:param _id: name
:param length: length for counter
:param theme: theme for counter
@@ -20,7 +21,7 @@ async def resp(_id: str, length: int = 7, theme: str = 'lewd') -> dict:
times = Database().query(_id)[1]
str_number = str(times) # 将整形转换为字符串
len_number = len(str_number) # 再获取字符串长度
g_length = length * '0' # 根据输入的位数来自动生成0的数量
g_length = length * '0' # 根据输入的位数来生成0的数量
show_number = str(g_length[:-len_number] + str_number)
context = []
headers = {'cache-control': 'max-age=0, no-cache, no-store, must-revalidate',