feat: 新增告警、成本、配额、微信模块及缓存服务
All checks were successful
continuous-integration/drone/push Build is passing

- 新增告警模块 (alerts): 告警规则配置与触发
- 新增成本管理模块 (cost): 成本统计与分析
- 新增配额模块 (quota): 配额管理与限制
- 新增微信模块 (wechat): 微信相关功能接口
- 新增缓存服务 (cache): Redis 缓存封装
- 新增请求日志中间件 (request_logger)
- 新增异常处理和链路追踪中间件
- 更新 dashboard 前端展示
- 更新 SDK stats_client 功能
This commit is contained in:
111
2026-01-24 16:53:47 +08:00
parent eab2533c36
commit 6c6c48cf71
29 changed files with 4607 additions and 41 deletions

View File

@@ -2,6 +2,7 @@
import os
from functools import lru_cache
from pydantic_settings import BaseSettings
from typing import Optional
class Settings(BaseSettings):
@@ -14,6 +15,10 @@ class Settings(BaseSettings):
# 数据库
DATABASE_URL: str = "mysql+pymysql://scrm_reader:ScrmReader2024Pass@47.107.71.55:3306/new_qiqi"
# Redis
REDIS_URL: str = "redis://localhost:6379/0"
REDIS_PREFIX: str = "platform:"
# API Key内部服务调用
API_KEY: str = "platform_api_key_2026"
@@ -29,6 +34,10 @@ class Settings(BaseSettings):
# 配置加密密钥
CONFIG_ENCRYPT_KEY: str = "platform_config_key_32bytes!!"
# 企业微信配置
WECHAT_ACCESS_TOKEN_EXPIRE: int = 7000 # access_token缓存时间(秒)企微有效期7200秒
WECHAT_JSAPI_TICKET_EXPIRE: int = 7000 # jsapi_ticket缓存时间(秒)
class Config:
env_file = ".env"
extra = "ignore"