Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
zhaominxu
Open-IM-Server
提交
9bee5c79
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,发现更多精彩内容 >>
提交
9bee5c79
编写于
12月 31, 2021
作者:
W
wenxu12345
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactor code
上级
aab6ad96
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
26 addition
and
32 deletion
+26
-32
internal/api/friend/friend.go
internal/api/friend/friend.go
+6
-10
internal/api/group/group.go
internal/api/group/group.go
+3
-6
internal/api/user/user.go
internal/api/user/user.go
+2
-0
pkg/base_info/friend_api_struct.go
pkg/base_info/friend_api_struct.go
+10
-11
pkg/base_info/group_api_struct.go
pkg/base_info/group_api_struct.go
+3
-4
pkg/base_info/user_api_struct.go
pkg/base_info/user_api_struct.go
+2
-1
未找到文件。
internal/api/friend/friend.go
浏览文件 @
9bee5c79
package
friend
import
(
jsonData
"Open_IM/internal/utils"
api
"Open_IM/pkg/base_info"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
...
...
@@ -214,10 +215,11 @@ func GetBlacklist(c *gin.Context) {
resp
:=
api
.
GetBlackListResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
ErrMsg
}}
for
_
,
v
:=
range
RpcResp
.
BlackUserInfoList
{
black
:=
api
.
Black
UserInfo
{}
black
:=
open_im_sdk
.
Public
UserInfo
{}
utils
.
CopyStructFields
(
&
black
,
v
)
resp
.
BlackUserInfoList
=
append
(
resp
.
BlackUserInfoList
,
&
black
)
}
resp
.
Data
=
jsonData
.
JsonDataList
(
resp
.
BlackUserInfoList
)
log
.
NewInfo
(
req
.
CommID
.
OperationID
,
"GetBlacklist api return "
,
resp
)
c
.
JSON
(
http
.
StatusOK
,
resp
)
}
...
...
@@ -381,9 +383,7 @@ 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
{}
}
resp
.
Data
=
jsonData
.
JsonDataList
(
resp
.
FriendInfoList
)
log
.
NewInfo
(
req
.
CommID
.
OperationID
,
"GetFriendList api return "
,
resp
)
c
.
JSON
(
http
.
StatusOK
,
resp
)
}
...
...
@@ -417,9 +417,7 @@ func GetFriendApplyList(c *gin.Context) {
}
resp
:=
api
.
GetFriendApplyListResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
ErrMsg
},
FriendRequestList
:
RpcResp
.
FriendRequestList
}
if
len
(
resp
.
FriendRequestList
)
==
0
{
resp
.
FriendRequestList
=
[]
*
open_im_sdk
.
FriendRequest
{}
}
resp
.
Data
=
jsonData
.
JsonDataList
(
resp
.
FriendRequestList
)
log
.
NewInfo
(
req
.
CommID
.
OperationID
,
"GetFriendApplyList api return "
,
resp
)
c
.
JSON
(
http
.
StatusOK
,
resp
)
}
...
...
@@ -451,9 +449,7 @@ func GetSelfApplyList(c *gin.Context) {
return
}
resp
:=
api
.
GetSelfApplyListResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
ErrMsg
},
FriendRequestList
:
RpcResp
.
FriendRequestList
}
if
len
(
resp
.
FriendRequestList
)
==
0
{
resp
.
FriendRequestList
=
[]
*
open_im_sdk
.
FriendRequest
{}
}
resp
.
Data
=
jsonData
.
JsonDataList
(
resp
.
FriendRequestList
)
log
.
NewInfo
(
req
.
CommID
.
OperationID
,
"GetSelfApplyList api return "
,
resp
)
c
.
JSON
(
http
.
StatusOK
,
resp
)
}
internal/api/group/group.go
浏览文件 @
9bee5c79
...
...
@@ -271,6 +271,7 @@ func CreateGroup(c *gin.Context) {
resp
:=
api
.
CreateGroupResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
ErrMsg
}}
if
RpcResp
.
ErrCode
==
0
{
utils
.
CopyStructFields
(
&
resp
.
GroupInfo
,
RpcResp
.
GroupInfo
)
resp
.
Data
=
jsonData
.
JsonDataOne
(
&
resp
.
GroupInfo
)
}
log
.
NewInfo
(
req
.
OperationID
,
"CreateGroup api return "
,
resp
)
c
.
JSON
(
http
.
StatusOK
,
resp
)
...
...
@@ -305,9 +306,7 @@ func GetGroupApplicationList(c *gin.Context) {
}
resp
:=
api
.
GetGroupApplicationListResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
reply
.
ErrCode
,
ErrMsg
:
reply
.
ErrMsg
},
GroupRequestList
:
reply
.
GroupRequestList
}
if
len
(
resp
.
GroupRequestList
)
==
0
{
resp
.
GroupRequestList
=
[]
*
open_im_sdk
.
GroupRequest
{}
}
resp
.
Data
=
jsonData
.
JsonDataList
(
resp
.
GroupRequestList
)
log
.
NewInfo
(
req
.
OperationID
,
"GetGroupApplicationList api return "
,
resp
)
c
.
JSON
(
http
.
StatusOK
,
resp
)
}
...
...
@@ -340,9 +339,7 @@ func GetGroupsInfo(c *gin.Context) {
}
resp
:=
api
.
GetGroupInfoResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
ErrMsg
},
GroupInfoList
:
RpcResp
.
GroupInfoList
}
if
len
(
resp
.
GroupInfoList
)
==
0
{
resp
.
GroupInfoList
=
[]
*
open_im_sdk
.
GroupInfo
{}
}
resp
.
Data
=
jsonData
.
JsonDataList
(
resp
.
GroupInfoList
)
log
.
NewInfo
(
req
.
OperationID
,
"GetGroupsInfo api return "
,
resp
)
c
.
JSON
(
http
.
StatusOK
,
resp
)
}
...
...
internal/api/user/user.go
浏览文件 @
9bee5c79
package
user
import
(
jsonData
"Open_IM/internal/utils"
api
"Open_IM/pkg/base_info"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
...
...
@@ -43,6 +44,7 @@ func GetUserInfo(c *gin.Context) {
}
resp
:=
api
.
GetUserInfoResp
{
CommResp
:
api
.
CommResp
{
ErrCode
:
RpcResp
.
CommonResp
.
ErrCode
,
ErrMsg
:
RpcResp
.
CommonResp
.
ErrMsg
},
UserInfoList
:
RpcResp
.
UserInfoList
}
resp
.
Data
=
jsonData
.
JsonDataList
(
resp
.
UserInfoList
)
log
.
NewInfo
(
req
.
OperationID
,
"GetUserInfo api return "
,
resp
)
c
.
JSON
(
http
.
StatusOK
,
resp
)
}
...
...
pkg/base_info/friend_api_struct.go
浏览文件 @
9bee5c79
...
...
@@ -39,8 +39,6 @@ type AddFriendResp struct {
type
AddFriendResponseReq
struct
{
ParamsCommFriend
//binding:"oneof=0 1 2"`
//}
Flag
int32
`json:"flag" binding:"required,oneof=-1 0 1"`
HandleMsg
string
`json:"handleMsg"`
}
...
...
@@ -61,7 +59,8 @@ type GetBlackListReq struct {
}
type
GetBlackListResp
struct
{
CommResp
BlackUserInfoList
[]
*
BlackUserInfo
`json:"data"`
BlackUserInfoList
[]
*
open_im_sdk
.
PublicUserInfo
Data
[]
map
[
string
]
interface
{}
`json:"data"`
}
//type PublicUserInfo struct {
...
...
@@ -71,10 +70,6 @@ type GetBlackListResp struct {
// Gender int32 `json:"gender"`
//}
type
BlackUserInfo
struct
{
open_im_sdk
.
PublicUserInfo
}
type
SetFriendRemarkReq
struct
{
ParamsCommFriend
Remark
string
`json:"remark" binding:"required"`
...
...
@@ -106,7 +101,8 @@ type GetFriendsInfoReq struct {
}
type
GetFriendsInfoResp
struct
{
CommResp
FriendInfoList
[]
*
open_im_sdk
.
FriendInfo
`json:"data"`
FriendInfoList
[]
*
open_im_sdk
.
FriendInfo
Data
[]
map
[
string
]
interface
{}
`json:"data"`
}
type
GetFriendListReq
struct
{
...
...
@@ -115,7 +111,8 @@ type GetFriendListReq struct {
}
type
GetFriendListResp
struct
{
CommResp
FriendInfoList
[]
*
open_im_sdk
.
FriendInfo
`json:"data"`
FriendInfoList
[]
*
open_im_sdk
.
FriendInfo
Data
[]
map
[
string
]
interface
{}
`json:"data"`
}
type
GetFriendApplyListReq
struct
{
...
...
@@ -124,7 +121,8 @@ type GetFriendApplyListReq struct {
}
type
GetFriendApplyListResp
struct
{
CommResp
FriendRequestList
[]
*
open_im_sdk
.
FriendRequest
`json:"data"`
FriendRequestList
[]
*
open_im_sdk
.
FriendRequest
Data
[]
map
[
string
]
interface
{}
`json:"data"`
}
type
GetSelfApplyListReq
struct
{
...
...
@@ -133,5 +131,6 @@ type GetSelfApplyListReq struct {
}
type
GetSelfApplyListResp
struct
{
CommResp
FriendRequestList
[]
*
open_im_sdk
.
FriendRequest
`json:"data"`
FriendRequestList
[]
*
open_im_sdk
.
FriendRequest
Data
[]
map
[
string
]
interface
{}
`json:"data"`
}
pkg/base_info/group_api_struct.go
浏览文件 @
9bee5c79
...
...
@@ -73,8 +73,7 @@ type GetGroupAllMemberReq struct {
type
GetGroupAllMemberResp
struct
{
CommResp
MemberList
[]
*
open_im_sdk
.
GroupMemberFullInfo
Data
[]
map
[
string
]
interface
{}
`json:"data"`
Data
[]
map
[
string
]
interface
{}
`json:"data"`
}
type
CreateGroupReq
struct
{
...
...
@@ -84,10 +83,10 @@ type CreateGroupReq struct {
GroupType
int32
`json:"groupType"`
OperationID
string
`json:"operationID" binding:"required"`
}
type
CreateGroupResp
struct
{
CommResp
GroupInfo
open_im_sdk
.
GroupInfo
`json:"data"`
GroupInfo
open_im_sdk
.
GroupInfo
Data
map
[
string
]
interface
{}
`json:"data"`
}
type
GetGroupApplicationListReq
struct
{
...
...
pkg/base_info/user_api_struct.go
浏览文件 @
9bee5c79
...
...
@@ -10,7 +10,8 @@ type GetUserInfoReq struct {
}
type
GetUserInfoResp
struct
{
CommResp
UserInfoList
[]
*
open_im_sdk
.
UserInfo
`json:"data"`
UserInfoList
[]
*
open_im_sdk
.
UserInfo
Data
[]
map
[
string
]
interface
{}
`json:"data"`
}
type
UpdateUserInfoReq
struct
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录