feat: Add bot analysis and command services, bot settings, and a frontend account center with subscription and EVM wallet integration.

This commit is contained in:
2569718930@qq.com
2026-03-13 12:45:39 +08:00
parent c3958c29c7
commit 50a2202930
5 changed files with 45 additions and 10 deletions
+8 -1
View File
@@ -33,6 +33,10 @@ class DebAnalysisService:
city_input_norm = city_input.strip().lower()
return aliases.get(city_input_norm, city_input_norm)
# Backward-compatible alias used by older service wrappers.
def resolve_deb_city(self, city_input: str) -> str:
return self.resolve_city(city_input)
def has_history(self, city_name: str) -> bool:
_is_excluded_model_name, load_history, reconcile_recent_actual_highs = (
self._load_deb_module_api()
@@ -42,6 +46,10 @@ class DebAnalysisService:
city_data = data.get(city_name)
return isinstance(city_data, dict) and bool(city_data)
# Backward-compatible alias used by older service wrappers.
def has_deb_history(self, city_name: str) -> bool:
return self.has_history(city_name)
def build_deb_accuracy_report(self, city_name: str, deb_query_cost: int) -> str:
_is_excluded_model_name, load_history, reconcile_recent_actual_highs = (
self._load_deb_module_api()
@@ -217,4 +225,3 @@ class DebAnalysisService:
lines.append("")
lines.append(f"💸 本次消耗 <code>{deb_query_cost}</code> 积分。")
return "\n".join(lines)
+2 -2
View File
@@ -18,10 +18,10 @@ class DebCommandService:
self.analysis = analysis
def resolve_city(self, city_input: str) -> str:
return self.analysis.resolve_deb_city(city_input)
return self.analysis.resolve_city(city_input)
def has_history(self, city_name: str) -> bool:
return self.analysis.has_deb_history(city_name)
return self.analysis.has_history(city_name)
def build_report(self, city_name: str, deb_query_cost: int) -> DebReportResult:
try:
+2 -2
View File
@@ -18,5 +18,5 @@ MESSAGE_POINTS = _env_int("POLYWEATHER_BOT_MESSAGE_POINTS", 4, min_value=1)
MESSAGE_DAILY_CAP = _env_int("POLYWEATHER_BOT_MESSAGE_DAILY_CAP", 40, min_value=1)
MESSAGE_MIN_LENGTH = _env_int("POLYWEATHER_BOT_MESSAGE_MIN_LENGTH", 3, min_value=1)
MESSAGE_COOLDOWN_SEC = _env_int("POLYWEATHER_BOT_MESSAGE_COOLDOWN_SEC", 30, min_value=0)
CITY_QUERY_COST = _env_int("POLYWEATHER_BOT_CITY_QUERY_COST", 1, min_value=0)
DEB_QUERY_COST = _env_int("POLYWEATHER_BOT_DEB_QUERY_COST", 1, min_value=0)
CITY_QUERY_COST = _env_int("POLYWEATHER_BOT_CITY_QUERY_COST", 2, min_value=0)
DEB_QUERY_COST = _env_int("POLYWEATHER_BOT_DEB_QUERY_COST", 2, min_value=0)