feat: infra api
This commit is contained in:
44
apps/web-tdesign/src/api/infra/api-access-log/index.ts
Normal file
44
apps/web-tdesign/src/api/infra/api-access-log/index.ts
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace InfraApiAccessLogApi {
|
||||||
|
/** API 访问日志信息 */
|
||||||
|
export interface ApiAccessLog {
|
||||||
|
id: number;
|
||||||
|
traceId: string;
|
||||||
|
userId: number;
|
||||||
|
userType: number;
|
||||||
|
applicationName: string;
|
||||||
|
requestMethod: string;
|
||||||
|
requestParams: string;
|
||||||
|
responseBody: string;
|
||||||
|
requestUrl: string;
|
||||||
|
userIp: string;
|
||||||
|
userAgent: string;
|
||||||
|
operateModule: string;
|
||||||
|
operateName: string;
|
||||||
|
operateType: number;
|
||||||
|
beginTime: string;
|
||||||
|
endTime: string;
|
||||||
|
duration: number;
|
||||||
|
resultCode: number;
|
||||||
|
resultMsg: string;
|
||||||
|
createTime: string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询 API 访问日志列表 */
|
||||||
|
export function getApiAccessLogPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<InfraApiAccessLogApi.ApiAccessLog>>(
|
||||||
|
'/infra/api-access-log/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出 API 访问日志 */
|
||||||
|
export function exportApiAccessLog(params: any) {
|
||||||
|
return requestClient.download('/infra/api-access-log/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
55
apps/web-tdesign/src/api/infra/api-error-log/index.ts
Normal file
55
apps/web-tdesign/src/api/infra/api-error-log/index.ts
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace InfraApiErrorLogApi {
|
||||||
|
/** API 错误日志信息 */
|
||||||
|
export interface ApiErrorLog {
|
||||||
|
id: number;
|
||||||
|
traceId: string;
|
||||||
|
userId: number;
|
||||||
|
userType: number;
|
||||||
|
applicationName: string;
|
||||||
|
requestMethod: string;
|
||||||
|
requestParams: string;
|
||||||
|
requestUrl: string;
|
||||||
|
userIp: string;
|
||||||
|
userAgent: string;
|
||||||
|
exceptionTime: string;
|
||||||
|
exceptionName: string;
|
||||||
|
exceptionMessage: string;
|
||||||
|
exceptionRootCauseMessage: string;
|
||||||
|
exceptionStackTrace: string;
|
||||||
|
exceptionClassName: string;
|
||||||
|
exceptionFileName: string;
|
||||||
|
exceptionMethodName: string;
|
||||||
|
exceptionLineNumber: number;
|
||||||
|
processUserId: number;
|
||||||
|
processStatus: number;
|
||||||
|
processTime: string;
|
||||||
|
resultCode: number;
|
||||||
|
createTime: string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询 API 错误日志列表 */
|
||||||
|
export function getApiErrorLogPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<InfraApiErrorLogApi.ApiErrorLog>>(
|
||||||
|
'/infra/api-error-log/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新 API 错误日志的处理状态 */
|
||||||
|
export function updateApiErrorLogStatus(id: number, processStatus: number) {
|
||||||
|
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,
|
||||||
|
});
|
||||||
|
}
|
||||||
168
apps/web-tdesign/src/api/infra/codegen/index.ts
Normal file
168
apps/web-tdesign/src/api/infra/codegen/index.ts
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace InfraCodegenApi {
|
||||||
|
/** 代码生成表定义 */
|
||||||
|
export interface CodegenTable {
|
||||||
|
id: number;
|
||||||
|
tableId: number;
|
||||||
|
isParentMenuIdValid: boolean;
|
||||||
|
dataSourceConfigId: number;
|
||||||
|
scene: number;
|
||||||
|
tableName: string;
|
||||||
|
tableComment: string;
|
||||||
|
remark: string;
|
||||||
|
moduleName: string;
|
||||||
|
businessName: string;
|
||||||
|
className: string;
|
||||||
|
classComment: string;
|
||||||
|
author: string;
|
||||||
|
createTime: Date;
|
||||||
|
updateTime: Date;
|
||||||
|
templateType: number;
|
||||||
|
parentMenuId: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 代码生成字段定义 */
|
||||||
|
export interface CodegenColumn {
|
||||||
|
id: number;
|
||||||
|
tableId: number;
|
||||||
|
columnName: string;
|
||||||
|
dataType: string;
|
||||||
|
columnComment: string;
|
||||||
|
nullable: number;
|
||||||
|
primaryKey: number;
|
||||||
|
ordinalPosition: number;
|
||||||
|
javaType: string;
|
||||||
|
javaField: string;
|
||||||
|
dictType: string;
|
||||||
|
example: string;
|
||||||
|
createOperation: number;
|
||||||
|
updateOperation: number;
|
||||||
|
listOperation: number;
|
||||||
|
listOperationCondition: string;
|
||||||
|
listOperationResult: number;
|
||||||
|
htmlType: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 数据库表定义 */
|
||||||
|
export interface DatabaseTable {
|
||||||
|
name: string;
|
||||||
|
comment: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 代码生成详情 */
|
||||||
|
export interface CodegenDetail {
|
||||||
|
table: CodegenTable;
|
||||||
|
columns: CodegenColumn[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 代码预览 */
|
||||||
|
export interface CodegenPreview {
|
||||||
|
filePath: string;
|
||||||
|
code: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新代码生成请求 */
|
||||||
|
export interface CodegenUpdateReqVO {
|
||||||
|
table: any | CodegenTable;
|
||||||
|
columns: CodegenColumn[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 创建代码生成请求 */
|
||||||
|
export interface CodegenCreateListReqVO {
|
||||||
|
dataSourceConfigId?: number;
|
||||||
|
tableNames: string[];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询列表代码生成表定义 */
|
||||||
|
export function getCodegenTableList(dataSourceConfigId: number) {
|
||||||
|
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 },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询详情代码生成表定义 */
|
||||||
|
export function getCodegenTable(tableId: number) {
|
||||||
|
return requestClient.get<InfraCodegenApi.CodegenDetail>(
|
||||||
|
'/infra/codegen/detail',
|
||||||
|
{
|
||||||
|
params: { tableId },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改代码生成表定义 */
|
||||||
|
export function updateCodegenTable(data: InfraCodegenApi.CodegenUpdateReqVO) {
|
||||||
|
return requestClient.put('/infra/codegen/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 基于数据库的表结构,同步数据库的表和字段定义 */
|
||||||
|
export function syncCodegenFromDB(tableId: number) {
|
||||||
|
return requestClient.put(
|
||||||
|
'/infra/codegen/sync-from-db',
|
||||||
|
{},
|
||||||
|
{
|
||||||
|
params: { tableId },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 预览生成代码 */
|
||||||
|
export function previewCodegen(tableId: number) {
|
||||||
|
return requestClient.get<InfraCodegenApi.CodegenPreview[]>(
|
||||||
|
'/infra/codegen/preview',
|
||||||
|
{
|
||||||
|
params: { tableId },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 下载生成代码 */
|
||||||
|
export function downloadCodegen(tableId: number) {
|
||||||
|
return requestClient.download('/infra/codegen/download', {
|
||||||
|
params: { tableId },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得表定义 */
|
||||||
|
export function getSchemaTableList(params: any) {
|
||||||
|
return requestClient.get<InfraCodegenApi.DatabaseTable[]>(
|
||||||
|
'/infra/codegen/db/table/list',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 基于数据库的表结构,创建代码生成器的表定义 */
|
||||||
|
export function createCodegenList(
|
||||||
|
data: InfraCodegenApi.CodegenCreateListReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.post('/infra/codegen/create-list', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除代码生成表定义 */
|
||||||
|
export function deleteCodegenTable(tableId: number) {
|
||||||
|
return requestClient.delete('/infra/codegen/delete', {
|
||||||
|
params: { tableId },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除代码生成表定义 */
|
||||||
|
export function deleteCodegenTableList(tableIds: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/codegen/delete-list?tableIds=${tableIds.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
67
apps/web-tdesign/src/api/infra/config/index.ts
Normal file
67
apps/web-tdesign/src/api/infra/config/index.ts
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace InfraConfigApi {
|
||||||
|
/** 参数配置信息 */
|
||||||
|
export interface Config {
|
||||||
|
id?: number;
|
||||||
|
category: string;
|
||||||
|
name: string;
|
||||||
|
key: string;
|
||||||
|
value: string;
|
||||||
|
type: number;
|
||||||
|
visible: boolean;
|
||||||
|
remark: string;
|
||||||
|
createTime?: Date;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询参数列表 */
|
||||||
|
export function getConfigPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<InfraConfigApi.Config>>(
|
||||||
|
'/infra/config/page',
|
||||||
|
{
|
||||||
|
params,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询参数详情 */
|
||||||
|
export function getConfig(id: number) {
|
||||||
|
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}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增参数 */
|
||||||
|
export function createConfig(data: InfraConfigApi.Config) {
|
||||||
|
return requestClient.post('/infra/config/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改参数 */
|
||||||
|
export function updateConfig(data: InfraConfigApi.Config) {
|
||||||
|
return requestClient.put('/infra/config/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除参数 */
|
||||||
|
export function deleteConfig(id: number) {
|
||||||
|
return requestClient.delete(`/infra/config/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除参数 */
|
||||||
|
export function deleteConfigList(ids: number[]) {
|
||||||
|
return requestClient.delete(`/infra/config/delete-list?ids=${ids.join(',')}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出参数 */
|
||||||
|
export function exportConfig(params: any) {
|
||||||
|
return requestClient.download('/infra/config/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
53
apps/web-tdesign/src/api/infra/data-source-config/index.ts
Normal file
53
apps/web-tdesign/src/api/infra/data-source-config/index.ts
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace InfraDataSourceConfigApi {
|
||||||
|
/** 数据源配置信息 */
|
||||||
|
export interface DataSourceConfig {
|
||||||
|
id?: number;
|
||||||
|
name: string;
|
||||||
|
url: string;
|
||||||
|
username: string;
|
||||||
|
password: string;
|
||||||
|
createTime?: Date;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询数据源配置列表 */
|
||||||
|
export function getDataSourceConfigList() {
|
||||||
|
return requestClient.get<InfraDataSourceConfigApi.DataSourceConfig[]>(
|
||||||
|
'/infra/data-source-config/list',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询数据源配置详情 */
|
||||||
|
export function getDataSourceConfig(id: number) {
|
||||||
|
return requestClient.get<InfraDataSourceConfigApi.DataSourceConfig>(
|
||||||
|
`/infra/data-source-config/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增数据源配置 */
|
||||||
|
export function createDataSourceConfig(
|
||||||
|
data: InfraDataSourceConfigApi.DataSourceConfig,
|
||||||
|
) {
|
||||||
|
return requestClient.post('/infra/data-source-config/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改数据源配置 */
|
||||||
|
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}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除数据源配置 */
|
||||||
|
export function deleteDataSourceConfigList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/data-source-config/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
61
apps/web-tdesign/src/api/infra/demo/demo01/index.ts
Normal file
61
apps/web-tdesign/src/api/infra/demo/demo01/index.ts
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
import type { Dayjs } from 'dayjs';
|
||||||
|
|
||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace Demo01ContactApi {
|
||||||
|
/** 示例联系人信息 */
|
||||||
|
export interface Demo01Contact {
|
||||||
|
id: number; // 编号
|
||||||
|
name?: string; // 名字
|
||||||
|
sex?: number; // 性别
|
||||||
|
birthday?: Dayjs | string; // 出生年
|
||||||
|
description?: string; // 简介
|
||||||
|
avatar: string; // 头像
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询示例联系人分页 */
|
||||||
|
export function getDemo01ContactPage(params: PageParam) {
|
||||||
|
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}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增示例联系人 */
|
||||||
|
export function createDemo01Contact(data: Demo01ContactApi.Demo01Contact) {
|
||||||
|
return requestClient.post('/infra/demo01-contact/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改示例联系人 */
|
||||||
|
export function updateDemo01Contact(data: Demo01ContactApi.Demo01Contact) {
|
||||||
|
return requestClient.put('/infra/demo01-contact/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除示例联系人 */
|
||||||
|
export function deleteDemo01Contact(id: number) {
|
||||||
|
return requestClient.delete(`/infra/demo01-contact/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除示例联系人 */
|
||||||
|
export function deleteDemo01ContactList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/demo01-contact/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出示例联系人 */
|
||||||
|
export function exportDemo01Contact(params: any) {
|
||||||
|
return requestClient.download('/infra/demo01-contact/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
48
apps/web-tdesign/src/api/infra/demo/demo02/index.ts
Normal file
48
apps/web-tdesign/src/api/infra/demo/demo02/index.ts
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace Demo02CategoryApi {
|
||||||
|
/** 示例分类信息 */
|
||||||
|
export interface Demo02Category {
|
||||||
|
id: number; // 编号
|
||||||
|
name?: string; // 名字
|
||||||
|
parentId?: number; // 父级编号
|
||||||
|
children?: Demo02Category[];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询示例分类列表 */
|
||||||
|
export function getDemo02CategoryList(params: any) {
|
||||||
|
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}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增示例分类 */
|
||||||
|
export function createDemo02Category(data: Demo02CategoryApi.Demo02Category) {
|
||||||
|
return requestClient.post('/infra/demo02-category/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改示例分类 */
|
||||||
|
export function updateDemo02Category(data: Demo02CategoryApi.Demo02Category) {
|
||||||
|
return requestClient.put('/infra/demo02-category/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除示例分类 */
|
||||||
|
export function deleteDemo02Category(id: number) {
|
||||||
|
return requestClient.delete(`/infra/demo02-category/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出示例分类 */
|
||||||
|
export function exportDemo02Category(params: any) {
|
||||||
|
return requestClient.download('/infra/demo02-category/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
168
apps/web-tdesign/src/api/infra/demo/demo03/erp/index.ts
Normal file
168
apps/web-tdesign/src/api/infra/demo/demo03/erp/index.ts
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
import type { Dayjs } from 'dayjs';
|
||||||
|
|
||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace Demo03StudentApi {
|
||||||
|
/** 学生课程信息 */
|
||||||
|
export interface Demo03Course {
|
||||||
|
id: number; // 编号
|
||||||
|
studentId?: number; // 学生编号
|
||||||
|
name?: string; // 名字
|
||||||
|
score?: number; // 分数
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 学生班级信息 */
|
||||||
|
export interface Demo03Grade {
|
||||||
|
id: number; // 编号
|
||||||
|
studentId?: number; // 学生编号
|
||||||
|
name?: string; // 名字
|
||||||
|
teacher?: string; // 班主任
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 学生信息 */
|
||||||
|
export interface Demo03Student {
|
||||||
|
id: number; // 编号
|
||||||
|
name?: string; // 名字
|
||||||
|
sex?: number; // 性别
|
||||||
|
birthday?: Dayjs | string; // 出生日期
|
||||||
|
description?: string; // 简介
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询学生分页 */
|
||||||
|
export function getDemo03StudentPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<Demo03StudentApi.Demo03Student>>(
|
||||||
|
'/infra/demo03-student-erp/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询学生详情 */
|
||||||
|
export function getDemo03Student(id: number) {
|
||||||
|
return requestClient.get<Demo03StudentApi.Demo03Student>(
|
||||||
|
`/infra/demo03-student-erp/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增学生 */
|
||||||
|
export function createDemo03Student(data: Demo03StudentApi.Demo03Student) {
|
||||||
|
return requestClient.post('/infra/demo03-student-erp/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改学生 */
|
||||||
|
export function updateDemo03Student(data: Demo03StudentApi.Demo03Student) {
|
||||||
|
return requestClient.put('/infra/demo03-student-erp/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除学生 */
|
||||||
|
export function deleteDemo03Student(id: number) {
|
||||||
|
return requestClient.delete(`/infra/demo03-student-erp/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除学生 */
|
||||||
|
export function deleteDemo03StudentList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/demo03-student-erp/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出学生 */
|
||||||
|
export function exportDemo03Student(params: any) {
|
||||||
|
return requestClient.download('/infra/demo03-student-erp/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 子表(学生课程) ====================
|
||||||
|
|
||||||
|
/** 获得学生课程分页 */
|
||||||
|
export function getDemo03CoursePage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<Demo03StudentApi.Demo03Course>>(
|
||||||
|
`/infra/demo03-student-erp/demo03-course/page`,
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
/** 新增学生课程 */
|
||||||
|
export function createDemo03Course(data: Demo03StudentApi.Demo03Course) {
|
||||||
|
return requestClient.post(
|
||||||
|
`/infra/demo03-student-erp/demo03-course/create`,
|
||||||
|
data,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改学生课程 */
|
||||||
|
export function updateDemo03Course(data: Demo03StudentApi.Demo03Course) {
|
||||||
|
return requestClient.put(
|
||||||
|
`/infra/demo03-student-erp/demo03-course/update`,
|
||||||
|
data,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除学生课程 */
|
||||||
|
export function deleteDemo03Course(id: number) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/demo03-student-erp/demo03-course/delete?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除学生课程 */
|
||||||
|
export function deleteDemo03CourseList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/demo03-student-erp/demo03-course/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得学生课程 */
|
||||||
|
export function getDemo03Course(id: number) {
|
||||||
|
return requestClient.get<Demo03StudentApi.Demo03Course>(
|
||||||
|
`/infra/demo03-student-erp/demo03-course/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 子表(学生班级) ====================
|
||||||
|
|
||||||
|
/** 获得学生班级分页 */
|
||||||
|
export function getDemo03GradePage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<Demo03StudentApi.Demo03Grade>>(
|
||||||
|
`/infra/demo03-student-erp/demo03-grade/page`,
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
/** 新增学生班级 */
|
||||||
|
export function createDemo03Grade(data: Demo03StudentApi.Demo03Grade) {
|
||||||
|
return requestClient.post(
|
||||||
|
`/infra/demo03-student-erp/demo03-grade/create`,
|
||||||
|
data,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改学生班级 */
|
||||||
|
export function updateDemo03Grade(data: Demo03StudentApi.Demo03Grade) {
|
||||||
|
return requestClient.put(
|
||||||
|
`/infra/demo03-student-erp/demo03-grade/update`,
|
||||||
|
data,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除学生班级 */
|
||||||
|
export function deleteDemo03Grade(id: number) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/demo03-student-erp/demo03-grade/delete?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除学生班级 */
|
||||||
|
export function deleteDemo03GradeList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/demo03-student-erp/demo03-grade/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得学生班级 */
|
||||||
|
export function getDemo03Grade(id: number) {
|
||||||
|
return requestClient.get<Demo03StudentApi.Demo03Grade>(
|
||||||
|
`/infra/demo03-student-erp/demo03-grade/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
96
apps/web-tdesign/src/api/infra/demo/demo03/inner/index.ts
Normal file
96
apps/web-tdesign/src/api/infra/demo/demo03/inner/index.ts
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
import type { Dayjs } from 'dayjs';
|
||||||
|
|
||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace Demo03StudentApi {
|
||||||
|
/** 学生课程信息 */
|
||||||
|
export interface Demo03Course {
|
||||||
|
id: number; // 编号
|
||||||
|
studentId?: number; // 学生编号
|
||||||
|
name?: string; // 名字
|
||||||
|
score?: number; // 分数
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 学生班级信息 */
|
||||||
|
export interface Demo03Grade {
|
||||||
|
id: number; // 编号
|
||||||
|
studentId?: number; // 学生编号
|
||||||
|
name?: string; // 名字
|
||||||
|
teacher?: string; // 班主任
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 学生信息 */
|
||||||
|
export interface Demo03Student {
|
||||||
|
id: number; // 编号
|
||||||
|
name?: string; // 名字
|
||||||
|
sex?: number; // 性别
|
||||||
|
birthday?: Dayjs | string; // 出生日期
|
||||||
|
description?: string; // 简介
|
||||||
|
demo03courses?: Demo03Course[];
|
||||||
|
demo03grade?: Demo03Grade;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询学生分页 */
|
||||||
|
export function getDemo03StudentPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<Demo03StudentApi.Demo03Student>>(
|
||||||
|
'/infra/demo03-student-inner/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询学生详情 */
|
||||||
|
export function getDemo03Student(id: number) {
|
||||||
|
return requestClient.get<Demo03StudentApi.Demo03Student>(
|
||||||
|
`/infra/demo03-student-inner/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增学生 */
|
||||||
|
export function createDemo03Student(data: Demo03StudentApi.Demo03Student) {
|
||||||
|
return requestClient.post('/infra/demo03-student-inner/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改学生 */
|
||||||
|
export function updateDemo03Student(data: Demo03StudentApi.Demo03Student) {
|
||||||
|
return requestClient.put('/infra/demo03-student-inner/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除学生 */
|
||||||
|
export function deleteDemo03Student(id: number) {
|
||||||
|
return requestClient.delete(`/infra/demo03-student-inner/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除学生 */
|
||||||
|
export function deleteDemo03StudentList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/demo03-student-inner/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出学生 */
|
||||||
|
export function exportDemo03Student(params: any) {
|
||||||
|
return requestClient.download('/infra/demo03-student-inner/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 子表(学生课程) ====================
|
||||||
|
|
||||||
|
/** 获得学生课程列表 */
|
||||||
|
export function getDemo03CourseListByStudentId(studentId: number) {
|
||||||
|
return requestClient.get<Demo03StudentApi.Demo03Course[]>(
|
||||||
|
`/infra/demo03-student-inner/demo03-course/list-by-student-id?studentId=${studentId}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 子表(学生班级) ====================
|
||||||
|
|
||||||
|
/** 获得学生班级 */
|
||||||
|
export function getDemo03GradeByStudentId(studentId: number) {
|
||||||
|
return requestClient.get<Demo03StudentApi.Demo03Grade>(
|
||||||
|
`/infra/demo03-student-inner/demo03-grade/get-by-student-id?studentId=${studentId}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
96
apps/web-tdesign/src/api/infra/demo/demo03/normal/index.ts
Normal file
96
apps/web-tdesign/src/api/infra/demo/demo03/normal/index.ts
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
import type { Dayjs } from 'dayjs';
|
||||||
|
|
||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace Demo03StudentApi {
|
||||||
|
/** 学生课程信息 */
|
||||||
|
export interface Demo03Course {
|
||||||
|
id: number; // 编号
|
||||||
|
studentId?: number; // 学生编号
|
||||||
|
name?: string; // 名字
|
||||||
|
score?: number; // 分数
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 学生班级信息 */
|
||||||
|
export interface Demo03Grade {
|
||||||
|
id: number; // 编号
|
||||||
|
studentId?: number; // 学生编号
|
||||||
|
name?: string; // 名字
|
||||||
|
teacher?: string; // 班主任
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 学生信息 */
|
||||||
|
export interface Demo03Student {
|
||||||
|
id: number; // 编号
|
||||||
|
name?: string; // 名字
|
||||||
|
sex?: number; // 性别
|
||||||
|
birthday?: Dayjs | string; // 出生日期
|
||||||
|
description?: string; // 简介
|
||||||
|
demo03courses?: Demo03Course[];
|
||||||
|
demo03grade?: Demo03Grade;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询学生分页 */
|
||||||
|
export function getDemo03StudentPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<Demo03StudentApi.Demo03Student>>(
|
||||||
|
'/infra/demo03-student-normal/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询学生详情 */
|
||||||
|
export function getDemo03Student(id: number) {
|
||||||
|
return requestClient.get<Demo03StudentApi.Demo03Student>(
|
||||||
|
`/infra/demo03-student-normal/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增学生 */
|
||||||
|
export function createDemo03Student(data: Demo03StudentApi.Demo03Student) {
|
||||||
|
return requestClient.post('/infra/demo03-student-normal/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改学生 */
|
||||||
|
export function updateDemo03Student(data: Demo03StudentApi.Demo03Student) {
|
||||||
|
return requestClient.put('/infra/demo03-student-normal/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除学生 */
|
||||||
|
export function deleteDemo03Student(id: number) {
|
||||||
|
return requestClient.delete(`/infra/demo03-student-normal/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除学生 */
|
||||||
|
export function deleteDemo03StudentList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/demo03-student-normal/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出学生 */
|
||||||
|
export function exportDemo03Student(params: any) {
|
||||||
|
return requestClient.download('/infra/demo03-student-normal/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 子表(学生课程) ====================
|
||||||
|
|
||||||
|
/** 获得学生课程列表 */
|
||||||
|
export function getDemo03CourseListByStudentId(studentId: number) {
|
||||||
|
return requestClient.get<Demo03StudentApi.Demo03Course[]>(
|
||||||
|
`/infra/demo03-student-normal/demo03-course/list-by-student-id?studentId=${studentId}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 子表(学生班级) ====================
|
||||||
|
|
||||||
|
/** 获得学生班级 */
|
||||||
|
export function getDemo03GradeByStudentId(studentId: number) {
|
||||||
|
return requestClient.get<Demo03StudentApi.Demo03Grade>(
|
||||||
|
`/infra/demo03-student-normal/demo03-grade/get-by-student-id?studentId=${studentId}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
83
apps/web-tdesign/src/api/infra/file-config/index.ts
Normal file
83
apps/web-tdesign/src/api/infra/file-config/index.ts
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace InfraFileConfigApi {
|
||||||
|
/** 文件客户端配置 */
|
||||||
|
export interface FileClientConfig {
|
||||||
|
basePath: string;
|
||||||
|
host?: string;
|
||||||
|
port?: number;
|
||||||
|
username?: string;
|
||||||
|
password?: string;
|
||||||
|
mode?: string;
|
||||||
|
endpoint?: string;
|
||||||
|
bucket?: string;
|
||||||
|
accessKey?: string;
|
||||||
|
accessSecret?: string;
|
||||||
|
pathStyle?: boolean;
|
||||||
|
enablePublicAccess?: boolean;
|
||||||
|
domain: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 文件配置信息 */
|
||||||
|
export interface FileConfig {
|
||||||
|
id?: number;
|
||||||
|
name: string;
|
||||||
|
storage?: number;
|
||||||
|
master: boolean;
|
||||||
|
visible: boolean;
|
||||||
|
config: FileClientConfig;
|
||||||
|
remark: string;
|
||||||
|
createTime?: Date;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询文件配置列表 */
|
||||||
|
export function getFileConfigPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<InfraFileConfigApi.FileConfig>>(
|
||||||
|
'/infra/file-config/page',
|
||||||
|
{
|
||||||
|
params,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询文件配置详情 */
|
||||||
|
export function getFileConfig(id: number) {
|
||||||
|
return requestClient.get<InfraFileConfigApi.FileConfig>(
|
||||||
|
`/infra/file-config/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新文件配置为主配置 */
|
||||||
|
export function updateFileConfigMaster(id: number) {
|
||||||
|
return requestClient.put(`/infra/file-config/update-master?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增文件配置 */
|
||||||
|
export function createFileConfig(data: InfraFileConfigApi.FileConfig) {
|
||||||
|
return requestClient.post('/infra/file-config/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改文件配置 */
|
||||||
|
export function updateFileConfig(data: InfraFileConfigApi.FileConfig) {
|
||||||
|
return requestClient.put('/infra/file-config/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除文件配置 */
|
||||||
|
export function deleteFileConfig(id: number) {
|
||||||
|
return requestClient.delete(`/infra/file-config/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除文件配置 */
|
||||||
|
export function deleteFileConfigList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/file-config/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 测试文件配置 */
|
||||||
|
export function testFileConfig(id: number) {
|
||||||
|
return requestClient.get(`/infra/file-config/test?id=${id}`);
|
||||||
|
}
|
||||||
78
apps/web-tdesign/src/api/infra/file/index.ts
Normal file
78
apps/web-tdesign/src/api/infra/file/index.ts
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
import type { AxiosRequestConfig, PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
/** Axios 上传进度事件 */
|
||||||
|
export type AxiosProgressEvent = AxiosRequestConfig['onUploadProgress'];
|
||||||
|
|
||||||
|
export namespace InfraFileApi {
|
||||||
|
/** 文件信息 */
|
||||||
|
export interface File {
|
||||||
|
id?: number;
|
||||||
|
configId?: number;
|
||||||
|
path: string;
|
||||||
|
name?: string;
|
||||||
|
url?: string;
|
||||||
|
size?: number;
|
||||||
|
type?: string;
|
||||||
|
createTime?: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 文件预签名地址 */
|
||||||
|
export interface FilePresignedUrlRespVO {
|
||||||
|
configId: number; // 文件配置编号
|
||||||
|
uploadUrl: string; // 文件上传 URL
|
||||||
|
url: string; // 文件 URL
|
||||||
|
path: string; // 文件路径
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 上传文件 */
|
||||||
|
export interface FileUploadReqVO {
|
||||||
|
file: globalThis.File;
|
||||||
|
directory?: string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询文件列表 */
|
||||||
|
export function getFilePage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<InfraFileApi.File>>('/infra/file/page', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除文件 */
|
||||||
|
export function deleteFile(id: number) {
|
||||||
|
return requestClient.delete(`/infra/file/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除文件 */
|
||||||
|
export function deleteFileList(ids: number[]) {
|
||||||
|
return requestClient.delete(`/infra/file/delete-list?ids=${ids.join(',')}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取文件预签名地址 */
|
||||||
|
export function getFilePresignedUrl(name: string, directory?: string) {
|
||||||
|
return requestClient.get<InfraFileApi.FilePresignedUrlRespVO>(
|
||||||
|
'/infra/file/presigned-url',
|
||||||
|
{
|
||||||
|
params: { name, directory },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 创建文件 */
|
||||||
|
export function createFile(data: InfraFileApi.File) {
|
||||||
|
return requestClient.post('/infra/file/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 上传文件 */
|
||||||
|
export function uploadFile(
|
||||||
|
data: InfraFileApi.FileUploadReqVO,
|
||||||
|
onUploadProgress?: AxiosProgressEvent,
|
||||||
|
) {
|
||||||
|
// 特殊:由于 upload 内部封装,即使 directory 为 undefined,也会传递给后端
|
||||||
|
if (!data.directory) {
|
||||||
|
delete data.directory;
|
||||||
|
}
|
||||||
|
return requestClient.upload('/infra/file/upload', data, { onUploadProgress });
|
||||||
|
}
|
||||||
41
apps/web-tdesign/src/api/infra/job-log/index.ts
Normal file
41
apps/web-tdesign/src/api/infra/job-log/index.ts
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace InfraJobLogApi {
|
||||||
|
/** 任务日志信息 */
|
||||||
|
export interface JobLog {
|
||||||
|
id?: number;
|
||||||
|
jobId: number;
|
||||||
|
handlerName: string;
|
||||||
|
handlerParam: string;
|
||||||
|
cronExpression: string;
|
||||||
|
executeIndex: string;
|
||||||
|
beginTime: Date;
|
||||||
|
endTime: Date;
|
||||||
|
duration: string;
|
||||||
|
status: number;
|
||||||
|
createTime?: string;
|
||||||
|
result: string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询任务日志列表 */
|
||||||
|
export function getJobLogPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<InfraJobLogApi.JobLog>>(
|
||||||
|
'/infra/job-log/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询任务日志详情 */
|
||||||
|
export function getJobLog(id: number) {
|
||||||
|
return requestClient.get<InfraJobLogApi.JobLog>(
|
||||||
|
`/infra/job-log/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出定时任务日志 */
|
||||||
|
export function exportJobLog(params: any) {
|
||||||
|
return requestClient.download('/infra/job-log/export-excel', { params });
|
||||||
|
}
|
||||||
77
apps/web-tdesign/src/api/infra/job/index.ts
Normal file
77
apps/web-tdesign/src/api/infra/job/index.ts
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace InfraJobApi {
|
||||||
|
/** 任务信息 */
|
||||||
|
export interface Job {
|
||||||
|
id?: number;
|
||||||
|
name: string;
|
||||||
|
status: number;
|
||||||
|
handlerName: string;
|
||||||
|
handlerParam: string;
|
||||||
|
cronExpression: string;
|
||||||
|
retryCount: number;
|
||||||
|
retryInterval: number;
|
||||||
|
monitorTimeout: number;
|
||||||
|
createTime?: Date;
|
||||||
|
nextTimes?: Date[];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询任务列表 */
|
||||||
|
export function getJobPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<InfraJobApi.Job>>('/infra/job/page', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询任务详情 */
|
||||||
|
export function getJob(id: number) {
|
||||||
|
return requestClient.get<InfraJobApi.Job>(`/infra/job/get?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增任务 */
|
||||||
|
export function createJob(data: InfraJobApi.Job) {
|
||||||
|
return requestClient.post('/infra/job/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改定时任务调度 */
|
||||||
|
export function updateJob(data: InfraJobApi.Job) {
|
||||||
|
return requestClient.put('/infra/job/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除定时任务调度 */
|
||||||
|
export function deleteJob(id: number) {
|
||||||
|
return requestClient.delete(`/infra/job/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除定时任务调度 */
|
||||||
|
export function deleteJobList(ids: number[]) {
|
||||||
|
return requestClient.delete(`/infra/job/delete-list?ids=${ids.join(',')}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出定时任务调度 */
|
||||||
|
export function exportJob(params: any) {
|
||||||
|
return requestClient.download('/infra/job/export-excel', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 任务状态修改 */
|
||||||
|
export function updateJobStatus(id: number, status: number) {
|
||||||
|
return requestClient.put('/infra/job/update-status', undefined, {
|
||||||
|
params: {
|
||||||
|
id,
|
||||||
|
status,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 定时任务立即执行一次 */
|
||||||
|
export function runJob(id: number) {
|
||||||
|
return requestClient.put(`/infra/job/trigger?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得定时任务的下 n 次执行时间 */
|
||||||
|
export function getJobNextTimes(id: number) {
|
||||||
|
return requestClient.get(`/infra/job/get_next_times?id=${id}`);
|
||||||
|
}
|
||||||
190
apps/web-tdesign/src/api/infra/redis/index.ts
Normal file
190
apps/web-tdesign/src/api/infra/redis/index.ts
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace InfraRedisApi {
|
||||||
|
/** Redis 信息 */
|
||||||
|
export interface RedisInfo {
|
||||||
|
io_threaded_reads_processed: string;
|
||||||
|
tracking_clients: string;
|
||||||
|
uptime_in_seconds: string;
|
||||||
|
cluster_connections: string;
|
||||||
|
current_cow_size: string;
|
||||||
|
maxmemory_human: string;
|
||||||
|
aof_last_cow_size: string;
|
||||||
|
master_replid2: string;
|
||||||
|
mem_replication_backlog: string;
|
||||||
|
aof_rewrite_scheduled: string;
|
||||||
|
total_net_input_bytes: string;
|
||||||
|
rss_overhead_ratio: string;
|
||||||
|
hz: string;
|
||||||
|
current_cow_size_age: string;
|
||||||
|
redis_build_id: string;
|
||||||
|
errorstat_BUSYGROUP: string;
|
||||||
|
aof_last_bgrewrite_status: string;
|
||||||
|
multiplexing_api: string;
|
||||||
|
client_recent_max_output_buffer: string;
|
||||||
|
allocator_resident: string;
|
||||||
|
mem_fragmentation_bytes: string;
|
||||||
|
aof_current_size: string;
|
||||||
|
repl_backlog_first_byte_offset: string;
|
||||||
|
tracking_total_prefixes: string;
|
||||||
|
redis_mode: string;
|
||||||
|
redis_git_dirty: string;
|
||||||
|
aof_delayed_fsync: string;
|
||||||
|
allocator_rss_bytes: string;
|
||||||
|
repl_backlog_histlen: string;
|
||||||
|
io_threads_active: string;
|
||||||
|
rss_overhead_bytes: string;
|
||||||
|
total_system_memory: string;
|
||||||
|
loading: string;
|
||||||
|
evicted_keys: string;
|
||||||
|
maxclients: string;
|
||||||
|
cluster_enabled: string;
|
||||||
|
redis_version: string;
|
||||||
|
repl_backlog_active: string;
|
||||||
|
mem_aof_buffer: string;
|
||||||
|
allocator_frag_bytes: string;
|
||||||
|
io_threaded_writes_processed: string;
|
||||||
|
instantaneous_ops_per_sec: string;
|
||||||
|
used_memory_human: string;
|
||||||
|
total_error_replies: string;
|
||||||
|
role: string;
|
||||||
|
maxmemory: string;
|
||||||
|
used_memory_lua: string;
|
||||||
|
rdb_current_bgsave_time_sec: string;
|
||||||
|
used_memory_startup: string;
|
||||||
|
used_cpu_sys_main_thread: string;
|
||||||
|
lazyfree_pending_objects: string;
|
||||||
|
aof_pending_bio_fsync: string;
|
||||||
|
used_memory_dataset_perc: string;
|
||||||
|
allocator_frag_ratio: string;
|
||||||
|
arch_bits: string;
|
||||||
|
used_cpu_user_main_thread: string;
|
||||||
|
mem_clients_normal: string;
|
||||||
|
expired_time_cap_reached_count: string;
|
||||||
|
unexpected_error_replies: string;
|
||||||
|
mem_fragmentation_ratio: string;
|
||||||
|
aof_last_rewrite_time_sec: string;
|
||||||
|
master_replid: string;
|
||||||
|
aof_rewrite_in_progress: string;
|
||||||
|
lru_clock: string;
|
||||||
|
maxmemory_policy: string;
|
||||||
|
run_id: string;
|
||||||
|
latest_fork_usec: string;
|
||||||
|
tracking_total_items: string;
|
||||||
|
total_commands_processed: string;
|
||||||
|
expired_keys: string;
|
||||||
|
errorstat_ERR: string;
|
||||||
|
used_memory: string;
|
||||||
|
module_fork_in_progress: string;
|
||||||
|
errorstat_WRONGPASS: string;
|
||||||
|
aof_buffer_length: string;
|
||||||
|
dump_payload_sanitizations: string;
|
||||||
|
mem_clients_slaves: string;
|
||||||
|
keyspace_misses: string;
|
||||||
|
server_time_usec: string;
|
||||||
|
executable: string;
|
||||||
|
lazyfreed_objects: string;
|
||||||
|
db0: string;
|
||||||
|
used_memory_peak_human: string;
|
||||||
|
keyspace_hits: string;
|
||||||
|
rdb_last_cow_size: string;
|
||||||
|
aof_pending_rewrite: string;
|
||||||
|
used_memory_overhead: string;
|
||||||
|
active_defrag_hits: string;
|
||||||
|
tcp_port: string;
|
||||||
|
uptime_in_days: string;
|
||||||
|
used_memory_peak_perc: string;
|
||||||
|
current_save_keys_processed: string;
|
||||||
|
blocked_clients: string;
|
||||||
|
total_reads_processed: string;
|
||||||
|
expire_cycle_cpu_milliseconds: string;
|
||||||
|
sync_partial_err: string;
|
||||||
|
used_memory_scripts_human: string;
|
||||||
|
aof_current_rewrite_time_sec: string;
|
||||||
|
aof_enabled: string;
|
||||||
|
process_supervised: string;
|
||||||
|
master_repl_offset: string;
|
||||||
|
used_memory_dataset: string;
|
||||||
|
used_cpu_user: string;
|
||||||
|
rdb_last_bgsave_status: string;
|
||||||
|
tracking_total_keys: string;
|
||||||
|
atomicvar_api: string;
|
||||||
|
allocator_rss_ratio: string;
|
||||||
|
client_recent_max_input_buffer: string;
|
||||||
|
clients_in_timeout_table: string;
|
||||||
|
aof_last_write_status: string;
|
||||||
|
mem_allocator: string;
|
||||||
|
used_memory_scripts: string;
|
||||||
|
used_memory_peak: string;
|
||||||
|
process_id: string;
|
||||||
|
master_failover_state: string;
|
||||||
|
errorstat_NOAUTH: string;
|
||||||
|
used_cpu_sys: string;
|
||||||
|
repl_backlog_size: string;
|
||||||
|
connected_slaves: string;
|
||||||
|
current_save_keys_total: string;
|
||||||
|
gcc_version: string;
|
||||||
|
total_system_memory_human: string;
|
||||||
|
sync_full: string;
|
||||||
|
connected_clients: string;
|
||||||
|
module_fork_last_cow_size: string;
|
||||||
|
total_writes_processed: string;
|
||||||
|
allocator_active: string;
|
||||||
|
total_net_output_bytes: string;
|
||||||
|
pubsub_channels: string;
|
||||||
|
current_fork_perc: string;
|
||||||
|
active_defrag_key_hits: string;
|
||||||
|
rdb_changes_since_last_save: string;
|
||||||
|
instantaneous_input_kbps: string;
|
||||||
|
used_memory_rss_human: string;
|
||||||
|
configured_hz: string;
|
||||||
|
expired_stale_perc: string;
|
||||||
|
active_defrag_misses: string;
|
||||||
|
used_cpu_sys_children: string;
|
||||||
|
number_of_cached_scripts: string;
|
||||||
|
sync_partial_ok: string;
|
||||||
|
used_memory_lua_human: string;
|
||||||
|
rdb_last_save_time: string;
|
||||||
|
pubsub_patterns: string;
|
||||||
|
slave_expires_tracked_keys: string;
|
||||||
|
redis_git_sha1: string;
|
||||||
|
used_memory_rss: string;
|
||||||
|
rdb_last_bgsave_time_sec: string;
|
||||||
|
os: string;
|
||||||
|
mem_not_counted_for_evict: string;
|
||||||
|
active_defrag_running: string;
|
||||||
|
rejected_connections: string;
|
||||||
|
aof_rewrite_buffer_length: string;
|
||||||
|
total_forks: string;
|
||||||
|
active_defrag_key_misses: string;
|
||||||
|
allocator_allocated: string;
|
||||||
|
aof_base_size: string;
|
||||||
|
instantaneous_output_kbps: string;
|
||||||
|
second_repl_offset: string;
|
||||||
|
rdb_bgsave_in_progress: string;
|
||||||
|
used_cpu_user_children: string;
|
||||||
|
total_connections_received: string;
|
||||||
|
migrate_cached_sockets: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Redis 命令统计 */
|
||||||
|
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.RedisMonitorInfo>(
|
||||||
|
'/infra/redis/get-monitor-info',
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user