mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
cobra
This commit is contained in:
parent
345bf3a882
commit
9ce50095b5
@ -28,7 +28,7 @@ func run(port int) error {
|
||||
if port == 0 {
|
||||
port = config.Config.Api.GinPort[0]
|
||||
}
|
||||
zk, err := openKeeper.NewClient(config.Config.Zookeeper.ZkAddr, "", 10, "", "")
|
||||
zk, err := openKeeper.NewClient(config.Config.Zookeeper.ZkAddr, "", 10, config.Config.Zookeeper.UserName, config.Config.Zookeeper.Password)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -3,24 +3,24 @@ package api
|
||||
import (
|
||||
"OpenIM/internal/api/a2r"
|
||||
"OpenIM/pkg/common/config"
|
||||
"OpenIM/pkg/discoveryregistry"
|
||||
auth "OpenIM/pkg/proto/auth"
|
||||
"context"
|
||||
"github.com/OpenIMSDK/openKeeper"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
var _ context.Context // 解决goland编辑器bug
|
||||
|
||||
func NewAuth(zk *openKeeper.ZkClient) *Auth {
|
||||
return &Auth{zk: zk}
|
||||
func NewAuth(c discoveryregistry.SvcDiscoveryRegistry) *Auth {
|
||||
return &Auth{c: c}
|
||||
}
|
||||
|
||||
type Auth struct {
|
||||
zk *openKeeper.ZkClient
|
||||
c discoveryregistry.SvcDiscoveryRegistry
|
||||
}
|
||||
|
||||
func (o *Auth) client() (auth.AuthClient, error) {
|
||||
conn, err := o.zk.GetConn(config.Config.RpcRegisterName.OpenImAuthName)
|
||||
conn, err := o.c.GetConn(config.Config.RpcRegisterName.OpenImAuthName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -3,24 +3,24 @@ package api
|
||||
import (
|
||||
"OpenIM/internal/api/a2r"
|
||||
"OpenIM/pkg/common/config"
|
||||
"OpenIM/pkg/discoveryregistry"
|
||||
"OpenIM/pkg/proto/conversation"
|
||||
"context"
|
||||
"github.com/OpenIMSDK/openKeeper"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
var _ context.Context // 解决goland编辑器bug
|
||||
|
||||
func NewConversation(zk *openKeeper.ZkClient) *Conversation {
|
||||
return &Conversation{zk: zk}
|
||||
func NewConversation(c discoveryregistry.SvcDiscoveryRegistry) *Conversation {
|
||||
return &Conversation{c: c}
|
||||
}
|
||||
|
||||
type Conversation struct {
|
||||
zk *openKeeper.ZkClient
|
||||
c discoveryregistry.SvcDiscoveryRegistry
|
||||
}
|
||||
|
||||
func (o *Conversation) client() (conversation.ConversationClient, error) {
|
||||
conn, err := o.zk.GetConn(config.Config.RpcRegisterName.OpenImConversationName)
|
||||
conn, err := o.c.GetConn(config.Config.RpcRegisterName.OpenImConversationName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -3,24 +3,25 @@ package api
|
||||
import (
|
||||
"OpenIM/internal/api/a2r"
|
||||
"OpenIM/pkg/common/config"
|
||||
"OpenIM/pkg/discoveryregistry"
|
||||
"OpenIM/pkg/proto/friend"
|
||||
"context"
|
||||
"github.com/OpenIMSDK/openKeeper"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
var _ context.Context // 解决goland编辑器bug
|
||||
|
||||
func NewFriend(zk *openKeeper.ZkClient) *Friend {
|
||||
return &Friend{zk: zk}
|
||||
func NewFriend(c discoveryregistry.SvcDiscoveryRegistry) *Friend {
|
||||
return &Friend{c: c}
|
||||
}
|
||||
|
||||
type Friend struct {
|
||||
zk *openKeeper.ZkClient
|
||||
c discoveryregistry.SvcDiscoveryRegistry
|
||||
}
|
||||
|
||||
func (o *Friend) client() (friend.FriendClient, error) {
|
||||
conn, err := o.zk.GetConn(config.Config.RpcRegisterName.OpenImFriendName)
|
||||
conn, err := o.c.GetConn(config.Config.RpcRegisterName.OpenImFriendName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -3,24 +3,25 @@ package api
|
||||
import (
|
||||
"OpenIM/internal/api/a2r"
|
||||
"OpenIM/pkg/common/config"
|
||||
"OpenIM/pkg/discoveryregistry"
|
||||
"OpenIM/pkg/proto/group"
|
||||
"context"
|
||||
"github.com/OpenIMSDK/openKeeper"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
var _ context.Context // 解决goland编辑器bug
|
||||
|
||||
func NewGroup(zk *openKeeper.ZkClient) *Group {
|
||||
return &Group{zk: zk}
|
||||
func NewGroup(c discoveryregistry.SvcDiscoveryRegistry) *Group {
|
||||
return &Group{c: c}
|
||||
}
|
||||
|
||||
type Group struct {
|
||||
zk *openKeeper.ZkClient
|
||||
c discoveryregistry.SvcDiscoveryRegistry
|
||||
}
|
||||
|
||||
func (o *Group) client() (group.GroupClient, error) {
|
||||
conn, err := o.zk.GetConn(config.Config.RpcRegisterName.OpenImGroupName)
|
||||
conn, err := o.c.GetConn(config.Config.RpcRegisterName.OpenImGroupName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -7,13 +7,13 @@ import (
|
||||
"OpenIM/pkg/common/config"
|
||||
"OpenIM/pkg/common/constant"
|
||||
"OpenIM/pkg/common/log"
|
||||
"OpenIM/pkg/discoveryregistry"
|
||||
"OpenIM/pkg/errs"
|
||||
"OpenIM/pkg/proto/msg"
|
||||
"OpenIM/pkg/proto/sdkws"
|
||||
"OpenIM/pkg/utils"
|
||||
"context"
|
||||
"errors"
|
||||
"github.com/OpenIMSDK/openKeeper"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/go-playground/validator/v10"
|
||||
"github.com/golang/protobuf/proto"
|
||||
@ -22,12 +22,12 @@ import (
|
||||
|
||||
var _ context.Context // 解决goland编辑器bug
|
||||
|
||||
func NewMsg(zk *openKeeper.ZkClient) *Msg {
|
||||
return &Msg{zk: zk, validate: validator.New()}
|
||||
func NewMsg(c discoveryregistry.SvcDiscoveryRegistry) *Msg {
|
||||
return &Msg{c: c, validate: validator.New()}
|
||||
}
|
||||
|
||||
type Msg struct {
|
||||
zk *openKeeper.ZkClient
|
||||
c discoveryregistry.SvcDiscoveryRegistry
|
||||
validate *validator.Validate
|
||||
}
|
||||
|
||||
@ -107,7 +107,7 @@ func newUserSendMsgReq(params *apistruct.ManagementSendMsgReq) *msg.SendMsgReq {
|
||||
}
|
||||
|
||||
func (o *Msg) client() (msg.MsgClient, error) {
|
||||
conn, err := o.zk.GetConn(config.Config.RpcRegisterName.OpenImMsgName)
|
||||
conn, err := o.c.GetConn(config.Config.RpcRegisterName.OpenImMsgName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -214,7 +214,7 @@ func (o *Msg) ManagementSendMsg(c *gin.Context) {
|
||||
}
|
||||
log.NewInfo(params.OperationID, "Ws call success to ManagementSendMsgReq", params)
|
||||
pbData := newUserSendMsgReq(¶ms)
|
||||
conn, err := o.zk.GetConn(config.Config.RpcRegisterName.OpenImMsgName)
|
||||
conn, err := o.c.GetConn(config.Config.RpcRegisterName.OpenImMsgName)
|
||||
if err != nil {
|
||||
apiresp.GinError(c, errs.ErrInternalServer)
|
||||
return
|
||||
|
@ -5,13 +5,13 @@ import (
|
||||
"OpenIM/pkg/common/log"
|
||||
"OpenIM/pkg/common/mw"
|
||||
"OpenIM/pkg/common/prome"
|
||||
"github.com/OpenIMSDK/openKeeper"
|
||||
"OpenIM/pkg/discoveryregistry"
|
||||
"github.com/gin-gonic/gin"
|
||||
"io"
|
||||
"os"
|
||||
)
|
||||
|
||||
func NewGinRouter(zk *openKeeper.ZkClient) *gin.Engine {
|
||||
func NewGinRouter(zk discoveryregistry.SvcDiscoveryRegistry) *gin.Engine {
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
f, _ := os.Create("../logs/api.log")
|
||||
gin.DefaultWriter = io.MultiWriter(f)
|
||||
@ -27,7 +27,6 @@ func NewGinRouter(zk *openKeeper.ZkClient) *gin.Engine {
|
||||
r.GET("/metrics", prome.PrometheusHandler())
|
||||
}
|
||||
zk.AddOption(mw.GrpcClient()) // 默认RPC中间件
|
||||
|
||||
userRouterGroup := r.Group("/user")
|
||||
{
|
||||
u := NewUser(zk)
|
||||
|
@ -3,24 +3,25 @@ package api
|
||||
import (
|
||||
"OpenIM/internal/api/a2r"
|
||||
"OpenIM/pkg/common/config"
|
||||
"OpenIM/pkg/discoveryregistry"
|
||||
"OpenIM/pkg/proto/third"
|
||||
"context"
|
||||
"github.com/OpenIMSDK/openKeeper"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
var _ context.Context // 解决goland编辑器bug
|
||||
|
||||
func NewThird(zk *openKeeper.ZkClient) *Third {
|
||||
return &Third{zk: zk}
|
||||
func NewThird(c discoveryregistry.SvcDiscoveryRegistry) *Third {
|
||||
return &Third{c: c}
|
||||
}
|
||||
|
||||
type Third struct {
|
||||
zk *openKeeper.ZkClient
|
||||
c discoveryregistry.SvcDiscoveryRegistry
|
||||
}
|
||||
|
||||
func (o *Third) client() (third.ThirdClient, error) {
|
||||
conn, err := o.zk.GetConn(config.Config.RpcRegisterName.OpenImThirdName)
|
||||
conn, err := o.c.GetConn(config.Config.RpcRegisterName.OpenImThirdName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -3,24 +3,24 @@ package api
|
||||
import (
|
||||
"OpenIM/internal/api/a2r"
|
||||
"OpenIM/pkg/common/config"
|
||||
"OpenIM/pkg/discoveryregistry"
|
||||
"OpenIM/pkg/proto/user"
|
||||
"context"
|
||||
"github.com/OpenIMSDK/openKeeper"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
var _ context.Context // 解决goland编辑器bug
|
||||
|
||||
func NewUser(zk *openKeeper.ZkClient) *User {
|
||||
return &User{zk: zk}
|
||||
func NewUser(client discoveryregistry.SvcDiscoveryRegistry) *User {
|
||||
return &User{c: client}
|
||||
}
|
||||
|
||||
type User struct {
|
||||
zk *openKeeper.ZkClient
|
||||
c discoveryregistry.SvcDiscoveryRegistry
|
||||
}
|
||||
|
||||
func (o *User) client() (user.UserClient, error) {
|
||||
conn, err := o.zk.GetConn(config.Config.RpcRegisterName.OpenImUserName)
|
||||
conn, err := o.c.GetConn(config.Config.RpcRegisterName.OpenImUserName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -13,7 +13,6 @@ type UserTokenInfo struct {
|
||||
ExpiredTime int64 `json:"expiredTime"`
|
||||
}
|
||||
type UserRegisterResp struct {
|
||||
CommResp
|
||||
UserToken UserTokenInfo `json:"data"`
|
||||
}
|
||||
|
||||
@ -25,7 +24,6 @@ type UserTokenReq struct {
|
||||
}
|
||||
|
||||
type UserTokenResp struct {
|
||||
CommResp
|
||||
UserToken UserTokenInfo `json:"data"`
|
||||
}
|
||||
|
||||
@ -36,7 +34,6 @@ type ForceLogoutReq struct {
|
||||
}
|
||||
|
||||
type ForceLogoutResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type ParseTokenReq struct {
|
||||
@ -44,7 +41,7 @@ type ParseTokenReq struct {
|
||||
}
|
||||
|
||||
//type ParseTokenResp struct {
|
||||
// CommResp
|
||||
//
|
||||
// ExpireTime int64 `json:"expireTime" binding:"required"`
|
||||
//}
|
||||
|
||||
@ -53,7 +50,6 @@ type ExpireTime struct {
|
||||
}
|
||||
|
||||
type ParseTokenResp struct {
|
||||
CommResp
|
||||
Data map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
ExpireTime ExpireTime `json:"-"`
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ type AwsStorageCredentialRespData struct {
|
||||
}
|
||||
|
||||
type AwsStorageCredentialResp struct {
|
||||
CommResp
|
||||
CosData AwsStorageCredentialRespData
|
||||
Data map[string]interface{} `json:"data"`
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
package apistruct
|
||||
|
||||
type RequestPagination struct {
|
||||
PageNumber int `json:"pageNumber" binding:"required"`
|
||||
ShowNumber int `json:"showNumber" binding:"required"`
|
||||
}
|
@ -9,7 +9,6 @@ type GetAllConversationMessageOptReq struct {
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
}
|
||||
type GetAllConversationMessageOptResp struct {
|
||||
CommResp
|
||||
ConversationOptResultList []*OptResult `json:"data"`
|
||||
}
|
||||
type GetReceiveMessageOptReq struct {
|
||||
@ -18,7 +17,6 @@ type GetReceiveMessageOptReq struct {
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
}
|
||||
type GetReceiveMessageOptResp struct {
|
||||
CommResp
|
||||
ConversationOptResultList []*OptResult `json:"data"`
|
||||
}
|
||||
type SetReceiveMessageOptReq struct {
|
||||
@ -28,7 +26,6 @@ type SetReceiveMessageOptReq struct {
|
||||
ConversationIDList []string `json:"conversationIDList" binding:"required"`
|
||||
}
|
||||
type SetReceiveMessageOptResp struct {
|
||||
CommResp
|
||||
ConversationOptResultList []*OptResult `json:"data"`
|
||||
}
|
||||
|
||||
@ -58,7 +55,6 @@ type SetConversationReq struct {
|
||||
}
|
||||
|
||||
type SetConversationResp struct {
|
||||
CommResp
|
||||
}
|
||||
type ModifyConversationFieldReq struct {
|
||||
Conversation
|
||||
@ -67,7 +63,6 @@ type ModifyConversationFieldReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type ModifyConversationFieldResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type BatchSetConversationsReq struct {
|
||||
@ -78,7 +73,6 @@ type BatchSetConversationsReq struct {
|
||||
}
|
||||
|
||||
type BatchSetConversationsResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
Success []string `json:"success"`
|
||||
Failed []string `json:"failed"`
|
||||
@ -92,7 +86,6 @@ type GetConversationReq struct {
|
||||
}
|
||||
|
||||
type GetConversationResp struct {
|
||||
CommResp
|
||||
Conversation Conversation `json:"data"`
|
||||
}
|
||||
|
||||
@ -102,7 +95,6 @@ type GetAllConversationsReq struct {
|
||||
}
|
||||
|
||||
type GetAllConversationsResp struct {
|
||||
CommResp
|
||||
Conversations []Conversation `json:"data"`
|
||||
}
|
||||
|
||||
@ -113,7 +105,6 @@ type GetConversationsReq struct {
|
||||
}
|
||||
|
||||
type GetConversationsResp struct {
|
||||
CommResp
|
||||
Conversations []Conversation `json:"data"`
|
||||
}
|
||||
|
||||
@ -126,5 +117,4 @@ type SetRecvMsgOptReq struct {
|
||||
}
|
||||
|
||||
type SetRecvMsgOptResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
@ -13,7 +13,6 @@ type TencentCloudStorageCredentialRespData struct {
|
||||
}
|
||||
|
||||
type TencentCloudStorageCredentialResp struct {
|
||||
CommResp
|
||||
CosData TencentCloudStorageCredentialRespData `json:"-"`
|
||||
|
||||
Data map[string]interface{} `json:"data"`
|
||||
|
@ -10,7 +10,7 @@ package apistruct
|
||||
// ParamsCommFriend
|
||||
//}
|
||||
//type AddBlacklistResp struct {
|
||||
// CommResp
|
||||
//
|
||||
//}
|
||||
//
|
||||
//type ImportFriendReq struct {
|
||||
@ -23,7 +23,7 @@ package apistruct
|
||||
// Result int32 `json:"result"`
|
||||
//}
|
||||
//type ImportFriendResp struct {
|
||||
// CommResp
|
||||
//
|
||||
// UserIDResultList []UserIDResult `json:"data"`
|
||||
//}
|
||||
//
|
||||
@ -32,7 +32,7 @@ package apistruct
|
||||
// ReqMsg string `json:"reqMsg"`
|
||||
//}
|
||||
//type AddFriendResp struct {
|
||||
// CommResp
|
||||
//
|
||||
//}
|
||||
//
|
||||
//type AddFriendResponseReq struct {
|
||||
@ -41,14 +41,14 @@ package apistruct
|
||||
// HandleMsg string `json:"handleMsg"`
|
||||
//}
|
||||
//type AddFriendResponseResp struct {
|
||||
// CommResp
|
||||
//
|
||||
//}
|
||||
//
|
||||
//type DeleteFriendReq struct {
|
||||
// ParamsCommFriend
|
||||
//}
|
||||
//type DeleteFriendResp struct {
|
||||
// CommResp
|
||||
//
|
||||
//}
|
||||
//
|
||||
//type GetBlackListReq struct {
|
||||
@ -56,7 +56,7 @@ package apistruct
|
||||
// FromUserID string `json:"fromUserID" binding:"required"`
|
||||
//}
|
||||
//type GetBlackListResp struct {
|
||||
// CommResp
|
||||
//
|
||||
// BlackUserInfoList []*sdkws.PublicUserInfo `json:"-"`
|
||||
// Map []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
//}
|
||||
@ -73,14 +73,14 @@ package apistruct
|
||||
// Remark string `json:"remark"`
|
||||
//}
|
||||
//type SetFriendRemarkResp struct {
|
||||
// CommResp
|
||||
//
|
||||
//}
|
||||
//
|
||||
//type RemoveBlacklistReq struct {
|
||||
// ParamsCommFriend
|
||||
//}
|
||||
//type RemoveBlacklistResp struct {
|
||||
// CommResp
|
||||
//
|
||||
//}
|
||||
//
|
||||
//type IsFriendReq struct {
|
||||
@ -90,7 +90,7 @@ package apistruct
|
||||
// Friend bool `json:"isFriend"`
|
||||
//}
|
||||
//type IsFriendResp struct {
|
||||
// CommResp
|
||||
//
|
||||
// Response Response `json:"data"`
|
||||
//}
|
||||
//
|
||||
@ -98,7 +98,7 @@ package apistruct
|
||||
// ParamsCommFriend
|
||||
//}
|
||||
//type GetFriendsInfoResp struct {
|
||||
// CommResp
|
||||
//
|
||||
// FriendInfoList []*sdkws.FriendInfo `json:"-"`
|
||||
// Map []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
//}
|
||||
@ -108,7 +108,7 @@ package apistruct
|
||||
// FromUserID string `json:"fromUserID" binding:"required"`
|
||||
//}
|
||||
//type GetFriendListResp struct {
|
||||
// CommResp
|
||||
//
|
||||
// FriendInfoList []*sdkws.FriendInfo `json:"-"`
|
||||
// Map []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
//}
|
||||
@ -118,7 +118,7 @@ package apistruct
|
||||
// FromUserID string `json:"fromUserID" binding:"required"`
|
||||
//}
|
||||
//type GetFriendApplyListResp struct {
|
||||
// CommResp
|
||||
//
|
||||
// FriendRequestList []*sdkws.FriendRequest `json:"-"`
|
||||
// Map []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
//}
|
||||
@ -128,7 +128,7 @@ package apistruct
|
||||
// FromUserID string `json:"fromUserID" binding:"required"`
|
||||
//}
|
||||
//type GetSelfApplyListResp struct {
|
||||
// CommResp
|
||||
//
|
||||
// FriendRequestList []*sdkws.FriendRequest `json:"-"`
|
||||
// Map []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
//}
|
||||
@ -180,7 +180,7 @@ type ImportFriendReq struct {
|
||||
}
|
||||
|
||||
type ImportFriendResp struct {
|
||||
//CommResp
|
||||
//
|
||||
}
|
||||
|
||||
type AddFriendReq struct {
|
||||
@ -189,7 +189,7 @@ type AddFriendReq struct {
|
||||
ReqMsg string `json:"reqMsg"`
|
||||
}
|
||||
type AddFriendResp struct {
|
||||
//CommResp
|
||||
//
|
||||
}
|
||||
|
||||
type AddFriendResponseReq struct {
|
||||
|
@ -4,13 +4,13 @@ import (
|
||||
sdkws "OpenIM/pkg/proto/sdkws"
|
||||
)
|
||||
|
||||
type CommResp struct {
|
||||
type struct {
|
||||
ErrCode int32 `json:"errCode"`
|
||||
ErrMsg string `json:"errMsg"`
|
||||
}
|
||||
|
||||
type CommDataResp struct {
|
||||
CommResp
|
||||
|
||||
Data []map[string]interface{} `json:"data"`
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ type KickGroupMemberReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type KickGroupMemberResp struct {
|
||||
CommResp
|
||||
|
||||
//UserIDResultList []*UserIDResult `json:"data"`
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ type GetGroupMembersInfoReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type GetGroupMembersInfoResp struct {
|
||||
CommResp
|
||||
|
||||
MemberList []*sdkws.GroupMemberFullInfo `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
@ -43,7 +43,7 @@ type InviteUserToGroupReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type InviteUserToGroupResp struct {
|
||||
CommResp
|
||||
|
||||
//UserIDResultList []*UserIDResult `json:"data"`
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ type GetJoinedGroupListReq struct {
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
}
|
||||
type GetJoinedGroupListResp struct {
|
||||
CommResp
|
||||
|
||||
GroupInfoList []*sdkws.GroupInfo `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
@ -64,7 +64,7 @@ type GetGroupMemberListReq struct {
|
||||
OperationID string `json:"operationID"`
|
||||
}
|
||||
type GetGroupMemberListResp struct {
|
||||
CommResp
|
||||
|
||||
NextSeq int32 `json:"nextSeq"`
|
||||
MemberList []*sdkws.GroupMemberFullInfo `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
@ -77,7 +77,7 @@ type GetGroupAllMemberReq struct {
|
||||
Count int32 `json:"count"`
|
||||
}
|
||||
type GetGroupAllMemberResp struct {
|
||||
CommResp
|
||||
|
||||
MemberList []*sdkws.GroupMemberFullInfo `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
@ -90,7 +90,7 @@ type GetGroupAllMemberResp struct {
|
||||
// Count int32 `json:"count" binding:"required"`
|
||||
//}
|
||||
//type GetGroupAllMemberListBySplitResp struct {
|
||||
// CommResp
|
||||
//
|
||||
// MemberList []*sdkws.GroupMemberFullInfo `json:"-"`
|
||||
// Map []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
//}
|
||||
@ -108,7 +108,7 @@ type CreateGroupReq struct {
|
||||
GroupID string `json:"groupID"`
|
||||
}
|
||||
type CreateGroupResp struct {
|
||||
CommResp
|
||||
|
||||
GroupInfo sdkws.GroupInfo `json:"-"`
|
||||
Data map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
@ -118,7 +118,7 @@ type GetGroupApplicationListReq struct {
|
||||
FromUserID string `json:"fromUserID" binding:"required"` //作为管理员或群主收到的 进群申请
|
||||
}
|
||||
type GetGroupApplicationListResp struct {
|
||||
CommResp
|
||||
|
||||
GroupRequestList []*sdkws.GroupRequest `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
@ -137,7 +137,7 @@ type GetGroupInfoReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type GetGroupInfoResp struct {
|
||||
CommResp
|
||||
|
||||
GroupInfoList []*sdkws.GroupInfo `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
@ -171,7 +171,7 @@ type ApplicationGroupResponseReq struct {
|
||||
HandleResult int32 `json:"handleResult" binding:"required,oneof=-1 1"`
|
||||
}
|
||||
type ApplicationGroupResponseResp struct {
|
||||
CommResp
|
||||
|
||||
}
|
||||
|
||||
type JoinGroupReq struct {
|
||||
@ -183,7 +183,7 @@ type JoinGroupReq struct {
|
||||
}
|
||||
|
||||
type JoinGroupResp struct {
|
||||
CommResp
|
||||
|
||||
}
|
||||
|
||||
type QuitGroupReq struct {
|
||||
@ -191,7 +191,7 @@ type QuitGroupReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type QuitGroupResp struct {
|
||||
CommResp
|
||||
|
||||
}
|
||||
|
||||
type SetGroupInfoReq struct {
|
||||
@ -208,7 +208,7 @@ type SetGroupInfoReq struct {
|
||||
}
|
||||
|
||||
type SetGroupInfoResp struct {
|
||||
CommResp
|
||||
|
||||
}
|
||||
|
||||
type TransferGroupOwnerReq struct {
|
||||
@ -218,7 +218,7 @@ type TransferGroupOwnerReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type TransferGroupOwnerResp struct {
|
||||
CommResp
|
||||
|
||||
}
|
||||
|
||||
type DismissGroupReq struct {
|
||||
@ -226,7 +226,7 @@ type DismissGroupReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type DismissGroupResp struct {
|
||||
CommResp
|
||||
|
||||
}
|
||||
|
||||
type MuteGroupMemberReq struct {
|
||||
@ -236,7 +236,7 @@ type MuteGroupMemberReq struct {
|
||||
MutedSeconds uint32 `json:"mutedSeconds" binding:"required"`
|
||||
}
|
||||
type MuteGroupMemberResp struct {
|
||||
CommResp
|
||||
|
||||
}
|
||||
|
||||
type CancelMuteGroupMemberReq struct {
|
||||
@ -245,7 +245,7 @@ type CancelMuteGroupMemberReq struct {
|
||||
UserID string `json:"userID" binding:"required"`
|
||||
}
|
||||
type CancelMuteGroupMemberResp struct {
|
||||
CommResp
|
||||
|
||||
}
|
||||
|
||||
type MuteGroupReq struct {
|
||||
@ -253,7 +253,7 @@ type MuteGroupReq struct {
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
}
|
||||
type MuteGroupResp struct {
|
||||
CommResp
|
||||
|
||||
}
|
||||
|
||||
type CancelMuteGroupReq struct {
|
||||
@ -261,7 +261,7 @@ type CancelMuteGroupReq struct {
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
}
|
||||
type CancelMuteGroupResp struct {
|
||||
CommResp
|
||||
|
||||
}
|
||||
|
||||
type SetGroupMemberNicknameReq struct {
|
||||
@ -272,7 +272,7 @@ type SetGroupMemberNicknameReq struct {
|
||||
}
|
||||
|
||||
type SetGroupMemberNicknameResp struct {
|
||||
CommResp
|
||||
|
||||
}
|
||||
|
||||
type SetGroupMemberInfoReq struct {
|
||||
@ -286,7 +286,7 @@ type SetGroupMemberInfoReq struct {
|
||||
}
|
||||
|
||||
type SetGroupMemberInfoResp struct {
|
||||
CommResp
|
||||
|
||||
}
|
||||
|
||||
type GetGroupAbstractInfoReq struct {
|
||||
@ -295,7 +295,7 @@ type GetGroupAbstractInfoReq struct {
|
||||
}
|
||||
|
||||
type GetGroupAbstractInfoResp struct {
|
||||
CommResp
|
||||
|
||||
GroupMemberNumber int32 `json:"groupMemberNumber"`
|
||||
GroupMemberListHash uint64 `json:"groupMemberListHash"`
|
||||
}
|
||||
|
@ -9,14 +9,12 @@ type DeleteUsersReq struct {
|
||||
DeleteUserIDList []string `json:"deleteUserIDList" binding:"required"`
|
||||
}
|
||||
type DeleteUsersResp struct {
|
||||
CommResp
|
||||
FailedUserIDList []string `json:"data"`
|
||||
}
|
||||
type GetAllUsersUidReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type GetAllUsersUidResp struct {
|
||||
CommResp
|
||||
UserIDList []string `json:"data"`
|
||||
}
|
||||
type GetUsersOnlineStatusReq struct {
|
||||
@ -24,7 +22,7 @@ type GetUsersOnlineStatusReq struct {
|
||||
UserIDList []string `json:"userIDList" binding:"required,lte=200"`
|
||||
}
|
||||
type GetUsersOnlineStatusResp struct {
|
||||
CommResp
|
||||
|
||||
//SuccessResult []*msggateway.GetUsersOnlineStatusResp_SuccessResult `json:"data"`
|
||||
}
|
||||
type AccountCheckReq struct {
|
||||
@ -32,7 +30,7 @@ type AccountCheckReq struct {
|
||||
CheckUserIDList []string `json:"checkUserIDList" binding:"required,lte=100"`
|
||||
}
|
||||
type AccountCheckResp struct {
|
||||
CommResp
|
||||
|
||||
//ResultList []*pbUser.AccountCheckResp_SingleUserStatus `json:"data"`
|
||||
}
|
||||
|
||||
@ -69,7 +67,6 @@ type ManagementBatchSendMsgReq struct {
|
||||
}
|
||||
|
||||
type ManagementBatchSendMsgResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
ResultList []*SingleReturnResult `json:"resultList"`
|
||||
FailedIDList []string
|
||||
@ -87,7 +84,6 @@ type CheckMsgIsSendSuccessReq struct {
|
||||
}
|
||||
|
||||
type CheckMsgIsSendSuccessResp struct {
|
||||
CommResp
|
||||
Status int32 `json:"status"`
|
||||
}
|
||||
|
||||
@ -119,7 +115,6 @@ type CMSUser struct {
|
||||
}
|
||||
|
||||
type GetUsersResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
UserList []*CMSUser `json:"userList"`
|
||||
TotalNum int32 `json:"totalNum"`
|
||||
|
@ -12,7 +12,6 @@ type DelMsgReq struct {
|
||||
}
|
||||
|
||||
type DelMsgResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type CleanUpMsgReq struct {
|
||||
@ -21,7 +20,6 @@ type CleanUpMsgReq struct {
|
||||
}
|
||||
|
||||
type CleanUpMsgResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type DelSuperGroupMsgReq struct {
|
||||
@ -33,7 +31,6 @@ type DelSuperGroupMsgReq struct {
|
||||
}
|
||||
|
||||
type DelSuperGroupMsgResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type MsgDeleteNotificationElem struct {
|
||||
@ -50,7 +47,6 @@ type SetMsgMinSeqReq struct {
|
||||
}
|
||||
|
||||
type SetMsgMinSeqResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type ModifyMessageReactionExtensionsReq struct {
|
||||
@ -67,7 +63,6 @@ type ModifyMessageReactionExtensionsReq struct {
|
||||
}
|
||||
|
||||
type ModifyMessageReactionExtensionsResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
ResultKeyValue []*msg.KeyValueResp `json:"result"`
|
||||
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
|
||||
@ -83,7 +78,6 @@ type ModifyMessageReactionExtensionsResp struct {
|
||||
//}
|
||||
|
||||
type OperateMessageListReactionExtensionsResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
SuccessList []*msg.ExtendMsgResp `json:"successList"`
|
||||
FailedList []*msg.ExtendMsgResp `json:"failedList"`
|
||||
@ -97,7 +91,6 @@ type SetMessageReactionExtensionsCallbackResp ModifyMessageReactionExtensionsRes
|
||||
//type GetMessageListReactionExtensionsReq OperateMessageListReactionExtensionsReq
|
||||
|
||||
type GetMessageListReactionExtensionsResp struct {
|
||||
CommResp
|
||||
Data []*msg.SingleMessageExtensionResult `json:"data"`
|
||||
}
|
||||
|
||||
@ -116,7 +109,6 @@ type DeleteMessageReactionExtensionsReq struct {
|
||||
}
|
||||
|
||||
type DeleteMessageReactionExtensionsResp struct {
|
||||
CommResp
|
||||
Data []*msg.KeyValueResp
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,6 @@ type OSSCredentialRespData struct {
|
||||
}
|
||||
|
||||
type OSSCredentialResp struct {
|
||||
CommResp
|
||||
OssData OSSCredentialRespData `json:"-"`
|
||||
Data map[string]interface{} `json:"data"`
|
||||
}
|
||||
|
@ -29,7 +29,6 @@ type MinioUploadFile struct {
|
||||
}
|
||||
|
||||
type MinioUploadFileResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
MinioUploadFile
|
||||
} `json:"data"`
|
||||
@ -46,7 +45,6 @@ type UploadUpdateAppReq struct {
|
||||
}
|
||||
|
||||
type UploadUpdateAppResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type GetDownloadURLReq struct {
|
||||
@ -56,7 +54,6 @@ type GetDownloadURLReq struct {
|
||||
}
|
||||
|
||||
type GetDownloadURLResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
HasNewVersion bool `json:"hasNewVersion"`
|
||||
ForceUpdate bool `json:"forceUpdate"`
|
||||
@ -73,7 +70,6 @@ type GetRTCInvitationInfoReq struct {
|
||||
}
|
||||
|
||||
type GetRTCInvitationInfoResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
OpUserID string `json:"opUserID"`
|
||||
Invitation struct {
|
||||
@ -110,7 +106,6 @@ type FcmUpdateTokenReq struct {
|
||||
}
|
||||
|
||||
type FcmUpdateTokenResp struct {
|
||||
CommResp
|
||||
}
|
||||
type SetAppBadgeReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
@ -119,5 +114,4 @@ type SetAppBadgeReq struct {
|
||||
}
|
||||
|
||||
type SetAppBadgeResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
|
||||
const (
|
||||
singleGocMsgNum = 5000
|
||||
msg = "msg"
|
||||
Msg = "msg"
|
||||
OldestList = 0
|
||||
NewestList = -1
|
||||
)
|
||||
@ -38,7 +38,7 @@ type MsgDocModelInterface interface {
|
||||
}
|
||||
|
||||
func (MsgDocModel) TableName() string {
|
||||
return msg
|
||||
return Msg
|
||||
}
|
||||
|
||||
func (MsgDocModel) GetSingleGocMsgNum() int64 {
|
||||
|
@ -61,7 +61,7 @@ func (m *Mongo) GetDatabase() *mongo.Database {
|
||||
}
|
||||
|
||||
func (m *Mongo) CreateMsgIndex() error {
|
||||
return m.createMongoIndex(unrelation.CChat, false, "uid")
|
||||
return m.createMongoIndex(unrelation.Msg, false, "uid")
|
||||
}
|
||||
|
||||
func (m *Mongo) CreateSuperGroupIndex() error {
|
||||
|
@ -9,6 +9,7 @@ type SvcDiscoveryRegistry interface {
|
||||
UnRegister() error
|
||||
GetConns(serviceName string, opts ...grpc.DialOption) ([]*grpc.ClientConn, error)
|
||||
GetConn(serviceName string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
|
||||
AddOption(opts ...grpc.DialOption)
|
||||
|
||||
RegisterConf2Registry(key string, conf []byte) error
|
||||
GetConfFromRegistry(key string) ([]byte, error)
|
||||
|
Loading…
x
Reference in New Issue
Block a user