YOUPAILZLiveManagerListUtils.m 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // YOUPAILZLiveManagerListUtils.m
  3. // VQU
  4. //
  5. // Created by CY on 2021/9/1.
  6. // Copyright © 2021 MS. All rights reserved.
  7. //
  8. #import "YOUPAILZLiveManagerListUtils.h"
  9. @interface YOUPAILZLiveManagerListUtils ()
  10. @property (nonatomic,strong,readwrite) NSArray <YOUPAILZLiveManageModel*> *youpaipmanages;
  11. @property (nonatomic,strong,readwrite) NSArray <NSString *> *youpaipmanageUserIds;
  12. @end
  13. @implementation YOUPAILZLiveManagerListUtils
  14. + (instancetype)shared{
  15. static YOUPAILZLiveManagerListUtils *sharedManager = nil;
  16. static dispatch_once_t onceToken;
  17. dispatch_once(&onceToken, ^{
  18. sharedManager = [[YOUPAILZLiveManagerListUtils alloc] init];
  19. });
  20. return sharedManager;
  21. }
  22. - (void)youpaifreloadManagerListWithLiveId:(NSString *)liveId{
  23. @weakify(self);
  24. [LCHttpHelper requestWithURLString:GetManagerList parameters:@{@"live_id":liveId,@"type":@"manager"} needToken:YES type:HttpRequestTypePost success:^(id responseObject) {
  25. @strongify(self);
  26. NSDictionary* dict = (NSDictionary*)responseObject;
  27. NSInteger code = [[dict objectForKey:@"code"] integerValue];
  28. if (code == 0) {
  29. self.youpaipmanages = [YOUPAILZLiveManageModel mj_objectArrayWithKeyValuesArray:[dict objectForKey:@"data"]].mutableCopy;
  30. NSMutableArray *youpaipmanageUserIds = [NSMutableArray array];
  31. for (YOUPAILZLiveManageModel *model in self.youpaipmanages) {
  32. [youpaipmanageUserIds addObject:model.youpaipid];
  33. }
  34. self.youpaipmanageUserIds = youpaipmanageUserIds.copy;
  35. }
  36. } failure:^(NSError *error) {
  37. }];
  38. }
  39. @end