新增插件指引网页
This commit is contained in:
@@ -14,6 +14,41 @@ CHECKIN_POINTS = logger.FindItem("checkin_points", 100)
|
||||
logger.SaveProperties()
|
||||
|
||||
class WPSConfigAPI(WPSAPI):
|
||||
def get_guide_subtitle(self) -> str:
|
||||
return "用户基础资料与积分配置接口"
|
||||
|
||||
def get_guide_metadata(self) -> Dict[str, str]:
|
||||
return {
|
||||
"数据表": "user_info",
|
||||
"每日签到积分": str(CHECKIN_POINTS),
|
||||
}
|
||||
|
||||
def collect_command_entries(self) -> Sequence[GuideEntry]:
|
||||
return (
|
||||
{
|
||||
"title": "config",
|
||||
"identifier": "config",
|
||||
"description": "配置与查询用户昵称、URL、积分等信息。",
|
||||
"metadata": {"别名": "cfg"},
|
||||
},
|
||||
)
|
||||
|
||||
def collect_guide_entries(self) -> Sequence[GuideEntry]:
|
||||
return (
|
||||
{
|
||||
"title": "设置指令",
|
||||
"description": "`config set user.name <昵称>` / `config set user.url <URL>`",
|
||||
},
|
||||
{
|
||||
"title": "查询指令",
|
||||
"description": "`config get user.name|user.url|user.point` 返回当前资料或积分。",
|
||||
},
|
||||
{
|
||||
"title": "数据校验",
|
||||
"description": "内部自动确保用户记录存在,并限制昵称长度与 URL 前缀。",
|
||||
},
|
||||
)
|
||||
|
||||
@override
|
||||
def dependencies(self) -> List[Type]:
|
||||
return [WPSAPI]
|
||||
@@ -196,6 +231,37 @@ class WPSConfigAPI(WPSAPI):
|
||||
|
||||
|
||||
class WPSCheckinAPI(WPSAPI):
|
||||
def get_guide_subtitle(self) -> str:
|
||||
return "每日签到并发放积分的快捷指令"
|
||||
|
||||
def get_guide_metadata(self) -> Dict[str, str]:
|
||||
return {
|
||||
"数据表": "daily_checkin",
|
||||
"签到积分": str(CHECKIN_POINTS),
|
||||
}
|
||||
|
||||
def collect_command_entries(self) -> Sequence[GuideEntry]:
|
||||
return (
|
||||
{
|
||||
"title": "checkin",
|
||||
"identifier": "checkin",
|
||||
"description": "执行签到流程,发放积分并反馈今日进度。",
|
||||
"metadata": {"别名": "签到 / 积分"},
|
||||
},
|
||||
)
|
||||
|
||||
def collect_guide_entries(self) -> Sequence[GuideEntry]:
|
||||
return (
|
||||
{
|
||||
"title": "签到逻辑",
|
||||
"description": "同一日多次调用仅第一次成功,并记录在 `daily_checkin` 表内。",
|
||||
},
|
||||
{
|
||||
"title": "积分结算",
|
||||
"description": "成功签到将通过 `WPSConfigAPI.adjust_user_points` 增加积分。",
|
||||
},
|
||||
)
|
||||
|
||||
@override
|
||||
def dependencies(self) -> List[Type]:
|
||||
return [WPSAPI]
|
||||
|
||||
Reference in New Issue
Block a user