aiteamutils 0.2.64__py3-none-any.whl → 0.2.65__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aiteamutils/base_repository.py +0 -16
- aiteamutils/base_service.py +5 -18
- aiteamutils/version.py +1 -1
- {aiteamutils-0.2.64.dist-info → aiteamutils-0.2.65.dist-info}/METADATA +1 -1
- {aiteamutils-0.2.64.dist-info → aiteamutils-0.2.65.dist-info}/RECORD +6 -6
- {aiteamutils-0.2.64.dist-info → aiteamutils-0.2.65.dist-info}/WHEEL +0 -0
aiteamutils/base_repository.py
CHANGED
@@ -13,24 +13,8 @@ ModelType = TypeVar("ModelType", bound=DeclarativeBase)
|
|
13
13
|
|
14
14
|
class BaseRepository(Generic[ModelType]):
|
15
15
|
def __init__(self, session: AsyncSession, model: Type[ModelType]):
|
16
|
-
if session is None:
|
17
|
-
raise CustomException(
|
18
|
-
ErrorCode.DB_CONNECTION_ERROR,
|
19
|
-
detail="Database session is not set",
|
20
|
-
source_function=f"{self.__class__.__name__}.session"
|
21
|
-
)
|
22
|
-
if model is None:
|
23
|
-
raise CustomException(
|
24
|
-
ErrorCode.DB_CONNECTION_ERROR,
|
25
|
-
detail="Model is not set",
|
26
|
-
source_function=f"{self.__class__.__name__}.model"
|
27
|
-
)
|
28
|
-
print(f"BaseRepository.__init__() called with session: {session} and model: {model}")
|
29
|
-
|
30
16
|
self._session = session
|
31
17
|
self.model = model
|
32
|
-
|
33
|
-
print(f"BaseRepository initialized with session: {session} and model: {model}")
|
34
18
|
|
35
19
|
@property
|
36
20
|
def session(self) -> AsyncSession:
|
aiteamutils/base_service.py
CHANGED
@@ -18,28 +18,13 @@ class BaseService(Generic[ModelType]):
|
|
18
18
|
self,
|
19
19
|
model: Type[ModelType],
|
20
20
|
repository: BaseRepository[ModelType],
|
21
|
-
db_session: AsyncSession
|
21
|
+
db_session: AsyncSession,
|
22
|
+
additional_models: Dict[str, Type[DeclarativeBase]] = None,
|
22
23
|
):
|
23
|
-
if not repository:
|
24
|
-
raise CustomException(
|
25
|
-
ErrorCode.INVALID_REQUEST,
|
26
|
-
detail="Repository is not set",
|
27
|
-
source_function=f"{self.__class__.__name__}.__init__"
|
28
|
-
)
|
29
|
-
if not db_session:
|
30
|
-
raise CustomException(
|
31
|
-
ErrorCode.INVALID_REQUEST,
|
32
|
-
detail="Database session is not set",
|
33
|
-
source_function=f"{self.__class__.__name__}.__init__"
|
34
|
-
)
|
35
|
-
print(f"BaseService.__init__() called with repository: {repository} and db_session: {db_session}")
|
36
|
-
|
37
|
-
|
38
24
|
self.model = model
|
39
25
|
self.repository = repository
|
40
26
|
self.db_session = db_session
|
41
|
-
|
42
|
-
print(f"BaseService initialized with repository: {repository} and db_session: {db_session}")
|
27
|
+
self.additional_models = additional_models or {},
|
43
28
|
|
44
29
|
async def list(
|
45
30
|
self,
|
@@ -48,6 +33,8 @@ class BaseService(Generic[ModelType]):
|
|
48
33
|
filters: Dict[str, Any] | None = None,
|
49
34
|
search_params: Dict[str, Any] | None = None,
|
50
35
|
model_name: str | None = None,
|
36
|
+
request: Request | None = None,
|
37
|
+
response_model: Any = None
|
51
38
|
) -> List[Dict[str, Any]]:
|
52
39
|
try:
|
53
40
|
# 모델 이름을 통한 동적 처리
|
aiteamutils/version.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
"""버전 정보"""
|
2
|
-
__version__ = "0.2.
|
2
|
+
__version__ = "0.2.65"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
aiteamutils/__init__.py,sha256=kRBpRjark0M8ZwFfmKiMFol6CbIILN3WE4f6_P6iIq0,1089
|
2
2
|
aiteamutils/base_model.py,sha256=ODEnjvUVoxQ1RPCfq8-uZTfTADIA4c7Z3E6G4EVsSX0,2708
|
3
|
-
aiteamutils/base_repository.py,sha256=
|
4
|
-
aiteamutils/base_service.py,sha256=
|
3
|
+
aiteamutils/base_repository.py,sha256=sPEUnXCXdkdBp23LKLOQVrPBUCZ5HbS9jHG8PLN9iFc,1539
|
4
|
+
aiteamutils/base_service.py,sha256=nppwL5D0Vc-BAnD63cPKU8MxjKxy3EL7v8f1iQ7SYJc,2423
|
5
5
|
aiteamutils/cache.py,sha256=07xBGlgAwOTAdY5mnMOQJ5EBxVwe8glVD7DkGEkxCtw,1373
|
6
6
|
aiteamutils/config.py,sha256=YdalpJb70-txhGJAS4aaKglEZAFVWgfzw5BXSWpkUz4,3232
|
7
7
|
aiteamutils/database.py,sha256=MtmrX_pDzKFQM-P3OAfm2mALvhRg-v5JWtGBoiegeU0,1484
|
@@ -9,7 +9,7 @@ aiteamutils/enums.py,sha256=ipZi6k_QD5-3QV7Yzv7bnL0MjDz-vqfO9I5L77biMKs,632
|
|
9
9
|
aiteamutils/exceptions.py,sha256=_lKWXq_ujNj41xN6LDE149PwsecAP7lgYWbOBbLOntg,15368
|
10
10
|
aiteamutils/security.py,sha256=xFVrjttxwXB1TTjqgRQQgQJQohQBT28vuW8FVLjvi-M,10103
|
11
11
|
aiteamutils/validators.py,sha256=PvI9hbMEAqTawgxPbiWRyx2r9yTUrpNBQs1AD3w4F2U,7726
|
12
|
-
aiteamutils/version.py,sha256=
|
13
|
-
aiteamutils-0.2.
|
14
|
-
aiteamutils-0.2.
|
15
|
-
aiteamutils-0.2.
|
12
|
+
aiteamutils/version.py,sha256=E7-idFYDXPCtYKATwYOhcuxe0eMgtGyLKhLM9MWca7E,42
|
13
|
+
aiteamutils-0.2.65.dist-info/METADATA,sha256=eZemHrikhA7qP--ukXBbmrLsE6VyfXH_lxvGziAa7sU,1718
|
14
|
+
aiteamutils-0.2.65.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
15
|
+
aiteamutils-0.2.65.dist-info/RECORD,,
|
File without changes
|