- Add complete metrics microservice structure - Implement StarRocks database integration - Add user registration data query APIs: - Daily registered users by date range - Recent N days registration data - Registration data by start date and days - Registration summary statistics - Add comprehensive error handling and logging - Include test scripts and documentation
42 lines
1.2 KiB
Python
42 lines
1.2 KiB
Python
from pydantic_settings import BaseSettings
|
|
from typing import Optional
|
|
|
|
|
|
class SiteSettings(BaseSettings):
|
|
# Server settings
|
|
SERVER_HOST: str = "0.0.0.0"
|
|
SERVER_PORT: int = 8009
|
|
SERVICE_API_ACCESS_HOST: str = "0.0.0.0"
|
|
SERVICE_API_ACCESS_PORT: int = 8009
|
|
|
|
# Database settings
|
|
MONGODB_URI: str = "mongodb://localhost:27017/"
|
|
MONGODB_NAME: str = "freeleaps2"
|
|
MONGODB_PORT: int = 27017
|
|
|
|
# JWT settings
|
|
JWT_SECRET_KEY: str = "8f87ca8c3c9c3df09a9c78e0adb0927855568f6072d9efc892534aee35f5867b"
|
|
JWT_ALGORITHM: str = "HS256"
|
|
|
|
# Log settings
|
|
LOG_BASE_PATH: str = "./logs"
|
|
BACKEND_LOG_FILE_NAME: str = "metrics"
|
|
APPLICATION_ACTIVITY_LOG: str = "metrics-activity"
|
|
|
|
# Service dependencies
|
|
DEVSVC_WEBAPI_URL_BASE: str = "http://devsvc:8007/api/devsvc"
|
|
NOTIFICATION_WEBAPI_URL_BASE: str = "http://notification:8003/api/notification/"
|
|
|
|
# StarRocks database settings
|
|
STARROCKS_HOST: str = "freeleaps-starrocks-cluster-fe-service.freeleaps-data-platform.svc"
|
|
STARROCKS_PORT: int = 9030
|
|
STARROCKS_USER: str = "root"
|
|
STARROCKS_PASSWORD: str = ""
|
|
STARROCKS_DATABASE: str = "freeleaps"
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
|
|
|
|
site_settings = SiteSettings()
|