XYXYActivityAPIManager.m 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // XYXYActivityAPIManager.m
  3. // Timi
  4. //
  5. // Created by 翟玉磊 on 2021/12/14.
  6. //
  7. #import "XYXYActivityAPIManager.h"
  8. /// 巅峰家族-排行榜
  9. static NSString * const ACTIVITY_GET_PEAK_FAMILY_RANK = @"api-app/v1/activity/getPeakFamilyRank";
  10. /// 魅力花房-房间排行信息获取
  11. static NSString * const ACTIVITY_GET_FLOWER_ROOM_RANK = @"api-app/v1/activity/getFlowerRoomRank";
  12. @implementation XYXYActivityAPIManager
  13. /// 巅峰家族-排行榜
  14. /// @param activityId 活动id
  15. /// @param successHandler 请求成功
  16. /// @param failureHandler 请求失败
  17. - (NSNumber *)getPeakFamilyRankWithActivityId:(NSString *)activityId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  18. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  19. config.urlPath = [ACTIVITY_GET_PEAK_FAMILY_RANK copy];
  20. config.instructions = @"巅峰家族-排行榜";
  21. config.requestType = ZYLNetworkRequestTypeGet;
  22. config.requestParameters = @{@"activityId":activityId};
  23. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  24. }
  25. /// 魅力花房-房间排行信息获取
  26. /// @param activityId 活动id
  27. /// @param successHandler 请求成功
  28. /// @param failureHandler 请求失败
  29. - (NSNumber *)getFlowerRoomRankWithActivityId:(NSString *)activityId subActivityId:(NSString *)subActivityId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  30. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  31. config.urlPath = [ACTIVITY_GET_FLOWER_ROOM_RANK copy];
  32. config.instructions = @"魅力花房-房间排行信息获取";
  33. if (StringIsEmpty(subActivityId)) {
  34. config.requestParameters = @{@"activityId":activityId};
  35. }else {
  36. config.requestParameters = @{@"activityId":activityId, @"subActivityId":subActivityId};
  37. }
  38. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  39. }
  40. @end