aiteamutils 0.2.146__py3-none-any.whl → 0.2.148__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/files.py +25 -28
- aiteamutils/models.py +1 -0
- aiteamutils/version.py +1 -1
- {aiteamutils-0.2.146.dist-info → aiteamutils-0.2.148.dist-info}/METADATA +1 -1
- {aiteamutils-0.2.146.dist-info → aiteamutils-0.2.148.dist-info}/RECORD +6 -5
- {aiteamutils-0.2.146.dist-info → aiteamutils-0.2.148.dist-info}/WHEEL +0 -0
aiteamutils/files.py
CHANGED
@@ -194,38 +194,35 @@ class FileHandler:
|
|
194
194
|
# DB에 파일 정보 저장
|
195
195
|
try:
|
196
196
|
logger.info(f"[DB 저장 시작] {original_name}")
|
197
|
+
file_ulid = str(ULID())
|
198
|
+
logger.info(f"[생성된 파일 ULID] {file_ulid}")
|
197
199
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
200
|
+
result = await db_session.execute(
|
201
|
+
text("""
|
202
|
+
INSERT INTO files (
|
203
|
+
ulid, entity_name, entity_ulid, original_name, storage_path,
|
204
|
+
mime_type, size, checksum, column_name
|
205
|
+
) VALUES (
|
206
|
+
:ulid, :entity_name, :entity_ulid, :original_name, :storage_path,
|
207
|
+
:mime_type, :size, :checksum, :column_name
|
208
|
+
) RETURNING *
|
209
|
+
"""),
|
210
|
+
{
|
211
|
+
"ulid": file_ulid,
|
212
|
+
"entity_name": entity_name,
|
213
|
+
"entity_ulid": entity_ulid,
|
214
|
+
"original_name": file_info["original_name"],
|
215
|
+
"storage_path": file_info["storage_path"],
|
216
|
+
"mime_type": file_info["mime_type"],
|
217
|
+
"size": file_info["size"],
|
218
|
+
"checksum": file_info["checksum"],
|
219
|
+
"column_name": column_name
|
220
|
+
}
|
208
221
|
)
|
209
222
|
|
210
|
-
|
211
|
-
db_session.add(file_record)
|
212
|
-
await db_session.flush()
|
213
|
-
|
214
|
-
# 결과를 딕셔너리로 변환
|
215
|
-
file_info = {
|
216
|
-
"ulid": file_record.ulid,
|
217
|
-
"entity_name": file_record.entity_name,
|
218
|
-
"entity_ulid": file_record.entity_ulid,
|
219
|
-
"original_name": file_record.original_name,
|
220
|
-
"storage_path": file_record.storage_path,
|
221
|
-
"mime_type": file_record.mime_type,
|
222
|
-
"size": file_record.size,
|
223
|
-
"checksum": file_record.checksum,
|
224
|
-
"column_name": file_record.column_name
|
225
|
-
}
|
226
|
-
|
223
|
+
file_info = dict(result.fetchone())
|
227
224
|
file_infos.append(file_info)
|
228
|
-
logger.info(f"[DB 저장 완료] {original_name}, ulid: {
|
225
|
+
logger.info(f"[DB 저장 완료] {original_name}, ulid: {file_info['ulid']}")
|
229
226
|
|
230
227
|
except Exception as e:
|
231
228
|
logger.error(f"[DB 저장 실패] {original_name}: {str(e)}")
|
aiteamutils/models.py
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
|
aiteamutils/version.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
"""버전 정보"""
|
2
|
-
__version__ = "0.2.
|
2
|
+
__version__ = "0.2.148"
|
@@ -7,10 +7,11 @@ aiteamutils/config.py,sha256=YdalpJb70-txhGJAS4aaKglEZAFVWgfzw5BXSWpkUz4,3232
|
|
7
7
|
aiteamutils/database.py,sha256=msvBKtxWeQVOo0v2Q9i2azuTNtnUItuNNar52gdRZTo,20418
|
8
8
|
aiteamutils/enums.py,sha256=7WLqlcJqQWtETAga2WAxNp3dJTQIAd2TW-4WzkoHHa8,2498
|
9
9
|
aiteamutils/exceptions.py,sha256=pgf3ersezObyl17wAO3I2fb8m9t2OzWDX1mSjwAWm2Y,16035
|
10
|
-
aiteamutils/files.py,sha256=
|
10
|
+
aiteamutils/files.py,sha256=cf6nCsw9p5VcT9TOKyZ8XYcar1n7g2IqOTwXVJLeglA,11810
|
11
|
+
aiteamutils/models.py,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
|
11
12
|
aiteamutils/security.py,sha256=McUl3t5Z5SyUDVUHymHdDkYyF4YSeg4g9fFMML4W6Kw,11630
|
12
13
|
aiteamutils/validators.py,sha256=_WHN6jqJQzKM5uPTg-Da8U2qqevS84XeKMkCCF4C_lY,9591
|
13
|
-
aiteamutils/version.py,sha256=
|
14
|
-
aiteamutils-0.2.
|
15
|
-
aiteamutils-0.2.
|
16
|
-
aiteamutils-0.2.
|
14
|
+
aiteamutils/version.py,sha256=ADLCxtyyiUj8hSamNaN449kCqHVtY-_PpHf4BbzSVIg,43
|
15
|
+
aiteamutils-0.2.148.dist-info/METADATA,sha256=809OjK3zL9yG-JpKhg0FA86TMQRR8laiueN2t_HT-64,1743
|
16
|
+
aiteamutils-0.2.148.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
17
|
+
aiteamutils-0.2.148.dist-info/RECORD,,
|
File without changes
|