12345678910111213141516171819202122232425
  1. import 'package:dio/dio.dart';
  2. import 'package:farmer_client/utils/Request.dart';
  3. import 'showError.dart';
  4. /**
  5. * 农机资讯
  6. * @param {*} data
  7. * @returns
  8. */
  9. Future getNewsList(params) async {
  10. return request('/news', options: Options(method: 'GET'),queryParameters: params)
  11. .catchError(showError);
  12. }
  13. /**
  14. * 农机资讯详情
  15. * @param {*} data
  16. * @returns
  17. */
  18. Future getNewsInfo(String id) async {
  19. return request(
  20. '/news/$id',
  21. options: Options(method: 'GET'),
  22. ).catchError(showError);
  23. }