1 Star 0 Fork 0

马锦航/HuoBan_160120old

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
HttpClassSelf.m 28.13 KB
一键复制 编辑 原始数据 按行查看 历史
NewImprove 提交于 2016-01-20 15:25 . 合并后的提提交
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
//
// HttpClassSelf.m
// appDemo
//
// Created by 刘雨辰 on 15/9/10.
// Copyright (c) 2015年 lyc. All rights reserved.
#import "HttpClassSelf.h"
#import "MKNetworkKit.h"
#import "CommonCrypto/CommonDigest.h"
#import "CommonBase64.h"
#define HTTPAddHuoBan @"api.huoban.io:8877"
//服务器测试地址
//#define HTTPAddHuoBan @"123.57.33.133:8888"
@implementation HttpClassSelf
#pragma mark POST
//登陆
-(void)loginSetMobile:(NSString *)mobile pwd:(NSString *)pwd umengid:(NSString *)umengid mobibuild:(NSString *)mobibuild mobitype:(NSString *)mobitype CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
//设置请求路径
NSString *path = [[NSString alloc]initWithFormat:@"/auth/login"];
//设置主机名
MKNetworkEngine *engine = [[MKNetworkEngine alloc]initWithHostName:HTTPAddHuoBan customHeaderFields:nil ];
NSString *pwdMD5 = [self MD5ByAStr:pwd];
NSMutableDictionary *postBody = [[NSMutableDictionary alloc]init ];
[postBody setValue:mobile forKey:@"mobile"];
[postBody setValue:pwdMD5 forKey:@"pwd"];
// [postBody setValue:umengid forKey:@"umengid"];
[postBody setValue:@"" forKey:@"umengid"];
[postBody setValue:mobibuild forKey:@"mobibuild"];
[postBody setValue:mobitype forKey:@"mobitype"];
NSLog(@"%@",umengid);
//请求地址,参数
MKNetworkOperation *op = [engine operationWithPath:path params:postBody httpMethod:@"POST"];
//请求闭包
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
//发起网络请求
[engine enqueueOperation:op];
}
//回复评论
-(void)answerComment:(NSString *)strComment token:(NSString *)strToken answerID:(NSString*)strAnswerID message:(NSString *)strMessage CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
//设置请求路径
NSString *path = [[NSString alloc]initWithFormat:@"/comment/%@/reply/%@",strComment,strToken];
//设置主机名
MKNetworkEngine *engine = [[MKNetworkEngine alloc]initWithHostName:HTTPAddHuoBan customHeaderFields:nil ];
NSMutableDictionary *postBody = [[NSMutableDictionary alloc]init ];
[postBody setValue:strMessage forKey:@"message"];
//请求地址,参数
MKNetworkOperation *op = [engine operationWithPath:path params:postBody httpMethod:@"POST"];
//请求闭包
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
//发起网络请求
[engine enqueueOperation:op];
}
//保存个人信息
-(void)UpdateUserSettingSetUser:(NSString*)steUser setToken:(NSString*)strToken setImage:(NSString*)steImage setName:(NSString*)strName setSex:(NSString*)strSex setAddress:(NSString*)strAddress setSign:(NSString*)strSign setDesc:(NSString*)strDesc payName:(NSString *)strPayName payMobile:(NSString *)strPayMobile payPostCode:(NSString *)strPostCode CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
NSString *path = [[NSString alloc] initWithFormat:@"/user/profile/user-%@/%@",steUser,strToken];
//设置主机名
MKNetworkEngine *engine = [[MKNetworkEngine alloc]initWithHostName:HTTPAddHuoBan customHeaderFields:nil ];
NSMutableDictionary *postBody = [[NSMutableDictionary alloc]init];
[postBody setValue:steUser forKey:@"user"];
[postBody setValue:strToken forKey:@"token"];
[postBody setValue:steImage forKey:@"image"];
[postBody setValue:strName forKey:@"name"];
[postBody setValue:strSex forKey:@"sex"];
[postBody setValue:strAddress forKey:@"address"];
[postBody setValue:strSign forKey:@"sign"];
[postBody setValue:strDesc forKey:@"desc"];
[postBody setValue:strPayName forKey:@"postname"];
[postBody setValue:strPayMobile forKey:@"postmobile"];
[postBody setValue:strAddress forKey:@"postaddress"];
[postBody setValue:strPostCode forKey:@"postcode"];
// NSLog(@"%@--%@--%@--%@--%@--%@--%@--%@--%@---%@---%@",steUser,strToken,steImage,strName,strSex,strAddress,strSign,strDesc,strPayName,strPayMobile,strAddress);
MKNetworkOperation *op = [engine operationWithPath:path params:postBody httpMethod:@"POST"];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
}
-(void)UpdateUserSettingSetUser:(NSString*)steUser setToken:(NSString*)strToken setImage:(NSString*)steImage setName:(NSString*)strName setSex:(NSString*)strSex setAddress:(NSString*)strAddress setSign:(NSString*)strSign setDesc:(NSString*)strDesc payName:(NSString *)strPayName payMobile:(NSString *)strPayMobile payPostCode:(NSString *)strPostCode profession:(NSString *)profession city:(NSString *)city CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
NSString *path = [[NSString alloc] initWithFormat:@"/user/profile/user-%@/%@",steUser,strToken];
//设置主机名
MKNetworkEngine *engine = [[MKNetworkEngine alloc]initWithHostName:HTTPAddHuoBan customHeaderFields:nil ];
NSMutableDictionary *postBody = [[NSMutableDictionary alloc]init];
NSString * _strSex;
_strSex = [strSex isEqualToString:@"男"]?@"1":@"0";
[postBody setValue:steUser forKey:@"user"];
[postBody setValue:strToken forKey:@"token"];
[postBody setValue:steImage forKey:@"image"];
[postBody setValue:strName forKey:@"name"];
[postBody setValue:_strSex forKey:@"sex"];
[postBody setValue:strAddress forKey:@"address"];
[postBody setValue:strSign forKey:@"sign"];
[postBody setValue:strDesc forKey:@"desc"];
[postBody setValue:strPayName forKey:@"postname"];
[postBody setValue:strPayMobile forKey:@"postmobile"];
[postBody setValue:strAddress forKey:@"postaddress"];
[postBody setValue:strPostCode forKey:@"postcode"];
[postBody setValue:profession forKey:@"profession"];
[postBody setValue:city forKey:@"city"];
NSLog(@"%@",postBody);
// NSLog(@"%@--%@--%@--%@--%@--%@--%@--%@--%@---%@---%@",steUser,strToken,steImage,strName,strSex,strAddress,strSign,strDesc,strPayName,strPayMobile,strAddress);
MKNetworkOperation *op = [engine operationWithPath:path params:postBody httpMethod:@"POST"];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
}
//注册
-(void)RegisterSetMobile:(NSString*)mobile pwd:(NSString*)pwd umengid:(NSString*)umengid mobibuild:(NSString*)mobibuild mobitype:(NSString*)mobitype CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
//设置请求路径
NSString *path = [[NSString alloc]initWithFormat:@"/auth/register"];
NSString *pwdMD5 = [self MD5ByAStr:pwd];
//设置主机名
MKNetworkEngine *engine = [[MKNetworkEngine alloc]initWithHostName:HTTPAddHuoBan customHeaderFields:nil ];
NSMutableDictionary *postBody = [[NSMutableDictionary alloc]init ];
[postBody setValue:mobile forKey:@"mobile"];
[postBody setValue:pwdMD5 forKey:@"pwd"];
[postBody setValue:umengid forKey:@"umengid"];
[postBody setValue:mobibuild forKey:@"mobibuild"];
[postBody setValue:mobitype forKey:@"mobitype"];
//请求地址,参数
MKNetworkOperation *op = [engine operationWithPath:path params:postBody httpMethod:@"POST"];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
//发起网络请求
[engine enqueueOperation:op];
}
//忘记密码
-(void)forgotPWDSetMobile:(NSString*)mobile pwd:(NSString*)pwd umengid:(NSString*)umengid mobibuild:(NSString*)mobibuild mobitype:(NSString*)mobitype CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
//设置请求路径
NSString *path = [[NSString alloc]initWithFormat:@"/auth/forgetpwd"];
NSString *pwdMD5 = [self MD5ByAStr:pwd];
//设置主机名
MKNetworkEngine *engine = [[MKNetworkEngine alloc]initWithHostName:HTTPAddHuoBan customHeaderFields:nil ];
NSMutableDictionary *postBody = [[NSMutableDictionary alloc]init ];
[postBody setValue:mobile forKey:@"mobile"];
[postBody setValue:pwdMD5 forKey:@"pwd"];
[postBody setValue:umengid forKey:@"umengid"];
[postBody setValue:mobibuild forKey:@"mobibuild"];
[postBody setValue:mobitype forKey:@"mobitype"];
//请求地址,参数
MKNetworkOperation *op = [engine operationWithPath:path params:postBody httpMethod:@"POST"];
//请求闭包
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
//发起网络请求
[engine enqueueOperation:op];
}
//发布项目动态
-(void)sendProjectselfDynamicSetProjectID:(NSString*)strProjectID strToken:(NSString*)strToken message:(NSString*)message image:(NSString*)strImage CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
//设置请求路径
NSString *path = [[NSString alloc]initWithFormat:@"/project/feed/p-%@/new/%@",strProjectID,strToken];
//设置主机名
MKNetworkEngine *engine = [[MKNetworkEngine alloc]initWithHostName:HTTPAddHuoBan customHeaderFields:nil ];
NSMutableDictionary *postBody = [[NSMutableDictionary alloc]init ];
[postBody setValue:message forKey:@"message"];
[postBody setValue:strImage forKey:@"image"];
//请求地址,参数
MKNetworkOperation *op = [engine operationWithPath:path params:postBody httpMethod:@"POST"];
//请求闭包
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
//发起网络请求
[engine enqueueOperation:op];
}
//评论项目动态
-(void)commentProjectselDynamicSetFeed:(NSString*)strFeed strToken:(NSString*)strToken message:(NSString*)message CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
//设置请求路径
NSString *path = [[NSString alloc]initWithFormat:@"/project/feed/%@/comment/%@",strFeed,strToken];
//设置主机名
MKNetworkEngine *engine = [[MKNetworkEngine alloc]initWithHostName:HTTPAddHuoBan customHeaderFields:nil ];
NSMutableDictionary *postBody = [[NSMutableDictionary alloc]init ];
[postBody setValue:message forKey:@"message"];
//请求地址,参数
MKNetworkOperation *op = [engine operationWithPath:path params:postBody httpMethod:@"POST"];
//请求闭包
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
//发起网络请求
[engine enqueueOperation:op];
}
#pragma mark GET
//主页项目列表
-(void)homePageSetKey:(NSString*)strkey numPage:(int)numPage numNum:(int)numNum token:(NSString*)strtoken CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
//设置请求路径
NSString *path = [[NSString alloc]initWithFormat:@"/project/list/%@/page-%i/num-%i/%@",strkey,numPage,numNum,strtoken];
//设置主机名
MKNetworkEngine *engine = [[MKNetworkEngine alloc]initWithHostName:HTTPAddHuoBan customHeaderFields:nil ];
//请求地址,参数
MKNetworkOperation *op = [engine operationWithPath:path];
//请求闭包
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
//发起网络请求
[engine enqueueOperation:op];
}
//聊天列表;
-(void)projectTalkSetFeed:(NSString *)strFeed numPage:(int)numPage numNum:(int)numNum token:(NSString *)strToken CallBackyes:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
NSString *path = [[NSString alloc] initWithFormat:@"/comments/list/f-%@/page-%i/num-%i/%@",strFeed,numPage,numNum,strToken];
MKNetworkEngine *engine = [[MKNetworkEngine alloc] initWithHostName:HTTPAddHuoBan customHeaderFields:nil];
MKNetworkOperation *op = [engine operationWithPath:path];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
}
//项目详情
-(void)projectDetailsSetProjectID:(NSString*)strProjectID token:(NSString*)strtoken CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
//设置请求路径
NSString *path = [[NSString alloc]initWithFormat:@"/project/p-%@/%@",strProjectID,strtoken];
//设置主机名
MKNetworkEngine *engine = [[MKNetworkEngine alloc]initWithHostName:HTTPAddHuoBan customHeaderFields:nil ];
//请求地址,参数
MKNetworkOperation *op = [engine operationWithPath:path];
//请求闭包
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
//发起网络请求
[engine enqueueOperation:op];
}
-(void)oneProjectDynamicSetProjectID:(NSString *)strProjectID numPage:(int)numPage numNum:(int)numNum token:(NSString *)strToken CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
NSString *path = [[NSString alloc] initWithFormat:@"/feed/p-%@/page-%i/num-%i/%@",strProjectID,numPage,numNum,strToken];
MKNetworkEngine *engine = [[MKNetworkEngine alloc] initWithHostName:HTTPAddHuoBan customHeaderFields:nil];
MKNetworkOperation *op = [engine operationWithPath:path];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
}
//显示一个用户的所有动态
-(void)projectDynmaicUserSelfSetUser:(NSString*)strUser numPage:(int)numPage numNum:(int)numNum token:(NSString*)strToken CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
NSString *path = [[NSString alloc] initWithFormat:@"/feed/u-%@/page-%i/num-%i/%@",strUser,numPage,numNum,strToken];
MKNetworkEngine *engine = [[MKNetworkEngine alloc]initWithHostName:HTTPAddHuoBan customHeaderFields:nil];
MKNetworkOperation *op = [engine operationWithPath:path];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
}
//全部动态接口
-(void)projectDynamicOurSetUser:(NSString*)strUser numPage:(int)numPage numNum:(int)numNum token:(NSString*)strToken CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
NSString *path = [[NSString alloc] initWithFormat:@"/feed/u-%@-we/page-%i/num-%i/%@",strUser,numPage,numNum,strToken];
MKNetworkEngine *engine = [[MKNetworkEngine alloc] initWithHostName:HTTPAddHuoBan customHeaderFields:nil];
MKNetworkOperation *op = [engine operationWithPath:path];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
}
// 查看个人所有动态接口
-(void)personDynamic:(NSString *)strUserID numPage:(int)numPage numNum:(int)numNum token:(NSString *)strToken CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
NSString *path = [[NSString alloc] initWithFormat:@"/feed/u-%@/page-%i/num-%i/%@",strUserID,numPage,numNum,strToken];
MKNetworkEngine *engine = [[MKNetworkEngine alloc] initWithHostName:HTTPAddHuoBan customHeaderFields:nil];
MKNetworkOperation *op = [engine operationWithPath:path];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
}
-(void)projectDetailsDynamic:(NSString *)strProjectID numPage:(int)numPage numNum:(int)numNum token:(NSString *)strToken CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
NSString *path = [[NSString alloc] initWithFormat:@"/feed/p-%@-creator/page-%i/num-%i/%@",strProjectID,numPage,numNum,strToken];
MKNetworkEngine *engine = [[MKNetworkEngine alloc] initWithHostName:HTTPAddHuoBan customHeaderFields:nil];
MKNetworkOperation *op = [engine operationWithPath:path];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
}
//项目点赞(取消)
-(void)loveProjectselfSetFeed:(NSString*)strFeed up:(int)upInt token:(NSString*)strtoken CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
//设置请求路径
NSString *path = [[NSString alloc]initWithFormat:@"/project/feed/%@/up/%i/%@",strFeed,upInt,strtoken];
//设置主机名
MKNetworkEngine *engine = [[MKNetworkEngine alloc]initWithHostName:HTTPAddHuoBan customHeaderFields:nil ];
//请求地址,参数
MKNetworkOperation *op = [engine operationWithPath:path];
//请求闭包
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
//发起网络请求
[engine enqueueOperation:op];
}
//关注一个项目(取消)(返回状态)
-(void)focusProjectselfSetProjectID:(NSString*)strProjectID up:(int)upInt token:(NSString*)strtoken CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
//设置请求路径
NSString *path = [[NSString alloc]initWithFormat:@"/user/focus/%@/%i/%@",strProjectID,upInt,strtoken];
//设置主机名
MKNetworkEngine *engine = [[MKNetworkEngine alloc]initWithHostName:HTTPAddHuoBan customHeaderFields:nil ];
//请求地址,参数
MKNetworkOperation *op = [engine operationWithPath:path];
//请求闭包
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
//发起网络请求
[engine enqueueOperation:op];
}
//查看用户关注的项目(自己,别人)
-(void)focusProjectselfSetUser:(NSString*)strUser page:(int)numPage num:(int)numNum token:(NSString*)strtoken CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
//设置请求路径
NSString *path = [[NSString alloc]initWithFormat:@"/user/profile/focus/%@/page-%i/num-%i/%@",strUser,numPage,numNum,strtoken];
//设置主机名
MKNetworkEngine *engine = [[MKNetworkEngine alloc]initWithHostName:HTTPAddHuoBan customHeaderFields:nil ];
//请求地址,参数
MKNetworkOperation *op = [engine operationWithPath:path];
//请求闭包
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
//发起网络请求
[engine enqueueOperation:op];
}
//查看用户基本信息
-(void)CheckUserSelfSetUser:(NSString*)strUser token:(NSString*)strtoken CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
//设置请求路径
NSString *path = [[NSString alloc]initWithFormat:@"/user/profile/userv2-%@/%@",strUser,strtoken];
//设置主机名
MKNetworkEngine *engine = [[MKNetworkEngine alloc]initWithHostName:HTTPAddHuoBan customHeaderFields:nil ];
//请求地址,参数
MKNetworkOperation *op = [engine operationWithPath:path];
//请求闭包
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
//发起网络请求
[engine enqueueOperation:op];
}
//查看用户发起的项目
-(void)CheckUserCreateProjectSetUser:(NSString*)strUser page:(int)numPage num:(int)numNum token:(NSString*)strtoken CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
//设置请求路径
NSString *path = [[NSString alloc]initWithFormat:@"/user/profile/create/%@/page-%i/num-%i/%@",strUser,numPage,numNum,strtoken];
//设置主机名
MKNetworkEngine *engine = [[MKNetworkEngine alloc]initWithHostName:HTTPAddHuoBan customHeaderFields:nil];
//请求地址,参数
MKNetworkOperation *op = [engine operationWithPath:path];
//请求闭包
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
//发起网络请求
[engine enqueueOperation:op];
}
//查看用户支持的项目
-(void)CheckUserSuppotProjectSetUser:(NSString*)strUser page:(int)numPage num:(int)numNum token:(NSString*)strtoken CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
//设置请求路径
NSString *path = [[NSString alloc]initWithFormat:@"/user/profile/pay/%@/page-%i/num-%i/%@",strUser,numPage,numNum,strtoken];
//设置主机名
MKNetworkEngine *engine = [[MKNetworkEngine alloc]initWithHostName:HTTPAddHuoBan customHeaderFields:nil ];
//请求地址,参数
MKNetworkOperation *op = [engine operationWithPath:path];
//请求闭包
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
//发起网络请求
[engine enqueueOperation:op];
}
-(void)qiniuSDK:(NSString*)qiniu CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
NSString *path = [[NSString alloc] initWithFormat:@"/qiniu/1w3EcXsD"];
MKNetworkEngine *engine = [[MKNetworkEngine alloc] initWithHostName:HTTPAddHuoBan customHeaderFields:nil];
MKNetworkOperation *op = [engine operationWithPath:path];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
}
-(void)pingSDk:(NSString *)pingsdk projectID:(NSString *)strProjectID paytype:(NSString *)strPaytype chou:(NSString *)strChouID token:(NSString *)strToken CallBackYES:(CallBackYES)BlockYES CallBackNo:(CallBackNO)BlockNO{
NSString *path = [[NSString alloc] initWithFormat:@"/pay/p-%@/%@/%@/%@",strProjectID,strPaytype,strChouID,strToken];
MKNetworkEngine *engine = [[MKNetworkEngine alloc] initWithHostName:HTTPAddHuoBan customHeaderFields:nil];
MKNetworkOperation *op = [engine operationWithPath:path];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
}
-(void)getTalkListSetFeed:(NSString *)strFeed page:(int)pageInt num:(int)numInt token:(NSString *)strToken CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
NSString *path = [[NSString alloc] initWithFormat:@"comments/list/f-%@/page-%i/num-%i/%@",strFeed,pageInt,numInt,strToken];
MKNetworkEngine *engine = [[MKNetworkEngine alloc] initWithHostName:HTTPAddHuoBan customHeaderFields:nil];
MKNetworkOperation *op = [engine operationWithPath:path];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
}
-(void)GetCheckIDSetTelephoneNumForCreate:(NSString *)strTelephone getKey:(NSString *)strKey CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
NSString *path = [[NSString alloc] initWithFormat:@"/sendsms/%@/%@",strKey,strTelephone];
MKNetworkEngine *engine = [[MKNetworkEngine alloc] initWithHostName:HTTPAddHuoBan customHeaderFields:nil];
MKNetworkOperation *op = [engine operationWithPath:path];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
}
-(void)GetCheckIDSetTelephoneNumForFixPWD:(NSString *)strTelephone getKey:(NSString *)strKey CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
NSString *path = [[NSString alloc] initWithFormat:@"/sendsms/%@/%@",strKey,strTelephone];
MKNetworkEngine *engine = [[MKNetworkEngine alloc] initWithHostName:HTTPAddHuoBan customHeaderFields:nil];
MKNetworkOperation *op = [engine operationWithPath:path];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
}
-(void)CheckIDReviewForCreate:(NSString *)strTelephone getKey:(NSString *)strKey getCode:(NSString *)strCode CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
NSString *path = [[NSString alloc] initWithFormat:@"/sendsms/verify/%@/%@/%@",strKey,strTelephone,strCode];
MKNetworkEngine *engine = [[MKNetworkEngine alloc] initWithHostName:HTTPAddHuoBan customHeaderFields:nil];
MKNetworkOperation *op = [engine operationWithPath:path];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
}
-(void)CheckIDReviewForFixPWD:(NSString *)strTelephone getKey:(NSString *)strKey getCode:(NSString *)strCode CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
NSString *path = [[NSString alloc] initWithFormat:@"/sendsms/verify/%@/%@/%@",strKey,strTelephone,strCode];
MKNetworkEngine *engine = [[MKNetworkEngine alloc] initWithHostName:HTTPAddHuoBan customHeaderFields:nil];
MKNetworkOperation *op = [engine operationWithPath:path];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
}
-(void)ChoseMyProjectIDByUserID:(NSString *)strUserID token:(NSString *)strToken page:(int)pageInt num:(int)numInt CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
NSString *path = [[NSString alloc] initWithFormat:@"/user/profile/postfeed/%@/page-%i/num-%i/%@",strUserID,pageInt,numInt,strToken];
MKNetworkEngine *engine = [[MKNetworkEngine alloc] initWithHostName:HTTPAddHuoBan customHeaderFields:nil];
MKNetworkOperation *op = [engine operationWithPath:path];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
}
//查看关注和加入项目接口
-(void)UpAndJoinProjectList:(NSString *)strUserID token:(NSString *)strToken page:(int)pageInt num:(int)numInt CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
NSString *path = [[NSString alloc] initWithFormat:@"/v2/user/profile/postfeed/%@/page-%i/num-%i/%@",strUserID,pageInt,numInt,strToken];
MKNetworkEngine *engine = [[MKNetworkEngine alloc] initWithHostName:HTTPAddHuoBan customHeaderFields:nil];
MKNetworkOperation *op = [engine operationWithPath:path];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
}
-(void)CHeckPayList:(NSString *)strUserID token:(NSString *)strToken page:(int)pageInt num:(int)numInt CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
NSString *path = [[NSString alloc] initWithFormat:@"user/orders/%@/page-%i/num-%i/%@",strUserID,pageInt,numInt,strToken];
MKNetworkEngine *engine = [[MKNetworkEngine alloc] initWithHostName:HTTPAddHuoBan customHeaderFields:nil];
MKNetworkOperation *op = [engine operationWithPath:path];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
}
-(void)deleteProjectDynamic:(NSString *)strFeedID token:(NSString *)strToken CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
NSString *path = [[NSString alloc] initWithFormat:@"/project/feed/%@/%@",strFeedID,strToken];
MKNetworkEngine *engine = [[MKNetworkEngine alloc] initWithHostName:HTTPAddHuoBan customHeaderFields:nil];
MKNetworkOperation *op = [engine operationWithPath:path params:nil httpMethod:@"DELETE"];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
}
//单个动态信息
-(void)getOneDynamic:(NSString *)strFeedID token:(NSString *)strToken CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
NSString *path = [[NSString alloc] initWithFormat:@"/project/feed/%@/%@",strFeedID,strToken];
MKNetworkEngine *engine = [[MKNetworkEngine alloc] initWithHostName:HTTPAddHuoBan customHeaderFields:nil];
MKNetworkOperation *op = [engine operationWithPath:path params:nil httpMethod:@"GET"];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
}
-(void)getUserTimeLineByUserID:(NSString *)strUserID page:(int)pageInt num:(int)numInt token:(NSString *)strToken CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
NSString *path = [[NSString alloc] initWithFormat:@"/user/profile/timeline/%@/page-%i/num-%i/%@",strUserID,pageInt,numInt,strToken];
MKNetworkEngine *engine = [[MKNetworkEngine alloc] initWithHostName:HTTPAddHuoBan customHeaderFields:nil];
MKNetworkOperation *op = [engine operationWithPath:path params:nil httpMethod:@"GET"];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
}
//我V@
-(void)getUserSelfInfoByUserID:(NSString *)strUserID page:(int)pageInt num:(int)numInt token:(NSString *)strToken CallBackYES:(CallBackYES)BlockYES CallBackNO:(CallBackNO)BlockNO{
///v2/profile/u-{user}/page-{page}/num-{num}/{token}
NSString *path = [[NSString alloc] initWithFormat:@"/v2/profile/u-%@/page-%i/num-%i/%@",strUserID,pageInt,numInt,strToken];
MKNetworkEngine *engine = [[MKNetworkEngine alloc] initWithHostName:HTTPAddHuoBan customHeaderFields:nil];
MKNetworkOperation *op = [engine operationWithPath:path params:nil httpMethod:@"GET"];
[op addCompletionHandler:BlockYES errorHandler:BlockNO];
[engine enqueueOperation:op];
//http://123.57.33.133:8888/v2/profile/u-5620a7b7b5a2a7a8fe41b7eb/page-0/num-10/5620a7b7b5a2a7a8fe41b7eb
//http://123.57.33.133:8888/v2/profile/567b9019acaad970fc37c754/page-0/num-0/567b9019acaad970fc37c754
}
//md5加密
-(NSString *)MD5ByAStr:(NSString *)aSourceStr {
const char* cStr = [aSourceStr UTF8String];
unsigned char result[CC_MD5_DIGEST_LENGTH];
CC_MD5(cStr, strlen(cStr), result);
NSMutableString *ret = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH];
for (NSInteger i=0; i<CC_MD5_DIGEST_LENGTH; i++) {
[ret appendFormat:@"%02x", result[i]];
}
return ret;
}
@end
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/2233mjh/HuoBan_160120old.git
git@gitee.com:2233mjh/HuoBan_160120old.git
2233mjh
HuoBan_160120old
HuoBan_160120old
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385