chore: 完善form demo
This commit is contained in:
55
apps/web-antd/src/api/system/config/index.ts
Normal file
55
apps/web-antd/src/api/system/config/index.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import type { Config } from './model';
|
||||
|
||||
import type { ID, IDS, PageQuery, PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
enum Api {
|
||||
configExport = '/system/config/export',
|
||||
configInfoByKey = '/system/config/configKey',
|
||||
configList = '/system/config/list',
|
||||
configRefreshCache = '/system/config/refreshCache',
|
||||
root = '/system/config',
|
||||
}
|
||||
|
||||
export function configList(params?: PageQuery) {
|
||||
return requestClient.get<PageResult<Config>>(Api.configList, { params });
|
||||
}
|
||||
|
||||
export function configInfo(configId: ID) {
|
||||
return requestClient.get<Config>(`${Api.root}/${configId}`);
|
||||
}
|
||||
|
||||
export function configExport(data: any) {
|
||||
return commonExport(Api.configExport, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新缓存
|
||||
* @returns void
|
||||
*/
|
||||
export function configRefreshCache() {
|
||||
return requestClient.deleteWithMsg<void>(Api.configRefreshCache);
|
||||
}
|
||||
|
||||
export function configUpdate(data: any) {
|
||||
return requestClient.putWithMsg<void>(Api.root, data);
|
||||
}
|
||||
|
||||
export function configAdd(data: any) {
|
||||
return requestClient.postWithMsg<void>(Api.root, data);
|
||||
}
|
||||
|
||||
export function configRemove(configIds: IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`${Api.root}/${configIds}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取配置信息
|
||||
* @param configKey configKey
|
||||
* @returns info
|
||||
*/
|
||||
export function configInfoByKey(configKey: string) {
|
||||
return requestClient.get<Config>(`${Api.configInfoByKey}/${configKey}`);
|
||||
}
|
9
apps/web-antd/src/api/system/config/model.d.ts
vendored
Normal file
9
apps/web-antd/src/api/system/config/model.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
export interface Config {
|
||||
configId: number;
|
||||
configName: string;
|
||||
configKey: string;
|
||||
configValue: string;
|
||||
configType: string;
|
||||
remark: string;
|
||||
createTime: string;
|
||||
}
|
@@ -1,8 +1,8 @@
|
||||
import type { DictData } from './dict-data-model';
|
||||
|
||||
import type { ID, IDS, PageQuery } from '#/api/base';
|
||||
import type { ID, IDS, PageQuery } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/base';
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
enum Api {
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import type { DictType } from './dict-type-model';
|
||||
|
||||
import type { ID, IDS, PageQuery } from '#/api/base';
|
||||
import type { ID, IDS, PageQuery } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/base';
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
enum Api {
|
||||
|
Reference in New Issue
Block a user