XYFamilyAPIManager.m 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. //
  2. // XYFamilyAPIManager.m
  3. // Starbuds
  4. //
  5. // Created by 翟玉磊 on 2020/10/26.
  6. // Copyright © 2020 翟玉磊. All rights reserved.
  7. //
  8. #import "XYFamilyAPIManager.h"
  9. /// 下单
  10. static NSString * const FAMILY_ADD_ORDER = @"api-app/v1/family/addOrder";
  11. /// 取消支付
  12. static NSString * const FAMILY_CANCEL_PAY = @"api-app/v1/family/cancelPay";
  13. /// 开始服务
  14. static NSString * const FAMILY_START_SERVICE = @"api-app/v1/family/startService";
  15. /// 技能设置
  16. static NSString * const FAMILY_SET_SKILL = @"api-app/v1/family/setSkill";
  17. /// 拒单
  18. static NSString * const FAMILY_REJECT_ORDER = @"api-app/v1/family/rejectOrder";
  19. /// 接单
  20. static NSString * const FAMILY_RECEIVE_ORDER = @"api-app/v1/family/receiveOrder";
  21. /// 支付订单
  22. static NSString * const FAMILY_PAY_ORDER = @"api-app/v1/family/payOrder";
  23. /// 添加家族签约/解约
  24. static NSString * const FAMILY_ADD_FAMILY_AUDIT = @"api-app/v1/family/addFamilyAudit";
  25. /// 添加技能认证
  26. static NSString * const FAMILY_ADD_SKILL_AUDIT = @"api-app/v1/family/addSkillAudit";
  27. /// 确认完成
  28. static NSString * const FAMILY_CONFIRM_SERVICE = @"api-app/v1/family/confirmService";
  29. /// 获取家族列表
  30. static NSString * const FAMILY_GET_FAMILY_LIST = @"api-app/v1/family/getFamilyList";
  31. /// 获取家族详情
  32. static NSString * const FAMILY_GET_FAMILY_DETAIL = @"api-app/v1/family/getFamilyDetail";
  33. /// 获取已提交的技能列表
  34. static NSString * const FAMILY_GET_SKILLS_SUBMIT = @"api-app/v1/family/getSkillsSubmit";
  35. /// 获取已认证的技能列表
  36. static NSString * const FAMILY_GET_SKILLS_AUTH = @"api-app/v1/family/getSkillsAuth";
  37. /// 获取技能用户列表
  38. static NSString * const FAMILY_GET_SKILL_USER_LIST = @"api-app/v1/family/getSkillUserList";
  39. ///获取推荐技能用户列表
  40. static NSString * const FAMILY_GET_RECOMMEND_SKILL_USER_LIST = @"api-app/v1/family/getRecommendSkillUserList";
  41. ///获取开黑头条
  42. static NSString * const FAMILY_GET_PLAY_TOP = @"api-app/v1/family/getPlayTop";
  43. /// 获取技能设置
  44. static NSString * const FAMILY_GET_SKILL = @"api-app/v1/family/getSkill";
  45. /// 获取接单记录
  46. static NSString * const FAMILY_GET_ORDER_RECEIVE_LIST = @"api-app/v1/family/getOrderReceiveList";
  47. /// 获取点单记录
  48. static NSString * const FAMILY_GET_ORDER_PAY_LIST = @"api-app/v1/family/getOrderPayList";
  49. /// 获取订单详情
  50. static NSString * const FAMILY_GET_ORDER_DETAIL = @"api-app/v1/family/getOrderDetail";
  51. /// 获取我的家族及签约状态
  52. static NSString * const FAMILY_GET_FAMILY = @"api-app/v1/family/getFamily";
  53. /// 获取用户技能详情
  54. static NSString * const FAMILY_GET_SKILL_USER_DETAIL = @"api-app/v1/family/getSkillUserDetail";
  55. /// 强制解约家族
  56. static NSString * const FAMILY_FORCE_LEAVE = @"api-app/v1/family/forceLeave";
  57. @implementation XYFamilyAPIManager
  58. /// 下单
  59. /// @param receiveUserId 接单人的用户id
  60. /// @param skillId 技能id
  61. /// @param quantity 数量
  62. /// @param remark 备注
  63. /// @param requireTime 要求服务时间
  64. /// @param successHandler 请求成功
  65. /// @param failureHandler 请求失败
  66. - (NSNumber *)addOrderWithReceiveUserId:(NSString *)receiveUserId skillId:(NSString *)skillId quantity:(NSInteger)quantity remark:(NSString *)remark requireTime:(NSString *)requireTime successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  67. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  68. config.urlPath = [FAMILY_ADD_ORDER copy];
  69. config.instructions = @"下单";
  70. NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
  71. if (requireTime.length == 10) {
  72. // 如果是秒级的时间戳这转成毫秒
  73. requireTime = [NSString stringWithFormat:@"%@000", requireTime];
  74. }
  75. [parameters addEntriesFromDictionary:@{@"receiveUserId":receiveUserId, @"skillId":skillId, @"quantity":@(quantity), @"requireTime":requireTime}];
  76. if (StringIsNotEmpty(remark)) {
  77. [parameters addEntriesFromDictionary:@{@"remark":remark}];
  78. }
  79. config.requestParameters = parameters;
  80. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  81. }
  82. /// 取消支付
  83. /// @param orderId 订单id
  84. /// @param successHandler 请求成功
  85. /// @param failureHandler 请求失败
  86. - (NSNumber *)cancelPayWithOrderId:(NSString *)orderId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  87. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  88. config.urlPath = [FAMILY_CANCEL_PAY copy];
  89. config.instructions = @"取消支付";
  90. config.requestParameters = @{@"orderId":orderId};
  91. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  92. }
  93. /// 开始服务
  94. /// @param orderId 订单id
  95. /// @param successHandler 请求成功
  96. /// @param failureHandler 请求失败
  97. - (NSNumber *)startServiceWithOrderId:(NSString *)orderId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  98. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  99. config.urlPath = [FAMILY_START_SERVICE copy];
  100. config.instructions = @"开始服务";
  101. config.requestParameters = @{@"orderId":orderId};
  102. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  103. }
  104. /// 技能设置
  105. /// @param skillId 技能id
  106. /// @param orderPrice 接单价格
  107. /// @param orderTime 接单时间 格式 hh:mm-hh:mm
  108. /// @param orderStatus 接单状态 1:接单 0:不接单
  109. /// @param successHandler 请求成功
  110. /// @param failureHandler 请求失败
  111. - (NSNumber *)setSkillWithSkillId:(NSString *)skillId orderPrice:(NSString *)orderPrice orderTime:(NSString *)orderTime orderStatus:(NSInteger)orderStatus successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  112. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  113. config.urlPath = [FAMILY_SET_SKILL copy];
  114. config.instructions = @"技能设置";
  115. config.requestParameters = @{@"skillId":skillId, @"orderPrice":orderPrice, @"orderTime":orderTime, @"orderStatus":@(orderStatus)};
  116. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  117. }
  118. /// 拒单
  119. /// @param orderId 订单id
  120. /// @param successHandler 请求成功
  121. /// @param failureHandler 请求失败
  122. - (NSNumber *)rejectOrderWithOrderId:(NSString *)orderId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  123. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  124. config.urlPath = [FAMILY_REJECT_ORDER copy];
  125. config.instructions = @"拒单";
  126. config.requestParameters = @{@"orderId":orderId};
  127. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  128. }
  129. /// 接单
  130. /// @param orderId 订单id
  131. /// @param successHandler 请求成功
  132. /// @param failureHandler 请求失败
  133. - (NSNumber *)receiveOrderWithOrderWithOrderId:(NSString *)orderId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  134. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  135. config.urlPath = [FAMILY_RECEIVE_ORDER copy];
  136. config.instructions = @"接单";
  137. config.requestParameters = @{@"orderId":orderId};
  138. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  139. }
  140. /// 支付订单
  141. /// @param orderId 订单id
  142. /// @param successHandler 请求成功
  143. /// @param failureHandler 请求失败
  144. - (NSNumber *)payOrderWithOrderWithOrderWithOrderId:(NSString *)orderId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  145. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  146. config.urlPath = [FAMILY_PAY_ORDER copy];
  147. config.instructions = @"支付订单";
  148. config.requestParameters = @{@"orderId":orderId};
  149. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  150. }
  151. /// 添加家族签约/解约
  152. /// @param familyId 家族id
  153. /// @param applyType 申请类型 0签约 1解约
  154. /// @param applyMsg 申请说明
  155. /// @param successHandler 请求成功
  156. /// @param failureHandler 请求失败
  157. - (NSNumber *)addFamilyAuditWithFamilyId:(NSString *)familyId applyType:(NSInteger)applyType applyMsg:(NSString *)applyMsg successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  158. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  159. config.urlPath = [FAMILY_ADD_FAMILY_AUDIT copy];
  160. config.instructions = @"添加家族签约/解约";
  161. NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
  162. [parameters addEntriesFromDictionary:@{@"familyId":familyId, @"applyType":@(applyType)}];
  163. if (StringIsNotEmpty(applyMsg)) {
  164. [parameters addEntriesFromDictionary:@{@"applyMsg":applyMsg}];
  165. }
  166. config.requestParameters = parameters;
  167. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  168. }
  169. /// 添加技能认证
  170. /// @param parameters 必填( skillId:技能id skillTagId:标签id familyId:家族id ) 选填 (skillIntro:技能简介 images:形象照 voice:语音)
  171. /// @param successHandler 请求成功
  172. /// @param failureHandler 请求失败
  173. - (NSNumber *)addSkillAuditWithParameters:(NSDictionary *)parameters successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  174. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  175. config.urlPath = [FAMILY_ADD_SKILL_AUDIT copy];
  176. config.instructions = @"添加技能认证";
  177. config.requestParameters = parameters;
  178. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  179. }
  180. /// 确认完成
  181. /// @param orderId 订单id
  182. /// @param successHandler 请求成功
  183. /// @param failureHandler 请求失败
  184. - (NSNumber *)confirmServiceWithOrderWithOrderId:(NSString *)orderId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  185. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  186. config.urlPath = [FAMILY_CONFIRM_SERVICE copy];
  187. config.instructions = @"确认完成";
  188. config.requestParameters = @{@"orderId":orderId};
  189. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  190. }
  191. /// 获取家族列表
  192. /// @param content 搜索内容
  193. /// @param pageIndex 当前页码
  194. /// @param successHandler 请求成功
  195. /// @param failureHandler 请求失败
  196. - (NSNumber *)getFamilyListContent:(NSString *)content pageIndex:(NSInteger)pageIndex successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  197. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  198. config.urlPath = [FAMILY_GET_FAMILY_LIST copy];
  199. config.instructions = @"获取家族列表";
  200. config.requestType = ZYLNetworkRequestTypeGet;
  201. config.requestParameters = @{@"content":content, @"pageIndex":@(pageIndex)};
  202. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  203. }
  204. /// 获取家族详情
  205. /// @param familyId 家族id
  206. /// @param successHandler 请求成功
  207. /// @param failureHandler 请求失败
  208. - (NSNumber *)getFamilyDetailWithFamilyId:(NSString *)familyId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  209. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  210. config.urlPath = [FAMILY_GET_FAMILY_DETAIL copy];
  211. config.instructions = @"获取家族详情";
  212. config.requestType = ZYLNetworkRequestTypeGet;
  213. config.requestParameters = @{@"familyId":familyId};
  214. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  215. }
  216. /// 获取已提交的技能列表
  217. /// @param successHandler 请求成功
  218. /// @param failureHandler 请求失败
  219. - (NSNumber *)getSkillsSubmitSuccessHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  220. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  221. config.urlPath = [FAMILY_GET_SKILLS_SUBMIT copy];
  222. config.instructions = @"获取已提交的技能列表";
  223. config.requestType = ZYLNetworkRequestTypeGet;
  224. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  225. }
  226. /// 获取已认证的技能列表
  227. /// @param userId 用户id 不传表示查看自己
  228. /// @param successHandler 请求成功
  229. /// @param failureHandler 请求失败
  230. - (NSNumber *)getSkillsAuthWithUserId:(NSString *)userId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  231. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  232. config.urlPath = [FAMILY_GET_SKILLS_AUTH copy];
  233. config.instructions = @"获取已认证的技能列表";
  234. config.requestType = ZYLNetworkRequestTypeGet;
  235. if (StringIsNotEmpty(userId)) {
  236. config.requestParameters = @{@"userId":userId};
  237. }
  238. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  239. }
  240. /// 获取技能用户列表
  241. /// @param pageIndex 当前页码
  242. /// @param skillId 技能id
  243. /// @param successHandler 请求成功
  244. /// @param failureHandler 请求失败
  245. - (NSNumber *)getSkillUserListWithPageIndex:(NSInteger)pageIndex skillId:(NSString *)skillId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  246. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  247. config.urlPath = [FAMILY_GET_SKILL_USER_LIST copy];
  248. config.instructions = @"获取技能用户列表";
  249. config.requestType = ZYLNetworkRequestTypeGet;
  250. config.requestParameters = @{@"skillId":skillId, @"pageIndex":@(pageIndex)};
  251. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  252. }
  253. /// 获取推荐技能用户列表
  254. /// @param pageIndex 当前页码
  255. /// @param skillId 技能id
  256. /// @param successHandler 请求成功
  257. /// @param failureHandler 请求失败
  258. - (NSNumber *)getRecommendSkillUserListWithPageIndex:(NSInteger)pageIndex skillId:(NSString *)skillId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  259. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  260. config.urlPath = [FAMILY_GET_RECOMMEND_SKILL_USER_LIST copy];
  261. config.instructions = @"获取推荐技能用户列表";
  262. config.requestType = ZYLNetworkRequestTypeGet;
  263. config.requestParameters = @{@"skillId":skillId, @"pageIndex":@(pageIndex)};
  264. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  265. }
  266. /// 获取开黑头条
  267. /// @param successHandler 请求成功
  268. /// @param failureHandler 请求失败
  269. - (NSNumber *)getPlayTopsuccessHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
  270. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  271. config.urlPath = [FAMILY_GET_PLAY_TOP copy];
  272. config.instructions = @"获取开黑头条";
  273. config.requestType = ZYLNetworkRequestTypeGet;
  274. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  275. }
  276. /// 获取技能设置
  277. /// @param skillId 技能id
  278. /// @param successHandler 请求成功
  279. /// @param failureHandler 请求失败
  280. - (NSNumber *)getSkillWithSkillId:(NSString *)skillId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  281. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  282. config.urlPath = [FAMILY_GET_SKILL copy];
  283. config.instructions = @"获取技能设置";
  284. config.requestType = ZYLNetworkRequestTypeGet;
  285. config.requestParameters = @{@"skillId":skillId};
  286. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  287. }
  288. /// 获取接单记录
  289. /// @param pageIndex 当前页码
  290. /// @param orderStatus 订单状态
  291. /// @param successHandler 请求成功
  292. /// @param failureHandler 请求失败
  293. - (NSNumber *)getOrderReceiveListWithPageIndex:(NSInteger)pageIndex orderStatus:(NSInteger)orderStatus successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  294. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  295. config.urlPath = [FAMILY_GET_ORDER_RECEIVE_LIST copy];
  296. config.instructions = @"获取接单记录";
  297. config.requestType = ZYLNetworkRequestTypeGet;
  298. NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
  299. [parameters addEntriesFromDictionary:@{@"pageIndex":@(pageIndex)}];
  300. if (orderStatus > 0) {
  301. [parameters addEntriesFromDictionary:@{@"orderStatus":@(orderStatus)}];
  302. }
  303. config.requestParameters = parameters;
  304. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  305. }
  306. /// 获取点单记录
  307. /// @param pageIndex 当前页码
  308. /// @param orderStatus 订单状态 WAIT_RECEIVE(100, "待接单"), WAIT_SERVICE(200, "待服务"), IN_SERVICE(210, "服务中"), COMPLETE(300, "已完成"), CANCEL(310, "已取消"), REJECT(320, "已拒绝"), EVALUATE(400, "已评价"),
  309. /// @param payStatus 支付状态 /** * 待支付 */ WAITTING(11, "待支付"), /** * 支付失败 */ FAILED(21, "支付失败"), /** * 支付取消 */ CANCELED(22, "支付取消"), /** * 支付成功 */ SUCCESSED(99, "支付成功"),;
  310. /// @param successHandler 请求成功
  311. /// @param failureHandler 请求失败
  312. - (NSNumber *)getOrderPayListWithPageIndex:(NSInteger)pageIndex orderStatus:(NSInteger)orderStatus payStatus:(NSInteger)payStatus successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  313. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  314. config.urlPath = [FAMILY_GET_ORDER_PAY_LIST copy];
  315. config.instructions = @"获取点单记录";
  316. config.requestType = ZYLNetworkRequestTypeGet;
  317. NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
  318. [parameters addEntriesFromDictionary:@{@"pageIndex":@(pageIndex)}];
  319. if (orderStatus > 0) {
  320. [parameters addEntriesFromDictionary:@{@"orderStatus":@(orderStatus)}];
  321. }
  322. if (payStatus > 0) {
  323. [parameters addEntriesFromDictionary:@{@"payStatus":@(payStatus)}];
  324. }
  325. config.requestParameters = parameters;
  326. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  327. }
  328. /// 获取订单详情
  329. /// @param orderId 订单id
  330. /// @param successHandler 请求成功
  331. /// @param failureHandler 请求失败
  332. - (NSNumber *)getOrderDetailWithOrderId:(NSString *)orderId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  333. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  334. config.urlPath = [FAMILY_GET_ORDER_DETAIL copy];
  335. config.instructions = @"获取订单详情";
  336. config.requestType = ZYLNetworkRequestTypeGet;
  337. config.requestParameters = @{@"orderId":orderId};
  338. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  339. }
  340. /// 获取我的家族及签约状态
  341. /// @param successHandler 请求成功
  342. /// @param failureHandler 请求失败
  343. - (NSNumber *)getFamilySuccessHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  344. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  345. config.urlPath = [FAMILY_GET_FAMILY copy];
  346. config.instructions = @"获取我的家族及签约状态";
  347. config.requestType = ZYLNetworkRequestTypeGet;
  348. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  349. }
  350. /// 获取用户技能详情
  351. /// @param skillId 技能id
  352. /// @param userId 用户id
  353. /// @param successHandler 请求成功
  354. /// @param failureHandler 请求失败
  355. - (NSNumber *)getSkillUserDetailWithSkillId:(NSString *)skillId userId:(NSString *)userId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  356. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  357. config.urlPath = [FAMILY_GET_SKILL_USER_DETAIL copy];
  358. config.instructions = @" 获取用户技能详情";
  359. config.requestType = ZYLNetworkRequestTypeGet;
  360. config.requestParameters = @{@"skillId":skillId, @"userId":userId};
  361. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  362. }
  363. /// 强制解约家族
  364. /// @param applyMsg 申请说明
  365. /// @param successHandler 请求成功
  366. /// @param failureHandler 请求失败
  367. - (NSNumber *)forceLeaveWithApplyMsg:(NSString *)applyMsg successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
  368. ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
  369. config.urlPath = [FAMILY_FORCE_LEAVE copy];
  370. config.instructions = @"强制解约家族";
  371. if (StringIsNotEmpty(applyMsg)) {
  372. config.requestParameters = @{@"applyMsg":applyMsg};
  373. }
  374. return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
  375. }
  376. @end