Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
zhaominxu
Open-IM-Server
提交
cd6bb1b9
O
Open-IM-Server
项目概览
zhaominxu
/
Open-IM-Server
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Open-IM-Server
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cd6bb1b9
编写于
12月 29, 2021
作者:
programor_guo
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/tuoyun' into tuoyun
上级
03f491ab
667ceb21
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
204 addition
and
192 deletion
+204
-192
cmd/open_im_api/main.go
cmd/open_im_api/main.go
+4
-4
internal/api/friend/friend.go
internal/api/friend/friend.go
+12
-7
internal/rpc/friend/firend.go
internal/rpc/friend/firend.go
+18
-17
pkg/base_info/friend_api_struct.go
pkg/base_info/friend_api_struct.go
+11
-5
pkg/common/db/mysql_model/im_mysql_model/model_struct.go
pkg/common/db/mysql_model/im_mysql_model/model_struct.go
+1
-1
pkg/common/utils/utils.go
pkg/common/utils/utils.go
+14
-14
pkg/proto/friend/friend.pb.go
pkg/proto/friend/friend.pb.go
+141
-141
pkg/proto/friend/friend.proto
pkg/proto/friend/friend.proto
+3
-3
未找到文件。
cmd/open_im_api/main.go
浏览文件 @
cd6bb1b9
...
...
@@ -34,14 +34,14 @@ func main() {
friendRouterGroup
.
POST
(
"/add_friend"
,
friend
.
AddFriend
)
//1
friendRouterGroup
.
POST
(
"/get_friend_apply_list"
,
friend
.
GetFriendApplyList
)
//1
friendRouterGroup
.
POST
(
"/get_self_apply_list"
,
friend
.
GetSelfApplyList
)
//1
friendRouterGroup
.
POST
(
"/get_friend_list"
,
friend
.
GetFriendList
)
friendRouterGroup
.
POST
(
"/get_friend_list"
,
friend
.
GetFriendList
)
//1
friendRouterGroup
.
POST
(
"/add_blacklist"
,
friend
.
AddBlacklist
)
friendRouterGroup
.
POST
(
"/get_blacklist"
,
friend
.
GetBlacklist
)
friendRouterGroup
.
POST
(
"/remove_blacklist"
,
friend
.
RemoveBlacklist
)
friendRouterGroup
.
POST
(
"/delete_friend"
,
friend
.
DeleteFriend
)
friendRouterGroup
.
POST
(
"/add_friend_response"
,
friend
.
AddFriendResponse
)
friendRouterGroup
.
POST
(
"/set_friend_
comment"
,
friend
.
SetFriendComment
)
friendRouterGroup
.
POST
(
"/is_friend"
,
friend
.
IsFriend
)
friendRouterGroup
.
POST
(
"/add_friend_response"
,
friend
.
AddFriendResponse
)
//1
friendRouterGroup
.
POST
(
"/set_friend_
remark"
,
friend
.
SetFriendRemark
)
//1
friendRouterGroup
.
POST
(
"/is_friend"
,
friend
.
IsFriend
)
//1
friendRouterGroup
.
POST
(
"/import_friend"
,
friend
.
ImportFriend
)
}
//group related routing group
...
...
internal/api/friend/friend.go
浏览文件 @
cd6bb1b9
...
...
@@ -215,14 +215,14 @@ func GetBlacklist(c *gin.Context) {
c
.
JSON
(
http
.
StatusOK
,
resp
)
}
func
SetFriend
Comment
(
c
*
gin
.
Context
)
{
params
:=
api
.
SetFriend
Comment
Req
{}
func
SetFriend
Remark
(
c
*
gin
.
Context
)
{
params
:=
api
.
SetFriend
Remark
Req
{}
if
err
:=
c
.
BindJSON
(
&
params
);
err
!=
nil
{
log
.
NewError
(
"0"
,
"BindJSON failed "
,
err
.
Error
())
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"errCode"
:
400
,
"errMsg"
:
err
.
Error
()})
return
}
req
:=
&
rpc
.
SetFriend
Comment
Req
{
CommID
:
&
rpc
.
CommID
{}}
req
:=
&
rpc
.
SetFriend
Remark
Req
{
CommID
:
&
rpc
.
CommID
{}}
utils
.
CopyStructFields
(
req
.
CommID
,
&
params
.
ParamsCommFriend
)
req
.
Remark
=
params
.
Remark
var
ok
bool
...
...
@@ -236,13 +236,13 @@ func SetFriendComment(c *gin.Context) {
etcdConn
:=
getcdv3
.
GetConn
(
config
.
Config
.
Etcd
.
EtcdSchema
,
strings
.
Join
(
config
.
Config
.
Etcd
.
EtcdAddr
,
","
),
config
.
Config
.
RpcRegisterName
.
OpenImFriendName
)
client
:=
rpc
.
NewFriendClient
(
etcdConn
)
RpcResp
,
err
:=
client
.
SetFriend
Comment
(
context
.
Background
(),
req
)
RpcResp
,
err
:=
client
.
SetFriend
Remark
(
context
.
Background
(),
req
)
if
err
!=
nil
{
log
.
NewError
(
req
.
CommID
.
OperationID
,
"SetFriendComment failed "
,
err
.
Error
(),
req
.
String
())
c
.
JSON
(
http
.
StatusInternalServerError
,
gin
.
H
{
"errCode"
:
500
,
"errMsg"
:
"call set friend comment rpc server failed"
})
return
}
resp
:=
api
.
SetFriend
Comment
Resp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
CommonResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
CommonResp
.
ErrMsg
}}
resp
:=
api
.
SetFriend
Remark
Resp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
CommonResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
CommonResp
.
ErrMsg
}}
log
.
NewInfo
(
req
.
CommID
.
OperationID
,
"SetFriendComment api return "
,
resp
)
c
.
JSON
(
http
.
StatusOK
,
resp
)
...
...
@@ -305,7 +305,9 @@ func IsFriend(c *gin.Context) {
c
.
JSON
(
http
.
StatusInternalServerError
,
gin
.
H
{
"errCode"
:
500
,
"errMsg"
:
"call add friend rpc server failed"
})
return
}
resp
:=
api
.
IsFriendResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
ErrMsg
},
Response
:
RpcResp
.
Response
}
resp
:=
api
.
IsFriendResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
ErrMsg
}}
resp
.
Response
.
Friend
=
RpcResp
.
Response
log
.
NewInfo
(
req
.
CommID
.
OperationID
,
"IsFriend api return "
,
resp
)
c
.
JSON
(
http
.
StatusOK
,
resp
)
}
...
...
@@ -352,7 +354,7 @@ func GetFriendList(c *gin.Context) {
return
}
req
:=
&
rpc
.
GetFriendListReq
{
CommID
:
&
rpc
.
CommID
{}}
utils
.
CopyStructFields
(
req
.
CommID
,
&
params
.
ParamsCommFriend
)
utils
.
CopyStructFields
(
req
.
CommID
,
&
params
)
var
ok
bool
ok
,
req
.
CommID
.
OpUserID
=
token_verify
.
GetUserIDFromToken
(
c
.
Request
.
Header
.
Get
(
"token"
))
if
!
ok
{
...
...
@@ -372,6 +374,9 @@ func GetFriendList(c *gin.Context) {
}
resp
:=
api
.
GetFriendListResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
ErrMsg
},
FriendInfoList
:
RpcResp
.
FriendInfoList
}
if
len
(
resp
.
FriendInfoList
)
==
0
{
resp
.
FriendInfoList
=
[]
*
open_im_sdk
.
FriendInfo
{}
}
log
.
NewInfo
(
req
.
CommID
.
OperationID
,
"GetFriendList api return "
,
resp
)
c
.
JSON
(
http
.
StatusOK
,
resp
)
}
...
...
internal/rpc/friend/firend.go
浏览文件 @
cd6bb1b9
...
...
@@ -116,7 +116,7 @@ func (s *friendServer) AddBlacklist(ctx context.Context, req *pbFriend.AddBlackl
log
.
NewError
(
req
.
CommID
.
OperationID
,
"CheckAccess false "
,
req
.
CommID
.
OpUserID
,
req
.
CommID
.
FromUserID
)
return
&
pbFriend
.
AddBlacklistResp
{
CommonResp
:
&
pbFriend
.
CommonResp
{
ErrCode
:
constant
.
ErrAccess
.
ErrCode
,
ErrMsg
:
constant
.
ErrAccess
.
ErrMsg
}},
nil
}
black
:=
imdb
.
Black
{
OwnerUserID
:
req
.
CommID
.
FromUserID
,
BlockUserID
:
req
.
CommID
.
ToUserID
}
black
:=
imdb
.
Black
{
OwnerUserID
:
req
.
CommID
.
FromUserID
,
BlockUserID
:
req
.
CommID
.
ToUserID
,
OperatorUserID
:
req
.
CommID
.
OpUserID
}
err
:=
imdb
.
InsertInToUserBlackList
(
black
)
if
err
!=
nil
{
...
...
@@ -257,15 +257,16 @@ func (s *friendServer) AddFriendResponse(ctx context.Context, req *pbFriend.AddF
_
,
err
=
imdb
.
GetFriendRelationshipFromFriend
(
req
.
CommID
.
ToUserID
,
req
.
CommID
.
FromUserID
)
if
err
==
nil
{
log
.
NewWarn
(
req
.
CommID
.
OperationID
,
"FindFriendRelationshipFromFriend exist"
,
req
.
CommID
.
ToUserID
,
req
.
CommID
.
FromUserID
)
}
toInsertFollow
:=
imdb
.
Friend
{
OwnerUserID
:
req
.
CommID
.
ToUserID
,
FriendUserID
:
req
.
CommID
.
FromUserID
,
OperatorUserID
:
req
.
CommID
.
OpUserID
}
err
=
imdb
.
InsertToFriend
(
&
toInsertFollow
)
if
err
!=
nil
{
log
.
NewError
(
req
.
CommID
.
OperationID
,
"InsertToFriend failed "
,
err
.
Error
(),
toInsertFollow
)
return
&
pbFriend
.
AddFriendResponseResp
{
CommonResp
:
&
pbFriend
.
CommonResp
{
ErrCode
:
constant
.
ErrDB
.
ErrCode
,
ErrMsg
:
constant
.
ErrDB
.
ErrMsg
}},
nil
log
.
NewWarn
(
req
.
CommID
.
OperationID
,
"GetFriendRelationshipFromFriend exist"
,
req
.
CommID
.
ToUserID
,
req
.
CommID
.
FromUserID
)
}
else
{
toInsertFollow
:=
imdb
.
Friend
{
OwnerUserID
:
req
.
CommID
.
ToUserID
,
FriendUserID
:
req
.
CommID
.
FromUserID
,
OperatorUserID
:
req
.
CommID
.
OpUserID
}
err
=
imdb
.
InsertToFriend
(
&
toInsertFollow
)
if
err
!=
nil
{
log
.
NewError
(
req
.
CommID
.
OperationID
,
"InsertToFriend failed "
,
err
.
Error
(),
toInsertFollow
)
return
&
pbFriend
.
AddFriendResponseResp
{
CommonResp
:
&
pbFriend
.
CommonResp
{
ErrCode
:
constant
.
ErrDB
.
ErrCode
,
ErrMsg
:
constant
.
ErrDB
.
ErrMsg
}},
nil
}
chat
.
FriendAddedNotification
(
req
.
CommID
.
OperationID
,
req
.
CommID
.
OpUserID
,
req
.
CommID
.
FromUserID
,
req
.
CommID
.
ToUserID
)
}
chat
.
FriendAddedNotification
(
req
.
CommID
.
OperationID
,
req
.
CommID
.
OpUserID
,
req
.
CommID
.
FromUserID
,
req
.
CommID
.
ToUserID
)
}
chat
.
FriendApplicationProcessedNotification
(
req
)
...
...
@@ -324,22 +325,22 @@ func (s *friendServer) GetBlacklist(ctx context.Context, req *pbFriend.GetBlackl
return
&
pbFriend
.
GetBlacklistResp
{
BlackUserInfoList
:
userInfoList
},
nil
}
func
(
s
*
friendServer
)
SetFriend
Comment
(
ctx
context
.
Context
,
req
*
pbFriend
.
SetFriendCommentReq
)
(
*
pbFriend
.
SetFriendComment
Resp
,
error
)
{
func
(
s
*
friendServer
)
SetFriend
Remark
(
ctx
context
.
Context
,
req
*
pbFriend
.
SetFriendRemarkReq
)
(
*
pbFriend
.
SetFriendRemark
Resp
,
error
)
{
log
.
NewInfo
(
req
.
CommID
.
OperationID
,
"SetFriendComment args "
,
req
.
String
())
//Parse token, to find current user information
if
!
token_verify
.
CheckAccess
(
req
.
CommID
.
OpUserID
,
req
.
CommID
.
FromUserID
)
{
log
.
NewError
(
req
.
CommID
.
OperationID
,
"CheckAccess false "
,
req
.
CommID
.
OpUserID
,
req
.
CommID
.
FromUserID
)
return
&
pbFriend
.
SetFriend
Comment
Resp
{
CommonResp
:
&
pbFriend
.
CommonResp
{
ErrCode
:
constant
.
ErrAccess
.
ErrCode
,
ErrMsg
:
constant
.
ErrAccess
.
ErrMsg
}},
nil
return
&
pbFriend
.
SetFriend
Remark
Resp
{
CommonResp
:
&
pbFriend
.
CommonResp
{
ErrCode
:
constant
.
ErrAccess
.
ErrCode
,
ErrMsg
:
constant
.
ErrAccess
.
ErrMsg
}},
nil
}
err
:=
imdb
.
UpdateFriendComment
(
req
.
CommID
.
FromUserID
,
req
.
CommID
.
ToUserID
,
req
.
Remark
)
if
err
!=
nil
{
log
.
NewError
(
req
.
CommID
.
OperationID
,
"UpdateFriendComment failed "
,
req
.
CommID
.
FromUserID
,
req
.
CommID
.
ToUserID
,
req
.
Remark
)
return
&
pbFriend
.
SetFriend
Comment
Resp
{
CommonResp
:
&
pbFriend
.
CommonResp
{
ErrCode
:
constant
.
ErrDB
.
ErrCode
,
ErrMsg
:
constant
.
ErrDB
.
ErrMsg
}},
nil
return
&
pbFriend
.
SetFriend
Remark
Resp
{
CommonResp
:
&
pbFriend
.
CommonResp
{
ErrCode
:
constant
.
ErrDB
.
ErrCode
,
ErrMsg
:
constant
.
ErrDB
.
ErrMsg
}},
nil
}
log
.
NewInfo
(
req
.
CommID
.
OperationID
,
"rpc SetFriendComment ok"
)
chat
.
FriendInfoChangedNotification
(
req
.
CommID
.
OperationID
,
req
.
CommID
.
OpUserID
,
req
.
CommID
.
FromUserID
,
req
.
CommID
.
ToUserID
)
return
&
pbFriend
.
SetFriend
Comment
Resp
{
CommonResp
:
&
pbFriend
.
CommonResp
{}},
nil
return
&
pbFriend
.
SetFriend
Remark
Resp
{
CommonResp
:
&
pbFriend
.
CommonResp
{}},
nil
}
func
(
s
*
friendServer
)
RemoveBlacklist
(
ctx
context
.
Context
,
req
*
pbFriend
.
RemoveBlacklistReq
)
(
*
pbFriend
.
RemoveBlacklistResp
,
error
)
{
...
...
@@ -407,9 +408,9 @@ func (s *friendServer) GetFriendList(ctx context.Context, req *pbFriend.GetFrien
}
var
userInfoList
[]
*
sdkws
.
FriendInfo
for
_
,
friendUser
:=
range
friends
{
var
friendUserInfo
sdkws
.
FriendInfo
utils
.
CopyStructFields
(
&
friendUserInfo
,
friendUser
)
friendUserInfo
:=
sdkws
.
FriendInfo
{
FriendUser
:
&
sdkws
.
UserInfo
{}}
cp
.
FriendDBCopyOpenIM
(
&
friendUserInfo
,
&
friendUser
)
log
.
NewDebug
(
req
.
CommID
.
OperationID
,
"friends : "
,
friendUser
,
"openim friends: "
,
friendUserInfo
)
userInfoList
=
append
(
userInfoList
,
&
friendUserInfo
)
}
log
.
NewInfo
(
req
.
CommID
.
OperationID
,
"rpc GetFriendList ok"
,
pbFriend
.
GetFriendListResp
{
FriendInfoList
:
userInfoList
})
...
...
@@ -458,7 +459,7 @@ func (s *friendServer) GetSelfApplyList(ctx context.Context, req *pbFriend.GetSe
var
selfApplyOtherUserList
[]
*
sdkws
.
FriendRequest
for
_
,
selfApplyOtherUserInfo
:=
range
usersInfo
{
var
userInfo
sdkws
.
FriendRequest
// pbFriend.ApplyUserInfo
cp
.
FriendRequestDBCopyOpenIM
(
&
userInfo
,
selfApplyOtherUserInfo
)
cp
.
FriendRequestDBCopyOpenIM
(
&
userInfo
,
&
selfApplyOtherUserInfo
)
selfApplyOtherUserList
=
append
(
selfApplyOtherUserList
,
&
userInfo
)
}
log
.
NewInfo
(
req
.
CommID
.
OperationID
,
"rpc GetSelfApplyList ok"
,
pbFriend
.
GetSelfApplyListResp
{
FriendRequestList
:
selfApplyOtherUserList
})
...
...
pkg/base_info/friend_api_struct.go
浏览文件 @
cd6bb1b9
...
...
@@ -35,7 +35,9 @@ type AddFriendResp struct {
type
AddFriendResponseReq
struct
{
ParamsCommFriend
Flag
int32
`json:"flag" binding:"required"`
//binding:"oneof=0 1 2"`
//}
Flag
int32
`json:"flag" binding:"required,oneof=-1 0 1"`
HandleMsg
string
`json:"handleMsg"`
}
type
AddFriendResponseResp
struct
{
...
...
@@ -69,11 +71,11 @@ type BlackUserInfo struct {
open_im_sdk
.
PublicUserInfo
}
type
SetFriend
Comment
Req
struct
{
type
SetFriend
Remark
Req
struct
{
ParamsCommFriend
Remark
string
`json:"remark" binding:"required"`
}
type
SetFriend
Comment
Resp
struct
{
type
SetFriend
Remark
Resp
struct
{
CommResp
}
...
...
@@ -87,9 +89,12 @@ type RemoveBlackListResp struct {
type
IsFriendReq
struct
{
ParamsCommFriend
}
type
Response
struct
{
Friend
bool
`json:"isFriend"`
}
type
IsFriendResp
struct
{
CommResp
Response
bool
`json:"response
"`
Response
Response
`json:"data
"`
}
type
GetFriendsInfoReq
struct
{
...
...
@@ -101,7 +106,8 @@ type GetFriendsInfoResp struct {
}
type
GetFriendListReq
struct
{
ParamsCommFriend
OperationID
string
`json:"operationID" binding:"required"`
FromUserID
string
`json:"fromUserID" binding:"required"`
}
type
GetFriendListResp
struct
{
CommResp
...
...
pkg/common/db/mysql_model/im_mysql_model/model_struct.go
浏览文件 @
cd6bb1b9
...
...
@@ -161,6 +161,6 @@ type Black struct {
CreateTime
time
.
Time
`gorm:"column:create_time"`
BlockUserID
string
`gorm:"column:block_user_id;primaryKey;"`
AddSource
int32
`gorm:"column:add_source"`
OperatorUserID
int32
`gorm:"column:operator_user_id"`
OperatorUserID
string
`gorm:"column:operator_user_id"`
Ex
string
`gorm:"column:ex"`
}
pkg/common/utils/utils.go
浏览文件 @
cd6bb1b9
...
...
@@ -14,12 +14,12 @@ func OperationIDGenerator() string {
return
strconv
.
FormatInt
(
time
.
Now
()
.
UnixNano
()
+
int64
(
rand
.
Uint32
()),
10
)
}
func
FriendOpenIMCopyDB
(
dst
*
imdb
.
Friend
,
src
open_im_sdk
.
FriendInfo
)
{
func
FriendOpenIMCopyDB
(
dst
*
imdb
.
Friend
,
src
*
open_im_sdk
.
FriendInfo
)
{
utils
.
CopyStructFields
(
dst
,
src
)
dst
.
FriendUserID
=
src
.
FriendUser
.
UserID
}
func
FriendDBCopyOpenIM
(
dst
*
open_im_sdk
.
FriendInfo
,
src
imdb
.
Friend
)
{
func
FriendDBCopyOpenIM
(
dst
*
open_im_sdk
.
FriendInfo
,
src
*
imdb
.
Friend
)
{
utils
.
CopyStructFields
(
dst
,
src
)
user
,
_
:=
imdb
.
GetUserByUserID
(
src
.
FriendUserID
)
if
user
!=
nil
{
...
...
@@ -30,21 +30,21 @@ func FriendDBCopyOpenIM(dst *open_im_sdk.FriendInfo, src imdb.Friend) {
}
//
func
FriendRequestOpenIMCopyDB
(
dst
*
imdb
.
FriendRequest
,
src
open_im_sdk
.
FriendRequest
)
{
func
FriendRequestOpenIMCopyDB
(
dst
*
imdb
.
FriendRequest
,
src
*
open_im_sdk
.
FriendRequest
)
{
utils
.
CopyStructFields
(
dst
,
src
)
}
func
FriendRequestDBCopyOpenIM
(
dst
*
open_im_sdk
.
FriendRequest
,
src
imdb
.
FriendRequest
)
{
func
FriendRequestDBCopyOpenIM
(
dst
*
open_im_sdk
.
FriendRequest
,
src
*
imdb
.
FriendRequest
)
{
utils
.
CopyStructFields
(
dst
,
src
)
dst
.
CreateTime
=
src
.
CreateTime
.
Unix
()
dst
.
HandleTime
=
src
.
HandleTime
.
Unix
()
}
func
GroupOpenIMCopyDB
(
dst
*
imdb
.
Group
,
src
open_im_sdk
.
GroupInfo
)
{
func
GroupOpenIMCopyDB
(
dst
*
imdb
.
Group
,
src
*
open_im_sdk
.
GroupInfo
)
{
utils
.
CopyStructFields
(
dst
,
src
)
}
func
GroupDBCopyOpenIM
(
dst
*
open_im_sdk
.
GroupInfo
,
src
imdb
.
Group
)
{
func
GroupDBCopyOpenIM
(
dst
*
open_im_sdk
.
GroupInfo
,
src
*
imdb
.
Group
)
{
utils
.
CopyStructFields
(
dst
,
src
)
user
,
_
:=
imdb
.
GetGroupOwnerInfoByGroupID
(
src
.
GroupID
)
if
user
!=
nil
{
...
...
@@ -54,11 +54,11 @@ func GroupDBCopyOpenIM(dst *open_im_sdk.GroupInfo, src imdb.Group) {
dst
.
CreateTime
=
src
.
CreateTime
.
Unix
()
}
func
GroupMemberOpenIMCopyDB
(
dst
*
imdb
.
GroupMember
,
src
open_im_sdk
.
GroupMemberFullInfo
)
{
func
GroupMemberOpenIMCopyDB
(
dst
*
imdb
.
GroupMember
,
src
*
open_im_sdk
.
GroupMemberFullInfo
)
{
utils
.
CopyStructFields
(
dst
,
src
)
}
func
GroupMemberDBCopyOpenIM
(
dst
*
open_im_sdk
.
GroupMemberFullInfo
,
src
imdb
.
GroupMember
)
{
func
GroupMemberDBCopyOpenIM
(
dst
*
open_im_sdk
.
GroupMemberFullInfo
,
src
*
imdb
.
GroupMember
)
{
utils
.
CopyStructFields
(
dst
,
src
)
if
token_verify
.
IsMangerUserID
(
src
.
UserID
)
{
u
,
_
:=
imdb
.
GetUserByUserID
(
src
.
UserID
)
...
...
@@ -70,31 +70,31 @@ func GroupMemberDBCopyOpenIM(dst *open_im_sdk.GroupMemberFullInfo, src imdb.Grou
dst
.
JoinTime
=
src
.
JoinTime
.
Unix
()
}
func
GroupRequestOpenIMCopyDB
(
dst
*
imdb
.
GroupRequest
,
src
open_im_sdk
.
GroupRequest
)
{
func
GroupRequestOpenIMCopyDB
(
dst
*
imdb
.
GroupRequest
,
src
*
open_im_sdk
.
GroupRequest
)
{
utils
.
CopyStructFields
(
dst
,
src
)
}
func
GroupRequestDBCopyOpenIM
(
dst
*
open_im_sdk
.
GroupRequest
,
src
imdb
.
GroupRequest
)
{
func
GroupRequestDBCopyOpenIM
(
dst
*
open_im_sdk
.
GroupRequest
,
src
*
imdb
.
GroupRequest
)
{
utils
.
CopyStructFields
(
dst
,
src
)
dst
.
ReqTime
=
src
.
ReqTime
.
Unix
()
dst
.
HandleTime
=
src
.
HandledTime
.
Unix
()
}
func
UserOpenIMCopyDB
(
dst
*
imdb
.
User
,
src
open_im_sdk
.
UserInfo
)
{
func
UserOpenIMCopyDB
(
dst
*
imdb
.
User
,
src
*
open_im_sdk
.
UserInfo
)
{
utils
.
CopyStructFields
(
dst
,
src
)
}
func
UserDBCopyOpenIM
(
dst
*
open_im_sdk
.
UserInfo
,
src
imdb
.
User
)
{
func
UserDBCopyOpenIM
(
dst
*
open_im_sdk
.
UserInfo
,
src
*
imdb
.
User
)
{
utils
.
CopyStructFields
(
dst
,
src
)
dst
.
CreateTime
=
src
.
CreateTime
.
Unix
()
}
func
BlackOpenIMCopyDB
(
dst
*
imdb
.
Black
,
src
open_im_sdk
.
BlackInfo
)
{
func
BlackOpenIMCopyDB
(
dst
*
imdb
.
Black
,
src
*
open_im_sdk
.
BlackInfo
)
{
utils
.
CopyStructFields
(
dst
,
src
)
dst
.
BlockUserID
=
src
.
BlackUserInfo
.
UserID
}
func
BlackDBCopyOpenIM
(
dst
*
open_im_sdk
.
BlackInfo
,
src
imdb
.
Black
)
{
func
BlackDBCopyOpenIM
(
dst
*
open_im_sdk
.
BlackInfo
,
src
*
imdb
.
Black
)
{
utils
.
CopyStructFields
(
dst
,
src
)
dst
.
CreateTime
=
src
.
CreateTime
.
Unix
()
user
,
_
:=
imdb
.
GetUserByUserID
(
src
.
BlockUserID
)
...
...
pkg/proto/friend/friend.pb.go
浏览文件 @
cd6bb1b9
此差异已折叠。
点击以展开。
pkg/proto/friend/friend.proto
浏览文件 @
cd6bb1b9
...
...
@@ -130,11 +130,11 @@ message AddFriendResponseResp{
CommonResp
CommonResp
=
1
;
}
message
SetFriend
Comment
Req
{
message
SetFriend
Remark
Req
{
CommID
CommID
=
1
;
string
Remark
=
2
;
}
message
SetFriend
Comment
Resp
{
message
SetFriend
Remark
Resp
{
CommonResp
CommonResp
=
1
;
}
...
...
@@ -160,6 +160,6 @@ service friend{
rpc
getBlacklist
(
GetBlacklistReq
)
returns
(
GetBlacklistResp
);
rpc
deleteFriend
(
DeleteFriendReq
)
returns
(
DeleteFriendResp
);
rpc
addFriendResponse
(
AddFriendResponseReq
)
returns
(
AddFriendResponseResp
);
rpc
setFriend
Comment
(
SetFriendCommentReq
)
returns
(
SetFriendComment
Resp
);
rpc
setFriend
Remark
(
SetFriendRemarkReq
)
returns
(
SetFriendRemark
Resp
);
rpc
importFriend
(
ImportFriendReq
)
returns
(
ImportFriendResp
);
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录