style: 使用ruff格式化config模块,优化导入
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
import argparse
|
||||
from pydantic_settings import BaseSettings
|
||||
from functools import lru_cache
|
||||
from dotenv import load_dotenv
|
||||
from functools import lru_cache
|
||||
from pydantic_settings import BaseSettings
|
||||
|
||||
|
||||
class AppSettings(BaseSettings):
|
||||
"""
|
||||
应用配置
|
||||
"""
|
||||
|
||||
app_env: str = 'dev'
|
||||
app_name: str = 'RuoYi-FasAPI'
|
||||
app_root_path: str = '/dev-api'
|
||||
@@ -25,6 +26,7 @@ class JwtSettings(BaseSettings):
|
||||
"""
|
||||
Jwt配置
|
||||
"""
|
||||
|
||||
jwt_secret_key: str = 'b01c66dc2c58dc6a0aabfe2144256be36226de378bf87f72c0c795dda67f4d55'
|
||||
jwt_algorithm: str = 'HS256'
|
||||
jwt_expire_minutes: int = 1440
|
||||
@@ -35,6 +37,7 @@ class DataBaseSettings(BaseSettings):
|
||||
"""
|
||||
数据库配置
|
||||
"""
|
||||
|
||||
db_host: str = '127.0.0.1'
|
||||
db_port: int = 3306
|
||||
db_username: str = 'root'
|
||||
@@ -51,6 +54,7 @@ class RedisSettings(BaseSettings):
|
||||
"""
|
||||
Redis配置
|
||||
"""
|
||||
|
||||
redis_host: str = '127.0.0.1'
|
||||
redis_port: int = 6379
|
||||
redis_username: str = ''
|
||||
@@ -62,20 +66,38 @@ class UploadSettings:
|
||||
"""
|
||||
上传配置
|
||||
"""
|
||||
|
||||
UPLOAD_PREFIX = '/profile'
|
||||
UPLOAD_PATH = 'vf_admin/upload_path'
|
||||
UPLOAD_MACHINE = 'A'
|
||||
DEFAULT_ALLOWED_EXTENSION = [
|
||||
# 图片
|
||||
"bmp", "gif", "jpg", "jpeg", "png",
|
||||
'bmp',
|
||||
'gif',
|
||||
'jpg',
|
||||
'jpeg',
|
||||
'png',
|
||||
# word excel powerpoint
|
||||
"doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt",
|
||||
'doc',
|
||||
'docx',
|
||||
'xls',
|
||||
'xlsx',
|
||||
'ppt',
|
||||
'pptx',
|
||||
'html',
|
||||
'htm',
|
||||
'txt',
|
||||
# 压缩文件
|
||||
"rar", "zip", "gz", "bz2",
|
||||
'rar',
|
||||
'zip',
|
||||
'gz',
|
||||
'bz2',
|
||||
# 视频格式
|
||||
"mp4", "avi", "rmvb",
|
||||
'mp4',
|
||||
'avi',
|
||||
'rmvb',
|
||||
# pdf
|
||||
"pdf"
|
||||
'pdf',
|
||||
]
|
||||
DOWNLOAD_PATH = 'vf_admin/download_path'
|
||||
|
||||
@@ -90,6 +112,7 @@ class CachePathConfig:
|
||||
"""
|
||||
缓存目录配置
|
||||
"""
|
||||
|
||||
PATH = os.path.join(os.path.abspath(os.getcwd()), 'caches')
|
||||
PATHSTR = 'caches'
|
||||
|
||||
@@ -98,6 +121,7 @@ class RedisInitKeyConfig:
|
||||
"""
|
||||
系统内置Redis键名
|
||||
"""
|
||||
|
||||
ACCESS_TOKEN = {'key': 'access_token', 'remark': '登录令牌信息'}
|
||||
SYS_DICT = {'key': 'sys_dict', 'remark': '数据字典'}
|
||||
SYS_CONFIG = {'key': 'sys_config', 'remark': '配置信息'}
|
||||
|
Reference in New Issue
Block a user