mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-12 04:55:59 +08:00
Refactor code
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
jsonData "Open_IM/internal/utils"
|
jsonData "Open_IM/internal/utils"
|
||||||
|
"github.com/golang/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
func KickGroupMember(c *gin.Context) {
|
func KickGroupMember(c *gin.Context) {
|
||||||
@@ -186,6 +187,7 @@ func GetGroupAllMemberList(c *gin.Context) {
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
memberListResp.Test = jsonData.JsonDataList(memberListResp.MemberList)
|
memberListResp.Test = jsonData.JsonDataList(memberListResp.MemberList)
|
||||||
|
|
||||||
log.NewInfo(req.OperationID, "GetGroupAllMember api return ", memberListResp)
|
log.NewInfo(req.OperationID, "GetGroupAllMember api return ", memberListResp)
|
||||||
c.JSON(http.StatusOK, memberListResp)
|
c.JSON(http.StatusOK, memberListResp)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
|
|
||||||
func JsonDataList(resp ...interface{}) []map[string]interface{} {
|
func JsonDataList(resp ...interface{}) []map[string]interface{} {
|
||||||
result := make([]map[string]interface{}, 0)
|
result := make([]map[string]interface{}, 0)
|
||||||
for _, v := range resp {
|
for _, v := range resp[0].([]proto.Message) {
|
||||||
m := ProtoToMap(v.(proto.Message), false)
|
m := ProtoToMap(v, false)
|
||||||
result = append(result, m)
|
result = append(result, m)
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
|||||||
Reference in New Issue
Block a user