ucenter.go
1.6 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
package protocol
const (
ModuleOportunity = "opportunity"
ModuleQuestion = "question"
)
const (
MethodLogin = "/auth/login"
MethodGetUser = "/users/"
MethodPutUser = "/users/"
MethodUserExists = "/users/isExist"
)
/*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 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"`
Token string `json:"token"`
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 {
}