mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 20:27:23 +00:00
Initial commit
This commit is contained in:
91
frontend/src/network/models.ts
Normal file
91
frontend/src/network/models.ts
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user