Initial commit

This commit is contained in:
2025-05-11 20:32:14 +08:00
commit d97247159f
80 changed files with 13013 additions and 0 deletions

View File

@@ -0,0 +1,91 @@
export interface User {
id: number;
username: string;
created_at: string;
avatar_path: string;
is_admin: boolean;
can_upload: boolean;
}
export interface UserWithToken extends User {
token: string;
}
export interface Response<T> {
success: boolean;
message: string;
data?: T;
}
export interface PageResponse<T> {
success: boolean;
message: string;
data?: T[];
totalPages?: number;
}
export interface Tag {
id: number;
name: string;
}
export interface CreateResourceParams {
title: string;
alternative_titles: string[];
tags: number[];
article: string;
images: number[];
}
export interface Image {
id: number;
width: number;
height: number;
}
export interface Resource {
id: number;
title: string;
created_at: string;
tags: Tag[];
image?: Image;
author: User;
}
export interface ResourceDetails {
id: number;
title: string;
alternativeTitles: string[];
article: string;
createdAt: string;
tags: Tag[];
images: Image[];
files: RFile[];
author: User;
}
export interface Storage {
id: number;
name: string;
type: string;
maxSize: number;
currentSize: number;
createdAt: string;
}
export interface RFile {
id: number;
filename: string;
description: string;
}
export interface UploadingFile {
id: number;
filename: string;
description: string;
totalSize?: number;
blockSize: number;
blocksCount: number;
storageId: number;
resourceId: number;
}