import 'package:chicken_farm/core/api/api_service.dart'; import 'package:chicken_farm/modes/system/config.dart'; class ConfigApi { static final ConfigApi _instance = ConfigApi._internal(); factory ConfigApi() => _instance; ConfigApi._internal(); Future getConfigs() async { return await ApiService().get( '/system/config/list', queryParameters: {'pageSize': 10000}, ); } Future getConfigKey(String configKey) async { final response = await ApiService().get( '/system/config/configKey/$configKey', ); return response != null ? ConfigModel.fromJson(response) : null; } Future refreshCache() async { return await ApiService().delete('/system/config/refreshCache'); } }