ASSginViewModel.m 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // ASSginViewModel.m
  3. // Asteria
  4. //
  5. // Created by iOS on 2023/11/29.
  6. //
  7. #import "ASSginViewModel.h"
  8. @implementation ASSginViewModel
  9. - (void)getSignData:(void(^)(NSArray *arr))compBlock {
  10. [ASNetTools.shared getWithPath:getSignStateUrl param:@{} success:^(id _Nonnull json) {
  11. NSArray *arr = json;
  12. compBlock(arr);
  13. } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
  14. NSArray *arr= [NSArray array];
  15. compBlock(arr);
  16. [Current_normalTool.currentNav.topViewController.view makeToast:msg];
  17. }];
  18. }
  19. - (void)signToday:(void(^)(void))compBlock {
  20. [ASNetTools.shared postWithPath:postSignUrl param:@{} success:^(id _Nonnull json) {
  21. compBlock();
  22. } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
  23. compBlock();
  24. [Current_normalTool.currentNav.topViewController.view makeToast:msg];
  25. }];
  26. }
  27. - (void)requestGetUserIsSign:(void(^)(BOOL isSign))compBlock {
  28. [ASNetTools.shared getWithPath:getUserIsSign param:@{} success:^(id _Nonnull json) {
  29. BOOL isSign = [json boolValue];
  30. // NSLog(@"====%@", isSign);
  31. compBlock(isSign);
  32. } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
  33. compBlock(NO);
  34. }];
  35. }
  36. @end