init: new structure + fix lint errors
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Literal
|
||||
from uuid import UUID
|
||||
|
||||
from cpv3.common.schemas import Schema
|
||||
|
||||
|
||||
StorageBackendEnum = Literal["LOCAL", "S3"]
|
||||
|
||||
|
||||
class FileRead(Schema):
|
||||
id: UUID
|
||||
project_id: UUID | None
|
||||
owner_id: UUID | None
|
||||
|
||||
original_filename: str
|
||||
path: str
|
||||
storage_backend: StorageBackendEnum
|
||||
|
||||
mime_type: str
|
||||
size_bytes: int
|
||||
checksum: str | None
|
||||
file_format: str | None
|
||||
|
||||
is_uploaded: bool
|
||||
is_deleted: bool
|
||||
is_active: bool
|
||||
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
|
||||
class FileCreate(Schema):
|
||||
project_id: UUID | None = None
|
||||
original_filename: str
|
||||
path: str
|
||||
storage_backend: StorageBackendEnum = "S3"
|
||||
mime_type: str
|
||||
size_bytes: int
|
||||
checksum: str | None = None
|
||||
file_format: str | None = None
|
||||
is_uploaded: bool = False
|
||||
|
||||
|
||||
class FileUpdate(Schema):
|
||||
original_filename: str | None = None
|
||||
is_uploaded: bool | None = None
|
||||
is_deleted: bool | None = None
|
||||
|
||||
|
||||
class FileInfoResponse(Schema):
|
||||
file_path: str
|
||||
file_url: str
|
||||
file_size: int | None = None
|
||||
filename: str | None = None
|
||||
|
||||
|
||||
class FileParam(Schema):
|
||||
file_path: str
|
||||
|
||||
|
||||
class FileUploadForm(Schema):
|
||||
folder: str = ""
|
||||
Reference in New Issue
Block a user