-
Notifications
You must be signed in to change notification settings - Fork 0
/
account.go
88 lines (80 loc) · 3.49 KB
/
account.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
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
81
82
83
84
85
86
87
88
package uimserver
import "context"
type Account struct {
Id string `json:"id"`
AccountId string `json:"accountId"`
CustomId string `json:"customId"`
Nickname string `json:"nickname"`
Avatar string `json:"avatar"`
Gender int32 `json:"gender"`
Mobile string `json:"mobile"`
Country string `json:"country"`
State string `json:"state"`
City string `json:"city"`
Signature string `json:"signature"`
Alias string `json:"alias"`
Qrcode string `json:"qrcode"`
ExtendProps map[string]interface{} `json:"extendProps"`
IsDeleted bool `json:"isDeleted"`
CreateAt int64 `json:"createAt"`
UpdateAt int64 `json:"updateAt"`
}
type AccountUpateParameters struct {
AppId string `json:"appId"`
AccountId string `json:"accountId"`
CustomId string `json:"customeId"`
Nickname string `json:"nickname"`
Avatar string `json:"avatar"`
Gender int32 `json:"gender"`
Mobile string `json:"mobile"`
Country string `json:"country"`
State string `json:"state"`
City string `json:"city"`
Alias string `json:"alias"`
Qrcode string `json:"qrcode"`
Signature string `json:"signature"`
TenantId string `json:"tenantId"`
TenantUserId string `json:"tenantUserId"`
ExtendProps map[string]interface{} `json:"extendProps"`
IsDeleted bool `json:"isDeleted"`
}
type AccountAddParameters struct {
AppId string `json:"appId"`
AccountId string `json:"accountId"`
CustomId string `json:"customId"`
Nickname string `json:"nickname"`
Avatar string `json:"avatar"`
Gender int32 `json:"gender"`
Mobile string `json:"mobile"`
Country string `json:"country"`
State string `json:"state"`
City string `json:"city"`
Alias string `json:"alias"`
Qrcode string `json:"qrcode"`
Signature string `json:"signature"`
TenantId string `json:"tenantId"`
TenantUserId string `json:"tenantUserId"`
ExtendProps map[string]interface{} `json:"extendProps"`
}
func (api *Client) AccountAdd(req *AccountAddParameters) error {
return api.AccountAddContext(context.Background(), req)
}
func (api *Client) AccountAddContext(ctx context.Context, req *AccountAddParameters) error {
response := Response{}
err := api.postJSONMethod(ctx, "/account/add", req, &response)
if err != nil {
return err
}
return response.Err()
}
func (api *Client) AccountUpdate(req *AccountUpateParameters) error {
return api.AccountUpdateContext(context.Background(), req)
}
func (api *Client) AccountUpdateContext(ctx context.Context, req *AccountUpateParameters) error {
response := Response{}
err := api.postJSONMethod(ctx, "/account/update", req, &response)
if err != nil {
return err
}
return response.Err()
}