aiteamutils 0.2.29__tar.gz → 0.2.30__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {aiteamutils-0.2.29 → aiteamutils-0.2.30}/PKG-INFO +1 -1
- {aiteamutils-0.2.29 → aiteamutils-0.2.30}/aiteamutils/dependencies.py +12 -16
- aiteamutils-0.2.30/aiteamutils/version.py +2 -0
- aiteamutils-0.2.29/aiteamutils/version.py +0 -2
- {aiteamutils-0.2.29 → aiteamutils-0.2.30}/.gitignore +0 -0
- {aiteamutils-0.2.29 → aiteamutils-0.2.30}/README.md +0 -0
- {aiteamutils-0.2.29 → aiteamutils-0.2.30}/aiteamutils/__init__.py +0 -0
- {aiteamutils-0.2.29 → aiteamutils-0.2.30}/aiteamutils/base_model.py +0 -0
- {aiteamutils-0.2.29 → aiteamutils-0.2.30}/aiteamutils/base_repository.py +0 -0
- {aiteamutils-0.2.29 → aiteamutils-0.2.30}/aiteamutils/base_service.py +0 -0
- {aiteamutils-0.2.29 → aiteamutils-0.2.30}/aiteamutils/cache.py +0 -0
- {aiteamutils-0.2.29 → aiteamutils-0.2.30}/aiteamutils/config.py +0 -0
- {aiteamutils-0.2.29 → aiteamutils-0.2.30}/aiteamutils/database.py +0 -0
- {aiteamutils-0.2.29 → aiteamutils-0.2.30}/aiteamutils/enums.py +0 -0
- {aiteamutils-0.2.29 → aiteamutils-0.2.30}/aiteamutils/exceptions.py +0 -0
- {aiteamutils-0.2.29 → aiteamutils-0.2.30}/aiteamutils/security.py +0 -0
- {aiteamutils-0.2.29 → aiteamutils-0.2.30}/aiteamutils/validators.py +0 -0
- {aiteamutils-0.2.29 → aiteamutils-0.2.30}/pyproject.toml +0 -0
- {aiteamutils-0.2.29 → aiteamutils-0.2.30}/setup.py +0 -0
@@ -52,23 +52,19 @@ class ServiceRegistry:
|
|
52
52
|
service_registry = ServiceRegistry()
|
53
53
|
|
54
54
|
def get_service(name: str):
|
55
|
+
"""등록된 서비스를 가져오는 의존성 함수
|
56
|
+
|
57
|
+
Args:
|
58
|
+
name (str): 서비스 이름
|
59
|
+
|
60
|
+
Returns:
|
61
|
+
Callable: 서비스 인스턴스를 반환하는 의존성 함수
|
62
|
+
"""
|
55
63
|
def _get_service(db: AsyncSession = Depends(get_db)):
|
56
|
-
db_service =
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
if not hasattr(service_registry, '_instances'):
|
61
|
-
service_registry._instances = {}
|
62
|
-
|
63
|
-
if name not in service_registry._instances:
|
64
|
-
repository_class, service_class = service_registry.get(name)
|
65
|
-
repository = repository_class(db_service)
|
66
|
-
service_registry._instances[name] = service_class(repository, db_service)
|
67
|
-
else:
|
68
|
-
# 기존 서비스의 db 세션 업데이트
|
69
|
-
service_registry._instances[name].db_service.db = db
|
70
|
-
|
71
|
-
return service_registry._instances[name]
|
64
|
+
db_service = DatabaseService(session=db)
|
65
|
+
repository_class, service_class = service_registry.get(name)
|
66
|
+
repository = repository_class(db_service)
|
67
|
+
return service_class(repository, db_service)
|
72
68
|
return _get_service
|
73
69
|
|
74
70
|
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/users/token")
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|