111
This commit is contained in:
23
flutter_monisuo/lib/data/services/config_service.dart
Normal file
23
flutter_monisuo/lib/data/services/config_service.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import '../../core/constants/api_endpoints.dart';
|
||||
import '../../core/network/api_response.dart';
|
||||
import '../../core/network/dio_client.dart';
|
||||
|
||||
/// 系统配置服务
|
||||
class ConfigService {
|
||||
final DioClient _client;
|
||||
|
||||
ConfigService(this._client);
|
||||
|
||||
/// 获取客服联系信息
|
||||
Future<ApiResponse<String>> getCustomerServiceContact() async {
|
||||
final response = await _client.get<Map<String, dynamic>>(
|
||||
ApiEndpoints.customerService,
|
||||
);
|
||||
|
||||
if (response.success && response.data != null) {
|
||||
final contact = response.data!['contact'] as String? ?? '';
|
||||
return ApiResponse.success(contact, response.message);
|
||||
}
|
||||
return ApiResponse.fail(response.message ?? '获取客服信息失败');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user