feat(api): 添加任务调度相关接口和模型
- 新增 DispatchIn、TaskCreateIn 和 TaskCreateOut 模型 - 在 Service 类中添加任务调度相关接口: - addOverviewApiInfoGetOverviewPost - addTaskApiDispatchStartPost - stopTaskApiDispatchStopPost - 更新 index.ts,导出新增的模型和接口 - 优化导入路径,去除不必要的文件扩展名
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import type { ApiRequestOptions } from './ApiRequestOptions.ts';
|
import type { ApiRequestOptions } from './ApiRequestOptions';
|
||||||
import type { ApiResult } from './ApiResult.ts';
|
import type { ApiResult } from './ApiResult';
|
||||||
|
|
||||||
export class ApiError extends Error {
|
export class ApiError extends Error {
|
||||||
public readonly url: string;
|
public readonly url: string;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import type { ApiRequestOptions } from './ApiRequestOptions.ts';
|
import type { ApiRequestOptions } from './ApiRequestOptions';
|
||||||
|
|
||||||
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
|
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
|
||||||
type Headers = Record<string, string>;
|
type Headers = Record<string, string>;
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ import axios from 'axios';
|
|||||||
import type { AxiosError, AxiosRequestConfig, AxiosResponse, AxiosInstance } from 'axios';
|
import type { AxiosError, AxiosRequestConfig, AxiosResponse, AxiosInstance } from 'axios';
|
||||||
import FormData from 'form-data';
|
import FormData from 'form-data';
|
||||||
|
|
||||||
import { ApiError } from './ApiError.ts';
|
import { ApiError } from './ApiError';
|
||||||
import type { ApiRequestOptions } from './ApiRequestOptions.ts';
|
import type { ApiRequestOptions } from './ApiRequestOptions';
|
||||||
import type { ApiResult } from './ApiResult.ts';
|
import type { ApiResult } from './ApiResult';
|
||||||
import { CancelablePromise } from './CancelablePromise.ts';
|
import { CancelablePromise } from './CancelablePromise';
|
||||||
import type { OnCancel } from './CancelablePromise.ts';
|
import type { OnCancel } from './CancelablePromise';
|
||||||
import type { OpenAPIConfig } from './OpenAPI.ts';
|
import type { OpenAPIConfig } from './OpenAPI';
|
||||||
|
|
||||||
export const isDefined = <T>(value: T | null | undefined): value is Exclude<T, null | undefined> => {
|
export const isDefined = <T>(value: T | null | undefined): value is Exclude<T, null | undefined> => {
|
||||||
return value !== undefined && value !== null;
|
return value !== undefined && value !== null;
|
||||||
|
|||||||
@@ -2,50 +2,53 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
export { ApiError } from './core/ApiError.ts';
|
export { ApiError } from './core/ApiError';
|
||||||
export { CancelablePromise, CancelError } from './core/CancelablePromise.ts';
|
export { CancelablePromise, CancelError } from './core/CancelablePromise';
|
||||||
export { OpenAPI } from './core/OpenAPI.ts';
|
export { OpenAPI } from './core/OpenAPI';
|
||||||
export type { OpenAPIConfig } from './core/OpenAPI.ts';
|
export type { OpenAPIConfig } from './core/OpenAPI';
|
||||||
|
|
||||||
export type { HTTPValidationError } from './models/HTTPValidationError.ts';
|
export type { DispatchIn } from './models/DispatchIn';
|
||||||
export type { InfoOut } from './models/InfoOut.ts';
|
export type { HTTPValidationError } from './models/HTTPValidationError';
|
||||||
export type { OutBase } from './models/OutBase.ts';
|
export type { InfoOut } from './models/InfoOut';
|
||||||
export type { PlanCreateIn } from './models/PlanCreateIn.ts';
|
export type { OutBase } from './models/OutBase';
|
||||||
export type { PlanCreateOut } from './models/PlanCreateOut.ts';
|
export type { PlanCreateIn } from './models/PlanCreateIn';
|
||||||
export type { PlanDeleteIn } from './models/PlanDeleteIn.ts';
|
export type { PlanCreateOut } from './models/PlanCreateOut';
|
||||||
export type { PlanGetIn } from './models/PlanGetIn.ts';
|
export type { PlanDeleteIn } from './models/PlanDeleteIn';
|
||||||
export type { PlanGetOut } from './models/PlanGetOut.ts';
|
export type { PlanGetIn } from './models/PlanGetIn';
|
||||||
export type { PlanReorderIn } from './models/PlanReorderIn.ts';
|
export type { PlanGetOut } from './models/PlanGetOut';
|
||||||
export type { PlanUpdateIn } from './models/PlanUpdateIn.ts';
|
export type { PlanReorderIn } from './models/PlanReorderIn';
|
||||||
export type { QueueCreateOut } from './models/QueueCreateOut.ts';
|
export type { PlanUpdateIn } from './models/PlanUpdateIn';
|
||||||
export type { QueueDeleteIn } from './models/QueueDeleteIn.ts';
|
export type { QueueCreateOut } from './models/QueueCreateOut';
|
||||||
export type { QueueGetIn } from './models/QueueGetIn.ts';
|
export type { QueueDeleteIn } from './models/QueueDeleteIn';
|
||||||
export type { QueueGetOut } from './models/QueueGetOut.ts';
|
export type { QueueGetIn } from './models/QueueGetIn';
|
||||||
export type { QueueItemCreateOut } from './models/QueueItemCreateOut.ts';
|
export type { QueueGetOut } from './models/QueueGetOut';
|
||||||
export type { QueueItemDeleteIn } from './models/QueueItemDeleteIn.ts';
|
export type { QueueItemCreateOut } from './models/QueueItemCreateOut';
|
||||||
export type { QueueItemReorderIn } from './models/QueueItemReorderIn.ts';
|
export type { QueueItemDeleteIn } from './models/QueueItemDeleteIn';
|
||||||
export type { QueueItemUpdateIn } from './models/QueueItemUpdateIn.ts';
|
export type { QueueItemReorderIn } from './models/QueueItemReorderIn';
|
||||||
export type { QueueReorderIn } from './models/QueueReorderIn.ts';
|
export type { QueueItemUpdateIn } from './models/QueueItemUpdateIn';
|
||||||
export type { QueueSetInBase } from './models/QueueSetInBase.ts';
|
export type { QueueReorderIn } from './models/QueueReorderIn';
|
||||||
export type { QueueUpdateIn } from './models/QueueUpdateIn.ts';
|
export type { QueueSetInBase } from './models/QueueSetInBase';
|
||||||
export { ScriptCreateIn } from './models/ScriptCreateIn.ts';
|
export type { QueueUpdateIn } from './models/QueueUpdateIn';
|
||||||
export type { ScriptCreateOut } from './models/ScriptCreateOut.ts';
|
export { ScriptCreateIn } from './models/ScriptCreateIn';
|
||||||
export type { ScriptDeleteIn } from './models/ScriptDeleteIn.ts';
|
export type { ScriptCreateOut } from './models/ScriptCreateOut';
|
||||||
export type { ScriptGetIn } from './models/ScriptGetIn.ts';
|
export type { ScriptDeleteIn } from './models/ScriptDeleteIn';
|
||||||
export type { ScriptGetOut } from './models/ScriptGetOut.ts';
|
export type { ScriptGetIn } from './models/ScriptGetIn';
|
||||||
export type { ScriptReorderIn } from './models/ScriptReorderIn.ts';
|
export type { ScriptGetOut } from './models/ScriptGetOut';
|
||||||
export type { ScriptUpdateIn } from './models/ScriptUpdateIn.ts';
|
export type { ScriptReorderIn } from './models/ScriptReorderIn';
|
||||||
export type { SettingGetOut } from './models/SettingGetOut.ts';
|
export type { ScriptUpdateIn } from './models/ScriptUpdateIn';
|
||||||
export type { SettingUpdateIn } from './models/SettingUpdateIn.ts';
|
export type { SettingGetOut } from './models/SettingGetOut';
|
||||||
export type { TimeSetCreateOut } from './models/TimeSetCreateOut.ts';
|
export type { SettingUpdateIn } from './models/SettingUpdateIn';
|
||||||
export type { TimeSetDeleteIn } from './models/TimeSetDeleteIn.ts';
|
export { TaskCreateIn } from './models/TaskCreateIn';
|
||||||
export type { TimeSetReorderIn } from './models/TimeSetReorderIn.ts';
|
export type { TaskCreateOut } from './models/TaskCreateOut';
|
||||||
export type { TimeSetUpdateIn } from './models/TimeSetUpdateIn.ts';
|
export type { TimeSetCreateOut } from './models/TimeSetCreateOut';
|
||||||
export type { UserCreateOut } from './models/UserCreateOut.ts';
|
export type { TimeSetDeleteIn } from './models/TimeSetDeleteIn';
|
||||||
export type { UserDeleteIn } from './models/UserDeleteIn.ts';
|
export type { TimeSetReorderIn } from './models/TimeSetReorderIn';
|
||||||
export type { UserInBase } from './models/UserInBase.ts';
|
export type { TimeSetUpdateIn } from './models/TimeSetUpdateIn';
|
||||||
export type { UserReorderIn } from './models/UserReorderIn.ts';
|
export type { UserCreateOut } from './models/UserCreateOut';
|
||||||
export type { UserUpdateIn } from './models/UserUpdateIn.ts';
|
export type { UserDeleteIn } from './models/UserDeleteIn';
|
||||||
export type { ValidationError } from './models/ValidationError.ts';
|
export type { UserInBase } from './models/UserInBase';
|
||||||
|
export type { UserReorderIn } from './models/UserReorderIn';
|
||||||
|
export type { UserUpdateIn } from './models/UserUpdateIn';
|
||||||
|
export type { ValidationError } from './models/ValidationError';
|
||||||
|
|
||||||
export { Service } from './services/Service.ts';
|
export { Service } from './services/Service';
|
||||||
|
|||||||
11
frontend/src/api/models/DispatchIn.ts
Normal file
11
frontend/src/api/models/DispatchIn.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export type DispatchIn = {
|
||||||
|
/**
|
||||||
|
* 目标任务ID,设置类任务可选对应脚本ID或用户ID,代理类任务可选对应队列ID或脚本ID
|
||||||
|
*/
|
||||||
|
taskId: string;
|
||||||
|
};
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import type { ValidationError } from './ValidationError.ts';
|
import type { ValidationError } from './ValidationError';
|
||||||
export type HTTPValidationError = {
|
export type HTTPValidationError = {
|
||||||
detail?: Array<ValidationError>;
|
detail?: Array<ValidationError>;
|
||||||
};
|
};
|
||||||
|
|||||||
25
frontend/src/api/models/TaskCreateIn.ts
Normal file
25
frontend/src/api/models/TaskCreateIn.ts
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export type TaskCreateIn = {
|
||||||
|
/**
|
||||||
|
* 目标任务ID,设置类任务可选对应脚本ID或用户ID,代理类任务可选对应队列ID或脚本ID
|
||||||
|
*/
|
||||||
|
taskId: string;
|
||||||
|
/**
|
||||||
|
* 任务模式
|
||||||
|
*/
|
||||||
|
mode: TaskCreateIn.mode;
|
||||||
|
};
|
||||||
|
export namespace TaskCreateIn {
|
||||||
|
/**
|
||||||
|
* 任务模式
|
||||||
|
*/
|
||||||
|
export enum mode {
|
||||||
|
_ = '自动代理',
|
||||||
|
_ = '人工排查',
|
||||||
|
_ = '设置脚本',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
23
frontend/src/api/models/TaskCreateOut.ts
Normal file
23
frontend/src/api/models/TaskCreateOut.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/* generated using openapi-typescript-codegen -- do not edit */
|
||||||
|
/* istanbul ignore file */
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export type TaskCreateOut = {
|
||||||
|
/**
|
||||||
|
* 状态码
|
||||||
|
*/
|
||||||
|
code?: number;
|
||||||
|
/**
|
||||||
|
* 操作状态
|
||||||
|
*/
|
||||||
|
status?: string;
|
||||||
|
/**
|
||||||
|
* 操作消息
|
||||||
|
*/
|
||||||
|
message?: string;
|
||||||
|
/**
|
||||||
|
* 新创建的任务ID
|
||||||
|
*/
|
||||||
|
taskId: string;
|
||||||
|
};
|
||||||
|
|
||||||
@@ -2,47 +2,50 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import type { InfoOut } from '../models/InfoOut.ts';
|
import type { DispatchIn } from '../models/DispatchIn';
|
||||||
import type { OutBase } from '../models/OutBase.ts';
|
import type { InfoOut } from '../models/InfoOut';
|
||||||
import type { PlanCreateIn } from '../models/PlanCreateIn.ts';
|
import type { OutBase } from '../models/OutBase';
|
||||||
import type { PlanCreateOut } from '../models/PlanCreateOut.ts';
|
import type { PlanCreateIn } from '../models/PlanCreateIn';
|
||||||
import type { PlanDeleteIn } from '../models/PlanDeleteIn.ts';
|
import type { PlanCreateOut } from '../models/PlanCreateOut';
|
||||||
import type { PlanGetIn } from '../models/PlanGetIn.ts';
|
import type { PlanDeleteIn } from '../models/PlanDeleteIn';
|
||||||
import type { PlanGetOut } from '../models/PlanGetOut.ts';
|
import type { PlanGetIn } from '../models/PlanGetIn';
|
||||||
import type { PlanReorderIn } from '../models/PlanReorderIn.ts';
|
import type { PlanGetOut } from '../models/PlanGetOut';
|
||||||
import type { PlanUpdateIn } from '../models/PlanUpdateIn.ts';
|
import type { PlanReorderIn } from '../models/PlanReorderIn';
|
||||||
import type { QueueCreateOut } from '../models/QueueCreateOut.ts';
|
import type { PlanUpdateIn } from '../models/PlanUpdateIn';
|
||||||
import type { QueueDeleteIn } from '../models/QueueDeleteIn.ts';
|
import type { QueueCreateOut } from '../models/QueueCreateOut';
|
||||||
import type { QueueGetIn } from '../models/QueueGetIn.ts';
|
import type { QueueDeleteIn } from '../models/QueueDeleteIn';
|
||||||
import type { QueueGetOut } from '../models/QueueGetOut.ts';
|
import type { QueueGetIn } from '../models/QueueGetIn';
|
||||||
import type { QueueItemCreateOut } from '../models/QueueItemCreateOut.ts';
|
import type { QueueGetOut } from '../models/QueueGetOut';
|
||||||
import type { QueueItemDeleteIn } from '../models/QueueItemDeleteIn.ts';
|
import type { QueueItemCreateOut } from '../models/QueueItemCreateOut';
|
||||||
import type { QueueItemReorderIn } from '../models/QueueItemReorderIn.ts';
|
import type { QueueItemDeleteIn } from '../models/QueueItemDeleteIn';
|
||||||
import type { QueueItemUpdateIn } from '../models/QueueItemUpdateIn.ts';
|
import type { QueueItemReorderIn } from '../models/QueueItemReorderIn';
|
||||||
import type { QueueReorderIn } from '../models/QueueReorderIn.ts';
|
import type { QueueItemUpdateIn } from '../models/QueueItemUpdateIn';
|
||||||
import type { QueueSetInBase } from '../models/QueueSetInBase.ts';
|
import type { QueueReorderIn } from '../models/QueueReorderIn';
|
||||||
import type { QueueUpdateIn } from '../models/QueueUpdateIn.ts';
|
import type { QueueSetInBase } from '../models/QueueSetInBase';
|
||||||
import type { ScriptCreateIn } from '../models/ScriptCreateIn.ts';
|
import type { QueueUpdateIn } from '../models/QueueUpdateIn';
|
||||||
import type { ScriptCreateOut } from '../models/ScriptCreateOut.ts';
|
import type { ScriptCreateIn } from '../models/ScriptCreateIn';
|
||||||
import type { ScriptDeleteIn } from '../models/ScriptDeleteIn.ts';
|
import type { ScriptCreateOut } from '../models/ScriptCreateOut';
|
||||||
import type { ScriptGetIn } from '../models/ScriptGetIn.ts';
|
import type { ScriptDeleteIn } from '../models/ScriptDeleteIn';
|
||||||
import type { ScriptGetOut } from '../models/ScriptGetOut.ts';
|
import type { ScriptGetIn } from '../models/ScriptGetIn';
|
||||||
import type { ScriptReorderIn } from '../models/ScriptReorderIn.ts';
|
import type { ScriptGetOut } from '../models/ScriptGetOut';
|
||||||
import type { ScriptUpdateIn } from '../models/ScriptUpdateIn.ts';
|
import type { ScriptReorderIn } from '../models/ScriptReorderIn';
|
||||||
import type { SettingGetOut } from '../models/SettingGetOut.ts';
|
import type { ScriptUpdateIn } from '../models/ScriptUpdateIn';
|
||||||
import type { SettingUpdateIn } from '../models/SettingUpdateIn.ts';
|
import type { SettingGetOut } from '../models/SettingGetOut';
|
||||||
import type { TimeSetCreateOut } from '../models/TimeSetCreateOut.ts';
|
import type { SettingUpdateIn } from '../models/SettingUpdateIn';
|
||||||
import type { TimeSetDeleteIn } from '../models/TimeSetDeleteIn.ts';
|
import type { TaskCreateIn } from '../models/TaskCreateIn';
|
||||||
import type { TimeSetReorderIn } from '../models/TimeSetReorderIn.ts';
|
import type { TaskCreateOut } from '../models/TaskCreateOut';
|
||||||
import type { TimeSetUpdateIn } from '../models/TimeSetUpdateIn.ts';
|
import type { TimeSetCreateOut } from '../models/TimeSetCreateOut';
|
||||||
import type { UserCreateOut } from '../models/UserCreateOut.ts';
|
import type { TimeSetDeleteIn } from '../models/TimeSetDeleteIn';
|
||||||
import type { UserDeleteIn } from '../models/UserDeleteIn.ts';
|
import type { TimeSetReorderIn } from '../models/TimeSetReorderIn';
|
||||||
import type { UserInBase } from '../models/UserInBase.ts';
|
import type { TimeSetUpdateIn } from '../models/TimeSetUpdateIn';
|
||||||
import type { UserReorderIn } from '../models/UserReorderIn.ts';
|
import type { UserCreateOut } from '../models/UserCreateOut';
|
||||||
import type { UserUpdateIn } from '../models/UserUpdateIn.ts';
|
import type { UserDeleteIn } from '../models/UserDeleteIn';
|
||||||
import type { CancelablePromise } from '../core/CancelablePromise.ts';
|
import type { UserInBase } from '../models/UserInBase';
|
||||||
import { OpenAPI } from '../core/OpenAPI.ts';
|
import type { UserReorderIn } from '../models/UserReorderIn';
|
||||||
import { request as __request } from '../core/request.ts';
|
import type { UserUpdateIn } from '../models/UserUpdateIn';
|
||||||
|
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||||
|
import { OpenAPI } from '../core/OpenAPI';
|
||||||
|
import { request as __request } from '../core/request';
|
||||||
export class Service {
|
export class Service {
|
||||||
/**
|
/**
|
||||||
* 获取关卡号信息
|
* 获取关卡号信息
|
||||||
@@ -77,6 +80,17 @@ export class Service {
|
|||||||
url: '/api/info/apps_info',
|
url: '/api/info/apps_info',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 信息总览
|
||||||
|
* @returns InfoOut Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static addOverviewApiInfoGetOverviewPost(): CancelablePromise<InfoOut> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'POST',
|
||||||
|
url: '/api/info/get/overview',
|
||||||
|
});
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 添加脚本
|
* 添加脚本
|
||||||
* @param requestBody
|
* @param requestBody
|
||||||
@@ -582,6 +596,44 @@ export class Service {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 添加任务
|
||||||
|
* @param requestBody
|
||||||
|
* @returns TaskCreateOut Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static addTaskApiDispatchStartPost(
|
||||||
|
requestBody: TaskCreateIn,
|
||||||
|
): CancelablePromise<TaskCreateOut> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'POST',
|
||||||
|
url: '/api/dispatch/start',
|
||||||
|
body: requestBody,
|
||||||
|
mediaType: 'application/json',
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 中止任务
|
||||||
|
* @param requestBody
|
||||||
|
* @returns OutBase Successful Response
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static stopTaskApiDispatchStopPost(
|
||||||
|
requestBody: DispatchIn,
|
||||||
|
): CancelablePromise<OutBase> {
|
||||||
|
return __request(OpenAPI, {
|
||||||
|
method: 'POST',
|
||||||
|
url: '/api/dispatch/stop',
|
||||||
|
body: requestBody,
|
||||||
|
mediaType: 'application/json',
|
||||||
|
errors: {
|
||||||
|
422: `Validation Error`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 查询配置
|
* 查询配置
|
||||||
* 查询配置
|
* 查询配置
|
||||||
|
|||||||
Reference in New Issue
Block a user