Config and Service initilaized
This commit is contained in:
18
AllConfigs/Email/configs.py
Normal file
18
AllConfigs/Email/configs.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from AllConfigs import HostConfig
|
||||
|
||||
|
||||
class EmailConfig:
|
||||
EMAIL_HOST: str = HostConfig.EMAIL_HOST
|
||||
EMAIL_USERNAME: str = "karatay@mehmetkaratay.com.tr"
|
||||
EMAIL_PASSWORD: str = "system"
|
||||
EMAIL_PORT: int = 587
|
||||
EMAIL_SEND: bool = False
|
||||
|
||||
@classmethod
|
||||
def as_dict(cls):
|
||||
return dict(
|
||||
host=EmailConfig.EMAIL_HOST,
|
||||
port=EmailConfig.EMAIL_PORT,
|
||||
username=EmailConfig.EMAIL_USERNAME,
|
||||
password=EmailConfig.EMAIL_PASSWORD,
|
||||
)
|
||||
12
AllConfigs/Email/email_send_model.py
Normal file
12
AllConfigs/Email/email_send_model.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import List, Dict, Optional
|
||||
|
||||
class EmailSendModel(BaseModel):
|
||||
subject: str
|
||||
html: str = ""
|
||||
receivers: List[str]
|
||||
text: Optional[str] = ""
|
||||
cc: Optional[List[str]] = None
|
||||
bcc: Optional[List[str]] = None
|
||||
headers: Optional[Dict] = None
|
||||
attachments: Optional[Dict] = None
|
||||
10
AllConfigs/NoSqlDatabase/configs.py
Normal file
10
AllConfigs/NoSqlDatabase/configs.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from AllConfigs import HostConfig
|
||||
|
||||
|
||||
class MongoConfig:
|
||||
PASSWORD = "mongo_password"
|
||||
USER_NAME = "mongo_user"
|
||||
DATABASE_NAME = "mongo_database"
|
||||
HOST = HostConfig.MAIN_HOST
|
||||
PORT = 11777
|
||||
URL = f"mongodb://{USER_NAME}:{PASSWORD}@{HOST}:{PORT}/{DATABASE_NAME}?retryWrites=true&w=majority"
|
||||
8
AllConfigs/Redis/configs.py
Normal file
8
AllConfigs/Redis/configs.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from AllConfigs import HostConfig
|
||||
|
||||
|
||||
class WagRedis:
|
||||
REDIS_HOST = HostConfig.MAIN_HOST
|
||||
REDIS_PASSWORD: str = "commercial_redis_password"
|
||||
REDIS_PORT: int = 11222
|
||||
REDIS_DB: int = 0
|
||||
11
AllConfigs/SqlDatabase/configs.py
Normal file
11
AllConfigs/SqlDatabase/configs.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from AllConfigs import HostConfig
|
||||
|
||||
|
||||
class WagDatabase:
|
||||
HOST: str = HostConfig.MAIN_HOST
|
||||
PORT: str = "5444"
|
||||
SQL: str = "postgresql+psycopg2"
|
||||
USERNAME: str = "berkay_wag_user"
|
||||
PASSWORD: str = "berkay_wag_user_password"
|
||||
DATABASE_NAME: str = "wag_database"
|
||||
DATABASE_URL: str = f"{SQL}://{USERNAME}:{PASSWORD}@{HOST}:{PORT}/{DATABASE_NAME}"
|
||||
3
AllConfigs/__init__.py
Normal file
3
AllConfigs/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from .main import HostConfig
|
||||
|
||||
__all__ = ["HostConfig"]
|
||||
3
AllConfigs/main.py
Normal file
3
AllConfigs/main.py
Normal file
@@ -0,0 +1,3 @@
|
||||
class HostConfig:
|
||||
MAIN_HOST = "10.10.2.36" # http://10.10.2.36
|
||||
EMAIL_HOST = "10.10.2.34" # http://10.10.2.34
|
||||
Reference in New Issue
Block a user