XYLotteryGameAPIManager.m 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //
  2. // XYLotteryGameAPIManager.m
  3. // Timi
  4. //
  5. // Created by gy on 2021/11/26.
  6. //
  7. #import "XYLotteryGameAPIManager.h"
  8. static NSString * const getLotteryGameDetailPath = @"api-app/v1/lotteryGame/getLotteryGameDetail";
  9. static NSString * const joinLotteryGamePath = @"api-app/v1/lotteryGame/joinLotteryGame";
  10. static NSString * const getResultByRedBagPath = @"api-app/v1/lotteryGame/getResultByRedBag";
  11. static NSString * const getLotteryGameListPath = @"api-app/v1/lotteryGame/getLotteryGameList";
  12. @interface XYLotteryGameAPIManager(){
  13. }
  14. @end
  15. @implementation XYLotteryGameAPIManager
  16. /// 获取抽奖游戏详情 GET/api-app/v1/lotteryGame/getLotteryGameDetail
  17. /// snapId 是 快照id
  18. - (NSNumber *)getLotteryGameDetail:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  19. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  20. config.urlPath = [getLotteryGameDetailPath copy];
  21. config.instructions = @"获取抽奖游戏详情";
  22. config.requestType = ZYLNetworkRequestTypeGet;
  23. config.requestParameters = paramDict;
  24. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  25. }
  26. /// 参与抽奖游戏 POST/api-app/v1/lotteryGame/joinLotteryGame
  27. /// snapId 文本 是 快照id
  28. - (NSNumber *)joinLotteryGame:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  29. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  30. config.urlPath = [joinLotteryGamePath copy];
  31. config.instructions = @"参与抽奖游戏";
  32. config.requestType = ZYLNetworkRequestTypePost;
  33. config.requestParameters = paramDict;
  34. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  35. }
  36. /// 查询抽奖游戏开奖结果-红包 GET/api-app/v1/lotteryGame/getResultByRedBag
  37. /// snapId 是 快照id
  38. - (NSNumber *)getResultByRedBag:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  39. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  40. config.urlPath = [getResultByRedBagPath copy];
  41. config.instructions = @"查询抽奖游戏开奖结果-红包";
  42. config.requestType = ZYLNetworkRequestTypeGet;
  43. config.requestParameters = paramDict;
  44. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  45. }
  46. /// 获取正在进行中的抽奖活动 POST /v1/lotteryGame/getLotteryGameList
  47. /// null
  48. - (NSNumber *)getLotteryGameList:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  49. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  50. config.urlPath = [getLotteryGameListPath copy];
  51. config.instructions = @"获取正在进行中的抽奖活动";
  52. config.requestType = ZYLNetworkRequestTypePost;
  53. config.requestParameters = paramDict;
  54. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  55. }
  56. @end