Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
zhaominxu
Open-IM-Server
提交
8e173d82
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,发现更多精彩内容 >>
提交
8e173d82
编写于
12月 29, 2021
作者:
W
wenxu12345
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/tuoyun' into tuoyun
上级
7b67dc03
c4fca3b2
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
26 addition
and
20 deletion
+26
-20
internal/api/conversation/conversation.go
internal/api/conversation/conversation.go
+12
-6
internal/api/manage/management_user.go
internal/api/manage/management_user.go
+14
-14
未找到文件。
internal/api/conversation/conversation.go
浏览文件 @
8e173d82
...
...
@@ -39,8 +39,10 @@ func GetAllConversationMessageOpt(c *gin.Context) {
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"errCode"
:
500
,
"errMsg"
:
"GetAllConversationMsgOpt rpc failed, "
+
err
.
Error
()})
return
}
resp
:=
api
.
GetAllConversationMessageOptResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
CommonResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
CommonResp
.
ErrMsg
}}
resp
.
ConversationOptResultList
=
RpcResp
.
ConversationOptResultList
resp
:=
api
.
GetAllConversationMessageOptResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
CommonResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
CommonResp
.
ErrMsg
},
ConversationOptResultList
:
RpcResp
.
ConversationOptResultList
}
if
len
(
RpcResp
.
ConversationOptResultList
)
==
0
{
resp
.
ConversationOptResultList
=
[]
*
user
.
OptResult
{}
}
log
.
NewInfo
(
req
.
OperationID
,
"GetAllConversationMsgOpt api return: "
,
resp
)
c
.
JSON
(
http
.
StatusOK
,
resp
)
}
...
...
@@ -69,8 +71,10 @@ func GetReceiveMessageOpt(c *gin.Context) {
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"errCode"
:
500
,
"errMsg"
:
"GetReceiveMessageOpt rpc failed, "
+
err
.
Error
()})
return
}
resp
:=
api
.
GetReceiveMessageOptResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
CommonResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
CommonResp
.
ErrMsg
}}
resp
.
ConversationOptResultList
=
RpcResp
.
ConversationOptResultList
resp
:=
api
.
GetReceiveMessageOptResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
CommonResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
CommonResp
.
ErrMsg
},
ConversationOptResultList
:
RpcResp
.
ConversationOptResultList
}
if
len
(
RpcResp
.
ConversationOptResultList
)
==
0
{
resp
.
ConversationOptResultList
=
[]
*
user
.
OptResult
{}
}
log
.
NewInfo
(
req
.
OperationID
,
"GetReceiveMessageOpt api return: "
,
resp
)
c
.
JSON
(
http
.
StatusOK
,
resp
)
}
...
...
@@ -99,8 +103,10 @@ func SetReceiveMessageOpt(c *gin.Context) {
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"errCode"
:
500
,
"errMsg"
:
"SetReceiveMessageOpt rpc failed, "
+
err
.
Error
()})
return
}
resp
:=
api
.
SetReceiveMessageOptResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
CommonResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
CommonResp
.
ErrMsg
}}
resp
.
OptResultList
=
RpcResp
.
OptResultList
resp
:=
api
.
SetReceiveMessageOptResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
CommonResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
CommonResp
.
ErrMsg
},
OptResultList
:
RpcResp
.
OptResultList
}
if
len
(
RpcResp
.
OptResultList
)
==
0
{
resp
.
OptResultList
=
[]
*
user
.
OptResult
{}
}
log
.
NewInfo
(
req
.
OperationID
,
"SetReceiveMessageOpt api return: "
,
resp
)
c
.
JSON
(
http
.
StatusOK
,
resp
)
}
internal/api/manage/management_user.go
浏览文件 @
8e173d82
...
...
@@ -47,12 +47,10 @@ func DeleteUser(c *gin.Context) {
c
.
JSON
(
http
.
StatusInternalServerError
,
gin
.
H
{
"errCode"
:
500
,
"errMsg"
:
"call delete users rpc server failed"
})
return
}
failedUserIDList
:=
make
([]
string
,
0
)
for
_
,
v
:=
range
RpcResp
.
FailedUserIDList
{
failedUserIDList
=
append
(
failedUserIDList
,
v
)
resp
:=
api
.
DeleteUsersResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
CommonResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
CommonResp
.
ErrMsg
},
FailedUserIDList
:
RpcResp
.
FailedUserIDList
}
if
len
(
RpcResp
.
FailedUserIDList
)
==
0
{
resp
.
FailedUserIDList
=
[]
string
{}
}
resp
:=
api
.
DeleteUsersResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
CommonResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
CommonResp
.
ErrMsg
}}
resp
.
FailedUserIDList
=
failedUserIDList
log
.
NewInfo
(
req
.
OperationID
,
"DeleteUser api return"
,
resp
)
c
.
JSON
(
http
.
StatusOK
,
resp
)
}
...
...
@@ -80,12 +78,10 @@ func GetAllUsersUid(c *gin.Context) {
c
.
JSON
(
http
.
StatusInternalServerError
,
gin
.
H
{
"errCode"
:
500
,
"errMsg"
:
"call GetAllUsersUid users rpc server failed"
})
return
}
userIDList
:=
make
([]
string
,
0
)
for
_
,
v
:=
range
RpcResp
.
UserIDList
{
userIDList
=
append
(
userIDList
,
v
)
resp
:=
api
.
GetAllUsersUidResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
CommonResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
CommonResp
.
ErrMsg
},
UserIDList
:
RpcResp
.
UserIDList
}
if
len
(
RpcResp
.
UserIDList
)
==
0
{
resp
.
UserIDList
=
[]
string
{}
}
resp
:=
api
.
GetAllUsersUidResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
CommonResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
CommonResp
.
ErrMsg
}}
resp
.
UserIDList
=
userIDList
log
.
NewInfo
(
req
.
OperationID
,
"GetAllUsersUid api return"
,
resp
)
c
.
JSON
(
http
.
StatusOK
,
resp
)
...
...
@@ -115,8 +111,10 @@ func AccountCheck(c *gin.Context) {
c
.
JSON
(
http
.
StatusInternalServerError
,
gin
.
H
{
"errCode"
:
500
,
"errMsg"
:
"call AccountCheck users rpc server failed"
})
return
}
resp
:=
api
.
AccountCheckResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
CommonResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
CommonResp
.
ErrMsg
}}
resp
.
ResultList
=
RpcResp
.
ResultList
resp
:=
api
.
AccountCheckResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
CommonResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
CommonResp
.
ErrMsg
},
ResultList
:
RpcResp
.
ResultList
}
if
len
(
RpcResp
.
ResultList
)
==
0
{
resp
.
ResultList
=
[]
*
rpc
.
AccountCheckResp_SingleUserStatus
{}
}
log
.
NewInfo
(
req
.
OperationID
,
"AccountCheck api return"
,
resp
)
c
.
JSON
(
http
.
StatusOK
,
resp
)
}
...
...
@@ -172,8 +170,10 @@ func GetUsersOnlineStatus(c *gin.Context) {
}
respResult
=
append
(
respResult
,
temp
)
}
resp
:=
api
.
GetUsersOnlineStatusResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
0
,
ErrMsg
:
""
}}
resp
.
SuccessResult
=
respResult
resp
:=
api
.
GetUsersOnlineStatusResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
0
,
ErrMsg
:
""
},
SuccessResult
:
respResult
}
if
len
(
respResult
)
==
0
{
resp
.
SuccessResult
=
[]
*
pbRelay
.
GetUsersOnlineStatusResp_SuccessResult
{}
}
log
.
NewInfo
(
req
.
OperationID
,
"GetUsersOnlineStatus api return"
,
resp
)
c
.
JSON
(
http
.
StatusOK
,
resp
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录