- Updated .env.example to include S3 configuration options. - Added boto3 and python-multipart dependencies in pyproject.toml. - Enhanced file management API with endpoints for uploading, downloading, and managing file metadata. - Updated database models to associate files with various assets. - Refactored schemas to include file ID references for asset images.
15 lines
314 B
Python
15 lines
314 B
Python
import asyncio
|
|
|
|
from app.core.storage import init_storage
|
|
|
|
|
|
async def _main() -> None:
|
|
"""初始化对象存储(例如创建 bucket)。"""
|
|
# boto3 是同步库,这里用线程池避免阻塞事件循环
|
|
await asyncio.to_thread(init_storage)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(_main())
|
|
|