diff --git a/frontend/package.json b/frontend/package.json index 4ae7804..77e11ca 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -51,6 +51,7 @@ "eslint-config-prettier": "^10.1.8", "eslint-plugin-prettier": "^5.5.3", "eslint-plugin-vue": "^10.4.0", + "openapi-typescript-codegen": "^0.29.0", "prettier": "^3.6.2", "typescript": "^5.9.2", "vite": "^7.0.4", diff --git a/frontend/src/api/core/ApiError.ts b/frontend/src/api/core/ApiError.ts new file mode 100644 index 0000000..af12586 --- /dev/null +++ b/frontend/src/api/core/ApiError.ts @@ -0,0 +1,25 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { ApiRequestOptions } from './ApiRequestOptions.ts'; +import type { ApiResult } from './ApiResult.ts'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: any; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} diff --git a/frontend/src/api/core/ApiRequestOptions.ts b/frontend/src/api/core/ApiRequestOptions.ts new file mode 100644 index 0000000..93143c3 --- /dev/null +++ b/frontend/src/api/core/ApiRequestOptions.ts @@ -0,0 +1,17 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ApiRequestOptions = { + readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH'; + readonly url: string; + readonly path?: Record; + readonly cookies?: Record; + readonly headers?: Record; + readonly query?: Record; + readonly formData?: Record; + readonly body?: any; + readonly mediaType?: string; + readonly responseHeader?: string; + readonly errors?: Record; +}; diff --git a/frontend/src/api/core/ApiResult.ts b/frontend/src/api/core/ApiResult.ts new file mode 100644 index 0000000..ee1126e --- /dev/null +++ b/frontend/src/api/core/ApiResult.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ApiResult = { + readonly url: string; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly body: any; +}; diff --git a/frontend/src/api/core/CancelablePromise.ts b/frontend/src/api/core/CancelablePromise.ts new file mode 100644 index 0000000..d70de92 --- /dev/null +++ b/frontend/src/api/core/CancelablePromise.ts @@ -0,0 +1,131 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export class CancelError extends Error { + + constructor(message: string) { + super(message); + this.name = 'CancelError'; + } + + public get isCancelled(): boolean { + return true; + } +} + +export interface OnCancel { + readonly isResolved: boolean; + readonly isRejected: boolean; + readonly isCancelled: boolean; + + (cancelHandler: () => void): void; +} + +export class CancelablePromise implements Promise { + #isResolved: boolean; + #isRejected: boolean; + #isCancelled: boolean; + readonly #cancelHandlers: (() => void)[]; + readonly #promise: Promise; + #resolve?: (value: T | PromiseLike) => void; + #reject?: (reason?: any) => void; + + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: any) => void, + onCancel: OnCancel + ) => void + ) { + this.#isResolved = false; + this.#isRejected = false; + this.#isCancelled = false; + this.#cancelHandlers = []; + this.#promise = new Promise((resolve, reject) => { + this.#resolve = resolve; + this.#reject = reject; + + const onResolve = (value: T | PromiseLike): void => { + if (this.#isResolved || this.#isRejected || this.#isCancelled) { + return; + } + this.#isResolved = true; + if (this.#resolve) this.#resolve(value); + }; + + const onReject = (reason?: any): void => { + if (this.#isResolved || this.#isRejected || this.#isCancelled) { + return; + } + this.#isRejected = true; + if (this.#reject) this.#reject(reason); + }; + + const onCancel = (cancelHandler: () => void): void => { + if (this.#isResolved || this.#isRejected || this.#isCancelled) { + return; + } + this.#cancelHandlers.push(cancelHandler); + }; + + Object.defineProperty(onCancel, 'isResolved', { + get: (): boolean => this.#isResolved, + }); + + Object.defineProperty(onCancel, 'isRejected', { + get: (): boolean => this.#isRejected, + }); + + Object.defineProperty(onCancel, 'isCancelled', { + get: (): boolean => this.#isCancelled, + }); + + return executor(onResolve, onReject, onCancel as OnCancel); + }); + } + + get [Symbol.toStringTag]() { + return "Cancellable Promise"; + } + + public then( + onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onRejected?: ((reason: any) => TResult2 | PromiseLike) | null + ): Promise { + return this.#promise.then(onFulfilled, onRejected); + } + + public catch( + onRejected?: ((reason: any) => TResult | PromiseLike) | null + ): Promise { + return this.#promise.catch(onRejected); + } + + public finally(onFinally?: (() => void) | null): Promise { + return this.#promise.finally(onFinally); + } + + public cancel(): void { + if (this.#isResolved || this.#isRejected || this.#isCancelled) { + return; + } + this.#isCancelled = true; + if (this.#cancelHandlers.length) { + try { + for (const cancelHandler of this.#cancelHandlers) { + cancelHandler(); + } + } catch (error) { + console.warn('Cancellation threw an error', error); + return; + } + } + this.#cancelHandlers.length = 0; + if (this.#reject) this.#reject(new CancelError('Request aborted')); + } + + public get isCancelled(): boolean { + return this.#isCancelled; + } +} diff --git a/frontend/src/api/core/OpenAPI.ts b/frontend/src/api/core/OpenAPI.ts new file mode 100644 index 0000000..79a2ba4 --- /dev/null +++ b/frontend/src/api/core/OpenAPI.ts @@ -0,0 +1,32 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { ApiRequestOptions } from './ApiRequestOptions.ts'; + +type Resolver = (options: ApiRequestOptions) => Promise; +type Headers = Record; + +export type OpenAPIConfig = { + BASE: string; + VERSION: string; + WITH_CREDENTIALS: boolean; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + HEADERS?: Headers | Resolver | undefined; + ENCODE_PATH?: ((path: string) => string) | undefined; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: '', + VERSION: '1.0.0', + WITH_CREDENTIALS: false, + CREDENTIALS: 'include', + TOKEN: undefined, + USERNAME: undefined, + PASSWORD: undefined, + HEADERS: undefined, + ENCODE_PATH: undefined, +}; diff --git a/frontend/src/api/core/request.ts b/frontend/src/api/core/request.ts new file mode 100644 index 0000000..ffff887 --- /dev/null +++ b/frontend/src/api/core/request.ts @@ -0,0 +1,323 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import axios from 'axios'; +import type { AxiosError, AxiosRequestConfig, AxiosResponse, AxiosInstance } from 'axios'; +import FormData from 'form-data'; + +import { ApiError } from './ApiError.ts'; +import type { ApiRequestOptions } from './ApiRequestOptions.ts'; +import type { ApiResult } from './ApiResult.ts'; +import { CancelablePromise } from './CancelablePromise.ts'; +import type { OnCancel } from './CancelablePromise.ts'; +import type { OpenAPIConfig } from './OpenAPI.ts'; + +export const isDefined = (value: T | null | undefined): value is Exclude => { + return value !== undefined && value !== null; +}; + +export const isString = (value: any): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: any): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return ( + typeof value === 'object' && + typeof value.type === 'string' && + typeof value.stream === 'function' && + typeof value.arrayBuffer === 'function' && + typeof value.constructor === 'function' && + typeof value.constructor.name === 'string' && + /^(Blob|File)$/.test(value.constructor.name) && + /^(Blob|File)$/.test(value[Symbol.toStringTag]) + ); +}; + +export const isFormData = (value: any): value is FormData => { + return value instanceof FormData; +}; + +export const isSuccess = (status: number): boolean => { + return status >= 200 && status < 300; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: any) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const process = (key: string, value: any) => { + if (isDefined(value)) { + if (Array.isArray(value)) { + value.forEach(v => { + process(key, v); + }); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => { + process(`${key}[${k}]`, v); + }); + } else { + append(key, value); + } + } + }; + + Object.entries(params).forEach(([key, value]) => { + process(key, value); + }); + + if (qs.length > 0) { + return `?${qs.join('&')}`; + } + + return ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = `${config.BASE}${path}`; + if (options.query) { + return `${url}${getQueryString(options.query)}`; + } + return url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: any) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([_, value]) => isDefined(value)) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions, formData?: FormData): Promise> => { + const [token, username, password, additionalHeaders] = await Promise.all([ + resolve(options, config.TOKEN), + resolve(options, config.USERNAME), + resolve(options, config.PASSWORD), + resolve(options, config.HEADERS), + ]); + + const formHeaders = typeof formData?.getHeaders === 'function' && formData?.getHeaders() || {} + + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + ...formHeaders, + }) + .filter(([_, value]) => isDefined(value)) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } + + return headers; +}; + +export const getRequestBody = (options: ApiRequestOptions): any => { + if (options.body) { + return options.body; + } + return undefined; +}; + +export const sendRequest = async ( + config: OpenAPIConfig, + options: ApiRequestOptions, + url: string, + body: any, + formData: FormData | undefined, + headers: Record, + onCancel: OnCancel, + axiosClient: AxiosInstance +): Promise> => { + const source = axios.CancelToken.source(); + + const requestConfig: AxiosRequestConfig = { + url, + headers, + data: body ?? formData, + method: options.method, + withCredentials: config.WITH_CREDENTIALS, + withXSRFToken: config.CREDENTIALS === 'include' ? config.WITH_CREDENTIALS : false, + cancelToken: source.token, + }; + + onCancel(() => source.cancel('The user aborted a request.')); + + try { + return await axiosClient.request(requestConfig); + } catch (error) { + const axiosError = error as AxiosError; + if (axiosError.response) { + return axiosError.response; + } + throw error; + } +}; + +export const getResponseHeader = (response: AxiosResponse, responseHeader?: string): string | undefined => { + if (responseHeader) { + const content = response.headers[responseHeader]; + if (isString(content)) { + return content; + } + } + return undefined; +}; + +export const getResponseBody = (response: AxiosResponse): any => { + if (response.status !== 204) { + return response.data; + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 403: 'Forbidden', + 404: 'Not Found', + 500: 'Internal Server Error', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param options The request options from the service + * @param axiosClient The axios client instance to use + * @returns CancelablePromise + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, options: ApiRequestOptions, axiosClient: AxiosInstance = axios): CancelablePromise => { + return new CancelablePromise(async (resolve, reject, onCancel) => { + try { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + const headers = await getHeaders(config, options, formData); + + if (!onCancel.isCancelled) { + const response = await sendRequest(config, options, url, body, formData, headers, onCancel, axiosClient); + const responseBody = getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + const result: ApiResult = { + url, + ok: isSuccess(response.status), + status: response.status, + statusText: response.statusText, + body: responseHeader ?? responseBody, + }; + + catchErrorCodes(options, result); + + resolve(result.body); + } + } catch (error) { + reject(error); + } + }); +}; diff --git a/frontend/src/api/index.ts b/frontend/src/api/index.ts new file mode 100644 index 0000000..623ca45 --- /dev/null +++ b/frontend/src/api/index.ts @@ -0,0 +1,51 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export { ApiError } from './core/ApiError.ts'; +export { CancelablePromise, CancelError } from './core/CancelablePromise.ts'; +export { OpenAPI } from './core/OpenAPI.ts'; +export type { OpenAPIConfig } from './core/OpenAPI.ts'; + +export type { HTTPValidationError } from './models/HTTPValidationError.ts'; +export type { InfoOut } from './models/InfoOut.ts'; +export type { OutBase } from './models/OutBase.ts'; +export type { PlanCreateIn } from './models/PlanCreateIn.ts'; +export type { PlanCreateOut } from './models/PlanCreateOut.ts'; +export type { PlanDeleteIn } from './models/PlanDeleteIn.ts'; +export type { PlanGetIn } from './models/PlanGetIn.ts'; +export type { PlanGetOut } from './models/PlanGetOut.ts'; +export type { PlanReorderIn } from './models/PlanReorderIn.ts'; +export type { PlanUpdateIn } from './models/PlanUpdateIn.ts'; +export type { QueueCreateOut } from './models/QueueCreateOut.ts'; +export type { QueueDeleteIn } from './models/QueueDeleteIn.ts'; +export type { QueueGetIn } from './models/QueueGetIn.ts'; +export type { QueueGetOut } from './models/QueueGetOut.ts'; +export type { QueueItemCreateOut } from './models/QueueItemCreateOut.ts'; +export type { QueueItemDeleteIn } from './models/QueueItemDeleteIn.ts'; +export type { QueueItemReorderIn } from './models/QueueItemReorderIn.ts'; +export type { QueueItemUpdateIn } from './models/QueueItemUpdateIn.ts'; +export type { QueueReorderIn } from './models/QueueReorderIn.ts'; +export type { QueueSetInBase } from './models/QueueSetInBase.ts'; +export type { QueueUpdateIn } from './models/QueueUpdateIn.ts'; +export { ScriptCreateIn } from './models/ScriptCreateIn.ts'; +export type { ScriptCreateOut } from './models/ScriptCreateOut.ts'; +export type { ScriptDeleteIn } from './models/ScriptDeleteIn.ts'; +export type { ScriptGetIn } from './models/ScriptGetIn.ts'; +export type { ScriptGetOut } from './models/ScriptGetOut.ts'; +export type { ScriptReorderIn } from './models/ScriptReorderIn.ts'; +export type { ScriptUpdateIn } from './models/ScriptUpdateIn.ts'; +export type { SettingGetOut } from './models/SettingGetOut.ts'; +export type { SettingUpdateIn } from './models/SettingUpdateIn.ts'; +export type { TimeSetCreateOut } from './models/TimeSetCreateOut.ts'; +export type { TimeSetDeleteIn } from './models/TimeSetDeleteIn.ts'; +export type { TimeSetReorderIn } from './models/TimeSetReorderIn.ts'; +export type { TimeSetUpdateIn } from './models/TimeSetUpdateIn.ts'; +export type { UserCreateOut } from './models/UserCreateOut.ts'; +export type { UserDeleteIn } from './models/UserDeleteIn.ts'; +export type { UserInBase } from './models/UserInBase.ts'; +export type { UserReorderIn } from './models/UserReorderIn.ts'; +export type { UserUpdateIn } from './models/UserUpdateIn.ts'; +export type { ValidationError } from './models/ValidationError.ts'; + +export { Service } from './services/Service.ts'; diff --git a/frontend/src/api/models/HTTPValidationError.ts b/frontend/src/api/models/HTTPValidationError.ts new file mode 100644 index 0000000..216ff15 --- /dev/null +++ b/frontend/src/api/models/HTTPValidationError.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { ValidationError } from './ValidationError.ts'; +export type HTTPValidationError = { + detail?: Array; +}; + diff --git a/frontend/src/api/models/InfoOut.ts b/frontend/src/api/models/InfoOut.ts new file mode 100644 index 0000000..ddaa5bf --- /dev/null +++ b/frontend/src/api/models/InfoOut.ts @@ -0,0 +1,23 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type InfoOut = { + /** + * 状态码 + */ + code?: number; + /** + * 操作状态 + */ + status?: string; + /** + * 操作消息 + */ + message?: string; + /** + * 收到的服务器数据 + */ + data: Record; +}; + diff --git a/frontend/src/api/models/OutBase.ts b/frontend/src/api/models/OutBase.ts new file mode 100644 index 0000000..7fd4772 --- /dev/null +++ b/frontend/src/api/models/OutBase.ts @@ -0,0 +1,19 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type OutBase = { + /** + * 状态码 + */ + code?: number; + /** + * 操作状态 + */ + status?: string; + /** + * 操作消息 + */ + message?: string; +}; + diff --git a/frontend/src/api/models/PlanCreateIn.ts b/frontend/src/api/models/PlanCreateIn.ts new file mode 100644 index 0000000..4ef9995 --- /dev/null +++ b/frontend/src/api/models/PlanCreateIn.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type PlanCreateIn = { + type: string; +}; + diff --git a/frontend/src/api/models/PlanCreateOut.ts b/frontend/src/api/models/PlanCreateOut.ts new file mode 100644 index 0000000..0d1dd56 --- /dev/null +++ b/frontend/src/api/models/PlanCreateOut.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type PlanCreateOut = { + /** + * 状态码 + */ + code?: number; + /** + * 操作状态 + */ + status?: string; + /** + * 操作消息 + */ + message?: string; + /** + * 新创建的计划ID + */ + planId: string; + /** + * 计划配置数据 + */ + data: Record; +}; + diff --git a/frontend/src/api/models/PlanDeleteIn.ts b/frontend/src/api/models/PlanDeleteIn.ts new file mode 100644 index 0000000..75fc54c --- /dev/null +++ b/frontend/src/api/models/PlanDeleteIn.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type PlanDeleteIn = { + /** + * 计划ID + */ + planId: string; +}; + diff --git a/frontend/src/api/models/PlanGetIn.ts b/frontend/src/api/models/PlanGetIn.ts new file mode 100644 index 0000000..c46e63b --- /dev/null +++ b/frontend/src/api/models/PlanGetIn.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type PlanGetIn = { + /** + * 计划ID,仅在模式为Single时需要 + */ + planId?: (string | null); +}; + diff --git a/frontend/src/api/models/PlanGetOut.ts b/frontend/src/api/models/PlanGetOut.ts new file mode 100644 index 0000000..70632b7 --- /dev/null +++ b/frontend/src/api/models/PlanGetOut.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type PlanGetOut = { + /** + * 状态码 + */ + code?: number; + /** + * 操作状态 + */ + status?: string; + /** + * 操作消息 + */ + message?: string; + /** + * 计划索引列表 + */ + index: Array>; + /** + * 计划列表或单个计划数据 + */ + data: Record; +}; + diff --git a/frontend/src/api/models/PlanReorderIn.ts b/frontend/src/api/models/PlanReorderIn.ts new file mode 100644 index 0000000..0abbff5 --- /dev/null +++ b/frontend/src/api/models/PlanReorderIn.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type PlanReorderIn = { + /** + * 计划ID列表,按新顺序排列 + */ + indexList: Array; +}; + diff --git a/frontend/src/api/models/PlanUpdateIn.ts b/frontend/src/api/models/PlanUpdateIn.ts new file mode 100644 index 0000000..a1f270b --- /dev/null +++ b/frontend/src/api/models/PlanUpdateIn.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type PlanUpdateIn = { + /** + * 计划ID + */ + planId: string; + /** + * 计划更新数据 + */ + data: Record>; +}; + diff --git a/frontend/src/api/models/QueueCreateOut.ts b/frontend/src/api/models/QueueCreateOut.ts new file mode 100644 index 0000000..9168064 --- /dev/null +++ b/frontend/src/api/models/QueueCreateOut.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type QueueCreateOut = { + /** + * 状态码 + */ + code?: number; + /** + * 操作状态 + */ + status?: string; + /** + * 操作消息 + */ + message?: string; + /** + * 新创建的队列ID + */ + queueId: string; + /** + * 队列配置数据 + */ + data: Record; +}; + diff --git a/frontend/src/api/models/QueueDeleteIn.ts b/frontend/src/api/models/QueueDeleteIn.ts new file mode 100644 index 0000000..7bc4b30 --- /dev/null +++ b/frontend/src/api/models/QueueDeleteIn.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type QueueDeleteIn = { + /** + * 队列ID + */ + queueId: string; +}; + diff --git a/frontend/src/api/models/QueueGetIn.ts b/frontend/src/api/models/QueueGetIn.ts new file mode 100644 index 0000000..2ef0eeb --- /dev/null +++ b/frontend/src/api/models/QueueGetIn.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type QueueGetIn = { + /** + * 队列ID,仅在模式为Single时需要 + */ + queueId?: (string | null); +}; + diff --git a/frontend/src/api/models/QueueGetOut.ts b/frontend/src/api/models/QueueGetOut.ts new file mode 100644 index 0000000..21ab397 --- /dev/null +++ b/frontend/src/api/models/QueueGetOut.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type QueueGetOut = { + /** + * 状态码 + */ + code?: number; + /** + * 操作状态 + */ + status?: string; + /** + * 操作消息 + */ + message?: string; + /** + * 队列索引列表 + */ + index: Array>; + /** + * 队列列表或单个队列数据 + */ + data: Record; +}; + diff --git a/frontend/src/api/models/QueueItemCreateOut.ts b/frontend/src/api/models/QueueItemCreateOut.ts new file mode 100644 index 0000000..77bab89 --- /dev/null +++ b/frontend/src/api/models/QueueItemCreateOut.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type QueueItemCreateOut = { + /** + * 状态码 + */ + code?: number; + /** + * 操作状态 + */ + status?: string; + /** + * 操作消息 + */ + message?: string; + /** + * 新创建的队列项ID + */ + queueItemId: string; + /** + * 队列项配置数据 + */ + data: Record; +}; + diff --git a/frontend/src/api/models/QueueItemDeleteIn.ts b/frontend/src/api/models/QueueItemDeleteIn.ts new file mode 100644 index 0000000..c7a454b --- /dev/null +++ b/frontend/src/api/models/QueueItemDeleteIn.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type QueueItemDeleteIn = { + /** + * 所属队列ID + */ + queueId: string; + /** + * 队列项ID + */ + queueItemId: string; +}; + diff --git a/frontend/src/api/models/QueueItemReorderIn.ts b/frontend/src/api/models/QueueItemReorderIn.ts new file mode 100644 index 0000000..0a81e1c --- /dev/null +++ b/frontend/src/api/models/QueueItemReorderIn.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type QueueItemReorderIn = { + /** + * 所属队列ID + */ + queueId: string; + /** + * 队列项ID列表,按新顺序排列 + */ + indexList: Array; +}; + diff --git a/frontend/src/api/models/QueueItemUpdateIn.ts b/frontend/src/api/models/QueueItemUpdateIn.ts new file mode 100644 index 0000000..1734b93 --- /dev/null +++ b/frontend/src/api/models/QueueItemUpdateIn.ts @@ -0,0 +1,19 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type QueueItemUpdateIn = { + /** + * 所属队列ID + */ + queueId: string; + /** + * 队列项ID + */ + queueItemId: string; + /** + * 队列项更新数据 + */ + data: Record>; +}; + diff --git a/frontend/src/api/models/QueueReorderIn.ts b/frontend/src/api/models/QueueReorderIn.ts new file mode 100644 index 0000000..b718e87 --- /dev/null +++ b/frontend/src/api/models/QueueReorderIn.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type QueueReorderIn = { + /** + * 调度队列ID列表,按新顺序排列 + */ + indexList: Array; +}; + diff --git a/frontend/src/api/models/QueueSetInBase.ts b/frontend/src/api/models/QueueSetInBase.ts new file mode 100644 index 0000000..d431c60 --- /dev/null +++ b/frontend/src/api/models/QueueSetInBase.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type QueueSetInBase = { + /** + * 所属队列ID + */ + queueId: string; +}; + diff --git a/frontend/src/api/models/QueueUpdateIn.ts b/frontend/src/api/models/QueueUpdateIn.ts new file mode 100644 index 0000000..2934f4b --- /dev/null +++ b/frontend/src/api/models/QueueUpdateIn.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type QueueUpdateIn = { + /** + * 队列ID + */ + queueId: string; + /** + * 队列更新数据 + */ + data: Record>; +}; + diff --git a/frontend/src/api/models/ScriptCreateIn.ts b/frontend/src/api/models/ScriptCreateIn.ts new file mode 100644 index 0000000..1d0d824 --- /dev/null +++ b/frontend/src/api/models/ScriptCreateIn.ts @@ -0,0 +1,14 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ScriptCreateIn = { + type: ScriptCreateIn.type; +}; +export namespace ScriptCreateIn { + export enum type { + MAA = 'MAA', + GENERAL = 'General', + } +} + diff --git a/frontend/src/api/models/ScriptCreateOut.ts b/frontend/src/api/models/ScriptCreateOut.ts new file mode 100644 index 0000000..96bda08 --- /dev/null +++ b/frontend/src/api/models/ScriptCreateOut.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ScriptCreateOut = { + /** + * 状态码 + */ + code?: number; + /** + * 操作状态 + */ + status?: string; + /** + * 操作消息 + */ + message?: string; + /** + * 新创建的脚本ID + */ + scriptId: string; + /** + * 脚本配置数据 + */ + data: Record; +}; + diff --git a/frontend/src/api/models/ScriptDeleteIn.ts b/frontend/src/api/models/ScriptDeleteIn.ts new file mode 100644 index 0000000..21b3e4b --- /dev/null +++ b/frontend/src/api/models/ScriptDeleteIn.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ScriptDeleteIn = { + /** + * 脚本ID + */ + scriptId: string; +}; + diff --git a/frontend/src/api/models/ScriptGetIn.ts b/frontend/src/api/models/ScriptGetIn.ts new file mode 100644 index 0000000..44ca873 --- /dev/null +++ b/frontend/src/api/models/ScriptGetIn.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ScriptGetIn = { + /** + * 脚本ID,仅在模式为Single时需要 + */ + scriptId?: (string | null); +}; + diff --git a/frontend/src/api/models/ScriptGetOut.ts b/frontend/src/api/models/ScriptGetOut.ts new file mode 100644 index 0000000..3c20e2f --- /dev/null +++ b/frontend/src/api/models/ScriptGetOut.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ScriptGetOut = { + /** + * 状态码 + */ + code?: number; + /** + * 操作状态 + */ + status?: string; + /** + * 操作消息 + */ + message?: string; + /** + * 脚本索引列表 + */ + index: Array>; + /** + * 脚本列表或单个脚本数据 + */ + data: Record; +}; + diff --git a/frontend/src/api/models/ScriptReorderIn.ts b/frontend/src/api/models/ScriptReorderIn.ts new file mode 100644 index 0000000..d24268b --- /dev/null +++ b/frontend/src/api/models/ScriptReorderIn.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ScriptReorderIn = { + /** + * 脚本ID列表,按新顺序排列 + */ + indexList: Array; +}; + diff --git a/frontend/src/api/models/ScriptUpdateIn.ts b/frontend/src/api/models/ScriptUpdateIn.ts new file mode 100644 index 0000000..f7a5584 --- /dev/null +++ b/frontend/src/api/models/ScriptUpdateIn.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ScriptUpdateIn = { + /** + * 脚本ID + */ + scriptId: string; + /** + * 脚本更新数据 + */ + data: Record>; +}; + diff --git a/frontend/src/api/models/SettingGetOut.ts b/frontend/src/api/models/SettingGetOut.ts new file mode 100644 index 0000000..d478626 --- /dev/null +++ b/frontend/src/api/models/SettingGetOut.ts @@ -0,0 +1,23 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type SettingGetOut = { + /** + * 状态码 + */ + code?: number; + /** + * 操作状态 + */ + status?: string; + /** + * 操作消息 + */ + message?: string; + /** + * 全局设置数据 + */ + data: Record>; +}; + diff --git a/frontend/src/api/models/SettingUpdateIn.ts b/frontend/src/api/models/SettingUpdateIn.ts new file mode 100644 index 0000000..791a6e9 --- /dev/null +++ b/frontend/src/api/models/SettingUpdateIn.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type SettingUpdateIn = { + /** + * 全局设置更新数据 + */ + data: Record>; +}; + diff --git a/frontend/src/api/models/TimeSetCreateOut.ts b/frontend/src/api/models/TimeSetCreateOut.ts new file mode 100644 index 0000000..06c5fc9 --- /dev/null +++ b/frontend/src/api/models/TimeSetCreateOut.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type TimeSetCreateOut = { + /** + * 状态码 + */ + code?: number; + /** + * 操作状态 + */ + status?: string; + /** + * 操作消息 + */ + message?: string; + /** + * 新创建的时间设置ID + */ + timeSetId: string; + /** + * 时间设置配置数据 + */ + data: Record; +}; + diff --git a/frontend/src/api/models/TimeSetDeleteIn.ts b/frontend/src/api/models/TimeSetDeleteIn.ts new file mode 100644 index 0000000..380f550 --- /dev/null +++ b/frontend/src/api/models/TimeSetDeleteIn.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type TimeSetDeleteIn = { + /** + * 所属队列ID + */ + queueId: string; + /** + * 时间设置ID + */ + timeSetId: string; +}; + diff --git a/frontend/src/api/models/TimeSetReorderIn.ts b/frontend/src/api/models/TimeSetReorderIn.ts new file mode 100644 index 0000000..e8e3078 --- /dev/null +++ b/frontend/src/api/models/TimeSetReorderIn.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type TimeSetReorderIn = { + /** + * 所属队列ID + */ + queueId: string; + /** + * 时间设置ID列表,按新顺序排列 + */ + indexList: Array; +}; + diff --git a/frontend/src/api/models/TimeSetUpdateIn.ts b/frontend/src/api/models/TimeSetUpdateIn.ts new file mode 100644 index 0000000..79647b7 --- /dev/null +++ b/frontend/src/api/models/TimeSetUpdateIn.ts @@ -0,0 +1,19 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type TimeSetUpdateIn = { + /** + * 所属队列ID + */ + queueId: string; + /** + * 时间设置ID + */ + timeSetId: string; + /** + * 时间设置更新数据 + */ + data: Record>; +}; + diff --git a/frontend/src/api/models/UserCreateOut.ts b/frontend/src/api/models/UserCreateOut.ts new file mode 100644 index 0000000..35052ef --- /dev/null +++ b/frontend/src/api/models/UserCreateOut.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type UserCreateOut = { + /** + * 状态码 + */ + code?: number; + /** + * 操作状态 + */ + status?: string; + /** + * 操作消息 + */ + message?: string; + /** + * 新创建的用户ID + */ + userId: string; + /** + * 用户配置数据 + */ + data: Record; +}; + diff --git a/frontend/src/api/models/UserDeleteIn.ts b/frontend/src/api/models/UserDeleteIn.ts new file mode 100644 index 0000000..7a9f847 --- /dev/null +++ b/frontend/src/api/models/UserDeleteIn.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type UserDeleteIn = { + /** + * 所属脚本ID + */ + scriptId: string; + /** + * 用户ID + */ + userId: string; +}; + diff --git a/frontend/src/api/models/UserInBase.ts b/frontend/src/api/models/UserInBase.ts new file mode 100644 index 0000000..1d31b2c --- /dev/null +++ b/frontend/src/api/models/UserInBase.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type UserInBase = { + /** + * 所属脚本ID + */ + scriptId: string; +}; + diff --git a/frontend/src/api/models/UserReorderIn.ts b/frontend/src/api/models/UserReorderIn.ts new file mode 100644 index 0000000..359c818 --- /dev/null +++ b/frontend/src/api/models/UserReorderIn.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type UserReorderIn = { + /** + * 所属脚本ID + */ + scriptId: string; + /** + * 用户ID列表,按新顺序排列 + */ + indexList: Array; +}; + diff --git a/frontend/src/api/models/UserUpdateIn.ts b/frontend/src/api/models/UserUpdateIn.ts new file mode 100644 index 0000000..e185669 --- /dev/null +++ b/frontend/src/api/models/UserUpdateIn.ts @@ -0,0 +1,19 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type UserUpdateIn = { + /** + * 所属脚本ID + */ + scriptId: string; + /** + * 用户ID + */ + userId: string; + /** + * 用户更新数据 + */ + data: Record>; +}; + diff --git a/frontend/src/api/models/ValidationError.ts b/frontend/src/api/models/ValidationError.ts new file mode 100644 index 0000000..aaf1c92 --- /dev/null +++ b/frontend/src/api/models/ValidationError.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ValidationError = { + loc: Array<(string | number)>; + msg: string; + type: string; +}; + diff --git a/frontend/src/api/services/Service.ts b/frontend/src/api/services/Service.ts new file mode 100644 index 0000000..d1283b9 --- /dev/null +++ b/frontend/src/api/services/Service.ts @@ -0,0 +1,617 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { InfoOut } from '../models/InfoOut.ts'; +import type { OutBase } from '../models/OutBase.ts'; +import type { PlanCreateIn } from '../models/PlanCreateIn.ts'; +import type { PlanCreateOut } from '../models/PlanCreateOut.ts'; +import type { PlanDeleteIn } from '../models/PlanDeleteIn.ts'; +import type { PlanGetIn } from '../models/PlanGetIn.ts'; +import type { PlanGetOut } from '../models/PlanGetOut.ts'; +import type { PlanReorderIn } from '../models/PlanReorderIn.ts'; +import type { PlanUpdateIn } from '../models/PlanUpdateIn.ts'; +import type { QueueCreateOut } from '../models/QueueCreateOut.ts'; +import type { QueueDeleteIn } from '../models/QueueDeleteIn.ts'; +import type { QueueGetIn } from '../models/QueueGetIn.ts'; +import type { QueueGetOut } from '../models/QueueGetOut.ts'; +import type { QueueItemCreateOut } from '../models/QueueItemCreateOut.ts'; +import type { QueueItemDeleteIn } from '../models/QueueItemDeleteIn.ts'; +import type { QueueItemReorderIn } from '../models/QueueItemReorderIn.ts'; +import type { QueueItemUpdateIn } from '../models/QueueItemUpdateIn.ts'; +import type { QueueReorderIn } from '../models/QueueReorderIn.ts'; +import type { QueueSetInBase } from '../models/QueueSetInBase.ts'; +import type { QueueUpdateIn } from '../models/QueueUpdateIn.ts'; +import type { ScriptCreateIn } from '../models/ScriptCreateIn.ts'; +import type { ScriptCreateOut } from '../models/ScriptCreateOut.ts'; +import type { ScriptDeleteIn } from '../models/ScriptDeleteIn.ts'; +import type { ScriptGetIn } from '../models/ScriptGetIn.ts'; +import type { ScriptGetOut } from '../models/ScriptGetOut.ts'; +import type { ScriptReorderIn } from '../models/ScriptReorderIn.ts'; +import type { ScriptUpdateIn } from '../models/ScriptUpdateIn.ts'; +import type { SettingGetOut } from '../models/SettingGetOut.ts'; +import type { SettingUpdateIn } from '../models/SettingUpdateIn.ts'; +import type { TimeSetCreateOut } from '../models/TimeSetCreateOut.ts'; +import type { TimeSetDeleteIn } from '../models/TimeSetDeleteIn.ts'; +import type { TimeSetReorderIn } from '../models/TimeSetReorderIn.ts'; +import type { TimeSetUpdateIn } from '../models/TimeSetUpdateIn.ts'; +import type { UserCreateOut } from '../models/UserCreateOut.ts'; +import type { UserDeleteIn } from '../models/UserDeleteIn.ts'; +import type { UserInBase } from '../models/UserInBase.ts'; +import type { UserReorderIn } from '../models/UserReorderIn.ts'; +import type { UserUpdateIn } from '../models/UserUpdateIn.ts'; +import type { CancelablePromise } from '../core/CancelablePromise.ts'; +import { OpenAPI } from '../core/OpenAPI.ts'; +import { request as __request } from '../core/request.ts'; +export class Service { + /** + * 获取关卡号信息 + * @returns InfoOut Successful Response + * @throws ApiError + */ + public static getStageInfoApiInfoStagePost(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/info/stage', + }); + } + /** + * 获取通知信息 + * @returns InfoOut Successful Response + * @throws ApiError + */ + public static getNoticeInfoApiInfoNoticePost(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/info/notice', + }); + } + /** + * 获取可下载应用信息 + * @returns InfoOut Successful Response + * @throws ApiError + */ + public static getAppsInfoApiInfoAppsInfoPost(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/info/apps_info', + }); + } + /** + * 添加脚本 + * @param requestBody + * @returns ScriptCreateOut Successful Response + * @throws ApiError + */ + public static addScriptApiScriptsAddPost( + requestBody: ScriptCreateIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/scripts/add', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 查询脚本配置信息 + * @param requestBody + * @returns ScriptGetOut Successful Response + * @throws ApiError + */ + public static getScriptsApiScriptsGetPost( + requestBody: ScriptGetIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/scripts/get', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 更新脚本配置信息 + * @param requestBody + * @returns OutBase Successful Response + * @throws ApiError + */ + public static updateScriptApiScriptsUpdatePost( + requestBody: ScriptUpdateIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/scripts/update', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 删除脚本 + * @param requestBody + * @returns OutBase Successful Response + * @throws ApiError + */ + public static deleteScriptApiScriptsDeletePost( + requestBody: ScriptDeleteIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/scripts/delete', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 重新排序脚本 + * @param requestBody + * @returns OutBase Successful Response + * @throws ApiError + */ + public static reorderScriptApiScriptsOrderPost( + requestBody: ScriptReorderIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/scripts/order', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 添加用户 + * @param requestBody + * @returns UserCreateOut Successful Response + * @throws ApiError + */ + public static addUserApiScriptsUserAddPost( + requestBody: UserInBase, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/scripts/user/add', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 更新用户配置信息 + * @param requestBody + * @returns OutBase Successful Response + * @throws ApiError + */ + public static updateUserApiScriptsUserUpdatePost( + requestBody: UserUpdateIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/scripts/user/update', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 删除用户 + * @param requestBody + * @returns OutBase Successful Response + * @throws ApiError + */ + public static deleteUserApiScriptsUserDeletePost( + requestBody: UserDeleteIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/scripts/user/delete', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 重新排序用户 + * @param requestBody + * @returns OutBase Successful Response + * @throws ApiError + */ + public static reorderUserApiScriptsUserOrderPost( + requestBody: UserReorderIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/scripts/user/order', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 添加计划表 + * @param requestBody + * @returns PlanCreateOut Successful Response + * @throws ApiError + */ + public static addPlanApiPlanAddPost( + requestBody: PlanCreateIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/plan/add', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 查询计划表配置信息 + * @param requestBody + * @returns PlanGetOut Successful Response + * @throws ApiError + */ + public static getPlanApiPlanGetPost( + requestBody: PlanGetIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/plan/get', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 更新计划表配置信息 + * @param requestBody + * @returns OutBase Successful Response + * @throws ApiError + */ + public static updatePlanApiPlanUpdatePost( + requestBody: PlanUpdateIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/plan/update', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 删除计划表 + * @param requestBody + * @returns OutBase Successful Response + * @throws ApiError + */ + public static deletePlanApiPlanDeletePost( + requestBody: PlanDeleteIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/plan/delete', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 重新排序计划表 + * @param requestBody + * @returns OutBase Successful Response + * @throws ApiError + */ + public static reorderPlanApiPlanOrderPost( + requestBody: PlanReorderIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/plan/order', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 添加调度队列 + * @returns QueueCreateOut Successful Response + * @throws ApiError + */ + public static addQueueApiQueueAddPost(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/queue/add', + }); + } + /** + * 查询调度队列配置信息 + * @param requestBody + * @returns QueueGetOut Successful Response + * @throws ApiError + */ + public static getQueuesApiQueueGetPost( + requestBody: QueueGetIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/queue/get', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 更新调度队列配置信息 + * @param requestBody + * @returns OutBase Successful Response + * @throws ApiError + */ + public static updateQueueApiQueueUpdatePost( + requestBody: QueueUpdateIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/queue/update', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 删除调度队列 + * @param requestBody + * @returns OutBase Successful Response + * @throws ApiError + */ + public static deleteQueueApiQueueDeletePost( + requestBody: QueueDeleteIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/queue/delete', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 重新排序 + * @param requestBody + * @returns OutBase Successful Response + * @throws ApiError + */ + public static reorderQueueApiQueueOrderPost( + requestBody: QueueReorderIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/queue/order', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 添加定时项 + * @param requestBody + * @returns TimeSetCreateOut Successful Response + * @throws ApiError + */ + public static addTimeSetApiQueueTimeAddPost( + requestBody: QueueSetInBase, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/queue/time/add', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 更新定时项 + * @param requestBody + * @returns OutBase Successful Response + * @throws ApiError + */ + public static updateTimeSetApiQueueTimeUpdatePost( + requestBody: TimeSetUpdateIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/queue/time/update', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 删除定时项 + * @param requestBody + * @returns OutBase Successful Response + * @throws ApiError + */ + public static deleteTimeSetApiQueueTimeDeletePost( + requestBody: TimeSetDeleteIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/queue/time/delete', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 重新排序时间设置 + * @param requestBody + * @returns OutBase Successful Response + * @throws ApiError + */ + public static reorderTimeSetApiQueueTimeOrderPost( + requestBody: TimeSetReorderIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/queue/time/order', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 添加队列项 + * @param requestBody + * @returns QueueItemCreateOut Successful Response + * @throws ApiError + */ + public static addItemApiQueueItemAddPost( + requestBody: QueueSetInBase, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/queue/item/add', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 更新队列项 + * @param requestBody + * @returns OutBase Successful Response + * @throws ApiError + */ + public static updateItemApiQueueItemUpdatePost( + requestBody: QueueItemUpdateIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/queue/item/update', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 删除队列项 + * @param requestBody + * @returns OutBase Successful Response + * @throws ApiError + */ + public static deleteItemApiQueueItemDeletePost( + requestBody: QueueItemDeleteIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/queue/item/delete', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 重新排序队列项 + * @param requestBody + * @returns OutBase Successful Response + * @throws ApiError + */ + public static reorderItemApiQueueItemOrderPost( + requestBody: QueueItemReorderIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/queue/item/order', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 查询配置 + * 查询配置 + * @returns SettingGetOut Successful Response + * @throws ApiError + */ + public static getScriptsApiSettingGetPost(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/setting/get', + }); + } + /** + * 更新配置 + * 更新配置 + * @param requestBody + * @returns OutBase Successful Response + * @throws ApiError + */ + public static updateScriptApiSettingUpdatePost( + requestBody: SettingUpdateIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/setting/update', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } +} diff --git a/frontend/src/components/ScriptTable.vue b/frontend/src/components/ScriptTable.vue index dc119b3..0e62f21 100644 --- a/frontend/src/components/ScriptTable.vue +++ b/frontend/src/components/ScriptTable.vue @@ -83,7 +83,13 @@ row-key="id" class="user-table" > +