feat:重构模块
This commit is contained in:
@@ -3,33 +3,33 @@ import { IAssetRecord } from '@/types/asset'
|
||||
|
||||
export const addAssetApi = (asset: IAssetRecord): Promise<boolean> =>
|
||||
cloudService({
|
||||
url: '/home-service/asset',
|
||||
url: '/home-api/asset',
|
||||
method: 'post',
|
||||
data: asset
|
||||
})
|
||||
|
||||
export const updateAssetApi = (id: number, asset: IAssetRecord): Promise<boolean> =>
|
||||
cloudService({
|
||||
url: `/home-service/asset/${id}`,
|
||||
url: `/home-api/asset/${id}`,
|
||||
method: 'put',
|
||||
data: asset
|
||||
})
|
||||
|
||||
export const deleteAssetApi = (id: number): Promise<boolean> =>
|
||||
cloudService({
|
||||
url: `/home-service/asset/${id}`,
|
||||
url: `/home-api/asset/${id}`,
|
||||
method: 'delete'
|
||||
})
|
||||
|
||||
export const queryAssetApi = (category: string): Promise<IAssetRecord[]> =>
|
||||
cloudService({
|
||||
url: '/home-service/asset',
|
||||
url: '/home-api/asset',
|
||||
method: 'get',
|
||||
params: { category }
|
||||
})
|
||||
|
||||
export const queryAssetCategoryApi = (): Promise<string[]> =>
|
||||
cloudService({
|
||||
url: '/home-service/asset/category',
|
||||
url: '/home-api/asset/category',
|
||||
method: 'get'
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user