123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501 |
- //
- // XYFamilyAPIManager.m
- // Starbuds
- //
- // Created by 翟玉磊 on 2020/10/26.
- // Copyright © 2020 翟玉磊. All rights reserved.
- //
- #import "XYFamilyAPIManager.h"
- /// 下单
- static NSString * const FAMILY_ADD_ORDER = @"api-app/v1/family/addOrder";
- /// 取消支付
- static NSString * const FAMILY_CANCEL_PAY = @"api-app/v1/family/cancelPay";
- /// 开始服务
- static NSString * const FAMILY_START_SERVICE = @"api-app/v1/family/startService";
- /// 技能设置
- static NSString * const FAMILY_SET_SKILL = @"api-app/v1/family/setSkill";
- /// 拒单
- static NSString * const FAMILY_REJECT_ORDER = @"api-app/v1/family/rejectOrder";
- /// 接单
- static NSString * const FAMILY_RECEIVE_ORDER = @"api-app/v1/family/receiveOrder";
- /// 支付订单
- static NSString * const FAMILY_PAY_ORDER = @"api-app/v1/family/payOrder";
- /// 添加家族签约/解约
- static NSString * const FAMILY_ADD_FAMILY_AUDIT = @"api-app/v1/family/addFamilyAudit";
- /// 添加技能认证
- static NSString * const FAMILY_ADD_SKILL_AUDIT = @"api-app/v1/family/addSkillAudit";
- /// 确认完成
- static NSString * const FAMILY_CONFIRM_SERVICE = @"api-app/v1/family/confirmService";
- /// 获取家族列表
- static NSString * const FAMILY_GET_FAMILY_LIST = @"api-app/v1/family/getFamilyList";
- /// 获取家族详情
- static NSString * const FAMILY_GET_FAMILY_DETAIL = @"api-app/v1/family/getFamilyDetail";
- /// 获取已提交的技能列表
- static NSString * const FAMILY_GET_SKILLS_SUBMIT = @"api-app/v1/family/getSkillsSubmit";
- /// 获取已认证的技能列表
- static NSString * const FAMILY_GET_SKILLS_AUTH = @"api-app/v1/family/getSkillsAuth";
- /// 获取技能用户列表
- static NSString * const FAMILY_GET_SKILL_USER_LIST = @"api-app/v1/family/getSkillUserList";
- ///获取推荐技能用户列表
- static NSString * const FAMILY_GET_RECOMMEND_SKILL_USER_LIST = @"api-app/v1/family/getRecommendSkillUserList";
- ///获取开黑头条
- static NSString * const FAMILY_GET_PLAY_TOP = @"api-app/v1/family/getPlayTop";
- /// 获取技能设置
- static NSString * const FAMILY_GET_SKILL = @"api-app/v1/family/getSkill";
- /// 获取接单记录
- static NSString * const FAMILY_GET_ORDER_RECEIVE_LIST = @"api-app/v1/family/getOrderReceiveList";
- /// 获取点单记录
- static NSString * const FAMILY_GET_ORDER_PAY_LIST = @"api-app/v1/family/getOrderPayList";
- /// 获取订单详情
- static NSString * const FAMILY_GET_ORDER_DETAIL = @"api-app/v1/family/getOrderDetail";
- /// 获取我的家族及签约状态
- static NSString * const FAMILY_GET_FAMILY = @"api-app/v1/family/getFamily";
- /// 获取用户技能详情
- static NSString * const FAMILY_GET_SKILL_USER_DETAIL = @"api-app/v1/family/getSkillUserDetail";
- /// 强制解约家族
- static NSString * const FAMILY_FORCE_LEAVE = @"api-app/v1/family/forceLeave";
- @implementation XYFamilyAPIManager
- /// 下单
- /// @param receiveUserId 接单人的用户id
- /// @param skillId 技能id
- /// @param quantity 数量
- /// @param remark 备注
- /// @param requireTime 要求服务时间
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)addOrderWithReceiveUserId:(NSString *)receiveUserId skillId:(NSString *)skillId quantity:(NSInteger)quantity remark:(NSString *)remark requireTime:(NSString *)requireTime successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_ADD_ORDER copy];
- config.instructions = @"下单";
-
- NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
-
- if (requireTime.length == 10) {
- // 如果是秒级的时间戳这转成毫秒
- requireTime = [NSString stringWithFormat:@"%@000", requireTime];
- }
-
- [parameters addEntriesFromDictionary:@{@"receiveUserId":receiveUserId, @"skillId":skillId, @"quantity":@(quantity), @"requireTime":requireTime}];
- if (StringIsNotEmpty(remark)) {
- [parameters addEntriesFromDictionary:@{@"remark":remark}];
- }
- config.requestParameters = parameters;
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 取消支付
- /// @param orderId 订单id
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)cancelPayWithOrderId:(NSString *)orderId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_CANCEL_PAY copy];
- config.instructions = @"取消支付";
-
- config.requestParameters = @{@"orderId":orderId};
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 开始服务
- /// @param orderId 订单id
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)startServiceWithOrderId:(NSString *)orderId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_START_SERVICE copy];
- config.instructions = @"开始服务";
- config.requestParameters = @{@"orderId":orderId};
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 技能设置
- /// @param skillId 技能id
- /// @param orderPrice 接单价格
- /// @param orderTime 接单时间 格式 hh:mm-hh:mm
- /// @param orderStatus 接单状态 1:接单 0:不接单
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)setSkillWithSkillId:(NSString *)skillId orderPrice:(NSString *)orderPrice orderTime:(NSString *)orderTime orderStatus:(NSInteger)orderStatus successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_SET_SKILL copy];
- config.instructions = @"技能设置";
- config.requestParameters = @{@"skillId":skillId, @"orderPrice":orderPrice, @"orderTime":orderTime, @"orderStatus":@(orderStatus)};
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 拒单
- /// @param orderId 订单id
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)rejectOrderWithOrderId:(NSString *)orderId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_REJECT_ORDER copy];
- config.instructions = @"拒单";
- config.requestParameters = @{@"orderId":orderId};
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 接单
- /// @param orderId 订单id
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)receiveOrderWithOrderWithOrderId:(NSString *)orderId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_RECEIVE_ORDER copy];
- config.instructions = @"接单";
- config.requestParameters = @{@"orderId":orderId};
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 支付订单
- /// @param orderId 订单id
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)payOrderWithOrderWithOrderWithOrderId:(NSString *)orderId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_PAY_ORDER copy];
- config.instructions = @"支付订单";
- config.requestParameters = @{@"orderId":orderId};
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 添加家族签约/解约
- /// @param familyId 家族id
- /// @param applyType 申请类型 0签约 1解约
- /// @param applyMsg 申请说明
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)addFamilyAuditWithFamilyId:(NSString *)familyId applyType:(NSInteger)applyType applyMsg:(NSString *)applyMsg successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_ADD_FAMILY_AUDIT copy];
- config.instructions = @"添加家族签约/解约";
- NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
- [parameters addEntriesFromDictionary:@{@"familyId":familyId, @"applyType":@(applyType)}];
- if (StringIsNotEmpty(applyMsg)) {
- [parameters addEntriesFromDictionary:@{@"applyMsg":applyMsg}];
- }
- config.requestParameters = parameters;
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 添加技能认证
- /// @param parameters 必填( skillId:技能id skillTagId:标签id familyId:家族id ) 选填 (skillIntro:技能简介 images:形象照 voice:语音)
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)addSkillAuditWithParameters:(NSDictionary *)parameters successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_ADD_SKILL_AUDIT copy];
- config.instructions = @"添加技能认证";
- config.requestParameters = parameters;
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 确认完成
- /// @param orderId 订单id
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)confirmServiceWithOrderWithOrderId:(NSString *)orderId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_CONFIRM_SERVICE copy];
- config.instructions = @"确认完成";
- config.requestParameters = @{@"orderId":orderId};
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 获取家族列表
- /// @param content 搜索内容
- /// @param pageIndex 当前页码
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)getFamilyListContent:(NSString *)content pageIndex:(NSInteger)pageIndex successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_GET_FAMILY_LIST copy];
- config.instructions = @"获取家族列表";
- config.requestType = ZYLNetworkRequestTypeGet;
-
- config.requestParameters = @{@"content":content, @"pageIndex":@(pageIndex)};
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 获取家族详情
- /// @param familyId 家族id
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)getFamilyDetailWithFamilyId:(NSString *)familyId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_GET_FAMILY_DETAIL copy];
- config.instructions = @"获取家族详情";
- config.requestType = ZYLNetworkRequestTypeGet;
-
- config.requestParameters = @{@"familyId":familyId};
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 获取已提交的技能列表
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)getSkillsSubmitSuccessHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_GET_SKILLS_SUBMIT copy];
- config.instructions = @"获取已提交的技能列表";
- config.requestType = ZYLNetworkRequestTypeGet;
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 获取已认证的技能列表
- /// @param userId 用户id 不传表示查看自己
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)getSkillsAuthWithUserId:(NSString *)userId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_GET_SKILLS_AUTH copy];
- config.instructions = @"获取已认证的技能列表";
- config.requestType = ZYLNetworkRequestTypeGet;
-
- if (StringIsNotEmpty(userId)) {
- config.requestParameters = @{@"userId":userId};
- }
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 获取技能用户列表
- /// @param pageIndex 当前页码
- /// @param skillId 技能id
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)getSkillUserListWithPageIndex:(NSInteger)pageIndex skillId:(NSString *)skillId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_GET_SKILL_USER_LIST copy];
- config.instructions = @"获取技能用户列表";
- config.requestType = ZYLNetworkRequestTypeGet;
-
- config.requestParameters = @{@"skillId":skillId, @"pageIndex":@(pageIndex)};
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 获取推荐技能用户列表
- /// @param pageIndex 当前页码
- /// @param skillId 技能id
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)getRecommendSkillUserListWithPageIndex:(NSInteger)pageIndex skillId:(NSString *)skillId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_GET_RECOMMEND_SKILL_USER_LIST copy];
- config.instructions = @"获取推荐技能用户列表";
- config.requestType = ZYLNetworkRequestTypeGet;
-
- config.requestParameters = @{@"skillId":skillId, @"pageIndex":@(pageIndex)};
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 获取开黑头条
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)getPlayTopsuccessHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler{
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_GET_PLAY_TOP copy];
- config.instructions = @"获取开黑头条";
- config.requestType = ZYLNetworkRequestTypeGet;
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 获取技能设置
- /// @param skillId 技能id
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)getSkillWithSkillId:(NSString *)skillId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_GET_SKILL copy];
- config.instructions = @"获取技能设置";
- config.requestType = ZYLNetworkRequestTypeGet;
-
- config.requestParameters = @{@"skillId":skillId};
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 获取接单记录
- /// @param pageIndex 当前页码
- /// @param orderStatus 订单状态
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)getOrderReceiveListWithPageIndex:(NSInteger)pageIndex orderStatus:(NSInteger)orderStatus successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_GET_ORDER_RECEIVE_LIST copy];
- config.instructions = @"获取接单记录";
- config.requestType = ZYLNetworkRequestTypeGet;
-
- NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
- [parameters addEntriesFromDictionary:@{@"pageIndex":@(pageIndex)}];
- if (orderStatus > 0) {
- [parameters addEntriesFromDictionary:@{@"orderStatus":@(orderStatus)}];
- }
-
- config.requestParameters = parameters;
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 获取点单记录
- /// @param pageIndex 当前页码
- /// @param orderStatus 订单状态 WAIT_RECEIVE(100, "待接单"), WAIT_SERVICE(200, "待服务"), IN_SERVICE(210, "服务中"), COMPLETE(300, "已完成"), CANCEL(310, "已取消"), REJECT(320, "已拒绝"), EVALUATE(400, "已评价"),
- /// @param payStatus 支付状态 /** * 待支付 */ WAITTING(11, "待支付"), /** * 支付失败 */ FAILED(21, "支付失败"), /** * 支付取消 */ CANCELED(22, "支付取消"), /** * 支付成功 */ SUCCESSED(99, "支付成功"),;
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)getOrderPayListWithPageIndex:(NSInteger)pageIndex orderStatus:(NSInteger)orderStatus payStatus:(NSInteger)payStatus successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_GET_ORDER_PAY_LIST copy];
- config.instructions = @"获取点单记录";
- config.requestType = ZYLNetworkRequestTypeGet;
-
- NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
- [parameters addEntriesFromDictionary:@{@"pageIndex":@(pageIndex)}];
- if (orderStatus > 0) {
- [parameters addEntriesFromDictionary:@{@"orderStatus":@(orderStatus)}];
- }
- if (payStatus > 0) {
- [parameters addEntriesFromDictionary:@{@"payStatus":@(payStatus)}];
- }
-
- config.requestParameters = parameters;
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 获取订单详情
- /// @param orderId 订单id
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)getOrderDetailWithOrderId:(NSString *)orderId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_GET_ORDER_DETAIL copy];
- config.instructions = @"获取订单详情";
- config.requestType = ZYLNetworkRequestTypeGet;
- config.requestParameters = @{@"orderId":orderId};
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 获取我的家族及签约状态
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)getFamilySuccessHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_GET_FAMILY copy];
- config.instructions = @"获取我的家族及签约状态";
- config.requestType = ZYLNetworkRequestTypeGet;
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 获取用户技能详情
- /// @param skillId 技能id
- /// @param userId 用户id
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)getSkillUserDetailWithSkillId:(NSString *)skillId userId:(NSString *)userId successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_GET_SKILL_USER_DETAIL copy];
- config.instructions = @" 获取用户技能详情";
- config.requestType = ZYLNetworkRequestTypeGet;
-
- config.requestParameters = @{@"skillId":skillId, @"userId":userId};
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- /// 强制解约家族
- /// @param applyMsg 申请说明
- /// @param successHandler 请求成功
- /// @param failureHandler 请求失败
- - (NSNumber *)forceLeaveWithApplyMsg:(NSString *)applyMsg successHandler:(ZYLNetworkTaskSuccessHandler)successHandler failureHandler:(ZYLNetworkTaskFailureHandler)failureHandler {
-
- ZYLDataAPIConfiguration *config = [ZYLDataAPIConfiguration new];
- config.urlPath = [FAMILY_FORCE_LEAVE copy];
- config.instructions = @"强制解约家族";
-
- if (StringIsNotEmpty(applyMsg)) {
- config.requestParameters = @{@"applyMsg":applyMsg};
- }
-
- return [super dispatchDataTaskWithConfiguration:config successHandler:successHandler failureHandler:failureHandler];
- }
- @end
|