-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #385 from tukcomCD2024/develop_back_animation
feat : develop_back_animation -> develop_back
- Loading branch information
Showing
24 changed files
with
415 additions
and
297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import celery_app | ||
__all__ = ('celery_app',) |
143 changes: 69 additions & 74 deletions
143
backend/AnimatedDrawings/application/animation_queue.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 16 additions & 13 deletions
29
backend/AnimatedDrawings/application/config/database_config.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
from urllib.parse import urlparse, quote_plus | ||
from sqlalchemy import URL | ||
|
||
from application.config.root_config import RootConfig | ||
|
||
|
||
class DatabaseConfig(RootConfig): | ||
def __init__(self): | ||
self._db_username = self._config_file['spring']['datasource'][ | ||
'username'] | ||
self._db_password = self._config_file['spring']['datasource'][ | ||
'password'] | ||
self._db_url = urlparse( | ||
self._config_file['spring']['datasource']['url']) | ||
class DatabaseConfig: | ||
USER_NAME = RootConfig.CONFIG_FILE['database']['username'] | ||
PASSWORD = RootConfig.CONFIG_FILE['database']['password'] | ||
DB_URL = RootConfig.CONFIG_FILE['database']['url'] | ||
DB_NAME = RootConfig.CONFIG_FILE['database']['database_name'] | ||
|
||
def get_database_url(self) -> str: | ||
url = self._db_url.path.split("//")[1] | ||
return 'mysql+pymysql://%s:%s@%s' % ( | ||
self._db_username, quote_plus(self._db_password), url) | ||
@staticmethod | ||
def get_database_url() -> URL: | ||
url_object = URL.create( | ||
"mysql+pymysql", | ||
username=DatabaseConfig.USER_NAME, | ||
password=DatabaseConfig.PASSWORD, | ||
host=DatabaseConfig.DB_URL, | ||
database=DatabaseConfig.DB_NAME | ||
) | ||
return url_object |
18 changes: 4 additions & 14 deletions
18
backend/AnimatedDrawings/application/config/flowerconfig.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,9 @@ | ||
from application.config.root_config import RootConfig | ||
|
||
|
||
class FlowerConfig(RootConfig): | ||
def __init__(self): | ||
self._username = self._config_file['flower']['username'] | ||
self._password = self._config_file['flower']['password'] | ||
class FlowerConfig: | ||
USERNAME = RootConfig.CONFIG_FILE['flower']['username'] | ||
PASSWORD = RootConfig.CONFIG_FILE['flower']['password'] | ||
|
||
@property | ||
def username(self): | ||
return self._username | ||
|
||
@property | ||
def password(self): | ||
return self._password | ||
|
||
|
||
config = FlowerConfig() | ||
basic_auth = "%s:%s" % (config.username, config.password) | ||
basic_auth = f'{FlowerConfig.USERNAME}:{FlowerConfig.PASSWORD}' |
10 changes: 10 additions & 0 deletions
10
backend/AnimatedDrawings/application/config/logger_config.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from application.config.root_config import RootConfig | ||
|
||
|
||
class LoggerConfig: | ||
LOGGING_LEVEL = RootConfig.CONFIG_FILE['logging']['level'] | ||
CELERY_OUTPUT_FILE_PATH = RootConfig.CONFIG_FILE['logging'][ | ||
'celery_output_file_path'] | ||
APPLICATION_OUTPUT_FILE_PATH = RootConfig.CONFIG_FILE['logging'][ | ||
'application_output_file_path'] | ||
FORMAT_STRING = RootConfig.CONFIG_FILE['logging']['format'] |
41 changes: 22 additions & 19 deletions
41
backend/AnimatedDrawings/application/config/queue_config.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,27 @@ | ||
from application.config.root_config import RootConfig | ||
|
||
|
||
class QueueConfig(RootConfig): | ||
def __init__(self): | ||
self._queue_username = self._config_file['spring']['rabbitmq']['username'] | ||
self._queue_host = self._config_file['spring']['rabbitmq']['host'] | ||
self._queue_password = self._config_file['spring']['rabbitmq']['password'] | ||
self._queue_virtual_host = self._config_file['spring']['rabbitmq']['virtual-host'] | ||
self._queue_name = 'capsuleSkin_delay.queue' | ||
class QueueConfig: | ||
USERNAME = RootConfig.CONFIG_FILE['rabbitmq']['username'] | ||
BROKER_HOST = RootConfig.CONFIG_FILE['rabbitmq']['host'] | ||
PASSWORD = RootConfig.CONFIG_FILE['rabbitmq']['password'] | ||
VIRTUAL_HOST = RootConfig.CONFIG_FILE['rabbitmq']['virtual-host'] | ||
CAPSULE_SKIN_REQUEST_QUEUE_NAME = RootConfig.CONFIG_FILE['rabbitmq'][ | ||
'queue_name'] | ||
CAPSULE_SKIN_REQUEST_EXCHANGE_NAME = RootConfig.CONFIG_FILE['rabbitmq'][ | ||
'exchange_name'] | ||
NOTIFICATION_EXCHANGE_NAME = RootConfig.CONFIG_FILE['rabbitmq'][ | ||
'notification_exchange_name'] | ||
NOTIFICATION_QUEUE_NAME = RootConfig.CONFIG_FILE['rabbitmq'][ | ||
'notification_queue_name'] | ||
|
||
def get_queue_url(self) -> str: | ||
return 'pyamqp://%s:%s@%s:5672%s' % (self._queue_username, | ||
self._queue_password, | ||
self._queue_host, | ||
self._queue_virtual_host) | ||
@staticmethod | ||
def get_celery_broker_url() -> str: | ||
return 'pyamqp://%s:%s@%s:5672%s' % (QueueConfig.USERNAME, | ||
QueueConfig.PASSWORD, | ||
QueueConfig.BROKER_HOST, | ||
QueueConfig.VIRTUAL_HOST) | ||
|
||
@property | ||
def queue_name(self) -> str: | ||
return self._queue_name | ||
|
||
@property | ||
def queue_host(self) -> str: | ||
return self._queue_host | ||
@staticmethod | ||
def get_kombu_broker_url() -> str: | ||
return f'amqp://{QueueConfig.USERNAME}:{QueueConfig.PASSWORD}@{QueueConfig.BROKER_HOST}/{QueueConfig.VIRTUAL_HOST}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.