Archived
update: 更新了函数注释
This commit is contained in:
1 file changed
+3
-2
@@ -11,7 +11,8 @@ from src.db import Database
|
|||||||
|
|
||||||
async def resp(_id: str, length: int = 7, theme: str = 'lewd') -> dict:
|
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 _id: name
|
||||||
:param length: length for counter
|
:param length: length for counter
|
||||||
:param theme: theme 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]
|
times = Database().query(_id)[1]
|
||||||
str_number = str(times) # 将整形转换为字符串
|
str_number = str(times) # 将整形转换为字符串
|
||||||
len_number = len(str_number) # 再获取字符串长度
|
len_number = len(str_number) # 再获取字符串长度
|
||||||
g_length = length * '0' # 根据输入的位数来自动生成0的数量
|
g_length = length * '0' # 根据输入的位数来生成0的数量
|
||||||
show_number = str(g_length[:-len_number] + str_number)
|
show_number = str(g_length[:-len_number] + str_number)
|
||||||
context = []
|
context = []
|
||||||
headers = {'cache-control': 'max-age=0, no-cache, no-store, must-revalidate',
|
headers = {'cache-control': 'max-age=0, no-cache, no-store, must-revalidate',
|
||||||
|
|||||||
Reference in New Issue
Block a user