// // XYLotteryGameAPIManager.m // Timi // // Created by gy on 2021/11/26. // #import "XYLotteryGameAPIManager.h" static NSString * const getLotteryGameDetailPath = @"api-app/v1/lotteryGame/getLotteryGameDetail"; static NSString * const joinLotteryGamePath = @"api-app/v1/lotteryGame/joinLotteryGame"; static NSString * const getResultByRedBagPath = @"api-app/v1/lotteryGame/getResultByRedBag"; static NSString * const getLotteryGameListPath = @"api-app/v1/lotteryGame/getLotteryGameList"; @interface XYLotteryGameAPIManager(){ } @end @implementation XYLotteryGameAPIManager /// 获取抽奖游戏详情 GET/api-app/v1/lotteryGame/getLotteryGameDetail /// snapId 是 快照id - (NSNumber *)getLotteryGameDetail:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{ ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new]; config.urlPath = [getLotteryGameDetailPath copy]; config.instructions = @"获取抽奖游戏详情"; config.requestType = ZYLNetworkRequestTypeGet; config.requestParameters = paramDict; return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler]; } /// 参与抽奖游戏 POST/api-app/v1/lotteryGame/joinLotteryGame /// snapId 文本 是 快照id - (NSNumber *)joinLotteryGame:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{ ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new]; config.urlPath = [joinLotteryGamePath copy]; config.instructions = @"参与抽奖游戏"; config.requestType = ZYLNetworkRequestTypePost; config.requestParameters = paramDict; return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler]; } /// 查询抽奖游戏开奖结果-红包 GET/api-app/v1/lotteryGame/getResultByRedBag /// snapId 是 快照id - (NSNumber *)getResultByRedBag:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{ ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new]; config.urlPath = [getResultByRedBagPath copy]; config.instructions = @"查询抽奖游戏开奖结果-红包"; config.requestType = ZYLNetworkRequestTypeGet; config.requestParameters = paramDict; return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler]; } /// 获取正在进行中的抽奖活动 POST /v1/lotteryGame/getLotteryGameList /// null - (NSNumber *)getLotteryGameList:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{ ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new]; config.urlPath = [getLotteryGameListPath copy]; config.instructions = @"获取正在进行中的抽奖活动"; config.requestType = ZYLNetworkRequestTypePost; config.requestParameters = paramDict; return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler]; } @end