feat(交易记录): 新增交易记录管理页面与API接口 feat(上传): 添加统一上传接口支持自动识别文件类型 feat(用户管理): 为用户模型添加备注字段并更新相关接口 feat(邮件): 实现SMTP邮件发送功能并添加测试脚本 feat(短信): 增强短信服务配置灵活性与日志记录 fix(发票): 修复发票列表时间筛选功能 fix(nginx): 调整上传大小限制与超时配置 docs: 添加多个功能模块的说明文档 docs(估值): 补充估值计算流程与API提交数据说明 chore: 更新依赖与Docker镜像版本
118 lines
4.8 KiB
Python
118 lines
4.8 KiB
Python
import os
|
|
import typing
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
VERSION: str = "0.1.0"
|
|
APP_TITLE: str = "Vue FastAPI Admin"
|
|
PROJECT_NAME: str = "Vue FastAPI Admin"
|
|
APP_DESCRIPTION: str = "Description"
|
|
|
|
CORS_ORIGINS: typing.List = ["*"]
|
|
CORS_ALLOW_CREDENTIALS: bool = True
|
|
CORS_ALLOW_METHODS: typing.List = ["*"]
|
|
CORS_ALLOW_HEADERS: typing.List = ["*"]
|
|
|
|
DEBUG: bool = True
|
|
|
|
# 服务器配置
|
|
SERVER_HOST: str = "https://value.cdcee.net"
|
|
SERVER_PORT: int = 9999
|
|
BASE_URL: str = f"{SERVER_HOST}"
|
|
|
|
PROJECT_ROOT: str = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
|
|
BASE_DIR: str = os.path.abspath(os.path.join(PROJECT_ROOT, os.pardir))
|
|
LOGS_ROOT: str = os.path.join(BASE_DIR, "app/logs")
|
|
SECRET_KEY: str = "3488a63e1765035d386f05409663f55c83bfae3b3c61a932744b20ad14244dcf" # openssl rand -hex 32
|
|
JWT_ALGORITHM: str = "HS256"
|
|
JWT_ACCESS_TOKEN_EXPIRE_MINUTES: int = 60 * 24 * 7 # 7 day
|
|
TORTOISE_ORM: dict = {
|
|
"connections": {
|
|
# SQLite configuration
|
|
# "sqlite": {
|
|
# "engine": "tortoise.backends.sqlite",
|
|
# "credentials": {"file_path": f"{BASE_DIR}/db.sqlite3"}, # Path to SQLite database file
|
|
# },
|
|
# MySQL/MariaDB configuration
|
|
# Install with: tortoise-orm[asyncmy]
|
|
"mysql": {
|
|
"engine": "tortoise.backends.mysql",
|
|
"credentials": {
|
|
"host": "sh-cynosdbmysql-grp-88th45wy.sql.tencentcdb.com", # Database host address
|
|
"port": 28555, # Database port
|
|
"user": "root", # Database username
|
|
"password": "api2api..", # Database password
|
|
"database": "valuation_service", # Database name
|
|
},
|
|
},
|
|
# PostgreSQL configuration
|
|
# Install with: tortoise-orm[asyncpg]
|
|
# "postgres": {
|
|
# "engine": "tortoise.backends.asyncpg",
|
|
# "credentials": {
|
|
# "host": "localhost", # Database host address
|
|
# "port": 5432, # Database port
|
|
# "user": "yourusername", # Database username
|
|
# "password": "yourpassword", # Database password
|
|
# "database": "yourdatabase", # Database name
|
|
# },
|
|
# },
|
|
# MSSQL/Oracle configuration
|
|
# Install with: tortoise-orm[asyncodbc]
|
|
# "oracle": {
|
|
# "engine": "tortoise.backends.asyncodbc",
|
|
# "credentials": {
|
|
# "host": "localhost", # Database host address
|
|
# "port": 1433, # Database port
|
|
# "user": "yourusername", # Database username
|
|
# "password": "yourpassword", # Database password
|
|
# "database": "yourdatabase", # Database name
|
|
# },
|
|
# },
|
|
# SQLServer configuration
|
|
# Install with: tortoise-orm[asyncodbc]
|
|
# "sqlserver": {
|
|
# "engine": "tortoise.backends.asyncodbc",
|
|
# "credentials": {
|
|
# "host": "localhost", # Database host address
|
|
# "port": 1433, # Database port
|
|
# "user": "yourusername", # Database username
|
|
# "password": "yourpassword", # Database password
|
|
# "database": "yourdatabase", # Database name
|
|
# },
|
|
# },
|
|
},
|
|
"apps": {
|
|
"models": {
|
|
"models": ["app.models", "aerich.models"],
|
|
"default_connection": "mysql",
|
|
},
|
|
},
|
|
"use_tz": False, # Whether to use timezone-aware datetimes
|
|
"timezone": "Asia/Shanghai", # Timezone setting
|
|
}
|
|
DATETIME_FORMAT: str = "%Y-%m-%d %H:%M:%S"
|
|
|
|
ALIBABA_CLOUD_ACCESS_KEY_ID: typing.Optional[str] = "LTAI5tA8gcgM8Qc7K9qCtmXg"
|
|
ALIBABA_CLOUD_ACCESS_KEY_SECRET: typing.Optional[str] = "eWZIWi6xILGtmPSGyJEAhILX5fQx0h"
|
|
ALIYUN_SMS_SIGN_NAME: typing.Optional[str] = "成都文化产权交易所"
|
|
ALIYUN_SMS_ENDPOINT: str = "dysmsapi.aliyuncs.com"
|
|
ALIYUN_SMS_TEMPLATE_CODE_VERIFY: typing.Optional[str] = "SMS_498140213"
|
|
ALIYUN_SMS_TEMPLATE_CODE_REPORT: typing.Optional[str] = "SMS_49190229"
|
|
SMS_CODE_DIGITS: int = 6
|
|
SMS_DEBUG_LOG_CODE: bool = True
|
|
ALIYUN_USE_DEFAULT_CREDENTIALS: bool = False
|
|
ALIYUN_SMS_TEMPLATE_PARAM_CODE_KEY: typing.Optional[str] = "code"
|
|
|
|
SMTP_HOST: typing.Optional[str] = None
|
|
SMTP_PORT: typing.Optional[int] = None
|
|
SMTP_USERNAME: typing.Optional[str] = None
|
|
SMTP_PASSWORD: typing.Optional[str] = None
|
|
SMTP_TLS: bool = True
|
|
SMTP_FROM: typing.Optional[str] = None
|
|
|
|
|
|
settings = Settings()
|