feat: 智能分类建议 — 根据金额/备注/历史自动推荐分类
This commit is contained in:
@@ -41,3 +41,14 @@ export function getCategoryStats(month?: string, type: string = 'expense', group
|
||||
export function getTrend(month?: string, type: string = 'expense', group_id?: number | null) {
|
||||
return request<TrendPoint[]>({ url: '/stats/trend', data: { month, type, group_id } })
|
||||
}
|
||||
|
||||
/** 智能分类建议结果 */
|
||||
export interface CategorySuggestion {
|
||||
category: { id: number; name: string; color: string } | null
|
||||
confidence: number
|
||||
}
|
||||
|
||||
/** 根据金额和备注推荐分类 */
|
||||
export function suggestCategory(amount: number, type: string, note?: string) {
|
||||
return request<CategorySuggestion>({ url: '/stats/suggest-category', data: { amount, type, note } })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user