5 changed files with 52 additions and 84 deletions
@ -1,25 +1,34 @@
@@ -1,25 +1,34 @@
|
||||
import { ConfigParams, Config, ConfigResult } from '../entity/config' |
||||
/** |
||||
* 提供api模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 |
||||
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. |
||||
* author entfrm开发团队-王翔 |
||||
*/ |
||||
import type { ConfigParams, Config } from '/@/api/platform/system/entity/config'; |
||||
import { defHttp } from '/@/utils/http/axios'; |
||||
import {isDef} from "/@/utils/is"; |
||||
|
||||
enum Api { |
||||
Page = '/system_proxy/system/config/list', |
||||
Save = '/system_proxy/system/config/save', |
||||
Update = '/system_proxy/system/config/update', |
||||
Remove = '/system_proxy/system/config/remove', |
||||
list = '/system_proxy/system/config/list', |
||||
add = '/system_proxy/system/config/save', |
||||
get = '/system_proxy/system/config', |
||||
edit = '/system_proxy/system/config/update', |
||||
del = '/system_proxy/system/config/remove', |
||||
getByKey = '/system_proxy/system/config/getByKey' |
||||
} |
||||
|
||||
export const list = (params: ConfigParams) => |
||||
defHttp.get({ url: Api.Page, params }); |
||||
/** 查询配置列表 */ |
||||
export const listConfig = (params?: Partial<ConfigParams>) => defHttp.get({ url: Api.list, params }); |
||||
|
||||
/** 新增配置 */ |
||||
export const addConfig = (params: Partial<Config>) => defHttp.post({ url: Api.add, data: params }); |
||||
|
||||
export const set = (params: Config) => { |
||||
if (isDef(params.id)) { |
||||
return defHttp.put({ url: Api.Update, params }); |
||||
}else { |
||||
return defHttp.post({ url: Api.Save, params }); |
||||
} |
||||
} |
||||
/** 修改配置 */ |
||||
export const editConfig = (params: Partial<Config>) => defHttp.put({ url: Api.edit, data: params }); |
||||
|
||||
/** 查询配置详细 */ |
||||
export const getConfig = (id: string) => defHttp.get<Config>({ url: `${Api.get}/${id}` }); |
||||
|
||||
/** 删除配置 */ |
||||
export const delConfig = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` }); |
||||
|
||||
export const remove = (params: {ids: string}) => |
||||
defHttp.delete<ConfigResult>({ url: Api.Remove + `/${params.ids}` }); |
||||
/** 根据 key 查询配置详细 */ |
||||
export const getConfigByKey = (id: string) => defHttp.get({ url: `${Api.getByKey}/${id}` }); |
||||
|
@ -1,63 +1,25 @@
@@ -1,63 +1,25 @@
|
||||
/** |
||||
* @program: kicc-ui |
||||
* @description: 文件上传实体类 |
||||
* @description: 配置实体类 |
||||
* 类型定义 |
||||
* @author: entfrm开发团队-王翔 |
||||
* @create: 2022/4/8 |
||||
*/ |
||||
import { Page, R, CommonEntity } from '/@/api/model'; |
||||
|
||||
export type ConfigParams = { |
||||
/** |
||||
* 参数主键 |
||||
*/ |
||||
id: string; |
||||
|
||||
/** |
||||
* 参数名称 |
||||
*/ |
||||
name: string; |
||||
|
||||
/** |
||||
* 参数键名 |
||||
*/ |
||||
key: string; |
||||
|
||||
/** |
||||
* 系统内置 0:是,1否 |
||||
*/ |
||||
isSys:string; |
||||
|
||||
} & Page; |
||||
import { R } from '/#/axios'; |
||||
import { CommonEntity, Page } from '/@/api/common/data/entity'; |
||||
|
||||
/** 配置查询参数 */ |
||||
export type ConfigParams = Page & Config; |
||||
|
||||
/** 配置对象 */ |
||||
export interface Config extends CommonEntity { |
||||
/** |
||||
* 参数主键 |
||||
*/ |
||||
id: string; |
||||
|
||||
/** |
||||
* 参数名称 |
||||
*/ |
||||
name: string; |
||||
|
||||
/** |
||||
* 参数键名 |
||||
*/ |
||||
key: string; |
||||
|
||||
/** |
||||
* 参数键值 |
||||
*/ |
||||
value:string; |
||||
|
||||
/** |
||||
* 系统内置 0:是,1否 |
||||
*/ |
||||
isSys:string; |
||||
|
||||
value: string; |
||||
isSys: string; |
||||
[key: string]: any; |
||||
} |
||||
|
||||
|
||||
export type ConfigResult = R<Config>; |
||||
/** 配置响应对象 */ |
||||
export type ConfigResult = R<Config[]>; |
||||
|
Loading…
Reference in new issue