aiteamutils 0.2.89__py3-none-any.whl → 0.2.91__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_service.py +16 -2
- aiteamutils/security.py +1 -1
- aiteamutils/version.py +1 -1
- {aiteamutils-0.2.89.dist-info → aiteamutils-0.2.91.dist-info}/METADATA +1 -1
- {aiteamutils-0.2.89.dist-info → aiteamutils-0.2.91.dist-info}/RECORD +6 -6
- {aiteamutils-0.2.89.dist-info → aiteamutils-0.2.91.dist-info}/WHEEL +0 -0
aiteamutils/base_service.py
CHANGED
@@ -46,9 +46,11 @@ class BaseService(Generic[ModelType]):
|
|
46
46
|
org_ulid_position: str = "organization_ulid",
|
47
47
|
role_permission: str = "create"
|
48
48
|
) -> ModelType:
|
49
|
-
await verify_role_permission(request, role_permission)
|
49
|
+
payload = await verify_role_permission(request, role_permission)
|
50
50
|
|
51
51
|
try:
|
52
|
+
body = await request.json()
|
53
|
+
|
52
54
|
async with self.db_session.begin():
|
53
55
|
# 고유 검사 수행
|
54
56
|
if unique_check:
|
@@ -56,6 +58,16 @@ class BaseService(Generic[ModelType]):
|
|
56
58
|
# 외래 키 검사 수행
|
57
59
|
if fk_check:
|
58
60
|
await validate_unique_fields(self.db_session, fk_check, find_value=False)
|
61
|
+
|
62
|
+
if org_ulid_position:
|
63
|
+
organization_ulid = body.get(org_ulid_position)
|
64
|
+
|
65
|
+
if not organization_ulid == payload.get("organization_ulid"):
|
66
|
+
raise CustomException(
|
67
|
+
ErrorCode.INVALID_INPUT,
|
68
|
+
detail="organization_ulid is required",
|
69
|
+
source_function=f"{self.__class__.__name__}.create"
|
70
|
+
)
|
59
71
|
|
60
72
|
result = await self.repository.create(
|
61
73
|
entity_data=entity_data,
|
@@ -187,12 +199,14 @@ class BaseService(Generic[ModelType]):
|
|
187
199
|
limit: int = 100,
|
188
200
|
filters: List[Dict[str, Any]] | None = None,
|
189
201
|
org_ulid_position: str = "organization_ulid",
|
202
|
+
role_permission: str = "list",
|
190
203
|
response_model: Any = None,
|
191
204
|
explicit_joins: Optional[List[Any]] = None,
|
192
205
|
loading_joins: Optional[List[Any]] = None,
|
193
206
|
order: Optional[str] = None,
|
194
|
-
role_permission: str = "list"
|
195
207
|
) -> List[Dict[str, Any]]:
|
208
|
+
payload = await verify_role_permission(request, role_permission)
|
209
|
+
|
196
210
|
try:
|
197
211
|
if order is None:
|
198
212
|
order = "created_at|desc"
|
aiteamutils/security.py
CHANGED
aiteamutils/version.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
"""버전 정보"""
|
2
|
-
__version__ = "0.2.
|
2
|
+
__version__ = "0.2.91"
|
@@ -1,15 +1,15 @@
|
|
1
1
|
aiteamutils/__init__.py,sha256=kRBpRjark0M8ZwFfmKiMFol6CbIILN3WE4f6_P6iIq0,1089
|
2
2
|
aiteamutils/base_model.py,sha256=bnRJJaGXGS3TKxfCWWV3arFjdG0qLsPFDXuguYsDyVM,3008
|
3
3
|
aiteamutils/base_repository.py,sha256=HKcgYyEb0JypojoXBFcIT39hPC5CqnjBkHT__GV-lfQ,4615
|
4
|
-
aiteamutils/base_service.py,sha256=
|
4
|
+
aiteamutils/base_service.py,sha256=QPehqL8yuShoRr6T7EwlgRln04iOWCd8rWnm4CVJK0w,10018
|
5
5
|
aiteamutils/cache.py,sha256=07xBGlgAwOTAdY5mnMOQJ5EBxVwe8glVD7DkGEkxCtw,1373
|
6
6
|
aiteamutils/config.py,sha256=YdalpJb70-txhGJAS4aaKglEZAFVWgfzw5BXSWpkUz4,3232
|
7
7
|
aiteamutils/database.py,sha256=b4fN0XHNWxMJeS5M95JcJ7tujAJ1x3SPTAfDvJdB4sE,19696
|
8
8
|
aiteamutils/enums.py,sha256=Z9wzR3H4XLpA4U3urR5e4eDnEY3Qhne34nLXsKXiL64,2177
|
9
9
|
aiteamutils/exceptions.py,sha256=wls-R8qbD7fWzEgDDY1Eiy1vXl59R5IsCXTRkZpBiGU,16021
|
10
|
-
aiteamutils/security.py,sha256=
|
10
|
+
aiteamutils/security.py,sha256=HFMaGnvLp_JR2D9AEKpGRMQF2aAjiPdIOF0ysMS1dWk,10853
|
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=PJ1UnX24vSCQ_oIDO0VfRRLdxDepWeHiu724PJ96z5g,42
|
13
|
+
aiteamutils-0.2.91.dist-info/METADATA,sha256=neRTid2ZSl9g5jUO8KUJ2qbvDTMhfcz6FyYc-P48o30,1718
|
14
|
+
aiteamutils-0.2.91.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
15
|
+
aiteamutils-0.2.91.dist-info/RECORD,,
|
File without changes
|