refactor:基于 lint 处理排版
This commit is contained in:
@@ -4,7 +4,7 @@ import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace InfraApiAccessLogApi {
|
||||
/** API 访问日志信息 */
|
||||
export interface SystemApiAccessLog {
|
||||
export interface ApiAccessLog {
|
||||
id: number;
|
||||
traceId: string;
|
||||
userId: number;
|
||||
@@ -30,13 +30,15 @@ export namespace InfraApiAccessLogApi {
|
||||
|
||||
/** 查询 API 访问日志列表 */
|
||||
export function getApiAccessLogPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<InfraApiAccessLogApi.SystemApiAccessLog>>(
|
||||
return requestClient.get<PageResult<InfraApiAccessLogApi.ApiAccessLog>>(
|
||||
'/infra/api-access-log/page',
|
||||
{ params }
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出 API 访问日志 */
|
||||
export function exportApiAccessLog(params: any) {
|
||||
return requestClient.download('/infra/api-access-log/export-excel', { params });
|
||||
return requestClient.download('/infra/api-access-log/export-excel', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace InfraApiErrorLogApi {
|
||||
/** API 错误日志信息 */
|
||||
export interface SystemApiErrorLog {
|
||||
export interface ApiErrorLog {
|
||||
id: number;
|
||||
traceId: string;
|
||||
userId: number;
|
||||
@@ -34,18 +34,22 @@ export namespace InfraApiErrorLogApi {
|
||||
|
||||
/** 查询 API 错误日志列表 */
|
||||
export function getApiErrorLogPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<InfraApiErrorLogApi.SystemApiErrorLog>>(
|
||||
return requestClient.get<PageResult<InfraApiErrorLogApi.ApiErrorLog>>(
|
||||
'/infra/api-error-log/page',
|
||||
{ params }
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 更新 API 错误日志的处理状态 */
|
||||
export function updateApiErrorLogStatus(id: number, processStatus: number) {
|
||||
return requestClient.put(`/infra/api-error-log/update-status?id=${id}&processStatus=${processStatus}`);
|
||||
return requestClient.put(
|
||||
`/infra/api-error-log/update-status?id=${id}&processStatus=${processStatus}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出 API 错误日志 */
|
||||
export function exportApiErrorLog(params: any) {
|
||||
return requestClient.download('/infra/api-error-log/export-excel', { params });
|
||||
return requestClient.download('/infra/api-error-log/export-excel', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -79,21 +79,30 @@ export namespace InfraCodegenApi {
|
||||
|
||||
/** 查询列表代码生成表定义 */
|
||||
export function getCodegenTableList(dataSourceConfigId: number) {
|
||||
return requestClient.get<InfraCodegenApi.CodegenTable[]>('/infra/codegen/table/list?', {
|
||||
params: { dataSourceConfigId },
|
||||
});
|
||||
return requestClient.get<InfraCodegenApi.CodegenTable[]>(
|
||||
'/infra/codegen/table/list?',
|
||||
{
|
||||
params: { dataSourceConfigId },
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询列表代码生成表定义 */
|
||||
export function getCodegenTablePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<InfraCodegenApi.CodegenTable>>('/infra/codegen/table/page', { params });
|
||||
return requestClient.get<PageResult<InfraCodegenApi.CodegenTable>>(
|
||||
'/infra/codegen/table/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询详情代码生成表定义 */
|
||||
export function getCodegenTable(tableId: number) {
|
||||
return requestClient.get<InfraCodegenApi.CodegenDetail>('/infra/codegen/detail', {
|
||||
params: { tableId },
|
||||
});
|
||||
return requestClient.get<InfraCodegenApi.CodegenDetail>(
|
||||
'/infra/codegen/detail',
|
||||
{
|
||||
params: { tableId },
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 修改代码生成表定义 */
|
||||
@@ -110,9 +119,12 @@ export function syncCodegenFromDB(tableId: number) {
|
||||
|
||||
/** 预览生成代码 */
|
||||
export function previewCodegen(tableId: number) {
|
||||
return requestClient.get<InfraCodegenApi.CodegenPreview[]>('/infra/codegen/preview', {
|
||||
params: { tableId },
|
||||
});
|
||||
return requestClient.get<InfraCodegenApi.CodegenPreview[]>(
|
||||
'/infra/codegen/preview',
|
||||
{
|
||||
params: { tableId },
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 下载生成代码 */
|
||||
@@ -124,11 +136,16 @@ export function downloadCodegen(tableId: number) {
|
||||
|
||||
/** 获得表定义 */
|
||||
export function getSchemaTableList(params: any) {
|
||||
return requestClient.get<InfraCodegenApi.DatabaseTable[]>('/infra/codegen/db/table/list', { params });
|
||||
return requestClient.get<InfraCodegenApi.DatabaseTable[]>(
|
||||
'/infra/codegen/db/table/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 基于数据库的表结构,创建代码生成器的表定义 */
|
||||
export function createCodegenList(data: InfraCodegenApi.CodegenCreateListReqVO) {
|
||||
export function createCodegenList(
|
||||
data: InfraCodegenApi.CodegenCreateListReqVO,
|
||||
) {
|
||||
return requestClient.post('/infra/codegen/create-list', data);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace InfraConfigApi {
|
||||
/** 参数配置信息 */
|
||||
export interface InfraConfig {
|
||||
export interface Config {
|
||||
id?: number;
|
||||
category: string;
|
||||
name: string;
|
||||
@@ -18,28 +19,33 @@ export namespace InfraConfigApi {
|
||||
|
||||
/** 查询参数列表 */
|
||||
export function getConfigPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<InfraConfigApi.InfraConfig>>('/infra/config/page', {
|
||||
params
|
||||
});
|
||||
return requestClient.get<PageResult<InfraConfigApi.Config>>(
|
||||
'/infra/config/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询参数详情 */
|
||||
export function getConfig(id: number) {
|
||||
return requestClient.get<InfraConfigApi.InfraConfig>(`/infra/config/get?id=${id}`);
|
||||
return requestClient.get<InfraConfigApi.Config>(`/infra/config/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 根据参数键名查询参数值 */
|
||||
export function getConfigKey(configKey: string) {
|
||||
return requestClient.get<string>(`/infra/config/get-value-by-key?key=${configKey}`);
|
||||
return requestClient.get<string>(
|
||||
`/infra/config/get-value-by-key?key=${configKey}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增参数 */
|
||||
export function createConfig(data: InfraConfigApi.InfraConfig) {
|
||||
export function createConfig(data: InfraConfigApi.Config) {
|
||||
return requestClient.post('/infra/config/create', data);
|
||||
}
|
||||
|
||||
/** 修改参数 */
|
||||
export function updateConfig(data: InfraConfigApi.InfraConfig) {
|
||||
export function updateConfig(data: InfraConfigApi.Config) {
|
||||
return requestClient.put('/infra/config/update', data);
|
||||
}
|
||||
|
||||
@@ -51,6 +57,6 @@ export function deleteConfig(id: number) {
|
||||
/** 导出参数 */
|
||||
export function exportConfig(params: any) {
|
||||
return requestClient.download('/infra/config/export', {
|
||||
params
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace InfraDataSourceConfigApi {
|
||||
/** 数据源配置信息 */
|
||||
export interface InfraDataSourceConfig {
|
||||
export interface DataSourceConfig {
|
||||
id?: number;
|
||||
name: string;
|
||||
url: string;
|
||||
@@ -14,25 +14,33 @@ export namespace InfraDataSourceConfigApi {
|
||||
|
||||
/** 查询数据源配置列表 */
|
||||
export function getDataSourceConfigList() {
|
||||
return requestClient.get<InfraDataSourceConfigApi.InfraDataSourceConfig[]>('/infra/data-source-config/list');
|
||||
return requestClient.get<InfraDataSourceConfigApi.DataSourceConfig[]>(
|
||||
'/infra/data-source-config/list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询数据源配置详情 */
|
||||
export function getDataSourceConfig(id: number) {
|
||||
return requestClient.get<InfraDataSourceConfigApi.InfraDataSourceConfig>(`/infra/data-source-config/get?id=${id}`);
|
||||
return requestClient.get<InfraDataSourceConfigApi.DataSourceConfig>(
|
||||
`/infra/data-source-config/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增数据源配置 */
|
||||
export function createDataSourceConfig(data: InfraDataSourceConfigApi.InfraDataSourceConfig) {
|
||||
export function createDataSourceConfig(
|
||||
data: InfraDataSourceConfigApi.DataSourceConfig,
|
||||
) {
|
||||
return requestClient.post('/infra/data-source-config/create', data);
|
||||
}
|
||||
|
||||
/** 修改数据源配置 */
|
||||
export function updateDataSourceConfig(data: InfraDataSourceConfigApi.InfraDataSourceConfig) {
|
||||
export function updateDataSourceConfig(
|
||||
data: InfraDataSourceConfigApi.DataSourceConfig,
|
||||
) {
|
||||
return requestClient.put('/infra/data-source-config/update', data);
|
||||
}
|
||||
|
||||
/** 删除数据源配置 */
|
||||
export function deleteDataSourceConfig(id: number) {
|
||||
return requestClient.delete(`/infra/data-source-config/delete?id=${id}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,12 +16,17 @@ export namespace Demo01ContactApi {
|
||||
|
||||
/** 查询示例联系人分页 */
|
||||
export function getDemo01ContactPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<Demo01ContactApi.Demo01Contact>>('/infra/demo01-contact/page', { params });
|
||||
return requestClient.get<PageResult<Demo01ContactApi.Demo01Contact>>(
|
||||
'/infra/demo01-contact/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询示例联系人详情 */
|
||||
export function getDemo01Contact(id: number) {
|
||||
return requestClient.get<Demo01ContactApi.Demo01Contact>(`/infra/demo01-contact/get?id=${id}`);
|
||||
return requestClient.get<Demo01ContactApi.Demo01Contact>(
|
||||
`/infra/demo01-contact/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增示例联系人 */
|
||||
|
||||
@@ -12,12 +12,17 @@ export namespace Demo02CategoryApi {
|
||||
|
||||
/** 查询示例分类列表 */
|
||||
export function getDemo02CategoryList(params: any) {
|
||||
return requestClient.get<Demo02CategoryApi.Demo02Category[]>('/infra/demo02-category/list', { params });
|
||||
return requestClient.get<Demo02CategoryApi.Demo02Category[]>(
|
||||
'/infra/demo02-category/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询示例分类详情 */
|
||||
export function getDemo02Category(id: number) {
|
||||
return requestClient.get<Demo02CategoryApi.Demo02Category>(`/infra/demo02-category/get?id=${id}`);
|
||||
return requestClient.get<Demo02CategoryApi.Demo02Category>(
|
||||
`/infra/demo02-category/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增示例分类 */
|
||||
|
||||
@@ -31,12 +31,17 @@ export namespace Demo03StudentApi {
|
||||
|
||||
/** 查询学生分页 */
|
||||
export function getDemo03StudentPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<Demo03StudentApi.Demo03Student>>('/infra/demo03-student/page', { params });
|
||||
return requestClient.get<PageResult<Demo03StudentApi.Demo03Student>>(
|
||||
'/infra/demo03-student/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询学生详情 */
|
||||
export function getDemo03Student(id: number) {
|
||||
return requestClient.get<Demo03StudentApi.Demo03Student>(`/infra/demo03-student/get?id=${id}`);
|
||||
return requestClient.get<Demo03StudentApi.Demo03Student>(
|
||||
`/infra/demo03-student/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增学生 */
|
||||
@@ -63,9 +68,12 @@ export function exportDemo03Student(params: any) {
|
||||
|
||||
/** 获得学生课程分页 */
|
||||
export function getDemo03CoursePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<Demo03StudentApi.Demo03Course>>(`/infra/demo03-student/demo03-course/page`, {
|
||||
params,
|
||||
});
|
||||
return requestClient.get<PageResult<Demo03StudentApi.Demo03Course>>(
|
||||
`/infra/demo03-student/demo03-course/page`,
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
/** 新增学生课程 */
|
||||
export function createDemo03Course(data: Demo03StudentApi.Demo03Course) {
|
||||
@@ -79,21 +87,28 @@ export function updateDemo03Course(data: Demo03StudentApi.Demo03Course) {
|
||||
|
||||
/** 删除学生课程 */
|
||||
export function deleteDemo03Course(id: number) {
|
||||
return requestClient.delete(`/infra/demo03-student/demo03-course/delete?id=${id}`);
|
||||
return requestClient.delete(
|
||||
`/infra/demo03-student/demo03-course/delete?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得学生课程 */
|
||||
export function getDemo03Course(id: number) {
|
||||
return requestClient.get<Demo03StudentApi.Demo03Course>(`/infra/demo03-student/demo03-course/get?id=${id}`);
|
||||
return requestClient.get<Demo03StudentApi.Demo03Course>(
|
||||
`/infra/demo03-student/demo03-course/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
// ==================== 子表(学生班级) ====================
|
||||
|
||||
/** 获得学生班级分页 */
|
||||
export function getDemo03GradePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<Demo03StudentApi.Demo03Grade>>(`/infra/demo03-student/demo03-grade/page`, {
|
||||
params,
|
||||
});
|
||||
return requestClient.get<PageResult<Demo03StudentApi.Demo03Grade>>(
|
||||
`/infra/demo03-student/demo03-grade/page`,
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
/** 新增学生班级 */
|
||||
export function createDemo03Grade(data: Demo03StudentApi.Demo03Grade) {
|
||||
@@ -107,10 +122,14 @@ export function updateDemo03Grade(data: Demo03StudentApi.Demo03Grade) {
|
||||
|
||||
/** 删除学生班级 */
|
||||
export function deleteDemo03Grade(id: number) {
|
||||
return requestClient.delete(`/infra/demo03-student/demo03-grade/delete?id=${id}`);
|
||||
return requestClient.delete(
|
||||
`/infra/demo03-student/demo03-grade/delete?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得学生班级 */
|
||||
export function getDemo03Grade(id: number) {
|
||||
return requestClient.get<Demo03StudentApi.Demo03Grade>(`/infra/demo03-student/demo03-grade/get?id=${id}`);
|
||||
return requestClient.get<Demo03StudentApi.Demo03Grade>(
|
||||
`/infra/demo03-student/demo03-grade/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -33,12 +33,17 @@ export namespace Demo03StudentApi {
|
||||
|
||||
/** 查询学生分页 */
|
||||
export function getDemo03StudentPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<Demo03StudentApi.Demo03Student>>('/infra/demo03-student/page', { params });
|
||||
return requestClient.get<PageResult<Demo03StudentApi.Demo03Student>>(
|
||||
'/infra/demo03-student/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询学生详情 */
|
||||
export function getDemo03Student(id: number) {
|
||||
return requestClient.get<Demo03StudentApi.Demo03Student>(`/infra/demo03-student/get?id=${id}`);
|
||||
return requestClient.get<Demo03StudentApi.Demo03Student>(
|
||||
`/infra/demo03-student/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增学生 */
|
||||
|
||||
@@ -33,12 +33,17 @@ export namespace Demo03StudentApi {
|
||||
|
||||
/** 查询学生分页 */
|
||||
export function getDemo03StudentPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<Demo03StudentApi.Demo03Student>>('/infra/demo03-student/page', { params });
|
||||
return requestClient.get<PageResult<Demo03StudentApi.Demo03Student>>(
|
||||
'/infra/demo03-student/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询学生详情 */
|
||||
export function getDemo03Student(id: number) {
|
||||
return requestClient.get<Demo03StudentApi.Demo03Student>(`/infra/demo03-student/get?id=${id}`);
|
||||
return requestClient.get<Demo03StudentApi.Demo03Student>(
|
||||
`/infra/demo03-student/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增学生 */
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace InfraFileConfigApi {
|
||||
/** 文件客户端配置 */
|
||||
export interface FileClientConfig {
|
||||
@@ -18,7 +19,7 @@ export namespace InfraFileConfigApi {
|
||||
}
|
||||
|
||||
/** 文件配置信息 */
|
||||
export interface InfraFileConfig {
|
||||
export interface FileConfig {
|
||||
id?: number;
|
||||
name: string;
|
||||
storage?: number;
|
||||
@@ -32,14 +33,19 @@ export namespace InfraFileConfigApi {
|
||||
|
||||
/** 查询文件配置列表 */
|
||||
export function getFileConfigPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<InfraFileConfigApi.InfraFileConfig>>('/infra/file-config/page', {
|
||||
params
|
||||
});
|
||||
return requestClient.get<PageResult<InfraFileConfigApi.FileConfig>>(
|
||||
'/infra/file-config/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询文件配置详情 */
|
||||
export function getFileConfig(id: number) {
|
||||
return requestClient.get<InfraFileConfigApi.InfraFileConfig>(`/infra/file-config/get?id=${id}`);
|
||||
return requestClient.get<InfraFileConfigApi.FileConfig>(
|
||||
`/infra/file-config/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 更新文件配置为主配置 */
|
||||
@@ -48,12 +54,12 @@ export function updateFileConfigMaster(id: number) {
|
||||
}
|
||||
|
||||
/** 新增文件配置 */
|
||||
export function createFileConfig(data: InfraFileConfigApi.InfraFileConfig) {
|
||||
export function createFileConfig(data: InfraFileConfigApi.FileConfig) {
|
||||
return requestClient.post('/infra/file-config/create', data);
|
||||
}
|
||||
|
||||
/** 修改文件配置 */
|
||||
export function updateFileConfig(data: InfraFileConfigApi.InfraFileConfig) {
|
||||
export function updateFileConfig(data: InfraFileConfigApi.FileConfig) {
|
||||
return requestClient.put('/infra/file-config/update', data);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import type { AxiosRequestConfig, PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
import type { AxiosRequestConfig } from '@vben/request';
|
||||
|
||||
/** Axios 上传进度事件 */
|
||||
export type AxiosProgressEvent = AxiosRequestConfig['onUploadProgress'];
|
||||
|
||||
export namespace InfraFileApi {
|
||||
/** 文件信息 */
|
||||
export interface InfraFile {
|
||||
export interface File {
|
||||
id?: number;
|
||||
configId?: number;
|
||||
path: string;
|
||||
@@ -34,8 +34,8 @@ export namespace InfraFileApi {
|
||||
|
||||
/** 查询文件列表 */
|
||||
export function getFilePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<InfraFileApi.InfraFile>>('/infra/file/page', {
|
||||
params
|
||||
return requestClient.get<PageResult<InfraFileApi.File>>('/infra/file/page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -46,17 +46,24 @@ export function deleteFile(id: number) {
|
||||
|
||||
/** 获取文件预签名地址 */
|
||||
export function getFilePresignedUrl(path: string) {
|
||||
return requestClient.get<InfraFileApi.FilePresignedUrlRespVO>('/infra/file/presigned-url', {
|
||||
params: { path }
|
||||
});
|
||||
return requestClient.get<InfraFileApi.FilePresignedUrlRespVO>(
|
||||
'/infra/file/presigned-url',
|
||||
{
|
||||
params: { path },
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 创建文件 */
|
||||
export function createFile(data: InfraFileApi.InfraFile) {
|
||||
export function createFile(data: InfraFileApi.File) {
|
||||
return requestClient.post('/infra/file/create', data);
|
||||
}
|
||||
|
||||
/** 上传文件 */
|
||||
export function uploadFile(data: InfraFileApi.FileUploadReqVO, onUploadProgress?: AxiosProgressEvent) {
|
||||
// TODO @芋艿:这里有爆红
|
||||
export function uploadFile(
|
||||
data: InfraFileApi.FileUploadReqVO,
|
||||
onUploadProgress?: AxiosProgressEvent,
|
||||
) {
|
||||
return requestClient.upload('/infra/file/upload', data, { onUploadProgress });
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace InfraJobLogApi {
|
||||
/** 任务日志信息 */
|
||||
export interface InfraJobLog {
|
||||
export interface JobLog {
|
||||
id?: number;
|
||||
jobId: number;
|
||||
handlerName: string;
|
||||
@@ -22,12 +22,17 @@ export namespace InfraJobLogApi {
|
||||
|
||||
/** 查询任务日志列表 */
|
||||
export function getJobLogPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<InfraJobLogApi.InfraJobLog>>('/infra/job-log/page', { params });
|
||||
return requestClient.get<PageResult<InfraJobLogApi.JobLog>>(
|
||||
'/infra/job-log/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询任务日志详情 */
|
||||
export function getJobLog(id: number) {
|
||||
return requestClient.get<InfraJobLogApi.InfraJobLog>(`/infra/job-log/get?id=${id}`);
|
||||
return requestClient.get<InfraJobLogApi.JobLog>(
|
||||
`/infra/job-log/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出定时任务日志 */
|
||||
|
||||
@@ -4,7 +4,7 @@ import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace InfraJobApi {
|
||||
/** 任务信息 */
|
||||
export interface InfraJob {
|
||||
export interface Job {
|
||||
id?: number;
|
||||
name: string;
|
||||
status: number;
|
||||
@@ -20,21 +20,23 @@ export namespace InfraJobApi {
|
||||
|
||||
/** 查询任务列表 */
|
||||
export function getJobPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<InfraJobApi.InfraJob>>('/infra/job/page', { params });
|
||||
return requestClient.get<PageResult<InfraJobApi.Job>>('/infra/job/page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询任务详情 */
|
||||
export function getJob(id: number) {
|
||||
return requestClient.get<InfraJobApi.InfraJob>(`/infra/job/get?id=${id}`);
|
||||
return requestClient.get<InfraJobApi.Job>(`/infra/job/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 新增任务 */
|
||||
export function createJob(data: InfraJobApi.InfraJob) {
|
||||
export function createJob(data: InfraJobApi.Job) {
|
||||
return requestClient.post('/infra/job/create', data);
|
||||
}
|
||||
|
||||
/** 修改定时任务调度 */
|
||||
export function updateJob(data: InfraJobApi.InfraJob) {
|
||||
export function updateJob(data: InfraJobApi.Job) {
|
||||
return requestClient.put('/infra/job/update', data);
|
||||
}
|
||||
|
||||
@@ -52,7 +54,7 @@ export function exportJob(params: any) {
|
||||
export function updateJobStatus(id: number, status: number) {
|
||||
const params = {
|
||||
id,
|
||||
status
|
||||
status,
|
||||
};
|
||||
return requestClient.put('/infra/job/update-status', { params });
|
||||
}
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace InfraRedisApi {
|
||||
/** Redis 监控信息 */
|
||||
export interface InfraRedisMonitorInfo {
|
||||
info: InfraRedisInfo;
|
||||
dbSize: number;
|
||||
commandStats: InfraRedisCommandStats[];
|
||||
}
|
||||
|
||||
/** Redis 信息 */
|
||||
export interface InfraRedisInfo {
|
||||
export interface RedisInfo {
|
||||
io_threaded_reads_processed: string;
|
||||
tracking_clients: string;
|
||||
uptime_in_seconds: string;
|
||||
@@ -175,14 +168,23 @@ export namespace InfraRedisApi {
|
||||
}
|
||||
|
||||
/** Redis 命令统计 */
|
||||
export interface InfraRedisCommandStats {
|
||||
export interface RedisCommandStats {
|
||||
command: string;
|
||||
calls: number;
|
||||
usec: number;
|
||||
}
|
||||
|
||||
/** Redis 监控信息 */
|
||||
export interface RedisMonitorInfo {
|
||||
info: RedisInfo;
|
||||
dbSize: number;
|
||||
commandStats: RedisCommandStats[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 获取 Redis 监控信息 */
|
||||
export function getRedisMonitorInfo() {
|
||||
return requestClient.get<InfraRedisApi.InfraRedisMonitorInfo>('/infra/redis/get-monitor-info');
|
||||
return requestClient.get<InfraRedisApi.RedisMonitorInfo>(
|
||||
'/infra/redis/get-monitor-info',
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user