feat: 优化全局配置接口
This commit is contained in:
@@ -34,8 +34,514 @@ class InfoOut(OutBase):
|
||||
data: Dict[str, Any] = Field(..., description="收到的服务器数据")
|
||||
|
||||
|
||||
class GlobalConfig_Function(BaseModel):
|
||||
HistoryRetentionTime: Optional[Literal[7, 15, 30, 60, 90, 180, 365, 0]] = Field(
|
||||
None, description="历史记录保留时间, 0表示永久保存"
|
||||
)
|
||||
IfAllowSleep: Optional[bool] = Field(None, description="允许休眠")
|
||||
IfSilence: Optional[bool] = Field(None, description="静默模式")
|
||||
BossKey: Optional[str] = Field(None, description="模拟器老板键")
|
||||
IfAgreeBilibili: Optional[bool] = Field(None, description="同意哔哩哔哩用户协议")
|
||||
IfSkipMumuSplashAds: Optional[bool] = Field(
|
||||
None, description="跳过Mumu模拟器启动广告"
|
||||
)
|
||||
|
||||
|
||||
class GlobalConfig_Voice(BaseModel):
|
||||
Enabled: Optional[bool] = Field(None, description="语音功能是否启用")
|
||||
Type: Optional[Literal["simple", "noisy"]] = Field(
|
||||
None, description="语音类型, simple为简洁, noisy为聒噪"
|
||||
)
|
||||
|
||||
|
||||
class GlobalConfig_Start(BaseModel):
|
||||
IfSelfStart: Optional[bool] = Field(None, description="是否在系统启动时自动运行")
|
||||
IfMinimizeDirectly: Optional[bool] = Field(
|
||||
None, description="启动时是否直接最小化到托盘而不显示主窗口"
|
||||
)
|
||||
|
||||
|
||||
class GlobalConfig_UI(BaseModel):
|
||||
IfShowTray: Optional[bool] = Field(None, description="是否常态显示托盘图标")
|
||||
IfToTray: Optional[bool] = Field(None, description="是否最小化到托盘")
|
||||
|
||||
|
||||
class GlobalConfig_Notify(BaseModel):
|
||||
SendTaskResultTime: Optional[Literal["不推送", "任何时刻", "仅失败时"]] = Field(
|
||||
None, description="任务结果推送时机"
|
||||
)
|
||||
IfSendStatistic: Optional[bool] = Field(None, description="是否发送统计信息")
|
||||
IfSendSixStar: Optional[bool] = Field(None, description="是否发送公招六星通知")
|
||||
IfPushPlyer: Optional[bool] = Field(None, description="是否推送系统通知")
|
||||
IfSendMail: Optional[bool] = Field(None, description="是否发送邮件通知")
|
||||
SMTPServerAddress: Optional[str] = Field(None, description="SMTP服务器地址")
|
||||
AuthorizationCode: Optional[str] = Field(None, description="SMTP授权码")
|
||||
FromAddress: Optional[str] = Field(None, description="邮件发送地址")
|
||||
ToAddress: Optional[str] = Field(None, description="邮件接收地址")
|
||||
IfServerChan: Optional[bool] = Field(None, description="是否使用ServerChan推送")
|
||||
ServerChanKey: Optional[str] = Field(None, description="ServerChan推送密钥")
|
||||
IfCompanyWebHookBot: Optional[bool] = Field(
|
||||
None, description="是否使用企微Webhook推送"
|
||||
)
|
||||
CompanyWebHookBotUrl: Optional[str] = Field(None, description="企微Webhook Bot URL")
|
||||
|
||||
|
||||
class GlobalConfig_Update(BaseModel):
|
||||
IfAutoUpdate: Optional[bool] = Field(None, description="是否自动更新")
|
||||
UpdateType: Optional[Literal["stable", "beta"]] = Field(
|
||||
None, description="更新类型, stable为稳定版, beta为测试版"
|
||||
)
|
||||
Source: Optional[Literal["GitHub", "MirrorChyan", "AutoSite"]] = Field(
|
||||
None, description="更新源: GitHub源, Mirror酱源, 自建源"
|
||||
)
|
||||
ProxyAddress: Optional[str] = Field(None, description="网络代理地址")
|
||||
MirrorChyanCDK: Optional[str] = Field(None, description="Mirror酱CDK")
|
||||
|
||||
|
||||
class GlobalConfig(BaseModel):
|
||||
Function: Optional[GlobalConfig_Function] = Field(None, description="功能相关配置")
|
||||
Voice: Optional[GlobalConfig_Voice] = Field(None, description="语音相关配置")
|
||||
Start: Optional[GlobalConfig_Start] = Field(None, description="启动相关配置")
|
||||
UI: Optional[GlobalConfig_UI] = Field(None, description="界面相关配置")
|
||||
Notify: Optional[GlobalConfig_Notify] = Field(None, description="通知相关配置")
|
||||
Update: Optional[GlobalConfig_Update] = Field(None, description="更新相关配置")
|
||||
|
||||
|
||||
# class QueueItem(ConfigBase):
|
||||
# """队列项配置"""
|
||||
|
||||
# def __init__(self) -> None:
|
||||
# super().__init__()
|
||||
|
||||
# self.Info_ScriptId = ConfigItem("Info", "ScriptId", None, UidValidator())
|
||||
|
||||
|
||||
# class TimeSet(ConfigBase):
|
||||
# """时间设置配置"""
|
||||
|
||||
# def __init__(self) -> None:
|
||||
# super().__init__()
|
||||
|
||||
# self.Info_Enabled = ConfigItem("Info", "Enabled", False, BoolValidator())
|
||||
# self.Info_Time = ConfigItem("Info", "Time", "00:00")
|
||||
|
||||
|
||||
# class QueueConfig(ConfigBase):
|
||||
# """队列配置"""
|
||||
|
||||
# def __init__(self) -> None:
|
||||
# super().__init__()
|
||||
|
||||
# self.Info_Name = ConfigItem("Info", "Name", "")
|
||||
# self.Info_TimeEnabled = ConfigItem(
|
||||
# "Info", "TimeEnabled", False, BoolValidator()
|
||||
# )
|
||||
# self.Info_StartUpEnabled = ConfigItem(
|
||||
# "Info", "StartUpEnabled", False, BoolValidator()
|
||||
# )
|
||||
# self.Info_AfterAccomplish = ConfigItem(
|
||||
# "Info",
|
||||
# "AfterAccomplish",
|
||||
# "NoAction",
|
||||
# OptionsValidator(
|
||||
# [
|
||||
# "NoAction",
|
||||
# "KillSelf",
|
||||
# "Sleep",
|
||||
# "Hibernate",
|
||||
# "Shutdown",
|
||||
# "ShutdownForce",
|
||||
# ]
|
||||
# ),
|
||||
# )
|
||||
|
||||
# self.Data_LastProxyTime = ConfigItem(
|
||||
# "Data", "LastProxyTime", "2000-01-01 00:00:00"
|
||||
# )
|
||||
# self.Data_LastProxyHistory = ConfigItem(
|
||||
# "Data", "LastProxyHistory", "暂无历史运行记录"
|
||||
# )
|
||||
|
||||
# self.TimeSet = MultipleConfig([TimeSet])
|
||||
# self.QueueItem = MultipleConfig([QueueItem])
|
||||
|
||||
|
||||
# class MaaUserConfig(ConfigBase):
|
||||
# """MAA用户配置"""
|
||||
|
||||
# def __init__(self) -> None:
|
||||
# super().__init__()
|
||||
|
||||
# self.Info_Name = ConfigItem("Info", "Name", "新用户")
|
||||
# self.Info_Id = ConfigItem("Info", "Id", "")
|
||||
# self.Info_Mode = ConfigItem(
|
||||
# "Info", "Mode", "简洁", OptionsValidator(["简洁", "详细"])
|
||||
# )
|
||||
# self.Info_StageMode = ConfigItem("Info", "StageMode", "固定")
|
||||
# self.Info_Server = ConfigItem(
|
||||
# "Info",
|
||||
# "Server",
|
||||
# "Official",
|
||||
# OptionsValidator(
|
||||
# ["Official", "Bilibili", "YoStarEN", "YoStarJP", "YoStarKR", "txwy"]
|
||||
# ),
|
||||
# )
|
||||
# self.Info_Status = ConfigItem("Info", "Status", True, BoolValidator())
|
||||
# self.Info_RemainedDay = ConfigItem(
|
||||
# "Info", "RemainedDay", -1, RangeValidator(-1, 1024)
|
||||
# )
|
||||
# self.Info_Annihilation = ConfigItem(
|
||||
# "Info",
|
||||
# "Annihilation",
|
||||
# "Annihilation",
|
||||
# OptionsValidator(
|
||||
# [
|
||||
# "Close",
|
||||
# "Annihilation",
|
||||
# "Chernobog@Annihilation",
|
||||
# "LungmenOutskirts@Annihilation",
|
||||
# "LungmenDowntown@Annihilation",
|
||||
# ]
|
||||
# ),
|
||||
# )
|
||||
# self.Info_Routine = ConfigItem("Info", "Routine", True, BoolValidator())
|
||||
# self.Info_InfrastMode = ConfigItem(
|
||||
# "Info",
|
||||
# "InfrastMode",
|
||||
# "Normal",
|
||||
# OptionsValidator(["Normal", "Rotation", "Custom"]),
|
||||
# )
|
||||
# self.Info_Password = ConfigItem("Info", "Password", "", EncryptValidator())
|
||||
# self.Info_Notes = ConfigItem("Info", "Notes", "无")
|
||||
# self.Info_MedicineNumb = ConfigItem(
|
||||
# "Info", "MedicineNumb", 0, RangeValidator(0, 1024)
|
||||
# )
|
||||
# self.Info_SeriesNumb = ConfigItem(
|
||||
# "Info",
|
||||
# "SeriesNumb",
|
||||
# "0",
|
||||
# OptionsValidator(["0", "6", "5", "4", "3", "2", "1", "-1"]),
|
||||
# )
|
||||
# self.Info_Stage = ConfigItem("Info", "Stage", "-")
|
||||
# self.Info_Stage_1 = ConfigItem("Info", "Stage_1", "-")
|
||||
# self.Info_Stage_2 = ConfigItem("Info", "Stage_2", "-")
|
||||
# self.Info_Stage_3 = ConfigItem("Info", "Stage_3", "-")
|
||||
# self.Info_Stage_Remain = ConfigItem("Info", "Stage_Remain", "-")
|
||||
# self.Info_IfSkland = ConfigItem("Info", "IfSkland", False, BoolValidator())
|
||||
# self.Info_SklandToken = ConfigItem("Info", "SklandToken", "")
|
||||
|
||||
# self.Data_LastProxyDate = ConfigItem("Data", "LastProxyDate", "2000-01-01")
|
||||
# self.Data_LastAnnihilationDate = ConfigItem(
|
||||
# "Data", "LastAnnihilationDate", "2000-01-01"
|
||||
# )
|
||||
# self.Data_LastSklandDate = ConfigItem("Data", "LastSklandDate", "2000-01-01")
|
||||
# self.Data_ProxyTimes = ConfigItem(
|
||||
# "Data", "ProxyTimes", 0, RangeValidator(0, 1024)
|
||||
# )
|
||||
# self.Data_IfPassCheck = ConfigItem("Data", "IfPassCheck", True, BoolValidator())
|
||||
# self.Data_CustomInfrastPlanIndex = ConfigItem(
|
||||
# "Data", "CustomInfrastPlanIndex", "0"
|
||||
# )
|
||||
|
||||
# self.Task_IfWakeUp = ConfigItem("Task", "IfWakeUp", True, BoolValidator())
|
||||
# self.Task_IfRecruiting = ConfigItem(
|
||||
# "Task", "IfRecruiting", True, BoolValidator()
|
||||
# )
|
||||
# self.Task_IfBase = ConfigItem("Task", "IfBase", True, BoolValidator())
|
||||
# self.Task_IfCombat = ConfigItem("Task", "IfCombat", True, BoolValidator())
|
||||
# self.Task_IfMall = ConfigItem("Task", "IfMall", True, BoolValidator())
|
||||
# self.Task_IfMission = ConfigItem("Task", "IfMission", True, BoolValidator())
|
||||
# self.Task_IfAutoRoguelike = ConfigItem(
|
||||
# "Task", "IfAutoRoguelike", False, BoolValidator()
|
||||
# )
|
||||
# self.Task_IfReclamation = ConfigItem(
|
||||
# "Task", "IfReclamation", False, BoolValidator()
|
||||
# )
|
||||
|
||||
# self.Notify_Enabled = ConfigItem("Notify", "Enabled", False, BoolValidator())
|
||||
# self.Notify_IfSendStatistic = ConfigItem(
|
||||
# "Notify", "IfSendStatistic", False, BoolValidator()
|
||||
# )
|
||||
# self.Notify_IfSendSixStar = ConfigItem(
|
||||
# "Notify", "IfSendSixStar", False, BoolValidator()
|
||||
# )
|
||||
# self.Notify_IfSendMail = ConfigItem(
|
||||
# "Notify", "IfSendMail", False, BoolValidator()
|
||||
# )
|
||||
# self.Notify_ToAddress = ConfigItem("Notify", "ToAddress", "")
|
||||
# self.Notify_IfServerChan = ConfigItem(
|
||||
# "Notify", "IfServerChan", False, BoolValidator()
|
||||
# )
|
||||
# self.Notify_ServerChanKey = ConfigItem("Notify", "ServerChanKey", "")
|
||||
# self.Notify_IfCompanyWebHookBot = ConfigItem(
|
||||
# "Notify", "IfCompanyWebHookBot", False, BoolValidator()
|
||||
# )
|
||||
# self.Notify_CompanyWebHookBotUrl = ConfigItem(
|
||||
# "Notify", "CompanyWebHookBotUrl", ""
|
||||
# )
|
||||
|
||||
# def get_plan_info(self) -> Dict[str, Union[str, int]]:
|
||||
# """获取当前的计划下信息"""
|
||||
|
||||
# if self.get("Info", "StageMode") == "固定":
|
||||
# return {
|
||||
# "MedicineNumb": self.get("Info", "MedicineNumb"),
|
||||
# "SeriesNumb": self.get("Info", "SeriesNumb"),
|
||||
# "Stage": self.get("Info", "Stage"),
|
||||
# "Stage_1": self.get("Info", "Stage_1"),
|
||||
# "Stage_2": self.get("Info", "Stage_2"),
|
||||
# "Stage_3": self.get("Info", "Stage_3"),
|
||||
# "Stage_Remain": self.get("Info", "Stage_Remain"),
|
||||
# }
|
||||
# else:
|
||||
# plan = Config.PlanConfig[uuid.UUID(self.get("Info", "StageMode"))]
|
||||
# if isinstance(plan, MaaPlanConfig):
|
||||
# return {
|
||||
# "MedicineNumb": plan.get_current_info("MedicineNumb").getValue(),
|
||||
# "SeriesNumb": plan.get_current_info("SeriesNumb").getValue(),
|
||||
# "Stage": plan.get_current_info("Stage").getValue(),
|
||||
# "Stage_1": plan.get_current_info("Stage_1").getValue(),
|
||||
# "Stage_2": plan.get_current_info("Stage_2").getValue(),
|
||||
# "Stage_3": plan.get_current_info("Stage_3").getValue(),
|
||||
# "Stage_Remain": plan.get_current_info("Stage_Remain").getValue(),
|
||||
# }
|
||||
# else:
|
||||
# raise ValueError("Invalid plan type")
|
||||
|
||||
|
||||
# class MaaConfig(ConfigBase):
|
||||
# """MAA配置"""
|
||||
|
||||
# def __init__(self) -> None:
|
||||
# super().__init__()
|
||||
|
||||
# self.Info_Name = ConfigItem("Info", "Name", "")
|
||||
# self.Info_Path = ConfigItem("Info", "Path", ".", FolderValidator())
|
||||
|
||||
# self.Run_TaskTransitionMethod = ConfigItem(
|
||||
# "Run",
|
||||
# "TaskTransitionMethod",
|
||||
# "ExitEmulator",
|
||||
# OptionsValidator(["NoAction", "ExitGame", "ExitEmulator"]),
|
||||
# )
|
||||
# self.Run_ProxyTimesLimit = ConfigItem(
|
||||
# "Run", "ProxyTimesLimit", 0, RangeValidator(0, 1024)
|
||||
# )
|
||||
# self.Run_ADBSearchRange = ConfigItem(
|
||||
# "Run", "ADBSearchRange", 0, RangeValidator(0, 3)
|
||||
# )
|
||||
# self.Run_RunTimesLimit = ConfigItem(
|
||||
# "Run", "RunTimesLimit", 3, RangeValidator(1, 1024)
|
||||
# )
|
||||
# self.Run_AnnihilationTimeLimit = ConfigItem(
|
||||
# "Run", "AnnihilationTimeLimit", 40, RangeValidator(1, 1024)
|
||||
# )
|
||||
# self.Run_RoutineTimeLimit = ConfigItem(
|
||||
# "Run", "RoutineTimeLimit", 10, RangeValidator(1, 1024)
|
||||
# )
|
||||
# self.Run_AnnihilationWeeklyLimit = ConfigItem(
|
||||
# "Run", "AnnihilationWeeklyLimit", True, BoolValidator()
|
||||
# )
|
||||
|
||||
# self.UserData = MultipleConfig([MaaUserConfig])
|
||||
|
||||
|
||||
# class MaaPlanConfig(ConfigBase):
|
||||
# """MAA计划表配置"""
|
||||
|
||||
# def __init__(self) -> None:
|
||||
# super().__init__()
|
||||
|
||||
# self.Info_Name = ConfigItem("Info", "Name", "")
|
||||
# self.Info_Mode = ConfigItem(
|
||||
# "Info", "Mode", "ALL", OptionsValidator(["ALL", "Weekly"])
|
||||
# )
|
||||
|
||||
# self.config_item_dict: dict[str, Dict[str, ConfigItem]] = {}
|
||||
|
||||
# for group in [
|
||||
# "ALL",
|
||||
# "Monday",
|
||||
# "Tuesday",
|
||||
# "Wednesday",
|
||||
# "Thursday",
|
||||
# "Friday",
|
||||
# "Saturday",
|
||||
# "Sunday",
|
||||
# ]:
|
||||
# self.config_item_dict[group] = {}
|
||||
|
||||
# self.config_item_dict[group]["MedicineNumb"] = ConfigItem(
|
||||
# group, "MedicineNumb", 0, RangeValidator(0, 1024)
|
||||
# )
|
||||
# self.config_item_dict[group]["SeriesNumb"] = ConfigItem(
|
||||
# group,
|
||||
# "SeriesNumb",
|
||||
# "0",
|
||||
# OptionsValidator(["0", "6", "5", "4", "3", "2", "1", "-1"]),
|
||||
# )
|
||||
# self.config_item_dict[group]["Stage"] = ConfigItem(group, "Stage", "-")
|
||||
# self.config_item_dict[group]["Stage_1"] = ConfigItem(group, "Stage_1", "-")
|
||||
# self.config_item_dict[group]["Stage_2"] = ConfigItem(group, "Stage_2", "-")
|
||||
# self.config_item_dict[group]["Stage_3"] = ConfigItem(group, "Stage_3", "-")
|
||||
# self.config_item_dict[group]["Stage_Remain"] = ConfigItem(
|
||||
# group, "Stage_Remain", "-"
|
||||
# )
|
||||
|
||||
# for name in [
|
||||
# "MedicineNumb",
|
||||
# "SeriesNumb",
|
||||
# "Stage",
|
||||
# "Stage_1",
|
||||
# "Stage_2",
|
||||
# "Stage_3",
|
||||
# "Stage_Remain",
|
||||
# ]:
|
||||
# setattr(self, f"{group}_{name}", self.config_item_dict[group][name])
|
||||
|
||||
# def get_current_info(self, name: str) -> ConfigItem:
|
||||
# """获取当前的计划表配置项"""
|
||||
|
||||
# if self.get("Info", "Mode") == "ALL":
|
||||
|
||||
# return self.config_item_dict["ALL"][name]
|
||||
|
||||
# elif self.get("Info", "Mode") == "Weekly":
|
||||
|
||||
# dt = datetime.now()
|
||||
# if dt.time() < datetime.min.time().replace(hour=4):
|
||||
# dt = dt - timedelta(days=1)
|
||||
# today = dt.strftime("%A")
|
||||
|
||||
# if today in self.config_item_dict:
|
||||
# return self.config_item_dict[today][name]
|
||||
# else:
|
||||
# return self.config_item_dict["ALL"][name]
|
||||
|
||||
# else:
|
||||
# raise ValueError("The mode is invalid.")
|
||||
|
||||
|
||||
# class GeneralUserConfig(ConfigBase):
|
||||
# """通用子配置"""
|
||||
|
||||
# def __init__(self) -> None:
|
||||
# super().__init__()
|
||||
|
||||
# self.Info_Name = ConfigItem("Info", "Name", "新配置")
|
||||
# self.Info_Status = ConfigItem("Info", "Status", True, BoolValidator())
|
||||
# self.Info_RemainedDay = ConfigItem(
|
||||
# "Info", "RemainedDay", -1, RangeValidator(-1, 1024)
|
||||
# )
|
||||
# self.Info_IfScriptBeforeTask = ConfigItem(
|
||||
# "Info", "IfScriptBeforeTask", False, BoolValidator()
|
||||
# )
|
||||
# self.Info_ScriptBeforeTask = ConfigItem(
|
||||
# "Info", "ScriptBeforeTask", "", FileValidator()
|
||||
# )
|
||||
# self.Info_IfScriptAfterTask = ConfigItem(
|
||||
# "Info", "IfScriptAfterTask", False, BoolValidator()
|
||||
# )
|
||||
# self.Info_ScriptAfterTask = ConfigItem(
|
||||
# "Info", "ScriptAfterTask", "", FileValidator()
|
||||
# )
|
||||
# self.Info_Notes = ConfigItem("Info", "Notes", "无")
|
||||
|
||||
# self.Data_LastProxyDate = ConfigItem("Data", "LastProxyDate", "2000-01-01")
|
||||
# self.Data_ProxyTimes = ConfigItem(
|
||||
# "Data", "ProxyTimes", 0, RangeValidator(0, 1024)
|
||||
# )
|
||||
|
||||
# self.Notify_Enabled = ConfigItem("Notify", "Enabled", False, BoolValidator())
|
||||
# self.Notify_IfSendStatistic = ConfigItem(
|
||||
# "Notify", "IfSendStatistic", False, BoolValidator()
|
||||
# )
|
||||
# self.Notify_IfSendMail = ConfigItem(
|
||||
# "Notify", "IfSendMail", False, BoolValidator()
|
||||
# )
|
||||
# self.Notify_ToAddress = ConfigItem("Notify", "ToAddress", "")
|
||||
# self.Notify_IfServerChan = ConfigItem(
|
||||
# "Notify", "IfServerChan", False, BoolValidator()
|
||||
# )
|
||||
# self.Notify_ServerChanKey = ConfigItem("Notify", "ServerChanKey", "")
|
||||
# self.Notify_IfCompanyWebHookBot = ConfigItem(
|
||||
# "Notify", "IfCompanyWebHookBot", False, BoolValidator()
|
||||
# )
|
||||
# self.Notify_CompanyWebHookBotUrl = ConfigItem(
|
||||
# "Notify", "CompanyWebHookBotUrl", ""
|
||||
# )
|
||||
|
||||
|
||||
# class GeneralConfig(ConfigBase):
|
||||
# """通用配置"""
|
||||
|
||||
# def __init__(self) -> None:
|
||||
# super().__init__()
|
||||
|
||||
# self.Info_Name = ConfigItem("Info", "Name", "")
|
||||
# self.Info_RootPath = ConfigItem("Info", "RootPath", ".", FileValidator())
|
||||
|
||||
# self.Script_ScriptPath = ConfigItem(
|
||||
# "Script", "ScriptPath", ".", FileValidator()
|
||||
# )
|
||||
# self.Script_Arguments = ConfigItem("Script", "Arguments", "")
|
||||
# self.Script_IfTrackProcess = ConfigItem(
|
||||
# "Script", "IfTrackProcess", False, BoolValidator()
|
||||
# )
|
||||
# self.Script_ConfigPath = ConfigItem(
|
||||
# "Script", "ConfigPath", ".", FileValidator()
|
||||
# )
|
||||
# self.Script_ConfigPathMode = ConfigItem(
|
||||
# "Script", "ConfigPathMode", "File", OptionsValidator(["File", "Folder"])
|
||||
# )
|
||||
# self.Script_UpdateConfigMode = ConfigItem(
|
||||
# "Script",
|
||||
# "UpdateConfigMode",
|
||||
# "Never",
|
||||
# OptionsValidator(["Never", "Success", "Failure", "Always"]),
|
||||
# )
|
||||
# self.Script_LogPath = ConfigItem("Script", "LogPath", ".", FileValidator())
|
||||
# self.Script_LogPathFormat = ConfigItem("Script", "LogPathFormat", "%Y-%m-%d")
|
||||
# self.Script_LogTimeStart = ConfigItem(
|
||||
# "Script", "LogTimeStart", 1, RangeValidator(1, 1024)
|
||||
# )
|
||||
# self.Script_LogTimeEnd = ConfigItem(
|
||||
# "Script", "LogTimeEnd", 1, RangeValidator(1, 1024)
|
||||
# )
|
||||
# self.Script_LogTimeFormat = ConfigItem(
|
||||
# "Script", "LogTimeFormat", "%Y-%m-%d %H:%M:%S"
|
||||
# )
|
||||
# self.Script_SuccessLog = ConfigItem("Script", "SuccessLog", "")
|
||||
# self.Script_ErrorLog = ConfigItem("Script", "ErrorLog", "")
|
||||
|
||||
# self.Game_Enabled = ConfigItem("Game", "Enabled", False, BoolValidator())
|
||||
# self.Game_Style = ConfigItem(
|
||||
# "Game", "Style", "Emulator", OptionsValidator(["Emulator", "Client"])
|
||||
# )
|
||||
# self.Game_Path = ConfigItem("Game", "Path", ".", FileValidator())
|
||||
# self.Game_Arguments = ConfigItem("Game", "Arguments", "")
|
||||
# self.Game_WaitTime = ConfigItem("Game", "WaitTime", 0, RangeValidator(0, 1024))
|
||||
# self.Game_IfForceClose = ConfigItem(
|
||||
# "Game", "IfForceClose", False, BoolValidator()
|
||||
# )
|
||||
|
||||
# self.Run_ProxyTimesLimit = ConfigItem(
|
||||
# "Run", "ProxyTimesLimit", 0, RangeValidator(0, 1024)
|
||||
# )
|
||||
# self.Run_RunTimesLimit = ConfigItem(
|
||||
# "Run", "RunTimesLimit", 3, RangeValidator(1, 1024)
|
||||
# )
|
||||
# self.Run_RunTimeLimit = ConfigItem(
|
||||
# "Run", "RunTimeLimit", 10, RangeValidator(1, 1024)
|
||||
# )
|
||||
|
||||
# self.UserData = MultipleConfig([GeneralUserConfig])
|
||||
|
||||
|
||||
class ScriptCreateIn(BaseModel):
|
||||
type: Literal["MAA", "General"]
|
||||
type: Literal["MAA", "General"] = Field(
|
||||
..., description="脚本类型: MAA脚本, 通用脚本"
|
||||
)
|
||||
|
||||
|
||||
class ScriptCreateOut(OutBase):
|
||||
@@ -211,8 +717,8 @@ class TaskMessage(BaseModel):
|
||||
|
||||
|
||||
class SettingGetOut(OutBase):
|
||||
data: Dict[str, Dict[str, Any]] = Field(..., description="全局设置数据")
|
||||
data: GlobalConfig = Field(..., description="全局设置数据")
|
||||
|
||||
|
||||
class SettingUpdateIn(BaseModel):
|
||||
data: Dict[str, Dict[str, Any]] = Field(..., description="全局设置更新数据")
|
||||
data: GlobalConfig = Field(..., description="全局设置需要更新的数据")
|
||||
|
||||
Reference in New Issue
Block a user