Files
oneos-frontend/apps/web-tdesign/src/api/infra/config/index.ts
k kfluous 2650d1cdf0
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
Initial commit: OneOS frontend based on yudao-ui-admin-vben
2026-03-11 22:18:23 +08:00

68 lines
1.6 KiB
TypeScript

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,
});
}