XYLiveRoomAPIManager.m 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. //
  2. // XYLiveRoomAPIManager.m
  3. // Starbuds
  4. //
  5. // Created by pajia on 2020/1/7.
  6. // Copyright © 2020 翟玉磊. All rights reserved.
  7. //
  8. #import "XYLiveRoomAPIManager.h"
  9. static NSString * const liveStartLivePath = @"api-app/v1/live/startLive";
  10. static NSString * const liveResumeLivePath = @"api-app/v1/live/resumeLive";
  11. static NSString * const liveStopLivePath = @"api-app/v1/live/stopLive";
  12. static NSString * const anchorEditAnchorInfoPath = @"api-app/v1/anchor/editAnchorInfo";
  13. static NSString * const anchorAddMasterPath = @"api-app/v1/anchor/addMaster";
  14. static NSString * const anchorRemoveMasterPath = @"api-app/v1/anchor/removeMaster";
  15. static NSString * const anchorAnchorGetMastersPath = @"api-app/v1/anchor/getMasters";
  16. static NSString * const anchorForbiddenWordsPath = @"api-app/v1/anchor/forbiddenWords";
  17. static NSString * const anchorEnableWordsPath = @"api-app/v1/anchor/enableWords";
  18. static NSString * const getScoreLevelInfoPath = @"api-app/v1/user/getScoreLevelInfo";
  19. static NSString * const liveGetLiveInfoPath = @"api-app/v1/live/getLiveInfo";
  20. static NSString * const giftGetGiftsPath = @"api-app/v1/gift/getGifts";
  21. static NSString * const getUserVirtualWalletPath = @"api-app/v1/wallet/getUserVirtualWallet";
  22. static NSString * const giftSendGiftPath = @"api-app/v1/gift/sendGift";
  23. static NSString * const configGetGiftAnimationsPath = @"api-app/v1/config/getAnimations";
  24. static NSString * const configGetGiftTagsPath = @"api-app/v1/config/getGiftTags";
  25. static NSString * const bagGetGiftListPath = @"api-app/v1/bag/getGiftList";
  26. static NSString * const getLiveActivitiesPath = @"api-app/v1/activity/getLiveActivities";
  27. static NSString * const getChatRoomActivitiesPath = @"api-app/v1/activity/getRtcActivities";
  28. static NSString * const getGiftPath = @"api-app/v1/gift/getGift";
  29. static NSString * const addBlackPath = @"api-app/v1/anchor/addBlack";
  30. static NSString * const removeBlackPath = @"api-app/v1/anchor/removeBlack";
  31. static NSString * const getBlackListPath = @"api-app/v1/anchor/getBlackList";
  32. static NSString * const anchorDisableAnchorPath = @"api-app/v1/anchor/disableAnchor";
  33. static NSString * const anchorGetForbiddenUsersPath = @"api-app/v1/anchor/getForbiddenUsers";
  34. static NSString * const liveGetUsersPath = @"api-app/v1/live/getUsers";
  35. static NSString * const getSingleChatRandomPath = @"api-app/v1/chat/getSingleChatRandom";
  36. static NSString * const getSingleChatNearbyListPath = @"api-app/v1/chat/getSingleChatNearbyList";
  37. static NSString * const getSingleChatMatchedHisPath = @"api-app/v1/chat/getSingleChatMatchedHis";
  38. static NSString * const getBattleInvitePath = @"api-app/v1/battle/invite";
  39. static NSString * const getBattleJoinInviteCancelPath = @"api-app/v1/battle/inviteCancel";
  40. static NSString * const getBattleInviteDecidePath = @"api-app/v1/battle/inviteDecide";
  41. static NSString * const getBattleJoinBattleRoomPath = @"api-app/v1/battle/joinBattleRoom";
  42. static NSString * const getBattleCloseBattlePath = @"api-app/v1/battle/closeBattle";
  43. static NSString * const getBattleSurrenderBattlePath = @"api-app/v1/battle/surrenderBattle";
  44. static NSString * const getBubbleListPath = @"api-app/v1/config/getBubbleList";
  45. static NSString * const getMetalListPath = @"api-app/v1/config/getMedalList";
  46. static NSString * const getActivitiesMedalListPath = @"api-app/v1/config/getActivitiesMedalList";
  47. @interface XYLiveRoomAPIManager(){
  48. }
  49. @end
  50. @implementation XYLiveRoomAPIManager
  51. - (NSNumber *)getLiveStartLive:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  52. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  53. config.urlPath = [liveStartLivePath copy];
  54. config.instructions = liveStartLivePath;
  55. config.requestType = ZYLNetworkRequestTypePost;
  56. config.requestParameters = paramDict;
  57. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  58. }
  59. //Body categoryId 直播分类
  60. //Body liveTitle 直播标题
  61. //Body liveCover 直播封面
  62. - (NSNumber *)liveResumeLive:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  63. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  64. config.urlPath = [liveResumeLivePath copy];
  65. config.instructions = liveResumeLivePath;
  66. config.requestType = ZYLNetworkRequestTypePost;
  67. config.requestParameters = paramDict;
  68. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  69. }
  70. //Body liveHisId 直播记录 id Long
  71. - (NSNumber *)liveStopLive:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  72. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  73. config.urlPath = [liveStopLivePath copy];
  74. config.instructions = liveStopLivePath;
  75. config.requestType = ZYLNetworkRequestTypePost;
  76. config.requestParameters = paramDict;
  77. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  78. }
  79. //Body categoryId 直播分类
  80. //Body liveTitle 直播标题
  81. //Body liveCover 直播封面
  82. - (NSNumber *)anchorEditAnchorInfo:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  83. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  84. config.urlPath = [anchorEditAnchorInfoPath copy];
  85. config.instructions = anchorEditAnchorInfoPath;
  86. config.requestType = ZYLNetworkRequestTypePost;
  87. config.requestParameters = paramDict;
  88. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  89. }
  90. //Body userId 要添加的用户 id Long
  91. - (NSNumber *)anchorAddMaster:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  92. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  93. config.urlPath = [anchorAddMasterPath copy];
  94. config.instructions = anchorAddMasterPath;
  95. config.requestType = ZYLNetworkRequestTypePost;
  96. config.requestParameters = paramDict;
  97. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  98. }
  99. //Body userId 要取消的用户 id Long
  100. - (NSNumber *)anchorRemoveMaster:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  101. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  102. config.urlPath = [anchorRemoveMasterPath copy];
  103. config.instructions = anchorRemoveMasterPath;
  104. config.requestType = ZYLNetworkRequestTypePost;
  105. config.requestParameters = paramDict;
  106. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  107. }
  108. //
  109. - (NSNumber *)anchorGetMasters:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  110. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  111. config.urlPath = [anchorAnchorGetMastersPath copy];
  112. config.instructions = anchorAnchorGetMastersPath;
  113. config.requestType = ZYLNetworkRequestTypeGet;
  114. config.requestParameters = paramDict;
  115. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  116. }
  117. //Body anchorUserId 主播 id Long
  118. //Body targetUserId 目标用户 id Long
  119. //Body remarks 禁言备注 String
  120. //Body optionId 禁言选项 id Long
  121. - (NSNumber *)anchorForbiddenWords:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  122. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  123. config.urlPath = [anchorForbiddenWordsPath copy];
  124. config.instructions = anchorForbiddenWordsPath;
  125. config.requestType = ZYLNetworkRequestTypePost;
  126. config.requestParameters = paramDict;
  127. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  128. }
  129. //Body anchorUserId 主播 id Long
  130. //Body targetUserId 目标用户 id Long
  131. //Body remarks 备注 String
  132. - (NSNumber *)anchorEnableWords:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  133. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  134. config.urlPath = [anchorEnableWordsPath copy];
  135. config.instructions = anchorEnableWordsPath;
  136. config.requestType = ZYLNetworkRequestTypePost;
  137. config.requestParameters = paramDict;
  138. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  139. }
  140. ////Query scoreType 积分类型 Integer
  141. - (NSNumber *)getScoreLevelInfo:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  142. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  143. config.urlPath = [getScoreLevelInfoPath copy];
  144. config.instructions = getScoreLevelInfoPath;
  145. config.requestType = ZYLNetworkRequestTypeGet;
  146. config.requestParameters = paramDict;
  147. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  148. }
  149. - (NSNumber *)getliveGetLiveInfo:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  150. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  151. config.urlPath = [liveGetLiveInfoPath copy];
  152. config.instructions = liveGetLiveInfoPath;
  153. config.requestType = ZYLNetworkRequestTypeGet;
  154. config.requestParameters = paramDict;
  155. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  156. }
  157. - (NSNumber *)getGiftGetGifts:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  158. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  159. config.urlPath = [giftGetGiftsPath copy];
  160. config.instructions = giftGetGiftsPath;
  161. config.requestType = ZYLNetworkRequestTypeGet;
  162. config.requestParameters = paramDict;
  163. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  164. }
  165. - (NSNumber *)getUserVirtualWallet:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  166. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  167. config.urlPath = [getUserVirtualWalletPath copy];
  168. config.instructions = getUserVirtualWalletPath;
  169. config.requestType = ZYLNetworkRequestTypeGet;
  170. config.requestParameters = paramDict;
  171. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  172. }
  173. - (NSNumber *)getGiftSendGift:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  174. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  175. config.urlPath = [giftSendGiftPath copy];
  176. config.instructions = giftSendGiftPath;
  177. config.requestType = ZYLNetworkRequestTypePost;
  178. config.requestParameters = paramDict;
  179. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  180. }
  181. - (NSNumber *)configGetGiftAnimations:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  182. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  183. config.urlPath = [configGetGiftAnimationsPath copy];
  184. config.instructions = configGetGiftAnimationsPath;
  185. config.requestType = ZYLNetworkRequestTypeGet;
  186. config.requestParameters = paramDict;
  187. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  188. }
  189. - (NSNumber *)configGetGiftTags:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  190. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  191. config.urlPath = [configGetGiftTagsPath copy];
  192. config.instructions = configGetGiftTagsPath;
  193. config.requestType = ZYLNetworkRequestTypeGet;
  194. config.requestParameters = paramDict;
  195. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  196. }
  197. - (NSNumber *)bagGetGiftList:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  198. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  199. config.urlPath = [bagGetGiftListPath copy];
  200. config.instructions = bagGetGiftListPath;
  201. config.requestType = ZYLNetworkRequestTypeGet;
  202. config.requestParameters = paramDict;
  203. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  204. }
  205. - (NSNumber *)getLiveActivities:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  206. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  207. config.urlPath = [getLiveActivitiesPath copy];
  208. config.instructions = getLiveActivitiesPath;
  209. config.requestType = ZYLNetworkRequestTypeGet;
  210. config.requestParameters = paramDict;
  211. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  212. }
  213. - (NSNumber *)getChatRoomActivities:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  214. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  215. config.urlPath = [getChatRoomActivitiesPath copy];
  216. config.instructions = getChatRoomActivitiesPath;
  217. config.requestType = ZYLNetworkRequestTypeGet;
  218. config.requestParameters = paramDict;
  219. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  220. }
  221. - (NSNumber *)bagGetGift:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  222. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  223. config.urlPath = [getGiftPath copy];
  224. config.instructions = getGiftPath;
  225. config.requestType = ZYLNetworkRequestTypeGet;
  226. config.requestParameters = paramDict;
  227. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  228. }
  229. /// 拉黑用户
  230. /// userId 拉黑用户id
  231. - (NSNumber *)addBlackWithUserId:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  232. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  233. config.urlPath = [addBlackPath copy];
  234. config.instructions = @"拉黑用户";
  235. config.requestParameters = paramDict;
  236. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  237. }
  238. /// 解除拉黑
  239. /// userId 拉黑用户id
  240. - (NSNumber *)removeBlackWithUserId:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  241. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  242. config.urlPath = [removeBlackPath copy];
  243. config.instructions = @"解除拉黑";
  244. config.requestParameters = paramDict;
  245. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  246. }
  247. /// 获取黑名单列表
  248. - (NSNumber *)getBlackListPageIndex:(NSInteger)pageIndex successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  249. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  250. config.urlPath = [getBlackListPath copy];
  251. config.instructions = @"获取黑名单列表";
  252. config.requestType = ZYLNetworkRequestTypeGet;
  253. config.requestParameters = @{@"pageIndex":@(pageIndex)};
  254. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  255. }
  256. - (NSNumber *)anchorDisableAnchor:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  257. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  258. config.urlPath = [anchorDisableAnchorPath copy];
  259. config.instructions = @"封禁主播";
  260. config.requestParameters = paramDict;
  261. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  262. }
  263. - (NSNumber *)anchorGetForbiddenUsers:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  264. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  265. config.urlPath = [anchorGetForbiddenUsersPath copy];
  266. config.instructions = @"获取禁言用户列表";
  267. config.requestParameters = paramDict;
  268. config.requestType = ZYLNetworkRequestTypeGet;
  269. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  270. }
  271. //paramDict userId 主播 id
  272. - (NSNumber *)liveGetUsers:(NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  273. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  274. config.urlPath = [liveGetUsersPath copy];
  275. config.instructions = @"获取在线用户";
  276. config.requestParameters = paramDict;
  277. config.requestType = ZYLNetworkRequestTypeGet;
  278. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  279. }
  280. //Query userSex 性别筛选 Integer
  281. //Query categoryId 类目筛选 Long
  282. - (NSNumber *)getSingleChatRandom:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  283. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  284. config.urlPath = [getSingleChatRandomPath copy];
  285. config.instructions = @"随机获取单聊主播列表";
  286. config.requestParameters = paramDict;
  287. config.requestType = ZYLNetworkRequestTypeGet;
  288. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  289. }
  290. //Query pageIndex 页码 Integer
  291. //Query userSex 性别 Integer
  292. //Query userAgeMin 最小年龄 Integer
  293. //Query userAgeMax 最大年龄 Integer
  294. //Query categoryId 类目id Long
  295. - (NSNumber *)getSingleChatNearbyList:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  296. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  297. config.urlPath = [getSingleChatNearbyListPath copy];
  298. config.instructions = @"获取附近单聊主播列表";
  299. config.requestParameters = paramDict;
  300. config.requestType = ZYLNetworkRequestTypeGet;
  301. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  302. }
  303. - (NSNumber *)getSingleChatMatchedHis:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  304. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  305. config.urlPath = [getSingleChatMatchedHisPath copy];
  306. config.instructions = @"获取单聊匹配记录";
  307. config.requestParameters = paramDict;
  308. config.requestType = ZYLNetworkRequestTypeGet;
  309. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  310. }
  311. //邀请 PK getBattleInvite api-app/v1/battle/invite
  312. //Body userId 对方主播 id Long
  313. - (NSNumber *)getBattleInvite:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  314. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  315. config.urlPath = [getBattleInvitePath copy];
  316. config.instructions = @"邀请 PK";
  317. config.requestParameters = paramDict;
  318. config.requestType = ZYLNetworkRequestTypePost;
  319. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  320. }
  321. //取消邀请 api-app/v1/battle/inviteCancel
  322. //Body battleId pkid String
  323. - (NSNumber *)getBattleJoinInviteCancel:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  324. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  325. config.urlPath = [getBattleJoinInviteCancelPath copy];
  326. config.instructions = @"取消邀请";
  327. config.requestParameters = paramDict;
  328. config.requestType = ZYLNetworkRequestTypePost;
  329. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  330. }
  331. //决策邀请 api-app/v1/battle/inviteDecide
  332. //Body battleId pkid String
  333. //Body decision 决定 0 拒绝 1 接受 Integer
  334. - (NSNumber *)getBattleInviteDecide:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  335. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  336. config.urlPath = [getBattleInviteDecidePath copy];
  337. config.instructions = @"决策邀请";
  338. config.requestParameters = paramDict;
  339. config.requestType = ZYLNetworkRequestTypePost;
  340. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  341. }
  342. //加入PK房间 api-app/v1/battle/joinBattleRoom
  343. //Body battleId pkid String
  344. - (NSNumber *)getBattleJoinBattleRoom:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  345. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  346. config.urlPath = [getBattleJoinBattleRoomPath copy];
  347. config.instructions = @"加入PK房间";
  348. config.requestParameters = paramDict;
  349. config.requestType = ZYLNetworkRequestTypePost;
  350. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  351. }
  352. //结束 PK api-app/v1/battle/closeBattle
  353. //Body battleId pkid String
  354. - (NSNumber *)getBattleCloseBattle:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  355. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  356. config.urlPath = [getBattleCloseBattlePath copy];
  357. config.instructions = @"结束 PK";
  358. config.requestParameters = paramDict;
  359. config.requestType = ZYLNetworkRequestTypePost;
  360. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  361. }
  362. //认输 PK api-app/v1/battle/surrenderBattle
  363. //Body battleId String
  364. - (NSNumber *)getBattleSurrenderBattle:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler
  365. failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  366. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  367. config.urlPath = [getBattleSurrenderBattlePath copy];
  368. config.instructions = @"认输 PK";
  369. config.requestParameters = paramDict;
  370. config.requestType = ZYLNetworkRequestTypePost;
  371. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  372. }
  373. //获取聊天气泡列表 GET api-app/v1/config/getBubbleList
  374. - (NSNumber *)getBubbleList:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  375. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  376. config.urlPath = [getBubbleListPath copy];
  377. config.instructions = @"获取聊天气泡列表";
  378. config.requestParameters = paramDict;
  379. config.requestType = ZYLNetworkRequestTypeGet;
  380. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  381. }
  382. //获取勋章列表 GET api-app/v1/config/getMedalList
  383. - (NSNumber *)getMetalList:(NSDictionary *__nullable)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  384. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  385. config.urlPath = [getMetalListPath copy];
  386. config.instructions = @"获取勋章列表";
  387. config.requestParameters = paramDict;
  388. config.requestType = ZYLNetworkRequestTypeGet;
  389. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  390. }
  391. /// 获取活动勋章配置列表 GET v1/config/getActivitiesMedalList
  392. - (NSNumber *)getActivitiesMedalList:(nullable NSDictionary *)paramDict successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  393. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  394. config.urlPath = [getActivitiesMedalListPath copy];
  395. config.instructions = @"获取活动勋章配置列表";
  396. config.requestParameters = paramDict;
  397. config.requestType = ZYLNetworkRequestTypeGet;
  398. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  399. }
  400. @end