feat: multi-customer architecture + Z-Park support + Gitea migration scripts
Multi-customer config system: - CUSTOMER env var selects customer (tianpu/zpark) - customers/tianpu/config.yaml — Tianpu branding, collectors, features - customers/zpark/config.yaml — Z-Park branding, Sungrow collector - GET /api/v1/branding endpoint for customer-specific branding - main.py loads customer config for app title, CORS, logging - Collector manager filters by customer's enabled collectors Z-Park (中关村医疗器械园) support: - Sungrow iSolarCloud API collector (sungrow_collector.py) - Z-Park device definitions (10 inverters, 8 combiner boxes, 22+ buildings) - Z-Park TOU pricing config (Beijing 2026 rates) - Z-Park seed script (seed_zpark.py) Gitea migration scripts (Mac Studio → labmac3): - 5 migration scripts + README in scripts/gitea-migration/ - Creates 3-repo structure: ems-core, tp-ems, zpark-ems Version: v1.0.0 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
20
backend/app/api/v1/branding.py
Normal file
20
backend/app/api/v1/branding.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from fastapi import APIRouter
|
||||
from app.core.config import get_settings
|
||||
|
||||
router = APIRouter(prefix="/branding", tags=["品牌配置"])
|
||||
|
||||
|
||||
@router.get("")
|
||||
async def get_branding():
|
||||
"""Return customer-specific branding configuration"""
|
||||
settings = get_settings()
|
||||
customer_config = settings.load_customer_config()
|
||||
return {
|
||||
"customer": settings.CUSTOMER,
|
||||
"customer_name": customer_config.get("customer_name", settings.CUSTOMER),
|
||||
"platform_name": customer_config.get("platform_name", settings.APP_NAME),
|
||||
"platform_name_en": customer_config.get("platform_name_en", "Smart EMS"),
|
||||
"logo_url": customer_config.get("logo_url", ""),
|
||||
"theme_color": customer_config.get("theme_color", "#1890ff"),
|
||||
"features": customer_config.get("features", {}),
|
||||
}
|
||||
Reference in New Issue
Block a user