-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAiInterface.h
44 lines (40 loc) · 1.18 KB
/
AiInterface.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "HttpRequest.h"
CString login(CString name, CString password){
CString body,b_Ret;
body.Format(_T("action=loginIn&name=%s&password=%s"), name, password);
b_Ret = postRequest(_T("http://api.xingjk.cn/api/do.php"), _T("POST"), body);
if (b_Ret.Find('1')){
return b_Ret;
}
else{
return b_Ret;
}
}
CString getPhone(CString sid, CString token, CString location = NULL){
CString body, b_Ret;
if (location.IsEmpty()){
body.Format(_T("action=getPhone&sid=%s&token=%s"), sid, token);
}
else{
//Only province
body.Format(_T("action=getPhone&sid=%s&token=%slocationMatching=include&locationLevel=p&location=%s"), sid, token,location);
}
b_Ret = postRequest(_T("http://api.xingjk.cn/api/do.php"), _T("POST"), body);
if (b_Ret.Find('1')){
return b_Ret;
}
else{
return b_Ret;
}
}
CString putSendMessage(CString phone, CString sid, CString message,CString recvPhone,CString token){
CString body, b_Ret;
body.Format(_T("action=putSentMessage&phone=%s&sid=%s&message=%s&recvPhone=%s&token=%s"), phone, sid,message,recvPhone,token);
b_Ret = postRequest(_T("http://api.xingjk.cn/api/do.php"), _T("POST"), body);
if (b_Ret.Find('1')){
return b_Ret;
}
else{
return b_Ret;
}
}