123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482 |
- //
- // XYLiveRoomAPIManager.m
- // Starbuds
- //
- // Created by pajia on 2020/1/7.
- // Copyright © 2020 翟玉磊. All rights reserved.
- //
- #import "XYLiveRoomAPIManager.h"
- static NSString * const liveStartLivePath = @"api-app/v1/live/startLive";
- static NSString * const liveResumeLivePath = @"api-app/v1/live/resumeLive";
- static NSString * const liveStopLivePath = @"api-app/v1/live/stopLive";
- static NSString * const anchorEditAnchorInfoPath = @"api-app/v1/anchor/editAnchorInfo";
- static NSString * const anchorAddMasterPath = @"api-app/v1/anchor/addMaster";
- static NSString * const anchorRemoveMasterPath = @"api-app/v1/anchor/removeMaster";
- static NSString * const anchorAnchorGetMastersPath = @"api-app/v1/anchor/getMasters";
- static NSString * const anchorForbiddenWordsPath = @"api-app/v1/anchor/forbiddenWords";
- static NSString * const anchorEnableWordsPath = @"api-app/v1/anchor/enableWords";
- static NSString * const getScoreLevelInfoPath = @"api-app/v1/user/getScoreLevelInfo";
- static NSString * const liveGetLiveInfoPath = @"api-app/v1/live/getLiveInfo";
- static NSString * const giftGetGiftsPath = @"api-app/v1/gift/getGifts";
- static NSString * const getUserVirtualWalletPath = @"api-app/v1/wallet/getUserVirtualWallet";
- static NSString * const giftSendGiftPath = @"api-app/v1/gift/sendGift";
- static NSString * const configGetGiftAnimationsPath = @"api-app/v1/config/getAnimations";
- static NSString * const configGetGiftTagsPath = @"api-app/v1/config/getGiftTags";
- static NSString * const bagGetGiftListPath = @"api-app/v1/bag/getGiftList";
- static NSString * const getLiveActivitiesPath = @"api-app/v1/activity/getLiveActivities";
- static NSString * const getChatRoomActivitiesPath = @"api-app/v1/activity/getRtcActivities";
- static NSString * const getGiftPath = @"api-app/v1/gift/getGift";
- static NSString * const addBlackPath = @"api-app/v1/anchor/addBlack";
- static NSString * const removeBlackPath = @"api-app/v1/anchor/removeBlack";
- static NSString * const getBlackListPath = @"api-app/v1/anchor/getBlackList";
- static NSString * const anchorDisableAnchorPath = @"api-app/v1/anchor/disableAnchor";
- static NSString * const anchorGetForbiddenUsersPath = @"api-app/v1/anchor/getForbiddenUsers";
- static NSString * const liveGetUsersPath = @"api-app/v1/live/getUsers";
- static NSString * const getSingleChatRandomPath = @"api-app/v1/chat/getSingleChatRandom";
- static NSString * const getSingleChatNearbyListPath = @"api-app/v1/chat/getSingleChatNearbyList";
- static NSString * const getSingleChatMatchedHisPath = @"api-app/v1/chat/getSingleChatMatchedHis";
- static NSString * const getBattleInvitePath = @"api-app/v1/battle/invite";
- static NSString * const getBattleJoinInviteCancelPath = @"api-app/v1/battle/inviteCancel";
- static NSString * const getBattleInviteDecidePath = @"api-app/v1/battle/inviteDecide";
- static NSString * const getBattleJoinBattleRoomPath = @"api-app/v1/battle/joinBattleRoom";
- static NSString * const getBattleCloseBattlePath = @"api-app/v1/battle/closeBattle";
- static NSString * const getBattleSurrenderBattlePath = @"api-app/v1/battle/surrenderBattle";
- static NSString * const getBubbleListPath = @"api-app/v1/config/getBubbleList";
- static NSString * const getMetalListPath = @"api-app/v1/config/getMedalList";
- static NSString * const getActivitiesMedalListPath = @"api-app/v1/config/getActivitiesMedalList";
- @interface XYLiveRoomAPIManager(){
-
- }
- @end
- @implementation XYLiveRoomAPIManager
- - (NSNumber *)getLiveStartLive:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [liveStartLivePath copy];
- config.instructions = liveStartLivePath;
- config.requestType = ZYLNetworkRequestTypePost;
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- //Body categoryId 直播分类
- //Body liveTitle 直播标题
- //Body liveCover 直播封面
- - (NSNumber *)liveResumeLive:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [liveResumeLivePath copy];
- config.instructions = liveResumeLivePath;
- config.requestType = ZYLNetworkRequestTypePost;
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- //Body liveHisId 直播记录 id Long
- - (NSNumber *)liveStopLive:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [liveStopLivePath copy];
- config.instructions = liveStopLivePath;
- config.requestType = ZYLNetworkRequestTypePost;
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- //Body categoryId 直播分类
- //Body liveTitle 直播标题
- //Body liveCover 直播封面
- - (NSNumber *)anchorEditAnchorInfo:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [anchorEditAnchorInfoPath copy];
- config.instructions = anchorEditAnchorInfoPath;
- config.requestType = ZYLNetworkRequestTypePost;
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- //Body userId 要添加的用户 id Long
- - (NSNumber *)anchorAddMaster:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [anchorAddMasterPath copy];
- config.instructions = anchorAddMasterPath;
- config.requestType = ZYLNetworkRequestTypePost;
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- //Body userId 要取消的用户 id Long
- - (NSNumber *)anchorRemoveMaster:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [anchorRemoveMasterPath copy];
- config.instructions = anchorRemoveMasterPath;
- config.requestType = ZYLNetworkRequestTypePost;
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- //
- - (NSNumber *)anchorGetMasters:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [anchorAnchorGetMastersPath copy];
- config.instructions = anchorAnchorGetMastersPath;
- config.requestType = ZYLNetworkRequestTypeGet;
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- //Body anchorUserId 主播 id Long
- //Body targetUserId 目标用户 id Long
- //Body remarks 禁言备注 String
- //Body optionId 禁言选项 id Long
- - (NSNumber *)anchorForbiddenWords:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [anchorForbiddenWordsPath copy];
- config.instructions = anchorForbiddenWordsPath;
- config.requestType = ZYLNetworkRequestTypePost;
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- //Body anchorUserId 主播 id Long
- //Body targetUserId 目标用户 id Long
- //Body remarks 备注 String
- - (NSNumber *)anchorEnableWords:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [anchorEnableWordsPath copy];
- config.instructions = anchorEnableWordsPath;
- config.requestType = ZYLNetworkRequestTypePost;
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- ////Query scoreType 积分类型 Integer
- - (NSNumber *)getScoreLevelInfo:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [getScoreLevelInfoPath copy];
- config.instructions = getScoreLevelInfoPath;
- config.requestType = ZYLNetworkRequestTypeGet;
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- - (NSNumber *)getliveGetLiveInfo:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [liveGetLiveInfoPath copy];
- config.instructions = liveGetLiveInfoPath;
- config.requestType = ZYLNetworkRequestTypeGet;
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- - (NSNumber *)getGiftGetGifts:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [giftGetGiftsPath copy];
- config.instructions = giftGetGiftsPath;
- config.requestType = ZYLNetworkRequestTypeGet;
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- - (NSNumber *)getUserVirtualWallet:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [getUserVirtualWalletPath copy];
- config.instructions = getUserVirtualWalletPath;
- config.requestType = ZYLNetworkRequestTypeGet;
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- - (NSNumber *)getGiftSendGift:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [giftSendGiftPath copy];
- config.instructions = giftSendGiftPath;
- config.requestType = ZYLNetworkRequestTypePost;
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- - (NSNumber *)configGetGiftAnimations:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [configGetGiftAnimationsPath copy];
- config.instructions = configGetGiftAnimationsPath;
- config.requestType = ZYLNetworkRequestTypeGet;
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- - (NSNumber *)configGetGiftTags:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [configGetGiftTagsPath copy];
- config.instructions = configGetGiftTagsPath;
- config.requestType = ZYLNetworkRequestTypeGet;
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- - (NSNumber *)bagGetGiftList:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [bagGetGiftListPath copy];
- config.instructions = bagGetGiftListPath;
- config.requestType = ZYLNetworkRequestTypeGet;
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- - (NSNumber *)getLiveActivities:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [getLiveActivitiesPath copy];
- config.instructions = getLiveActivitiesPath;
- config.requestType = ZYLNetworkRequestTypeGet;
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- - (NSNumber *)getChatRoomActivities:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [getChatRoomActivitiesPath copy];
- config.instructions = getChatRoomActivitiesPath;
- config.requestType = ZYLNetworkRequestTypeGet;
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- - (NSNumber *)bagGetGift:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [getGiftPath copy];
- config.instructions = getGiftPath;
- config.requestType = ZYLNetworkRequestTypeGet;
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 拉黑用户
- /// userId 拉黑用户id
- - (NSNumber *)addBlackWithUserId:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [addBlackPath copy];
- config.instructions = @"拉黑用户";
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 解除拉黑
- /// userId 拉黑用户id
- - (NSNumber *)removeBlackWithUserId:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [removeBlackPath copy];
- config.instructions = @"解除拉黑";
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 获取黑名单列表
- - (NSNumber *)getBlackListPageIndex:(NSInteger)pageIndex successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [getBlackListPath copy];
- config.instructions = @"获取黑名单列表";
- config.requestType = ZYLNetworkRequestTypeGet;
- config.requestParameters = @{@"pageIndex":@(pageIndex)};
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- - (NSNumber *)anchorDisableAnchor:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [anchorDisableAnchorPath copy];
- config.instructions = @"封禁主播";
- config.requestParameters = paramDict;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- - (NSNumber *)anchorGetForbiddenUsers:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [anchorGetForbiddenUsersPath copy];
- config.instructions = @"获取禁言用户列表";
- config.requestParameters = paramDict;
- config.requestType = ZYLNetworkRequestTypeGet;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- //paramDict userId 主播 id
- - (NSNumber *)liveGetUsers:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [liveGetUsersPath copy];
- config.instructions = @"获取在线用户";
- config.requestParameters = paramDict;
- config.requestType = ZYLNetworkRequestTypeGet;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- //Query userSex 性别筛选 Integer
- //Query categoryId 类目筛选 Long
- - (NSNumber *)getSingleChatRandom:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [getSingleChatRandomPath copy];
- config.instructions = @"随机获取单聊主播列表";
- config.requestParameters = paramDict;
- config.requestType = ZYLNetworkRequestTypeGet;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- //Query pageIndex 页码 Integer
- //Query userSex 性别 Integer
- //Query userAgeMin 最小年龄 Integer
- //Query userAgeMax 最大年龄 Integer
- //Query categoryId 类目id Long
- - (NSNumber *)getSingleChatNearbyList:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [getSingleChatNearbyListPath copy];
- config.instructions = @"获取附近单聊主播列表";
- config.requestParameters = paramDict;
- config.requestType = ZYLNetworkRequestTypeGet;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- - (NSNumber *)getSingleChatMatchedHis:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [getSingleChatMatchedHisPath copy];
- config.instructions = @"获取单聊匹配记录";
- config.requestParameters = paramDict;
- config.requestType = ZYLNetworkRequestTypeGet;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- //邀请 PK getBattleInvite api-app/v1/battle/invite
- //Body userId 对方主播 id Long
- - (NSNumber *)getBattleInvite:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [getBattleInvitePath copy];
- config.instructions = @"邀请 PK";
- config.requestParameters = paramDict;
- config.requestType = ZYLNetworkRequestTypePost;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- //取消邀请 api-app/v1/battle/inviteCancel
- //Body battleId pkid String
- - (NSNumber *)getBattleJoinInviteCancel:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [getBattleJoinInviteCancelPath copy];
- config.instructions = @"取消邀请";
- config.requestParameters = paramDict;
- config.requestType = ZYLNetworkRequestTypePost;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- //决策邀请 api-app/v1/battle/inviteDecide
- //Body battleId pkid String
- //Body decision 决定 0 拒绝 1 接受 Integer
- - (NSNumber *)getBattleInviteDecide:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [getBattleInviteDecidePath copy];
- config.instructions = @"决策邀请";
- config.requestParameters = paramDict;
- config.requestType = ZYLNetworkRequestTypePost;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- //加入PK房间 api-app/v1/battle/joinBattleRoom
- //Body battleId pkid String
- - (NSNumber *)getBattleJoinBattleRoom:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [getBattleJoinBattleRoomPath copy];
- config.instructions = @"加入PK房间";
- config.requestParameters = paramDict;
- config.requestType = ZYLNetworkRequestTypePost;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- //结束 PK api-app/v1/battle/closeBattle
- //Body battleId pkid String
- - (NSNumber *)getBattleCloseBattle:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [getBattleCloseBattlePath copy];
- config.instructions = @"结束 PK";
- config.requestParameters = paramDict;
- config.requestType = ZYLNetworkRequestTypePost;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- //认输 PK api-app/v1/battle/surrenderBattle
- //Body battleId String
- - (NSNumber *)getBattleSurrenderBattle:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler
- failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [getBattleSurrenderBattlePath copy];
- config.instructions = @"认输 PK";
- config.requestParameters = paramDict;
- config.requestType = ZYLNetworkRequestTypePost;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- //获取聊天气泡列表 GET api-app/v1/config/getBubbleList
- - (NSNumber *)getBubbleList:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [getBubbleListPath copy];
- config.instructions = @"获取聊天气泡列表";
- config.requestParameters = paramDict;
- config.requestType = ZYLNetworkRequestTypeGet;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- //获取勋章列表 GET api-app/v1/config/getMedalList
- - (NSNumber *)getMetalList:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [getMetalListPath copy];
- config.instructions = @"获取勋章列表";
- config.requestParameters = paramDict;
- config.requestType = ZYLNetworkRequestTypeGet;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 获取活动勋章配置列表 GET v1/config/getActivitiesMedalList
- - (NSNumber *)getActivitiesMedalList:(nullable NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [getActivitiesMedalListPath copy];
- config.instructions = @"获取活动勋章配置列表";
- config.requestParameters = paramDict;
- config.requestType = ZYLNetworkRequestTypeGet;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- @end
|