24 lines
720 B
Dart
24 lines
720 B
Dart
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 ?? '获取客服信息失败');
|
|
}
|
|
}
|