디지털 자산의 업로드, 관리, 폴더 구성을 지원하는 RESTful API 서버입니다.
다운로드한 zip 파일을 압축 해제한 후, 다음 명령어로 서버를 실행할 수 있습니다:
python 으로 서버 실행:
uvicorn 으로 서버 실행:
서버가 성공적으로 실행되면 localhost:8000에서 API를 사용할 수 있습니다.
Swagger UI는 localhost:8000/docs에서 확인할 수 있습니다.
/api/v1/auth/register새로운 사용자를 등록합니다.
{
"email": "string",
"password": "string",
"name": "string"
}{
"id": 1,
"email": "user@example.com",
"name": "홍길동",
"created_at": "2024-12-27T10:00:00"
}400 Bad Request
/api/v1/auth/login사용자 인증을 수행하고 액세스 토큰을 발급합니다.
{
"email": "string",
"password": "string"
}{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer"
}401 Unauthorized
/api/v1/assets새로운 디지털 자산을 업로드합니다.
Authorization: Bearer {token}multipart/form-data:
{
"file": "binary",
"name": "string",
"description": "string",
"tags": ["string"],
"folder_id": "number (optional)"
}{
"id": 1,
"name": "sample_image.jpg",
"description": "샘플 이미지 파일",
"folder_id": 1,
"mime_type": "image/jpeg",
"size": 102400,
"file_url": "https://s3.amazonaws.com/bucket/sample_image.jpg",
"created_at": "2024-12-27T10:00:00",
"updated_at": "2024-12-27T10:00:00",
"tags": [
{
"id": 1,
"name": "이미지",
"created_at": "2024-12-27T10:00:00"
}
]
}400 Bad Request
/api/v1/assets디지털 자산 목록을 조회합니다.
Authorization: Bearer {token}folder_id: number (optional) tag: string (optional)
[
{
"id": 1,
"name": "sample_image.jpg",
"description": "샘플 이미지 파일",
"folder_id": 1,
"mime_type": "image/jpeg",
"size": 102400,
"file_url": "https://s3.amazonaws.com/bucket/sample_image.jpg",
"created_at": "2024-12-27T10:00:00",
"updated_at": "2024-12-27T10:00:00",
"tags": [
{
"id": 1,
"name": "이미지",
"created_at": "2024-12-27T10:00:00"
}
]
}
]401 Unauthorized
/api/v1/folders새로운 폴더를 생성합니다.
Authorization: Bearer {token}{
"name": "string",
"parent_id": "number (optional)"
}{
"id": 1,
"name": "내 폴더",
"parent_id": null,
"user_id": 1,
"created_at": "2024-12-27T10:00:00",
"updated_at": "2024-12-27T10:00:00"
}400 Bad Request