service_pack.dart 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import 'package:fis_jsonrpc/rpc.dart';
  2. import 'package:vitalapp/managers/interfaces/service_pack.dart';
  3. import 'package:vitalapp/rpc.dart';
  4. import 'package:fis_common/logger/logger.dart';
  5. import 'package:vitalapp/store/store.dart';
  6. class ServicePackManager implements IServicePackManager {
  7. @override
  8. Future<PageCollection<ServicePackDTO>?> getServicePackList(
  9. ServicePackPageRequest request) async {
  10. try {
  11. request.token = Store.user.token;
  12. final result =
  13. await rpc.vitalServicePack.getServicePackPageAsync(request);
  14. return result;
  15. } catch (e) {
  16. logger.e("getServicePackPageAsync query patient paged list error.", e);
  17. return null;
  18. }
  19. }
  20. @override
  21. Future<PageCollection<ServiceItemDTO>?> getServiceItemList(
  22. PageRequest request) async {
  23. try {
  24. request.token = Store.user.token;
  25. final result =
  26. await rpc.vitalServicePack.getServiceItemPageAsync(request);
  27. print(result);
  28. return result;
  29. } catch (e) {
  30. logger.e("getServiceItemList query patient paged list error.", e);
  31. return null;
  32. }
  33. }
  34. }