release: PicHost v1.0.0
Publish Docker image / build-and-push (push) Canceled after 0s
ci / ci (22, ubuntu-latest) (push) Canceled after 0s
Publish Docker image / build-and-push (push) Canceled after 0s
ci / ci (22, ubuntu-latest) (push) Canceled after 0s
Multi-user image hosting with RBAC, upload preferences, and admin settings.
This commit is contained in:
commit
bc4cba7e52
115 files changed
+26508
No files matched your search
@@ -0,0 +1,75 @@
|
||||
export type ErrorCode
|
||||
= | 'UNAUTHORIZED'
|
||||
| 'FORBIDDEN'
|
||||
| 'CONFLICT'
|
||||
| 'INVALID_REQUEST'
|
||||
| 'TOO_MANY_FILES'
|
||||
| 'FILE_TOO_LARGE'
|
||||
| 'UNSUPPORTED_FILE_TYPE'
|
||||
| 'INVALID_FILE_SIGNATURE'
|
||||
| 'INVALID_IMAGE_KEY'
|
||||
| 'IMAGE_NOT_FOUND'
|
||||
| 'UPLOAD_FAILED'
|
||||
| 'DELETE_FAILED'
|
||||
|
||||
export interface ApiError {
|
||||
code: ErrorCode
|
||||
message: string
|
||||
}
|
||||
|
||||
export interface ApiErrorResponse {
|
||||
success: false
|
||||
error: ApiError
|
||||
}
|
||||
|
||||
export interface ImageItem {
|
||||
key: string
|
||||
url: string
|
||||
originalName: string
|
||||
contentType: string
|
||||
size: number
|
||||
uploadedAt: string
|
||||
markdown: string
|
||||
html: string
|
||||
/** 管理员列表可见:上传者信息 */
|
||||
owner?: {
|
||||
userId: number | null
|
||||
username: string
|
||||
}
|
||||
}
|
||||
|
||||
export interface UploadErrorItem {
|
||||
name: string
|
||||
error: ApiError
|
||||
}
|
||||
|
||||
export interface UploadResponse {
|
||||
success: boolean
|
||||
items: ImageItem[]
|
||||
errors: UploadErrorItem[]
|
||||
}
|
||||
|
||||
export interface ImageListResponse {
|
||||
items: ImageItem[]
|
||||
total: number
|
||||
page: number
|
||||
pageSize: number
|
||||
totalPages: number
|
||||
}
|
||||
|
||||
export interface DeleteResponse {
|
||||
success: boolean
|
||||
}
|
||||
|
||||
export interface BatchDeleteResponse {
|
||||
success: boolean
|
||||
deleted: string[]
|
||||
failed: Array<{ key: string, error: ApiError }>
|
||||
}
|
||||
|
||||
export interface UploadProgressItem {
|
||||
name: string
|
||||
status: 'pending' | 'uploading' | 'success' | 'error'
|
||||
progress: number
|
||||
error?: string
|
||||
}
|
||||
Reference in new issue
Block a user