pull/351/head
wangchuxiao 2 years ago
parent da9918b655
commit 8d4e5ad3f1

@ -111,7 +111,6 @@ func main() {
groupRouterGroup.POST("/set_group_member_nickname", group.SetGroupMemberNickname)
groupRouterGroup.POST("/set_group_member_info", group.SetGroupMemberInfo)
groupRouterGroup.POST("/get_group_abstract_info", group.GetGroupAbstractInfo)
groupRouterGroup.POST("/get_groups", group.GetGroups)
//groupRouterGroup.POST("/get_group_all_member_list_by_split", group.GetGroupAllMemberListBySplit)
}
superGroupRouterGroup := r.Group("/super_group")

@ -11,6 +11,7 @@ import (
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils"
"context"
"github.com/golang/protobuf/ptypes/wrappers"
"google.golang.org/grpc"
@ -1318,7 +1319,3 @@ func GetGroupAbstractInfo(c *gin.Context) {
c.JSON(http.StatusOK, resp)
return
}
func GetGroups(c *gin.Context) {
}

@ -463,7 +463,7 @@ func GetUsers(c *gin.Context) {
resp api.GetUsersResp
reqPb rpc.GetUsersReq
)
if err := c.Bind(&req); err != nil {
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, "Bind failed ", err.Error(), req)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return

@ -3,8 +3,6 @@ package group
import (
"Open_IM/pkg/cms_api_struct"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
openIMHttp "Open_IM/pkg/common/http"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
commonPb "Open_IM/pkg/proto/sdk_ws"
@ -18,51 +16,15 @@ import (
"github.com/gin-gonic/gin"
)
func GetGroupByID(c *gin.Context) {
var (
req cms_api_struct.GetGroupByIDRequest
resp cms_api_struct.GetGroupByIDResponse
reqPb pbGroup.GetGroupByIDReq
)
if err := c.ShouldBindQuery(&req); err != nil {
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error())
openIMHttp.RespHttp200(c, constant.ErrArgs, nil)
return
}
reqPb.OperationID = utils.OperationIDGenerator()
log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req)
reqPb.GroupID = req.GroupID
etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID)
if etcdConn == nil {
errMsg := reqPb.OperationID + "getcdv3.GetDefaultConn == nil"
log.NewError(reqPb.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbGroup.NewGroupClient(etcdConn)
respPb, err := client.GetGroupByID(context.Background(), &reqPb)
if err != nil {
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetGroupById failed ", err.Error())
openIMHttp.RespHttp200(c, err, nil)
return
}
utils.CopyStructFields(&resp, respPb.CMSGroup.GroupInfo)
resp.GroupOwnerID = respPb.CMSGroup.GroupOwnerUserID
resp.GroupOwnerName = respPb.CMSGroup.GroupOwnerUserName
log.NewInfo("", utils.GetSelfFuncName(), "req: ", resp)
openIMHttp.RespHttp200(c, constant.OK, resp)
}
func GetGroups(c *gin.Context) {
var (
req cms_api_struct.GetGroupsRequest
resp cms_api_struct.GetGroupsResponse
reqPb pbGroup.GetGroupsReq
)
if err := c.ShouldBindQuery(&req); err != nil {
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error())
openIMHttp.RespHttp200(c, constant.ErrArgs, nil)
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
reqPb.OperationID = utils.OperationIDGenerator()
@ -80,7 +42,7 @@ func GetGroups(c *gin.Context) {
respPb, err := client.GetGroups(context.Background(), &reqPb)
if err != nil {
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetUserInfo failed ", err.Error())
openIMHttp.RespHttp200(c, err, nil)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()})
return
}
for _, v := range respPb.CMSGroups {
@ -91,54 +53,10 @@ func GetGroups(c *gin.Context) {
resp.Groups = append(resp.Groups, groupResp)
}
resp.GroupNums = int(respPb.GroupNum)
resp.CurrentPage = int(respPb.Pagination.PageNumber)
resp.ShowNumber = int(respPb.Pagination.ShowNumber)
log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp)
openIMHttp.RespHttp200(c, constant.OK, resp)
}
func GetGroupByName(c *gin.Context) {
var (
req cms_api_struct.GetGroupRequest
resp cms_api_struct.GetGroupResponse
reqPb pbGroup.GetGroupReq
)
if err := c.ShouldBindQuery(&req); err != nil {
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error())
openIMHttp.RespHttp200(c, constant.ErrArgs, nil)
return
}
reqPb.OperationID = utils.OperationIDGenerator()
log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req)
reqPb.GroupName = req.GroupName
reqPb.Pagination = &commonPb.RequestPagination{}
utils.CopyStructFields(&reqPb.Pagination, req)
etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID)
if etcdConn == nil {
errMsg := reqPb.OperationID + "getcdv3.GetDefaultConn == nil"
log.NewError(reqPb.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
client := pbGroup.NewGroupClient(etcdConn)
respPb, err := client.GetGroup(context.Background(), &reqPb)
if err != nil {
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetGroup failed", err.Error())
openIMHttp.RespHttp200(c, constant.ErrServer, nil)
return
}
for _, v := range respPb.CMSGroups {
groupResp := cms_api_struct.GroupResponse{}
utils.CopyStructFields(&groupResp, v.GroupInfo)
groupResp.GroupOwnerName = v.GroupOwnerUserName
groupResp.GroupOwnerID = v.GroupOwnerUserID
resp.Groups = append(resp.Groups, groupResp)
}
resp.CurrentPage = int(respPb.Pagination.PageNumber)
resp.CurrentPage = int(respPb.Pagination.CurrentPage)
resp.ShowNumber = int(respPb.Pagination.ShowNumber)
resp.GroupNums = int(respPb.GroupNums)
log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp)
openIMHttp.RespHttp200(c, constant.OK, resp)
c.JSON(http.StatusOK, gin.H{"errCode": respPb.CommonResp.ErrCode, "errMsg": respPb.CommonResp.ErrMsg, "data": resp})
}
func GetGroupMembers(c *gin.Context) {
@ -147,9 +65,9 @@ func GetGroupMembers(c *gin.Context) {
reqPb pbGroup.GetGroupMembersCMSReq
resp cms_api_struct.GetGroupMembersResponse
)
if err := c.ShouldBindQuery(&req); err != nil {
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error())
openIMHttp.RespHttp200(c, constant.ErrArgs, nil)
if err := c.BindJSON(&req); err != nil {
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
reqPb.OperationID = utils.OperationIDGenerator()
@ -171,7 +89,7 @@ func GetGroupMembers(c *gin.Context) {
respPb, err := client.GetGroupMembersCMS(context.Background(), &reqPb)
if err != nil {
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetGroupMembersCMS failed:", err.Error())
openIMHttp.RespHttp200(c, err, nil)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()})
return
}
resp.ResponsePagination = cms_api_struct.ResponsePagination{
@ -185,5 +103,5 @@ func GetGroupMembers(c *gin.Context) {
resp.GroupMembers = append(resp.GroupMembers, memberResp)
}
log.NewInfo("", utils.GetSelfFuncName(), "req: ", resp)
openIMHttp.RespHttp200(c, constant.OK, resp)
c.JSON(http.StatusOK, gin.H{"errCode": respPb.CommonResp.ErrCode, "errMsg": respPb.CommonResp.ErrMsg, "data": resp})
}

@ -3,7 +3,6 @@ package messageCMS
import (
"Open_IM/pkg/cms_api_struct"
"Open_IM/pkg/common/config"
openIMHttp "Open_IM/pkg/common/http"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
pbAdminCMS "Open_IM/pkg/proto/admin_cms"
@ -13,8 +12,6 @@ import (
"net/http"
"strings"
"Open_IM/pkg/common/constant"
"github.com/gin-gonic/gin"
)
@ -24,9 +21,9 @@ func GetChatLogs(c *gin.Context) {
resp cms_api_struct.GetChatLogsResp
reqPb pbAdminCMS.GetChatLogsReq
)
if err := c.ShouldBindQuery(&req); err != nil {
if err := c.Bind(&req); err != nil {
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error())
openIMHttp.RespHttp200(c, constant.ErrArgs, resp)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
reqPb.Pagination = &pbCommon.RequestPagination{
@ -46,7 +43,7 @@ func GetChatLogs(c *gin.Context) {
respPb, err := client.GetChatLogs(context.Background(), &reqPb)
if err != nil {
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetChatLogs rpc failed", err.Error())
openIMHttp.RespHttp200(c, err, resp)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
for _, v := range respPb.ChatLogs {
@ -58,5 +55,5 @@ func GetChatLogs(c *gin.Context) {
resp.CurrentPage = int(respPb.Pagination.CurrentPage)
resp.ChatLogsNum = int(respPb.ChatLogsNum)
log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp", resp)
openIMHttp.RespHttp200(c, constant.OK, resp)
c.JSON(http.StatusOK, gin.H{"errCode": respPb.CommonResp.ErrCode, "errMsg": respPb.CommonResp.ErrMsg, "data": resp})
}

@ -1,11 +1,11 @@
package middleware
import (
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/http"
"Open_IM/pkg/common/log"
"Open_IM/pkg/common/token_verify"
"Open_IM/pkg/utils"
"net/http"
"github.com/gin-gonic/gin"
)
@ -17,7 +17,7 @@ func JWTAuth() gin.HandlerFunc {
if !ok {
log.NewError("", "GetUserIDFromToken false ", c.Request.Header.Get("token"))
c.Abort()
http.RespHttp200(c, constant.ErrParseToken, nil)
c.JSON(http.StatusOK, gin.H{"errCode": 400, "errMsg": errInfo})
return
} else {
log.NewInfo("0", utils.GetSelfFuncName(), "failed: ", errInfo)

@ -28,25 +28,17 @@ func NewGinRouter() *gin.Engine {
r2.Use(middleware.JWTAuth())
statisticsRouterGroup := r2.Group("/statistics")
{
statisticsRouterGroup.GET("/get_messages_statistics", statistics.GetMessagesStatistics)
statisticsRouterGroup.GET("/get_user_statistics", statistics.GetUserStatistics)
statisticsRouterGroup.GET("/get_group_statistics", statistics.GetGroupStatistics)
statisticsRouterGroup.GET("/get_active_user", statistics.GetActiveUser)
statisticsRouterGroup.GET("/get_active_group", statistics.GetActiveGroup)
statisticsRouterGroup.POST("/get_messages_statistics", statistics.GetMessagesStatistics)
statisticsRouterGroup.POST("/get_user_statistics", statistics.GetUserStatistics)
statisticsRouterGroup.POST("/get_group_statistics", statistics.GetGroupStatistics)
statisticsRouterGroup.POST("/get_active_user", statistics.GetActiveUser)
statisticsRouterGroup.POST("/get_active_group", statistics.GetActiveGroup)
}
groupRouterGroup := r2.Group("/group")
{
groupRouterGroup.GET("/get_group_by_id", group.GetGroupByID)
groupRouterGroup.GET("/get_groups", group.GetGroups)
groupRouterGroup.GET("/get_group_by_name", group.GetGroupByName)
groupRouterGroup.GET("/get_group_members", group.GetGroupMembers)
// groupRouterGroup.POST("/create_group", group.CreateGroup)
// groupRouterGroup.POST("/add_members", group.AddGroupMembers)
// groupRouterGroup.POST("/remove_members", group.RemoveGroupMembers)
// groupRouterGroup.POST("/get_members_in_group", group.GetGroupMembers)
// groupRouterGroup.POST("/set_group_master", group.SetGroupOwner)
// groupRouterGroup.POST("/set_group_ordinary_user", group.SetGroupOrdinaryUsers)
// groupRouterGroup.POST("/alter_group_info", group.AlterGroupInfo)
groupRouterGroup.POST("/get_groups", group.GetGroups)
groupRouterGroup.POST("/get_group_members", group.GetGroupMembers)
groupRouterGroup.POST("/get_members_in_group", group.GetGroupMembers)
}
userRouterGroup := r2.Group("/user")
{

@ -21,7 +21,7 @@ func GetMessagesStatistics(c *gin.Context) {
reqPb admin.GetMessageStatisticsReq
)
reqPb.StatisticsReq = &admin.StatisticsReq{}
if err := c.Bind(&req); err != nil {
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
@ -75,7 +75,7 @@ func GetUserStatistics(c *gin.Context) {
reqPb admin.GetUserStatisticsReq
)
reqPb.StatisticsReq = &admin.StatisticsReq{}
if err := c.Bind(&req); err != nil {
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
@ -138,7 +138,7 @@ func GetGroupStatistics(c *gin.Context) {
reqPb admin.GetGroupStatisticsReq
)
reqPb.StatisticsReq = &admin.StatisticsReq{}
if err := c.Bind(&req); err != nil {
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
@ -195,7 +195,7 @@ func GetActiveUser(c *gin.Context) {
reqPb admin.GetActiveUserReq
)
reqPb.StatisticsReq = &admin.StatisticsReq{}
if err := c.Bind(&req); err != nil {
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
@ -229,8 +229,8 @@ func GetActiveGroup(c *gin.Context) {
reqPb admin.GetActiveGroupReq
)
reqPb.StatisticsReq = &admin.StatisticsReq{}
if err := c.Bind(&req); err != nil {
log.NewError("0", utils.GetSelfFuncName(), "BindJSON failed ", err.Error())
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}

@ -3,15 +3,12 @@ package user
import (
"Open_IM/pkg/cms_api_struct"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
openIMHttp "Open_IM/pkg/common/http"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
commonPb "Open_IM/pkg/proto/sdk_ws"
pb "Open_IM/pkg/proto/user"
"Open_IM/pkg/utils"
"context"
"fmt"
"net/http"
"strings"
@ -25,7 +22,7 @@ func AddUser(c *gin.Context) {
)
if err := c.BindJSON(&req); err != nil {
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error())
openIMHttp.RespHttp200(c, constant.ErrArgs, nil)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
reqPb.OperationID = utils.OperationIDGenerator()
@ -39,23 +36,24 @@ func AddUser(c *gin.Context) {
return
}
client := pb.NewUserClient(etcdConn)
_, err := client.AddUser(context.Background(), &reqPb)
respPb, err := client.AddUser(context.Background(), &reqPb)
if err != nil {
openIMHttp.RespHttp200(c, err, nil)
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), reqPb.String())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()})
return
}
openIMHttp.RespHttp200(c, constant.OK, nil)
c.JSON(http.StatusOK, gin.H{"errCode": respPb.CommonResp.ErrCode, "errMsg": respPb.CommonResp.ErrMsg})
}
func BlockUser(c *gin.Context) {
var (
req cms_api_struct.BlockUserRequest
resp cms_api_struct.BlockUserResponse
req cms_api_struct.BlockUserRequest
// resp cms_api_struct.BlockUserResponse
reqPb pb.BlockUserReq
)
if err := c.BindJSON(&req); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
openIMHttp.RespHttp200(c, constant.ErrArgs, resp)
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": err.Error()})
return
}
reqPb.OperationID = utils.OperationIDGenerator()
@ -69,13 +67,13 @@ func BlockUser(c *gin.Context) {
return
}
client := pb.NewUserClient(etcdConn)
fmt.Println(reqPb)
_, err := client.BlockUser(context.Background(), &reqPb)
respPb, err := client.BlockUser(context.Background(), &reqPb)
if err != nil {
openIMHttp.RespHttp200(c, err, resp)
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), reqPb.String())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()})
return
}
openIMHttp.RespHttp200(c, constant.OK, resp)
c.JSON(http.StatusOK, gin.H{"errCode": respPb.CommonResp.ErrCode, "errMsg": respPb.CommonResp.ErrMsg})
}
func UnblockUser(c *gin.Context) {
@ -84,9 +82,9 @@ func UnblockUser(c *gin.Context) {
resp cms_api_struct.UnBlockUserResponse
reqPb pb.UnBlockUserReq
)
if err := c.ShouldBind(&req); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
openIMHttp.RespHttp200(c, constant.ErrArgs, resp)
if err := c.BindJSON(&req); err != nil {
log.NewError(req.OperationID, "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": err.Error()})
return
}
reqPb.OperationID = utils.OperationIDGenerator()
@ -100,13 +98,14 @@ func UnblockUser(c *gin.Context) {
return
}
client := pb.NewUserClient(etcdConn)
_, err := client.UnBlockUser(context.Background(), &reqPb)
respPb, err := client.UnBlockUser(context.Background(), &reqPb)
if err != nil {
openIMHttp.RespHttp200(c, err, resp)
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), err.Error(), reqPb.String())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()})
return
}
log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp)
openIMHttp.RespHttp200(c, constant.OK, resp)
c.JSON(http.StatusOK, gin.H{"errCode": respPb.CommonResp.ErrCode, "errMsg": respPb.CommonResp.ErrMsg})
}
func GetBlockUsers(c *gin.Context) {
@ -117,9 +116,9 @@ func GetBlockUsers(c *gin.Context) {
respPb *pb.GetBlockUsersResp
)
reqPb.Pagination = &commonPb.RequestPagination{}
if err := c.ShouldBindQuery(&req); err != nil {
if err := c.BindJSON(&req); err != nil {
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error())
openIMHttp.RespHttp200(c, constant.ErrArgs, resp)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
reqPb.OperationID = utils.OperationIDGenerator()
@ -137,7 +136,7 @@ func GetBlockUsers(c *gin.Context) {
respPb, err := client.GetBlockUsers(context.Background(), &reqPb)
if err != nil {
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetBlockUsers rpc", err.Error())
openIMHttp.RespHttp200(c, err, resp)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()})
return
}
for _, v := range respPb.BlockUsers {
@ -149,7 +148,6 @@ func GetBlockUsers(c *gin.Context) {
PhoneNumber: v.UserInfo.PhoneNumber,
Email: v.UserInfo.Email,
Gender: int(v.UserInfo.Gender),
// CreateTime: v.UserInfo.CreateTime,
},
BeginDisableTime: v.BeginDisableTime,
EndDisableTime: v.EndDisableTime,
@ -159,5 +157,5 @@ func GetBlockUsers(c *gin.Context) {
resp.CurrentPage = int(respPb.Pagination.CurrentPage)
resp.UserNums = respPb.UserNums
log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", resp)
openIMHttp.RespHttp200(c, constant.OK, resp)
c.JSON(http.StatusOK, gin.H{"errCode": respPb.CommonResp.ErrCode, "errMsg": respPb.CommonResp.ErrMsg, "data": resp})
}

@ -140,7 +140,7 @@ func (s *adminCMSServer) ReduceUserRegisterAddFriendIDList(_ context.Context, re
}
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", req.String())
return resp, nil
return resp, nil
}
func (s *adminCMSServer) GetUserRegisterAddFriendIDList(_ context.Context, req *pbAdminCMS.GetUserRegisterAddFriendIDListReq) (*pbAdminCMS.GetUserRegisterAddFriendIDListResp, error) {
@ -223,7 +223,7 @@ func (s *adminCMSServer) GetChatLogs(_ context.Context, req *pbAdminCMS.GetChatL
}
pbChatLog.SenderNickname = recvUser.Nickname
case constant.GroupChatType:
case constant.GroupChatType, constant.SuperGroupChatType:
group, err := imdb.GetGroupInfoByGroupID(chatLog.RecvID)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupById failed")

@ -6,7 +6,7 @@ import (
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db"
imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/db/rocks_cache"
rocksCache "Open_IM/pkg/common/db/rocks_cache"
"Open_IM/pkg/common/http"
"Open_IM/pkg/common/log"
"Open_IM/pkg/common/token_verify"
@ -19,12 +19,13 @@ import (
pbUser "Open_IM/pkg/proto/user"
"Open_IM/pkg/utils"
"context"
"google.golang.org/grpc"
"math/big"
"net"
"strconv"
"strings"
"time"
"google.golang.org/grpc"
)
type groupServer struct {
@ -315,7 +316,7 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
resp.Id2ResultList = append(resp.Id2ResultList, &resultNode)
continue
log.NewError(req.OperationID, "InsertIntoGroupRequest failed ", err.Error(), groupRequest)
// log.NewError(req.OperationID, "InsertIntoGroupRequest failed ", err.Error(), groupRequest)
// return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil
} else {
var resultNode pbGroup.Id2Result
@ -826,7 +827,6 @@ func (s *groupServer) GetGroupsInfo(ctx context.Context, req *pbGroup.GetGroupsI
func (s *groupServer) GroupApplicationResponse(_ context.Context, req *pbGroup.GroupApplicationResponseReq) (*pbGroup.GroupApplicationResponseResp, error) {
log.NewInfo(req.OperationID, "GroupApplicationResponse args ", req.String())
groupRequest := db.GroupRequest{}
utils.CopyStructFields(&groupRequest, req)
groupRequest.UserID = req.FromUserID
@ -1335,139 +1335,53 @@ func (s *groupServer) TransferGroupOwner(_ context.Context, req *pbGroup.Transfe
}
func (s *groupServer) GetGroupByID(_ context.Context, req *pbGroup.GetGroupByIDReq) (*pbGroup.GetGroupByIDResp, error) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
resp := &pbGroup.GetGroupByIDResp{CMSGroup: &pbGroup.CMSGroup{
GroupInfo: &open_im_sdk.GroupInfo{},
}}
group, err := imdb.GetGroupInfoByGroupID(req.GroupID)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupById error", err.Error())
return resp, http.WrapError(constant.ErrDB)
}
utils.CopyStructFields(resp.CMSGroup.GroupInfo, group)
groupMember, err := imdb.GetGroupOwnerInfoByGroupID(group.GroupID)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMaster", err.Error())
return resp, http.WrapError(constant.ErrDB)
}
groupMemberNum, err := imdb.GetGroupMemberNumByGroupID(req.GroupID)
if err == nil {
resp.CMSGroup.GroupInfo.MemberCount = uint32(groupMemberNum)
} else {
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.GroupID)
}
resp.CMSGroup.GroupOwnerUserName = groupMember.Nickname
resp.CMSGroup.GroupOwnerUserID = groupMember.UserID
resp.CMSGroup.GroupInfo.CreatorUserID = group.CreatorUserID
resp.CMSGroup.GroupInfo.CreateTime = uint32(group.CreateTime.Unix())
utils.CopyStructFields(resp.CMSGroup.GroupInfo, group)
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
return resp, nil
}
func (s *groupServer) GetGroup(_ context.Context, req *pbGroup.GetGroupReq) (*pbGroup.GetGroupResp, error) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
resp := &pbGroup.GetGroupResp{
CMSGroups: []*pbGroup.CMSGroup{},
}
groups, err := imdb.GetGroupsByName(req.GroupName, req.Pagination.PageNumber, req.Pagination.ShowNumber)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupsByName error", req.String(), req.GroupName, req.Pagination.PageNumber, req.Pagination.ShowNumber)
return resp, http.WrapError(constant.ErrDB)
}
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "groups", groups)
nums, err := imdb.GetGroupsCountNum(db.Group{GroupName: req.GroupName})
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupsCountNum error", err.Error(), req.GroupName)
return resp, http.WrapError(constant.ErrDB)
}
resp.GroupNums = nums
resp.Pagination = &open_im_sdk.RequestPagination{
PageNumber: req.Pagination.PageNumber,
ShowNumber: req.Pagination.ShowNumber,
}
for _, v := range groups {
group := &pbGroup.CMSGroup{GroupInfo: &open_im_sdk.GroupInfo{}}
utils.CopyStructFields(group.GroupInfo, v)
groupMember, err := imdb.GetGroupOwnerInfoByGroupID(v.GroupID)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMaster error", err.Error())
continue
}
group.GroupInfo.CreateTime = uint32(v.CreateTime.Unix())
group.GroupOwnerUserID = groupMember.UserID
group.GroupOwnerUserName = groupMember.Nickname
resp.CMSGroups = append(resp.CMSGroups, group)
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
return resp, nil
}
func (s *groupServer) GetGroups(_ context.Context, req *pbGroup.GetGroupsReq) (*pbGroup.GetGroupsResp, error) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "GetGroups ", req.String())
resp := &pbGroup.GetGroupsResp{
CMSGroups: []*pbGroup.CMSGroup{},
Pagination: &open_im_sdk.RequestPagination{},
}
groups, err := imdb.GetGroups(int(req.Pagination.PageNumber), int(req.Pagination.ShowNumber))
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroups error", err.Error())
return resp, http.WrapError(constant.ErrDB)
}
resp.GroupNum, err = imdb.GetGroupsCountNum(db.Group{})
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupsCountNum error", err.Error())
return resp, http.WrapError(constant.ErrDB)
Pagination: &open_im_sdk.ResponsePagination{},
}
resp.Pagination.PageNumber = req.Pagination.PageNumber
resp.Pagination.ShowNumber = req.Pagination.ShowNumber
for _, v := range groups {
group := &pbGroup.CMSGroup{GroupInfo: &open_im_sdk.GroupInfo{}}
utils.CopyStructFields(group.GroupInfo, v)
groupMember, err := imdb.GetGroupOwnerInfoByGroupID(v.GroupID)
if req.GroupID != "" {
groupInfoDB, err := imdb.GetGroupInfoByGroupID(req.GroupID)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMaster failed", err.Error(), v)
continue
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.GroupID)
resp.CommonResp.ErrCode = constant.ErrDB.ErrCode
resp.CommonResp.ErrMsg = err.Error()
return resp, nil
}
group.GroupInfo.CreateTime = uint32(v.CreateTime.Unix())
group.GroupOwnerUserID = groupMember.UserID
group.GroupOwnerUserName = groupMember.Nickname
resp.CMSGroups = append(resp.CMSGroups, group)
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "GetGroups ", resp.String())
return resp, nil
}
func (s *groupServer) OperateUserRole(_ context.Context, req *pbGroup.OperateUserRoleReq) (*pbGroup.OperateUserRoleResp, error) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "args:", req.String())
resp := &pbGroup.OperateUserRoleResp{}
oldOwnerUserID, err := imdb.GetGroupOwnerInfoByGroupID(req.GroupID)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMaster failed", err.Error())
return resp, http.WrapError(constant.ErrDB)
}
etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil"
log.NewError(req.OperationID, errMsg)
return resp, http.WrapError(constant.ErrInternal)
}
client := pbGroup.NewGroupClient(etcdConn)
var reqPb pbGroup.TransferGroupOwnerReq
reqPb.OperationID = req.OperationID
reqPb.NewOwnerUserID = req.UserID
reqPb.GroupID = req.GroupID
reqPb.OpUserID = "cms admin"
reqPb.OldOwnerUserID = oldOwnerUserID.UserID
reply, err := client.TransferGroupOwner(context.Background(), &reqPb)
if reply.CommonResp.ErrCode != 0 || err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "TransferGroupOwner rpc failed")
resp.GroupNum = 1
groupInfo := &open_im_sdk.GroupInfo{}
utils.CopyStructFields(groupInfo, groupInfoDB)
resp.CMSGroups = append(resp.CMSGroups, &pbGroup.CMSGroup{GroupInfo: groupInfo})
} else {
groups, err := imdb.GetGroupsByName(req.GroupName, req.Pagination.PageNumber, req.Pagination.ShowNumber)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error())
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupsByName error", req.String(), req.GroupName, req.Pagination.PageNumber, req.Pagination.ShowNumber)
}
for _, v := range groups {
group := &pbGroup.CMSGroup{GroupInfo: &open_im_sdk.GroupInfo{}}
utils.CopyStructFields(group.GroupInfo, v)
groupMember, err := imdb.GetGroupOwnerInfoByGroupID(v.GroupID)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupOwnerInfoByGroupID failed", err.Error(), v)
continue
}
group.GroupInfo.CreateTime = uint32(v.CreateTime.Unix())
group.GroupOwnerUserID = groupMember.UserID
group.GroupOwnerUserName = groupMember.Nickname
resp.CMSGroups = append(resp.CMSGroups, group)
}
resp.GroupNum, err = imdb.GetGroupsCountNum(db.Group{GroupName: req.GroupName})
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupsCountNum error", err.Error())
resp.CommonResp.ErrCode = constant.ErrDB.ErrCode
resp.CommonResp.ErrMsg = err.Error()
return resp, nil
}
}
resp.Pagination.CurrentPage = req.Pagination.PageNumber
resp.Pagination.ShowNumber = req.Pagination.ShowNumber
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "GetGroups resp", resp.String())
return resp, nil
}
@ -1477,12 +1391,16 @@ func (s *groupServer) GetGroupMembersCMS(_ context.Context, req *pbGroup.GetGrou
groupMembers, err := imdb.GetGroupMembersByGroupIdCMS(req.GroupID, req.UserName, req.Pagination.ShowNumber, req.Pagination.PageNumber)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMembersByGroupIdCMS Error", err.Error())
return resp, http.WrapError(constant.ErrDB)
resp.CommonResp.ErrCode = constant.ErrDB.ErrCode
resp.CommonResp.ErrMsg = err.Error()
return resp, nil
}
groupMembersCount, err := imdb.GetGroupMembersCount(req.GroupID, req.UserName)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMembersCMS Error", err.Error())
return resp, http.WrapError(constant.ErrDB)
resp.CommonResp.ErrCode = constant.ErrDB.ErrCode
resp.CommonResp.ErrMsg = err.Error()
return resp, nil
}
log.NewInfo(req.OperationID, groupMembersCount)
resp.MemberNums = int32(groupMembersCount)
@ -1501,151 +1419,6 @@ func (s *groupServer) GetGroupMembersCMS(_ context.Context, req *pbGroup.GetGrou
return resp, nil
}
func (s *groupServer) RemoveGroupMembersCMS(_ context.Context, req *pbGroup.RemoveGroupMembersCMSReq) (*pbGroup.RemoveGroupMembersCMSResp, error) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "args:", req.String())
resp := &pbGroup.RemoveGroupMembersCMSResp{}
for _, userId := range req.UserIDList {
err := imdb.DeleteGroupMemberByGroupIDAndUserID(req.GroupID, userId)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error())
resp.Failed = append(resp.Failed, userId)
} else {
resp.Success = append(resp.Success, userId)
}
}
reqKick := &pbGroup.KickGroupMemberReq{
GroupID: req.GroupID,
KickedUserIDList: resp.Success,
Reason: "admin kick",
OperationID: req.OperationID,
OpUserID: req.OpUserID,
}
var reqPb pbUser.SetConversationReq
var c pbConversation.Conversation
for _, v := range resp.Success {
reqPb.OperationID = req.OperationID
c.OwnerUserID = v
c.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType)
c.ConversationType = constant.GroupChatType
c.GroupID = req.GroupID
c.IsNotInGroup = true
reqPb.Conversation = &c
etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil"
log.NewError(req.OperationID, errMsg)
return resp, http.WrapError(constant.ErrInternal)
}
client := pbUser.NewUserClient(etcdConn)
respPb, err := client.SetConversation(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error(), v)
} else {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "SetConversation success", respPb.String(), v)
}
}
etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil"
log.NewError(req.OperationID, errMsg)
return resp, http.WrapError(constant.ErrDB)
}
cacheClient := pbCache.NewCacheClient(etcdConn)
cacheResp, err := cacheClient.DelGroupMemberIDListFromCache(context.Background(), &pbCache.DelGroupMemberIDListFromCacheReq{
GroupID: req.GroupID,
OperationID: req.OperationID,
})
if err != nil {
log.NewError(req.OperationID, "DelGroupMemberIDListFromCache rpc call failed ", err.Error())
return resp, http.WrapError(constant.ErrDB)
}
if cacheResp.CommonResp.ErrCode != 0 {
log.NewError(req.OperationID, "DelGroupMemberIDListFromCache rpc logic call failed ", cacheResp.String())
return resp, http.WrapError(constant.ErrDB)
}
if err := rocksCache.DelGroupMemberListHashFromCache(req.GroupID); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.GroupID)
}
if err := rocksCache.DelGroupMemberNumFromCache(req.GroupID); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.GroupID)
}
for _, userID := range resp.Success {
if err := rocksCache.DelGroupMemberInfoFromCache(req.GroupID, userID); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.GroupID, userID)
}
}
chat.MemberKickedNotification(reqKick, resp.Success)
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp)
return resp, nil
}
func (s *groupServer) AddGroupMembersCMS(_ context.Context, req *pbGroup.AddGroupMembersCMSReq) (*pbGroup.AddGroupMembersCMSResp, error) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "args:", req.String())
resp := &pbGroup.AddGroupMembersCMSResp{}
for _, userId := range req.UserIDList {
if isExist := imdb.IsExistGroupMember(req.GroupID, userId); isExist {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "user is exist in group", userId, req.GroupID)
resp.Failed = append(resp.Failed, userId)
continue
}
user, err := imdb.GetUserByUserID(userId)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserByUserID", err.Error())
resp.Failed = append(resp.Failed, userId)
continue
}
groupMember := db.GroupMember{
GroupID: req.GroupID,
UserID: userId,
Nickname: user.Nickname,
FaceURL: "",
RoleLevel: 1,
JoinTime: time.Time{},
JoinSource: constant.JoinByAdmin,
OperatorUserID: "CmsAdmin",
Ex: "",
}
if err := imdb.InsertIntoGroupMember(groupMember); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "InsertIntoGroupMember failed", req.String())
resp.Failed = append(resp.Failed, userId)
} else {
resp.Success = append(resp.Success, userId)
}
}
etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil"
log.NewError(req.OperationID, errMsg)
return resp, http.WrapError(constant.ErrDB)
}
cacheClient := pbCache.NewCacheClient(etcdConn)
cacheResp, err := cacheClient.DelGroupMemberIDListFromCache(context.Background(), &pbCache.DelGroupMemberIDListFromCacheReq{
GroupID: req.GroupID,
OperationID: req.OperationID,
})
if err != nil {
log.NewError(req.OperationID, "DelGroupMemberIDListFromCache rpc call failed ", err.Error())
return resp, http.WrapError(constant.ErrDB)
}
if cacheResp.CommonResp.ErrCode != 0 {
log.NewError(req.OperationID, "DelGroupMemberIDListFromCache rpc logic call failed ", cacheResp.String())
return resp, http.WrapError(constant.ErrDB)
}
if err := rocksCache.DelGroupMemberListHashFromCache(req.GroupID); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.GroupID)
}
if err := rocksCache.DelGroupMemberNumFromCache(req.GroupID); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.GroupID)
}
chat.MemberInvitedNotification(req.OperationID, req.GroupID, req.OpUserID, "admin add you to group", resp.Success)
return resp, nil
}
func (s *groupServer) GetUserReqApplicationList(_ context.Context, req *pbGroup.GetUserReqApplicationListReq) (*pbGroup.GetUserReqApplicationListResp, error) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
resp := &pbGroup.GetUserReqApplicationListResp{}

@ -1,182 +0,0 @@
package messageCMS
import (
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db"
errors "Open_IM/pkg/common/http"
"context"
"strconv"
"Open_IM/pkg/common/log"
imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
pbMessageCMS "Open_IM/pkg/proto/message_cms"
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils"
"net"
"strings"
"google.golang.org/grpc"
)
type messageCMSServer struct {
rpcPort int
rpcRegisterName string
etcdSchema string
etcdAddr []string
}
func NewMessageCMSServer(port int) *messageCMSServer {
log.NewPrivateLog(constant.LogFileName)
return &messageCMSServer{
rpcPort: port,
rpcRegisterName: config.Config.RpcRegisterName.OpenImMessageCMSName,
etcdSchema: config.Config.Etcd.EtcdSchema,
etcdAddr: config.Config.Etcd.EtcdAddr,
}
}
func (s *messageCMSServer) Run() {
log.NewInfo("0", "messageCMS rpc start ")
listenIP := ""
if config.Config.ListenIP == "" {
listenIP = "0.0.0.0"
} else {
listenIP = config.Config.ListenIP
}
address := listenIP + ":" + strconv.Itoa(s.rpcPort)
//listener network
listener, err := net.Listen("tcp", address)
if err != nil {
panic("listening err:" + err.Error() + s.rpcRegisterName)
}
log.NewInfo("0", "listen network success, ", address, listener)
defer listener.Close()
//grpc server
srv := grpc.NewServer()
defer srv.GracefulStop()
//Service registers with etcd
pbMessageCMS.RegisterMessageCMSServer(srv, s)
rpcRegisterIP := config.Config.RpcRegisterIP
if config.Config.RpcRegisterIP == "" {
rpcRegisterIP, err = utils.GetLocalIP()
if err != nil {
log.Error("", "GetLocalIP failed ", err.Error())
}
}
log.NewInfo("", "rpcRegisterIP", rpcRegisterIP)
err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10)
if err != nil {
log.NewError("0", "RegisterEtcd failed ", err.Error())
panic(utils.Wrap(err, "register message_cms module rpc to etcd err"))
}
err = srv.Serve(listener)
if err != nil {
log.NewError("0", "Serve failed ", err.Error())
return
}
log.NewInfo("0", "message cms rpc success")
}
func (s *messageCMSServer) BoradcastMessage(_ context.Context, req *pbMessageCMS.BoradcastMessageReq) (*pbMessageCMS.BoradcastMessageResp, error) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "BoradcastMessage", req.String())
resp := &pbMessageCMS.BoradcastMessageResp{}
return resp, errors.WrapError(constant.ErrDB)
}
func (s *messageCMSServer) GetChatLogs(_ context.Context, req *pbMessageCMS.GetChatLogsReq) (*pbMessageCMS.GetChatLogsResp, error) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "GetChatLogs", req.String())
resp := &pbMessageCMS.GetChatLogsResp{}
time, err := utils.TimeStringToTime(req.Date)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "time string parse error", err.Error())
}
chatLog := db.ChatLog{
Content: req.Content,
SendTime: time,
ContentType: req.ContentType,
SessionType: req.SessionType,
}
switch chatLog.SessionType {
case constant.SingleChatType:
chatLog.SendID = req.UserId
case constant.GroupChatType:
chatLog.RecvID = req.GroupId
chatLog.SendID = req.UserId
}
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "chat_log: ", chatLog)
nums, err := imdb.GetChatLogCount(chatLog)
resp.ChatLogsNum = int32(nums)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetChatLogCount", err.Error())
}
chatLogs, err := imdb.GetChatLog(chatLog, req.Pagination.PageNumber, req.Pagination.ShowNumber)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetChatLog", err.Error())
return resp, errors.WrapError(constant.ErrDB)
}
for _, chatLog := range chatLogs {
pbChatLog := &pbMessageCMS.ChatLogs{
SessionType: chatLog.SessionType,
ContentType: chatLog.ContentType,
SearchContent: req.Content,
WholeContent: chatLog.Content,
Date: chatLog.CreateTime.String(),
SenderNickName: chatLog.SenderNickname,
SenderId: chatLog.SendID,
}
if chatLog.SenderNickname == "" {
sendUser, err := imdb.GetUserByUserID(chatLog.SendID)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserByUserID failed", err.Error())
continue
}
pbChatLog.SenderNickName = sendUser.Nickname
}
switch chatLog.SessionType {
case constant.SingleChatType:
recvUser, err := imdb.GetUserByUserID(chatLog.RecvID)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserByUserID failed", err.Error())
continue
}
pbChatLog.ReciverId = recvUser.UserID
pbChatLog.ReciverNickName = recvUser.Nickname
case constant.GroupChatType:
group, err := imdb.GetGroupInfoByGroupID(chatLog.RecvID)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupById failed")
continue
}
pbChatLog.GroupId = group.GroupID
pbChatLog.GroupName = group.GroupName
}
resp.ChatLogs = append(resp.ChatLogs, pbChatLog)
}
resp.Pagination = &open_im_sdk.ResponsePagination{
CurrentPage: req.Pagination.PageNumber,
ShowNumber: req.Pagination.ShowNumber,
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp output: ", resp.String())
return resp, nil
}
func (s *messageCMSServer) MassSendMessage(_ context.Context, req *pbMessageCMS.MassSendMessageReq) (*pbMessageCMS.MassSendMessageResp, error) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "MassSendMessage", req.String())
resp := &pbMessageCMS.MassSendMessageResp{}
return resp, nil
}
func (s *messageCMSServer) WithdrawMessage(_ context.Context, req *pbMessageCMS.WithdrawMessageReq) (*pbMessageCMS.WithdrawMessageResp, error) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "WithdrawMessage", req.String())
resp := &pbMessageCMS.WithdrawMessageResp{}
return resp, nil
}

@ -1,399 +0,0 @@
package statistics
import (
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"context"
"strconv"
"sync"
"time"
//"Open_IM/pkg/common/constant"
//"Open_IM/pkg/common/db"
imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
//cp "Open_IM/pkg/common/utils"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
pbStatistics "Open_IM/pkg/proto/statistics"
//open_im_sdk "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils"
//"context"
errors "Open_IM/pkg/common/http"
"net"
"strings"
"google.golang.org/grpc"
)
type statisticsServer struct {
rpcPort int
rpcRegisterName string
etcdSchema string
etcdAddr []string
}
func NewStatisticsServer(port int) *statisticsServer {
log.NewPrivateLog(constant.LogFileName)
return &statisticsServer{
rpcPort: port,
rpcRegisterName: config.Config.RpcRegisterName.OpenImStatisticsName,
etcdSchema: config.Config.Etcd.EtcdSchema,
etcdAddr: config.Config.Etcd.EtcdAddr,
}
}
func (s *statisticsServer) Run() {
log.NewInfo("0", "Statistics rpc start ")
listenIP := ""
if config.Config.ListenIP == "" {
listenIP = "0.0.0.0"
} else {
listenIP = config.Config.ListenIP
}
address := listenIP + ":" + strconv.Itoa(s.rpcPort)
//listener network
listener, err := net.Listen("tcp", address)
if err != nil {
panic("listening err:" + err.Error() + s.rpcRegisterName)
}
log.NewInfo("0", "listen network success, ", address, listener)
defer listener.Close()
//grpc server
srv := grpc.NewServer()
defer srv.GracefulStop()
//Service registers with etcd
pbStatistics.RegisterUserServer(srv, s)
rpcRegisterIP := config.Config.RpcRegisterIP
if config.Config.RpcRegisterIP == "" {
rpcRegisterIP, err = utils.GetLocalIP()
if err != nil {
log.Error("", "GetLocalIP failed ", err.Error())
}
}
err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10)
if err != nil {
log.NewError("0", "RegisterEtcd failed ", err.Error())
panic(utils.Wrap(err, "register statistics module rpc to etcd err"))
}
err = srv.Serve(listener)
if err != nil {
log.NewError("0", "Serve failed ", err.Error())
return
}
log.NewInfo("0", "statistics rpc success")
}
func (s *statisticsServer) GetActiveGroup(_ context.Context, req *pbStatistics.GetActiveGroupReq) (*pbStatistics.GetActiveGroupResp, error) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req", req.String())
resp := &pbStatistics.GetActiveGroupResp{}
fromTime, toTime, err := ParseTimeFromTo(req.StatisticsReq.From, req.StatisticsReq.To)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "ParseTimeFromTo failed", err.Error())
return resp, errors.WrapError(constant.ErrArgs)
}
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "time: ", fromTime, toTime)
activeGroups, err := imdb.GetActiveGroups(fromTime, toTime, 12)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetActiveGroups failed", err.Error())
return resp, errors.WrapError(constant.ErrDB)
}
for _, activeGroup := range activeGroups {
resp.Groups = append(resp.Groups,
&pbStatistics.GroupResp{
GroupName: activeGroup.Name,
GroupId: activeGroup.Id,
MessageNum: int32(activeGroup.MessageNum),
})
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), resp.String())
return resp, nil
}
func (s *statisticsServer) GetActiveUser(_ context.Context, req *pbStatistics.GetActiveUserReq) (*pbStatistics.GetActiveUserResp, error) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String())
resp := &pbStatistics.GetActiveUserResp{}
fromTime, toTime, err := ParseTimeFromTo(req.StatisticsReq.From, req.StatisticsReq.To)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "ParseTimeFromTo failed", err.Error())
return resp, errors.WrapError(constant.ErrDB)
}
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "time: ", fromTime, toTime)
activeUsers, err := imdb.GetActiveUsers(fromTime, toTime, 12)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetActiveUsers failed", err.Error())
return resp, errors.WrapError(constant.ErrDB)
}
for _, activeUser := range activeUsers {
resp.Users = append(resp.Users,
&pbStatistics.UserResp{
UserId: activeUser.Id,
NickName: activeUser.Name,
MessageNum: int32(activeUser.MessageNum),
},
)
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), resp.String())
return resp, nil
}
func ParseTimeFromTo(from, to string) (time.Time, time.Time, error) {
var fromTime time.Time
var toTime time.Time
fromTime, err := utils.TimeStringToTime(from)
if err != nil {
return fromTime, toTime, err
}
toTime, err = utils.TimeStringToTime(to)
if err != nil {
return fromTime, toTime, err
}
return fromTime, toTime, nil
}
func isInOneMonth(from, to time.Time) bool {
return from.Month() == to.Month() && from.Year() == to.Year()
}
func GetRangeDate(from, to time.Time) [][2]time.Time {
interval := to.Sub(from)
var times [][2]time.Time
switch {
// today
case interval == 0:
times = append(times, [2]time.Time{
from, from.Add(time.Hour * 24),
})
// days
case isInOneMonth(from, to):
for i := 0; ; i++ {
fromTime := from.Add(time.Hour * 24 * time.Duration(i))
toTime := from.Add(time.Hour * 24 * time.Duration(i+1))
if toTime.After(to.Add(time.Hour * 24)) {
break
}
times = append(times, [2]time.Time{
fromTime, toTime,
})
}
// month
case !isInOneMonth(from, to):
if to.Sub(from) < time.Hour*24*30 {
for i := 0; ; i++ {
fromTime := from.Add(time.Hour * 24 * time.Duration(i))
toTime := from.Add(time.Hour * 24 * time.Duration(i+1))
if toTime.After(to.Add(time.Hour * 24)) {
break
}
times = append(times, [2]time.Time{
fromTime, toTime,
})
}
} else {
for i := 0; ; i++ {
if i == 0 {
fromTime := from
toTime := getFirstDateOfNextNMonth(fromTime, 1)
times = append(times, [2]time.Time{
fromTime, toTime,
})
} else {
fromTime := getFirstDateOfNextNMonth(from, i)
toTime := getFirstDateOfNextNMonth(fromTime, 1)
if toTime.After(to) {
toTime = to
times = append(times, [2]time.Time{
fromTime, toTime,
})
break
}
times = append(times, [2]time.Time{
fromTime, toTime,
})
}
}
}
}
return times
}
func getFirstDateOfNextNMonth(currentTime time.Time, n int) time.Time {
lastOfMonth := time.Date(currentTime.Year(), currentTime.Month(), 1, 0, 0, 0, 0, currentTime.Location()).AddDate(0, n, 0)
return lastOfMonth
}
func (s *statisticsServer) GetGroupStatistics(_ context.Context, req *pbStatistics.GetGroupStatisticsReq) (*pbStatistics.GetGroupStatisticsResp, error) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String())
resp := &pbStatistics.GetGroupStatisticsResp{}
fromTime, toTime, err := ParseTimeFromTo(req.StatisticsReq.From, req.StatisticsReq.To)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupStatistics failed", err.Error())
return resp, errors.WrapError(constant.ErrArgs)
}
increaseGroupNum, err := imdb.GetIncreaseGroupNum(fromTime, toTime.Add(time.Hour*24))
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseGroupNum failed", err.Error(), fromTime, toTime)
return resp, errors.WrapError(constant.ErrDB)
}
totalGroupNum, err := imdb.GetTotalGroupNum()
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error())
return resp, errors.WrapError(constant.ErrDB)
}
resp.IncreaseGroupNum = increaseGroupNum
resp.TotalGroupNum = totalGroupNum
times := GetRangeDate(fromTime, toTime)
log.NewDebug(req.OperationID, "times:", times)
wg := &sync.WaitGroup{}
resp.IncreaseGroupNumList = make([]*pbStatistics.DateNumList, len(times), len(times))
resp.TotalGroupNumList = make([]*pbStatistics.DateNumList, len(times), len(times))
wg.Add(len(times))
for i, v := range times {
go func(wg *sync.WaitGroup, index int, v [2]time.Time) {
defer wg.Done()
num, err := imdb.GetIncreaseGroupNum(v[0], v[1])
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseGroupNum", v, err.Error())
}
resp.IncreaseGroupNumList[index] = &pbStatistics.DateNumList{
Date: v[0].String(),
Num: num,
}
num, err = imdb.GetGroupNum(v[1])
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseGroupNum", v, err.Error())
}
resp.TotalGroupNumList[index] = &pbStatistics.DateNumList{
Date: v[0].String(),
Num: num,
}
}(wg, i, v)
}
wg.Wait()
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp)
return resp, nil
}
func (s *statisticsServer) GetMessageStatistics(_ context.Context, req *pbStatistics.GetMessageStatisticsReq) (*pbStatistics.GetMessageStatisticsResp, error) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String())
resp := &pbStatistics.GetMessageStatisticsResp{}
fromTime, toTime, err := ParseTimeFromTo(req.StatisticsReq.From, req.StatisticsReq.To)
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "times: ", fromTime, toTime)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "ParseTimeFromTo failed", err.Error())
return resp, errors.WrapError(constant.ErrArgs)
}
privateMessageNum, err := imdb.GetPrivateMessageNum(fromTime, toTime.Add(time.Hour*24))
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetPrivateMessageNum failed", err.Error())
return resp, errors.WrapError(constant.ErrDB)
}
groupMessageNum, err := imdb.GetGroupMessageNum(fromTime, toTime.Add(time.Hour*24))
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMessageNum failed", err.Error())
return resp, errors.WrapError(constant.ErrDB)
}
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), privateMessageNum, groupMessageNum)
resp.PrivateMessageNum = privateMessageNum
resp.GroupMessageNum = groupMessageNum
times := GetRangeDate(fromTime, toTime)
resp.GroupMessageNumList = make([]*pbStatistics.DateNumList, len(times), len(times))
resp.PrivateMessageNumList = make([]*pbStatistics.DateNumList, len(times), len(times))
wg := &sync.WaitGroup{}
wg.Add(len(times))
for i, v := range times {
go func(wg *sync.WaitGroup, index int, v [2]time.Time) {
defer wg.Done()
num, err := imdb.GetPrivateMessageNum(v[0], v[1])
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseGroupNum", v, err.Error())
}
resp.PrivateMessageNumList[index] = &pbStatistics.DateNumList{
Date: v[0].String(),
Num: num,
}
num, err = imdb.GetGroupMessageNum(v[0], v[1])
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseGroupNum", v, err.Error())
}
resp.GroupMessageNumList[index] = &pbStatistics.DateNumList{
Date: v[0].String(),
Num: num,
}
}(wg, i, v)
}
wg.Wait()
return resp, nil
}
func (s *statisticsServer) GetUserStatistics(_ context.Context, req *pbStatistics.GetUserStatisticsReq) (*pbStatistics.GetUserStatisticsResp, error) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
resp := &pbStatistics.GetUserStatisticsResp{}
fromTime, toTime, err := ParseTimeFromTo(req.StatisticsReq.From, req.StatisticsReq.To)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "ParseTimeFromTo failed", err.Error())
return resp, errors.WrapError(constant.ErrArgs)
}
activeUserNum, err := imdb.GetActiveUserNum(fromTime, toTime.Add(time.Hour*24))
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetActiveUserNum failed", err.Error())
return resp, errors.WrapError(constant.ErrDB)
}
increaseUserNum, err := imdb.GetIncreaseUserNum(fromTime, toTime.Add(time.Hour*24))
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseUserNum failed", err.Error())
return resp, errors.WrapError(constant.ErrDB)
}
totalUserNum, err := imdb.GetTotalUserNum()
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetTotalUserNum failed", err.Error())
return resp, errors.WrapError(constant.ErrDB)
}
resp.ActiveUserNum = activeUserNum
resp.TotalUserNum = totalUserNum
resp.IncreaseUserNum = increaseUserNum
times := GetRangeDate(fromTime, toTime)
resp.TotalUserNumList = make([]*pbStatistics.DateNumList, len(times), len(times))
resp.ActiveUserNumList = make([]*pbStatistics.DateNumList, len(times), len(times))
resp.IncreaseUserNumList = make([]*pbStatistics.DateNumList, len(times), len(times))
wg := &sync.WaitGroup{}
wg.Add(len(times))
for i, v := range times {
go func(wg *sync.WaitGroup, index int, v [2]time.Time) {
defer wg.Done()
num, err := imdb.GetActiveUserNum(v[0], v[1])
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseGroupNum", v, err.Error())
}
resp.ActiveUserNumList[index] = &pbStatistics.DateNumList{
Date: v[0].String(),
Num: num,
}
num, err = imdb.GetTotalUserNumByDate(v[1])
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetTotalUserNumByDate", v, err.Error())
}
resp.TotalUserNumList[index] = &pbStatistics.DateNumList{
Date: v[0].String(),
Num: num,
}
num, err = imdb.GetIncreaseUserNum(v[0], v[1])
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseUserNum", v, err.Error())
}
resp.IncreaseUserNumList[index] = &pbStatistics.DateNumList{
Date: v[0].String(),
Num: num,
}
}(wg, i, v)
}
wg.Wait()
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp)
return resp, nil
}

@ -6,7 +6,7 @@ import (
)
type AdminLoginRequest struct {
AdminName string `json:"adminName" binding:"required"`
AdminName string `json:"adminID" binding:"required"`
Secret string `json:"secret" binding:"required"`
OperationID string `json:"operationID" binding:"required"`
}

@ -1,9 +1,8 @@
package cms_api_struct
type GroupResponse struct {
GroupOwnerName string `json:"GroupOwnerName"`
GroupOwnerID string `json:"GroupOwnerID"`
//*server_api_params.GroupInfo
GroupOwnerName string `json:"GroupOwnerName"`
GroupOwnerID string `json:"GroupOwnerID"`
GroupID string `json:"groupID"`
GroupName string `json:"groupName"`
Notification string `json:"notification"`
@ -23,27 +22,9 @@ type GroupResponse struct {
NotificationUserID string `json:"notificationUserID"`
}
type GetGroupByIDRequest struct {
GroupID string `form:"groupID" binding:"required"`
}
type GetGroupByIDResponse struct {
GroupResponse
}
type GetGroupRequest struct {
GroupName string `form:"groupName" binding:"required"`
RequestPagination
}
type GetGroupResponse struct {
Groups []GroupResponse `json:"groups"`
GroupNums int `json:"groupNums"`
ResponsePagination
}
type GetGroupsRequest struct {
RequestPagination
OperationID string `json:"operationID"`
}
type GetGroupsResponse struct {
@ -52,55 +33,10 @@ type GetGroupsResponse struct {
ResponsePagination
}
type CreateGroupRequest struct {
GroupName string `json:"groupName" binding:"required"`
GroupMasterId string `json:"groupOwnerID" binding:"required"`
GroupMembers []string `json:"groupMembers" binding:"required"`
}
type CreateGroupResponse struct {
}
type SetGroupMasterRequest struct {
GroupId string `json:"groupID" binding:"required"`
UserId string `json:"userID" binding:"required"`
}
type SetGroupMasterResponse struct {
}
type SetGroupMemberRequest struct {
GroupId string `json:"groupID" binding:"required"`
UserId string `json:"userID" binding:"required"`
}
type SetGroupMemberRespones struct {
}
type BanGroupChatRequest struct {
GroupId string `json:"groupID" binding:"required"`
}
type BanGroupChatResponse struct {
}
type BanPrivateChatRequest struct {
GroupId string `json:"groupID" binding:"required"`
}
type BanPrivateChatResponse struct {
}
type DeleteGroupRequest struct {
GroupId string `json:"groupID" binding:"required"`
}
type DeleteGroupResponse struct {
}
type GetGroupMembersRequest struct {
GroupID string `form:"groupID" binding:"required"`
UserName string `form:"userName"`
GroupID string `form:"groupID" binding:"required"`
UserName string `form:"userName"`
OperationID string `json:"operationID"`
RequestPagination
}
@ -124,41 +60,3 @@ type GetGroupMembersResponse struct {
ResponsePagination
MemberNums int `json:"memberNums"`
}
type GroupMemberRequest struct {
GroupId string `json:"groupID" binding:"required"`
Members []string `json:"members" binding:"required"`
}
type GroupMemberOperateResponse struct {
Success []string `json:"success"`
Failed []string `json:"failed"`
}
type AddGroupMembersRequest struct {
GroupMemberRequest
}
type AddGroupMembersResponse struct {
GroupMemberOperateResponse
}
type RemoveGroupMembersRequest struct {
GroupMemberRequest
}
type RemoveGroupMembersResponse struct {
GroupMemberOperateResponse
}
type AlterGroupInfoRequest struct {
GroupID string `json:"groupID"`
GroupName string `json:"groupName"`
Notification string `json:"notification"`
Introduction string `json:"introduction"`
ProfilePhoto string `json:"profilePhoto"`
GroupType int `json:"groupType"`
}
type AlterGroupInfoResponse struct {
}

@ -17,63 +17,15 @@ type UserResponse struct {
Gender int `json:"gender"`
}
type GetUserRequest struct {
UserId string `form:"user_id" binding:"required"`
}
type GetUserResponse struct {
UserResponse
}
type GetUsersRequest struct {
RequestPagination
}
type GetUsersResponse struct {
Users []*UserResponse `json:"users"`
ResponsePagination
UserNums int32 `json:"user_nums"`
}
type GetUsersByNameRequest struct {
UserName string `form:"user_name" binding:"required"`
RequestPagination
}
type GetUsersByNameResponse struct {
Users []*UserResponse `json:"users"`
ResponsePagination
UserNums int32 `json:"user_nums"`
}
type ResignUserRequest struct {
UserId string `json:"user_id"`
}
type ResignUserResponse struct {
}
type AlterUserRequest struct {
UserId string `json:"user_id" binding:"required"`
Nickname string `json:"nickname"`
PhoneNumber string `json:"phone_number" validate:"len=11"`
Email string `json:"email"`
Birth string `json:"birth"`
Gender string `json:"gender"`
Photo string `json:"photo"`
}
type AlterUserResponse struct {
}
type AddUserRequest struct {
PhoneNumber string `json:"phone_number" binding:"required"`
UserId string `json:"user_id" binding:"required"`
OperationID string `json:"operationID"`
PhoneNumber string `json:"phoneNumber" binding:"required"`
UserId string `json:"userID" binding:"required"`
Name string `json:"name" binding:"required"`
Email string `json:"email"`
Birth string `json:"birth"`
Gender string `json:"gender"`
Photo string `json:"photo"`
FaceURL string `json:"faceURL"`
}
type AddUserResponse struct {
@ -81,46 +33,34 @@ type AddUserResponse struct {
type BlockUser struct {
UserResponse
BeginDisableTime string `json:"begin_disable_time"`
EndDisableTime string `json:"end_disable_time"`
BeginDisableTime string `json:"beginDisableTime"`
EndDisableTime string `json:"endDisableTime"`
}
type BlockUserRequest struct {
UserId string `json:"user_id" binding:"required"`
EndDisableTime string `json:"end_disable_time" binding:"required"`
OperationID string `json:"operationID"`
UserID string `json:"userID" binding:"required"`
EndDisableTime string `json:"endDisableTime" binding:"required"`
}
type BlockUserResponse struct {
}
type UnblockUserRequest struct {
UserId string `json:"user_id" binding:"required"`
OperationID string `json:"operationID"`
UserID string `json:"userID" binding:"required"`
}
type UnBlockUserResponse struct {
}
type GetBlockUsersRequest struct {
OperationID string `json:"operationID"`
RequestPagination
}
type GetBlockUsersResponse struct {
BlockUsers []BlockUser `json:"block_users"`
BlockUsers []BlockUser `json:"blockUsers"`
ResponsePagination
UserNums int32 `json:"user_nums"`
}
type GetBlockUserRequest struct {
UserId string `form:"user_id" binding:"required"`
}
type GetBlockUserResponse struct {
BlockUser
}
type DeleteUserRequest struct {
UserId string `json:"user_id" binding:"required"`
}
type DeleteUserResponse struct {
UserNums int32 `json:"userNums"`
}

@ -227,17 +227,17 @@ type Black struct {
type ChatLog struct {
ServerMsgID string `gorm:"column:server_msg_id;primary_key;type:char(64)" json:"serverMsgID"`
ClientMsgID string `gorm:"column:client_msg_id;type:char(64)" json:"clientMsgID"`
SendID string `gorm:"column:send_id;type:char(64)" json:"sendID"`
RecvID string `gorm:"column:recv_id;type:char(64)" json:"recvID"`
SendID string `gorm:"column:send_id;type:char(64);index:search" json:"sendID"`
RecvID string `gorm:"column:recv_id;type:char(64);index:search" json:"recvID"`
SenderPlatformID int32 `gorm:"column:sender_platform_id" json:"senderPlatformID"`
SenderNickname string `gorm:"column:sender_nick_name;type:varchar(255)" json:"senderNickname"`
SenderFaceURL string `gorm:"column:sender_face_url;type:varchar(255)" json:"senderFaceURL"`
SessionType int32 `gorm:"column:session_type" json:"sessionType"`
SessionType int32 `gorm:"column:session_type;;index:search" json:"sessionType"`
MsgFrom int32 `gorm:"column:msg_from" json:"msgFrom"`
ContentType int32 `gorm:"column:content_type" json:"contentType"`
Content string `gorm:"column:content;type:varchar(3000)" json:"content"`
ContentType int32 `gorm:"column:content_type;index:search" json:"contentType"`
Content string `gorm:"column:content;type:varchar(3000);index:search" json:"content"`
Status int32 `gorm:"column:status" json:"status"`
SendTime time.Time `gorm:"column:send_time" json:"sendTime"`
SendTime time.Time `gorm:"column:send_time;;index:search" json:"sendTime"`
CreateTime time.Time `gorm:"column:create_time" json:"createTime"`
Ex string `gorm:"column:ex;type:varchar(1024)" json:"ex"`
}

@ -1,6 +1,7 @@
package im_mysql_model
import (
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db"
"Open_IM/pkg/common/log"
"Open_IM/pkg/utils"
@ -15,8 +16,10 @@ func GetChatLog(chatLog db.ChatLog, pageNumber, showNumber int32) ([]db.ChatLog,
if chatLog.SessionType != 0 {
db = db.Where("session_type = ?", chatLog.SessionType)
}
if chatLog.ContentType != 0 {
if chatLog.ContentType == 1 {
db = db.Where("content_type = ?", chatLog.ContentType)
} else if chatLog.ContentType == 2 {
db = db.Where("content_type in (?)", []int{constant.GroupChatType, constant.SuperGroupChatType})
}
if chatLog.SendID != "" {
db = db.Where("send_id = ?", chatLog.SendID)

@ -1,43 +0,0 @@
package http
import (
"Open_IM/pkg/common/constant"
"fmt"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
//"Open_IM/pkg/cms_api_struct"
"net/http"
"github.com/gin-gonic/gin"
)
type BaseResp struct {
Code int32 `json:"code"`
ErrMsg string `json:"err_msg"`
Data interface{} `json:"data"`
}
func RespHttp200(ctx *gin.Context, err error, data interface{}) {
var resp BaseResp
switch e := err.(type) {
case constant.ErrInfo:
resp.Code = e.ErrCode
resp.ErrMsg = e.ErrMsg
default:
s, ok := status.FromError(err)
if !ok {
fmt.Println("need grpc format error")
return
}
resp.Code = int32(s.Code())
resp.ErrMsg = s.Message()
}
resp.Data = data
ctx.JSON(http.StatusOK, resp)
}
// warp error
func WrapError(err constant.ErrInfo) error {
return status.Error(codes.Code(err.ErrCode), err.ErrMsg)
}

@ -36,7 +36,7 @@ func (m *CommonResp) Reset() { *m = CommonResp{} }
func (m *CommonResp) String() string { return proto.CompactTextString(m) }
func (*CommonResp) ProtoMessage() {}
func (*CommonResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{0}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{0}
}
func (m *CommonResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CommonResp.Unmarshal(m, b)
@ -83,7 +83,7 @@ func (m *AdminLoginReq) Reset() { *m = AdminLoginReq{} }
func (m *AdminLoginReq) String() string { return proto.CompactTextString(m) }
func (*AdminLoginReq) ProtoMessage() {}
func (*AdminLoginReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{1}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{1}
}
func (m *AdminLoginReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AdminLoginReq.Unmarshal(m, b)
@ -136,7 +136,7 @@ func (m *AdminLoginResp) Reset() { *m = AdminLoginResp{} }
func (m *AdminLoginResp) String() string { return proto.CompactTextString(m) }
func (*AdminLoginResp) ProtoMessage() {}
func (*AdminLoginResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{2}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{2}
}
func (m *AdminLoginResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AdminLoginResp.Unmarshal(m, b)
@ -182,7 +182,7 @@ func (m *AddUserRegisterAddFriendIDListReq) Reset() { *m = AddUserRegist
func (m *AddUserRegisterAddFriendIDListReq) String() string { return proto.CompactTextString(m) }
func (*AddUserRegisterAddFriendIDListReq) ProtoMessage() {}
func (*AddUserRegisterAddFriendIDListReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{3}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{3}
}
func (m *AddUserRegisterAddFriendIDListReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AddUserRegisterAddFriendIDListReq.Unmarshal(m, b)
@ -227,7 +227,7 @@ func (m *AddUserRegisterAddFriendIDListResp) Reset() { *m = AddUserRegis
func (m *AddUserRegisterAddFriendIDListResp) String() string { return proto.CompactTextString(m) }
func (*AddUserRegisterAddFriendIDListResp) ProtoMessage() {}
func (*AddUserRegisterAddFriendIDListResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{4}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{4}
}
func (m *AddUserRegisterAddFriendIDListResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AddUserRegisterAddFriendIDListResp.Unmarshal(m, b)
@ -267,7 +267,7 @@ func (m *ReduceUserRegisterAddFriendIDListReq) Reset() { *m = ReduceUser
func (m *ReduceUserRegisterAddFriendIDListReq) String() string { return proto.CompactTextString(m) }
func (*ReduceUserRegisterAddFriendIDListReq) ProtoMessage() {}
func (*ReduceUserRegisterAddFriendIDListReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{5}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{5}
}
func (m *ReduceUserRegisterAddFriendIDListReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReduceUserRegisterAddFriendIDListReq.Unmarshal(m, b)
@ -319,7 +319,7 @@ func (m *ReduceUserRegisterAddFriendIDListResp) Reset() { *m = ReduceUse
func (m *ReduceUserRegisterAddFriendIDListResp) String() string { return proto.CompactTextString(m) }
func (*ReduceUserRegisterAddFriendIDListResp) ProtoMessage() {}
func (*ReduceUserRegisterAddFriendIDListResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{6}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{6}
}
func (m *ReduceUserRegisterAddFriendIDListResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReduceUserRegisterAddFriendIDListResp.Unmarshal(m, b)
@ -358,7 +358,7 @@ func (m *GetUserRegisterAddFriendIDListReq) Reset() { *m = GetUserRegist
func (m *GetUserRegisterAddFriendIDListReq) String() string { return proto.CompactTextString(m) }
func (*GetUserRegisterAddFriendIDListReq) ProtoMessage() {}
func (*GetUserRegisterAddFriendIDListReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{7}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{7}
}
func (m *GetUserRegisterAddFriendIDListReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetUserRegisterAddFriendIDListReq.Unmarshal(m, b)
@ -405,7 +405,7 @@ func (m *GetUserRegisterAddFriendIDListResp) Reset() { *m = GetUserRegis
func (m *GetUserRegisterAddFriendIDListResp) String() string { return proto.CompactTextString(m) }
func (*GetUserRegisterAddFriendIDListResp) ProtoMessage() {}
func (*GetUserRegisterAddFriendIDListResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{8}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{8}
}
func (m *GetUserRegisterAddFriendIDListResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetUserRegisterAddFriendIDListResp.Unmarshal(m, b)
@ -464,7 +464,7 @@ func (m *GetChatLogsReq) Reset() { *m = GetChatLogsReq{} }
func (m *GetChatLogsReq) String() string { return proto.CompactTextString(m) }
func (*GetChatLogsReq) ProtoMessage() {}
func (*GetChatLogsReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{9}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{9}
}
func (m *GetChatLogsReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetChatLogsReq.Unmarshal(m, b)
@ -542,21 +542,23 @@ func (m *GetChatLogsReq) GetOperationID() string {
type ChatLog struct {
ServerMsgID string `protobuf:"bytes,1,opt,name=ServerMsgID" json:"ServerMsgID,omitempty"`
StringClientMsgID string `protobuf:"bytes,2,opt,name=stringClientMsgID" json:"stringClientMsgID,omitempty"`
ClientMsgID string `protobuf:"bytes,2,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"`
SendID string `protobuf:"bytes,3,opt,name=SendID" json:"SendID,omitempty"`
RecvID string `protobuf:"bytes,4,opt,name=RecvID" json:"RecvID,omitempty"`
SenderPlatformID int32 `protobuf:"varint,5,opt,name=SenderPlatformID" json:"SenderPlatformID,omitempty"`
SenderNickname string `protobuf:"bytes,6,opt,name=SenderNickname" json:"SenderNickname,omitempty"`
SenderFaceURL string `protobuf:"bytes,7,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"`
GroupName string `protobuf:"bytes,8,opt,name=GroupName" json:"GroupName,omitempty"`
SessionType int32 `protobuf:"varint,9,opt,name=SessionType" json:"SessionType,omitempty"`
MsgFrom int32 `protobuf:"varint,10,opt,name=MsgFrom" json:"MsgFrom,omitempty"`
ContentType int32 `protobuf:"varint,11,opt,name=ContentType" json:"ContentType,omitempty"`
Content string `protobuf:"bytes,12,opt,name=Content" json:"Content,omitempty"`
Status int32 `protobuf:"varint,13,opt,name=Status" json:"Status,omitempty"`
SendTime int64 `protobuf:"varint,14,opt,name=SendTime" json:"SendTime,omitempty"`
CreateTime int64 `protobuf:"varint,15,opt,name=CreateTime" json:"CreateTime,omitempty"`
Ex string `protobuf:"bytes,16,opt,name=Ex" json:"Ex,omitempty"`
GroupID string `protobuf:"bytes,5,opt,name=groupID" json:"groupID,omitempty"`
RecvNickname string `protobuf:"bytes,6,opt,name=recvNickname" json:"recvNickname,omitempty"`
SenderPlatformID int32 `protobuf:"varint,7,opt,name=SenderPlatformID" json:"SenderPlatformID,omitempty"`
SenderNickname string `protobuf:"bytes,8,opt,name=SenderNickname" json:"SenderNickname,omitempty"`
SenderFaceURL string `protobuf:"bytes,9,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"`
GroupName string `protobuf:"bytes,10,opt,name=GroupName" json:"GroupName,omitempty"`
SessionType int32 `protobuf:"varint,11,opt,name=SessionType" json:"SessionType,omitempty"`
MsgFrom int32 `protobuf:"varint,12,opt,name=MsgFrom" json:"MsgFrom,omitempty"`
ContentType int32 `protobuf:"varint,13,opt,name=ContentType" json:"ContentType,omitempty"`
Content string `protobuf:"bytes,14,opt,name=Content" json:"Content,omitempty"`
Status int32 `protobuf:"varint,15,opt,name=Status" json:"Status,omitempty"`
SendTime int64 `protobuf:"varint,16,opt,name=SendTime" json:"SendTime,omitempty"`
CreateTime int64 `protobuf:"varint,17,opt,name=CreateTime" json:"CreateTime,omitempty"`
Ex string `protobuf:"bytes,18,opt,name=Ex" json:"Ex,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@ -566,7 +568,7 @@ func (m *ChatLog) Reset() { *m = ChatLog{} }
func (m *ChatLog) String() string { return proto.CompactTextString(m) }
func (*ChatLog) ProtoMessage() {}
func (*ChatLog) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{10}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{10}
}
func (m *ChatLog) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ChatLog.Unmarshal(m, b)
@ -593,9 +595,9 @@ func (m *ChatLog) GetServerMsgID() string {
return ""
}
func (m *ChatLog) GetStringClientMsgID() string {
func (m *ChatLog) GetClientMsgID() string {
if m != nil {
return m.StringClientMsgID
return m.ClientMsgID
}
return ""
}
@ -614,6 +616,20 @@ func (m *ChatLog) GetRecvID() string {
return ""
}
func (m *ChatLog) GetGroupID() string {
if m != nil {
return m.GroupID
}
return ""
}
func (m *ChatLog) GetRecvNickname() string {
if m != nil {
return m.RecvNickname
}
return ""
}
func (m *ChatLog) GetSenderPlatformID() int32 {
if m != nil {
return m.SenderPlatformID
@ -712,7 +728,7 @@ func (m *GetChatLogsResp) Reset() { *m = GetChatLogsResp{} }
func (m *GetChatLogsResp) String() string { return proto.CompactTextString(m) }
func (*GetChatLogsResp) ProtoMessage() {}
func (*GetChatLogsResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{11}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{11}
}
func (m *GetChatLogsResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetChatLogsResp.Unmarshal(m, b)
@ -772,7 +788,7 @@ func (m *StatisticsReq) Reset() { *m = StatisticsReq{} }
func (m *StatisticsReq) String() string { return proto.CompactTextString(m) }
func (*StatisticsReq) ProtoMessage() {}
func (*StatisticsReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{12}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{12}
}
func (m *StatisticsReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StatisticsReq.Unmarshal(m, b)
@ -818,7 +834,7 @@ func (m *GetActiveUserReq) Reset() { *m = GetActiveUserReq{} }
func (m *GetActiveUserReq) String() string { return proto.CompactTextString(m) }
func (*GetActiveUserReq) ProtoMessage() {}
func (*GetActiveUserReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{13}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{13}
}
func (m *GetActiveUserReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetActiveUserReq.Unmarshal(m, b)
@ -865,7 +881,7 @@ func (m *UserResp) Reset() { *m = UserResp{} }
func (m *UserResp) String() string { return proto.CompactTextString(m) }
func (*UserResp) ProtoMessage() {}
func (*UserResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{14}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{14}
}
func (m *UserResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_UserResp.Unmarshal(m, b)
@ -918,7 +934,7 @@ func (m *GetActiveUserResp) Reset() { *m = GetActiveUserResp{} }
func (m *GetActiveUserResp) String() string { return proto.CompactTextString(m) }
func (*GetActiveUserResp) ProtoMessage() {}
func (*GetActiveUserResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{15}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{15}
}
func (m *GetActiveUserResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetActiveUserResp.Unmarshal(m, b)
@ -964,7 +980,7 @@ func (m *GetActiveGroupReq) Reset() { *m = GetActiveGroupReq{} }
func (m *GetActiveGroupReq) String() string { return proto.CompactTextString(m) }
func (*GetActiveGroupReq) ProtoMessage() {}
func (*GetActiveGroupReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{16}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{16}
}
func (m *GetActiveGroupReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetActiveGroupReq.Unmarshal(m, b)
@ -1012,7 +1028,7 @@ func (m *GroupResp) Reset() { *m = GroupResp{} }
func (m *GroupResp) String() string { return proto.CompactTextString(m) }
func (*GroupResp) ProtoMessage() {}
func (*GroupResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{17}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{17}
}
func (m *GroupResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GroupResp.Unmarshal(m, b)
@ -1072,7 +1088,7 @@ func (m *GetActiveGroupResp) Reset() { *m = GetActiveGroupResp{} }
func (m *GetActiveGroupResp) String() string { return proto.CompactTextString(m) }
func (*GetActiveGroupResp) ProtoMessage() {}
func (*GetActiveGroupResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{18}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{18}
}
func (m *GetActiveGroupResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetActiveGroupResp.Unmarshal(m, b)
@ -1118,7 +1134,7 @@ func (m *DateNumList) Reset() { *m = DateNumList{} }
func (m *DateNumList) String() string { return proto.CompactTextString(m) }
func (*DateNumList) ProtoMessage() {}
func (*DateNumList) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{19}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{19}
}
func (m *DateNumList) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DateNumList.Unmarshal(m, b)
@ -1164,7 +1180,7 @@ func (m *GetMessageStatisticsReq) Reset() { *m = GetMessageStatisticsReq
func (m *GetMessageStatisticsReq) String() string { return proto.CompactTextString(m) }
func (*GetMessageStatisticsReq) ProtoMessage() {}
func (*GetMessageStatisticsReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{20}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{20}
}
func (m *GetMessageStatisticsReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetMessageStatisticsReq.Unmarshal(m, b)
@ -1213,7 +1229,7 @@ func (m *GetMessageStatisticsResp) Reset() { *m = GetMessageStatisticsRe
func (m *GetMessageStatisticsResp) String() string { return proto.CompactTextString(m) }
func (*GetMessageStatisticsResp) ProtoMessage() {}
func (*GetMessageStatisticsResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{21}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{21}
}
func (m *GetMessageStatisticsResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetMessageStatisticsResp.Unmarshal(m, b)
@ -1280,7 +1296,7 @@ func (m *GetGroupStatisticsReq) Reset() { *m = GetGroupStatisticsReq{} }
func (m *GetGroupStatisticsReq) String() string { return proto.CompactTextString(m) }
func (*GetGroupStatisticsReq) ProtoMessage() {}
func (*GetGroupStatisticsReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{22}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{22}
}
func (m *GetGroupStatisticsReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetGroupStatisticsReq.Unmarshal(m, b)
@ -1329,7 +1345,7 @@ func (m *GetGroupStatisticsResp) Reset() { *m = GetGroupStatisticsResp{}
func (m *GetGroupStatisticsResp) String() string { return proto.CompactTextString(m) }
func (*GetGroupStatisticsResp) ProtoMessage() {}
func (*GetGroupStatisticsResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{23}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{23}
}
func (m *GetGroupStatisticsResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetGroupStatisticsResp.Unmarshal(m, b)
@ -1396,7 +1412,7 @@ func (m *GetUserStatisticsReq) Reset() { *m = GetUserStatisticsReq{} }
func (m *GetUserStatisticsReq) String() string { return proto.CompactTextString(m) }
func (*GetUserStatisticsReq) ProtoMessage() {}
func (*GetUserStatisticsReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{24}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{24}
}
func (m *GetUserStatisticsReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetUserStatisticsReq.Unmarshal(m, b)
@ -1447,7 +1463,7 @@ func (m *GetUserStatisticsResp) Reset() { *m = GetUserStatisticsResp{} }
func (m *GetUserStatisticsResp) String() string { return proto.CompactTextString(m) }
func (*GetUserStatisticsResp) ProtoMessage() {}
func (*GetUserStatisticsResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_a6bac7cb5a282446, []int{25}
return fileDescriptor_admin_cms_521fdb68576e364f, []int{25}
}
func (m *GetUserStatisticsResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetUserStatisticsResp.Unmarshal(m, b)
@ -1915,98 +1931,99 @@ var _AdminCMS_serviceDesc = grpc.ServiceDesc{
}
func init() {
proto.RegisterFile("admin_cms/admin_cms.proto", fileDescriptor_admin_cms_a6bac7cb5a282446)
}
var fileDescriptor_admin_cms_a6bac7cb5a282446 = []byte{
// 1416 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcd, 0x6e, 0xdb, 0xc6,
0x13, 0x07, 0x25, 0xcb, 0xb2, 0x46, 0xb1, 0x63, 0x6f, 0xec, 0x84, 0x51, 0xf2, 0xcf, 0x5f, 0x66,
0x93, 0x42, 0x2d, 0x52, 0xa9, 0x70, 0xd0, 0x53, 0x81, 0x14, 0x8e, 0x94, 0xa8, 0x0a, 0xac, 0xc4,
0x60,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,
0xda, 0x07, 0x73, 0x6d, 0x28, 0x41, 0x5f, 0x8b, 0xdb, 0x54, 0xea, 0x05, 0x83, 0xea, 0xba, 0x6b,
0xf6, 0xdd, 0x57, 0xdb, 0x9e, 0x63, 0x41, 0x09, 0xfa, 0x4a, 0x5c, 0x5e, 0xf5, 0xb3, 0x10, 0xfd,
0x3f, 0x4b, 0xb0, 0x1e, 0xb8, 0x3e, 0xdb, 0x80, 0x92, 0x47, 0x37, 0xbe, 0xd9, 0x6a, 0x26, 0xff,
0x41, 0x3f, 0x8f, 0x9f, 0xbe, 0x5f, 0x16, 0x3f, 0x39, 0x1f, 0xfc, 0x1b, 0x00, 0x00, 0xff, 0xff,
0xcd, 0xf8, 0xf8, 0x38, 0x2f, 0x15, 0x00, 0x00,
proto.RegisterFile("admin_cms/admin_cms.proto", fileDescriptor_admin_cms_521fdb68576e364f)
}
var fileDescriptor_admin_cms_521fdb68576e364f = []byte{
// 1436 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xdd, 0x6e, 0x13, 0xc7,
0x17, 0xd7, 0xda, 0x71, 0x1c, 0x1f, 0x93, 0x90, 0x1c, 0x12, 0x58, 0x0c, 0x7f, 0xfe, 0xce, 0x16,
0xaa, 0xb4, 0xa2, 0x49, 0x15, 0xd4, 0xab, 0x4a, 0x54, 0x21, 0x86, 0xd4, 0x28, 0x86, 0x68, 0x81,
0x4a, 0x6d, 0x55, 0xac, 0xad, 0x3d, 0xb8, 0xab, 0xe0, 0xdd, 0x61, 0x67, 0x1c, 0x40, 0x55, 0x6f,
0xb9, 0xe9, 0x7d, 0x2f, 0x7a, 0xd9, 0x17, 0xe8, 0x45, 0x9f, 0xa0, 0x97, 0x7d, 0x8c, 0xaa, 0x2f,
0x52, 0xcd, 0xcc, 0x7e, 0xcc, 0xec, 0x6e, 0x6c, 0x13, 0x54, 0xee, 0xe6, 0x9c, 0x39,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36, 0x67, 0x48, 0x30, 0x8a, 0x5f, 0xc9, 0xc7, 0xab,
0x39, 0x0b, 0xf1, 0xff, 0xc5, 0x04, 0x9b, 0x86, 0xdb, 0xd3, 0x05, 0x18, 0xbd, 0x73, 0xe9, 0x9b,
0x8d, 0xed, 0xec, 0xcf, 0xe9, 0xe7, 0xe9, 0xea, 0xfb, 0x45, 0xf9, 0x5b, 0xf4, 0xd6, 0xbf, 0x01,
0x00, 0x00, 0xff, 0xff, 0x9c, 0x40, 0xb4, 0xf6, 0x61, 0x15, 0x00, 0x00,
}

@ -65,21 +65,23 @@ message GetChatLogsReq {
message ChatLog {
string ServerMsgID = 1;
string stringClientMsgID = 2;
string ClientMsgID = 2;
string SendID = 3;
string RecvID = 4;
int32 SenderPlatformID = 5;
string SenderNickname = 6;
string SenderFaceURL = 7;
string GroupName = 8;
int32 SessionType = 9;
int32 MsgFrom = 10;
int32 ContentType = 11;
string Content = 12;
int32 Status = 13;
int64 SendTime = 14;
int64 CreateTime = 15;
string Ex = 16;
string RecvID = 4;
string groupID = 5;
string recvNickname = 6;
int32 SenderPlatformID = 7;
string SenderNickname = 8;
string SenderFaceURL = 9;
string GroupName = 10;
int32 SessionType = 11;
int32 MsgFrom = 12;
int32 ContentType = 13;
string Content = 14;
int32 Status = 15;
int64 SendTime = 16;
int64 CreateTime = 17;
string Ex = 18;
}
message GetChatLogsResp {

File diff suppressed because it is too large Load Diff

@ -219,27 +219,19 @@ message CMSGroup {
string GroupOwnerUserID = 3;
}
message GetGroupReq {
string GroupName = 1;
server_api_params.RequestPagination Pagination = 2;
string OperationID = 3;
}
message GetGroupResp {
repeated CMSGroup CMSGroups = 1;
server_api_params.RequestPagination Pagination = 2;
int32 GroupNums = 3;
}
message GetGroupsReq {
server_api_params.RequestPagination Pagination = 1;
string OperationID = 2;
string GroupName = 2;
string GroupID = 3;
string OperationID = 4;
}
message GetGroupsResp {
repeated CMSGroup CMSGroups = 1;
server_api_params.RequestPagination Pagination = 2;
server_api_params.ResponsePagination Pagination = 2;
int32 GroupNum = 3;
CommonResp commonResp = 4;
}
message GetGroupMemberReq {
@ -247,26 +239,6 @@ message GetGroupMemberReq {
string OperationID = 2;
}
message OperateUserRoleReq {
string GroupID = 1;
string UserID = 2;
int32 RoleLevel = 3;
string OperationID = 4;
}
message OperateUserRoleResp {
}
message GetGroupByIDReq {
string GroupID = 1;
string OperationID = 2;
}
message GetGroupByIDResp {
CMSGroup CMSGroup = 1;
}
message GetGroupMembersCMSReq {
string GroupID = 1;
string UserName = 2;
@ -278,30 +250,7 @@ message GetGroupMembersCMSResp {
repeated server_api_params.GroupMemberFullInfo members = 1;
server_api_params.ResponsePagination Pagination = 2;
int32 MemberNums = 3;
}
message RemoveGroupMembersCMSReq {
string GroupID = 1;
repeated string UserIDList = 2;
string OperationID = 3;
string OpUserID = 4;
}
message RemoveGroupMembersCMSResp {
repeated string success = 1;
repeated string failed = 2;
}
message AddGroupMembersCMSReq {
string GroupID = 1;
repeated string UserIDList = 2;
string OperationID = 3;
string OpUserID = 4;
}
message AddGroupMembersCMSResp {
repeated string success = 1;
repeated string failed = 2;
CommonResp commonResp = 4;
}
message DismissGroupReq{
@ -444,13 +393,9 @@ service group{
rpc inviteUserToGroup(InviteUserToGroupReq) returns (InviteUserToGroupResp);
rpc getGroupAllMember(GetGroupAllMemberReq) returns(GetGroupAllMemberResp);
rpc GetGroupByID(GetGroupByIDReq) returns(GetGroupByIDResp);
rpc GetGroup(GetGroupReq) returns(GetGroupResp);
rpc GetGroups(GetGroupsReq) returns(GetGroupsResp);
rpc OperateUserRole(OperateUserRoleReq) returns(OperateUserRoleResp);
rpc GetGroupMembersCMS(GetGroupMembersCMSReq) returns(GetGroupMembersCMSResp);
rpc RemoveGroupMembersCMS(RemoveGroupMembersCMSReq) returns(RemoveGroupMembersCMSResp);
rpc AddGroupMembersCMS(AddGroupMembersCMSReq) returns(AddGroupMembersCMSResp);
rpc DismissGroup(DismissGroupReq) returns(DismissGroupResp);
rpc MuteGroupMember(MuteGroupMemberReq) returns(MuteGroupMemberResp);
@ -459,7 +404,6 @@ service group{
rpc CancelMuteGroup(CancelMuteGroupReq) returns(CancelMuteGroupResp);
rpc SetGroupMemberNickname(SetGroupMemberNicknameReq) returns (SetGroupMemberNicknameResp);
rpc GetJoinedSuperGroupList(GetJoinedSuperGroupListReq) returns (GetJoinedSuperGroupListResp);
rpc GetSuperGroupsInfo(GetSuperGroupsInfoReq) returns (GetSuperGroupsInfoResp);
rpc SetGroupMemberInfo(SetGroupMemberInfoReq) returns (SetGroupMemberInfoResp);

Loading…
Cancel
Save