aiteamutils 0.2.28__tar.gz → 0.2.30__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiteamutils
3
- Version: 0.2.28
3
+ Version: 0.2.30
4
4
  Summary: AI Team Utilities
5
5
  Project-URL: Homepage, https://github.com/yourusername/aiteamutils
6
6
  Project-URL: Issues, https://github.com/yourusername/aiteamutils/issues
@@ -52,27 +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 세션을 명시적으로 전달
57
- db_service = get_database_service()
58
- db_service.db = db # 세션 설정
59
-
64
+ db_service = DatabaseService(session=db)
60
65
  repository_class, service_class = service_registry.get(name)
61
-
62
- # 이미 생성된 서비스가 있다면 세션만 업데이트
63
- if hasattr(service_registry, '_instances') and name in service_registry._instances:
64
- service = service_registry._instances[name]
65
- service.db_service.db = db
66
- return service
67
-
68
66
  repository = repository_class(db_service)
69
- instance = service_class(repository, db_service)
70
-
71
- if not hasattr(service_registry, '_instances'):
72
- service_registry._instances = {}
73
- service_registry._instances[name] = instance
74
-
75
- return instance
67
+ return service_class(repository, db_service)
76
68
  return _get_service
77
69
 
78
70
  oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/users/token")
@@ -0,0 +1,2 @@
1
+ """버전 정보"""
2
+ __version__ = "0.2.30"
@@ -1,2 +0,0 @@
1
- """버전 정보"""
2
- __version__ = "0.2.28"
File without changes
File without changes
File without changes