-
Notifications
You must be signed in to change notification settings - Fork 0
/
http.go
51 lines (45 loc) · 1.69 KB
/
http.go
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
45
46
47
48
49
50
51
package po
type HttpResult struct {
// [{
// "success":"", --->是否成功
// "code":"", --->状态码
// "message":"", --->消息框
// "version":"", --->版本信息
// "data":[{"key":"value"}], --->返回数据
// "is_native" true // 是否跳转h5
// }]
Success bool `json:"success"`
Code int `json:"code"`
Message string `json:"message"`
Version string `json:"version"`
Data interface{} `json:"data"`
IsNative bool `json:"is_native"`
}
//data的正确格式: 3&4.0.1&black&xxhdpi&zh&aaa_a&53496937f5bc02807d3934ac9fcf5ac9
type HttpHeaderData struct {
Terminal int // 3 android端 4 ios端
Version string
Theme string
Resolution string
Locale string
Sign string
}
//{"success":false,"message":"账号或密码错误!","username":null,"password":null,"isOpenCaptcha":true,"propMessages":{}}
//{"success":false,"message":null,"username":null,"password":null,"isOpenCaptcha":true,"propMessages":{"captcha":"验证码不正确!"}}
//{"success":true,"message":null,"username":null,"password":null,"isOpenCaptcha":false,"propMessages":{}}
type LoginBean struct {
Success bool `json:"success"`
Message string `json:"message"`
Username string `json:"username"`
Password string `json:"password"`
IsOpenCaptcha bool `json:"isOpenCaptcha"`
PropMessages PropMessagesBean `json:"propMessages"`
}
type PropMessagesBean struct {
Captcha string `json:"captcha,omitempty"`
Location string `json:"location,omitempty"`
GbToken string `json:"gbToken,omitempty"`
}
type HttpRes struct {
Data string `json:"data"`
}