aiteamutils 0.2.155__tar.gz → 0.2.157__tar.gz
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-0.2.155 → aiteamutils-0.2.157}/PKG-INFO +1 -1
- {aiteamutils-0.2.155 → aiteamutils-0.2.157}/aiteamutils/base_service.py +24 -12
- aiteamutils-0.2.157/aiteamutils/version.py +2 -0
- aiteamutils-0.2.155/aiteamutils/version.py +0 -2
- {aiteamutils-0.2.155 → aiteamutils-0.2.157}/.cursorrules +0 -0
- {aiteamutils-0.2.155 → aiteamutils-0.2.157}/.gitignore +0 -0
- {aiteamutils-0.2.155 → aiteamutils-0.2.157}/README.md +0 -0
- {aiteamutils-0.2.155 → aiteamutils-0.2.157}/aiteamutils/__init__.py +0 -0
- {aiteamutils-0.2.155 → aiteamutils-0.2.157}/aiteamutils/base_model.py +0 -0
- {aiteamutils-0.2.155 → aiteamutils-0.2.157}/aiteamutils/base_repository.py +0 -0
- {aiteamutils-0.2.155 → aiteamutils-0.2.157}/aiteamutils/cache.py +0 -0
- {aiteamutils-0.2.155 → aiteamutils-0.2.157}/aiteamutils/config.py +0 -0
- {aiteamutils-0.2.155 → aiteamutils-0.2.157}/aiteamutils/database.py +0 -0
- {aiteamutils-0.2.155 → aiteamutils-0.2.157}/aiteamutils/enums.py +0 -0
- {aiteamutils-0.2.155 → aiteamutils-0.2.157}/aiteamutils/exceptions.py +0 -0
- {aiteamutils-0.2.155 → aiteamutils-0.2.157}/aiteamutils/files.py +0 -0
- {aiteamutils-0.2.155 → aiteamutils-0.2.157}/aiteamutils/models.py +0 -0
- {aiteamutils-0.2.155 → aiteamutils-0.2.157}/aiteamutils/security.py +0 -0
- {aiteamutils-0.2.155 → aiteamutils-0.2.157}/aiteamutils/validators.py +0 -0
- {aiteamutils-0.2.155 → aiteamutils-0.2.157}/pyproject.toml +0 -0
- {aiteamutils-0.2.155 → aiteamutils-0.2.157}/setup.py +0 -0
@@ -72,10 +72,12 @@ class BaseService(Generic[ModelType]):
|
|
72
72
|
# 파일 필드 체크 로직 수정
|
73
73
|
file_fields = {}
|
74
74
|
for k, v in extra_data.items():
|
75
|
+
logger.info(f"[필드 검사] 필드명: {k}, 타입: {type(v)}, 값: {v}")
|
75
76
|
if v and isinstance(v, (list, tuple)):
|
76
|
-
|
77
|
-
|
78
|
-
|
77
|
+
logger.info(f"[리스트/튜플 검사] 필드명: {k}, 첫 번째 항목 타입: {type(v[0]) if v else 'None'}")
|
78
|
+
# 파일 객체를 포함하는 튜플/리스트인 경우만 처리
|
79
|
+
if any(isinstance(item, (tuple, list)) and len(item) == 2 and hasattr(item[0], 'read') for item in v):
|
80
|
+
logger.info(f"[파일 객체 포함 필드 발견] {k}")
|
79
81
|
file_fields[k] = v
|
80
82
|
|
81
83
|
logger.info(f"[파일 필드 확인] {file_fields}")
|
@@ -92,10 +94,12 @@ class BaseService(Generic[ModelType]):
|
|
92
94
|
# 파일 필드 분리 및 제거
|
93
95
|
for field_name, files in file_fields.items():
|
94
96
|
logger.info(f"[파일 처리] 필드: {field_name}, 파일 수: {len(files)}")
|
97
|
+
logger.info(f"[파일 상세] 필드: {field_name}, 파일 내용: {files}")
|
95
98
|
separated_files[field_name] = files
|
96
99
|
del extra_data[field_name]
|
97
100
|
|
98
101
|
entity_data_copy['extra_data'] = extra_data
|
102
|
+
logger.info(f"[파일 분리 후 extra_data] {entity_data_copy['extra_data']}")
|
99
103
|
|
100
104
|
# 기존 파일 삭제 (update 또는 delete 작업 시)
|
101
105
|
if operation in ["update", "delete"]:
|
@@ -140,6 +144,12 @@ class BaseService(Generic[ModelType]):
|
|
140
144
|
if operation != "delete" and separated_files:
|
141
145
|
logger.info("[새 파일 저장 시작]")
|
142
146
|
from .files import FileHandler
|
147
|
+
|
148
|
+
# 임시 엔티티인 경우 파일 저장 건너뛰기
|
149
|
+
if isinstance(entity_result, type('TempEntity', (), {})):
|
150
|
+
logger.info("[임시 엔티티 감지] 파일 저장 건너뛰기")
|
151
|
+
return entity_data_copy, {}
|
152
|
+
|
143
153
|
for field_name, files in separated_files.items():
|
144
154
|
logger.info(f"[필드 처리] {field_name}, 파일 수: {len(files)}")
|
145
155
|
saved_files = await FileHandler.save_files(
|
@@ -261,20 +271,22 @@ class BaseService(Generic[ModelType]):
|
|
261
271
|
exclude_entities=exclude_entities
|
262
272
|
)
|
263
273
|
|
264
|
-
# 실제 파일
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
274
|
+
# 실제 파일 저장 및 엔티티 업데이트
|
275
|
+
if storage_dir:
|
276
|
+
_, file_infos = await self._process_files(
|
277
|
+
entity_data=entity_data, # 원본 데이터 사용
|
278
|
+
entity_result=result, # 실제 엔티티 사용
|
279
|
+
storage_dir=storage_dir,
|
280
|
+
operation="create"
|
281
|
+
)
|
271
282
|
|
272
283
|
# 결과 반환
|
273
284
|
if response_model:
|
274
285
|
processed_result = process_response(result, response_model)
|
275
286
|
# 파일 정보 추가
|
276
|
-
|
277
|
-
|
287
|
+
if storage_dir and 'file_infos' in locals():
|
288
|
+
for key, value in file_infos.items():
|
289
|
+
processed_result[key] = value
|
278
290
|
return processed_result
|
279
291
|
else:
|
280
292
|
return result
|
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
|
File without changes
|
File without changes
|