refactor(apps): simplify API layer by removing redundant wrapper classes

- Remove ApiClientWrapper and MockApiClientWrapper
- Simplify IApiClient interface
- Update dependency injection configuration
- Optimize calendar service and AG-UI chat models
This commit is contained in:
qzl
2026-03-03 10:12:46 +08:00
parent 9b9b8fcbdd
commit 5e169251fe
12 changed files with 84 additions and 140 deletions
+6 -1
View File
@@ -1,9 +1,10 @@
import 'package:dio/dio.dart';
import 'api_exception.dart';
import 'api_interceptor.dart';
import 'i_api_client.dart';
import '../storage/token_storage.dart';
class ApiClient {
class ApiClient implements IApiClient {
final Dio _dio;
final TokenStorage _tokenStorage;
final ApiInterceptor _interceptor;
@@ -44,6 +45,7 @@ class ApiClient {
};
}
@override
Future<Response<T>> get<T>(String path, {Options? options}) async {
try {
return await _dio.get<T>(path, options: options);
@@ -52,6 +54,7 @@ class ApiClient {
}
}
@override
Future<Response<T>> post<T>(
String path, {
dynamic data,
@@ -64,6 +67,7 @@ class ApiClient {
}
}
@override
Future<Response<T>> patch<T>(
String path, {
dynamic data,
@@ -76,6 +80,7 @@ class ApiClient {
}
}
@override
Future<Response<T>> delete<T>(
String path, {
dynamic data,