(keyword: string)
| 140 | } |
| 141 | |
| 142 | export async function searchHistory(keyword: string): Promise<{ |
| 143 | success: boolean |
| 144 | records: HistoryRecord[] |
| 145 | error?: AppError | string |
| 146 | error_message?: string |
| 147 | }> { |
| 148 | try { |
| 149 | const response = await axios.get(`${API_BASE_URL}/history/search`, { |
| 150 | params: { keyword }, |
| 151 | timeout: 10000 |
| 152 | }) |
| 153 | return response.data |
| 154 | } catch (error: any) { |
| 155 | return { success: false, records: [], ...getApiErrorPayload(error, '搜索历史记录失败') } |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | export async function getHistoryStats(): Promise<{ |
| 160 | success: boolean |
nothing calls this directly
no test coverage detected