aiteamutils 0.2.25__py3-none-any.whl → 0.2.27__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -52,19 +52,22 @@ class ServiceRegistry:
52
52
  service_registry = ServiceRegistry()
53
53
 
54
54
  def get_service(name: str):
55
- def _get_service():
56
- # 글로벌 DatabaseService 사용
55
+ def _get_service(db: AsyncSession = Depends(get_db)):
56
+ # db 세션을 명시적으로 전달
57
57
  db_service = get_database_service()
58
+ db_service.db = db # 세션 설정
59
+
58
60
  repository_class, service_class = service_registry.get(name)
59
61
 
60
- # 이미 생성된 서비스가 있다면 재사용
62
+ # 이미 생성된 서비스가 있다면 세션만 업데이트
61
63
  if hasattr(service_registry, '_instances') and name in service_registry._instances:
62
- return service_registry._instances[name]
64
+ service = service_registry._instances[name]
65
+ service.db_service.db = db
66
+ return service
63
67
 
64
68
  repository = repository_class(db_service)
65
69
  instance = service_class(repository, db_service)
66
70
 
67
- # 생성된 인스턴스 캐싱
68
71
  if not hasattr(service_registry, '_instances'):
69
72
  service_registry._instances = {}
70
73
  service_registry._instances[name] = instance
aiteamutils/security.py CHANGED
@@ -1,6 +1,7 @@
1
1
  """보안 관련 유틸리티."""
2
2
  from datetime import datetime, timedelta, UTC
3
- from typing import Dict, Any, Optional, Literal, Callable, Type, Base
3
+ from typing import Dict, Any, Optional, Literal, Callable, Type
4
+ from sqlalchemy.orm import DeclarativeBase as Base
4
5
  from fastapi import Request, HTTPException, status
5
6
  from functools import wraps
6
7
  from jose import jwt, JWTError
aiteamutils/version.py CHANGED
@@ -1,2 +1,2 @@
1
1
  """버전 정보"""
2
- __version__ = "0.2.25"
2
+ __version__ = "0.2.27"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiteamutils
3
- Version: 0.2.25
3
+ Version: 0.2.27
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
@@ -5,12 +5,12 @@ aiteamutils/base_service.py,sha256=E4dHGE0DvhmRyFplh46SwKJOSF_nUL7OAsCkf_ZJF_8,2
5
5
  aiteamutils/cache.py,sha256=tr0Yn8VPYA9QHiKCUzciVlQ2J1RAwNo2K9lGMH4rY3s,1334
6
6
  aiteamutils/config.py,sha256=7pJHBml8RRXC9FpoRBx0emofFkvtxsyk9_Rcur2F9hI,2724
7
7
  aiteamutils/database.py,sha256=raYKRZjEfefM3SnoPYozPu7OUGm62XWOUqZzN4_cayw,33479
8
- aiteamutils/dependencies.py,sha256=VIpy8InbmSd0yOtQYMnn-0rz8yVQwHHbB1xK9Gc7WOw,4275
8
+ aiteamutils/dependencies.py,sha256=ePSS0SS6FyI2DAS_L-f4NyWhYis3wkncC-gYbWdagZw,4407
9
9
  aiteamutils/enums.py,sha256=ipZi6k_QD5-3QV7Yzv7bnL0MjDz-vqfO9I5L77biMKs,632
10
10
  aiteamutils/exceptions.py,sha256=YV-ISya4wQlHk4twvGo16I5r8h22-tXpn9wa-b3WwDM,15231
11
- aiteamutils/security.py,sha256=t1xdvfy2qpggiQGr89AMuRKvWK1UFMxJiJYAE5Lek7o,13453
11
+ aiteamutils/security.py,sha256=jxJsWSjJOMVlNaBFxroIXrAgseJYKl_vQ_kfmHblPIA,13498
12
12
  aiteamutils/validators.py,sha256=3N245cZFjgwtW_KzjESkizx5BBUDaJLbbxfNO4WOFZ0,7764
13
- aiteamutils/version.py,sha256=twTFpzolvc7RqGZVG8NMtyztFRFxTGhSsOxiknGfolo,44
14
- aiteamutils-0.2.25.dist-info/METADATA,sha256=1adRJ-4J_keHTi-Oga8lzoqbUAsqG-pymSUuhQmxmlc,1718
15
- aiteamutils-0.2.25.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
16
- aiteamutils-0.2.25.dist-info/RECORD,,
13
+ aiteamutils/version.py,sha256=pDhMx7JxvUYJ3Q1O9SWtrBCnQFZY2593mC2NvfP1YN4,43
14
+ aiteamutils-0.2.27.dist-info/METADATA,sha256=iA35UWdpZDFcEoh-6Ra3eAWzFe_Q86CoiX0lZkGEKQI,1718
15
+ aiteamutils-0.2.27.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
16
+ aiteamutils-0.2.27.dist-info/RECORD,,