feat: titles page
This commit is contained in:
parent
6836cfa057
commit
b976c35b8e
44 changed files with 1539 additions and 107 deletions
|
|
@ -7,10 +7,17 @@ export { CancelablePromise, CancelError } from './core/CancelablePromise';
|
|||
export { OpenAPI } from './core/OpenAPI';
|
||||
export type { OpenAPIConfig } from './core/OpenAPI';
|
||||
|
||||
export type { cursor } from './models/cursor';
|
||||
export type { Image } from './models/Image';
|
||||
export { ReleaseSeason } from './models/ReleaseSeason';
|
||||
export type { Review } from './models/Review';
|
||||
export type { Studio } from './models/Studio';
|
||||
export type { Tag } from './models/Tag';
|
||||
export type { Tags } from './models/Tags';
|
||||
export type { Title } from './models/Title';
|
||||
export { TitleStatus } from './models/TitleStatus';
|
||||
export type { User } from './models/User';
|
||||
export type { UserTitle } from './models/UserTitle';
|
||||
export { UserTitleStatus } from './models/UserTitleStatus';
|
||||
|
||||
export { DefaultService } from './services/DefaultService';
|
||||
|
|
|
|||
10
modules/frontend/src/api/models/Image.ts
Normal file
10
modules/frontend/src/api/models/Image.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type Image = {
|
||||
id?: number;
|
||||
storage_type?: string;
|
||||
image_path?: string;
|
||||
};
|
||||
|
||||
13
modules/frontend/src/api/models/ReleaseSeason.ts
Normal file
13
modules/frontend/src/api/models/ReleaseSeason.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Title release season
|
||||
*/
|
||||
export enum ReleaseSeason {
|
||||
WINTER = 'winter',
|
||||
SPRING = 'spring',
|
||||
SUMMER = 'summer',
|
||||
FALL = 'fall',
|
||||
}
|
||||
12
modules/frontend/src/api/models/Studio.ts
Normal file
12
modules/frontend/src/api/models/Studio.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { Image } from './Image';
|
||||
export type Studio = {
|
||||
id: number;
|
||||
name: string;
|
||||
poster?: Image;
|
||||
description?: string;
|
||||
};
|
||||
|
||||
|
|
@ -2,4 +2,7 @@
|
|||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type Tag = Record<string, any>;
|
||||
/**
|
||||
* A localized tag: keys are language codes (ISO 639-1), values are tag names
|
||||
*/
|
||||
export type Tag = Record<string, string>;
|
||||
|
|
|
|||
9
modules/frontend/src/api/models/Tags.ts
Normal file
9
modules/frontend/src/api/models/Tags.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { Tag } from './Tag';
|
||||
/**
|
||||
* Array of localized tags
|
||||
*/
|
||||
export type Tags = Array<Tag>;
|
||||
12
modules/frontend/src/api/models/TitleStatus.ts
Normal file
12
modules/frontend/src/api/models/TitleStatus.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Title status
|
||||
*/
|
||||
export enum TitleStatus {
|
||||
FINISHED = 'finished',
|
||||
ONGOING = 'ongoing',
|
||||
PLANNED = 'planned',
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@ export type User = {
|
|||
/**
|
||||
* Unique user ID (primary key)
|
||||
*/
|
||||
id?: number;
|
||||
id: number;
|
||||
/**
|
||||
* ID of the user avatar (references images table)
|
||||
*/
|
||||
|
|
@ -30,6 +30,6 @@ export type User = {
|
|||
/**
|
||||
* Timestamp when the user was created
|
||||
*/
|
||||
creation_date: string;
|
||||
creation_date?: string;
|
||||
};
|
||||
|
||||
|
|
|
|||
13
modules/frontend/src/api/models/UserTitleStatus.ts
Normal file
13
modules/frontend/src/api/models/UserTitleStatus.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* User's title status
|
||||
*/
|
||||
export enum UserTitleStatus {
|
||||
FINISHED = 'finished',
|
||||
PLANNED = 'planned',
|
||||
DROPPED = 'dropped',
|
||||
IN_PROGRESS = 'in-progress',
|
||||
}
|
||||
5
modules/frontend/src/api/models/cursor.ts
Normal file
5
modules/frontend/src/api/models/cursor.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type cursor = string;
|
||||
|
|
@ -2,11 +2,84 @@
|
|||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { ReleaseSeason } from '../models/ReleaseSeason';
|
||||
import type { Title } from '../models/Title';
|
||||
import type { TitleStatus } from '../models/TitleStatus';
|
||||
import type { User } from '../models/User';
|
||||
import type { UserTitle } from '../models/UserTitle';
|
||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||
import { OpenAPI } from '../core/OpenAPI';
|
||||
import { request as __request } from '../core/request';
|
||||
export class DefaultService {
|
||||
/**
|
||||
* Get titles
|
||||
* @param word
|
||||
* @param status
|
||||
* @param rating
|
||||
* @param releaseYear
|
||||
* @param releaseSeason
|
||||
* @param limit
|
||||
* @param offset
|
||||
* @param fields
|
||||
* @returns Title List of titles
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getTitles(
|
||||
word?: string,
|
||||
status?: TitleStatus,
|
||||
rating?: number,
|
||||
releaseYear?: number,
|
||||
releaseSeason?: ReleaseSeason,
|
||||
limit: number = 10,
|
||||
offset?: number,
|
||||
fields: string = 'all',
|
||||
): CancelablePromise<Array<Title>> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/titles',
|
||||
query: {
|
||||
'word': word,
|
||||
'status': status,
|
||||
'rating': rating,
|
||||
'release_year': releaseYear,
|
||||
'release_season': releaseSeason,
|
||||
'limit': limit,
|
||||
'offset': offset,
|
||||
'fields': fields,
|
||||
},
|
||||
errors: {
|
||||
400: `Request params are not correct`,
|
||||
500: `Unknown server error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Get title description
|
||||
* @param titleId
|
||||
* @param fields
|
||||
* @returns Title Title description
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getTitles1(
|
||||
titleId: number,
|
||||
fields: string = 'all',
|
||||
): CancelablePromise<Title> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/titles/{title_id}',
|
||||
path: {
|
||||
'title_id': titleId,
|
||||
},
|
||||
query: {
|
||||
'fields': fields,
|
||||
},
|
||||
errors: {
|
||||
400: `Request params are not correct`,
|
||||
404: `Title not found`,
|
||||
500: `Unknown server error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Get user info
|
||||
* @param userId
|
||||
|
|
@ -28,7 +101,47 @@ export class DefaultService {
|
|||
'fields': fields,
|
||||
},
|
||||
errors: {
|
||||
400: `Request params are not correct`,
|
||||
404: `User not found`,
|
||||
500: `Unknown server error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Get user titles
|
||||
* @param userId
|
||||
* @param cursor
|
||||
* @param query
|
||||
* @param limit
|
||||
* @param offset
|
||||
* @param fields
|
||||
* @returns UserTitle List of user titles
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getUsersTitles(
|
||||
userId: string,
|
||||
cursor?: string,
|
||||
query?: string,
|
||||
limit: number = 10,
|
||||
offset?: number,
|
||||
fields: string = 'all',
|
||||
): CancelablePromise<Array<UserTitle>> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/users/{user_id}/titles',
|
||||
path: {
|
||||
'user_id': userId,
|
||||
},
|
||||
query: {
|
||||
'cursor': cursor,
|
||||
'query': query,
|
||||
'limit': limit,
|
||||
'offset': offset,
|
||||
'fields': fields,
|
||||
},
|
||||
errors: {
|
||||
400: `Request params are not correct`,
|
||||
500: `Unknown server error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue