feat: add thumbnail metadata and download endpoint
- Extend `BoxFile` with thumbnail path/status fields and internal URL - Populate `ThumbnailURL` when a thumbnail path is present during decoration - Add `/box/:id/thumbnails/:file_id` route and handler to serve JPEG thumbnails - Introduce thumbnail status constants to standardize processing state reportingfeat: add thumbnail metadata and download endpoint - Extend `BoxFile` with thumbnail path/status fields and internal URL - Populate `ThumbnailURL` when a thumbnail path is present during decoration - Add `/box/:id/thumbnails/:file_id` route and handler to serve JPEG thumbnails - Introduce thumbnail status constants to standardize processing state reporting
This commit is contained in:
@@ -9,6 +9,13 @@ const (
|
||||
FileStatusWork = "uploading"
|
||||
)
|
||||
|
||||
const (
|
||||
ThumbnailStatusFailed = "failed"
|
||||
ThumbnailStatusProcessing = "processing"
|
||||
ThumbnailStatusReady = "ready"
|
||||
ThumbnailStatusUnsupported = "unsupported"
|
||||
)
|
||||
|
||||
type RetentionOption struct {
|
||||
Key string `json:"key"`
|
||||
Label string `json:"label"`
|
||||
@@ -16,18 +23,21 @@ type RetentionOption struct {
|
||||
}
|
||||
|
||||
type BoxFile struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Size int64 `json:"size"`
|
||||
SizeLabel string `json:"size_label"`
|
||||
MimeType string `json:"mime_type"`
|
||||
Status string `json:"status"`
|
||||
StatusLabel string `json:"status_label"`
|
||||
Title string `json:"title"`
|
||||
IconPath string `json:"icon_path"`
|
||||
DownloadPath string `json:"download_path"`
|
||||
UploadPath string `json:"upload_path"`
|
||||
IsComplete bool `json:"is_complete"`
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Size int64 `json:"size"`
|
||||
SizeLabel string `json:"size_label"`
|
||||
MimeType string `json:"mime_type"`
|
||||
Status string `json:"status"`
|
||||
StatusLabel string `json:"status_label"`
|
||||
Title string `json:"title"`
|
||||
IconPath string `json:"icon_path"`
|
||||
ThumbnailPath *string `json:"thumbnail_path"`
|
||||
ThumbnailStatus string `json:"thumbnail_status,omitempty"`
|
||||
ThumbnailURL string `json:"-"`
|
||||
DownloadPath string `json:"download_path"`
|
||||
UploadPath string `json:"upload_path"`
|
||||
IsComplete bool `json:"is_complete"`
|
||||
}
|
||||
|
||||
type BoxManifest struct {
|
||||
|
||||
Reference in New Issue
Block a user