diff --git a/modules/frontend/src/api/core/OpenAPI.ts b/modules/frontend/src/api/core/OpenAPI.ts index 99c577d..4fb2299 100644 --- a/modules/frontend/src/api/core/OpenAPI.ts +++ b/modules/frontend/src/api/core/OpenAPI.ts @@ -20,7 +20,7 @@ export type OpenAPIConfig = { }; export const OpenAPI: OpenAPIConfig = { - BASE: 'http://10.1.0.65:8080', + BASE: 'https://api.example.com', VERSION: '1.0.0', WITH_CREDENTIALS: false, CREDENTIALS: 'include', diff --git a/modules/frontend/src/api/models/User.ts b/modules/frontend/src/api/models/User.ts index c296445..b03d22f 100644 --- a/modules/frontend/src/api/models/User.ts +++ b/modules/frontend/src/api/models/User.ts @@ -6,7 +6,7 @@ export type User = { /** * Unique user ID (primary key) */ - user_id: number; + id?: number; /** * ID of the user avatar (references images table) */ diff --git a/modules/frontend/src/api/services/DefaultService.ts b/modules/frontend/src/api/services/DefaultService.ts index f000c3f..7ebd129 100644 --- a/modules/frontend/src/api/services/DefaultService.ts +++ b/modules/frontend/src/api/services/DefaultService.ts @@ -2,116 +2,11 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Review } from '../models/Review'; -import type { Tag } from '../models/Tag'; -import type { Title } from '../models/Title'; 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 query - * @param limit - * @param offset - * @param fields - * @returns Title List of titles - * @throws ApiError - */ - public static getTitle( - query?: string, - limit: number = 10, - offset?: number, - fields: string = 'all', - ): CancelablePromise> { - return __request(OpenAPI, { - method: 'GET', - url: '/title', - query: { - 'query': query, - 'limit': limit, - 'offset': offset, - 'fields': fields, - }, - }); - } - /** - * Get title description - * @param titleId - * @param fields - * @returns Title Title description - * @throws ApiError - */ - public static getTitle1( - titleId: string, - fields: string = 'all', - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/title/{title_id}', - path: { - 'title_id': titleId, - }, - query: { - 'fields': fields, - }, - errors: { - 404: `Title not found`, - }, - }); - } - /** - * Update title info - * @param titleId - * @param requestBody - * @returns any Update result - * @throws ApiError - */ - public static patchTitle( - titleId: string, - requestBody: Title, - ): CancelablePromise<{ - success?: boolean; - error?: string; - user_json?: User; - }> { - return __request(OpenAPI, { - method: 'PATCH', - url: '/title/{title_id}', - path: { - 'title_id': titleId, - }, - body: requestBody, - mediaType: 'application/json', - }); - } - /** - * Get title reviews - * @param titleId - * @param limit - * @param offset - * @returns Review List of reviews - * @throws ApiError - */ - public static getTitleReviews( - titleId: string, - limit: number = 10, - offset?: number, - ): CancelablePromise<Array<Review>> { - return __request(OpenAPI, { - method: 'GET', - url: '/title/{title_id}/reviews', - path: { - 'title_id': titleId, - }, - query: { - 'limit': limit, - 'offset': offset, - }, - }); - } /** * Get user info * @param userId @@ -137,342 +32,4 @@ export class DefaultService { }, }); } - /** - * Update user - * @param userId - * @param requestBody - * @returns any Update result - * @throws ApiError - */ - public static patchUsers( - userId: string, - requestBody: User, - ): CancelablePromise<{ - success?: boolean; - error?: string; - }> { - return __request(OpenAPI, { - method: 'PATCH', - url: '/users/{user_id}', - path: { - 'user_id': userId, - }, - body: requestBody, - mediaType: 'application/json', - }); - } - /** - * Delete user - * @param userId - * @returns any Delete result - * @throws ApiError - */ - public static deleteUsers( - userId: string, - ): CancelablePromise<{ - success?: boolean; - error?: string; - }> { - return __request(OpenAPI, { - method: 'DELETE', - url: '/users/{user_id}', - path: { - 'user_id': userId, - }, - }); - } - /** - * Search user - * @param query - * @param fields - * @returns User List of users - * @throws ApiError - */ - public static getUsers1( - query?: string, - fields?: string, - ): CancelablePromise<Array<User>> { - return __request(OpenAPI, { - method: 'GET', - url: '/users', - query: { - 'query': query, - 'fields': fields, - }, - }); - } - /** - * Add new user - * @param requestBody - * @returns any Add result - * @throws ApiError - */ - public static postUsers( - requestBody: User, - ): CancelablePromise<{ - success?: boolean; - error?: string; - user_json?: User; - }> { - return __request(OpenAPI, { - method: 'POST', - url: '/users', - body: requestBody, - mediaType: 'application/json', - }); - } - /** - * Get user titles - * @param userId - * @param query - * @param limit - * @param offset - * @param fields - * @returns UserTitle List of user titles - * @throws ApiError - */ - public static getUsersTitles( - userId: 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: { - 'query': query, - 'limit': limit, - 'offset': offset, - 'fields': fields, - }, - }); - } - /** - * Add user title - * @param userId - * @param requestBody - * @returns any Add result - * @throws ApiError - */ - public static postUsersTitles( - userId: string, - requestBody: { - title_id?: string; - status?: string; - }, - ): CancelablePromise<{ - success?: boolean; - error?: string; - }> { - return __request(OpenAPI, { - method: 'POST', - url: '/users/{user_id}/titles', - path: { - 'user_id': userId, - }, - body: requestBody, - mediaType: 'application/json', - }); - } - /** - * Update user title - * @param userId - * @param requestBody - * @returns any Update result - * @throws ApiError - */ - public static patchUsersTitles( - userId: string, - requestBody: UserTitle, - ): CancelablePromise<{ - success?: boolean; - error?: string; - }> { - return __request(OpenAPI, { - method: 'PATCH', - url: '/users/{user_id}/titles', - path: { - 'user_id': userId, - }, - body: requestBody, - mediaType: 'application/json', - }); - } - /** - * Delete user title - * @param userId - * @param titleId - * @returns any Delete result - * @throws ApiError - */ - public static deleteUsersTitles( - userId: string, - titleId?: string, - ): CancelablePromise<{ - success?: boolean; - error?: string; - }> { - return __request(OpenAPI, { - method: 'DELETE', - url: '/users/{user_id}/titles', - path: { - 'user_id': userId, - }, - query: { - 'title_id': titleId, - }, - }); - } - /** - * Get user reviews - * @param userId - * @param limit - * @param offset - * @returns Review List of reviews - * @throws ApiError - */ - public static getUsersReviews( - userId: string, - limit: number = 10, - offset?: number, - ): CancelablePromise<Array<Review>> { - return __request(OpenAPI, { - method: 'GET', - url: '/users/{user_id}/reviews', - path: { - 'user_id': userId, - }, - query: { - 'limit': limit, - 'offset': offset, - }, - }); - } - /** - * Add review - * @param requestBody - * @returns any Add result - * @throws ApiError - */ - public static postReviews( - requestBody: Review, - ): CancelablePromise<{ - success?: boolean; - error?: string; - }> { - return __request(OpenAPI, { - method: 'POST', - url: '/reviews', - body: requestBody, - mediaType: 'application/json', - }); - } - /** - * Update review - * @param reviewId - * @param requestBody - * @returns any Update result - * @throws ApiError - */ - public static patchReviews( - reviewId: string, - requestBody: Review, - ): CancelablePromise<{ - success?: boolean; - error?: string; - }> { - return __request(OpenAPI, { - method: 'PATCH', - url: '/reviews/{review_id}', - path: { - 'review_id': reviewId, - }, - body: requestBody, - mediaType: 'application/json', - }); - } - /** - * Delete review - * @param reviewId - * @returns any Delete result - * @throws ApiError - */ - public static deleteReviews( - reviewId: string, - ): CancelablePromise<{ - success?: boolean; - error?: string; - }> { - return __request(OpenAPI, { - method: 'DELETE', - url: '/reviews/{review_id}', - path: { - 'review_id': reviewId, - }, - }); - } - /** - * Get tags - * @param limit - * @param offset - * @param fields - * @returns Tag List of tags - * @throws ApiError - */ - public static getTags( - limit: number = 10, - offset?: number, - fields?: string, - ): CancelablePromise<Array<Tag>> { - return __request(OpenAPI, { - method: 'GET', - url: '/tags', - query: { - 'limit': limit, - 'offset': offset, - 'fields': fields, - }, - }); - } - /** - * Upload image - * @returns any Upload result - * @throws ApiError - */ - public static postMedia(): CancelablePromise<{ - success?: boolean; - error?: string; - image_id?: string; - }> { - return __request(OpenAPI, { - method: 'POST', - url: '/media', - }); - } - /** - * Get image path - * @param imageId - * @returns any Image path - * @throws ApiError - */ - public static getMedia( - imageId: string, - ): CancelablePromise<{ - success?: boolean; - error?: string; - image_path?: string; - }> { - return __request(OpenAPI, { - method: 'GET', - url: '/media', - query: { - 'image_id': imageId, - }, - }); - } }