service_pack.dart 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  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 = await rpc.servicePack.getServicePackPageAsync(request);
  13. return result;
  14. } catch (e) {
  15. logger.e("getServicePackPageAsync query patient paged list error.", e);
  16. return null;
  17. }
  18. }
  19. @override
  20. Future<PageCollection<ServiceItemDTO>?> getServiceItemList(
  21. PageRequest request) async {
  22. try {
  23. request.token = Store.user.token;
  24. final result = await rpc.servicePack.getServiceItemPageAsync(request);
  25. print(result);
  26. return result;
  27. } catch (e) {
  28. logger.e("getServiceItemList query patient paged list error.", e);
  29. return null;
  30. }
  31. }
  32. }