ucenter.go
2.4 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package protocol
const (
ModuleOportunity = "opportunity"
ModuleQuestion = "question"
)
const (
MethodLogin = "/auth/login"
MethodGetUser = "/users/"
MethodPutUser = "/users/"
MethodUserExists = "/users/isExist"
MethodServerLogin = "/auth/serverLogin"
)
/*UCenterLogin */
type UCenterLoginRequest struct {
Phone string `json:"phone"`
PassWord string `json:"password"`
Code string `json:"code"`
GrantType string `json:"grantType" valid:"Required"`
//ClientId string `json:"clientId" valid:"Required"`
Type int `json:"type"` //1为密码登录,管理后台登录,2为token登录,app登录
Uid int64 `json:"uid"` // type2
//CompanyId int64 `json:"companyId"` // type2
}
type UCenterLoginResponse struct {
Uid int64 `json:"uid"` //统一用户中心用户编号,作为登录凭证
Module []*ModulePermission `json:"module"`
}
//模块权限 (机会)opportunity (问题)question
type ModulePermission struct {
Name string `json:"name"` //模块名称 子菜单名称 `
Menus []*ModulePermission `json:"-"` //子模块权限
}
/*获取用户信息 UCenterGetUser */
type UCenterGetUserRequest struct {
}
type UCenterGetUserResponse struct {
Id int64 `json:"id"`
Phone string `json:"phone"`
NickName string `json:"nickname"`
Avatar string `json:"avatar"`
ImToken string `json:"imtoken"`
Accid int64 `json:"accid"`
CustomerAccount int64 `json:"customerAccount"`
}
type UCenter_GetUserResponse struct {
Id int64 `json:"id"`
Phone string `json:"phone"`
NickName string `json:"nickname"`
Avatar string `json:"avatar"`
ImToken string `json:"imtoken"`
Accid string `json:"accid"`
CustomerAccount string `json:"customerAccount"`
}
/*修改用户信息 UCenterPutUser */
type UCenterPutUserRequest struct {
Phone string `json:"phone,omitempty"`
PassWord string `json:"password,omitempty"`
NickName string `json:"nickname,omitempty"`
Avatar string `json:"avatar,omitempty"`
}
type UCenterPutUserResponse struct {
}
/*服务端登录*/
type UCenterServerLoginRequest struct {
Token string `json:"token"`
Uid int64 `json:"uid"`
CompanyId int64 `json:"company_id"`
Type int `json:"type"` //1为密码登录,管理后台登录,2为token登录,app登录
}
//type UCenterServerLoginResponse struct {
//}