7 changed files with 51 additions and 41 deletions
@ -1,20 +1,34 @@ |
|||||||
import { ClientParams, ClientListGetResultModel, ClientListItem } from '../entity/client'; |
/** |
||||||
|
* 提供api模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 |
||||||
|
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. |
||||||
|
* author entfrm开发团队-王翔 |
||||||
|
*/ |
||||||
|
import type { Client, ClientParams, ClientResult } from '/@/api/platform/system/entity/client'; |
||||||
import { defHttp } from '/@/utils/http/axios'; |
import { defHttp } from '/@/utils/http/axios'; |
||||||
|
|
||||||
enum Api { |
enum Api { |
||||||
Page = '/mate-system/client/page', |
list = '/system_proxy/system/client/list', |
||||||
Set = '/mate-system/client/set', |
add = '/system_proxy/system/client/save', |
||||||
Del = '/mate-system/client/del', |
get = '/system_proxy/system/client', |
||||||
|
edit = '/system_proxy/system/client/update', |
||||||
|
del = '/system_proxy/system/client/remove', |
||||||
|
cache = '/system_proxy/system/client/cache' |
||||||
} |
} |
||||||
|
|
||||||
// 分页查询
|
/** 查询客户端列表 */ |
||||||
export const page = (params: ClientParams) => |
export const listClient = (params?: Partial<ClientParams>) => defHttp.get<ClientResult>({ url: Api.list, params }, { isReturnResultResponse: true }); |
||||||
defHttp.get<ClientListGetResultModel>({ url: Api.Page, params }); |
|
||||||
|
|
||||||
// 保存
|
/** 新增客户端 */ |
||||||
export const set = (params: ClientListItem) => |
export const addClient = (params: Partial<ClientParams>) => defHttp.post({ url: Api.add, data: params }); |
||||||
defHttp.post<ClientListItem>({ url: Api.Set, params }); |
|
||||||
|
|
||||||
// 删除
|
/** 修改客户端 */ |
||||||
export const del = (params: { ids: String }) => |
export const editClient = (params: Partial<ClientParams>) => defHttp.put({ url: Api.edit, data: params }); |
||||||
defHttp.post<boolean>({ url: Api.Del + `?ids=${params.ids}` }); |
|
||||||
|
/** 查询客户端详细 */ |
||||||
|
export const getClient = (id: string) => defHttp.get<Client>({ url: `${Api.get}/${id}` }); |
||||||
|
|
||||||
|
/** 删除客户端 */ |
||||||
|
export const delClient = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` }); |
||||||
|
|
||||||
|
/** 清理客户端缓存 */ |
||||||
|
export const cleanCache = () => defHttp.put({ url: Api.cache }); |
||||||
|
Loading…
Reference in new issue