feat: 新人初始礼包购买追踪功能
- 数据库:添加 has_purchased_starter_pack 字段到 register_bonus_claims - 后端:创建静态配置管理套餐信息,支持按国家/地区区分 - 后端:新增 GET /api/v1/points/packages API 返回可用套餐 - 后端:创建 utils/paths.py 统一路径管理 - 前端:动态获取套餐信息,移除硬编码 - 前端:添加 ProductCode 枚举约束,前后端类型安全 - 配置:Profile 默认国家改为 US(ISO 3166-1 alpha-2) - 文档:更新协议文档说明新 API 和字段
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
from utils.paths import (
|
||||
get_config_root,
|
||||
get_database_config_dir,
|
||||
get_default_package_config_path,
|
||||
get_divination_data_dir,
|
||||
get_gua_catalog_path,
|
||||
get_llm_catalog_config_path,
|
||||
get_notification_config_dir,
|
||||
get_package_config_path,
|
||||
get_packages_config_dir,
|
||||
get_src_root,
|
||||
get_static_config_dir,
|
||||
get_system_agents_config_path,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"get_config_root",
|
||||
"get_database_config_dir",
|
||||
"get_default_package_config_path",
|
||||
"get_divination_data_dir",
|
||||
"get_gua_catalog_path",
|
||||
"get_llm_catalog_config_path",
|
||||
"get_notification_config_dir",
|
||||
"get_package_config_path",
|
||||
"get_packages_config_dir",
|
||||
"get_src_root",
|
||||
"get_static_config_dir",
|
||||
"get_system_agents_config_path",
|
||||
]
|
||||
@@ -0,0 +1,51 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def get_src_root() -> Path:
|
||||
return Path(__file__).parent.parent
|
||||
|
||||
|
||||
def get_config_root() -> Path:
|
||||
return get_src_root() / "core/config"
|
||||
|
||||
|
||||
def get_static_config_dir() -> Path:
|
||||
return get_config_root() / "static"
|
||||
|
||||
|
||||
def get_packages_config_dir() -> Path:
|
||||
return get_static_config_dir() / "packages"
|
||||
|
||||
|
||||
def get_database_config_dir() -> Path:
|
||||
return get_static_config_dir() / "database"
|
||||
|
||||
|
||||
def get_notification_config_dir() -> Path:
|
||||
return get_static_config_dir() / "notification/notifications"
|
||||
|
||||
|
||||
def get_divination_data_dir() -> Path:
|
||||
return get_src_root() / "core/divination/data"
|
||||
|
||||
|
||||
def get_package_config_path(country: str) -> Path:
|
||||
return get_packages_config_dir() / f"{country.lower()}.yaml"
|
||||
|
||||
|
||||
def get_default_package_config_path() -> Path:
|
||||
return get_packages_config_dir() / "default.yaml"
|
||||
|
||||
|
||||
def get_llm_catalog_config_path() -> Path:
|
||||
return get_database_config_dir() / "llm_catalog.yaml"
|
||||
|
||||
|
||||
def get_system_agents_config_path() -> Path:
|
||||
return get_database_config_dir() / "system_agents.yaml"
|
||||
|
||||
|
||||
def get_gua_catalog_path() -> Path:
|
||||
return get_divination_data_dir() / "gua_catalog.json"
|
||||
Reference in New Issue
Block a user