feat: Add hget function to redis util
This commit is contained in:
parent
d897580e0e
commit
479bea2fe0
@ -220,7 +220,7 @@ class DynamicUpdate(BaseModel):
|
||||
def default(cls):
|
||||
"""
|
||||
获取功能全部开启的默认 DynamicUpdate 实例
|
||||
默认配置:启用动态推送,推送内容模板为 "{uname} {action}\n{url}"
|
||||
默认配置:启用动态推送,推送内容模板为 "{uname} {action}\n{url}{next}{picture}"
|
||||
"""
|
||||
return DynamicUpdate(enabled=True, message=DynamicUpdate.DEFAULT_MESSAGE)
|
||||
|
||||
|
@ -285,13 +285,13 @@ class LiveReportGenerator:
|
||||
)
|
||||
pic.draw_img_alpha(pic.auto_size_img_by_limit(guard_list_img, logo_limit))
|
||||
|
||||
# 盲盒盈亏曲线图
|
||||
# 盲盒盈亏折线图
|
||||
if model.box_profit_diagram:
|
||||
profits = param.get("box_profit_diagram", [])
|
||||
if profits:
|
||||
profits.insert(0, 0.0)
|
||||
|
||||
pic.draw_section("盲盒盈亏曲线图")
|
||||
pic.draw_section("盲盒盈亏折线图")
|
||||
|
||||
diagram = cls.__get_box_profit_diagram(profits, pic.width - (margin * 2))
|
||||
pic.draw_img_alpha(pic.auto_size_img_by_limit(diagram, logo_limit))
|
||||
|
@ -85,6 +85,13 @@ async def hexists(key: str, hkey: Union[str, int]) -> bool:
|
||||
return await __redis.hexists(key, hkey)
|
||||
|
||||
|
||||
async def hget(key: str, hkey: Union[str, int]) -> str:
|
||||
result = await __redis.hget(key, hkey)
|
||||
if result is None:
|
||||
return ""
|
||||
return result.decode()
|
||||
|
||||
|
||||
async def hgeti(key: str, hkey: Union[str, int]) -> int:
|
||||
result = await __redis.hget(key, hkey)
|
||||
if result is None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user