Merge commit 'b6cc7651c425ec09e3efff3d809a57ae13d245ae'
This commit is contained in:
@@ -4,6 +4,7 @@ from pydantic_settings import BaseSettings,SettingsConfigDict
|
|||||||
class Settings(BaseSettings):
|
class Settings(BaseSettings):
|
||||||
model_config = SettingsConfigDict(env_file=".env" , env_prefix="WNZS_")
|
model_config = SettingsConfigDict(env_file=".env" , env_prefix="WNZS_")
|
||||||
PGSQL: str = ""
|
PGSQL: str = ""
|
||||||
|
WECOM_PROXY: str = ""
|
||||||
WECOM_CORPID: str = ""
|
WECOM_CORPID: str = ""
|
||||||
WECOM_CORPSECRET: str = ""
|
WECOM_CORPSECRET: str = ""
|
||||||
WECOM_APP_TOKEN: str = ""
|
WECOM_APP_TOKEN: str = ""
|
||||||
|
|||||||
@@ -3,7 +3,13 @@ from config import Settings
|
|||||||
from utils.sing import SingletonProvider
|
from utils.sing import SingletonProvider
|
||||||
|
|
||||||
# 获取单例函数
|
# 获取单例函数
|
||||||
|
def get_wecom_single() -> Wecom:
|
||||||
|
wecom = Wecom(
|
||||||
|
Settings().WECOM_CORPID,Settings().WECOM_CORPSECRET
|
||||||
|
)
|
||||||
|
WECOM_PROXY = Settings().WECOM_PROXY
|
||||||
|
if WECOM_PROXY and WECOM_PROXY != "":
|
||||||
|
wecom.BASE_URL = WECOM_PROXY
|
||||||
|
return wecom
|
||||||
|
|
||||||
get_wecom = SingletonProvider(lambda: Wecom(
|
get_wecom = SingletonProvider(get_wecom_single)
|
||||||
Settings().WECOM_CORPID,Settings().WECOM_CORPSECRET
|
|
||||||
))
|
|
||||||
Reference in New Issue
Block a user