Skip to content

Commit

Permalink
Merge pull request #100 from SWM14-Architect/dev
Browse files Browse the repository at this point in the history
Release v1.1
  • Loading branch information
saebyeok0306 authored Sep 19, 2023
2 parents 51e151a + 6ee7448 commit 3b11826
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
11 changes: 10 additions & 1 deletion moview/repository/input_data/input_data_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,20 @@
from moview.domain.entity.input_data.initial_input_data_document import InitialInputData
from moview.utils.singleton_meta_class import SingletonMeta
from bson import ObjectId
from moview.environment.environment_loader import EnvironmentLoader

DB_HOST = "db-host"
DB_PORT = "db-port"
DB_USERNAME = "db-username"
DB_PASSWORD = "db-password"


class InputDataRepository(metaclass=SingletonMeta):
def __init__(self, mongo_config: MongoConfig):
self.client = MongoClient(mongo_config.host, mongo_config.port)
self.client = MongoClient(host=EnvironmentLoader.getenv(DB_HOST),
port=int(EnvironmentLoader.getenv(DB_PORT)),
username=EnvironmentLoader.getenv(DB_USERNAME),
password=EnvironmentLoader.getenv(DB_PASSWORD))
self.db = self.client[mongo_config.db_name]
self.collection = self.db["input_data"]

Expand Down
11 changes: 10 additions & 1 deletion moview/repository/interview_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@
from moview.utils.singleton_meta_class import SingletonMeta
from moview.config.loggers.mongo_logger import execution_trace_logger
from moview.domain.entity.interview_session_document import InterviewSession
from moview.environment.environment_loader import EnvironmentLoader

DB_HOST = "db-host"
DB_PORT = "db-port"
DB_USERNAME = "db-username"
DB_PASSWORD = "db-password"


class InterviewRepository(metaclass=SingletonMeta):
def __init__(self, mongo_config: MongoConfig):
self.client = MongoClient(mongo_config.host, mongo_config.port)
self.client = MongoClient(host=EnvironmentLoader.getenv(DB_HOST),
port=int(EnvironmentLoader.getenv(DB_PORT)),
username=EnvironmentLoader.getenv(DB_USERNAME),
password=EnvironmentLoader.getenv(DB_PASSWORD))
self.db = self.client[mongo_config.db_name]
self.collection = self.db["interview"]

Expand Down
11 changes: 10 additions & 1 deletion moview/repository/question_answer/question_answer_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,20 @@
from moview.domain.entity.question_answer.question import Question
from moview.domain.entity.question_answer.answer import Answer
from moview.config.loggers.mongo_logger import execution_trace_logger, error_logger
from moview.environment.environment_loader import EnvironmentLoader

DB_HOST = "db-host"
DB_PORT = "db-port"
DB_USERNAME = "db-username"
DB_PASSWORD = "db-password"


class QuestionAnswerRepository(metaclass=SingletonMeta):
def __init__(self, mongo_config: MongoConfig):
self.client = MongoClient(mongo_config.host, mongo_config.port)
self.client = MongoClient(host=EnvironmentLoader.getenv(DB_HOST),
port=int(EnvironmentLoader.getenv(DB_PORT)),
username=EnvironmentLoader.getenv(DB_USERNAME),
password=EnvironmentLoader.getenv(DB_PASSWORD))
self.db = self.client[mongo_config.db_name]
self.collection = self.db["question_answer"]

Expand Down

0 comments on commit 3b11826

Please sign in to comment.