-
Notifications
You must be signed in to change notification settings - Fork 14
/
contact.go
182 lines (155 loc) · 5.22 KB
/
contact.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
package model
// 好友列表接口响应参数
type ContactListRes struct {
Items []*Contact `json:"items"`
}
// 好友删除接口请求参数
type ContactDeleteReq struct {
FriendId int `json:"friend_id,omitempty" v:"required"`
}
// 好友搜索接口请求参数
type ContactSearchReq struct {
Mobile string `json:"mobile,omitempty" v:"required"`
}
// 好友搜索接口响应参数
type ContactSearchRes struct {
Id int `json:"id,omitempty"`
Mobile string `json:"mobile,omitempty"`
Nickname string `json:"nickname,omitempty"`
Avatar string `json:"avatar,omitempty"`
Gender int `json:"gender,omitempty"`
Motto string `json:"motto,omitempty"`
}
// 好友备注修改接口请求参数
type ContactEditRemarkReq struct {
FriendId int `json:"friend_id,omitempty" v:"required"`
Remark string `json:"remark,omitempty"`
}
// 好友详情接口请求参数
type ContactDetailReq struct {
UserId int `json:"user_id,omitempty" v:"required"`
}
// 好友详情接口响应参数
type ContactDetailRes struct {
Id int `json:"id"`
Mobile string `json:"mobile"`
Nickname string `json:"nickname"`
Remark string `json:"remark"`
Avatar string `json:"avatar"`
Gender int `json:"gender"`
Motto string `json:"motto"`
FriendApply int `json:"friend_apply"`
FriendStatus int `json:"friend_status"`
GroupId string `json:"group_id"`
Email string `json:"email"`
Birthday string `json:"birthday"` // 生日
}
// 修改好友分组接口请求参数
type ContactChangeGroupReq struct {
UserId int `json:"user_id,omitempty" v:"required"`
GroupId string `json:"group_id,omitempty"`
}
// 添加好友申请接口请求参数
type ApplyCreateReq struct {
ContactApply
}
// 同意好友申请接口请求参数
type ApplyAcceptReq struct {
ContactApply
}
// 拒绝好友申请接口请求参数
type ApplyDeclineReq struct {
ApplyId string `json:"apply_id,omitempty" v:"required"`
Remark string `json:"remark,omitempty" v:"required"`
}
// 好友申请列表接口响应参数
type ApplyListRes struct {
Items []*Apply `json:"items"`
}
// 好友申请未读数接口响应参数
type ApplyUnreadNumRes struct {
UnreadNum int `json:"unread_num"`
}
// 好友分组列表接口响应参数
type ContactGroupListRes struct {
// 分组列表
Items []*ContactGroup `json:"items"`
}
// 保存好友分组列表接口请求参数
type GroupSaveReq struct {
Items []*ContactGroup `json:"items" v:"required"`
}
// 添加好友分组接口请求参数
type ContactGroupCreateReq struct {
Name string `json:"name,omitempty" v:"required"`
Sort int32 `json:"sort,omitempty" v:"required"`
}
// 添加好友分组接口响应参数
type ContactGroupCreateRes struct {
Id int32 `json:"id,omitempty"`
}
// 更新好友分组接口请求参数
type GroupUpdateReq struct {
Id int32 `json:"id,omitempty" v:"required"`
Name string `json:"name,omitempty" v:"required"`
Sort int32 `json:"sort,omitempty" v:"required"`
}
// 更新好友分组接口响应参数
type GroupUpdateRes struct {
Id int32 `json:"id,omitempty"`
}
// 删除好友分组接口请求参数
type GroupDeleteReq struct {
Id int32 `json:"id,omitempty" v:"required"`
}
// 删除好友分组接口响应参数
type GroupDeleteRes struct {
Id int32 `json:"id,omitempty"`
}
// 排序好友分组接口请求参数
type GroupSortReq struct {
Items []*ContactGroup `json:"items" v:"required"`
}
type Contact struct {
Id int `json:"id"` // 用户ID
Nickname string `json:"nickname"` // 昵称
Gender int `json:"gender"` // 性别[0:未知;1:男;2:女;]
Motto string `json:"motto"` // 座右铭
Avatar string `json:"avatar"` // 头像
Remark string `json:"remark"` // 备注
IsOnline int `json:"is_online"` // 是否在线
GroupId string `json:"group_id"` // 好友分组ID
}
type ContactListItem struct {
Id int `json:"id"` // 用户ID
Nickname string `json:"nickname"` // 用户昵称
Gender int `json:"gender"` // 用户性别[0:未知;1:男;2:女;]
Motto string `json:"motto"` // 用户座右铭
Avatar string `json:"avatar" ` // 好友头像
Remark string `json:"friend_remark"` // 好友的备注
IsOnline int `json:"is_online"` // 是否在线
GroupId string `json:"group_id"` // 好友分组ID
}
type Apply struct {
Id string `json:"id,omitempty"` // 申请ID
UserId int `json:"user_id,omitempty"` // 申请人ID
FriendId int `json:"friend_id,omitempty"` // 被申请人
Remark string `json:"remark,omitempty"` // 申请备注
Nickname string `json:"nickname,omitempty"` // 申请备注
Avatar string `json:"avatar,omitempty"` // 申请备注
CreatedAt string `json:"created_at,omitempty"` // 申请时间
}
// 用户添加好友申请
type ContactApply struct {
FriendId int `json:"friend_id,omitempty"`
Remark string `json:"remark,omitempty"`
ApplyId string `json:"apply_id,omitempty"`
UserId int `json:"user_id,omitempty"`
}
// 好友分组
type ContactGroup struct {
Id string `json:"id"` // ID
Name string `json:"name"` // 分组名称
Count int `json:"count"` // 成员总数
Sort int `json:"sort"` // 分组排序
}