feat:重构模块
This commit is contained in:
@@ -3,47 +3,47 @@ import { IBudgetInfo } from '@/types/budget'
|
||||
|
||||
export const addBudgetApi = (budget: IBudgetInfo): Promise<any> =>
|
||||
cloudService({
|
||||
url: '/home-service/budget',
|
||||
url: '/home-api/budget',
|
||||
method: 'post',
|
||||
data: budget
|
||||
})
|
||||
|
||||
export const updateBudgetApi = (id: number, budget: IBudgetInfo): Promise<any> =>
|
||||
cloudService({
|
||||
url: `/home-service/budget/${id}`,
|
||||
url: `/home-api/budget/${id}`,
|
||||
method: 'put',
|
||||
data: budget
|
||||
})
|
||||
|
||||
export const deleteBudgetApi = (id: number): Promise<any> =>
|
||||
cloudService({
|
||||
url: `/home-service/budget/${id}`,
|
||||
url: `/home-api/budget/${id}`,
|
||||
method: 'DELETE'
|
||||
})
|
||||
|
||||
export const queryBudgetApi = (category: string): Promise<any> =>
|
||||
cloudService({
|
||||
url: '/home-service/budget',
|
||||
url: '/home-api/budget',
|
||||
method: 'get',
|
||||
params: { category }
|
||||
})
|
||||
|
||||
export const queryBudgetCategory = (): Promise<any> =>
|
||||
cloudService({
|
||||
url: '/home-service/budget/category',
|
||||
url: '/home-api/budget/category',
|
||||
method: 'get'
|
||||
})
|
||||
|
||||
export const queryBudgetRankStats = (category: string): Promise<any> =>
|
||||
cloudService({
|
||||
url: '/home-service/budget/stats/rank',
|
||||
url: '/home-api/budget/stats/rank',
|
||||
method: 'get',
|
||||
params: { category }
|
||||
})
|
||||
|
||||
export const queryBudgetProjectStats = (category: string): Promise<any> =>
|
||||
cloudService({
|
||||
url: '/home-service/budget/stats/project',
|
||||
url: '/home-api/budget/stats/project',
|
||||
method: 'get',
|
||||
params: { category }
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user