fix: changing naming irregularities under pkg and internal packages (#520)

Signed-off-by: BanTanger <1290288968@qq.com>
pull/636/head
BanTanger 2 years ago
parent 94b4dcae3f
commit b369e43c05

@ -25,7 +25,6 @@ require (
github.com/robfig/cron/v3 v3.0.1 github.com/robfig/cron/v3 v3.0.1
github.com/sirupsen/logrus v1.9.2 // indirect github.com/sirupsen/logrus v1.9.2 // indirect
github.com/stretchr/testify v1.8.3 github.com/stretchr/testify v1.8.3
github.com/tencentyun/qcloud-cos-sts-sdk v0.0.0-20210325043845-84a0811633ca
go.mongodb.org/mongo-driver v1.8.3 go.mongodb.org/mongo-driver v1.8.3
golang.org/x/image v0.3.0 golang.org/x/image v0.3.0
google.golang.org/api v0.114.0 google.golang.org/api v0.114.0

@ -426,8 +426,6 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.194/go.mod
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.194/go.mod h1:yrBKWhChnDqNz1xuXdSbWXG56XawEq0G5j1lg4VwBD4= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.194/go.mod h1:yrBKWhChnDqNz1xuXdSbWXG56XawEq0G5j1lg4VwBD4=
github.com/tencentyun/cos-go-sdk-v5 v0.7.41 h1:iU0Li/Np78H4SBna0ECQoF3mpgi6ImLXU+doGzPFXGc= github.com/tencentyun/cos-go-sdk-v5 v0.7.41 h1:iU0Li/Np78H4SBna0ECQoF3mpgi6ImLXU+doGzPFXGc=
github.com/tencentyun/cos-go-sdk-v5 v0.7.41/go.mod h1:4dCEtLHGh8QPxHEkgq+nFaky7yZxQuYwgSJM87icDaw= github.com/tencentyun/cos-go-sdk-v5 v0.7.41/go.mod h1:4dCEtLHGh8QPxHEkgq+nFaky7yZxQuYwgSJM87icDaw=
github.com/tencentyun/qcloud-cos-sts-sdk v0.0.0-20210325043845-84a0811633ca h1:G/aIr3WiUesWHL2YGYgEqjM5tCAJ43Ml+0C18wDkWWs=
github.com/tencentyun/qcloud-cos-sts-sdk v0.0.0-20210325043845-84a0811633ca/go.mod h1:b18KQa4IxHbxeseW1GcZox53d7J0z39VNONTxvvlkXw=
github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=

@ -0,0 +1,21 @@
#!/usr/bin/env bash
internet_ip=`curl ifconfig.me -s`
echo $internet_ip
source .env
echo $MINIO_ENDPOINT
if [ $MINIO_ENDPOINT == "http://127.0.0.1:10005" ]; then
sed -i "s/127.0.0.1/${internet_ip}/" .env
fi
cd scripts ;
chmod +x *.sh ;
./init_pwd.sh
./env_check.sh;
cd .. ;
docker-compose -f im-compose.yaml up -d
docker ps

@ -0,0 +1,43 @@
#!/usr/bin/env bash
# Get the public internet IP address
internet_ip=$(curl ifconfig.me -s)
echo $internet_ip
# Load environment variables from .env file
source .env
echo $MINIO_ENDPOINT
# Replace local IP address with the public IP address in .env file
if [ $API_URL == "http://127.0.0.1:10002/object/" ]; then
sed -i "s/127.0.0.1/${internet_ip}/" .env
fi
if [ $MINIO_ENDPOINT == "http://127.0.0.1:10005" ]; then
sed -i "s/127.0.0.1/${internet_ip}/" .env
fi
# Change directory to scripts folder
cd scripts
chmod +x *.sh
# Execute necessary scripts
./init_pwd.sh
./env_check.sh
# Go back to the previous directory
cd ..
# Check if docker-compose command is available
if command -v docker-compose &> /dev/null
then
docker-compose up -d
else
docker compose up -d
fi
# Change directory to scripts folder again
cd scripts
# Check docker services
./docker_check_service.sh

@ -86,7 +86,6 @@ func (u *UserApi) GetUsersOnlineStatus(c *gin.Context) {
log.ZWarn(c, "GetUsersOnlineStatus rpc err", err) log.ZWarn(c, "GetUsersOnlineStatus rpc err", err)
parseError := apiresp.ParseError(err) parseError := apiresp.ParseError(err)
log.ZDebug(c, "errcode bantanger", "errcode", parseError.ErrCode)
if parseError.ErrCode == errs.NoPermissionError { if parseError.ErrCode == errs.NoPermissionError {
apiresp.GinError(c, err) apiresp.GinError(c, err)
return return

@ -18,12 +18,12 @@ import (
"context" "context"
) )
// OfflinePusher Offline Pusher. // OfflinePusher Offline Pusher
type OfflinePusher interface { type OfflinePusher interface {
Push(ctx context.Context, userIDs []string, title, content string, opts *Opts) error Push(ctx context.Context, userIDs []string, title, content string, opts *Opts) error
} }
// Opts opts. // Opts opts
type Opts struct { type Opts struct {
Signal *Signal Signal *Signal
IOSPushSound string IOSPushSound string
@ -31,7 +31,7 @@ type Opts struct {
Ex string Ex string
} }
// Signal message id. // Signal message id
type Signal struct { type Signal struct {
ClientMsgID string ClientMsgID string
} }

@ -33,7 +33,7 @@ type SendMsg struct {
} }
type SendMsgReq struct { type SendMsgReq struct {
RecvID string `json:"recvID" binding:"required_if" message:"recvID is required if sessionType is SingleChatType or NotificationChatType"` RecvID string `json:"recvID" binding:"required_if" message:"recvID is required if sessionType is SingleChatType or NotificationChatType"`
SendMsg SendMsg
} }

@ -38,6 +38,7 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/errinfo" "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/errinfo"
) )
// rpcString
func rpcString(v interface{}) string { func rpcString(v interface{}) string {
if s, ok := v.(interface{ String() string }); ok { if s, ok := v.(interface{ String() string }); ok {
return s.String() return s.String()
@ -45,6 +46,7 @@ func rpcString(v interface{}) string {
return fmt.Sprintf("%+v", v) return fmt.Sprintf("%+v", v)
} }
// RpcServerInterceptor
func RpcServerInterceptor( func RpcServerInterceptor(
ctx context.Context, ctx context.Context,
req interface{}, req interface{},
@ -52,7 +54,7 @@ func RpcServerInterceptor(
handler grpc.UnaryHandler, handler grpc.UnaryHandler,
) (resp interface{}, err error) { ) (resp interface{}, err error) {
log.ZDebug(ctx, "rpc server req", "req", rpcString(req)) log.ZDebug(ctx, "rpc server req", "req", rpcString(req))
//defer func() { // defer func() {
// if r := recover(); r != nil { // if r := recover(); r != nil {
// log.ZError(ctx, "rpc panic", nil, "FullMethod", info.FullMethod, "type:", fmt.Sprintf("%T", r), "panic:", r) // log.ZError(ctx, "rpc panic", nil, "FullMethod", info.FullMethod, "type:", fmt.Sprintf("%T", r), "panic:", r)
// fmt.Printf("panic: %+v\nstack info: %s\n", r, string(debug.Stack())) // fmt.Printf("panic: %+v\nstack info: %s\n", r, string(debug.Stack()))
@ -74,7 +76,7 @@ func RpcServerInterceptor(
// } // }
// err = sta.Err() // err = sta.Err()
// } // }
//}() // }()
funcName := info.FullMethod funcName := info.FullMethod
md, ok := metadata.FromIncomingContext(ctx) md, ok := metadata.FromIncomingContext(ctx)
if !ok { if !ok {
@ -133,8 +135,8 @@ func RpcServerInterceptor(
var errInfo *errinfo.ErrorInfo var errInfo *errinfo.ErrorInfo
if config.Config.Log.WithStack { if config.Config.Log.WithStack {
if unwrap != err { if unwrap != err {
sti, ok := err.(interface{ StackTrace() errors.StackTrace }) var sti interface{ StackTrace() errors.StackTrace }
if ok { if errors.As(err, &sti) {
log.ZWarn( log.ZWarn(
ctx, ctx,
"rpc server resp", "rpc server resp",
@ -173,9 +175,11 @@ func RpcServerInterceptor(
return nil, errs.Wrap(err) return nil, errs.Wrap(err)
} }
log.ZWarn(ctx, "rpc server resp", err, "funcName", funcName) log.ZWarn(ctx, "rpc server resp", err, "funcName", funcName)
return nil, details.Err() return nil, details.Err()
} }
// GrpcServer
func GrpcServer() grpc.ServerOption { func GrpcServer() grpc.ServerOption {
return grpc.ChainUnaryInterceptor(RpcServerInterceptor) return grpc.ChainUnaryInterceptor(RpcServerInterceptor)
} }

@ -14,10 +14,15 @@
package specialerror package specialerror
import "github.com/OpenIMSDK/Open-IM-Server/pkg/errs" import (
"errors"
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
)
var handlers []func(err error) errs.CodeError var handlers []func(err error) errs.CodeError
// AddErrHandler
func AddErrHandler(h func(err error) errs.CodeError) { func AddErrHandler(h func(err error) errs.CodeError) {
if h == nil { if h == nil {
panic("nil handler") panic("nil handler")
@ -27,13 +32,15 @@ func AddErrHandler(h func(err error) errs.CodeError) {
func AddReplace(target error, codeErr errs.CodeError) { func AddReplace(target error, codeErr errs.CodeError) {
AddErrHandler(func(err error) errs.CodeError { AddErrHandler(func(err error) errs.CodeError {
if err == target { if errors.Is(err, target) {
return codeErr return codeErr
} }
return nil return nil
}) })
} }
// ErrCode
func ErrCode(err error) errs.CodeError { func ErrCode(err error) errs.CodeError {
if codeErr, ok := err.(errs.CodeError); ok { if codeErr, ok := err.(errs.CodeError); ok {
return codeErr return codeErr
@ -43,5 +50,6 @@ func ErrCode(err error) errs.CodeError {
return codeErr return codeErr
} }
} }
return nil return nil
} }

@ -79,6 +79,7 @@ var (
ConversationCreateFailedCounter prometheus.Counter ConversationCreateFailedCounter prometheus.Counter
) )
// NewUserLoginCounter
func NewUserLoginCounter() { func NewUserLoginCounter() {
if UserLoginCounter != nil { if UserLoginCounter != nil {
return return
@ -89,6 +90,7 @@ func NewUserLoginCounter() {
}) })
} }
// NewUserRegisterCounter
func NewUserRegisterCounter() { func NewUserRegisterCounter() {
if UserRegisterCounter != nil { if UserRegisterCounter != nil {
return return
@ -99,6 +101,7 @@ func NewUserRegisterCounter() {
}) })
} }
// NewSeqGetSuccessCounter
func NewSeqGetSuccessCounter() { func NewSeqGetSuccessCounter() {
if SeqGetSuccessCounter != nil { if SeqGetSuccessCounter != nil {
return return
@ -109,6 +112,7 @@ func NewSeqGetSuccessCounter() {
}) })
} }
// NewSeqGetFailedCounter
func NewSeqGetFailedCounter() { func NewSeqGetFailedCounter() {
if SeqGetFailedCounter != nil { if SeqGetFailedCounter != nil {
return return
@ -119,6 +123,7 @@ func NewSeqGetFailedCounter() {
}) })
} }
// NewSeqSetSuccessCounter
func NewSeqSetSuccessCounter() { func NewSeqSetSuccessCounter() {
if SeqSetSuccessCounter != nil { if SeqSetSuccessCounter != nil {
return return
@ -129,6 +134,7 @@ func NewSeqSetSuccessCounter() {
}) })
} }
// NewSeqSetFailedCounter
func NewSeqSetFailedCounter() { func NewSeqSetFailedCounter() {
if SeqSetFailedCounter != nil { if SeqSetFailedCounter != nil {
return return
@ -139,6 +145,7 @@ func NewSeqSetFailedCounter() {
}) })
} }
// NewApiRequestCounter
func NewApiRequestCounter() { func NewApiRequestCounter() {
if ApiRequestCounter != nil { if ApiRequestCounter != nil {
return return
@ -149,6 +156,7 @@ func NewApiRequestCounter() {
}) })
} }
// NewApiRequestSuccessCounter
func NewApiRequestSuccessCounter() { func NewApiRequestSuccessCounter() {
if ApiRequestSuccessCounter != nil { if ApiRequestSuccessCounter != nil {
return return
@ -159,6 +167,7 @@ func NewApiRequestSuccessCounter() {
}) })
} }
// NewApiRequestFailedCounter
func NewApiRequestFailedCounter() { func NewApiRequestFailedCounter() {
if ApiRequestFailedCounter != nil { if ApiRequestFailedCounter != nil {
return return
@ -169,6 +178,7 @@ func NewApiRequestFailedCounter() {
}) })
} }
// NewGrpcRequestCounter
func NewGrpcRequestCounter() { func NewGrpcRequestCounter() {
if GrpcRequestCounter != nil { if GrpcRequestCounter != nil {
return return
@ -179,6 +189,7 @@ func NewGrpcRequestCounter() {
}) })
} }
// NewGrpcRequestSuccessCounter
func NewGrpcRequestSuccessCounter() { func NewGrpcRequestSuccessCounter() {
if GrpcRequestSuccessCounter != nil { if GrpcRequestSuccessCounter != nil {
return return
@ -189,6 +200,7 @@ func NewGrpcRequestSuccessCounter() {
}) })
} }
// NewGrpcRequestFailedCounter
func NewGrpcRequestFailedCounter() { func NewGrpcRequestFailedCounter() {
if GrpcRequestFailedCounter != nil { if GrpcRequestFailedCounter != nil {
return return
@ -199,6 +211,7 @@ func NewGrpcRequestFailedCounter() {
}) })
} }
// NewSendMsgCount
func NewSendMsgCount() { func NewSendMsgCount() {
if SendMsgCounter != nil { if SendMsgCounter != nil {
return return
@ -209,6 +222,7 @@ func NewSendMsgCount() {
}) })
} }
// NewMsgInsertRedisSuccessCounter
func NewMsgInsertRedisSuccessCounter() { func NewMsgInsertRedisSuccessCounter() {
if MsgInsertRedisSuccessCounter != nil { if MsgInsertRedisSuccessCounter != nil {
return return
@ -219,6 +233,7 @@ func NewMsgInsertRedisSuccessCounter() {
}) })
} }
// NewMsgInsertRedisFailedCounter
func NewMsgInsertRedisFailedCounter() { func NewMsgInsertRedisFailedCounter() {
if MsgInsertRedisFailedCounter != nil { if MsgInsertRedisFailedCounter != nil {
return return
@ -229,6 +244,7 @@ func NewMsgInsertRedisFailedCounter() {
}) })
} }
// NewMsgInsertMongoSuccessCounter
func NewMsgInsertMongoSuccessCounter() { func NewMsgInsertMongoSuccessCounter() {
if MsgInsertMongoSuccessCounter != nil { if MsgInsertMongoSuccessCounter != nil {
return return
@ -239,6 +255,7 @@ func NewMsgInsertMongoSuccessCounter() {
}) })
} }
// NewMsgInsertMongoFailedCounter
func NewMsgInsertMongoFailedCounter() { func NewMsgInsertMongoFailedCounter() {
if MsgInsertMongoFailedCounter != nil { if MsgInsertMongoFailedCounter != nil {
return return
@ -249,6 +266,7 @@ func NewMsgInsertMongoFailedCounter() {
}) })
} }
// NewMsgPullFromRedisSuccessCounter
func NewMsgPullFromRedisSuccessCounter() { func NewMsgPullFromRedisSuccessCounter() {
if MsgPullFromRedisSuccessCounter != nil { if MsgPullFromRedisSuccessCounter != nil {
return return
@ -259,6 +277,7 @@ func NewMsgPullFromRedisSuccessCounter() {
}) })
} }
// NewMsgPullFromRedisFailedCounter
func NewMsgPullFromRedisFailedCounter() { func NewMsgPullFromRedisFailedCounter() {
if MsgPullFromRedisFailedCounter != nil { if MsgPullFromRedisFailedCounter != nil {
return return
@ -269,6 +288,7 @@ func NewMsgPullFromRedisFailedCounter() {
}) })
} }
// NewMsgPullFromMongoSuccessCounter
func NewMsgPullFromMongoSuccessCounter() { func NewMsgPullFromMongoSuccessCounter() {
if MsgPullFromMongoSuccessCounter != nil { if MsgPullFromMongoSuccessCounter != nil {
return return
@ -279,6 +299,7 @@ func NewMsgPullFromMongoSuccessCounter() {
}) })
} }
// NewMsgPullFromMongoFailedCounter
func NewMsgPullFromMongoFailedCounter() { func NewMsgPullFromMongoFailedCounter() {
if MsgPullFromMongoFailedCounter != nil { if MsgPullFromMongoFailedCounter != nil {
return return
@ -289,6 +310,7 @@ func NewMsgPullFromMongoFailedCounter() {
}) })
} }
// NewMsgRecvTotalCounter
func NewMsgRecvTotalCounter() { func NewMsgRecvTotalCounter() {
if MsgRecvTotalCounter != nil { if MsgRecvTotalCounter != nil {
return return
@ -299,6 +321,7 @@ func NewMsgRecvTotalCounter() {
}) })
} }
// NewGetNewestSeqTotalCounter
func NewGetNewestSeqTotalCounter() { func NewGetNewestSeqTotalCounter() {
if GetNewestSeqTotalCounter != nil { if GetNewestSeqTotalCounter != nil {
return return
@ -309,6 +332,7 @@ func NewGetNewestSeqTotalCounter() {
}) })
} }
// NewPullMsgBySeqListTotalCounter
func NewPullMsgBySeqListTotalCounter() { func NewPullMsgBySeqListTotalCounter() {
if PullMsgBySeqListTotalCounter != nil { if PullMsgBySeqListTotalCounter != nil {
return return
@ -319,6 +343,7 @@ func NewPullMsgBySeqListTotalCounter() {
}) })
} }
// NewSingleChatMsgRecvSuccessCounter
func NewSingleChatMsgRecvSuccessCounter() { func NewSingleChatMsgRecvSuccessCounter() {
if SingleChatMsgRecvSuccessCounter != nil { if SingleChatMsgRecvSuccessCounter != nil {
return return
@ -329,6 +354,7 @@ func NewSingleChatMsgRecvSuccessCounter() {
}) })
} }
// NewGroupChatMsgRecvSuccessCounter
func NewGroupChatMsgRecvSuccessCounter() { func NewGroupChatMsgRecvSuccessCounter() {
if GroupChatMsgRecvSuccessCounter != nil { if GroupChatMsgRecvSuccessCounter != nil {
return return
@ -339,6 +365,7 @@ func NewGroupChatMsgRecvSuccessCounter() {
}) })
} }
// NewWorkSuperGroupChatMsgRecvSuccessCounter
func NewWorkSuperGroupChatMsgRecvSuccessCounter() { func NewWorkSuperGroupChatMsgRecvSuccessCounter() {
if WorkSuperGroupChatMsgRecvSuccessCounter != nil { if WorkSuperGroupChatMsgRecvSuccessCounter != nil {
return return
@ -349,6 +376,7 @@ func NewWorkSuperGroupChatMsgRecvSuccessCounter() {
}) })
} }
// NewOnlineUserGauges
func NewOnlineUserGauges() { func NewOnlineUserGauges() {
if OnlineUserGauge != nil { if OnlineUserGauge != nil {
return return
@ -359,6 +387,7 @@ func NewOnlineUserGauges() {
}) })
} }
// NewSingleChatMsgProcessSuccessCounter
func NewSingleChatMsgProcessSuccessCounter() { func NewSingleChatMsgProcessSuccessCounter() {
if SingleChatMsgProcessSuccessCounter != nil { if SingleChatMsgProcessSuccessCounter != nil {
return return
@ -369,6 +398,7 @@ func NewSingleChatMsgProcessSuccessCounter() {
}) })
} }
// NewSingleChatMsgProcessFailedCounter
func NewSingleChatMsgProcessFailedCounter() { func NewSingleChatMsgProcessFailedCounter() {
if SingleChatMsgProcessFailedCounter != nil { if SingleChatMsgProcessFailedCounter != nil {
return return
@ -379,6 +409,7 @@ func NewSingleChatMsgProcessFailedCounter() {
}) })
} }
// NewGroupChatMsgProcessSuccessCounter
func NewGroupChatMsgProcessSuccessCounter() { func NewGroupChatMsgProcessSuccessCounter() {
if GroupChatMsgProcessSuccessCounter != nil { if GroupChatMsgProcessSuccessCounter != nil {
return return
@ -389,6 +420,7 @@ func NewGroupChatMsgProcessSuccessCounter() {
}) })
} }
// NewGroupChatMsgProcessFailedCounter
func NewGroupChatMsgProcessFailedCounter() { func NewGroupChatMsgProcessFailedCounter() {
if GroupChatMsgProcessFailedCounter != nil { if GroupChatMsgProcessFailedCounter != nil {
return return
@ -399,6 +431,7 @@ func NewGroupChatMsgProcessFailedCounter() {
}) })
} }
// NewWorkSuperGroupChatMsgProcessSuccessCounter
func NewWorkSuperGroupChatMsgProcessSuccessCounter() { func NewWorkSuperGroupChatMsgProcessSuccessCounter() {
if WorkSuperGroupChatMsgProcessSuccessCounter != nil { if WorkSuperGroupChatMsgProcessSuccessCounter != nil {
return return
@ -409,6 +442,7 @@ func NewWorkSuperGroupChatMsgProcessSuccessCounter() {
}) })
} }
// NewWorkSuperGroupChatMsgProcessFailedCounter
func NewWorkSuperGroupChatMsgProcessFailedCounter() { func NewWorkSuperGroupChatMsgProcessFailedCounter() {
if WorkSuperGroupChatMsgProcessFailedCounter != nil { if WorkSuperGroupChatMsgProcessFailedCounter != nil {
return return
@ -419,6 +453,7 @@ func NewWorkSuperGroupChatMsgProcessFailedCounter() {
}) })
} }
// NewMsgOnlinePushSuccessCounter
func NewMsgOnlinePushSuccessCounter() { func NewMsgOnlinePushSuccessCounter() {
if MsgOnlinePushSuccessCounter != nil { if MsgOnlinePushSuccessCounter != nil {
return return
@ -429,6 +464,7 @@ func NewMsgOnlinePushSuccessCounter() {
}) })
} }
// NewMsgOfflinePushSuccessCounter
func NewMsgOfflinePushSuccessCounter() { func NewMsgOfflinePushSuccessCounter() {
if MsgOfflinePushSuccessCounter != nil { if MsgOfflinePushSuccessCounter != nil {
return return
@ -439,6 +475,7 @@ func NewMsgOfflinePushSuccessCounter() {
}) })
} }
// NewMsgOfflinePushFailedCounter
func NewMsgOfflinePushFailedCounter() { func NewMsgOfflinePushFailedCounter() {
if MsgOfflinePushFailedCounter != nil { if MsgOfflinePushFailedCounter != nil {
return return
@ -449,6 +486,7 @@ func NewMsgOfflinePushFailedCounter() {
}) })
} }
// NewConversationCreateSuccessCounter
func NewConversationCreateSuccessCounter() { func NewConversationCreateSuccessCounter() {
if ConversationCreateSuccessCounter != nil { if ConversationCreateSuccessCounter != nil {
return return
@ -459,6 +497,7 @@ func NewConversationCreateSuccessCounter() {
}) })
} }
// NewConversationCreateFailedCounter
func NewConversationCreateFailedCounter() { func NewConversationCreateFailedCounter() {
if ConversationCreateFailedCounter != nil { if ConversationCreateFailedCounter != nil {
return return

@ -26,6 +26,7 @@ import (
"github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/client_golang/prometheus/promhttp"
) )
// StartPrometheusSrv
func StartPrometheusSrv(prometheusPort int) error { func StartPrometheusSrv(prometheusPort int) error {
if config.Config.Prometheus.Enable { if config.Config.Prometheus.Enable {
http.Handle("/metrics", promhttp.Handler()) http.Handle("/metrics", promhttp.Handler())
@ -35,6 +36,7 @@ func StartPrometheusSrv(prometheusPort int) error {
return nil return nil
} }
// PrometheusHandler
func PrometheusHandler() gin.HandlerFunc { func PrometheusHandler() gin.HandlerFunc {
h := promhttp.Handler() h := promhttp.Handler()
return func(c *gin.Context) { return func(c *gin.Context) {
@ -42,16 +44,19 @@ func PrometheusHandler() gin.HandlerFunc {
} }
} }
// responseBodyWriter
type responseBodyWriter struct { type responseBodyWriter struct {
gin.ResponseWriter gin.ResponseWriter
body *bytes.Buffer body *bytes.Buffer
} }
// Write
func (r responseBodyWriter) Write(b []byte) (int, error) { func (r responseBodyWriter) Write(b []byte) (int, error) {
r.body.Write(b) r.body.Write(b)
return r.ResponseWriter.Write(b) return r.ResponseWriter.Write(b)
} }
// PrometheusMiddleware
func PrometheusMiddleware(c *gin.Context) { func PrometheusMiddleware(c *gin.Context) {
Inc(ApiRequestCounter) Inc(ApiRequestCounter)
w := &responseBodyWriter{body: &bytes.Buffer{}, ResponseWriter: c.Writer} w := &responseBodyWriter{body: &bytes.Buffer{}, ResponseWriter: c.Writer}
@ -64,6 +69,7 @@ func PrometheusMiddleware(c *gin.Context) {
} }
} }
// Inc
func Inc(counter prometheus.Counter) { func Inc(counter prometheus.Counter) {
if config.Config.Prometheus.Enable { if config.Config.Prometheus.Enable {
if counter != nil { if counter != nil {
@ -72,6 +78,7 @@ func Inc(counter prometheus.Counter) {
} }
} }
// Add
func Add(counter prometheus.Counter, add int) { func Add(counter prometheus.Counter, add int) {
if config.Config.Prometheus.Enable { if config.Config.Prometheus.Enable {
if counter != nil { if counter != nil {
@ -80,6 +87,7 @@ func Add(counter prometheus.Counter, add int) {
} }
} }
// GaugeInc
func GaugeInc(gauges prometheus.Gauge) { func GaugeInc(gauges prometheus.Gauge) {
if config.Config.Prometheus.Enable { if config.Config.Prometheus.Enable {
if gauges != nil { if gauges != nil {
@ -88,6 +96,7 @@ func GaugeInc(gauges prometheus.Gauge) {
} }
} }
// GaugeDec
func GaugeDec(gauges prometheus.Gauge) { func GaugeDec(gauges prometheus.Gauge) {
if config.Config.Prometheus.Enable { if config.Config.Prometheus.Enable {
if gauges != nil { if gauges != nil {

@ -27,15 +27,18 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils" "github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
) )
// Claims
type Claims struct { type Claims struct {
UserID string UserID string
PlatformID int // login platform PlatformID int // login platform
jwt.RegisteredClaims jwt.RegisteredClaims
} }
// BuildClaims
func BuildClaims(uid string, platformID int, ttl int64) Claims { func BuildClaims(uid string, platformID int, ttl int64) Claims {
now := time.Now() now := time.Now()
before := now.Add(-time.Minute * 5) before := now.Add(-time.Minute * 5)
return Claims{ return Claims{
UserID: uid, UserID: uid,
PlatformID: platformID, PlatformID: platformID,
@ -47,12 +50,14 @@ func BuildClaims(uid string, platformID int, ttl int64) Claims {
} }
} }
// secret
func secret() jwt.Keyfunc { func secret() jwt.Keyfunc {
return func(token *jwt.Token) (interface{}, error) { return func(token *jwt.Token) (interface{}, error) {
return []byte(config.Config.Secret), nil return []byte(config.Config.Secret), nil
} }
} }
// GetClaimFromToken
func GetClaimFromToken(tokensString string) (*Claims, error) { func GetClaimFromToken(tokensString string) (*Claims, error) {
token, err := jwt.ParseWithClaims(tokensString, &Claims{}, secret()) token, err := jwt.ParseWithClaims(tokensString, &Claims{}, secret())
if err != nil { if err != nil {
@ -73,10 +78,12 @@ func GetClaimFromToken(tokensString string) (*Claims, error) {
if claims, ok := token.Claims.(*Claims); ok && token.Valid { if claims, ok := token.Claims.(*Claims); ok && token.Valid {
return claims, nil return claims, nil
} }
return nil, utils.Wrap(errs.ErrTokenUnknown, "") return nil, utils.Wrap(errs.ErrTokenUnknown, "")
} }
} }
// CheckAccessV3
func CheckAccessV3(ctx context.Context, ownerUserID string) (err error) { func CheckAccessV3(ctx context.Context, ownerUserID string) (err error) {
opUserID := mcontext.GetOpUserID(ctx) opUserID := mcontext.GetOpUserID(ctx)
if utils.IsContain(opUserID, config.Config.Manager.UserID) { if utils.IsContain(opUserID, config.Config.Manager.UserID) {
@ -85,28 +92,35 @@ func CheckAccessV3(ctx context.Context, ownerUserID string) (err error) {
if opUserID == ownerUserID { if opUserID == ownerUserID {
return nil return nil
} }
return errs.ErrNoPermission.Wrap(utils.GetSelfFuncName()) return errs.ErrNoPermission.Wrap(utils.GetSelfFuncName())
} }
// IsAppManagerUid
func IsAppManagerUid(ctx context.Context) bool { func IsAppManagerUid(ctx context.Context) bool {
return utils.IsContain(mcontext.GetOpUserID(ctx), config.Config.Manager.UserID) return utils.IsContain(mcontext.GetOpUserID(ctx), config.Config.Manager.UserID)
} }
// CheckAdmin
func CheckAdmin(ctx context.Context) error { func CheckAdmin(ctx context.Context) error {
if utils.IsContain(mcontext.GetOpUserID(ctx), config.Config.Manager.UserID) { if utils.IsContain(mcontext.GetOpUserID(ctx), config.Config.Manager.UserID) {
return nil return nil
} }
return errs.ErrNoPermission.Wrap(fmt.Sprintf("user %s is not admin userID", mcontext.GetOpUserID(ctx))) return errs.ErrNoPermission.Wrap(fmt.Sprintf("user %s is not admin userID", mcontext.GetOpUserID(ctx)))
} }
// ParseRedisInterfaceToken
func ParseRedisInterfaceToken(redisToken interface{}) (*Claims, error) { func ParseRedisInterfaceToken(redisToken interface{}) (*Claims, error) {
return GetClaimFromToken(string(redisToken.([]uint8))) return GetClaimFromToken(string(redisToken.([]uint8)))
} }
// IsManagerUserID
func IsManagerUserID(opUserID string) bool { func IsManagerUserID(opUserID string) bool {
return utils.IsContain(opUserID, config.Config.Manager.UserID) return utils.IsContain(opUserID, config.Config.Manager.UserID)
} }
// WsVerifyToken
func WsVerifyToken(token, userID string, platformID int) error { func WsVerifyToken(token, userID string, platformID int) error {
claim, err := GetClaimFromToken(token) claim, err := GetClaimFromToken(token)
if err != nil { if err != nil {
@ -118,5 +132,6 @@ func WsVerifyToken(token, userID string, platformID int) error {
if claim.PlatformID != platformID { if claim.PlatformID != platformID {
return errs.ErrTokenInvalid.Wrap(fmt.Sprintf("token platform %d != %d", claim.PlatformID, platformID)) return errs.ErrTokenInvalid.Wrap(fmt.Sprintf("token platform %d != %d", claim.PlatformID, platformID))
} }
return nil return nil
} }

@ -20,6 +20,7 @@ import (
"google.golang.org/grpc" "google.golang.org/grpc"
) )
// Conn
type Conn interface { type Conn interface {
GetConns(ctx context.Context, serviceName string, opts ...grpc.DialOption) ([]grpc.ClientConnInterface, error) GetConns(ctx context.Context, serviceName string, opts ...grpc.DialOption) ([]grpc.ClientConnInterface, error)
GetConn(ctx context.Context, serviceName string, opts ...grpc.DialOption) (grpc.ClientConnInterface, error) GetConn(ctx context.Context, serviceName string, opts ...grpc.DialOption) (grpc.ClientConnInterface, error)
@ -29,6 +30,7 @@ type Conn interface {
GetClientLocalConns() map[string][]grpc.ClientConnInterface GetClientLocalConns() map[string][]grpc.ClientConnInterface
} }
// SvcDiscoveryRegistry
type SvcDiscoveryRegistry interface { type SvcDiscoveryRegistry interface {
Conn Conn
Register(serviceName, host string, port int, opts ...grpc.DialOption) error Register(serviceName, host string, port int, opts ...grpc.DialOption) error

@ -18,6 +18,7 @@ import (
"github.com/go-zookeeper/zk" "github.com/go-zookeeper/zk"
) )
// RegisterConf2Registry
func (s *ZkClient) RegisterConf2Registry(key string, conf []byte) error { func (s *ZkClient) RegisterConf2Registry(key string, conf []byte) error {
exists, _, err := s.conn.Exists(s.getPath(key)) exists, _, err := s.conn.Exists(s.getPath(key))
if err != nil { if err != nil {
@ -32,10 +33,13 @@ func (s *ZkClient) RegisterConf2Registry(key string, conf []byte) error {
if err != zk.ErrNodeExists { if err != zk.ErrNodeExists {
return err return err
} }
return nil return nil
} }
// GetConfFromRegistry
func (s *ZkClient) GetConfFromRegistry(key string) ([]byte, error) { func (s *ZkClient) GetConfFromRegistry(key string) ([]byte, error) {
bytes, _, err := s.conn.Get(s.getPath(key)) bytes, _, err := s.conn.Get(s.getPath(key))
return bytes, err return bytes, err
} }

@ -35,6 +35,7 @@ var (
ErrConnIsNilButLocalNotNil = errors.New("conn is nil, but local is not nil") ErrConnIsNilButLocalNotNil = errors.New("conn is nil, but local is not nil")
) )
// watch
func (s *ZkClient) watch() { func (s *ZkClient) watch() {
for { for {
event := <-s.eventChan event := <-s.eventChan
@ -69,6 +70,7 @@ func (s *ZkClient) watch() {
} }
} }
// GetConnsRemote
func (s *ZkClient) GetConnsRemote(serviceName string) (conns []resolver.Address, err error) { func (s *ZkClient) GetConnsRemote(serviceName string) (conns []resolver.Address, err error) {
path := s.getPath(serviceName) path := s.getPath(serviceName)
_, _, _, err = s.conn.ChildrenW(path) _, _, _, err = s.conn.ChildrenW(path)
@ -86,15 +88,18 @@ func (s *ZkClient) GetConnsRemote(serviceName string) (conns []resolver.Address,
if err == zk.ErrNoNode { if err == zk.ErrNoNode {
return nil, errors.Wrap(err, "this is zk ErrNoNode") return nil, errors.Wrap(err, "this is zk ErrNoNode")
} }
return nil, errors.Wrap(err, "get children error") return nil, errors.Wrap(err, "get children error")
} }
log.ZDebug(context.Background(), "get addrs from remote", "conn", string(data)) log.ZDebug(context.Background(), "get addrs from remote", "conn", string(data))
conns = append(conns, resolver.Address{Addr: string(data), ServerName: serviceName}) conns = append(conns, resolver.Address{Addr: string(data), ServerName: serviceName})
} }
} }
return conns, nil return conns, nil
} }
// GetConns
func (s *ZkClient) GetConns(ctx context.Context, serviceName string, opts ...grpc.DialOption) ([]grpc.ClientConnInterface, error) { func (s *ZkClient) GetConns(ctx context.Context, serviceName string, opts ...grpc.DialOption) ([]grpc.ClientConnInterface, error) {
s.logger.Printf("get conns from client, serviceName: %s", serviceName) s.logger.Printf("get conns from client, serviceName: %s", serviceName)
s.lock.Lock() s.lock.Lock()
@ -114,21 +119,26 @@ func (s *ZkClient) GetConns(ctx context.Context, serviceName string, opts ...grp
cc, err := grpc.DialContext(ctx, addr.Addr, append(s.options, opts...)...) cc, err := grpc.DialContext(ctx, addr.Addr, append(s.options, opts...)...)
if err != nil { if err != nil {
log.ZError(context.Background(), "dialContext failed", err, "addr", addr.Addr, "opts", append(s.options, opts...)) log.ZError(context.Background(), "dialContext failed", err, "addr", addr.Addr, "opts", append(s.options, opts...))
return nil, errs.Wrap(err) return nil, errs.Wrap(err)
} }
conns = append(conns, cc) conns = append(conns, cc)
} }
s.localConns[serviceName] = conns s.localConns[serviceName] = conns
} }
return conns, nil return conns, nil
} }
// GetConn
func (s *ZkClient) GetConn(ctx context.Context, serviceName string, opts ...grpc.DialOption) (grpc.ClientConnInterface, error) { func (s *ZkClient) GetConn(ctx context.Context, serviceName string, opts ...grpc.DialOption) (grpc.ClientConnInterface, error) {
newOpts := append(s.options, grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, s.balancerName))) newOpts := append(s.options, grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, s.balancerName)))
s.logger.Printf("get conn from client, serviceName: %s", serviceName) s.logger.Printf("get conn from client, serviceName: %s", serviceName)
return grpc.DialContext(ctx, fmt.Sprintf("%s:///%s", s.scheme, serviceName), append(newOpts, opts...)...) return grpc.DialContext(ctx, fmt.Sprintf("%s:///%s", s.scheme, serviceName), append(newOpts, opts...)...)
} }
// CloseConn
func (s *ZkClient) CloseConn(conn grpc.ClientConnInterface) { func (s *ZkClient) CloseConn(conn grpc.ClientConnInterface) {
if closer, ok := conn.(io.Closer); ok { if closer, ok := conn.(io.Closer); ok {
closer.Close() closer.Close()

@ -21,16 +21,20 @@ import (
"google.golang.org/grpc" "google.golang.org/grpc"
) )
// CreateRpcRootNodes
func (s *ZkClient) CreateRpcRootNodes(serviceNames []string) error { func (s *ZkClient) CreateRpcRootNodes(serviceNames []string) error {
for _, serviceName := range serviceNames { for _, serviceName := range serviceNames {
if err := s.ensureName(serviceName); err != nil && err != zk.ErrNodeExists { if err := s.ensureName(serviceName); err != nil && err != zk.ErrNodeExists {
return err return err
} }
} }
return nil return nil
} }
// CreateTempNode
func (s *ZkClient) CreateTempNode(rpcRegisterName, addr string) (node string, err error) { func (s *ZkClient) CreateTempNode(rpcRegisterName, addr string) (node string, err error) {
return s.conn.CreateProtectedEphemeralSequential( return s.conn.CreateProtectedEphemeralSequential(
s.getPath(rpcRegisterName)+"/"+addr+"_", s.getPath(rpcRegisterName)+"/"+addr+"_",
[]byte(addr), []byte(addr),
@ -38,6 +42,7 @@ func (s *ZkClient) CreateTempNode(rpcRegisterName, addr string) (node string, er
) )
} }
// Register
func (s *ZkClient) Register(rpcRegisterName, host string, port int, opts ...grpc.DialOption) error { func (s *ZkClient) Register(rpcRegisterName, host string, port int, opts ...grpc.DialOption) error {
if err := s.ensureName(rpcRegisterName); err != nil { if err := s.ensureName(rpcRegisterName); err != nil {
return err return err
@ -55,9 +60,11 @@ func (s *ZkClient) Register(rpcRegisterName, host string, port int, opts ...grpc
s.rpcRegisterAddr = addr s.rpcRegisterAddr = addr
s.node = node s.node = node
s.isRegistered = true s.isRegistered = true
return nil return nil
} }
// UnRegister
func (s *ZkClient) UnRegister() error { func (s *ZkClient) UnRegister() error {
s.lock.Lock() s.lock.Lock()
defer s.lock.Unlock() defer s.lock.Unlock()
@ -72,5 +79,6 @@ func (s *ZkClient) UnRegister() error {
s.isRegistered = false s.isRegistered = false
s.localConns = make(map[string][]grpc.ClientConnInterface) s.localConns = make(map[string][]grpc.ClientConnInterface)
s.resolvers = make(map[string]*Resolver) s.resolvers = make(map[string]*Resolver)
return nil return nil
} }

@ -23,6 +23,7 @@ import (
"google.golang.org/grpc/resolver" "google.golang.org/grpc/resolver"
) )
// Resolver
type Resolver struct { type Resolver struct {
target resolver.Target target resolver.Target
cc resolver.ClientConn cc resolver.ClientConn
@ -31,6 +32,7 @@ type Resolver struct {
getConnsRemote func(serviceName string) (conns []resolver.Address, err error) getConnsRemote func(serviceName string) (conns []resolver.Address, err error)
} }
// ResolveNowZK
func (r *Resolver) ResolveNowZK(o resolver.ResolveNowOptions) { func (r *Resolver) ResolveNowZK(o resolver.ResolveNowOptions) {
log.ZDebug( log.ZDebug(
context.Background(), context.Background(),
@ -45,6 +47,7 @@ func (r *Resolver) ResolveNowZK(o resolver.ResolveNowOptions) {
newConns, err := r.getConnsRemote(strings.TrimLeft(r.target.URL.Path, "/")) newConns, err := r.getConnsRemote(strings.TrimLeft(r.target.URL.Path, "/"))
if err != nil { if err != nil {
log.ZError(context.Background(), "resolve now error", err, "target", r.target) log.ZError(context.Background(), "resolve now error", err, "target", r.target)
return return
} }
r.addrs = newConns r.addrs = newConns
@ -58,15 +61,19 @@ func (r *Resolver) ResolveNowZK(o resolver.ResolveNowOptions) {
"zk path", "zk path",
r.target.URL.Path, r.target.URL.Path,
) )
return return
} }
log.ZDebug(context.Background(), "resolve now finished", "target", r.target, "conns", r.addrs) log.ZDebug(context.Background(), "resolve now finished", "target", r.target, "conns", r.addrs)
} }
// ResolveNow
func (r *Resolver) ResolveNow(o resolver.ResolveNowOptions) {} func (r *Resolver) ResolveNow(o resolver.ResolveNowOptions) {}
// Close
func (s *Resolver) Close() {} func (s *Resolver) Close() {}
// Build
func (s *ZkClient) Build( func (s *ZkClient) Build(
target resolver.Target, target resolver.Target,
cc resolver.ClientConn, cc resolver.ClientConn,
@ -76,6 +83,7 @@ func (s *ZkClient) Build(
serviceName := strings.TrimLeft(target.URL.Path, "/") serviceName := strings.TrimLeft(target.URL.Path, "/")
if oldResolver, ok := s.resolvers[serviceName]; ok { if oldResolver, ok := s.resolvers[serviceName]; ok {
s.logger.Printf("rpc resolver exist: %+v, cc: %+v, key: %s", target, cc.UpdateState, serviceName) s.logger.Printf("rpc resolver exist: %+v, cc: %+v, key: %s", target, cc.UpdateState, serviceName)
return oldResolver, nil return oldResolver, nil
} }
r := &Resolver{} r := &Resolver{}
@ -87,7 +95,9 @@ func (s *ZkClient) Build(
defer s.lock.Unlock() defer s.lock.Unlock()
s.resolvers[serviceName] = r s.resolvers[serviceName] = r
s.logger.Printf("build resolver finished: %+v, cc: %+v, key: %s", target, cc.UpdateState, serviceName) s.logger.Printf("build resolver finished: %+v, cc: %+v, key: %s", target, cc.UpdateState, serviceName)
return r, nil return r, nil
} }
// Scheme
func (s *ZkClient) Scheme() string { return s.scheme } func (s *ZkClient) Scheme() string { return s.scheme }

@ -30,10 +30,12 @@ const (
timeout = 5 timeout = 5
) )
// Logger
type Logger interface { type Logger interface {
Printf(string, ...interface{}) Printf(string, ...interface{})
} }
// ZkClient
type ZkClient struct { type ZkClient struct {
zkServers []string zkServers []string
zkRoot string zkRoot string
@ -62,14 +64,17 @@ type ZkClient struct {
logger Logger logger Logger
} }
// ZkOption
type ZkOption func(*ZkClient) type ZkOption func(*ZkClient)
// WithRoundRobin
func WithRoundRobin() ZkOption { func WithRoundRobin() ZkOption {
return func(client *ZkClient) { return func(client *ZkClient) {
client.balancerName = "round_robin" client.balancerName = "round_robin"
} }
} }
// WithUserNameAndPassword
func WithUserNameAndPassword(userName, password string) ZkOption { func WithUserNameAndPassword(userName, password string) ZkOption {
return func(client *ZkClient) { return func(client *ZkClient) {
client.userName = userName client.userName = userName
@ -83,24 +88,28 @@ func WithOptions(opts ...grpc.DialOption) ZkOption {
} }
} }
// WithFreq
func WithFreq(freq time.Duration) ZkOption { func WithFreq(freq time.Duration) ZkOption {
return func(client *ZkClient) { return func(client *ZkClient) {
client.ticker = time.NewTicker(freq) client.ticker = time.NewTicker(freq)
} }
} }
// WithTimeout
func WithTimeout(timeout int) ZkOption { func WithTimeout(timeout int) ZkOption {
return func(client *ZkClient) { return func(client *ZkClient) {
client.timeout = timeout client.timeout = timeout
} }
} }
// WithLogger
func WithLogger(logger Logger) ZkOption { func WithLogger(logger Logger) ZkOption {
return func(client *ZkClient) { return func(client *ZkClient) {
client.logger = logger client.logger = logger
} }
} }
// NewClient
func NewClient(zkServers []string, zkRoot string, options ...ZkOption) (*ZkClient, error) { func NewClient(zkServers []string, zkRoot string, options ...ZkOption) (*ZkClient, error) {
client := &ZkClient{ client := &ZkClient{
zkServers: zkServers, zkServers: zkServers,
@ -134,15 +143,18 @@ func NewClient(zkServers []string, zkRoot string, options ...ZkOption) (*ZkClien
client.conn = conn client.conn = conn
if err := client.ensureRoot(); err != nil { if err := client.ensureRoot(); err != nil {
client.CloseZK() client.CloseZK()
return nil, err return nil, err
} }
resolver.Register(client) resolver.Register(client)
go client.refresh() go client.refresh()
go client.watch() go client.watch()
time.Sleep(time.Millisecond * 50) time.Sleep(time.Millisecond * 50)
return client, nil return client, nil
} }
// CloseZK
func (s *ZkClient) CloseZK() { func (s *ZkClient) CloseZK() {
s.conn.Close() s.conn.Close()
} }
@ -158,6 +170,7 @@ func (s *ZkClient) ensureAndCreate(node string) error {
return err return err
} }
} }
return nil return nil
} }
@ -189,14 +202,17 @@ func (s *ZkClient) flushResolver(serviceName string) {
} }
} }
// GetZkConn
func (s *ZkClient) GetZkConn() *zk.Conn { func (s *ZkClient) GetZkConn() *zk.Conn {
return s.conn return s.conn
} }
// GetRootPath
func (s *ZkClient) GetRootPath() string { func (s *ZkClient) GetRootPath() string {
return s.zkRoot return s.zkRoot
} }
// GetNode
func (s *ZkClient) GetNode() string { func (s *ZkClient) GetNode() string {
return s.node return s.node
} }
@ -217,10 +233,12 @@ func (s *ZkClient) getAddr(host string, port int) string {
return net.JoinHostPort(host, strconv.Itoa(port)) return net.JoinHostPort(host, strconv.Itoa(port))
} }
// AddOption
func (s *ZkClient) AddOption(opts ...grpc.DialOption) { func (s *ZkClient) AddOption(opts ...grpc.DialOption) {
s.options = append(s.options, opts...) s.options = append(s.options, opts...)
} }
// GetClientLocalConns
func (s *ZkClient) GetClientLocalConns() map[string][]grpc.ClientConnInterface { func (s *ZkClient) GetClientLocalConns() map[string][]grpc.ClientConnInterface {
return s.localConns return s.localConns
} }

@ -15,12 +15,12 @@
package errs package errs
import ( import (
"fmt"
"strings" "strings"
"github.com/pkg/errors" "github.com/pkg/errors"
) )
// CodeError
type CodeError interface { type CodeError interface {
Code() int Code() int
Msg() string Msg() string
@ -32,6 +32,7 @@ type CodeError interface {
error error
} }
// NewCodeError
func NewCodeError(code int, msg string) CodeError { func NewCodeError(code int, msg string) CodeError {
return &codeError{ return &codeError{
code: code, code: code,
@ -64,6 +65,7 @@ func (e *codeError) WithDetail(detail string) CodeError {
} else { } else {
d = e.detail + ", " + detail d = e.detail + ", " + detail
} }
return &codeError{ return &codeError{
code: e.code, code: e.code,
msg: e.msg, msg: e.msg,
@ -93,13 +95,15 @@ func (e *codeError) Is(err error, loose ...bool) bool {
return codeErr.Code() == e.code return codeErr.Code() == e.code
} }
} }
return false return false
} }
func (e *codeError) Error() string { func (e *codeError) Error() string {
return fmt.Sprintf("%s", e.msg) return e.msg
} }
// Unwrap
func Unwrap(err error) error { func Unwrap(err error) error {
for err != nil { for err != nil {
unwrap, ok := err.(interface { unwrap, ok := err.(interface {
@ -110,9 +114,11 @@ func Unwrap(err error) error {
} }
err = unwrap.Unwrap() err = unwrap.Unwrap()
} }
return err return err
} }
// Wrap
func Wrap(err error, msg ...string) error { func Wrap(err error, msg ...string) error {
if err == nil { if err == nil {
return nil return nil
@ -120,5 +126,6 @@ func Wrap(err error, msg ...string) error {
if len(msg) == 0 { if len(msg) == 0 {
return errors.WithStack(err) return errors.WithStack(err)
} }
return errors.Wrap(err, strings.Join(msg, ", ")) return errors.Wrap(err, strings.Join(msg, ", "))
} }

@ -14,6 +14,7 @@
package errs package errs
// Relation
var Relation = &relation{m: make(map[int]map[int]struct{})} var Relation = &relation{m: make(map[int]map[int]struct{})}
func init() { func init() {
@ -52,5 +53,6 @@ func (r *relation) Is(parent, child int) bool {
return false return false
} }
_, ok = s[child] _, ok = s[child]
return ok return ok
} }

@ -19,6 +19,7 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs" "github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
) )
// Check
func (x *UserTokenReq) Check() error { func (x *UserTokenReq) Check() error {
if x.UserID == "" { if x.UserID == "" {
return errs.ErrArgs.Wrap("userID is empty") return errs.ErrArgs.Wrap("userID is empty")
@ -26,9 +27,11 @@ func (x *UserTokenReq) Check() error {
if x.PlatformID > constant.AdminPlatformID || x.PlatformID < constant.IOSPlatformID { if x.PlatformID > constant.AdminPlatformID || x.PlatformID < constant.IOSPlatformID {
return errs.ErrArgs.Wrap("platform is invalidate") return errs.ErrArgs.Wrap("platform is invalidate")
} }
return nil return nil
} }
// Check
func (x *ForceLogoutReq) Check() error { func (x *ForceLogoutReq) Check() error {
if x.UserID == "" { if x.UserID == "" {
return errs.ErrArgs.Wrap("userID is empty") return errs.ErrArgs.Wrap("userID is empty")
@ -36,12 +39,15 @@ func (x *ForceLogoutReq) Check() error {
if x.PlatformID > constant.AdminPlatformID || x.PlatformID < constant.IOSPlatformID { if x.PlatformID > constant.AdminPlatformID || x.PlatformID < constant.IOSPlatformID {
return errs.ErrArgs.Wrap("platformID is invalidate") return errs.ErrArgs.Wrap("platformID is invalidate")
} }
return nil return nil
} }
// Check
func (x *ParseTokenReq) Check() error { func (x *ParseTokenReq) Check() error {
if x.Token == "" { if x.Token == "" {
return errs.ErrArgs.Wrap("userID is empty") return errs.ErrArgs.Wrap("userID is empty")
} }
return nil return nil
} }

@ -22,13 +22,14 @@ package auth
import ( import (
context "context" context "context"
reflect "reflect"
sync "sync"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes" codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status" status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
) )
const ( const (
@ -43,9 +44,9 @@ type UserTokenReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Secret string `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret"` Secret string `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret"`
PlatformID int32 `protobuf:"varint,2,opt,name=platformID,proto3" json:"platformID"` PlatformID int32 `protobuf:"varint,2,opt,name=platformID,proto3" json:"platformID"`
UserID string `protobuf:"bytes,3,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,3,opt,name=userID,proto3" json:"userID"`
} }
func (x *UserTokenReq) Reset() { func (x *UserTokenReq) Reset() {
@ -106,7 +107,7 @@ type UserTokenResp struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token"` Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token"`
ExpireTimeSeconds int64 `protobuf:"varint,3,opt,name=expireTimeSeconds,proto3" json:"expireTimeSeconds"` ExpireTimeSeconds int64 `protobuf:"varint,3,opt,name=expireTimeSeconds,proto3" json:"expireTimeSeconds"`
} }
@ -162,7 +163,7 @@ type ForceLogoutReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
PlatformID int32 `protobuf:"varint,1,opt,name=platformID,proto3" json:"platformID"` PlatformID int32 `protobuf:"varint,1,opt,name=platformID,proto3" json:"platformID"`
UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"`
} }
func (x *ForceLogoutReq) Reset() { func (x *ForceLogoutReq) Reset() {
@ -301,8 +302,8 @@ type ParseTokenResp struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
Platform string `protobuf:"bytes,2,opt,name=platform,proto3" json:"platform"` Platform string `protobuf:"bytes,2,opt,name=platform,proto3" json:"platform"`
ExpireTimeSeconds int64 `protobuf:"varint,4,opt,name=expireTimeSeconds,proto3" json:"expireTimeSeconds"` ExpireTimeSeconds int64 `protobuf:"varint,4,opt,name=expireTimeSeconds,proto3" json:"expireTimeSeconds"`
} }

@ -16,13 +16,16 @@ package conversation
import "github.com/OpenIMSDK/Open-IM-Server/pkg/errs" import "github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
// Check
func (x *ConversationReq) Check() error { func (x *ConversationReq) Check() error {
if x.ConversationID == "" { if x.ConversationID == "" {
return errs.ErrArgs.Wrap("conversation is empty") return errs.ErrArgs.Wrap("conversation is empty")
} }
return nil return nil
} }
// Check
func (x *Conversation) Check() error { func (x *Conversation) Check() error {
if x.OwnerUserID == "" { if x.OwnerUserID == "" {
return errs.ErrArgs.Wrap("OwnerUserID is empty") return errs.ErrArgs.Wrap("OwnerUserID is empty")
@ -36,19 +39,23 @@ func (x *Conversation) Check() error {
if x.RecvMsgOpt < 0 || x.RecvMsgOpt > 2 { if x.RecvMsgOpt < 0 || x.RecvMsgOpt > 2 {
return errs.ErrArgs.Wrap("RecvMsgOpt is invalid") return errs.ErrArgs.Wrap("RecvMsgOpt is invalid")
} }
return nil return nil
} }
//func (x *ModifyConversationFieldReq) Check() error { // // Check
// func (x *ModifyConversationFieldReq) Check() error {
// if x.UserIDList == nil { // if x.UserIDList == nil {
// return errs.ErrArgs.Wrap("userIDList is empty") // return errs.ErrArgs.Wrap("userIDList is empty")
// } // }
// if x.Conversation == nil { // if x.Conversation == nil {
// return errs.ErrArgs.Wrap("conversation is empty") // return errs.ErrArgs.Wrap("conversation is empty")
// } // }
// return nil //
//} // return nil
// }
// Check
func (x *SetConversationReq) Check() error { func (x *SetConversationReq) Check() error {
if x.Conversation == nil { if x.Conversation == nil {
return errs.ErrArgs.Wrap("Conversation is empty") return errs.ErrArgs.Wrap("Conversation is empty")
@ -56,10 +63,12 @@ func (x *SetConversationReq) Check() error {
if x.Conversation.ConversationID == "" { if x.Conversation.ConversationID == "" {
return errs.ErrArgs.Wrap("conversationID is empty") return errs.ErrArgs.Wrap("conversationID is empty")
} }
return nil return nil
} }
//func (x *SetRecvMsgOptReq) Check() error { // // Check
// func (x *SetRecvMsgOptReq) Check() error {
// if x.OwnerUserID == "" { // if x.OwnerUserID == "" {
// return errs.ErrArgs.Wrap("ownerUserID is empty") // return errs.ErrArgs.Wrap("ownerUserID is empty")
// } // }
@ -69,9 +78,11 @@ func (x *SetConversationReq) Check() error {
// if x.RecvMsgOpt > 2 || x.RecvMsgOpt < 0 { // if x.RecvMsgOpt > 2 || x.RecvMsgOpt < 0 {
// return errs.ErrArgs.Wrap("MsgReceiveOpt is invalid") // return errs.ErrArgs.Wrap("MsgReceiveOpt is invalid")
// } // }
// return nil //
//} // return nil
// }
// Check
func (x *GetConversationReq) Check() error { func (x *GetConversationReq) Check() error {
if x.OwnerUserID == "" { if x.OwnerUserID == "" {
return errs.ErrArgs.Wrap("ownerUserID is empty") return errs.ErrArgs.Wrap("ownerUserID is empty")
@ -79,9 +90,11 @@ func (x *GetConversationReq) Check() error {
if x.ConversationID == "" { if x.ConversationID == "" {
return errs.ErrArgs.Wrap("conversationID is empty") return errs.ErrArgs.Wrap("conversationID is empty")
} }
return nil return nil
} }
// Check
func (x *GetConversationsReq) Check() error { func (x *GetConversationsReq) Check() error {
if x.OwnerUserID == "" { if x.OwnerUserID == "" {
return errs.ErrArgs.Wrap("ownerUserID is empty") return errs.ErrArgs.Wrap("ownerUserID is empty")
@ -89,41 +102,51 @@ func (x *GetConversationsReq) Check() error {
if x.ConversationIDs == nil { if x.ConversationIDs == nil {
return errs.ErrArgs.Wrap("conversationIDs is empty") return errs.ErrArgs.Wrap("conversationIDs is empty")
} }
return nil return nil
} }
// Check
func (x *GetAllConversationsReq) Check() error { func (x *GetAllConversationsReq) Check() error {
if x.OwnerUserID == "" { if x.OwnerUserID == "" {
return errs.ErrArgs.Wrap("ownerUserID is empty") return errs.ErrArgs.Wrap("ownerUserID is empty")
} }
return nil return nil
} }
// //
//func (x *BatchSetConversationsReq) Check() error { // // Check
// func (x *BatchSetConversationsReq) Check() error {
// if x.Conversations == nil { // if x.Conversations == nil {
// return errs.ErrArgs.Wrap("conversations is empty") // return errs.ErrArgs.Wrap("conversations is empty")
// } // }
// if x.OwnerUserID == "" { // if x.OwnerUserID == "" {
// return errs.ErrArgs.Wrap("conversation is empty") // return errs.ErrArgs.Wrap("conversation is empty")
// } // }
// return nil //
//} // return nil
// }
// Check
func (x *GetRecvMsgNotNotifyUserIDsReq) Check() error { func (x *GetRecvMsgNotNotifyUserIDsReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("groupID is empty") return errs.ErrArgs.Wrap("groupID is empty")
} }
return nil return nil
} }
// Check
func (x *CreateGroupChatConversationsReq) Check() error { func (x *CreateGroupChatConversationsReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("groupID is empty") return errs.ErrArgs.Wrap("groupID is empty")
} }
return nil return nil
} }
// Check
func (x *SetConversationMaxSeqReq) Check() error { func (x *SetConversationMaxSeqReq) Check() error {
if x.ConversationID == "" { if x.ConversationID == "" {
return errs.ErrArgs.Wrap("conversationID is empty") return errs.ErrArgs.Wrap("conversationID is empty")
@ -134,9 +157,11 @@ func (x *SetConversationMaxSeqReq) Check() error {
if x.MaxSeq <= 0 { if x.MaxSeq <= 0 {
return errs.ErrArgs.Wrap("maxSeq is invalid") return errs.ErrArgs.Wrap("maxSeq is invalid")
} }
return nil return nil
} }
// Check
func (x *SetConversationsReq) Check() error { func (x *SetConversationsReq) Check() error {
if x.UserIDs == nil { if x.UserIDs == nil {
return errs.ErrArgs.Wrap("userID is empty") return errs.ErrArgs.Wrap("userID is empty")
@ -144,19 +169,24 @@ func (x *SetConversationsReq) Check() error {
if x.Conversation == nil { if x.Conversation == nil {
return errs.ErrArgs.Wrap("conversation is empty") return errs.ErrArgs.Wrap("conversation is empty")
} }
return nil return nil
} }
// Check
func (x *GetUserConversationIDsHashReq) Check() error { func (x *GetUserConversationIDsHashReq) Check() error {
if x.OwnerUserID == "" { if x.OwnerUserID == "" {
return errs.ErrArgs.Wrap("ownerUserID is empty") return errs.ErrArgs.Wrap("ownerUserID is empty")
} }
return nil return nil
} }
// Check
func (x *GetConversationsByConversationIDReq) Check() error { func (x *GetConversationsByConversationIDReq) Check() error {
if x.ConversationIDs == nil { if x.ConversationIDs == nil {
return errs.ErrArgs.Wrap("conversationIDs is empty") return errs.ErrArgs.Wrap("conversationIDs is empty")
} }
return nil return nil
} }

@ -22,14 +22,16 @@ package conversation
import ( import (
context "context" context "context"
wrapperspb "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/wrapperspb" reflect "reflect"
sync "sync"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes" codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status" status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync" wrapperspb "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/wrapperspb"
) )
const ( const (
@ -44,23 +46,23 @@ type Conversation struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID,proto3" json:"ownerUserID"` OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID,proto3" json:"ownerUserID"`
ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"` ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"`
RecvMsgOpt int32 `protobuf:"varint,3,opt,name=recvMsgOpt,proto3" json:"recvMsgOpt"` RecvMsgOpt int32 `protobuf:"varint,3,opt,name=recvMsgOpt,proto3" json:"recvMsgOpt"`
ConversationType int32 `protobuf:"varint,4,opt,name=conversationType,proto3" json:"conversationType"` ConversationType int32 `protobuf:"varint,4,opt,name=conversationType,proto3" json:"conversationType"`
UserID string `protobuf:"bytes,5,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,5,opt,name=userID,proto3" json:"userID"`
GroupID string `protobuf:"bytes,6,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,6,opt,name=groupID,proto3" json:"groupID"`
IsPinned bool `protobuf:"varint,7,opt,name=isPinned,proto3" json:"isPinned"` IsPinned bool `protobuf:"varint,7,opt,name=isPinned,proto3" json:"isPinned"`
AttachedInfo string `protobuf:"bytes,8,opt,name=attachedInfo,proto3" json:"attachedInfo"` AttachedInfo string `protobuf:"bytes,8,opt,name=attachedInfo,proto3" json:"attachedInfo"`
IsPrivateChat bool `protobuf:"varint,9,opt,name=isPrivateChat,proto3" json:"isPrivateChat"` IsPrivateChat bool `protobuf:"varint,9,opt,name=isPrivateChat,proto3" json:"isPrivateChat"`
GroupAtType int32 `protobuf:"varint,10,opt,name=groupAtType,proto3" json:"groupAtType"` GroupAtType int32 `protobuf:"varint,10,opt,name=groupAtType,proto3" json:"groupAtType"`
Ex string `protobuf:"bytes,11,opt,name=ex,proto3" json:"ex"` Ex string `protobuf:"bytes,11,opt,name=ex,proto3" json:"ex"`
BurnDuration int32 `protobuf:"varint,12,opt,name=burnDuration,proto3" json:"burnDuration"` BurnDuration int32 `protobuf:"varint,12,opt,name=burnDuration,proto3" json:"burnDuration"`
MinSeq int64 `protobuf:"varint,13,opt,name=minSeq,proto3" json:"minSeq"` MinSeq int64 `protobuf:"varint,13,opt,name=minSeq,proto3" json:"minSeq"`
MaxSeq int64 `protobuf:"varint,14,opt,name=maxSeq,proto3" json:"maxSeq"` MaxSeq int64 `protobuf:"varint,14,opt,name=maxSeq,proto3" json:"maxSeq"`
MsgDestructTime int64 `protobuf:"varint,15,opt,name=msgDestructTime,proto3" json:"msgDestructTime"` MsgDestructTime int64 `protobuf:"varint,15,opt,name=msgDestructTime,proto3" json:"msgDestructTime"`
LatestMsgDestructTime int64 `protobuf:"varint,16,opt,name=latestMsgDestructTime,proto3" json:"latestMsgDestructTime"` LatestMsgDestructTime int64 `protobuf:"varint,16,opt,name=latestMsgDestructTime,proto3" json:"latestMsgDestructTime"`
IsMsgDestruct bool `protobuf:"varint,17,opt,name=isMsgDestruct,proto3" json:"isMsgDestruct"` IsMsgDestruct bool `protobuf:"varint,17,opt,name=isMsgDestruct,proto3" json:"isMsgDestruct"`
} }
func (x *Conversation) Reset() { func (x *Conversation) Reset() {
@ -219,21 +221,21 @@ type ConversationReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"` ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"`
ConversationType int32 `protobuf:"varint,2,opt,name=conversationType,proto3" json:"conversationType"` ConversationType int32 `protobuf:"varint,2,opt,name=conversationType,proto3" json:"conversationType"`
UserID string `protobuf:"bytes,3,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,3,opt,name=userID,proto3" json:"userID"`
GroupID string `protobuf:"bytes,4,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,4,opt,name=groupID,proto3" json:"groupID"`
RecvMsgOpt *wrapperspb.Int32Value `protobuf:"bytes,5,opt,name=recvMsgOpt,proto3" json:"recvMsgOpt"` RecvMsgOpt *wrapperspb.Int32Value `protobuf:"bytes,5,opt,name=recvMsgOpt,proto3" json:"recvMsgOpt"`
IsPinned *wrapperspb.BoolValue `protobuf:"bytes,6,opt,name=isPinned,proto3" json:"isPinned"` IsPinned *wrapperspb.BoolValue `protobuf:"bytes,6,opt,name=isPinned,proto3" json:"isPinned"`
AttachedInfo *wrapperspb.StringValue `protobuf:"bytes,7,opt,name=attachedInfo,proto3" json:"attachedInfo"` AttachedInfo *wrapperspb.StringValue `protobuf:"bytes,7,opt,name=attachedInfo,proto3" json:"attachedInfo"`
IsPrivateChat *wrapperspb.BoolValue `protobuf:"bytes,8,opt,name=isPrivateChat,proto3" json:"isPrivateChat"` IsPrivateChat *wrapperspb.BoolValue `protobuf:"bytes,8,opt,name=isPrivateChat,proto3" json:"isPrivateChat"`
Ex *wrapperspb.StringValue `protobuf:"bytes,9,opt,name=ex,proto3" json:"ex"` Ex *wrapperspb.StringValue `protobuf:"bytes,9,opt,name=ex,proto3" json:"ex"`
BurnDuration *wrapperspb.Int32Value `protobuf:"bytes,10,opt,name=burnDuration,proto3" json:"burnDuration"` BurnDuration *wrapperspb.Int32Value `protobuf:"bytes,10,opt,name=burnDuration,proto3" json:"burnDuration"`
MinSeq *wrapperspb.Int64Value `protobuf:"bytes,11,opt,name=minSeq,proto3" json:"minSeq"` MinSeq *wrapperspb.Int64Value `protobuf:"bytes,11,opt,name=minSeq,proto3" json:"minSeq"`
MaxSeq *wrapperspb.Int64Value `protobuf:"bytes,12,opt,name=maxSeq,proto3" json:"maxSeq"` MaxSeq *wrapperspb.Int64Value `protobuf:"bytes,12,opt,name=maxSeq,proto3" json:"maxSeq"`
GroupAtType *wrapperspb.Int32Value `protobuf:"bytes,13,opt,name=groupAtType,proto3" json:"groupAtType"` GroupAtType *wrapperspb.Int32Value `protobuf:"bytes,13,opt,name=groupAtType,proto3" json:"groupAtType"`
MsgDestructTime *wrapperspb.Int64Value `protobuf:"bytes,14,opt,name=msgDestructTime,proto3" json:"msgDestructTime"` MsgDestructTime *wrapperspb.Int64Value `protobuf:"bytes,14,opt,name=msgDestructTime,proto3" json:"msgDestructTime"`
IsMsgDestruct *wrapperspb.BoolValue `protobuf:"bytes,15,opt,name=isMsgDestruct,proto3" json:"isMsgDestruct"` IsMsgDestruct *wrapperspb.BoolValue `protobuf:"bytes,15,opt,name=isMsgDestruct,proto3" json:"isMsgDestruct"`
} }
func (x *ConversationReq) Reset() { func (x *ConversationReq) Reset() {
@ -464,7 +466,7 @@ type GetConversationReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"` ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"`
OwnerUserID string `protobuf:"bytes,2,opt,name=ownerUserID,proto3" json:"ownerUserID"` OwnerUserID string `protobuf:"bytes,2,opt,name=ownerUserID,proto3" json:"ownerUserID"`
} }
func (x *GetConversationReq) Reset() { func (x *GetConversationReq) Reset() {
@ -565,7 +567,7 @@ type GetConversationsReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID,proto3" json:"ownerUserID"` OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID,proto3" json:"ownerUserID"`
ConversationIDs []string `protobuf:"bytes,2,rep,name=conversationIDs,proto3" json:"conversationIDs"` ConversationIDs []string `protobuf:"bytes,2,rep,name=conversationIDs,proto3" json:"conversationIDs"`
} }
@ -1042,8 +1044,8 @@ type SetConversationMaxSeqReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"` ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"`
OwnerUserID []string `protobuf:"bytes,2,rep,name=ownerUserID,proto3" json:"ownerUserID"` OwnerUserID []string `protobuf:"bytes,2,rep,name=ownerUserID,proto3" json:"ownerUserID"`
MaxSeq int64 `protobuf:"varint,3,opt,name=maxSeq,proto3" json:"maxSeq"` MaxSeq int64 `protobuf:"varint,3,opt,name=maxSeq,proto3" json:"maxSeq"`
} }
func (x *SetConversationMaxSeqReq) Reset() { func (x *SetConversationMaxSeqReq) Reset() {
@ -1236,7 +1238,7 @@ type SetConversationsReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserIDs []string `protobuf:"bytes,1,rep,name=userIDs,proto3" json:"userIDs"` UserIDs []string `protobuf:"bytes,1,rep,name=userIDs,proto3" json:"userIDs"`
Conversation *ConversationReq `protobuf:"bytes,2,opt,name=conversation,proto3" json:"conversation"` Conversation *ConversationReq `protobuf:"bytes,2,opt,name=conversation,proto3" json:"conversation"`
} }

@ -21,10 +21,11 @@
package errinfo package errinfo
import ( import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect" reflect "reflect"
sync "sync" sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
) )
const ( const (
@ -39,11 +40,11 @@ type ErrorInfo struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path"` Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path"`
Line uint32 `protobuf:"varint,2,opt,name=line,proto3" json:"line"` Line uint32 `protobuf:"varint,2,opt,name=line,proto3" json:"line"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name"`
Cause string `protobuf:"bytes,4,opt,name=cause,proto3" json:"cause"` Cause string `protobuf:"bytes,4,opt,name=cause,proto3" json:"cause"`
Warp []string `protobuf:"bytes,5,rep,name=warp,proto3" json:"warp"` Warp []string `protobuf:"bytes,5,rep,name=warp,proto3" json:"warp"`
} }
func (x *ErrorInfo) Reset() { func (x *ErrorInfo) Reset() {

@ -16,6 +16,7 @@ package friend
import "github.com/OpenIMSDK/Open-IM-Server/pkg/errs" import "github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
// Check
func (x *GetPaginationFriendsReq) Check() error { func (x *GetPaginationFriendsReq) Check() error {
if x.Pagination == nil { if x.Pagination == nil {
return errs.ErrArgs.Wrap("pagination is empty") return errs.ErrArgs.Wrap("pagination is empty")
@ -26,9 +27,11 @@ func (x *GetPaginationFriendsReq) Check() error {
if x.UserID == "" { if x.UserID == "" {
return errs.ErrArgs.Wrap("userID is empty") return errs.ErrArgs.Wrap("userID is empty")
} }
return nil return nil
} }
// Check
func (x *ApplyToAddFriendReq) Check() error { func (x *ApplyToAddFriendReq) Check() error {
if x.ToUserID == "" { if x.ToUserID == "" {
return errs.ErrArgs.Wrap("toUserID is empty") return errs.ErrArgs.Wrap("toUserID is empty")
@ -36,9 +39,11 @@ func (x *ApplyToAddFriendReq) Check() error {
if x.FromUserID == "" { if x.FromUserID == "" {
return errs.ErrArgs.Wrap("fromUserID is empty") return errs.ErrArgs.Wrap("fromUserID is empty")
} }
return nil return nil
} }
// Check
func (x *ImportFriendReq) Check() error { func (x *ImportFriendReq) Check() error {
if x.OwnerUserID == "" { if x.OwnerUserID == "" {
return errs.ErrArgs.Wrap("ownerUserID is empty") return errs.ErrArgs.Wrap("ownerUserID is empty")
@ -46,9 +51,11 @@ func (x *ImportFriendReq) Check() error {
if x.FriendUserIDs == nil { if x.FriendUserIDs == nil {
return errs.ErrArgs.Wrap("friendUserIDS is empty") return errs.ErrArgs.Wrap("friendUserIDS is empty")
} }
return nil return nil
} }
// Check
func (x *GetPaginationFriendsApplyToReq) Check() error { func (x *GetPaginationFriendsApplyToReq) Check() error {
if x.UserID == "" { if x.UserID == "" {
return errs.ErrArgs.Wrap("userID is empty") return errs.ErrArgs.Wrap("userID is empty")
@ -59,9 +66,11 @@ func (x *GetPaginationFriendsApplyToReq) Check() error {
if x.Pagination.PageNumber < 1 { if x.Pagination.PageNumber < 1 {
return errs.ErrArgs.Wrap("pageNumber is invalid") return errs.ErrArgs.Wrap("pageNumber is invalid")
} }
return nil return nil
} }
// Check
func (x *GetDesignatedFriendsReq) Check() error { func (x *GetDesignatedFriendsReq) Check() error {
if x.OwnerUserID == "" { if x.OwnerUserID == "" {
return errs.ErrArgs.Wrap("ownerUserID is empty") return errs.ErrArgs.Wrap("ownerUserID is empty")
@ -69,9 +78,11 @@ func (x *GetDesignatedFriendsReq) Check() error {
if x.FriendUserIDs == nil { if x.FriendUserIDs == nil {
return errs.ErrArgs.Wrap("friendUserIDS is empty") return errs.ErrArgs.Wrap("friendUserIDS is empty")
} }
return nil return nil
} }
// Check
func (x *AddBlackReq) Check() error { func (x *AddBlackReq) Check() error {
if x.OwnerUserID == "" { if x.OwnerUserID == "" {
return errs.ErrArgs.Wrap("ownerUserID is empty") return errs.ErrArgs.Wrap("ownerUserID is empty")
@ -79,9 +90,11 @@ func (x *AddBlackReq) Check() error {
if x.BlackUserID == "" { if x.BlackUserID == "" {
return errs.ErrArgs.Wrap("BlackUserID is empty") return errs.ErrArgs.Wrap("BlackUserID is empty")
} }
return nil return nil
} }
// Check
func (x *RemoveBlackReq) Check() error { func (x *RemoveBlackReq) Check() error {
if x.OwnerUserID == "" { if x.OwnerUserID == "" {
return errs.ErrArgs.Wrap("ownerUserID is empty") return errs.ErrArgs.Wrap("ownerUserID is empty")
@ -89,9 +102,11 @@ func (x *RemoveBlackReq) Check() error {
if x.BlackUserID == "" { if x.BlackUserID == "" {
return errs.ErrArgs.Wrap("BlackUserID is empty") return errs.ErrArgs.Wrap("BlackUserID is empty")
} }
return nil return nil
} }
// Check
func (x *GetPaginationBlacksReq) Check() error { func (x *GetPaginationBlacksReq) Check() error {
if x.UserID == "" { if x.UserID == "" {
return errs.ErrArgs.Wrap("userID is empty") return errs.ErrArgs.Wrap("userID is empty")
@ -102,9 +117,11 @@ func (x *GetPaginationBlacksReq) Check() error {
if x.Pagination.PageNumber < 1 { if x.Pagination.PageNumber < 1 {
return errs.ErrArgs.Wrap("pageNumber is invalid") return errs.ErrArgs.Wrap("pageNumber is invalid")
} }
return nil return nil
} }
// Check
func (x *IsFriendReq) Check() error { func (x *IsFriendReq) Check() error {
if x.UserID1 == "" { if x.UserID1 == "" {
return errs.ErrArgs.Wrap("userID1 is empty") return errs.ErrArgs.Wrap("userID1 is empty")
@ -112,9 +129,11 @@ func (x *IsFriendReq) Check() error {
if x.UserID2 == "" { if x.UserID2 == "" {
return errs.ErrArgs.Wrap("userID2 is empty") return errs.ErrArgs.Wrap("userID2 is empty")
} }
return nil return nil
} }
// Check
func (x *IsBlackReq) Check() error { func (x *IsBlackReq) Check() error {
if x.UserID1 == "" { if x.UserID1 == "" {
return errs.ErrArgs.Wrap("userID1 is empty") return errs.ErrArgs.Wrap("userID1 is empty")
@ -122,9 +141,11 @@ func (x *IsBlackReq) Check() error {
if x.UserID2 == "" { if x.UserID2 == "" {
return errs.ErrArgs.Wrap("userID2 is empty") return errs.ErrArgs.Wrap("userID2 is empty")
} }
return nil return nil
} }
// Check
func (x *DeleteFriendReq) Check() error { func (x *DeleteFriendReq) Check() error {
if x.OwnerUserID == "" { if x.OwnerUserID == "" {
return errs.ErrArgs.Wrap("userID1 is empty") return errs.ErrArgs.Wrap("userID1 is empty")
@ -132,9 +153,11 @@ func (x *DeleteFriendReq) Check() error {
if x.FriendUserID == "" { if x.FriendUserID == "" {
return errs.ErrArgs.Wrap("userID2 is empty") return errs.ErrArgs.Wrap("userID2 is empty")
} }
return nil return nil
} }
// Check
func (x *RespondFriendApplyReq) Check() error { func (x *RespondFriendApplyReq) Check() error {
if x.ToUserID == "" { if x.ToUserID == "" {
return errs.ErrArgs.Wrap("toUserID is empty") return errs.ErrArgs.Wrap("toUserID is empty")
@ -142,9 +165,11 @@ func (x *RespondFriendApplyReq) Check() error {
if x.FromUserID == "" { if x.FromUserID == "" {
return errs.ErrArgs.Wrap("fromUserID is empty") return errs.ErrArgs.Wrap("fromUserID is empty")
} }
return nil return nil
} }
// Check
func (x *SetFriendRemarkReq) Check() error { func (x *SetFriendRemarkReq) Check() error {
if x.OwnerUserID == "" { if x.OwnerUserID == "" {
return errs.ErrArgs.Wrap("ownerUserID is empty") return errs.ErrArgs.Wrap("ownerUserID is empty")
@ -152,9 +177,11 @@ func (x *SetFriendRemarkReq) Check() error {
if x.FriendUserID == "" { if x.FriendUserID == "" {
return errs.ErrArgs.Wrap("fromUserID is empty") return errs.ErrArgs.Wrap("fromUserID is empty")
} }
return nil return nil
} }
// Check
func (x *GetPaginationFriendsApplyFromReq) Check() error { func (x *GetPaginationFriendsApplyFromReq) Check() error {
if x.UserID == "" { if x.UserID == "" {
return errs.ErrArgs.Wrap("userID is empty") return errs.ErrArgs.Wrap("userID is empty")
@ -165,12 +192,15 @@ func (x *GetPaginationFriendsApplyFromReq) Check() error {
if x.Pagination.PageNumber < 1 { if x.Pagination.PageNumber < 1 {
return errs.ErrArgs.Wrap("pageNumber is invalid") return errs.ErrArgs.Wrap("pageNumber is invalid")
} }
return nil return nil
} }
// Check
func (x *GetFriendIDsReq) Check() error { func (x *GetFriendIDsReq) Check() error {
if x.UserID == "" { if x.UserID == "" {
return errs.ErrArgs.Wrap("userID is empty") return errs.ErrArgs.Wrap("userID is empty")
} }
return nil return nil
} }

@ -22,14 +22,16 @@ package friend
import ( import (
context "context" context "context"
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws" reflect "reflect"
sync "sync"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes" codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status" status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync" sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
) )
const ( const (
@ -45,7 +47,7 @@ type GetPaginationFriendsReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination"` Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination"`
UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"`
} }
func (x *GetPaginationFriendsReq) Reset() { func (x *GetPaginationFriendsReq) Reset() {
@ -100,7 +102,7 @@ type GetPaginationFriendsResp struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
FriendsInfo []*sdkws.FriendInfo `protobuf:"bytes,1,rep,name=friendsInfo,proto3" json:"friendsInfo"` FriendsInfo []*sdkws.FriendInfo `protobuf:"bytes,1,rep,name=friendsInfo,proto3" json:"friendsInfo"`
Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total"` Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total"`
} }
func (x *GetPaginationFriendsResp) Reset() { func (x *GetPaginationFriendsResp) Reset() {
@ -155,9 +157,9 @@ type ApplyToAddFriendReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
FromUserID string `protobuf:"bytes,1,opt,name=fromUserID,proto3" json:"fromUserID"` FromUserID string `protobuf:"bytes,1,opt,name=fromUserID,proto3" json:"fromUserID"`
ToUserID string `protobuf:"bytes,2,opt,name=toUserID,proto3" json:"toUserID"` ToUserID string `protobuf:"bytes,2,opt,name=toUserID,proto3" json:"toUserID"`
ReqMsg string `protobuf:"bytes,3,opt,name=reqMsg,proto3" json:"reqMsg"` ReqMsg string `protobuf:"bytes,3,opt,name=reqMsg,proto3" json:"reqMsg"`
Ex string `protobuf:"bytes,4,opt,name=ex,proto3" json:"ex"` Ex string `protobuf:"bytes,4,opt,name=ex,proto3" json:"ex"`
} }
func (x *ApplyToAddFriendReq) Reset() { func (x *ApplyToAddFriendReq) Reset() {
@ -263,7 +265,7 @@ type ImportFriendReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID,proto3" json:"ownerUserID"` OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID,proto3" json:"ownerUserID"`
FriendUserIDs []string `protobuf:"bytes,2,rep,name=friendUserIDs,proto3" json:"friendUserIDs"` FriendUserIDs []string `protobuf:"bytes,2,rep,name=friendUserIDs,proto3" json:"friendUserIDs"`
} }
@ -356,7 +358,7 @@ type GetPaginationFriendsApplyToReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination"` Pagination *sdkws.RequestPagination `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination"`
} }
@ -412,7 +414,7 @@ type GetPaginationFriendsApplyToResp struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
FriendRequests []*sdkws.FriendRequest `protobuf:"bytes,1,rep,name=FriendRequests,proto3" json:"FriendRequests"` FriendRequests []*sdkws.FriendRequest `protobuf:"bytes,1,rep,name=FriendRequests,proto3" json:"FriendRequests"`
Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total"` Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total"`
} }
func (x *GetPaginationFriendsApplyToResp) Reset() { func (x *GetPaginationFriendsApplyToResp) Reset() {
@ -466,7 +468,7 @@ type GetDesignatedFriendsReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID,proto3" json:"ownerUserID"` OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID,proto3" json:"ownerUserID"`
FriendUserIDs []string `protobuf:"bytes,2,rep,name=friendUserIDs,proto3" json:"friendUserIDs"` FriendUserIDs []string `protobuf:"bytes,2,rep,name=friendUserIDs,proto3" json:"friendUserIDs"`
} }
@ -754,7 +756,7 @@ type GetPaginationBlacksReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination"` Pagination *sdkws.RequestPagination `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination"`
} }
@ -1084,7 +1086,7 @@ type DeleteFriendReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID,proto3" json:"ownerUserID"` OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID,proto3" json:"ownerUserID"`
FriendUserID string `protobuf:"bytes,2,opt,name=friendUserID,proto3" json:"friendUserID"` FriendUserID string `protobuf:"bytes,2,opt,name=friendUserID,proto3" json:"friendUserID"`
} }
@ -1178,10 +1180,10 @@ type RespondFriendApplyReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
FromUserID string `protobuf:"bytes,1,opt,name=fromUserID,proto3" json:"fromUserID"` //主动发起的申请者 FromUserID string `protobuf:"bytes,1,opt,name=fromUserID,proto3" json:"fromUserID"` //主动发起的申请者
ToUserID string `protobuf:"bytes,2,opt,name=toUserID,proto3" json:"toUserID"` //被动添加者 ToUserID string `protobuf:"bytes,2,opt,name=toUserID,proto3" json:"toUserID"` //被动添加者
HandleResult int32 `protobuf:"varint,3,opt,name=handleResult,proto3" json:"handleResult"` HandleResult int32 `protobuf:"varint,3,opt,name=handleResult,proto3" json:"handleResult"`
HandleMsg string `protobuf:"bytes,4,opt,name=handleMsg,proto3" json:"handleMsg"` HandleMsg string `protobuf:"bytes,4,opt,name=handleMsg,proto3" json:"handleMsg"`
} }
func (x *RespondFriendApplyReq) Reset() { func (x *RespondFriendApplyReq) Reset() {
@ -1287,9 +1289,9 @@ type SetFriendRemarkReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID,proto3" json:"ownerUserID"` OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID,proto3" json:"ownerUserID"`
FriendUserID string `protobuf:"bytes,2,opt,name=friendUserID,proto3" json:"friendUserID"` FriendUserID string `protobuf:"bytes,2,opt,name=friendUserID,proto3" json:"friendUserID"`
Remark string `protobuf:"bytes,3,opt,name=remark,proto3" json:"remark"` Remark string `protobuf:"bytes,3,opt,name=remark,proto3" json:"remark"`
} }
func (x *SetFriendRemarkReq) Reset() { func (x *SetFriendRemarkReq) Reset() {
@ -1388,7 +1390,7 @@ type GetPaginationFriendsApplyFromReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination"` Pagination *sdkws.RequestPagination `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination"`
} }
@ -1444,7 +1446,7 @@ type GetPaginationFriendsApplyFromResp struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
FriendRequests []*sdkws.FriendRequest `protobuf:"bytes,1,rep,name=friendRequests,proto3" json:"friendRequests"` FriendRequests []*sdkws.FriendRequest `protobuf:"bytes,1,rep,name=friendRequests,proto3" json:"friendRequests"`
Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total"` Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total"`
} }
func (x *GetPaginationFriendsApplyFromResp) Reset() { func (x *GetPaginationFriendsApplyFromResp) Reset() {

@ -16,6 +16,7 @@ package group
import "github.com/OpenIMSDK/Open-IM-Server/pkg/errs" import "github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
// Check
func (x *CreateGroupReq) Check() error { func (x *CreateGroupReq) Check() error {
if x.MemberUserIDs == nil { if x.MemberUserIDs == nil {
return errs.ErrArgs.Wrap("memberUserIDS is empty") return errs.ErrArgs.Wrap("memberUserIDS is empty")
@ -29,16 +30,20 @@ func (x *CreateGroupReq) Check() error {
if x.OwnerUserID == "" { if x.OwnerUserID == "" {
return errs.ErrArgs.Wrap("ownerUserID") return errs.ErrArgs.Wrap("ownerUserID")
} }
return nil return nil
} }
// Check
func (x *GetGroupsInfoReq) Check() error { func (x *GetGroupsInfoReq) Check() error {
if x.GroupIDs == nil { if x.GroupIDs == nil {
return errs.ErrArgs.Wrap("GroupIDs") return errs.ErrArgs.Wrap("GroupIDs")
} }
return nil return nil
} }
// Check
func (x *SetGroupInfoReq) Check() error { func (x *SetGroupInfoReq) Check() error {
if x.GroupInfoForSet == nil { if x.GroupInfoForSet == nil {
return errs.ErrArgs.Wrap("GroupInfoForSets is empty") return errs.ErrArgs.Wrap("GroupInfoForSets is empty")
@ -46,9 +51,11 @@ func (x *SetGroupInfoReq) Check() error {
if x.GroupInfoForSet.GroupID == "" { if x.GroupInfoForSet.GroupID == "" {
return errs.ErrArgs.Wrap("GroupID is empty") return errs.ErrArgs.Wrap("GroupID is empty")
} }
return nil return nil
} }
// Check
func (x *GetGroupApplicationListReq) Check() error { func (x *GetGroupApplicationListReq) Check() error {
if x.Pagination == nil { if x.Pagination == nil {
return errs.ErrArgs.Wrap("pagination is empty") return errs.ErrArgs.Wrap("pagination is empty")
@ -59,9 +66,11 @@ func (x *GetGroupApplicationListReq) Check() error {
if x.FromUserID == "" { if x.FromUserID == "" {
return errs.ErrArgs.Wrap("fromUserID is empty") return errs.ErrArgs.Wrap("fromUserID is empty")
} }
return nil return nil
} }
// Check
func (x *GetUserReqApplicationListReq) Check() error { func (x *GetUserReqApplicationListReq) Check() error {
if x.UserID == "" { if x.UserID == "" {
return errs.ErrArgs.Wrap("UserID is empty") return errs.ErrArgs.Wrap("UserID is empty")
@ -72,9 +81,11 @@ func (x *GetUserReqApplicationListReq) Check() error {
if x.Pagination.PageNumber < 1 { if x.Pagination.PageNumber < 1 {
return errs.ErrArgs.Wrap("pageNumber is invalid") return errs.ErrArgs.Wrap("pageNumber is invalid")
} }
return nil return nil
} }
// Check
func (x *TransferGroupOwnerReq) Check() error { func (x *TransferGroupOwnerReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("groupID is empty") return errs.ErrArgs.Wrap("groupID is empty")
@ -85,9 +96,11 @@ func (x *TransferGroupOwnerReq) Check() error {
if x.NewOwnerUserID == "" { if x.NewOwnerUserID == "" {
return errs.ErrArgs.Wrap("newOwnerUserID is empty") return errs.ErrArgs.Wrap("newOwnerUserID is empty")
} }
return nil return nil
} }
// Check
func (x *JoinGroupReq) Check() error { func (x *JoinGroupReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("groupID is empty") return errs.ErrArgs.Wrap("groupID is empty")
@ -100,9 +113,11 @@ func (x *JoinGroupReq) Check() error {
return errs.ErrArgs.Wrap("inviterUserID is empty") return errs.ErrArgs.Wrap("inviterUserID is empty")
} }
} }
return nil return nil
} }
// Check
func (x *GroupApplicationResponseReq) Check() error { func (x *GroupApplicationResponseReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("groupID is empty") return errs.ErrArgs.Wrap("groupID is empty")
@ -113,16 +128,20 @@ func (x *GroupApplicationResponseReq) Check() error {
if x.HandleResult > 1 || x.HandleResult < -1 { if x.HandleResult > 1 || x.HandleResult < -1 {
return errs.ErrArgs.Wrap("handleResult is invalid") return errs.ErrArgs.Wrap("handleResult is invalid")
} }
return nil return nil
} }
// Check
func (x *QuitGroupReq) Check() error { func (x *QuitGroupReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("groupID is empty") return errs.ErrArgs.Wrap("groupID is empty")
} }
return nil return nil
} }
// Check
func (x *GetGroupMemberListReq) Check() error { func (x *GetGroupMemberListReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("groupID is empty") return errs.ErrArgs.Wrap("groupID is empty")
@ -136,9 +155,11 @@ func (x *GetGroupMemberListReq) Check() error {
if x.Filter < 0 || x.Filter > 5 { if x.Filter < 0 || x.Filter > 5 {
return errs.ErrArgs.Wrap("filter is invalid") return errs.ErrArgs.Wrap("filter is invalid")
} }
return nil return nil
} }
// Check
func (x *GetGroupMembersInfoReq) Check() error { func (x *GetGroupMembersInfoReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("groupID is empty") return errs.ErrArgs.Wrap("groupID is empty")
@ -146,9 +167,11 @@ func (x *GetGroupMembersInfoReq) Check() error {
if x.UserIDs == nil { if x.UserIDs == nil {
return errs.ErrArgs.Wrap("userIDs is empty") return errs.ErrArgs.Wrap("userIDs is empty")
} }
return nil return nil
} }
// Check
func (x *KickGroupMemberReq) Check() error { func (x *KickGroupMemberReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("groupID is empty") return errs.ErrArgs.Wrap("groupID is empty")
@ -156,9 +179,11 @@ func (x *KickGroupMemberReq) Check() error {
if x.KickedUserIDs == nil { if x.KickedUserIDs == nil {
return errs.ErrArgs.Wrap("kickUserIDs is empty") return errs.ErrArgs.Wrap("kickUserIDs is empty")
} }
return nil return nil
} }
// Check
func (x *GetJoinedGroupListReq) Check() error { func (x *GetJoinedGroupListReq) Check() error {
if x.Pagination == nil { if x.Pagination == nil {
return errs.ErrArgs.Wrap("pagination is empty") return errs.ErrArgs.Wrap("pagination is empty")
@ -169,9 +194,11 @@ func (x *GetJoinedGroupListReq) Check() error {
if x.FromUserID == "" { if x.FromUserID == "" {
return errs.ErrArgs.Wrap("fromUserID is empty") return errs.ErrArgs.Wrap("fromUserID is empty")
} }
return nil return nil
} }
// Check
func (x *InviteUserToGroupReq) Check() error { func (x *InviteUserToGroupReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("groupID is empty") return errs.ErrArgs.Wrap("groupID is empty")
@ -179,9 +206,11 @@ func (x *InviteUserToGroupReq) Check() error {
if x.InvitedUserIDs == nil { if x.InvitedUserIDs == nil {
return errs.ErrArgs.Wrap("invitedUserIDs is empty") return errs.ErrArgs.Wrap("invitedUserIDs is empty")
} }
return nil return nil
} }
// Check
func (x *GetGroupAllMemberReq) Check() error { func (x *GetGroupAllMemberReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("groupID is empty") return errs.ErrArgs.Wrap("groupID is empty")
@ -192,9 +221,11 @@ func (x *GetGroupAllMemberReq) Check() error {
if x.Pagination.PageNumber < 1 { if x.Pagination.PageNumber < 1 {
return errs.ErrArgs.Wrap("pageNumber is invalid") return errs.ErrArgs.Wrap("pageNumber is invalid")
} }
return nil return nil
} }
// Check
func (x *GetGroupsReq) Check() error { func (x *GetGroupsReq) Check() error {
if x.Pagination == nil { if x.Pagination == nil {
return errs.ErrArgs.Wrap("pagination is empty") return errs.ErrArgs.Wrap("pagination is empty")
@ -202,16 +233,20 @@ func (x *GetGroupsReq) Check() error {
if x.Pagination.PageNumber < 1 { if x.Pagination.PageNumber < 1 {
return errs.ErrArgs.Wrap("pageNumber is invalid") return errs.ErrArgs.Wrap("pageNumber is invalid")
} }
return nil return nil
} }
// Check
func (x *GetGroupMemberReq) Check() error { func (x *GetGroupMemberReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("groupID is empty") return errs.ErrArgs.Wrap("groupID is empty")
} }
return nil return nil
} }
// Check
func (x *GetGroupMembersCMSReq) Check() error { func (x *GetGroupMembersCMSReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("groupID is empty") return errs.ErrArgs.Wrap("groupID is empty")
@ -222,16 +257,20 @@ func (x *GetGroupMembersCMSReq) Check() error {
if x.Pagination.PageNumber < 1 { if x.Pagination.PageNumber < 1 {
return errs.ErrArgs.Wrap("pageNumber is invalid") return errs.ErrArgs.Wrap("pageNumber is invalid")
} }
return nil return nil
} }
// Check
func (x *DismissGroupReq) Check() error { func (x *DismissGroupReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("groupID is empty") return errs.ErrArgs.Wrap("groupID is empty")
} }
return nil return nil
} }
// Check
func (x *MuteGroupMemberReq) Check() error { func (x *MuteGroupMemberReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("groupID is empty") return errs.ErrArgs.Wrap("groupID is empty")
@ -242,9 +281,11 @@ func (x *MuteGroupMemberReq) Check() error {
if x.MutedSeconds <= 0 { if x.MutedSeconds <= 0 {
return errs.ErrArgs.Wrap("mutedSeconds is empty") return errs.ErrArgs.Wrap("mutedSeconds is empty")
} }
return nil return nil
} }
// Check
func (x *CancelMuteGroupMemberReq) Check() error { func (x *CancelMuteGroupMemberReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("groupID is empty") return errs.ErrArgs.Wrap("groupID is empty")
@ -252,37 +293,47 @@ func (x *CancelMuteGroupMemberReq) Check() error {
if x.UserID == "" { if x.UserID == "" {
return errs.ErrArgs.Wrap("userID is empty") return errs.ErrArgs.Wrap("userID is empty")
} }
return nil return nil
} }
// Check
func (x *MuteGroupReq) Check() error { func (x *MuteGroupReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("groupID is empty") return errs.ErrArgs.Wrap("groupID is empty")
} }
return nil return nil
} }
// Check
func (x *CancelMuteGroupReq) Check() error { func (x *CancelMuteGroupReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("groupID is empty") return errs.ErrArgs.Wrap("groupID is empty")
} }
return nil return nil
} }
// Check
func (x *GetJoinedSuperGroupListReq) Check() error { func (x *GetJoinedSuperGroupListReq) Check() error {
if x.UserID == "" { if x.UserID == "" {
return errs.ErrArgs.Wrap("userID is empty") return errs.ErrArgs.Wrap("userID is empty")
} }
return nil return nil
} }
// Check
func (x *GetSuperGroupsInfoReq) Check() error { func (x *GetSuperGroupsInfoReq) Check() error {
if x.GroupIDs == nil { if x.GroupIDs == nil {
return errs.ErrArgs.Wrap("GroupIDs is empty") return errs.ErrArgs.Wrap("GroupIDs is empty")
} }
return nil return nil
} }
// Check
func (x *SetGroupMemberInfo) Check() error { func (x *SetGroupMemberInfo) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("GroupID is empty") return errs.ErrArgs.Wrap("GroupID is empty")
@ -290,23 +341,29 @@ func (x *SetGroupMemberInfo) Check() error {
if x.UserID == "" { if x.UserID == "" {
return errs.ErrArgs.Wrap("userID is empty") return errs.ErrArgs.Wrap("userID is empty")
} }
return nil return nil
} }
// Check
func (x *SetGroupMemberInfoReq) Check() error { func (x *SetGroupMemberInfoReq) Check() error {
if x.Members == nil { if x.Members == nil {
return errs.ErrArgs.Wrap("Members is empty") return errs.ErrArgs.Wrap("Members is empty")
} }
return nil return nil
} }
// Check
func (x *GetGroupAbstractInfoReq) Check() error { func (x *GetGroupAbstractInfoReq) Check() error {
if x.GroupIDs == nil { if x.GroupIDs == nil {
return errs.ErrArgs.Wrap("GroupID is empty") return errs.ErrArgs.Wrap("GroupID is empty")
} }
return nil return nil
} }
// Check
func (x *GetUserInGroupMembersReq) Check() error { func (x *GetUserInGroupMembersReq) Check() error {
if x.GroupIDs == nil { if x.GroupIDs == nil {
return errs.ErrArgs.Wrap("GroupID is empty") return errs.ErrArgs.Wrap("GroupID is empty")
@ -314,16 +371,20 @@ func (x *GetUserInGroupMembersReq) Check() error {
if x.UserID == "" { if x.UserID == "" {
return errs.ErrArgs.Wrap("userID is empty") return errs.ErrArgs.Wrap("userID is empty")
} }
return nil return nil
} }
// Check
func (x *GetGroupMemberUserIDsReq) Check() error { func (x *GetGroupMemberUserIDsReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("GroupID is empty") return errs.ErrArgs.Wrap("GroupID is empty")
} }
return nil return nil
} }
// Check
func (x *GetGroupMemberRoleLevelReq) Check() error { func (x *GetGroupMemberRoleLevelReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("GroupID is empty") return errs.ErrArgs.Wrap("GroupID is empty")
@ -331,16 +392,20 @@ func (x *GetGroupMemberRoleLevelReq) Check() error {
if x.RoleLevels == nil { if x.RoleLevels == nil {
return errs.ErrArgs.Wrap("rolesLevel is empty") return errs.ErrArgs.Wrap("rolesLevel is empty")
} }
return nil return nil
} }
// Check
func (x *GetGroupInfoCacheReq) Check() error { func (x *GetGroupInfoCacheReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("GroupID is empty") return errs.ErrArgs.Wrap("GroupID is empty")
} }
return nil return nil
} }
// Check
func (x *GetGroupMemberCacheReq) Check() error { func (x *GetGroupMemberCacheReq) Check() error {
if x.GroupID == "" { if x.GroupID == "" {
return errs.ErrArgs.Wrap("GroupID is empty") return errs.ErrArgs.Wrap("GroupID is empty")
@ -348,5 +413,6 @@ func (x *GetGroupMemberCacheReq) Check() error {
if x.GroupMemberID == "" { if x.GroupMemberID == "" {
return errs.ErrArgs.Wrap("GroupMemberID is empty") return errs.ErrArgs.Wrap("GroupMemberID is empty")
} }
return nil return nil
} }

@ -22,15 +22,17 @@ package group
import ( import (
context "context" context "context"
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws" reflect "reflect"
wrapperspb "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/wrapperspb" sync "sync"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes" codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status" status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync" sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
wrapperspb "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/wrapperspb"
) )
const ( const (
@ -46,9 +48,9 @@ type CreateGroupReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
MemberUserIDs []string `protobuf:"bytes,1,rep,name=memberUserIDs,proto3" json:"memberUserIDs"` MemberUserIDs []string `protobuf:"bytes,1,rep,name=memberUserIDs,proto3" json:"memberUserIDs"`
GroupInfo *sdkws.GroupInfo `protobuf:"bytes,2,opt,name=groupInfo,proto3" json:"groupInfo"` GroupInfo *sdkws.GroupInfo `protobuf:"bytes,2,opt,name=groupInfo,proto3" json:"groupInfo"`
AdminUserIDs []string `protobuf:"bytes,3,rep,name=adminUserIDs,proto3" json:"adminUserIDs"` AdminUserIDs []string `protobuf:"bytes,3,rep,name=adminUserIDs,proto3" json:"adminUserIDs"`
OwnerUserID string `protobuf:"bytes,4,opt,name=ownerUserID,proto3" json:"ownerUserID"` //owner OwnerUserID string `protobuf:"bytes,4,opt,name=ownerUserID,proto3" json:"ownerUserID"` //owner
} }
func (x *CreateGroupReq) Reset() { func (x *CreateGroupReq) Reset() {
@ -397,7 +399,7 @@ type GetGroupApplicationListResp struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Total uint32 `protobuf:"varint,1,opt,name=total,proto3" json:"total"` Total uint32 `protobuf:"varint,1,opt,name=total,proto3" json:"total"`
GroupRequests []*sdkws.GroupRequest `protobuf:"bytes,2,rep,name=groupRequests,proto3" json:"groupRequests"` GroupRequests []*sdkws.GroupRequest `protobuf:"bytes,2,rep,name=groupRequests,proto3" json:"groupRequests"`
} }
@ -453,7 +455,7 @@ type GetUserReqApplicationListReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination"` Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination"`
UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"`
} }
func (x *GetUserReqApplicationListReq) Reset() { func (x *GetUserReqApplicationListReq) Reset() {
@ -507,7 +509,7 @@ type GetUserReqApplicationListResp struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Total uint32 `protobuf:"varint,1,opt,name=total,proto3" json:"total"` Total uint32 `protobuf:"varint,1,opt,name=total,proto3" json:"total"`
GroupRequests []*sdkws.GroupRequest `protobuf:"bytes,2,rep,name=groupRequests,proto3" json:"groupRequests"` GroupRequests []*sdkws.GroupRequest `protobuf:"bytes,2,rep,name=groupRequests,proto3" json:"groupRequests"`
} }
@ -562,7 +564,7 @@ type TransferGroupOwnerReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"`
OldOwnerUserID string `protobuf:"bytes,2,opt,name=oldOwnerUserID,proto3" json:"oldOwnerUserID"` OldOwnerUserID string `protobuf:"bytes,2,opt,name=oldOwnerUserID,proto3" json:"oldOwnerUserID"`
NewOwnerUserID string `protobuf:"bytes,3,opt,name=newOwnerUserID,proto3" json:"newOwnerUserID"` NewOwnerUserID string `protobuf:"bytes,3,opt,name=newOwnerUserID,proto3" json:"newOwnerUserID"`
} }
@ -663,9 +665,9 @@ type JoinGroupReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"`
ReqMessage string `protobuf:"bytes,2,opt,name=reqMessage,proto3" json:"reqMessage"` ReqMessage string `protobuf:"bytes,2,opt,name=reqMessage,proto3" json:"reqMessage"`
JoinSource int32 `protobuf:"varint,3,opt,name=joinSource,proto3" json:"joinSource"` JoinSource int32 `protobuf:"varint,3,opt,name=joinSource,proto3" json:"joinSource"`
InviterUserID string `protobuf:"bytes,4,opt,name=inviterUserID,proto3" json:"inviterUserID"` InviterUserID string `protobuf:"bytes,4,opt,name=inviterUserID,proto3" json:"inviterUserID"`
} }
@ -772,9 +774,9 @@ type GroupApplicationResponseReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"`
FromUserID string `protobuf:"bytes,2,opt,name=fromUserID,proto3" json:"fromUserID"` // FromUserID string `protobuf:"bytes,2,opt,name=fromUserID,proto3" json:"fromUserID"` //
HandledMsg string `protobuf:"bytes,3,opt,name=handledMsg,proto3" json:"handledMsg"` HandledMsg string `protobuf:"bytes,3,opt,name=handledMsg,proto3" json:"handledMsg"`
HandleResult int32 `protobuf:"varint,4,opt,name=handleResult,proto3" json:"handleResult"` HandleResult int32 `protobuf:"varint,4,opt,name=handleResult,proto3" json:"handleResult"`
} }
@ -967,8 +969,8 @@ type GetGroupMemberListReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination"` Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination"`
GroupID string `protobuf:"bytes,2,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,2,opt,name=groupID,proto3" json:"groupID"`
Filter int32 `protobuf:"varint,3,opt,name=filter,proto3" json:"filter"` Filter int32 `protobuf:"varint,3,opt,name=filter,proto3" json:"filter"`
} }
func (x *GetGroupMemberListReq) Reset() { func (x *GetGroupMemberListReq) Reset() {
@ -1029,7 +1031,7 @@ type GetGroupMemberListResp struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Total uint32 `protobuf:"varint,1,opt,name=total,proto3" json:"total"` Total uint32 `protobuf:"varint,1,opt,name=total,proto3" json:"total"`
Members []*sdkws.GroupMemberFullInfo `protobuf:"bytes,2,rep,name=members,proto3" json:"members"` Members []*sdkws.GroupMemberFullInfo `protobuf:"bytes,2,rep,name=members,proto3" json:"members"`
} }
@ -1186,9 +1188,9 @@ type KickGroupMemberReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"`
KickedUserIDs []string `protobuf:"bytes,2,rep,name=kickedUserIDs,proto3" json:"kickedUserIDs"` KickedUserIDs []string `protobuf:"bytes,2,rep,name=kickedUserIDs,proto3" json:"kickedUserIDs"`
Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason"` Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason"`
} }
func (x *KickGroupMemberReq) Reset() { func (x *KickGroupMemberReq) Reset() {
@ -1397,8 +1399,8 @@ type InviteUserToGroupReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"`
Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason"` Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason"`
InvitedUserIDs []string `protobuf:"bytes,3,rep,name=invitedUserIDs,proto3" json:"invitedUserIDs"` InvitedUserIDs []string `protobuf:"bytes,3,rep,name=invitedUserIDs,proto3" json:"invitedUserIDs"`
} }
@ -1499,7 +1501,7 @@ type GetGroupAllMemberReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination"` Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination"`
GroupID string `protobuf:"bytes,2,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,2,opt,name=groupID,proto3" json:"groupID"`
} }
func (x *GetGroupAllMemberReq) Reset() { func (x *GetGroupAllMemberReq) Reset() {
@ -1600,9 +1602,9 @@ type CMSGroup struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
GroupInfo *sdkws.GroupInfo `protobuf:"bytes,1,opt,name=groupInfo,proto3" json:"groupInfo"` GroupInfo *sdkws.GroupInfo `protobuf:"bytes,1,opt,name=groupInfo,proto3" json:"groupInfo"`
GroupOwnerUserName string `protobuf:"bytes,2,opt,name=groupOwnerUserName,proto3" json:"groupOwnerUserName"` GroupOwnerUserName string `protobuf:"bytes,2,opt,name=groupOwnerUserName,proto3" json:"groupOwnerUserName"`
GroupOwnerUserID string `protobuf:"bytes,3,opt,name=groupOwnerUserID,proto3" json:"groupOwnerUserID"` GroupOwnerUserID string `protobuf:"bytes,3,opt,name=groupOwnerUserID,proto3" json:"groupOwnerUserID"`
} }
func (x *CMSGroup) Reset() { func (x *CMSGroup) Reset() {
@ -1664,8 +1666,8 @@ type GetGroupsReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination"` Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination"`
GroupName string `protobuf:"bytes,2,opt,name=groupName,proto3" json:"groupName"` GroupName string `protobuf:"bytes,2,opt,name=groupName,proto3" json:"groupName"`
GroupID string `protobuf:"bytes,3,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,3,opt,name=groupID,proto3" json:"groupID"`
} }
func (x *GetGroupsReq) Reset() { func (x *GetGroupsReq) Reset() {
@ -1829,8 +1831,8 @@ type GetGroupMembersCMSReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination"` Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination"`
GroupID string `protobuf:"bytes,2,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,2,opt,name=groupID,proto3" json:"groupID"`
UserName string `protobuf:"bytes,3,opt,name=userName,proto3" json:"userName"` UserName string `protobuf:"bytes,3,opt,name=userName,proto3" json:"userName"`
} }
func (x *GetGroupMembersCMSReq) Reset() { func (x *GetGroupMembersCMSReq) Reset() {
@ -1891,7 +1893,7 @@ type GetGroupMembersCMSResp struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Total uint32 `protobuf:"varint,1,opt,name=total,proto3" json:"total"` Total uint32 `protobuf:"varint,1,opt,name=total,proto3" json:"total"`
Members []*sdkws.GroupMemberFullInfo `protobuf:"bytes,2,rep,name=members,proto3" json:"members"` Members []*sdkws.GroupMemberFullInfo `protobuf:"bytes,2,rep,name=members,proto3" json:"members"`
} }
@ -1946,7 +1948,7 @@ type DismissGroupReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"`
DeleteMember bool `protobuf:"varint,2,opt,name=deleteMember,proto3" json:"deleteMember"` DeleteMember bool `protobuf:"varint,2,opt,name=deleteMember,proto3" json:"deleteMember"`
} }
@ -2039,8 +2041,8 @@ type MuteGroupMemberReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"`
UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"`
MutedSeconds uint32 `protobuf:"varint,3,opt,name=mutedSeconds,proto3" json:"mutedSeconds"` MutedSeconds uint32 `protobuf:"varint,3,opt,name=mutedSeconds,proto3" json:"mutedSeconds"`
} }
@ -2141,7 +2143,7 @@ type CancelMuteGroupMemberReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"`
UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"`
} }
func (x *CancelMuteGroupMemberReq) Reset() { func (x *CancelMuteGroupMemberReq) Reset() {
@ -2591,12 +2593,12 @@ type SetGroupMemberInfo struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"`
UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"`
Nickname *wrapperspb.StringValue `protobuf:"bytes,3,opt,name=nickname,proto3" json:"nickname"` Nickname *wrapperspb.StringValue `protobuf:"bytes,3,opt,name=nickname,proto3" json:"nickname"`
FaceURL *wrapperspb.StringValue `protobuf:"bytes,4,opt,name=faceURL,proto3" json:"faceURL"` FaceURL *wrapperspb.StringValue `protobuf:"bytes,4,opt,name=faceURL,proto3" json:"faceURL"`
RoleLevel *wrapperspb.Int32Value `protobuf:"bytes,5,opt,name=roleLevel,proto3" json:"roleLevel"` RoleLevel *wrapperspb.Int32Value `protobuf:"bytes,5,opt,name=roleLevel,proto3" json:"roleLevel"`
Ex *wrapperspb.StringValue `protobuf:"bytes,6,opt,name=ex,proto3" json:"ex"` Ex *wrapperspb.StringValue `protobuf:"bytes,6,opt,name=ex,proto3" json:"ex"`
} }
func (x *SetGroupMemberInfo) Reset() { func (x *SetGroupMemberInfo) Reset() {
@ -2810,8 +2812,8 @@ type GroupAbstractInfo struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"`
GroupMemberNumber uint32 `protobuf:"varint,2,opt,name=groupMemberNumber,proto3" json:"groupMemberNumber"` GroupMemberNumber uint32 `protobuf:"varint,2,opt,name=groupMemberNumber,proto3" json:"groupMemberNumber"`
GroupMemberListHash uint64 `protobuf:"varint,3,opt,name=groupMemberListHash,proto3" json:"groupMemberListHash"` GroupMemberListHash uint64 `protobuf:"varint,3,opt,name=groupMemberListHash,proto3" json:"groupMemberListHash"`
} }
@ -2920,7 +2922,7 @@ type GetUserInGroupMembersReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
GroupIDs []string `protobuf:"bytes,2,rep,name=groupIDs,proto3" json:"groupIDs"` GroupIDs []string `protobuf:"bytes,2,rep,name=groupIDs,proto3" json:"groupIDs"`
} }
@ -3116,7 +3118,7 @@ type GetGroupMemberRoleLevelReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"`
RoleLevels []int32 `protobuf:"varint,2,rep,packed,name=roleLevels,proto3" json:"roleLevels"` RoleLevels []int32 `protobuf:"varint,2,rep,packed,name=roleLevels,proto3" json:"roleLevels"`
} }
@ -3312,7 +3314,7 @@ type GetGroupMemberCacheReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"`
GroupMemberID string `protobuf:"bytes,2,opt,name=groupMemberID,proto3" json:"groupMemberID"` GroupMemberID string `protobuf:"bytes,2,opt,name=groupMemberID,proto3" json:"groupMemberID"`
} }
@ -3415,7 +3417,7 @@ type GroupCreateCountReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Start int64 `protobuf:"varint,1,opt,name=start,proto3" json:"start"` Start int64 `protobuf:"varint,1,opt,name=start,proto3" json:"start"`
End int64 `protobuf:"varint,2,opt,name=end,proto3" json:"end"` End int64 `protobuf:"varint,2,opt,name=end,proto3" json:"end"`
} }
func (x *GroupCreateCountReq) Reset() { func (x *GroupCreateCountReq) Reset() {
@ -3469,9 +3471,9 @@ type GroupCreateCountResp struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"` Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"`
Before int64 `protobuf:"varint,2,opt,name=before,proto3" json:"before"` Before int64 `protobuf:"varint,2,opt,name=before,proto3" json:"before"`
Count map[string]int64 `protobuf:"bytes,3,rep,name=count,proto3" json:"count" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` Count map[string]int64 `protobuf:"bytes,3,rep,name=count,proto3" json:"count" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
} }
func (x *GroupCreateCountResp) Reset() { func (x *GroupCreateCountResp) Reset() {

@ -16,13 +16,16 @@ package msg
import "github.com/OpenIMSDK/Open-IM-Server/pkg/errs" import "github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
// Check
func (x *GetMaxAndMinSeqReq) Check() error { func (x *GetMaxAndMinSeqReq) Check() error {
if x.UserID == "" { if x.UserID == "" {
return errs.ErrArgs.Wrap("userID is empty") return errs.ErrArgs.Wrap("userID is empty")
} }
return nil return nil
} }
// Check
func (x *SendMsgReq) Check() error { func (x *SendMsgReq) Check() error {
if x.MsgData == nil { if x.MsgData == nil {
return errs.ErrArgs.Wrap("MsgData is empty") return errs.ErrArgs.Wrap("MsgData is empty")
@ -30,21 +33,25 @@ func (x *SendMsgReq) Check() error {
if err := x.MsgData.Check(); err != nil { if err := x.MsgData.Check(); err != nil {
return err return err
} }
return nil return nil
} }
// Check
func (x *SetSendMsgStatusReq) Check() error { func (x *SetSendMsgStatusReq) Check() error {
if x.Status < 0 || x.Status > 3 { if x.Status < 0 || x.Status > 3 {
return errs.ErrArgs.Wrap("status is invalid") return errs.ErrArgs.Wrap("status is invalid")
} }
return nil return nil
} }
// Check
func (x *GetSendMsgStatusReq) Check() error { func (x *GetSendMsgStatusReq) Check() error {
return nil return nil
} }
//func (x *ModifyMessageReactionExtensionsReq) Check() error { // func (x *ModifyMessageReactionExtensionsReq) Check() error {
// if x.ConversationID == "" { // if x.ConversationID == "" {
// return errs.ErrArgs.Wrap("conversationID is empty") // return errs.ErrArgs.Wrap("conversationID is empty")
// } // }
@ -55,9 +62,9 @@ func (x *GetSendMsgStatusReq) Check() error {
// return errs.ErrArgs.Wrap("reactionExtensions is empty") // return errs.ErrArgs.Wrap("reactionExtensions is empty")
// } // }
// return nil // return nil
//} // }
// //
//func (x *SetMessageReactionExtensionsReq) Check() error { // func (x *SetMessageReactionExtensionsReq) Check() error {
// if x.ConversationID == "" { // if x.ConversationID == "" {
// return errs.ErrArgs.Wrap("conversationID is empty") // return errs.ErrArgs.Wrap("conversationID is empty")
// } // }
@ -68,9 +75,9 @@ func (x *GetSendMsgStatusReq) Check() error {
// return errs.ErrArgs.Wrap("reactionExtensions is empty") // return errs.ErrArgs.Wrap("reactionExtensions is empty")
// } // }
// return nil // return nil
//} // }
// //
//func (x *GetMessagesReactionExtensionsReq) Check() error { // func (x *GetMessagesReactionExtensionsReq) Check() error {
// if x.ConversationID == "" { // if x.ConversationID == "" {
// return errs.ErrArgs.Wrap("conversationID is empty") // return errs.ErrArgs.Wrap("conversationID is empty")
// } // }
@ -84,9 +91,9 @@ func (x *GetSendMsgStatusReq) Check() error {
// return errs.ErrArgs.Wrap("TypeKeys is empty") // return errs.ErrArgs.Wrap("TypeKeys is empty")
// } // }
// return nil // return nil
//} // }
// //
//func (x *DeleteMessagesReactionExtensionsReq) Check() error { // func (x *DeleteMessagesReactionExtensionsReq) Check() error {
// if x.ConversationID == "" { // if x.ConversationID == "" {
// return errs.ErrArgs.Wrap("conversationID is empty") // return errs.ErrArgs.Wrap("conversationID is empty")
// } // }
@ -97,12 +104,14 @@ func (x *GetSendMsgStatusReq) Check() error {
// return errs.ErrArgs.Wrap("ReactionExtensions is empty") // return errs.ErrArgs.Wrap("ReactionExtensions is empty")
// } // }
// return nil // return nil
//} // }
// Check
func (x *DelMsgsReq) Check() error { func (x *DelMsgsReq) Check() error {
return nil return nil
} }
// Check
func (x *RevokeMsgReq) Check() error { func (x *RevokeMsgReq) Check() error {
if x.ConversationID == "" { if x.ConversationID == "" {
return errs.ErrArgs.Wrap("conversationID is empty") return errs.ErrArgs.Wrap("conversationID is empty")
@ -113,9 +122,11 @@ func (x *RevokeMsgReq) Check() error {
if x.UserID == "" { if x.UserID == "" {
return errs.ErrArgs.Wrap("userID is empty") return errs.ErrArgs.Wrap("userID is empty")
} }
return nil return nil
} }
// Check
func (x *MarkMsgsAsReadReq) Check() error { func (x *MarkMsgsAsReadReq) Check() error {
if x.ConversationID == "" { if x.ConversationID == "" {
return errs.ErrArgs.Wrap("conversationID is empty") return errs.ErrArgs.Wrap("conversationID is empty")
@ -131,9 +142,11 @@ func (x *MarkMsgsAsReadReq) Check() error {
return errs.ErrArgs.Wrap("seqs has 0 value is invalid") return errs.ErrArgs.Wrap("seqs has 0 value is invalid")
} }
} }
return nil return nil
} }
// Check
func (x *MarkConversationAsReadReq) Check() error { func (x *MarkConversationAsReadReq) Check() error {
if x.ConversationID == "" { if x.ConversationID == "" {
return errs.ErrArgs.Wrap("conversationID is empty") return errs.ErrArgs.Wrap("conversationID is empty")
@ -149,9 +162,11 @@ func (x *MarkConversationAsReadReq) Check() error {
return errs.ErrArgs.Wrap("seqs has 0 value is invalid") return errs.ErrArgs.Wrap("seqs has 0 value is invalid")
} }
} }
return nil return nil
} }
// Check
func (x *SetConversationHasReadSeqReq) Check() error { func (x *SetConversationHasReadSeqReq) Check() error {
if x.ConversationID == "" { if x.ConversationID == "" {
return errs.ErrArgs.Wrap("conversationID is empty") return errs.ErrArgs.Wrap("conversationID is empty")
@ -162,9 +177,11 @@ func (x *SetConversationHasReadSeqReq) Check() error {
if x.HasReadSeq < 1 { if x.HasReadSeq < 1 {
return errs.ErrArgs.Wrap("hasReadSeq is invalid") return errs.ErrArgs.Wrap("hasReadSeq is invalid")
} }
return nil return nil
} }
// Check
func (x *ClearConversationsMsgReq) Check() error { func (x *ClearConversationsMsgReq) Check() error {
if x.ConversationIDs == nil { if x.ConversationIDs == nil {
return errs.ErrArgs.Wrap("conversationIDs is empty") return errs.ErrArgs.Wrap("conversationIDs is empty")
@ -172,16 +189,20 @@ func (x *ClearConversationsMsgReq) Check() error {
if x.UserID == "" { if x.UserID == "" {
return errs.ErrArgs.Wrap("userID is empty") return errs.ErrArgs.Wrap("userID is empty")
} }
return nil return nil
} }
// Check
func (x *UserClearAllMsgReq) Check() error { func (x *UserClearAllMsgReq) Check() error {
if x.UserID == "" { if x.UserID == "" {
return errs.ErrArgs.Wrap("userID is empty") return errs.ErrArgs.Wrap("userID is empty")
} }
return nil return nil
} }
// Check
func (x *DeleteMsgsReq) Check() error { func (x *DeleteMsgsReq) Check() error {
if x.ConversationID == "" { if x.ConversationID == "" {
return errs.ErrArgs.Wrap("conversationID is empty") return errs.ErrArgs.Wrap("conversationID is empty")
@ -192,26 +213,33 @@ func (x *DeleteMsgsReq) Check() error {
if x.Seqs == nil { if x.Seqs == nil {
return errs.ErrArgs.Wrap("seqs is empty") return errs.ErrArgs.Wrap("seqs is empty")
} }
return nil return nil
} }
// Check
func (x *DeleteMsgPhysicalReq) Check() error { func (x *DeleteMsgPhysicalReq) Check() error {
if x.ConversationIDs == nil { if x.ConversationIDs == nil {
return errs.ErrArgs.Wrap("conversationIDs is empty") return errs.ErrArgs.Wrap("conversationIDs is empty")
} }
return nil return nil
} }
// Check
func (x *GetConversationMaxSeqReq) Check() error { func (x *GetConversationMaxSeqReq) Check() error {
if x.ConversationID == "" { if x.ConversationID == "" {
return errs.ErrArgs.Wrap("conversationID is empty") return errs.ErrArgs.Wrap("conversationID is empty")
} }
return nil return nil
} }
// Check
func (x *GetConversationsHasReadAndMaxSeqReq) Check() error { func (x *GetConversationsHasReadAndMaxSeqReq) Check() error {
if x.UserID == "" { if x.UserID == "" {
return errs.ErrArgs.Wrap("userID is empty") return errs.ErrArgs.Wrap("userID is empty")
} }
return nil return nil
} }

@ -22,14 +22,16 @@ package msg
import ( import (
context "context" context "context"
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws" reflect "reflect"
sync "sync"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes" codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status" status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync" sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
) )
const ( const (
@ -44,7 +46,7 @@ type MsgDataToMQ struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token"` Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token"`
MsgData *sdkws.MsgData `protobuf:"bytes,2,opt,name=msgData,proto3" json:"msgData"` MsgData *sdkws.MsgData `protobuf:"bytes,2,opt,name=msgData,proto3" json:"msgData"`
} }
@ -146,7 +148,7 @@ type PushMsgDataToMQ struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
MsgData *sdkws.MsgData `protobuf:"bytes,1,opt,name=msgData,proto3" json:"msgData"` MsgData *sdkws.MsgData `protobuf:"bytes,1,opt,name=msgData,proto3" json:"msgData"`
ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"` ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"`
} }
@ -201,9 +203,9 @@ type MsgDataToMongoByMQ struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
LastSeq int64 `protobuf:"varint,1,opt,name=lastSeq,proto3" json:"lastSeq"` LastSeq int64 `protobuf:"varint,1,opt,name=lastSeq,proto3" json:"lastSeq"`
ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"` ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"`
MsgData []*sdkws.MsgData `protobuf:"bytes,3,rep,name=msgData,proto3" json:"msgData"` MsgData []*sdkws.MsgData `protobuf:"bytes,3,rep,name=msgData,proto3" json:"msgData"`
} }
func (x *MsgDataToMongoByMQ) Reset() { func (x *MsgDataToMongoByMQ) Reset() {
@ -415,7 +417,7 @@ type SendMsgResp struct {
ServerMsgID string `protobuf:"bytes,1,opt,name=serverMsgID,proto3" json:"serverMsgID"` ServerMsgID string `protobuf:"bytes,1,opt,name=serverMsgID,proto3" json:"serverMsgID"`
ClientMsgID string `protobuf:"bytes,2,opt,name=clientMsgID,proto3" json:"clientMsgID"` ClientMsgID string `protobuf:"bytes,2,opt,name=clientMsgID,proto3" json:"clientMsgID"`
SendTime int64 `protobuf:"varint,3,opt,name=sendTime,proto3" json:"sendTime"` SendTime int64 `protobuf:"varint,3,opt,name=sendTime,proto3" json:"sendTime"`
} }
func (x *SendMsgResp) Reset() { func (x *SendMsgResp) Reset() {
@ -646,7 +648,7 @@ type MsgDataToModifyByMQ struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Messages []*sdkws.MsgData `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages"` Messages []*sdkws.MsgData `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages"`
ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"` ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"`
} }
@ -778,8 +780,8 @@ type RevokeMsgReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"` ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"`
Seq int64 `protobuf:"varint,2,opt,name=seq,proto3" json:"seq"` Seq int64 `protobuf:"varint,2,opt,name=seq,proto3" json:"seq"`
UserID string `protobuf:"bytes,3,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,3,opt,name=userID,proto3" json:"userID"`
} }
func (x *RevokeMsgReq) Reset() { func (x *RevokeMsgReq) Reset() {
@ -879,8 +881,8 @@ type MarkMsgsAsReadReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"` ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"`
Seqs []int64 `protobuf:"varint,2,rep,packed,name=seqs,proto3" json:"seqs"` Seqs []int64 `protobuf:"varint,2,rep,packed,name=seqs,proto3" json:"seqs"`
UserID string `protobuf:"bytes,3,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,3,opt,name=userID,proto3" json:"userID"`
} }
func (x *MarkMsgsAsReadReq) Reset() { func (x *MarkMsgsAsReadReq) Reset() {
@ -980,9 +982,9 @@ type MarkConversationAsReadReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"` ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"`
UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"`
HasReadSeq int64 `protobuf:"varint,3,opt,name=hasReadSeq,proto3" json:"hasReadSeq"` HasReadSeq int64 `protobuf:"varint,3,opt,name=hasReadSeq,proto3" json:"hasReadSeq"`
Seqs []int64 `protobuf:"varint,4,rep,packed,name=seqs,proto3" json:"seqs"` Seqs []int64 `protobuf:"varint,4,rep,packed,name=seqs,proto3" json:"seqs"`
} }
func (x *MarkConversationAsReadReq) Reset() { func (x *MarkConversationAsReadReq) Reset() {
@ -1089,8 +1091,8 @@ type SetConversationHasReadSeqReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"` ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"`
UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"`
HasReadSeq int64 `protobuf:"varint,3,opt,name=hasReadSeq,proto3" json:"hasReadSeq"` HasReadSeq int64 `protobuf:"varint,3,opt,name=hasReadSeq,proto3" json:"hasReadSeq"`
} }
func (x *SetConversationHasReadSeqReq) Reset() { func (x *SetConversationHasReadSeqReq) Reset() {
@ -1189,7 +1191,7 @@ type DeleteSyncOpt struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
IsSyncSelf bool `protobuf:"varint,3,opt,name=IsSyncSelf,proto3" json:"IsSyncSelf"` IsSyncSelf bool `protobuf:"varint,3,opt,name=IsSyncSelf,proto3" json:"IsSyncSelf"`
IsSyncOther bool `protobuf:"varint,4,opt,name=IsSyncOther,proto3" json:"IsSyncOther"` IsSyncOther bool `protobuf:"varint,4,opt,name=IsSyncOther,proto3" json:"IsSyncOther"`
} }
@ -1245,8 +1247,8 @@ type ClearConversationsMsgReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
ConversationIDs []string `protobuf:"bytes,1,rep,name=conversationIDs,proto3" json:"conversationIDs"` ConversationIDs []string `protobuf:"bytes,1,rep,name=conversationIDs,proto3" json:"conversationIDs"`
UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"`
DeleteSyncOpt *DeleteSyncOpt `protobuf:"bytes,3,opt,name=deleteSyncOpt,proto3" json:"deleteSyncOpt"` DeleteSyncOpt *DeleteSyncOpt `protobuf:"bytes,3,opt,name=deleteSyncOpt,proto3" json:"deleteSyncOpt"`
} }
func (x *ClearConversationsMsgReq) Reset() { func (x *ClearConversationsMsgReq) Reset() {
@ -1345,7 +1347,7 @@ type UserClearAllMsgReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
DeleteSyncOpt *DeleteSyncOpt `protobuf:"bytes,3,opt,name=deleteSyncOpt,proto3" json:"deleteSyncOpt"` DeleteSyncOpt *DeleteSyncOpt `protobuf:"bytes,3,opt,name=deleteSyncOpt,proto3" json:"deleteSyncOpt"`
} }
@ -1439,9 +1441,9 @@ type DeleteMsgsReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"` ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"`
Seqs []int64 `protobuf:"varint,2,rep,packed,name=seqs,proto3" json:"seqs"` Seqs []int64 `protobuf:"varint,2,rep,packed,name=seqs,proto3" json:"seqs"`
UserID string `protobuf:"bytes,3,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,3,opt,name=userID,proto3" json:"userID"`
DeleteSyncOpt *DeleteSyncOpt `protobuf:"bytes,4,opt,name=deleteSyncOpt,proto3" json:"deleteSyncOpt"` DeleteSyncOpt *DeleteSyncOpt `protobuf:"bytes,4,opt,name=deleteSyncOpt,proto3" json:"deleteSyncOpt"`
} }
func (x *DeleteMsgsReq) Reset() { func (x *DeleteMsgsReq) Reset() {
@ -1548,7 +1550,7 @@ type DeleteMsgPhysicalReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
ConversationIDs []string `protobuf:"bytes,1,rep,name=conversationIDs,proto3" json:"conversationIDs"` ConversationIDs []string `protobuf:"bytes,1,rep,name=conversationIDs,proto3" json:"conversationIDs"`
Timestamp int64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp"` Timestamp int64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp"`
} }
func (x *DeleteMsgPhysicalReq) Reset() { func (x *DeleteMsgPhysicalReq) Reset() {
@ -1641,7 +1643,7 @@ type DeleteMsgPhysicalBySeqReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"` ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"`
Seqs []int64 `protobuf:"varint,2,rep,packed,name=seqs,proto3" json:"seqs"` Seqs []int64 `protobuf:"varint,2,rep,packed,name=seqs,proto3" json:"seqs"`
} }
func (x *DeleteMsgPhysicalBySeqReq) Reset() { func (x *DeleteMsgPhysicalBySeqReq) Reset() {
@ -1874,7 +1876,7 @@ type Seqs struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
MaxSeq int64 `protobuf:"varint,1,opt,name=maxSeq,proto3" json:"maxSeq"` MaxSeq int64 `protobuf:"varint,1,opt,name=maxSeq,proto3" json:"maxSeq"`
HasReadSeq int64 `protobuf:"varint,2,opt,name=hasReadSeq,proto3" json:"hasReadSeq"` HasReadSeq int64 `protobuf:"varint,2,opt,name=hasReadSeq,proto3" json:"hasReadSeq"`
} }
@ -1976,10 +1978,10 @@ type GetActiveUserReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Start int64 `protobuf:"varint,1,opt,name=start,proto3" json:"start"` Start int64 `protobuf:"varint,1,opt,name=start,proto3" json:"start"`
End int64 `protobuf:"varint,2,opt,name=end,proto3" json:"end"` End int64 `protobuf:"varint,2,opt,name=end,proto3" json:"end"`
Ase bool `protobuf:"varint,3,opt,name=ase,proto3" json:"ase"` Ase bool `protobuf:"varint,3,opt,name=ase,proto3" json:"ase"`
Group bool `protobuf:"varint,4,opt,name=group,proto3" json:"group"` Group bool `protobuf:"varint,4,opt,name=group,proto3" json:"group"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,5,opt,name=pagination,proto3" json:"pagination"` Pagination *sdkws.RequestPagination `protobuf:"bytes,5,opt,name=pagination,proto3" json:"pagination"`
} }
@ -2055,7 +2057,7 @@ type ActiveUser struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
User *sdkws.UserInfo `protobuf:"bytes,1,opt,name=user,proto3" json:"user"` User *sdkws.UserInfo `protobuf:"bytes,1,opt,name=user,proto3" json:"user"`
Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count"` Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count"`
} }
@ -2110,10 +2112,10 @@ type GetActiveUserResp struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
MsgCount int64 `protobuf:"varint,1,opt,name=msgCount,proto3" json:"msgCount"` MsgCount int64 `protobuf:"varint,1,opt,name=msgCount,proto3" json:"msgCount"`
UserCount int64 `protobuf:"varint,2,opt,name=userCount,proto3" json:"userCount"` UserCount int64 `protobuf:"varint,2,opt,name=userCount,proto3" json:"userCount"`
DateCount map[string]int64 `protobuf:"bytes,3,rep,name=dateCount,proto3" json:"dateCount" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` DateCount map[string]int64 `protobuf:"bytes,3,rep,name=dateCount,proto3" json:"dateCount" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
Users []*ActiveUser `protobuf:"bytes,4,rep,name=users,proto3" json:"users"` Users []*ActiveUser `protobuf:"bytes,4,rep,name=users,proto3" json:"users"`
} }
func (x *GetActiveUserResp) Reset() { func (x *GetActiveUserResp) Reset() {
@ -2181,9 +2183,9 @@ type GetActiveGroupReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Start int64 `protobuf:"varint,1,opt,name=start,proto3" json:"start"` Start int64 `protobuf:"varint,1,opt,name=start,proto3" json:"start"`
End int64 `protobuf:"varint,2,opt,name=end,proto3" json:"end"` End int64 `protobuf:"varint,2,opt,name=end,proto3" json:"end"`
Ase bool `protobuf:"varint,3,opt,name=ase,proto3" json:"ase"` Ase bool `protobuf:"varint,3,opt,name=ase,proto3" json:"ase"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination"` Pagination *sdkws.RequestPagination `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination"`
} }
@ -2252,7 +2254,7 @@ type ActiveGroup struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Group *sdkws.GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"` Group *sdkws.GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"`
Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count"` Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count"`
} }
@ -2307,10 +2309,10 @@ type GetActiveGroupResp struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
MsgCount int64 `protobuf:"varint,1,opt,name=msgCount,proto3" json:"msgCount"` MsgCount int64 `protobuf:"varint,1,opt,name=msgCount,proto3" json:"msgCount"`
GroupCount int64 `protobuf:"varint,2,opt,name=groupCount,proto3" json:"groupCount"` GroupCount int64 `protobuf:"varint,2,opt,name=groupCount,proto3" json:"groupCount"`
DateCount map[string]int64 `protobuf:"bytes,3,rep,name=dateCount,proto3" json:"dateCount" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` DateCount map[string]int64 `protobuf:"bytes,3,rep,name=dateCount,proto3" json:"dateCount" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
Groups []*ActiveGroup `protobuf:"bytes,4,rep,name=groups,proto3" json:"groups"` Groups []*ActiveGroup `protobuf:"bytes,4,rep,name=groups,proto3" json:"groups"`
} }
func (x *GetActiveGroupResp) Reset() { func (x *GetActiveGroupResp) Reset() {
@ -2378,12 +2380,12 @@ type SearchMessageReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
SendID string `protobuf:"bytes,1,opt,name=sendID,proto3" json:"sendID"` //发送者ID SendID string `protobuf:"bytes,1,opt,name=sendID,proto3" json:"sendID"` //发送者ID
RecvID string `protobuf:"bytes,2,opt,name=recvID,proto3" json:"recvID"` //接收者ID RecvID string `protobuf:"bytes,2,opt,name=recvID,proto3" json:"recvID"` //接收者ID
MsgType int32 `protobuf:"varint,3,opt,name=msgType,proto3" json:"msgType"` MsgType int32 `protobuf:"varint,3,opt,name=msgType,proto3" json:"msgType"`
SendTime string `protobuf:"bytes,4,opt,name=sendTime,proto3" json:"sendTime"` SendTime string `protobuf:"bytes,4,opt,name=sendTime,proto3" json:"sendTime"`
SessionType int32 `protobuf:"varint,5,opt,name=sessionType,proto3" json:"sessionType"` SessionType int32 `protobuf:"varint,5,opt,name=sessionType,proto3" json:"sessionType"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,6,opt,name=pagination,proto3" json:"pagination"` Pagination *sdkws.RequestPagination `protobuf:"bytes,6,opt,name=pagination,proto3" json:"pagination"`
} }
func (x *SearchMessageReq) Reset() { func (x *SearchMessageReq) Reset() {
@ -2465,7 +2467,7 @@ type SearchMessageResp struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
ChatLogs []*ChatLog `protobuf:"bytes,1,rep,name=chatLogs,proto3" json:"chatLogs"` ChatLogs []*ChatLog `protobuf:"bytes,1,rep,name=chatLogs,proto3" json:"chatLogs"`
ChatLogsNum int32 `protobuf:"varint,2,opt,name=chatLogsNum,proto3" json:"chatLogsNum"` ChatLogsNum int32 `protobuf:"varint,2,opt,name=chatLogsNum,proto3" json:"chatLogsNum"`
} }
@ -2520,29 +2522,29 @@ type ChatLog struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
ServerMsgID string `protobuf:"bytes,1,opt,name=serverMsgID,proto3" json:"serverMsgID"` ServerMsgID string `protobuf:"bytes,1,opt,name=serverMsgID,proto3" json:"serverMsgID"`
ClientMsgID string `protobuf:"bytes,2,opt,name=clientMsgID,proto3" json:"clientMsgID"` ClientMsgID string `protobuf:"bytes,2,opt,name=clientMsgID,proto3" json:"clientMsgID"`
SendID string `protobuf:"bytes,3,opt,name=sendID,proto3" json:"sendID"` SendID string `protobuf:"bytes,3,opt,name=sendID,proto3" json:"sendID"`
RecvID string `protobuf:"bytes,4,opt,name=recvID,proto3" json:"recvID"` RecvID string `protobuf:"bytes,4,opt,name=recvID,proto3" json:"recvID"`
GroupID string `protobuf:"bytes,5,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,5,opt,name=groupID,proto3" json:"groupID"`
RecvNickname string `protobuf:"bytes,6,opt,name=recvNickname,proto3" json:"recvNickname"` RecvNickname string `protobuf:"bytes,6,opt,name=recvNickname,proto3" json:"recvNickname"`
SenderPlatformID int32 `protobuf:"varint,7,opt,name=senderPlatformID,proto3" json:"senderPlatformID"` SenderPlatformID int32 `protobuf:"varint,7,opt,name=senderPlatformID,proto3" json:"senderPlatformID"`
SenderNickname string `protobuf:"bytes,8,opt,name=senderNickname,proto3" json:"senderNickname"` SenderNickname string `protobuf:"bytes,8,opt,name=senderNickname,proto3" json:"senderNickname"`
SenderFaceURL string `protobuf:"bytes,9,opt,name=senderFaceURL,proto3" json:"senderFaceURL"` SenderFaceURL string `protobuf:"bytes,9,opt,name=senderFaceURL,proto3" json:"senderFaceURL"`
GroupName string `protobuf:"bytes,10,opt,name=groupName,proto3" json:"groupName"` GroupName string `protobuf:"bytes,10,opt,name=groupName,proto3" json:"groupName"`
SessionType int32 `protobuf:"varint,11,opt,name=sessionType,proto3" json:"sessionType"` SessionType int32 `protobuf:"varint,11,opt,name=sessionType,proto3" json:"sessionType"`
MsgFrom int32 `protobuf:"varint,12,opt,name=msgFrom,proto3" json:"msgFrom"` MsgFrom int32 `protobuf:"varint,12,opt,name=msgFrom,proto3" json:"msgFrom"`
ContentType int32 `protobuf:"varint,13,opt,name=contentType,proto3" json:"contentType"` ContentType int32 `protobuf:"varint,13,opt,name=contentType,proto3" json:"contentType"`
Content string `protobuf:"bytes,14,opt,name=content,proto3" json:"content"` Content string `protobuf:"bytes,14,opt,name=content,proto3" json:"content"`
Status int32 `protobuf:"varint,15,opt,name=status,proto3" json:"status"` Status int32 `protobuf:"varint,15,opt,name=status,proto3" json:"status"`
SendTime int64 `protobuf:"varint,16,opt,name=sendTime,proto3" json:"sendTime"` SendTime int64 `protobuf:"varint,16,opt,name=sendTime,proto3" json:"sendTime"`
CreateTime int64 `protobuf:"varint,17,opt,name=createTime,proto3" json:"createTime"` CreateTime int64 `protobuf:"varint,17,opt,name=createTime,proto3" json:"createTime"`
Ex string `protobuf:"bytes,18,opt,name=ex,proto3" json:"ex"` Ex string `protobuf:"bytes,18,opt,name=ex,proto3" json:"ex"`
GroupFaceURL string `protobuf:"bytes,19,opt,name=groupFaceURL,proto3" json:"groupFaceURL"` GroupFaceURL string `protobuf:"bytes,19,opt,name=groupFaceURL,proto3" json:"groupFaceURL"`
GroupMemberCount uint32 `protobuf:"varint,20,opt,name=groupMemberCount,proto3" json:"groupMemberCount"` GroupMemberCount uint32 `protobuf:"varint,20,opt,name=groupMemberCount,proto3" json:"groupMemberCount"`
Seq int64 `protobuf:"varint,21,opt,name=seq,proto3" json:"seq"` Seq int64 `protobuf:"varint,21,opt,name=seq,proto3" json:"seq"`
GroupOwner string `protobuf:"bytes,22,opt,name=groupOwner,proto3" json:"groupOwner"` GroupOwner string `protobuf:"bytes,22,opt,name=groupOwner,proto3" json:"groupOwner"`
GroupType int32 `protobuf:"varint,23,opt,name=groupType,proto3" json:"groupType"` GroupType int32 `protobuf:"varint,23,opt,name=groupType,proto3" json:"groupType"`
} }
func (x *ChatLog) Reset() { func (x *ChatLog) Reset() {
@ -2744,7 +2746,7 @@ type BatchSendMessageReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
RecvIDList []string `protobuf:"bytes,1,rep,name=recvIDList,proto3" json:"recvIDList"` RecvIDList []string `protobuf:"bytes,1,rep,name=recvIDList,proto3" json:"recvIDList"`
MsgData *sdkws.MsgData `protobuf:"bytes,2,opt,name=msgData,proto3" json:"msgData"` MsgData *sdkws.MsgData `protobuf:"bytes,2,opt,name=msgData,proto3" json:"msgData"`
} }
func (x *BatchSendMessageReq) Reset() { func (x *BatchSendMessageReq) Reset() {

@ -16,6 +16,7 @@ package msggateway
import "github.com/OpenIMSDK/Open-IM-Server/pkg/errs" import "github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
// Check
func (x *OnlinePushMsgReq) Check() error { func (x *OnlinePushMsgReq) Check() error {
if x.MsgData == nil { if x.MsgData == nil {
return errs.ErrArgs.Wrap("MsgData is empty") return errs.ErrArgs.Wrap("MsgData is empty")
@ -26,9 +27,11 @@ func (x *OnlinePushMsgReq) Check() error {
if x.PushToUserID == "" { if x.PushToUserID == "" {
return errs.ErrArgs.Wrap("PushToUserID is empty") return errs.ErrArgs.Wrap("PushToUserID is empty")
} }
return nil return nil
} }
// Check
func (x *OnlineBatchPushOneMsgReq) Check() error { func (x *OnlineBatchPushOneMsgReq) Check() error {
if x.MsgData == nil { if x.MsgData == nil {
return errs.ErrArgs.Wrap("MsgData is empty") return errs.ErrArgs.Wrap("MsgData is empty")
@ -39,16 +42,20 @@ func (x *OnlineBatchPushOneMsgReq) Check() error {
if x.PushToUserIDs == nil { if x.PushToUserIDs == nil {
return errs.ErrArgs.Wrap("PushToUserIDs is empty") return errs.ErrArgs.Wrap("PushToUserIDs is empty")
} }
return nil return nil
} }
// Check
func (x *GetUsersOnlineStatusReq) Check() error { func (x *GetUsersOnlineStatusReq) Check() error {
if x.UserIDs == nil { if x.UserIDs == nil {
return errs.ErrArgs.Wrap("UserIDs is empty") return errs.ErrArgs.Wrap("UserIDs is empty")
} }
return nil return nil
} }
// Check
func (x *KickUserOfflineReq) Check() error { func (x *KickUserOfflineReq) Check() error {
if x.PlatformID < 1 || x.PlatformID > 9 { if x.PlatformID < 1 || x.PlatformID > 9 {
return errs.ErrArgs.Wrap("PlatformID is invalid") return errs.ErrArgs.Wrap("PlatformID is invalid")
@ -56,9 +63,11 @@ func (x *KickUserOfflineReq) Check() error {
if x.KickUserIDList == nil { if x.KickUserIDList == nil {
return errs.ErrArgs.Wrap("KickUserIDList is empty") return errs.ErrArgs.Wrap("KickUserIDList is empty")
} }
return nil return nil
} }
// Check
func (x *MultiTerminalLoginCheckReq) Check() error { func (x *MultiTerminalLoginCheckReq) Check() error {
if x.PlatformID < 1 || x.PlatformID > 9 { if x.PlatformID < 1 || x.PlatformID > 9 {
return errs.ErrArgs.Wrap("PlatformID is invalid") return errs.ErrArgs.Wrap("PlatformID is invalid")
@ -69,5 +78,6 @@ func (x *MultiTerminalLoginCheckReq) Check() error {
if x.Token == "" { if x.Token == "" {
return errs.ErrArgs.Wrap("Token is empty") return errs.ErrArgs.Wrap("Token is empty")
} }
return nil return nil
} }

@ -22,14 +22,16 @@ package msggateway
import ( import (
context "context" context "context"
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws" reflect "reflect"
sync "sync"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes" codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status" status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync" sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
) )
const ( const (
@ -44,7 +46,7 @@ type OnlinePushMsgReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
MsgData *sdkws.MsgData `protobuf:"bytes,1,opt,name=msgData,proto3" json:"msgData"` MsgData *sdkws.MsgData `protobuf:"bytes,1,opt,name=msgData,proto3" json:"msgData"`
PushToUserID string `protobuf:"bytes,2,opt,name=pushToUserID,proto3" json:"pushToUserID"` PushToUserID string `protobuf:"bytes,2,opt,name=pushToUserID,proto3" json:"pushToUserID"`
} }
@ -146,8 +148,8 @@ type SingleMsgToUserResults struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
Resp []*SingleMsgToUserPlatform `protobuf:"bytes,2,rep,name=resp,proto3" json:"resp"` Resp []*SingleMsgToUserPlatform `protobuf:"bytes,2,rep,name=resp,proto3" json:"resp"`
OnlinePush bool `protobuf:"varint,3,opt,name=onlinePush,proto3" json:"onlinePush"` OnlinePush bool `protobuf:"varint,3,opt,name=onlinePush,proto3" json:"onlinePush"`
} }
@ -209,7 +211,7 @@ type OnlineBatchPushOneMsgReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
MsgData *sdkws.MsgData `protobuf:"bytes,1,opt,name=msgData,proto3" json:"msgData"` MsgData *sdkws.MsgData `protobuf:"bytes,1,opt,name=msgData,proto3" json:"msgData"`
PushToUserIDs []string `protobuf:"bytes,2,rep,name=pushToUserIDs,proto3" json:"pushToUserIDs"` PushToUserIDs []string `protobuf:"bytes,2,rep,name=pushToUserIDs,proto3" json:"pushToUserIDs"`
} }
@ -311,8 +313,8 @@ type SingleMsgToUserPlatform struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
ResultCode int64 `protobuf:"varint,1,opt,name=ResultCode,proto3" json:"ResultCode"` ResultCode int64 `protobuf:"varint,1,opt,name=ResultCode,proto3" json:"ResultCode"`
RecvID string `protobuf:"bytes,2,opt,name=RecvID,proto3" json:"RecvID"` RecvID string `protobuf:"bytes,2,opt,name=RecvID,proto3" json:"RecvID"`
RecvPlatFormID int32 `protobuf:"varint,3,opt,name=RecvPlatFormID,proto3" json:"RecvPlatFormID"` RecvPlatFormID int32 `protobuf:"varint,3,opt,name=RecvPlatFormID,proto3" json:"RecvPlatFormID"`
} }
@ -422,7 +424,7 @@ type GetUsersOnlineStatusResp struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
SuccessResult []*GetUsersOnlineStatusResp_SuccessResult `protobuf:"bytes,1,rep,name=successResult,proto3" json:"successResult"` SuccessResult []*GetUsersOnlineStatusResp_SuccessResult `protobuf:"bytes,1,rep,name=successResult,proto3" json:"successResult"`
FailedResult []*GetUsersOnlineStatusResp_FailedDetail `protobuf:"bytes,2,rep,name=failedResult,proto3" json:"failedResult"` FailedResult []*GetUsersOnlineStatusResp_FailedDetail `protobuf:"bytes,2,rep,name=failedResult,proto3" json:"failedResult"`
} }
func (x *GetUsersOnlineStatusResp) Reset() { func (x *GetUsersOnlineStatusResp) Reset() {
@ -476,8 +478,8 @@ type SingleDetail struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status"` Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status"`
SinglePlatformToken []*SinglePlatformToken `protobuf:"bytes,3,rep,name=singlePlatformToken,proto3" json:"singlePlatformToken"` SinglePlatformToken []*SinglePlatformToken `protobuf:"bytes,3,rep,name=singlePlatformToken,proto3" json:"singlePlatformToken"`
} }
@ -540,8 +542,8 @@ type SinglePlatformToken struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform"` Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform"`
Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total"` Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total"`
Token []string `protobuf:"bytes,3,rep,name=token,proto3" json:"token"` Token []string `protobuf:"bytes,3,rep,name=token,proto3" json:"token"`
} }
func (x *SinglePlatformToken) Reset() { func (x *SinglePlatformToken) Reset() {
@ -602,7 +604,7 @@ type KickUserOfflineReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
PlatformID int32 `protobuf:"varint,1,opt,name=platformID,proto3" json:"platformID"` PlatformID int32 `protobuf:"varint,1,opt,name=platformID,proto3" json:"platformID"`
KickUserIDList []string `protobuf:"bytes,2,rep,name=kickUserIDList,proto3" json:"kickUserIDList"` KickUserIDList []string `protobuf:"bytes,2,rep,name=kickUserIDList,proto3" json:"kickUserIDList"`
} }
@ -695,9 +697,9 @@ type MultiTerminalLoginCheckReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
PlatformID int32 `protobuf:"varint,2,opt,name=platformID,proto3" json:"platformID"` PlatformID int32 `protobuf:"varint,2,opt,name=platformID,proto3" json:"platformID"`
Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token"` Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token"`
OperationID string `protobuf:"bytes,4,opt,name=operationID,proto3" json:"operationID"` OperationID string `protobuf:"bytes,4,opt,name=operationID,proto3" json:"operationID"`
} }
@ -804,11 +806,11 @@ type GetUsersOnlineStatusResp_SuccessDetail struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform"` Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform"`
Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status"` Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status"`
ConnID string `protobuf:"bytes,3,opt,name=connID,proto3" json:"connID"` ConnID string `protobuf:"bytes,3,opt,name=connID,proto3" json:"connID"`
IsBackground bool `protobuf:"varint,4,opt,name=isBackground,proto3" json:"isBackground"` IsBackground bool `protobuf:"varint,4,opt,name=isBackground,proto3" json:"isBackground"`
Token string `protobuf:"bytes,5,opt,name=token,proto3" json:"token"` Token string `protobuf:"bytes,5,opt,name=token,proto3" json:"token"`
} }
func (x *GetUsersOnlineStatusResp_SuccessDetail) Reset() { func (x *GetUsersOnlineStatusResp_SuccessDetail) Reset() {
@ -930,8 +932,8 @@ type GetUsersOnlineStatusResp_SuccessResult struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status"` Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status"`
DetailPlatformStatus []*GetUsersOnlineStatusResp_SuccessDetail `protobuf:"bytes,3,rep,name=detailPlatformStatus,proto3" json:"detailPlatformStatus"` DetailPlatformStatus []*GetUsersOnlineStatusResp_SuccessDetail `protobuf:"bytes,3,rep,name=detailPlatformStatus,proto3" json:"detailPlatformStatus"`
} }

@ -16,6 +16,7 @@ package push
import "github.com/OpenIMSDK/Open-IM-Server/pkg/errs" import "github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
// Check
func (x *PushMsgReq) Check() error { func (x *PushMsgReq) Check() error {
if x.MsgData == nil { if x.MsgData == nil {
return errs.ErrArgs.Wrap("MsgData is empty") return errs.ErrArgs.Wrap("MsgData is empty")
@ -26,9 +27,11 @@ func (x *PushMsgReq) Check() error {
if x.ConversationID == "" { if x.ConversationID == "" {
return errs.ErrArgs.Wrap("ConversationID is empty") return errs.ErrArgs.Wrap("ConversationID is empty")
} }
return nil return nil
} }
// Check
func (x *DelUserPushTokenReq) Check() error { func (x *DelUserPushTokenReq) Check() error {
if x.UserID == "" { if x.UserID == "" {
return errs.ErrArgs.Wrap("UserID is empty") return errs.ErrArgs.Wrap("UserID is empty")
@ -36,5 +39,6 @@ func (x *DelUserPushTokenReq) Check() error {
if x.PlatformID < 1 || x.PlatformID > 9 { if x.PlatformID < 1 || x.PlatformID > 9 {
return errs.ErrArgs.Wrap("PlatformID is invalid") return errs.ErrArgs.Wrap("PlatformID is invalid")
} }
return nil return nil
} }

@ -22,14 +22,16 @@ package push
import ( import (
context "context" context "context"
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws" reflect "reflect"
sync "sync"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes" codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status" status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync" sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
) )
const ( const (
@ -44,7 +46,7 @@ type PushMsgReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
MsgData *sdkws.MsgData `protobuf:"bytes,1,opt,name=msgData,proto3" json:"msgData"` MsgData *sdkws.MsgData `protobuf:"bytes,1,opt,name=msgData,proto3" json:"msgData"`
ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"` ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"`
} }
@ -137,7 +139,7 @@ type DelUserPushTokenReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
PlatformID int32 `protobuf:"varint,2,opt,name=platformID,proto3" json:"platformID"` PlatformID int32 `protobuf:"varint,2,opt,name=platformID,proto3" json:"platformID"`
} }

@ -19,6 +19,7 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs" "github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
) )
// Check
func (x *MsgData) Check() error { func (x *MsgData) Check() error {
if x.SendID == "" { if x.SendID == "" {
return errs.ErrArgs.Wrap("sendID is empty") return errs.ErrArgs.Wrap("sendID is empty")
@ -42,5 +43,6 @@ func (x *MsgData) Check() error {
return errs.ErrArgs.Wrap("GroupID is empty") return errs.ErrArgs.Wrap("GroupID is empty")
} }
} }
return nil return nil
} }

@ -21,11 +21,13 @@
package sdkws package sdkws
import ( import (
wrapperspb "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/wrapperspb"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect" reflect "reflect"
sync "sync" sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
wrapperspb "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/wrapperspb"
) )
const ( const (
@ -87,23 +89,23 @@ type GroupInfo struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"`
GroupName string `protobuf:"bytes,2,opt,name=groupName,proto3" json:"groupName"` GroupName string `protobuf:"bytes,2,opt,name=groupName,proto3" json:"groupName"`
Notification string `protobuf:"bytes,3,opt,name=notification,proto3" json:"notification"` Notification string `protobuf:"bytes,3,opt,name=notification,proto3" json:"notification"`
Introduction string `protobuf:"bytes,4,opt,name=introduction,proto3" json:"introduction"` Introduction string `protobuf:"bytes,4,opt,name=introduction,proto3" json:"introduction"`
FaceURL string `protobuf:"bytes,5,opt,name=faceURL,proto3" json:"faceURL"` FaceURL string `protobuf:"bytes,5,opt,name=faceURL,proto3" json:"faceURL"`
OwnerUserID string `protobuf:"bytes,6,opt,name=ownerUserID,proto3" json:"ownerUserID"` OwnerUserID string `protobuf:"bytes,6,opt,name=ownerUserID,proto3" json:"ownerUserID"`
CreateTime int64 `protobuf:"varint,7,opt,name=createTime,proto3" json:"createTime"` CreateTime int64 `protobuf:"varint,7,opt,name=createTime,proto3" json:"createTime"`
MemberCount uint32 `protobuf:"varint,8,opt,name=memberCount,proto3" json:"memberCount"` MemberCount uint32 `protobuf:"varint,8,opt,name=memberCount,proto3" json:"memberCount"`
Ex string `protobuf:"bytes,9,opt,name=ex,proto3" json:"ex"` Ex string `protobuf:"bytes,9,opt,name=ex,proto3" json:"ex"`
Status int32 `protobuf:"varint,10,opt,name=status,proto3" json:"status"` Status int32 `protobuf:"varint,10,opt,name=status,proto3" json:"status"`
CreatorUserID string `protobuf:"bytes,11,opt,name=creatorUserID,proto3" json:"creatorUserID"` CreatorUserID string `protobuf:"bytes,11,opt,name=creatorUserID,proto3" json:"creatorUserID"`
GroupType int32 `protobuf:"varint,12,opt,name=groupType,proto3" json:"groupType"` GroupType int32 `protobuf:"varint,12,opt,name=groupType,proto3" json:"groupType"`
NeedVerification int32 `protobuf:"varint,13,opt,name=needVerification,proto3" json:"needVerification"` NeedVerification int32 `protobuf:"varint,13,opt,name=needVerification,proto3" json:"needVerification"`
LookMemberInfo int32 `protobuf:"varint,14,opt,name=lookMemberInfo,proto3" json:"lookMemberInfo"` LookMemberInfo int32 `protobuf:"varint,14,opt,name=lookMemberInfo,proto3" json:"lookMemberInfo"`
ApplyMemberFriend int32 `protobuf:"varint,15,opt,name=applyMemberFriend,proto3" json:"applyMemberFriend"` ApplyMemberFriend int32 `protobuf:"varint,15,opt,name=applyMemberFriend,proto3" json:"applyMemberFriend"`
NotificationUpdateTime int64 `protobuf:"varint,16,opt,name=notificationUpdateTime,proto3" json:"notificationUpdateTime"` NotificationUpdateTime int64 `protobuf:"varint,16,opt,name=notificationUpdateTime,proto3" json:"notificationUpdateTime"`
NotificationUserID string `protobuf:"bytes,17,opt,name=notificationUserID,proto3" json:"notificationUserID"` NotificationUserID string `protobuf:"bytes,17,opt,name=notificationUserID,proto3" json:"notificationUserID"`
} }
func (x *GroupInfo) Reset() { func (x *GroupInfo) Reset() {
@ -262,14 +264,14 @@ type GroupInfoForSet struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"`
GroupName string `protobuf:"bytes,2,opt,name=groupName,proto3" json:"groupName"` GroupName string `protobuf:"bytes,2,opt,name=groupName,proto3" json:"groupName"`
Notification string `protobuf:"bytes,3,opt,name=notification,proto3" json:"notification"` Notification string `protobuf:"bytes,3,opt,name=notification,proto3" json:"notification"`
Introduction string `protobuf:"bytes,4,opt,name=introduction,proto3" json:"introduction"` Introduction string `protobuf:"bytes,4,opt,name=introduction,proto3" json:"introduction"`
FaceURL string `protobuf:"bytes,5,opt,name=faceURL,proto3" json:"faceURL"` FaceURL string `protobuf:"bytes,5,opt,name=faceURL,proto3" json:"faceURL"`
Ex string `protobuf:"bytes,6,opt,name=ex,proto3" json:"ex"` Ex string `protobuf:"bytes,6,opt,name=ex,proto3" json:"ex"`
NeedVerification *wrapperspb.Int32Value `protobuf:"bytes,7,opt,name=needVerification,proto3" json:"needVerification"` NeedVerification *wrapperspb.Int32Value `protobuf:"bytes,7,opt,name=needVerification,proto3" json:"needVerification"`
LookMemberInfo *wrapperspb.Int32Value `protobuf:"bytes,8,opt,name=lookMemberInfo,proto3" json:"lookMemberInfo"` LookMemberInfo *wrapperspb.Int32Value `protobuf:"bytes,8,opt,name=lookMemberInfo,proto3" json:"lookMemberInfo"`
ApplyMemberFriend *wrapperspb.Int32Value `protobuf:"bytes,9,opt,name=applyMemberFriend,proto3" json:"applyMemberFriend"` ApplyMemberFriend *wrapperspb.Int32Value `protobuf:"bytes,9,opt,name=applyMemberFriend,proto3" json:"applyMemberFriend"`
} }
@ -373,18 +375,18 @@ type GroupMemberFullInfo struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID"`
UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"`
RoleLevel int32 `protobuf:"varint,3,opt,name=roleLevel,proto3" json:"roleLevel"` RoleLevel int32 `protobuf:"varint,3,opt,name=roleLevel,proto3" json:"roleLevel"`
JoinTime int64 `protobuf:"varint,4,opt,name=joinTime,proto3" json:"joinTime"` JoinTime int64 `protobuf:"varint,4,opt,name=joinTime,proto3" json:"joinTime"`
Nickname string `protobuf:"bytes,5,opt,name=nickname,proto3" json:"nickname"` Nickname string `protobuf:"bytes,5,opt,name=nickname,proto3" json:"nickname"`
FaceURL string `protobuf:"bytes,6,opt,name=faceURL,proto3" json:"faceURL"` FaceURL string `protobuf:"bytes,6,opt,name=faceURL,proto3" json:"faceURL"`
AppMangerLevel int32 `protobuf:"varint,7,opt,name=appMangerLevel,proto3" json:"appMangerLevel"` //if >0 AppMangerLevel int32 `protobuf:"varint,7,opt,name=appMangerLevel,proto3" json:"appMangerLevel"` //if >0
JoinSource int32 `protobuf:"varint,8,opt,name=joinSource,proto3" json:"joinSource"` JoinSource int32 `protobuf:"varint,8,opt,name=joinSource,proto3" json:"joinSource"`
OperatorUserID string `protobuf:"bytes,9,opt,name=operatorUserID,proto3" json:"operatorUserID"` OperatorUserID string `protobuf:"bytes,9,opt,name=operatorUserID,proto3" json:"operatorUserID"`
Ex string `protobuf:"bytes,10,opt,name=ex,proto3" json:"ex"` Ex string `protobuf:"bytes,10,opt,name=ex,proto3" json:"ex"`
MuteEndTime int64 `protobuf:"varint,11,opt,name=muteEndTime,proto3" json:"muteEndTime"` MuteEndTime int64 `protobuf:"varint,11,opt,name=muteEndTime,proto3" json:"muteEndTime"`
InviterUserID string `protobuf:"bytes,12,opt,name=inviterUserID,proto3" json:"inviterUserID"` InviterUserID string `protobuf:"bytes,12,opt,name=inviterUserID,proto3" json:"inviterUserID"`
} }
func (x *GroupMemberFullInfo) Reset() { func (x *GroupMemberFullInfo) Reset() {
@ -508,10 +510,10 @@ type PublicUserInfo struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
Nickname string `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname"` Nickname string `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname"`
FaceURL string `protobuf:"bytes,3,opt,name=faceURL,proto3" json:"faceURL"` FaceURL string `protobuf:"bytes,3,opt,name=faceURL,proto3" json:"faceURL"`
Ex string `protobuf:"bytes,4,opt,name=ex,proto3" json:"ex"` Ex string `protobuf:"bytes,4,opt,name=ex,proto3" json:"ex"`
} }
func (x *PublicUserInfo) Reset() { func (x *PublicUserInfo) Reset() {
@ -579,12 +581,12 @@ type UserInfo struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
Nickname string `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname"` Nickname string `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname"`
FaceURL string `protobuf:"bytes,3,opt,name=faceURL,proto3" json:"faceURL"` FaceURL string `protobuf:"bytes,3,opt,name=faceURL,proto3" json:"faceURL"`
Ex string `protobuf:"bytes,4,opt,name=ex,proto3" json:"ex"` Ex string `protobuf:"bytes,4,opt,name=ex,proto3" json:"ex"`
CreateTime int64 `protobuf:"varint,5,opt,name=createTime,proto3" json:"createTime"` CreateTime int64 `protobuf:"varint,5,opt,name=createTime,proto3" json:"createTime"`
AppMangerLevel int32 `protobuf:"varint,6,opt,name=appMangerLevel,proto3" json:"appMangerLevel"` AppMangerLevel int32 `protobuf:"varint,6,opt,name=appMangerLevel,proto3" json:"appMangerLevel"`
GlobalRecvMsgOpt int32 `protobuf:"varint,7,opt,name=globalRecvMsgOpt,proto3" json:"globalRecvMsgOpt"` GlobalRecvMsgOpt int32 `protobuf:"varint,7,opt,name=globalRecvMsgOpt,proto3" json:"globalRecvMsgOpt"`
} }
@ -674,13 +676,13 @@ type FriendInfo struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID,proto3" json:"ownerUserID"` OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID,proto3" json:"ownerUserID"`
Remark string `protobuf:"bytes,2,opt,name=remark,proto3" json:"remark"` Remark string `protobuf:"bytes,2,opt,name=remark,proto3" json:"remark"`
CreateTime int64 `protobuf:"varint,3,opt,name=createTime,proto3" json:"createTime"` CreateTime int64 `protobuf:"varint,3,opt,name=createTime,proto3" json:"createTime"`
FriendUser *UserInfo `protobuf:"bytes,4,opt,name=friendUser,proto3" json:"friendUser"` FriendUser *UserInfo `protobuf:"bytes,4,opt,name=friendUser,proto3" json:"friendUser"`
AddSource int32 `protobuf:"varint,5,opt,name=addSource,proto3" json:"addSource"` AddSource int32 `protobuf:"varint,5,opt,name=addSource,proto3" json:"addSource"`
OperatorUserID string `protobuf:"bytes,6,opt,name=operatorUserID,proto3" json:"operatorUserID"` OperatorUserID string `protobuf:"bytes,6,opt,name=operatorUserID,proto3" json:"operatorUserID"`
Ex string `protobuf:"bytes,7,opt,name=ex,proto3" json:"ex"` Ex string `protobuf:"bytes,7,opt,name=ex,proto3" json:"ex"`
} }
func (x *FriendInfo) Reset() { func (x *FriendInfo) Reset() {
@ -769,12 +771,12 @@ type BlackInfo struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID,proto3" json:"ownerUserID"` OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID,proto3" json:"ownerUserID"`
CreateTime int64 `protobuf:"varint,2,opt,name=createTime,proto3" json:"createTime"` CreateTime int64 `protobuf:"varint,2,opt,name=createTime,proto3" json:"createTime"`
BlackUserInfo *PublicUserInfo `protobuf:"bytes,3,opt,name=blackUserInfo,proto3" json:"blackUserInfo"` BlackUserInfo *PublicUserInfo `protobuf:"bytes,3,opt,name=blackUserInfo,proto3" json:"blackUserInfo"`
AddSource int32 `protobuf:"varint,4,opt,name=addSource,proto3" json:"addSource"` AddSource int32 `protobuf:"varint,4,opt,name=addSource,proto3" json:"addSource"`
OperatorUserID string `protobuf:"bytes,5,opt,name=operatorUserID,proto3" json:"operatorUserID"` OperatorUserID string `protobuf:"bytes,5,opt,name=operatorUserID,proto3" json:"operatorUserID"`
Ex string `protobuf:"bytes,6,opt,name=ex,proto3" json:"ex"` Ex string `protobuf:"bytes,6,opt,name=ex,proto3" json:"ex"`
} }
func (x *BlackInfo) Reset() { func (x *BlackInfo) Reset() {
@ -856,16 +858,16 @@ type GroupRequest struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserInfo *PublicUserInfo `protobuf:"bytes,1,opt,name=userInfo,proto3" json:"userInfo"` UserInfo *PublicUserInfo `protobuf:"bytes,1,opt,name=userInfo,proto3" json:"userInfo"`
GroupInfo *GroupInfo `protobuf:"bytes,2,opt,name=groupInfo,proto3" json:"groupInfo"` GroupInfo *GroupInfo `protobuf:"bytes,2,opt,name=groupInfo,proto3" json:"groupInfo"`
HandleResult int32 `protobuf:"varint,3,opt,name=handleResult,proto3" json:"handleResult"` HandleResult int32 `protobuf:"varint,3,opt,name=handleResult,proto3" json:"handleResult"`
ReqMsg string `protobuf:"bytes,4,opt,name=reqMsg,proto3" json:"reqMsg"` ReqMsg string `protobuf:"bytes,4,opt,name=reqMsg,proto3" json:"reqMsg"`
HandleMsg string `protobuf:"bytes,5,opt,name=handleMsg,proto3" json:"handleMsg"` HandleMsg string `protobuf:"bytes,5,opt,name=handleMsg,proto3" json:"handleMsg"`
ReqTime int64 `protobuf:"varint,6,opt,name=reqTime,proto3" json:"reqTime"` ReqTime int64 `protobuf:"varint,6,opt,name=reqTime,proto3" json:"reqTime"`
HandleUserID string `protobuf:"bytes,7,opt,name=handleUserID,proto3" json:"handleUserID"` HandleUserID string `protobuf:"bytes,7,opt,name=handleUserID,proto3" json:"handleUserID"`
HandleTime int64 `protobuf:"varint,8,opt,name=handleTime,proto3" json:"handleTime"` HandleTime int64 `protobuf:"varint,8,opt,name=handleTime,proto3" json:"handleTime"`
Ex string `protobuf:"bytes,9,opt,name=ex,proto3" json:"ex"` Ex string `protobuf:"bytes,9,opt,name=ex,proto3" json:"ex"`
JoinSource int32 `protobuf:"varint,10,opt,name=joinSource,proto3" json:"joinSource"` JoinSource int32 `protobuf:"varint,10,opt,name=joinSource,proto3" json:"joinSource"`
InviterUserID string `protobuf:"bytes,11,opt,name=inviterUserID,proto3" json:"inviterUserID"` InviterUserID string `protobuf:"bytes,11,opt,name=inviterUserID,proto3" json:"inviterUserID"`
} }
@ -983,19 +985,19 @@ type FriendRequest struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
FromUserID string `protobuf:"bytes,1,opt,name=fromUserID,proto3" json:"fromUserID"` FromUserID string `protobuf:"bytes,1,opt,name=fromUserID,proto3" json:"fromUserID"`
FromNickname string `protobuf:"bytes,2,opt,name=fromNickname,proto3" json:"fromNickname"` FromNickname string `protobuf:"bytes,2,opt,name=fromNickname,proto3" json:"fromNickname"`
FromFaceURL string `protobuf:"bytes,3,opt,name=fromFaceURL,proto3" json:"fromFaceURL"` FromFaceURL string `protobuf:"bytes,3,opt,name=fromFaceURL,proto3" json:"fromFaceURL"`
ToUserID string `protobuf:"bytes,4,opt,name=toUserID,proto3" json:"toUserID"` ToUserID string `protobuf:"bytes,4,opt,name=toUserID,proto3" json:"toUserID"`
ToNickname string `protobuf:"bytes,5,opt,name=toNickname,proto3" json:"toNickname"` ToNickname string `protobuf:"bytes,5,opt,name=toNickname,proto3" json:"toNickname"`
ToFaceURL string `protobuf:"bytes,6,opt,name=toFaceURL,proto3" json:"toFaceURL"` ToFaceURL string `protobuf:"bytes,6,opt,name=toFaceURL,proto3" json:"toFaceURL"`
HandleResult int32 `protobuf:"varint,7,opt,name=handleResult,proto3" json:"handleResult"` HandleResult int32 `protobuf:"varint,7,opt,name=handleResult,proto3" json:"handleResult"`
ReqMsg string `protobuf:"bytes,8,opt,name=reqMsg,proto3" json:"reqMsg"` ReqMsg string `protobuf:"bytes,8,opt,name=reqMsg,proto3" json:"reqMsg"`
CreateTime int64 `protobuf:"varint,9,opt,name=createTime,proto3" json:"createTime"` CreateTime int64 `protobuf:"varint,9,opt,name=createTime,proto3" json:"createTime"`
HandlerUserID string `protobuf:"bytes,10,opt,name=handlerUserID,proto3" json:"handlerUserID"` HandlerUserID string `protobuf:"bytes,10,opt,name=handlerUserID,proto3" json:"handlerUserID"`
HandleMsg string `protobuf:"bytes,11,opt,name=handleMsg,proto3" json:"handleMsg"` HandleMsg string `protobuf:"bytes,11,opt,name=handleMsg,proto3" json:"handleMsg"`
HandleTime int64 `protobuf:"varint,12,opt,name=handleTime,proto3" json:"handleTime"` HandleTime int64 `protobuf:"varint,12,opt,name=handleTime,proto3" json:"handleTime"`
Ex string `protobuf:"bytes,13,opt,name=ex,proto3" json:"ex"` Ex string `protobuf:"bytes,13,opt,name=ex,proto3" json:"ex"`
} }
func (x *FriendRequest) Reset() { func (x *FriendRequest) Reset() {
@ -1126,8 +1128,8 @@ type PullMessageBySeqsReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
SeqRanges []*SeqRange `protobuf:"bytes,2,rep,name=seqRanges,proto3" json:"seqRanges"` SeqRanges []*SeqRange `protobuf:"bytes,2,rep,name=seqRanges,proto3" json:"seqRanges"`
Order PullOrder `protobuf:"varint,3,opt,name=order,proto3,enum=OpenIMServer.sdkws.PullOrder" json:"order"` Order PullOrder `protobuf:"varint,3,opt,name=order,proto3,enum=OpenIMServer.sdkws.PullOrder" json:"order"`
} }
@ -1190,9 +1192,9 @@ type SeqRange struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"` ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"`
Begin int64 `protobuf:"varint,2,opt,name=begin,proto3" json:"begin"` Begin int64 `protobuf:"varint,2,opt,name=begin,proto3" json:"begin"`
End int64 `protobuf:"varint,3,opt,name=end,proto3" json:"end"` End int64 `protobuf:"varint,3,opt,name=end,proto3" json:"end"`
Num int64 `protobuf:"varint,4,opt,name=num,proto3" json:"num"` Num int64 `protobuf:"varint,4,opt,name=num,proto3" json:"num"`
} }
func (x *SeqRange) Reset() { func (x *SeqRange) Reset() {
@ -1260,7 +1262,7 @@ type PullMsgs struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Msgs []*MsgData `protobuf:"bytes,1,rep,name=Msgs,proto3" json:"Msgs"` Msgs []*MsgData `protobuf:"bytes,1,rep,name=Msgs,proto3" json:"Msgs"`
IsEnd bool `protobuf:"varint,2,opt,name=isEnd,proto3" json:"isEnd"` IsEnd bool `protobuf:"varint,2,opt,name=isEnd,proto3" json:"isEnd"`
} }
@ -1315,7 +1317,7 @@ type PullMessageBySeqsResp struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Msgs map[string]*PullMsgs `protobuf:"bytes,1,rep,name=msgs,proto3" json:"msgs" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Msgs map[string]*PullMsgs `protobuf:"bytes,1,rep,name=msgs,proto3" json:"msgs" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
NotificationMsgs map[string]*PullMsgs `protobuf:"bytes,2,rep,name=notificationMsgs,proto3" json:"notificationMsgs" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` NotificationMsgs map[string]*PullMsgs `protobuf:"bytes,2,rep,name=notificationMsgs,proto3" json:"notificationMsgs" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
} }
@ -1474,7 +1476,7 @@ type UserSendMsgResp struct {
ServerMsgID string `protobuf:"bytes,1,opt,name=serverMsgID,proto3" json:"serverMsgID"` ServerMsgID string `protobuf:"bytes,1,opt,name=serverMsgID,proto3" json:"serverMsgID"`
ClientMsgID string `protobuf:"bytes,2,opt,name=clientMsgID,proto3" json:"clientMsgID"` ClientMsgID string `protobuf:"bytes,2,opt,name=clientMsgID,proto3" json:"clientMsgID"`
SendTime int64 `protobuf:"varint,3,opt,name=sendTime,proto3" json:"sendTime"` SendTime int64 `protobuf:"varint,3,opt,name=sendTime,proto3" json:"sendTime"`
} }
func (x *UserSendMsgResp) Reset() { func (x *UserSendMsgResp) Reset() {
@ -1535,28 +1537,28 @@ type MsgData struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
SendID string `protobuf:"bytes,1,opt,name=sendID,proto3" json:"sendID"` SendID string `protobuf:"bytes,1,opt,name=sendID,proto3" json:"sendID"`
RecvID string `protobuf:"bytes,2,opt,name=recvID,proto3" json:"recvID"` RecvID string `protobuf:"bytes,2,opt,name=recvID,proto3" json:"recvID"`
GroupID string `protobuf:"bytes,3,opt,name=groupID,proto3" json:"groupID"` GroupID string `protobuf:"bytes,3,opt,name=groupID,proto3" json:"groupID"`
ClientMsgID string `protobuf:"bytes,4,opt,name=clientMsgID,proto3" json:"clientMsgID"` ClientMsgID string `protobuf:"bytes,4,opt,name=clientMsgID,proto3" json:"clientMsgID"`
ServerMsgID string `protobuf:"bytes,5,opt,name=serverMsgID,proto3" json:"serverMsgID"` ServerMsgID string `protobuf:"bytes,5,opt,name=serverMsgID,proto3" json:"serverMsgID"`
SenderPlatformID int32 `protobuf:"varint,6,opt,name=senderPlatformID,proto3" json:"senderPlatformID"` SenderPlatformID int32 `protobuf:"varint,6,opt,name=senderPlatformID,proto3" json:"senderPlatformID"`
SenderNickname string `protobuf:"bytes,7,opt,name=senderNickname,proto3" json:"senderNickname"` SenderNickname string `protobuf:"bytes,7,opt,name=senderNickname,proto3" json:"senderNickname"`
SenderFaceURL string `protobuf:"bytes,8,opt,name=senderFaceURL,proto3" json:"senderFaceURL"` SenderFaceURL string `protobuf:"bytes,8,opt,name=senderFaceURL,proto3" json:"senderFaceURL"`
SessionType int32 `protobuf:"varint,9,opt,name=sessionType,proto3" json:"sessionType"` SessionType int32 `protobuf:"varint,9,opt,name=sessionType,proto3" json:"sessionType"`
MsgFrom int32 `protobuf:"varint,10,opt,name=msgFrom,proto3" json:"msgFrom"` MsgFrom int32 `protobuf:"varint,10,opt,name=msgFrom,proto3" json:"msgFrom"`
ContentType int32 `protobuf:"varint,11,opt,name=contentType,proto3" json:"contentType"` ContentType int32 `protobuf:"varint,11,opt,name=contentType,proto3" json:"contentType"`
Content []byte `protobuf:"bytes,12,opt,name=content,proto3" json:"content"` Content []byte `protobuf:"bytes,12,opt,name=content,proto3" json:"content"`
Seq int64 `protobuf:"varint,14,opt,name=seq,proto3" json:"seq"` Seq int64 `protobuf:"varint,14,opt,name=seq,proto3" json:"seq"`
SendTime int64 `protobuf:"varint,15,opt,name=sendTime,proto3" json:"sendTime"` SendTime int64 `protobuf:"varint,15,opt,name=sendTime,proto3" json:"sendTime"`
CreateTime int64 `protobuf:"varint,16,opt,name=createTime,proto3" json:"createTime"` CreateTime int64 `protobuf:"varint,16,opt,name=createTime,proto3" json:"createTime"`
Status int32 `protobuf:"varint,17,opt,name=status,proto3" json:"status"` Status int32 `protobuf:"varint,17,opt,name=status,proto3" json:"status"`
IsRead bool `protobuf:"varint,18,opt,name=isRead,proto3" json:"isRead"` IsRead bool `protobuf:"varint,18,opt,name=isRead,proto3" json:"isRead"`
Options map[string]bool `protobuf:"bytes,19,rep,name=options,proto3" json:"options" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` Options map[string]bool `protobuf:"bytes,19,rep,name=options,proto3" json:"options" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,20,opt,name=offlinePushInfo,proto3" json:"offlinePushInfo"` OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,20,opt,name=offlinePushInfo,proto3" json:"offlinePushInfo"`
AtUserIDList []string `protobuf:"bytes,21,rep,name=atUserIDList,proto3" json:"atUserIDList"` AtUserIDList []string `protobuf:"bytes,21,rep,name=atUserIDList,proto3" json:"atUserIDList"`
AttachedInfo string `protobuf:"bytes,22,opt,name=attachedInfo,proto3" json:"attachedInfo"` AttachedInfo string `protobuf:"bytes,22,opt,name=attachedInfo,proto3" json:"attachedInfo"`
Ex string `protobuf:"bytes,23,opt,name=ex,proto3" json:"ex"` Ex string `protobuf:"bytes,23,opt,name=ex,proto3" json:"ex"`
} }
func (x *MsgData) Reset() { func (x *MsgData) Reset() {
@ -1750,7 +1752,7 @@ type PushMessages struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Msgs map[string]*PullMsgs `protobuf:"bytes,1,rep,name=msgs,proto3" json:"msgs" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Msgs map[string]*PullMsgs `protobuf:"bytes,1,rep,name=msgs,proto3" json:"msgs" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
NotificationMsgs map[string]*PullMsgs `protobuf:"bytes,2,rep,name=notificationMsgs,proto3" json:"notificationMsgs" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` NotificationMsgs map[string]*PullMsgs `protobuf:"bytes,2,rep,name=notificationMsgs,proto3" json:"notificationMsgs" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
} }
@ -1805,12 +1807,12 @@ type OfflinePushInfo struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title"` Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title"`
Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc"` Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc"`
Ex string `protobuf:"bytes,3,opt,name=ex,proto3" json:"ex"` Ex string `protobuf:"bytes,3,opt,name=ex,proto3" json:"ex"`
IOSPushSound string `protobuf:"bytes,4,opt,name=iOSPushSound,proto3" json:"iOSPushSound"` IOSPushSound string `protobuf:"bytes,4,opt,name=iOSPushSound,proto3" json:"iOSPushSound"`
IOSBadgeCount bool `protobuf:"varint,5,opt,name=iOSBadgeCount,proto3" json:"iOSBadgeCount"` IOSBadgeCount bool `protobuf:"varint,5,opt,name=iOSBadgeCount,proto3" json:"iOSBadgeCount"`
SignalInfo string `protobuf:"bytes,6,opt,name=signalInfo,proto3" json:"signalInfo"` SignalInfo string `protobuf:"bytes,6,opt,name=signalInfo,proto3" json:"signalInfo"`
} }
func (x *OfflinePushInfo) Reset() { func (x *OfflinePushInfo) Reset() {
@ -1892,9 +1894,9 @@ type TipsComm struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Detail []byte `protobuf:"bytes,1,opt,name=detail,proto3" json:"detail"` Detail []byte `protobuf:"bytes,1,opt,name=detail,proto3" json:"detail"`
DefaultTips string `protobuf:"bytes,2,opt,name=defaultTips,proto3" json:"defaultTips"` DefaultTips string `protobuf:"bytes,2,opt,name=defaultTips,proto3" json:"defaultTips"`
JsonDetail string `protobuf:"bytes,3,opt,name=jsonDetail,proto3" json:"jsonDetail"` JsonDetail string `protobuf:"bytes,3,opt,name=jsonDetail,proto3" json:"jsonDetail"`
} }
func (x *TipsComm) Reset() { func (x *TipsComm) Reset() {
@ -1956,9 +1958,9 @@ type GroupCreatedTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"` Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"`
OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"` OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"`
MemberList []*GroupMemberFullInfo `protobuf:"bytes,3,rep,name=memberList,proto3" json:"memberList"` MemberList []*GroupMemberFullInfo `protobuf:"bytes,3,rep,name=memberList,proto3" json:"memberList"`
OperationTime int64 `protobuf:"varint,4,opt,name=operationTime,proto3" json:"operationTime"` OperationTime int64 `protobuf:"varint,4,opt,name=operationTime,proto3" json:"operationTime"`
GroupOwnerUser *GroupMemberFullInfo `protobuf:"bytes,5,opt,name=groupOwnerUser,proto3" json:"groupOwnerUser"` GroupOwnerUser *GroupMemberFullInfo `protobuf:"bytes,5,opt,name=groupOwnerUser,proto3" json:"groupOwnerUser"`
} }
@ -2036,9 +2038,9 @@ type GroupInfoSetTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
OpUser *GroupMemberFullInfo `protobuf:"bytes,1,opt,name=opUser,proto3" json:"opUser"` //who do this OpUser *GroupMemberFullInfo `protobuf:"bytes,1,opt,name=opUser,proto3" json:"opUser"` //who do this
MuteTime int64 `protobuf:"varint,2,opt,name=muteTime,proto3" json:"muteTime"` MuteTime int64 `protobuf:"varint,2,opt,name=muteTime,proto3" json:"muteTime"`
Group *GroupInfo `protobuf:"bytes,3,opt,name=group,proto3" json:"group"` Group *GroupInfo `protobuf:"bytes,3,opt,name=group,proto3" json:"group"`
} }
func (x *GroupInfoSetTips) Reset() { func (x *GroupInfoSetTips) Reset() {
@ -2100,7 +2102,7 @@ type GroupInfoSetNameTips struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
OpUser *GroupMemberFullInfo `protobuf:"bytes,1,opt,name=opUser,proto3" json:"opUser"` //who do this OpUser *GroupMemberFullInfo `protobuf:"bytes,1,opt,name=opUser,proto3" json:"opUser"` //who do this
Group *GroupInfo `protobuf:"bytes,2,opt,name=group,proto3" json:"group"` Group *GroupInfo `protobuf:"bytes,2,opt,name=group,proto3" json:"group"`
} }
func (x *GroupInfoSetNameTips) Reset() { func (x *GroupInfoSetNameTips) Reset() {
@ -2155,7 +2157,7 @@ type GroupInfoSetAnnouncementTips struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
OpUser *GroupMemberFullInfo `protobuf:"bytes,1,opt,name=opUser,proto3" json:"opUser"` //who do this OpUser *GroupMemberFullInfo `protobuf:"bytes,1,opt,name=opUser,proto3" json:"opUser"` //who do this
Group *GroupInfo `protobuf:"bytes,2,opt,name=group,proto3" json:"group"` Group *GroupInfo `protobuf:"bytes,2,opt,name=group,proto3" json:"group"`
} }
func (x *GroupInfoSetAnnouncementTips) Reset() { func (x *GroupInfoSetAnnouncementTips) Reset() {
@ -2210,9 +2212,9 @@ type JoinGroupApplicationTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"` Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"`
Applicant *PublicUserInfo `protobuf:"bytes,2,opt,name=applicant,proto3" json:"applicant"` Applicant *PublicUserInfo `protobuf:"bytes,2,opt,name=applicant,proto3" json:"applicant"`
ReqMsg string `protobuf:"bytes,3,opt,name=reqMsg,proto3" json:"reqMsg"` ReqMsg string `protobuf:"bytes,3,opt,name=reqMsg,proto3" json:"reqMsg"`
} }
func (x *JoinGroupApplicationTips) Reset() { func (x *JoinGroupApplicationTips) Reset() {
@ -2276,8 +2278,8 @@ type MemberQuitTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"` Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"`
QuitUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=quitUser,proto3" json:"quitUser"` QuitUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=quitUser,proto3" json:"quitUser"`
OperationTime int64 `protobuf:"varint,3,opt,name=operationTime,proto3" json:"operationTime"` OperationTime int64 `protobuf:"varint,3,opt,name=operationTime,proto3" json:"operationTime"`
} }
@ -2340,9 +2342,9 @@ type GroupApplicationAcceptedTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"` Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"`
OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"` OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"`
HandleMsg string `protobuf:"bytes,4,opt,name=handleMsg,proto3" json:"handleMsg"` HandleMsg string `protobuf:"bytes,4,opt,name=handleMsg,proto3" json:"handleMsg"`
ReceiverAs int32 `protobuf:"varint,5,opt,name=receiverAs,proto3" json:"receiverAs"` // admin(==1) or applicant(==0) ReceiverAs int32 `protobuf:"varint,5,opt,name=receiverAs,proto3" json:"receiverAs"` // admin(==1) or applicant(==0)
} }
@ -2412,9 +2414,9 @@ type GroupApplicationRejectedTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"` Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"`
OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"` OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"`
HandleMsg string `protobuf:"bytes,4,opt,name=handleMsg,proto3" json:"handleMsg"` HandleMsg string `protobuf:"bytes,4,opt,name=handleMsg,proto3" json:"handleMsg"`
ReceiverAs int32 `protobuf:"varint,5,opt,name=receiverAs,proto3" json:"receiverAs"` // admin(==1) or applicant(==0) ReceiverAs int32 `protobuf:"varint,5,opt,name=receiverAs,proto3" json:"receiverAs"` // admin(==1) or applicant(==0)
} }
@ -2484,9 +2486,9 @@ type GroupOwnerTransferredTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"` Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"`
OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"` OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"`
NewGroupOwner *GroupMemberFullInfo `protobuf:"bytes,3,opt,name=newGroupOwner,proto3" json:"newGroupOwner"` NewGroupOwner *GroupMemberFullInfo `protobuf:"bytes,3,opt,name=newGroupOwner,proto3" json:"newGroupOwner"`
OperationTime int64 `protobuf:"varint,4,opt,name=operationTime,proto3" json:"operationTime"` OperationTime int64 `protobuf:"varint,4,opt,name=operationTime,proto3" json:"operationTime"`
} }
@ -2556,8 +2558,8 @@ type MemberKickedTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"` Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"`
OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"` OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"`
KickedUserList []*GroupMemberFullInfo `protobuf:"bytes,3,rep,name=kickedUserList,proto3" json:"kickedUserList"` KickedUserList []*GroupMemberFullInfo `protobuf:"bytes,3,rep,name=kickedUserList,proto3" json:"kickedUserList"`
OperationTime int64 `protobuf:"varint,4,opt,name=operationTime,proto3" json:"operationTime"` OperationTime int64 `protobuf:"varint,4,opt,name=operationTime,proto3" json:"operationTime"`
} }
@ -2628,10 +2630,10 @@ type MemberInvitedTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"` Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"`
OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"` OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"`
InvitedUserList []*GroupMemberFullInfo `protobuf:"bytes,3,rep,name=invitedUserList,proto3" json:"invitedUserList"` InvitedUserList []*GroupMemberFullInfo `protobuf:"bytes,3,rep,name=invitedUserList,proto3" json:"invitedUserList"`
OperationTime int64 `protobuf:"varint,4,opt,name=operationTime,proto3" json:"operationTime"` OperationTime int64 `protobuf:"varint,4,opt,name=operationTime,proto3" json:"operationTime"`
} }
func (x *MemberInvitedTips) Reset() { func (x *MemberInvitedTips) Reset() {
@ -2700,8 +2702,8 @@ type MemberEnterTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"` Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"`
EntrantUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=entrantUser,proto3" json:"entrantUser"` EntrantUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=entrantUser,proto3" json:"entrantUser"`
OperationTime int64 `protobuf:"varint,3,opt,name=operationTime,proto3" json:"operationTime"` OperationTime int64 `protobuf:"varint,3,opt,name=operationTime,proto3" json:"operationTime"`
} }
@ -2763,8 +2765,8 @@ type GroupDismissedTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"` Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"`
OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"` OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"`
OperationTime int64 `protobuf:"varint,3,opt,name=operationTime,proto3" json:"operationTime"` OperationTime int64 `protobuf:"varint,3,opt,name=operationTime,proto3" json:"operationTime"`
} }
@ -2826,11 +2828,11 @@ type GroupMemberMutedTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"` Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"`
OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"` OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"`
OperationTime int64 `protobuf:"varint,3,opt,name=operationTime,proto3" json:"operationTime"` OperationTime int64 `protobuf:"varint,3,opt,name=operationTime,proto3" json:"operationTime"`
MutedUser *GroupMemberFullInfo `protobuf:"bytes,4,opt,name=mutedUser,proto3" json:"mutedUser"` MutedUser *GroupMemberFullInfo `protobuf:"bytes,4,opt,name=mutedUser,proto3" json:"mutedUser"`
MutedSeconds uint32 `protobuf:"varint,5,opt,name=mutedSeconds,proto3" json:"mutedSeconds"` MutedSeconds uint32 `protobuf:"varint,5,opt,name=mutedSeconds,proto3" json:"mutedSeconds"`
} }
func (x *GroupMemberMutedTips) Reset() { func (x *GroupMemberMutedTips) Reset() {
@ -2905,10 +2907,10 @@ type GroupMemberCancelMutedTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"` Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"`
OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"` OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"`
OperationTime int64 `protobuf:"varint,3,opt,name=operationTime,proto3" json:"operationTime"` OperationTime int64 `protobuf:"varint,3,opt,name=operationTime,proto3" json:"operationTime"`
MutedUser *GroupMemberFullInfo `protobuf:"bytes,4,opt,name=mutedUser,proto3" json:"mutedUser"` MutedUser *GroupMemberFullInfo `protobuf:"bytes,4,opt,name=mutedUser,proto3" json:"mutedUser"`
} }
func (x *GroupMemberCancelMutedTips) Reset() { func (x *GroupMemberCancelMutedTips) Reset() {
@ -2976,8 +2978,8 @@ type GroupMutedTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"` Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"`
OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"` OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"`
OperationTime int64 `protobuf:"varint,3,opt,name=operationTime,proto3" json:"operationTime"` OperationTime int64 `protobuf:"varint,3,opt,name=operationTime,proto3" json:"operationTime"`
} }
@ -3039,8 +3041,8 @@ type GroupCancelMutedTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"` Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"`
OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"` OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"`
OperationTime int64 `protobuf:"varint,3,opt,name=operationTime,proto3" json:"operationTime"` OperationTime int64 `protobuf:"varint,3,opt,name=operationTime,proto3" json:"operationTime"`
} }
@ -3102,10 +3104,10 @@ type GroupMemberInfoSetTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"` Group *GroupInfo `protobuf:"bytes,1,opt,name=group,proto3" json:"group"`
OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"` OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser,proto3" json:"opUser"`
OperationTime int64 `protobuf:"varint,3,opt,name=operationTime,proto3" json:"operationTime"` OperationTime int64 `protobuf:"varint,3,opt,name=operationTime,proto3" json:"operationTime"`
ChangedUser *GroupMemberFullInfo `protobuf:"bytes,4,opt,name=changedUser,proto3" json:"changedUser"` ChangedUser *GroupMemberFullInfo `protobuf:"bytes,4,opt,name=changedUser,proto3" json:"changedUser"`
} }
func (x *GroupMemberInfoSetTips) Reset() { func (x *GroupMemberInfoSetTips) Reset() {
@ -3173,8 +3175,8 @@ type FriendApplication struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
AddTime int64 `protobuf:"varint,1,opt,name=addTime,proto3" json:"addTime"` AddTime int64 `protobuf:"varint,1,opt,name=addTime,proto3" json:"addTime"`
AddSource string `protobuf:"bytes,2,opt,name=addSource,proto3" json:"addSource"` AddSource string `protobuf:"bytes,2,opt,name=addSource,proto3" json:"addSource"`
AddWording string `protobuf:"bytes,3,opt,name=addWording,proto3" json:"addWording"` AddWording string `protobuf:"bytes,3,opt,name=addWording,proto3" json:"addWording"`
} }
@ -3237,7 +3239,7 @@ type FromToUserID struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
FromUserID string `protobuf:"bytes,1,opt,name=fromUserID,proto3" json:"fromUserID"` FromUserID string `protobuf:"bytes,1,opt,name=fromUserID,proto3" json:"fromUserID"`
ToUserID string `protobuf:"bytes,2,opt,name=toUserID,proto3" json:"toUserID"` ToUserID string `protobuf:"bytes,2,opt,name=toUserID,proto3" json:"toUserID"`
} }
func (x *FromToUserID) Reset() { func (x *FromToUserID) Reset() {
@ -3341,7 +3343,7 @@ type FriendApplicationApprovedTips struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
FromToUserID *FromToUserID `protobuf:"bytes,1,opt,name=fromToUserID,proto3" json:"fromToUserID"` //from同意者to请求发起者 FromToUserID *FromToUserID `protobuf:"bytes,1,opt,name=fromToUserID,proto3" json:"fromToUserID"` //from同意者to请求发起者
HandleMsg string `protobuf:"bytes,2,opt,name=handleMsg,proto3" json:"handleMsg"` HandleMsg string `protobuf:"bytes,2,opt,name=handleMsg,proto3" json:"handleMsg"`
} }
func (x *FriendApplicationApprovedTips) Reset() { func (x *FriendApplicationApprovedTips) Reset() {
@ -3397,7 +3399,7 @@ type FriendApplicationRejectedTips struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
FromToUserID *FromToUserID `protobuf:"bytes,1,opt,name=fromToUserID,proto3" json:"fromToUserID"` //from拒绝者to请求发起者 FromToUserID *FromToUserID `protobuf:"bytes,1,opt,name=fromToUserID,proto3" json:"fromToUserID"` //from拒绝者to请求发起者
HandleMsg string `protobuf:"bytes,2,opt,name=handleMsg,proto3" json:"handleMsg"` HandleMsg string `protobuf:"bytes,2,opt,name=handleMsg,proto3" json:"handleMsg"`
} }
func (x *FriendApplicationRejectedTips) Reset() { func (x *FriendApplicationRejectedTips) Reset() {
@ -3452,9 +3454,9 @@ type FriendAddedTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Friend *FriendInfo `protobuf:"bytes,1,opt,name=friend,proto3" json:"friend"` Friend *FriendInfo `protobuf:"bytes,1,opt,name=friend,proto3" json:"friend"`
OperationTime int64 `protobuf:"varint,2,opt,name=operationTime,proto3" json:"operationTime"` OperationTime int64 `protobuf:"varint,2,opt,name=operationTime,proto3" json:"operationTime"`
OpUser *PublicUserInfo `protobuf:"bytes,3,opt,name=opUser,proto3" json:"opUser"` //who do this OpUser *PublicUserInfo `protobuf:"bytes,3,opt,name=opUser,proto3" json:"opUser"` //who do this
} }
func (x *FriendAddedTips) Reset() { func (x *FriendAddedTips) Reset() {
@ -3753,7 +3755,7 @@ type ConversationUpdateTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
ConversationIDList []string `protobuf:"bytes,2,rep,name=conversationIDList,proto3" json:"conversationIDList"` ConversationIDList []string `protobuf:"bytes,2,rep,name=conversationIDList,proto3" json:"conversationIDList"`
} }
@ -3808,8 +3810,8 @@ type ConversationSetPrivateTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
RecvID string `protobuf:"bytes,1,opt,name=recvID,proto3" json:"recvID"` RecvID string `protobuf:"bytes,1,opt,name=recvID,proto3" json:"recvID"`
SendID string `protobuf:"bytes,2,opt,name=sendID,proto3" json:"sendID"` SendID string `protobuf:"bytes,2,opt,name=sendID,proto3" json:"sendID"`
IsPrivate bool `protobuf:"varint,3,opt,name=isPrivate,proto3" json:"isPrivate"` IsPrivate bool `protobuf:"varint,3,opt,name=isPrivate,proto3" json:"isPrivate"`
} }
@ -3871,9 +3873,9 @@ type ConversationHasReadTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"` ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"`
HasReadSeq int64 `protobuf:"varint,3,opt,name=hasReadSeq,proto3" json:"hasReadSeq"` HasReadSeq int64 `protobuf:"varint,3,opt,name=hasReadSeq,proto3" json:"hasReadSeq"`
UnreadCountTime int64 `protobuf:"varint,4,opt,name=unreadCountTime,proto3" json:"unreadCountTime"` UnreadCountTime int64 `protobuf:"varint,4,opt,name=unreadCountTime,proto3" json:"unreadCountTime"`
} }
@ -4037,8 +4039,8 @@ type DeleteMessageTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
OpUserID string `protobuf:"bytes,1,opt,name=opUserID,proto3" json:"opUserID"` OpUserID string `protobuf:"bytes,1,opt,name=opUserID,proto3" json:"opUserID"`
UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID"`
Seqs []int64 `protobuf:"varint,3,rep,packed,name=seqs,proto3" json:"seqs"` Seqs []int64 `protobuf:"varint,3,rep,packed,name=seqs,proto3" json:"seqs"`
} }
@ -4100,11 +4102,11 @@ type RevokeMsgTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
RevokerUserID string `protobuf:"bytes,1,opt,name=revokerUserID,proto3" json:"revokerUserID"` RevokerUserID string `protobuf:"bytes,1,opt,name=revokerUserID,proto3" json:"revokerUserID"`
ClientMsgID string `protobuf:"bytes,2,opt,name=clientMsgID,proto3" json:"clientMsgID"` ClientMsgID string `protobuf:"bytes,2,opt,name=clientMsgID,proto3" json:"clientMsgID"`
RevokeTime int64 `protobuf:"varint,3,opt,name=revokeTime,proto3" json:"revokeTime"` RevokeTime int64 `protobuf:"varint,3,opt,name=revokeTime,proto3" json:"revokeTime"`
SesstionType int32 `protobuf:"varint,5,opt,name=sesstionType,proto3" json:"sesstionType"` SesstionType int32 `protobuf:"varint,5,opt,name=sesstionType,proto3" json:"sesstionType"`
Seq int64 `protobuf:"varint,6,opt,name=seq,proto3" json:"seq"` Seq int64 `protobuf:"varint,6,opt,name=seq,proto3" json:"seq"`
ConversationID string `protobuf:"bytes,7,opt,name=conversationID,proto3" json:"conversationID"` ConversationID string `protobuf:"bytes,7,opt,name=conversationID,proto3" json:"conversationID"`
} }
@ -4187,17 +4189,17 @@ type MessageRevokedContent struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
RevokerID string `protobuf:"bytes,1,opt,name=revokerID,proto3" json:"revokerID"` RevokerID string `protobuf:"bytes,1,opt,name=revokerID,proto3" json:"revokerID"`
RevokerRole int32 `protobuf:"varint,2,opt,name=revokerRole,proto3" json:"revokerRole"` RevokerRole int32 `protobuf:"varint,2,opt,name=revokerRole,proto3" json:"revokerRole"`
ClientMsgID string `protobuf:"bytes,3,opt,name=clientMsgID,proto3" json:"clientMsgID"` ClientMsgID string `protobuf:"bytes,3,opt,name=clientMsgID,proto3" json:"clientMsgID"`
RevokerNickname string `protobuf:"bytes,4,opt,name=revokerNickname,proto3" json:"revokerNickname"` RevokerNickname string `protobuf:"bytes,4,opt,name=revokerNickname,proto3" json:"revokerNickname"`
RevokeTime int64 `protobuf:"varint,5,opt,name=revokeTime,proto3" json:"revokeTime"` RevokeTime int64 `protobuf:"varint,5,opt,name=revokeTime,proto3" json:"revokeTime"`
SourceMessageSendTime int64 `protobuf:"varint,6,opt,name=sourceMessageSendTime,proto3" json:"sourceMessageSendTime"` SourceMessageSendTime int64 `protobuf:"varint,6,opt,name=sourceMessageSendTime,proto3" json:"sourceMessageSendTime"`
SourceMessageSendID string `protobuf:"bytes,7,opt,name=sourceMessageSendID,proto3" json:"sourceMessageSendID"` SourceMessageSendID string `protobuf:"bytes,7,opt,name=sourceMessageSendID,proto3" json:"sourceMessageSendID"`
SourceMessageSenderNickname string `protobuf:"bytes,8,opt,name=sourceMessageSenderNickname,proto3" json:"sourceMessageSenderNickname"` SourceMessageSenderNickname string `protobuf:"bytes,8,opt,name=sourceMessageSenderNickname,proto3" json:"sourceMessageSenderNickname"`
SessionType int32 `protobuf:"varint,10,opt,name=sessionType,proto3" json:"sessionType"` SessionType int32 `protobuf:"varint,10,opt,name=sessionType,proto3" json:"sessionType"`
Seq int64 `protobuf:"varint,11,opt,name=seq,proto3" json:"seq"` Seq int64 `protobuf:"varint,11,opt,name=seq,proto3" json:"seq"`
Ex string `protobuf:"bytes,12,opt,name=ex,proto3" json:"ex"` Ex string `protobuf:"bytes,12,opt,name=ex,proto3" json:"ex"`
} }
func (x *MessageRevokedContent) Reset() { func (x *MessageRevokedContent) Reset() {
@ -4314,7 +4316,7 @@ type ClearConversationTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
ConversationIDs []string `protobuf:"bytes,2,rep,name=conversationIDs,proto3" json:"conversationIDs"` ConversationIDs []string `protobuf:"bytes,2,rep,name=conversationIDs,proto3" json:"conversationIDs"`
} }
@ -4369,9 +4371,9 @@ type DeleteMsgsTips struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"` ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"`
Seqs []int64 `protobuf:"varint,3,rep,packed,name=seqs,proto3" json:"seqs"` Seqs []int64 `protobuf:"varint,3,rep,packed,name=seqs,proto3" json:"seqs"`
} }
func (x *DeleteMsgsTips) Reset() { func (x *DeleteMsgsTips) Reset() {
@ -4433,9 +4435,9 @@ type MarkAsReadTips struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
MarkAsReadUserID string `protobuf:"bytes,1,opt,name=markAsReadUserID,proto3" json:"markAsReadUserID"` MarkAsReadUserID string `protobuf:"bytes,1,opt,name=markAsReadUserID,proto3" json:"markAsReadUserID"`
ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"` ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"`
Seqs []int64 `protobuf:"varint,3,rep,packed,name=seqs,proto3" json:"seqs"` Seqs []int64 `protobuf:"varint,3,rep,packed,name=seqs,proto3" json:"seqs"`
HasReadSeq int64 `protobuf:"varint,4,opt,name=hasReadSeq,proto3" json:"hasReadSeq"` HasReadSeq int64 `protobuf:"varint,4,opt,name=hasReadSeq,proto3" json:"hasReadSeq"`
} }
func (x *MarkAsReadTips) Reset() { func (x *MarkAsReadTips) Reset() {
@ -4503,7 +4505,7 @@ type SetAppBackgroundStatusReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
IsBackground bool `protobuf:"varint,2,opt,name=isBackground,proto3" json:"isBackground"` IsBackground bool `protobuf:"varint,2,opt,name=isBackground,proto3" json:"isBackground"`
} }

@ -21,9 +21,10 @@
package statistics package statistics
import ( import (
reflect "reflect"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
) )
const ( const (

@ -16,7 +16,7 @@ package third
import "github.com/OpenIMSDK/Open-IM-Server/pkg/errs" import "github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
//func (x *ApplyPutReq) Check() error { // func (x *ApplyPutReq) Check() error {
// if x.PutID == "" { // if x.PutID == "" {
// return errs.ErrArgs.Wrap("PutID is empty") // return errs.ErrArgs.Wrap("PutID is empty")
// } // }
@ -24,36 +24,37 @@ import "github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
// return errs.ErrArgs.Wrap("ContentType is empty") // return errs.ErrArgs.Wrap("ContentType is empty")
// } // }
// return nil // return nil
//} // }
// //
//func (x *ConfirmPutReq) Check() error { // func (x *ConfirmPutReq) Check() error {
// if x.PutID == "" { // if x.PutID == "" {
// return errs.ErrArgs.Wrap("PutID is empty") // return errs.ErrArgs.Wrap("PutID is empty")
// } // }
// return nil // return nil
//} // }
// //
//func (x *GetUrlReq) Check() error { // func (x *GetUrlReq) Check() error {
// if x.Name == "" { // if x.Name == "" {
// return errs.ErrArgs.Wrap("Name is empty") // return errs.ErrArgs.Wrap("Name is empty")
// } // }
// return nil // return nil
//} // }
// //
//func (x *GetPutReq) Check() error { // func (x *GetPutReq) Check() error {
// if x.PutID == "" { // if x.PutID == "" {
// return errs.ErrArgs.Wrap("PutID is empty") // return errs.ErrArgs.Wrap("PutID is empty")
// } // }
// return nil // return nil
//} // }
// //
//func (x *GetHashInfoReq) Check() error { // func (x *GetHashInfoReq) Check() error {
// if x.Hash == "" { // if x.Hash == "" {
// return errs.ErrArgs.Wrap("Hash is empty") // return errs.ErrArgs.Wrap("Hash is empty")
// } // }
// return nil // return nil
//} // }
// Check
func (x *FcmUpdateTokenReq) Check() error { func (x *FcmUpdateTokenReq) Check() error {
if x.PlatformID < 1 || x.PlatformID > 9 { if x.PlatformID < 1 || x.PlatformID > 9 {
return errs.ErrArgs.Wrap("PlatformID is invalid") return errs.ErrArgs.Wrap("PlatformID is invalid")
@ -64,12 +65,15 @@ func (x *FcmUpdateTokenReq) Check() error {
if x.Account == "" { if x.Account == "" {
return errs.ErrArgs.Wrap("Account is empty") return errs.ErrArgs.Wrap("Account is empty")
} }
return nil return nil
} }
// Check
func (x *SetAppBadgeReq) Check() error { func (x *SetAppBadgeReq) Check() error {
if x.UserID == "" { if x.UserID == "" {
return errs.ErrArgs.Wrap("UserID is empty") return errs.ErrArgs.Wrap("UserID is empty")
} }
return nil return nil
} }

@ -22,13 +22,14 @@ package third
import ( import (
context "context" context "context"
reflect "reflect"
sync "sync"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes" codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status" status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
) )
const ( const (
@ -43,7 +44,7 @@ type KeyValues struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key"` Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key"`
Values []string `protobuf:"bytes,2,rep,name=values,proto3" json:"values"` Values []string `protobuf:"bytes,2,rep,name=values,proto3" json:"values"`
} }
@ -99,9 +100,9 @@ type SignPart struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
PartNumber int32 `protobuf:"varint,1,opt,name=partNumber,proto3" json:"partNumber"` PartNumber int32 `protobuf:"varint,1,opt,name=partNumber,proto3" json:"partNumber"`
Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url"` Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url"`
Query []*KeyValues `protobuf:"bytes,3,rep,name=query,proto3" json:"query"` Query []*KeyValues `protobuf:"bytes,3,rep,name=query,proto3" json:"query"`
Header []*KeyValues `protobuf:"bytes,4,rep,name=header,proto3" json:"header"` Header []*KeyValues `protobuf:"bytes,4,rep,name=header,proto3" json:"header"`
} }
func (x *SignPart) Reset() { func (x *SignPart) Reset() {
@ -169,10 +170,10 @@ type AuthSignParts struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url"` Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url"`
Query []*KeyValues `protobuf:"bytes,2,rep,name=query,proto3" json:"query"` Query []*KeyValues `protobuf:"bytes,2,rep,name=query,proto3" json:"query"`
Header []*KeyValues `protobuf:"bytes,3,rep,name=header,proto3" json:"header"` Header []*KeyValues `protobuf:"bytes,3,rep,name=header,proto3" json:"header"`
Parts []*SignPart `protobuf:"bytes,4,rep,name=parts,proto3" json:"parts"` Parts []*SignPart `protobuf:"bytes,4,rep,name=parts,proto3" json:"parts"`
} }
func (x *AuthSignParts) Reset() { func (x *AuthSignParts) Reset() {
@ -280,7 +281,7 @@ type PartLimitResp struct {
MinPartSize int64 `protobuf:"varint,1,opt,name=minPartSize,proto3" json:"minPartSize"` MinPartSize int64 `protobuf:"varint,1,opt,name=minPartSize,proto3" json:"minPartSize"`
MaxPartSize int64 `protobuf:"varint,2,opt,name=maxPartSize,proto3" json:"maxPartSize"` MaxPartSize int64 `protobuf:"varint,2,opt,name=maxPartSize,proto3" json:"maxPartSize"`
MaxNumSize int32 `protobuf:"varint,3,opt,name=maxNumSize,proto3" json:"maxNumSize"` MaxNumSize int32 `protobuf:"varint,3,opt,name=maxNumSize,proto3" json:"maxNumSize"`
} }
func (x *PartLimitResp) Reset() { func (x *PartLimitResp) Reset() {
@ -435,12 +436,12 @@ type InitiateMultipartUploadReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash"` Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash"`
Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size"` Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size"`
PartSize int64 `protobuf:"varint,3,opt,name=partSize,proto3" json:"partSize"` PartSize int64 `protobuf:"varint,3,opt,name=partSize,proto3" json:"partSize"`
MaxParts int32 `protobuf:"varint,4,opt,name=maxParts,proto3" json:"maxParts"` MaxParts int32 `protobuf:"varint,4,opt,name=maxParts,proto3" json:"maxParts"`
Cause string `protobuf:"bytes,5,opt,name=cause,proto3" json:"cause"` Cause string `protobuf:"bytes,5,opt,name=cause,proto3" json:"cause"`
Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name"` Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name"`
ContentType string `protobuf:"bytes,7,opt,name=contentType,proto3" json:"contentType"` ContentType string `protobuf:"bytes,7,opt,name=contentType,proto3" json:"contentType"`
} }
@ -530,9 +531,9 @@ type UploadInfo struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UploadID string `protobuf:"bytes,1,opt,name=uploadID,proto3" json:"uploadID"` UploadID string `protobuf:"bytes,1,opt,name=uploadID,proto3" json:"uploadID"`
PartSize int64 `protobuf:"varint,2,opt,name=partSize,proto3" json:"partSize"` PartSize int64 `protobuf:"varint,2,opt,name=partSize,proto3" json:"partSize"`
Sign *AuthSignParts `protobuf:"bytes,3,opt,name=sign,proto3" json:"sign"` Sign *AuthSignParts `protobuf:"bytes,3,opt,name=sign,proto3" json:"sign"`
ExpireTime int64 `protobuf:"varint,4,opt,name=expireTime,proto3" json:"expireTime"` ExpireTime int64 `protobuf:"varint,4,opt,name=expireTime,proto3" json:"expireTime"`
} }
@ -601,7 +602,7 @@ type InitiateMultipartUploadResp struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url"` Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url"`
Upload *UploadInfo `protobuf:"bytes,2,opt,name=upload,proto3" json:"upload"` Upload *UploadInfo `protobuf:"bytes,2,opt,name=upload,proto3" json:"upload"`
} }
@ -656,7 +657,7 @@ type AuthSignReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UploadID string `protobuf:"bytes,1,opt,name=uploadID,proto3" json:"uploadID"` UploadID string `protobuf:"bytes,1,opt,name=uploadID,proto3" json:"uploadID"`
PartNumbers []int32 `protobuf:"varint,2,rep,packed,name=partNumbers,proto3" json:"partNumbers"` PartNumbers []int32 `protobuf:"varint,2,rep,packed,name=partNumbers,proto3" json:"partNumbers"`
} }
@ -711,10 +712,10 @@ type AuthSignResp struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url"` Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url"`
Query []*KeyValues `protobuf:"bytes,2,rep,name=query,proto3" json:"query"` Query []*KeyValues `protobuf:"bytes,2,rep,name=query,proto3" json:"query"`
Header []*KeyValues `protobuf:"bytes,3,rep,name=header,proto3" json:"header"` Header []*KeyValues `protobuf:"bytes,3,rep,name=header,proto3" json:"header"`
Parts []*SignPart `protobuf:"bytes,4,rep,name=parts,proto3" json:"parts"` Parts []*SignPart `protobuf:"bytes,4,rep,name=parts,proto3" json:"parts"`
} }
func (x *AuthSignResp) Reset() { func (x *AuthSignResp) Reset() {
@ -782,11 +783,11 @@ type CompleteMultipartUploadReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UploadID string `protobuf:"bytes,1,opt,name=uploadID,proto3" json:"uploadID"` UploadID string `protobuf:"bytes,1,opt,name=uploadID,proto3" json:"uploadID"`
Parts []string `protobuf:"bytes,2,rep,name=parts,proto3" json:"parts"` Parts []string `protobuf:"bytes,2,rep,name=parts,proto3" json:"parts"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name"`
ContentType string `protobuf:"bytes,4,opt,name=contentType,proto3" json:"contentType"` ContentType string `protobuf:"bytes,4,opt,name=contentType,proto3" json:"contentType"`
Cause string `protobuf:"bytes,5,opt,name=cause,proto3" json:"cause"` Cause string `protobuf:"bytes,5,opt,name=cause,proto3" json:"cause"`
} }
func (x *CompleteMultipartUploadReq) Reset() { func (x *CompleteMultipartUploadReq) Reset() {
@ -955,7 +956,7 @@ type AccessURLResp struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url"` Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url"`
ExpireTime int64 `protobuf:"varint,2,opt,name=expireTime,proto3" json:"expireTime"` ExpireTime int64 `protobuf:"varint,2,opt,name=expireTime,proto3" json:"expireTime"`
} }
@ -1011,8 +1012,8 @@ type FcmUpdateTokenReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
PlatformID int32 `protobuf:"varint,1,opt,name=platformID,proto3" json:"platformID"` PlatformID int32 `protobuf:"varint,1,opt,name=platformID,proto3" json:"platformID"`
FcmToken string `protobuf:"bytes,2,opt,name=fcmToken,proto3" json:"fcmToken"` FcmToken string `protobuf:"bytes,2,opt,name=fcmToken,proto3" json:"fcmToken"`
Account string `protobuf:"bytes,3,opt,name=account,proto3" json:"account"` Account string `protobuf:"bytes,3,opt,name=account,proto3" json:"account"`
ExpireTime int64 `protobuf:"varint,4,opt,name=expireTime,proto3" json:"expireTime"` ExpireTime int64 `protobuf:"varint,4,opt,name=expireTime,proto3" json:"expireTime"`
} }
@ -1119,7 +1120,7 @@ type SetAppBadgeReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
AppUnreadCount int32 `protobuf:"varint,2,opt,name=appUnreadCount,proto3" json:"appUnreadCount"` AppUnreadCount int32 `protobuf:"varint,2,opt,name=appUnreadCount,proto3" json:"appUnreadCount"`
} }

@ -16,6 +16,7 @@ package user
import "github.com/OpenIMSDK/Open-IM-Server/pkg/errs" import "github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
// Check
func (x *GetAllUserIDReq) Check() error { func (x *GetAllUserIDReq) Check() error {
if x.Pagination == nil { if x.Pagination == nil {
return errs.ErrArgs.Wrap("pagination is empty") return errs.ErrArgs.Wrap("pagination is empty")
@ -23,23 +24,29 @@ func (x *GetAllUserIDReq) Check() error {
if x.Pagination.PageNumber < 1 { if x.Pagination.PageNumber < 1 {
return errs.ErrArgs.Wrap("pageNumber is invalid") return errs.ErrArgs.Wrap("pageNumber is invalid")
} }
return nil return nil
} }
// Check
func (x *AccountCheckReq) Check() error { func (x *AccountCheckReq) Check() error {
if x.CheckUserIDs == nil { if x.CheckUserIDs == nil {
return errs.ErrArgs.Wrap("CheckUserIDs is empty") return errs.ErrArgs.Wrap("CheckUserIDs is empty")
} }
return nil return nil
} }
// Check
func (x *GetDesignateUsersReq) Check() error { func (x *GetDesignateUsersReq) Check() error {
if x.UserIDs == nil { if x.UserIDs == nil {
return errs.ErrArgs.Wrap("UserIDs is empty") return errs.ErrArgs.Wrap("UserIDs is empty")
} }
return nil return nil
} }
// Check
func (x *UpdateUserInfoReq) Check() error { func (x *UpdateUserInfoReq) Check() error {
if x.UserInfo == nil { if x.UserInfo == nil {
return errs.ErrArgs.Wrap("UserInfo is empty") return errs.ErrArgs.Wrap("UserInfo is empty")
@ -47,9 +54,11 @@ func (x *UpdateUserInfoReq) Check() error {
if x.UserInfo.UserID == "" { if x.UserInfo.UserID == "" {
return errs.ErrArgs.Wrap("UserID is empty") return errs.ErrArgs.Wrap("UserID is empty")
} }
return nil return nil
} }
// Check
func (x *SetGlobalRecvMessageOptReq) Check() error { func (x *SetGlobalRecvMessageOptReq) Check() error {
if x.GlobalRecvMsgOpt > 2 || x.GlobalRecvMsgOpt < 0 { if x.GlobalRecvMsgOpt > 2 || x.GlobalRecvMsgOpt < 0 {
return errs.ErrArgs.Wrap("GlobalRecvMsgOpt is invalid") return errs.ErrArgs.Wrap("GlobalRecvMsgOpt is invalid")
@ -57,9 +66,11 @@ func (x *SetGlobalRecvMessageOptReq) Check() error {
if x.UserID == "" { if x.UserID == "" {
return errs.ErrArgs.Wrap("UserID is empty") return errs.ErrArgs.Wrap("UserID is empty")
} }
return nil return nil
} }
// Check
func (x *SetConversationReq) Check() error { func (x *SetConversationReq) Check() error {
if err := x.Conversation.Check(); err != nil { if err := x.Conversation.Check(); err != nil {
return err return err
@ -67,9 +78,11 @@ func (x *SetConversationReq) Check() error {
if x.NotificationType < 1 || x.NotificationType > 3 { if x.NotificationType < 1 || x.NotificationType > 3 {
return errs.ErrArgs.Wrap("NotificationType is invalid") return errs.ErrArgs.Wrap("NotificationType is invalid")
} }
return nil return nil
} }
// Check
func (x *SetRecvMsgOptReq) Check() error { func (x *SetRecvMsgOptReq) Check() error {
if x.OwnerUserID == "" { if x.OwnerUserID == "" {
return errs.ErrArgs.Wrap("OwnerUserID is empty") return errs.ErrArgs.Wrap("OwnerUserID is empty")
@ -83,9 +96,11 @@ func (x *SetRecvMsgOptReq) Check() error {
if x.NotificationType < 1 || x.NotificationType > 3 { if x.NotificationType < 1 || x.NotificationType > 3 {
return errs.ErrArgs.Wrap("NotificationType is invalid") return errs.ErrArgs.Wrap("NotificationType is invalid")
} }
return nil return nil
} }
// Check
func (x *GetConversationReq) Check() error { func (x *GetConversationReq) Check() error {
if x.OwnerUserID == "" { if x.OwnerUserID == "" {
return errs.ErrArgs.Wrap("OwnerUserID is empty") return errs.ErrArgs.Wrap("OwnerUserID is empty")
@ -93,9 +108,11 @@ func (x *GetConversationReq) Check() error {
if x.ConversationID == "" { if x.ConversationID == "" {
return errs.ErrArgs.Wrap("ConversationID is empty") return errs.ErrArgs.Wrap("ConversationID is empty")
} }
return nil return nil
} }
// Check
func (x *GetConversationsReq) Check() error { func (x *GetConversationsReq) Check() error {
if x.OwnerUserID == "" { if x.OwnerUserID == "" {
return errs.ErrArgs.Wrap("OwnerUserID is empty") return errs.ErrArgs.Wrap("OwnerUserID is empty")
@ -103,16 +120,20 @@ func (x *GetConversationsReq) Check() error {
if x.ConversationIDs == nil { if x.ConversationIDs == nil {
return errs.ErrArgs.Wrap("ConversationIDs is empty") return errs.ErrArgs.Wrap("ConversationIDs is empty")
} }
return nil return nil
} }
// Check
func (x *GetAllConversationsReq) Check() error { func (x *GetAllConversationsReq) Check() error {
if x.OwnerUserID == "" { if x.OwnerUserID == "" {
return errs.ErrArgs.Wrap("OwnerUserID is empty") return errs.ErrArgs.Wrap("OwnerUserID is empty")
} }
return nil return nil
} }
// Check
func (x *BatchSetConversationsReq) Check() error { func (x *BatchSetConversationsReq) Check() error {
if x.OwnerUserID == "" { if x.OwnerUserID == "" {
return errs.ErrArgs.Wrap("OwnerUserID is empty") return errs.ErrArgs.Wrap("OwnerUserID is empty")
@ -123,9 +144,11 @@ func (x *BatchSetConversationsReq) Check() error {
if x.NotificationType < 1 || x.NotificationType > 3 { if x.NotificationType < 1 || x.NotificationType > 3 {
return errs.ErrArgs.Wrap("NotificationType is invalid") return errs.ErrArgs.Wrap("NotificationType is invalid")
} }
return nil return nil
} }
// Check
func (x *GetPaginationUsersReq) Check() error { func (x *GetPaginationUsersReq) Check() error {
if x.Pagination == nil { if x.Pagination == nil {
return errs.ErrArgs.Wrap("pagination is empty") return errs.ErrArgs.Wrap("pagination is empty")
@ -133,23 +156,29 @@ func (x *GetPaginationUsersReq) Check() error {
if x.Pagination.PageNumber < 1 { if x.Pagination.PageNumber < 1 {
return errs.ErrArgs.Wrap("pageNumber is invalid") return errs.ErrArgs.Wrap("pageNumber is invalid")
} }
return nil return nil
} }
// Check
func (x *UserRegisterReq) Check() error { func (x *UserRegisterReq) Check() error {
if x.Users == nil { if x.Users == nil {
return errs.ErrArgs.Wrap("Users is empty") return errs.ErrArgs.Wrap("Users is empty")
} }
return nil return nil
} }
// Check
func (x *GetGlobalRecvMessageOptReq) Check() error { func (x *GetGlobalRecvMessageOptReq) Check() error {
if x.UserID == "" { if x.UserID == "" {
return errs.ErrArgs.Wrap("UserID is empty") return errs.ErrArgs.Wrap("UserID is empty")
} }
return nil return nil
} }
// Check
func (x *UserRegisterCountReq) Check() error { func (x *UserRegisterCountReq) Check() error {
if x.Start <= 0 { if x.Start <= 0 {
return errs.ErrArgs.Wrap("start is invalid") return errs.ErrArgs.Wrap("start is invalid")
@ -157,5 +186,6 @@ func (x *UserRegisterCountReq) Check() error {
if x.End <= 0 { if x.End <= 0 {
return errs.ErrArgs.Wrap("end is invalid") return errs.ErrArgs.Wrap("end is invalid")
} }
return nil return nil
} }

@ -22,15 +22,17 @@ package user
import ( import (
context "context" context "context"
conversation "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/conversation" reflect "reflect"
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws" sync "sync"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes" codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status" status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync" conversation "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/conversation"
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
) )
const ( const (
@ -92,7 +94,7 @@ type GetAllUserIDResp struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total"` Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total"`
UserIDs []string `protobuf:"bytes,2,rep,name=userIDs,proto3" json:"userIDs"` UserIDs []string `protobuf:"bytes,2,rep,name=userIDs,proto3" json:"userIDs"`
} }
@ -420,7 +422,7 @@ type SetGlobalRecvMessageOptReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
GlobalRecvMsgOpt int32 `protobuf:"varint,3,opt,name=globalRecvMsgOpt,proto3" json:"globalRecvMsgOpt"` GlobalRecvMsgOpt int32 `protobuf:"varint,3,opt,name=globalRecvMsgOpt,proto3" json:"globalRecvMsgOpt"`
} }
@ -513,9 +515,9 @@ type SetConversationReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Conversation *conversation.Conversation `protobuf:"bytes,1,opt,name=conversation,proto3" json:"conversation"` Conversation *conversation.Conversation `protobuf:"bytes,1,opt,name=conversation,proto3" json:"conversation"`
NotificationType int32 `protobuf:"varint,2,opt,name=notificationType,proto3" json:"notificationType"` NotificationType int32 `protobuf:"varint,2,opt,name=notificationType,proto3" json:"notificationType"`
OperationID string `protobuf:"bytes,3,opt,name=operationID,proto3" json:"operationID"` OperationID string `protobuf:"bytes,3,opt,name=operationID,proto3" json:"operationID"`
} }
func (x *SetConversationReq) Reset() { func (x *SetConversationReq) Reset() {
@ -614,11 +616,11 @@ type SetRecvMsgOptReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID,proto3" json:"ownerUserID"` OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID,proto3" json:"ownerUserID"`
ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"` ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"`
RecvMsgOpt int32 `protobuf:"varint,3,opt,name=recvMsgOpt,proto3" json:"recvMsgOpt"` RecvMsgOpt int32 `protobuf:"varint,3,opt,name=recvMsgOpt,proto3" json:"recvMsgOpt"`
NotificationType int32 `protobuf:"varint,4,opt,name=notificationType,proto3" json:"notificationType"` NotificationType int32 `protobuf:"varint,4,opt,name=notificationType,proto3" json:"notificationType"`
OperationID string `protobuf:"bytes,5,opt,name=operationID,proto3" json:"operationID"` OperationID string `protobuf:"bytes,5,opt,name=operationID,proto3" json:"operationID"`
} }
func (x *SetRecvMsgOptReq) Reset() { func (x *SetRecvMsgOptReq) Reset() {
@ -732,8 +734,8 @@ type GetConversationReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"` ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID"`
OwnerUserID string `protobuf:"bytes,2,opt,name=ownerUserID,proto3" json:"ownerUserID"` OwnerUserID string `protobuf:"bytes,2,opt,name=ownerUserID,proto3" json:"ownerUserID"`
OperationID string `protobuf:"bytes,3,opt,name=operationID,proto3" json:"operationID"` OperationID string `protobuf:"bytes,3,opt,name=operationID,proto3" json:"operationID"`
} }
func (x *GetConversationReq) Reset() { func (x *GetConversationReq) Reset() {
@ -841,9 +843,9 @@ type GetConversationsReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID,proto3" json:"ownerUserID"` OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID,proto3" json:"ownerUserID"`
ConversationIDs []string `protobuf:"bytes,2,rep,name=conversationIDs,proto3" json:"conversationIDs"` ConversationIDs []string `protobuf:"bytes,2,rep,name=conversationIDs,proto3" json:"conversationIDs"`
OperationID string `protobuf:"bytes,3,opt,name=operationID,proto3" json:"operationID"` OperationID string `protobuf:"bytes,3,opt,name=operationID,proto3" json:"operationID"`
} }
func (x *GetConversationsReq) Reset() { func (x *GetConversationsReq) Reset() {
@ -1053,10 +1055,10 @@ type BatchSetConversationsReq struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Conversations []*conversation.Conversation `protobuf:"bytes,1,rep,name=conversations,proto3" json:"conversations"` Conversations []*conversation.Conversation `protobuf:"bytes,1,rep,name=conversations,proto3" json:"conversations"`
OwnerUserID string `protobuf:"bytes,2,opt,name=OwnerUserID,proto3" json:"OwnerUserID"` OwnerUserID string `protobuf:"bytes,2,opt,name=OwnerUserID,proto3" json:"OwnerUserID"`
NotificationType int32 `protobuf:"varint,3,opt,name=notificationType,proto3" json:"notificationType"` NotificationType int32 `protobuf:"varint,3,opt,name=notificationType,proto3" json:"notificationType"`
OperationID string `protobuf:"bytes,4,opt,name=OperationID,proto3" json:"OperationID"` OperationID string `protobuf:"bytes,4,opt,name=OperationID,proto3" json:"OperationID"`
} }
func (x *BatchSetConversationsReq) Reset() { func (x *BatchSetConversationsReq) Reset() {
@ -1125,7 +1127,7 @@ type BatchSetConversationsResp struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Success []string `protobuf:"bytes,2,rep,name=Success,proto3" json:"Success"` Success []string `protobuf:"bytes,2,rep,name=Success,proto3" json:"Success"`
Failed []string `protobuf:"bytes,3,rep,name=Failed,proto3" json:"Failed"` Failed []string `protobuf:"bytes,3,rep,name=Failed,proto3" json:"Failed"`
} }
func (x *BatchSetConversationsResp) Reset() { func (x *BatchSetConversationsResp) Reset() {
@ -1227,7 +1229,7 @@ type GetPaginationUsersResp struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total"` Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total"`
Users []*sdkws.UserInfo `protobuf:"bytes,2,rep,name=users,proto3" json:"users"` Users []*sdkws.UserInfo `protobuf:"bytes,2,rep,name=users,proto3" json:"users"`
} }
func (x *GetPaginationUsersResp) Reset() { func (x *GetPaginationUsersResp) Reset() {
@ -1282,7 +1284,7 @@ type UserRegisterReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Secret string `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret"` Secret string `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret"`
Users []*sdkws.UserInfo `protobuf:"bytes,2,rep,name=users,proto3" json:"users"` Users []*sdkws.UserInfo `protobuf:"bytes,2,rep,name=users,proto3" json:"users"`
} }
func (x *UserRegisterReq) Reset() { func (x *UserRegisterReq) Reset() {
@ -1469,7 +1471,7 @@ type UserRegisterCountReq struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Start int64 `protobuf:"varint,1,opt,name=start,proto3" json:"start"` Start int64 `protobuf:"varint,1,opt,name=start,proto3" json:"start"`
End int64 `protobuf:"varint,2,opt,name=end,proto3" json:"end"` End int64 `protobuf:"varint,2,opt,name=end,proto3" json:"end"`
} }
func (x *UserRegisterCountReq) Reset() { func (x *UserRegisterCountReq) Reset() {
@ -1523,9 +1525,9 @@ type UserRegisterCountResp struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"` Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"`
Before int64 `protobuf:"varint,2,opt,name=before,proto3" json:"before"` Before int64 `protobuf:"varint,2,opt,name=before,proto3" json:"before"`
Count map[string]int64 `protobuf:"bytes,3,rep,name=count,proto3" json:"count" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` Count map[string]int64 `protobuf:"bytes,3,rep,name=count,proto3" json:"count" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
} }
func (x *UserRegisterCountResp) Reset() { func (x *UserRegisterCountResp) Reset() {
@ -1586,7 +1588,7 @@ type AccountCheckRespSingleUserStatus struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"` UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
AccountStatus string `protobuf:"bytes,2,opt,name=accountStatus,proto3" json:"accountStatus"` AccountStatus string `protobuf:"bytes,2,opt,name=accountStatus,proto3" json:"accountStatus"`
} }

@ -21,10 +21,11 @@
package wrapperspb package wrapperspb
import ( import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect" reflect "reflect"
sync "sync" sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
) )
const ( const (

@ -24,15 +24,18 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/auth" "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/auth"
) )
// NewAuth
func NewAuth(discov discoveryregistry.SvcDiscoveryRegistry) *Auth { func NewAuth(discov discoveryregistry.SvcDiscoveryRegistry) *Auth {
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImAuthName) conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImAuthName)
if err != nil { if err != nil {
panic(err) panic(err)
} }
client := auth.NewAuthClient(conn) client := auth.NewAuthClient(conn)
return &Auth{discov: discov, conn: conn, Client: client} return &Auth{discov: discov, conn: conn, Client: client}
} }
// Auth
type Auth struct { type Auth struct {
conn grpc.ClientConnInterface conn grpc.ClientConnInterface
Client auth.AuthClient Client auth.AuthClient

@ -26,27 +26,33 @@ import (
pbConversation "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/conversation" pbConversation "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/conversation"
) )
// Conversation
type Conversation struct { type Conversation struct {
Client pbConversation.ConversationClient Client pbConversation.ConversationClient
conn grpc.ClientConnInterface conn grpc.ClientConnInterface
discov discoveryregistry.SvcDiscoveryRegistry discov discoveryregistry.SvcDiscoveryRegistry
} }
// NewConversation
func NewConversation(discov discoveryregistry.SvcDiscoveryRegistry) *Conversation { func NewConversation(discov discoveryregistry.SvcDiscoveryRegistry) *Conversation {
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImConversationName) conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImConversationName)
if err != nil { if err != nil {
panic(err) panic(err)
} }
client := pbConversation.NewConversationClient(conn) client := pbConversation.NewConversationClient(conn)
return &Conversation{discov: discov, conn: conn, Client: client} return &Conversation{discov: discov, conn: conn, Client: client}
} }
// ConversationRpcClient
type ConversationRpcClient Conversation type ConversationRpcClient Conversation
// NewConversationRpcClient
func NewConversationRpcClient(discov discoveryregistry.SvcDiscoveryRegistry) ConversationRpcClient { func NewConversationRpcClient(discov discoveryregistry.SvcDiscoveryRegistry) ConversationRpcClient {
return ConversationRpcClient(*NewConversation(discov)) return ConversationRpcClient(*NewConversation(discov))
} }
// GetSingleConversationRecvMsgOpt
func (c *ConversationRpcClient) GetSingleConversationRecvMsgOpt(ctx context.Context, userID, conversationID string) (int32, error) { func (c *ConversationRpcClient) GetSingleConversationRecvMsgOpt(ctx context.Context, userID, conversationID string) (int32, error) {
var req pbConversation.GetConversationReq var req pbConversation.GetConversationReq
req.OwnerUserID = userID req.OwnerUserID = userID
@ -55,45 +61,59 @@ func (c *ConversationRpcClient) GetSingleConversationRecvMsgOpt(ctx context.Cont
if err != nil { if err != nil {
return 0, err return 0, err
} }
return conversation.GetConversation().RecvMsgOpt, err return conversation.GetConversation().RecvMsgOpt, err
} }
// SingleChatFirstCreateConversation
func (c *ConversationRpcClient) SingleChatFirstCreateConversation(ctx context.Context, recvID, sendID string) error { func (c *ConversationRpcClient) SingleChatFirstCreateConversation(ctx context.Context, recvID, sendID string) error {
_, err := c.Client.CreateSingleChatConversations(ctx, &pbConversation.CreateSingleChatConversationsReq{RecvID: recvID, SendID: sendID}) _, err := c.Client.CreateSingleChatConversations(ctx, &pbConversation.CreateSingleChatConversationsReq{RecvID: recvID, SendID: sendID})
return err return err
} }
// GroupChatFirstCreateConversation
func (c *ConversationRpcClient) GroupChatFirstCreateConversation(ctx context.Context, groupID string, userIDs []string) error { func (c *ConversationRpcClient) GroupChatFirstCreateConversation(ctx context.Context, groupID string, userIDs []string) error {
_, err := c.Client.CreateGroupChatConversations(ctx, &pbConversation.CreateGroupChatConversationsReq{UserIDs: userIDs, GroupID: groupID}) _, err := c.Client.CreateGroupChatConversations(ctx, &pbConversation.CreateGroupChatConversationsReq{UserIDs: userIDs, GroupID: groupID})
return err return err
} }
// SetConversationMaxSeq
func (c *ConversationRpcClient) SetConversationMaxSeq(ctx context.Context, ownerUserIDs []string, conversationID string, maxSeq int64) error { func (c *ConversationRpcClient) SetConversationMaxSeq(ctx context.Context, ownerUserIDs []string, conversationID string, maxSeq int64) error {
_, err := c.Client.SetConversationMaxSeq(ctx, &pbConversation.SetConversationMaxSeqReq{OwnerUserID: ownerUserIDs, ConversationID: conversationID, MaxSeq: maxSeq}) _, err := c.Client.SetConversationMaxSeq(ctx, &pbConversation.SetConversationMaxSeqReq{OwnerUserID: ownerUserIDs, ConversationID: conversationID, MaxSeq: maxSeq})
return err return err
} }
// SetConversations
func (c *ConversationRpcClient) SetConversations(ctx context.Context, userIDs []string, conversation *pbConversation.ConversationReq) error { func (c *ConversationRpcClient) SetConversations(ctx context.Context, userIDs []string, conversation *pbConversation.ConversationReq) error {
_, err := c.Client.SetConversations(ctx, &pbConversation.SetConversationsReq{UserIDs: userIDs, Conversation: conversation}) _, err := c.Client.SetConversations(ctx, &pbConversation.SetConversationsReq{UserIDs: userIDs, Conversation: conversation})
return err return err
} }
// GetConversationIDs
func (c *ConversationRpcClient) GetConversationIDs(ctx context.Context, ownerUserID string) ([]string, error) { func (c *ConversationRpcClient) GetConversationIDs(ctx context.Context, ownerUserID string) ([]string, error) {
resp, err := c.Client.GetConversationIDs(ctx, &pbConversation.GetConversationIDsReq{UserID: ownerUserID}) resp, err := c.Client.GetConversationIDs(ctx, &pbConversation.GetConversationIDsReq{UserID: ownerUserID})
if err != nil { if err != nil {
return nil, err return nil, err
} }
return resp.ConversationIDs, nil return resp.ConversationIDs, nil
} }
// GetConversation
func (c *ConversationRpcClient) GetConversation(ctx context.Context, ownerUserID, conversationID string) (*pbConversation.Conversation, error) { func (c *ConversationRpcClient) GetConversation(ctx context.Context, ownerUserID, conversationID string) (*pbConversation.Conversation, error) {
resp, err := c.Client.GetConversation(ctx, &pbConversation.GetConversationReq{OwnerUserID: ownerUserID, ConversationID: conversationID}) resp, err := c.Client.GetConversation(ctx, &pbConversation.GetConversationReq{OwnerUserID: ownerUserID, ConversationID: conversationID})
if err != nil { if err != nil {
return nil, err return nil, err
} }
return resp.Conversation, nil return resp.Conversation, nil
} }
// GetConversationsByConversationID
func (c *ConversationRpcClient) GetConversationsByConversationID(ctx context.Context, conversationIDs []string) ([]*pbConversation.Conversation, error) { func (c *ConversationRpcClient) GetConversationsByConversationID(ctx context.Context, conversationIDs []string) ([]*pbConversation.Conversation, error) {
if len(conversationIDs) == 0 { if len(conversationIDs) == 0 {
return nil, nil return nil, nil
@ -105,9 +125,11 @@ func (c *ConversationRpcClient) GetConversationsByConversationID(ctx context.Con
if len(resp.Conversations) == 0 { if len(resp.Conversations) == 0 {
return nil, errs.ErrRecordNotFound.Wrap(fmt.Sprintf("conversationIDs: %v not found", conversationIDs)) return nil, errs.ErrRecordNotFound.Wrap(fmt.Sprintf("conversationIDs: %v not found", conversationIDs))
} }
return resp.Conversations, nil return resp.Conversations, nil
} }
// GetConversations
func (c *ConversationRpcClient) GetConversations( func (c *ConversationRpcClient) GetConversations(
ctx context.Context, ctx context.Context,
ownerUserID string, ownerUserID string,
@ -123,5 +145,6 @@ func (c *ConversationRpcClient) GetConversations(
if err != nil { if err != nil {
return nil, err return nil, err
} }
return resp.Conversations, nil return resp.Conversations, nil
} }

@ -25,27 +25,33 @@ import (
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws" sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
) )
// Friend
type Friend struct { type Friend struct {
conn grpc.ClientConnInterface conn grpc.ClientConnInterface
Client friend.FriendClient Client friend.FriendClient
discov discoveryregistry.SvcDiscoveryRegistry discov discoveryregistry.SvcDiscoveryRegistry
} }
// NewFriend
func NewFriend(discov discoveryregistry.SvcDiscoveryRegistry) *Friend { func NewFriend(discov discoveryregistry.SvcDiscoveryRegistry) *Friend {
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImFriendName) conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImFriendName)
if err != nil { if err != nil {
panic(err) panic(err)
} }
client := friend.NewFriendClient(conn) client := friend.NewFriendClient(conn)
return &Friend{discov: discov, conn: conn, Client: client} return &Friend{discov: discov, conn: conn, Client: client}
} }
// FriendRpcClient
type FriendRpcClient Friend type FriendRpcClient Friend
// NewFriendRpcClient
func NewFriendRpcClient(discov discoveryregistry.SvcDiscoveryRegistry) FriendRpcClient { func NewFriendRpcClient(discov discoveryregistry.SvcDiscoveryRegistry) FriendRpcClient {
return FriendRpcClient(*NewFriend(discov)) return FriendRpcClient(*NewFriend(discov))
} }
// GetFriendsInfo
func (f *FriendRpcClient) GetFriendsInfo( func (f *FriendRpcClient) GetFriendsInfo(
ctx context.Context, ctx context.Context,
ownerUserID, friendUserID string, ownerUserID, friendUserID string,
@ -58,31 +64,37 @@ func (f *FriendRpcClient) GetFriendsInfo(
return nil, err return nil, err
} }
resp = r.FriendsInfo[0] resp = r.FriendsInfo[0]
return return
} }
// possibleFriendUserID是否在userID的好友中. // IsFriend possibleFriendUserID是否在userID的好友中.
func (f *FriendRpcClient) IsFriend(ctx context.Context, possibleFriendUserID, userID string) (bool, error) { func (f *FriendRpcClient) IsFriend(ctx context.Context, possibleFriendUserID, userID string) (bool, error) {
resp, err := f.Client.IsFriend(ctx, &friend.IsFriendReq{UserID1: userID, UserID2: possibleFriendUserID}) resp, err := f.Client.IsFriend(ctx, &friend.IsFriendReq{UserID1: userID, UserID2: possibleFriendUserID})
if err != nil { if err != nil {
return false, err return false, err
} }
return resp.InUser1Friends, nil return resp.InUser1Friends, nil
} }
// GetFriendIDs
func (f *FriendRpcClient) GetFriendIDs(ctx context.Context, ownerUserID string) (friendIDs []string, err error) { func (f *FriendRpcClient) GetFriendIDs(ctx context.Context, ownerUserID string) (friendIDs []string, err error) {
req := friend.GetFriendIDsReq{UserID: ownerUserID} req := friend.GetFriendIDsReq{UserID: ownerUserID}
resp, err := f.Client.GetFriendIDs(ctx, &req) resp, err := f.Client.GetFriendIDs(ctx, &req)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return resp.FriendIDs, nil return resp.FriendIDs, nil
} }
// IsBlocked
func (b *FriendRpcClient) IsBlocked(ctx context.Context, possibleBlackUserID, userID string) (bool, error) { func (b *FriendRpcClient) IsBlocked(ctx context.Context, possibleBlackUserID, userID string) (bool, error) {
r, err := b.Client.IsBlack(ctx, &friend.IsBlackReq{UserID1: possibleBlackUserID, UserID2: userID}) r, err := b.Client.IsBlack(ctx, &friend.IsBlackReq{UserID1: possibleBlackUserID, UserID2: userID})
if err != nil { if err != nil {
return false, err return false, err
} }
return r.InUser2Blacks, nil return r.InUser2Blacks, nil
} }

@ -29,27 +29,33 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils" "github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
) )
// Group
type Group struct { type Group struct {
conn grpc.ClientConnInterface conn grpc.ClientConnInterface
Client group.GroupClient Client group.GroupClient
discov discoveryregistry.SvcDiscoveryRegistry discov discoveryregistry.SvcDiscoveryRegistry
} }
// NewGroup
func NewGroup(discov discoveryregistry.SvcDiscoveryRegistry) *Group { func NewGroup(discov discoveryregistry.SvcDiscoveryRegistry) *Group {
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImGroupName) conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImGroupName)
if err != nil { if err != nil {
panic(err) panic(err)
} }
client := group.NewGroupClient(conn) client := group.NewGroupClient(conn)
return &Group{discov: discov, conn: conn, Client: client} return &Group{discov: discov, conn: conn, Client: client}
} }
// GroupRpcClient
type GroupRpcClient Group type GroupRpcClient Group
// NewGroupRpcClient
func NewGroupRpcClient(discov discoveryregistry.SvcDiscoveryRegistry) GroupRpcClient { func NewGroupRpcClient(discov discoveryregistry.SvcDiscoveryRegistry) GroupRpcClient {
return GroupRpcClient(*NewGroup(discov)) return GroupRpcClient(*NewGroup(discov))
} }
// GetGroupInfos
func (g *GroupRpcClient) GetGroupInfos( func (g *GroupRpcClient) GetGroupInfos(
ctx context.Context, ctx context.Context,
groupIDs []string, groupIDs []string,
@ -71,14 +77,17 @@ func (g *GroupRpcClient) GetGroupInfos(
return resp.GroupInfos, nil return resp.GroupInfos, nil
} }
// GetGroupInfo
func (g *GroupRpcClient) GetGroupInfo(ctx context.Context, groupID string) (*sdkws.GroupInfo, error) { func (g *GroupRpcClient) GetGroupInfo(ctx context.Context, groupID string) (*sdkws.GroupInfo, error) {
groups, err := g.GetGroupInfos(ctx, []string{groupID}, true) groups, err := g.GetGroupInfos(ctx, []string{groupID}, true)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return groups[0], nil return groups[0], nil
} }
// GetGroupInfoMap
func (g *GroupRpcClient) GetGroupInfoMap( func (g *GroupRpcClient) GetGroupInfoMap(
ctx context.Context, ctx context.Context,
groupIDs []string, groupIDs []string,
@ -88,11 +97,13 @@ func (g *GroupRpcClient) GetGroupInfoMap(
if err != nil { if err != nil {
return nil, err return nil, err
} }
return utils.SliceToMap(groups, func(e *sdkws.GroupInfo) string { return utils.SliceToMap(groups, func(e *sdkws.GroupInfo) string {
return e.GroupID return e.GroupID
}), nil }), nil
} }
// GetGroupMemberInfos
func (g *GroupRpcClient) GetGroupMemberInfos( func (g *GroupRpcClient) GetGroupMemberInfos(
ctx context.Context, ctx context.Context,
groupID string, groupID string,
@ -113,9 +124,11 @@ func (g *GroupRpcClient) GetGroupMemberInfos(
return nil, errs.ErrNotInGroupYet.Wrap(strings.Join(ids, ",")) return nil, errs.ErrNotInGroupYet.Wrap(strings.Join(ids, ","))
} }
} }
return resp.Members, nil return resp.Members, nil
} }
// GetGroupMemberInfo
func (g *GroupRpcClient) GetGroupMemberInfo( func (g *GroupRpcClient) GetGroupMemberInfo(
ctx context.Context, ctx context.Context,
groupID string, groupID string,
@ -125,9 +138,11 @@ func (g *GroupRpcClient) GetGroupMemberInfo(
if err != nil { if err != nil {
return nil, err return nil, err
} }
return members[0], nil return members[0], nil
} }
// GetGroupMemberInfoMap
func (g *GroupRpcClient) GetGroupMemberInfoMap( func (g *GroupRpcClient) GetGroupMemberInfoMap(
ctx context.Context, ctx context.Context,
groupID string, groupID string,
@ -138,11 +153,13 @@ func (g *GroupRpcClient) GetGroupMemberInfoMap(
if err != nil { if err != nil {
return nil, err return nil, err
} }
return utils.SliceToMap(members, func(e *sdkws.GroupMemberFullInfo) string { return utils.SliceToMap(members, func(e *sdkws.GroupMemberFullInfo) string {
return e.UserID return e.UserID
}), nil }), nil
} }
// GetOwnerAndAdminInfos
func (g *GroupRpcClient) GetOwnerAndAdminInfos( func (g *GroupRpcClient) GetOwnerAndAdminInfos(
ctx context.Context, ctx context.Context,
groupID string, groupID string,
@ -154,17 +171,21 @@ func (g *GroupRpcClient) GetOwnerAndAdminInfos(
if err != nil { if err != nil {
return nil, err return nil, err
} }
return resp.Members, nil return resp.Members, nil
} }
// GetOwnerInfo
func (g *GroupRpcClient) GetOwnerInfo(ctx context.Context, groupID string) (*sdkws.GroupMemberFullInfo, error) { func (g *GroupRpcClient) GetOwnerInfo(ctx context.Context, groupID string) (*sdkws.GroupMemberFullInfo, error) {
resp, err := g.Client.GetGroupMemberRoleLevel(ctx, &group.GetGroupMemberRoleLevelReq{ resp, err := g.Client.GetGroupMemberRoleLevel(ctx, &group.GetGroupMemberRoleLevelReq{
GroupID: groupID, GroupID: groupID,
RoleLevels: []int32{constant.GroupOwner}, RoleLevels: []int32{constant.GroupOwner},
}) })
return resp.Members[0], err return resp.Members[0], err
} }
// GetGroupMemberIDs
func (g *GroupRpcClient) GetGroupMemberIDs(ctx context.Context, groupID string) ([]string, error) { func (g *GroupRpcClient) GetGroupMemberIDs(ctx context.Context, groupID string) ([]string, error) {
resp, err := g.Client.GetGroupMemberUserIDs(ctx, &group.GetGroupMemberUserIDsReq{ resp, err := g.Client.GetGroupMemberUserIDs(ctx, &group.GetGroupMemberUserIDsReq{
GroupID: groupID, GroupID: groupID,
@ -172,9 +193,11 @@ func (g *GroupRpcClient) GetGroupMemberIDs(ctx context.Context, groupID string)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return resp.UserIDs, nil return resp.UserIDs, nil
} }
// GetGroupInfoCache
func (g *GroupRpcClient) GetGroupInfoCache(ctx context.Context, groupID string) (*sdkws.GroupInfo, error) { func (g *GroupRpcClient) GetGroupInfoCache(ctx context.Context, groupID string) (*sdkws.GroupInfo, error) {
resp, err := g.Client.GetGroupInfoCache(ctx, &group.GetGroupInfoCacheReq{ resp, err := g.Client.GetGroupInfoCache(ctx, &group.GetGroupInfoCacheReq{
GroupID: groupID, GroupID: groupID,
@ -182,9 +205,11 @@ func (g *GroupRpcClient) GetGroupInfoCache(ctx context.Context, groupID string)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return resp.GroupInfo, nil return resp.GroupInfo, nil
} }
// GetGroupMemberCache
func (g *GroupRpcClient) GetGroupMemberCache( func (g *GroupRpcClient) GetGroupMemberCache(
ctx context.Context, ctx context.Context,
groupID string, groupID string,
@ -197,13 +222,16 @@ func (g *GroupRpcClient) GetGroupMemberCache(
if err != nil { if err != nil {
return nil, err return nil, err
} }
return resp.Member, nil return resp.Member, nil
} }
// DismissGroup
func (g *GroupRpcClient) DismissGroup(ctx context.Context, groupID string) error { func (g *GroupRpcClient) DismissGroup(ctx context.Context, groupID string) error {
_, err := g.Client.DismissGroup(ctx, &group.DismissGroupReq{ _, err := g.Client.DismissGroup(ctx, &group.DismissGroupReq{
GroupID: groupID, GroupID: groupID,
DeleteMember: true, DeleteMember: true,
}) })
return err return err
} }

@ -121,29 +121,36 @@ func newSessionTypeConf() map[int32]int32 {
} }
} }
// Message
type Message struct { type Message struct {
conn grpc.ClientConnInterface conn grpc.ClientConnInterface
Client msg.MsgClient Client msg.MsgClient
discov discoveryregistry.SvcDiscoveryRegistry discov discoveryregistry.SvcDiscoveryRegistry
} }
// NewMessage
func NewMessage(discov discoveryregistry.SvcDiscoveryRegistry) *Message { func NewMessage(discov discoveryregistry.SvcDiscoveryRegistry) *Message {
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImMsgName) conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImMsgName)
if err != nil { if err != nil {
panic(err) panic(err)
} }
client := msg.NewMsgClient(conn) client := msg.NewMsgClient(conn)
return &Message{discov: discov, conn: conn, Client: client} return &Message{discov: discov, conn: conn, Client: client}
} }
// MessageRpcClient
type MessageRpcClient Message type MessageRpcClient Message
// NewMessageRpcClient
func NewMessageRpcClient(discov discoveryregistry.SvcDiscoveryRegistry) MessageRpcClient { func NewMessageRpcClient(discov discoveryregistry.SvcDiscoveryRegistry) MessageRpcClient {
return MessageRpcClient(*NewMessage(discov)) return MessageRpcClient(*NewMessage(discov))
} }
// SendMsg
func (m *MessageRpcClient) SendMsg(ctx context.Context, req *msg.SendMsgReq) (*msg.SendMsgResp, error) { func (m *MessageRpcClient) SendMsg(ctx context.Context, req *msg.SendMsgReq) (*msg.SendMsgResp, error) {
resp, err := m.Client.SendMsg(ctx, req) resp, err := m.Client.SendMsg(ctx, req)
return resp, err return resp, err
} }
@ -154,17 +161,21 @@ func (m *MessageRpcClient) GetMaxSeq(ctx context.Context, req *sdkws.GetMaxSeqRe
func (m *MessageRpcClient) PullMessageBySeqList(ctx context.Context, req *sdkws.PullMessageBySeqsReq) (*sdkws.PullMessageBySeqsResp, error) { func (m *MessageRpcClient) PullMessageBySeqList(ctx context.Context, req *sdkws.PullMessageBySeqsReq) (*sdkws.PullMessageBySeqsResp, error) {
resp, err := m.Client.PullMessageBySeqs(ctx, req) resp, err := m.Client.PullMessageBySeqs(ctx, req)
return resp, err return resp, err
} }
// GetConversationMaxSeq
func (m *MessageRpcClient) GetConversationMaxSeq(ctx context.Context, conversationID string) (int64, error) { func (m *MessageRpcClient) GetConversationMaxSeq(ctx context.Context, conversationID string) (int64, error) {
resp, err := m.Client.GetConversationMaxSeq(ctx, &msg.GetConversationMaxSeqReq{ConversationID: conversationID}) resp, err := m.Client.GetConversationMaxSeq(ctx, &msg.GetConversationMaxSeqReq{ConversationID: conversationID})
if err != nil { if err != nil {
return 0, err return 0, err
} }
return resp.MaxSeq, nil return resp.MaxSeq, nil
} }
// NotificationSender
type NotificationSender struct { type NotificationSender struct {
contentTypeConf map[int32]config.NotificationConf contentTypeConf map[int32]config.NotificationConf
sessionTypeConf map[int32]int32 sessionTypeConf map[int32]int32
@ -172,31 +183,37 @@ type NotificationSender struct {
getUserInfo func(ctx context.Context, userID string) (*sdkws.UserInfo, error) getUserInfo func(ctx context.Context, userID string) (*sdkws.UserInfo, error)
} }
// NotificationSenderOptions
type NotificationSenderOptions func(*NotificationSender) type NotificationSenderOptions func(*NotificationSender)
// WithLocalSendMsg
func WithLocalSendMsg(sendMsg func(ctx context.Context, req *msg.SendMsgReq) (*msg.SendMsgResp, error)) NotificationSenderOptions { func WithLocalSendMsg(sendMsg func(ctx context.Context, req *msg.SendMsgReq) (*msg.SendMsgResp, error)) NotificationSenderOptions {
return func(s *NotificationSender) { return func(s *NotificationSender) {
s.sendMsg = sendMsg s.sendMsg = sendMsg
} }
} }
// WithRpcClient
func WithRpcClient(msgRpcClient *MessageRpcClient) NotificationSenderOptions { func WithRpcClient(msgRpcClient *MessageRpcClient) NotificationSenderOptions {
return func(s *NotificationSender) { return func(s *NotificationSender) {
s.sendMsg = msgRpcClient.SendMsg s.sendMsg = msgRpcClient.SendMsg
} }
} }
// WithUserRpcClient
func WithUserRpcClient(userRpcClient *UserRpcClient) NotificationSenderOptions { func WithUserRpcClient(userRpcClient *UserRpcClient) NotificationSenderOptions {
return func(s *NotificationSender) { return func(s *NotificationSender) {
s.getUserInfo = userRpcClient.GetUserInfo s.getUserInfo = userRpcClient.GetUserInfo
} }
} }
// NewNotificationSender
func NewNotificationSender(opts ...NotificationSenderOptions) *NotificationSender { func NewNotificationSender(opts ...NotificationSenderOptions) *NotificationSender {
notificationSender := &NotificationSender{contentTypeConf: newContentTypeConf(), sessionTypeConf: newSessionTypeConf()} notificationSender := &NotificationSender{contentTypeConf: newContentTypeConf(), sessionTypeConf: newSessionTypeConf()}
for _, opt := range opts { for _, opt := range opts {
opt(notificationSender) opt(notificationSender)
} }
return notificationSender return notificationSender
} }
@ -204,19 +221,23 @@ type notificationOpt struct {
WithRpcGetUsername bool WithRpcGetUsername bool
} }
// NotificationOptions
type NotificationOptions func(*notificationOpt) type NotificationOptions func(*notificationOpt)
// WithRpcGetUserName
func WithRpcGetUserName() NotificationOptions { func WithRpcGetUserName() NotificationOptions {
return func(opt *notificationOpt) { return func(opt *notificationOpt) {
opt.WithRpcGetUsername = true opt.WithRpcGetUsername = true
} }
} }
// NotificationWithSesstionType
func (s *NotificationSender) NotificationWithSesstionType(ctx context.Context, sendID, recvID string, contentType, sesstionType int32, m proto.Message, opts ...NotificationOptions) (err error) { func (s *NotificationSender) NotificationWithSesstionType(ctx context.Context, sendID, recvID string, contentType, sesstionType int32, m proto.Message, opts ...NotificationOptions) (err error) {
n := sdkws.NotificationElem{Detail: utils.StructToJsonString(m)} n := sdkws.NotificationElem{Detail: utils.StructToJsonString(m)}
content, err := json.Marshal(&n) content, err := json.Marshal(&n)
if err != nil { if err != nil {
log.ZError(ctx, "MsgClient Notification json.Marshal failed", err, "sendID", sendID, "recvID", recvID, "contentType", contentType, "msg", m) log.ZError(ctx, "MsgClient Notification json.Marshal failed", err, "sendID", sendID, "recvID", recvID, "contentType", contentType, "msg", m)
return err return err
} }
notificationOpt := &notificationOpt{} notificationOpt := &notificationOpt{}
@ -260,9 +281,11 @@ func (s *NotificationSender) NotificationWithSesstionType(ctx context.Context, s
} else { } else {
log.ZError(ctx, "MsgClient Notification SendMsg failed", err, "req", &req) log.ZError(ctx, "MsgClient Notification SendMsg failed", err, "req", &req)
} }
return err return err
} }
// Notification
func (s *NotificationSender) Notification(ctx context.Context, sendID, recvID string, contentType int32, m proto.Message, opts ...NotificationOptions) error { func (s *NotificationSender) Notification(ctx context.Context, sendID, recvID string, contentType int32, m proto.Message, opts ...NotificationOptions) error {
return s.NotificationWithSesstionType(ctx, sendID, recvID, contentType, s.sessionTypeConf[contentType], m, opts...) return s.NotificationWithSesstionType(ctx, sendID, recvID, contentType, s.sessionTypeConf[contentType], m, opts...)
} }

@ -14,6 +14,7 @@
package notification package notification
// CommonUser
type CommonUser interface { type CommonUser interface {
GetNickname() string GetNickname() string
GetFaceURL() string GetFaceURL() string
@ -21,6 +22,7 @@ type CommonUser interface {
GetEx() string GetEx() string
} }
// CommonGroup
type CommonGroup interface { type CommonGroup interface {
GetNickname() string GetNickname() string
GetFaceURL() string GetFaceURL() string

@ -22,15 +22,17 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
) )
// ConversationNotificationSender
type ConversationNotificationSender struct { type ConversationNotificationSender struct {
*rpcclient.NotificationSender *rpcclient.NotificationSender
} }
// NewConversationNotificationSender
func NewConversationNotificationSender(msgRpcClient *rpcclient.MessageRpcClient) *ConversationNotificationSender { func NewConversationNotificationSender(msgRpcClient *rpcclient.MessageRpcClient) *ConversationNotificationSender {
return &ConversationNotificationSender{rpcclient.NewNotificationSender(rpcclient.WithRpcClient(msgRpcClient))} return &ConversationNotificationSender{rpcclient.NewNotificationSender(rpcclient.WithRpcClient(msgRpcClient))}
} }
// SetPrivate调用. // ConversationSetPrivateNotification
func (c *ConversationNotificationSender) ConversationSetPrivateNotification( func (c *ConversationNotificationSender) ConversationSetPrivateNotification(
ctx context.Context, ctx context.Context,
sendID, recvID string, sendID, recvID string,
@ -41,18 +43,20 @@ func (c *ConversationNotificationSender) ConversationSetPrivateNotification(
SendID: sendID, SendID: sendID,
IsPrivate: isPrivateChat, IsPrivate: isPrivateChat,
} }
return c.Notification(ctx, sendID, recvID, constant.ConversationPrivateChatNotification, tips) return c.Notification(ctx, sendID, recvID, constant.ConversationPrivateChatNotification, tips)
} }
// 会话改变. // ConversationChangeNotification
func (c *ConversationNotificationSender) ConversationChangeNotification(ctx context.Context, userID string) error { func (c *ConversationNotificationSender) ConversationChangeNotification(ctx context.Context, userID string) error {
tips := &sdkws.ConversationUpdateTips{ tips := &sdkws.ConversationUpdateTips{
UserID: userID, UserID: userID,
} }
return c.Notification(ctx, userID, userID, constant.ConversationChangeNotification, tips) return c.Notification(ctx, userID, userID, constant.ConversationChangeNotification, tips)
} }
// 会话未读数同步. // ConversationUnreadChangeNotification
func (c *ConversationNotificationSender) ConversationUnreadChangeNotification( func (c *ConversationNotificationSender) ConversationUnreadChangeNotification(
ctx context.Context, ctx context.Context,
userID, conversationID string, userID, conversationID string,
@ -64,5 +68,6 @@ func (c *ConversationNotificationSender) ConversationUnreadChangeNotification(
HasReadSeq: hasReadSeq, HasReadSeq: hasReadSeq,
UnreadCountTime: unreadCountTime, UnreadCountTime: unreadCountTime,
} }
return c.Notification(ctx, userID, userID, constant.ConversationUnreadNotification, tips) return c.Notification(ctx, userID, userID, constant.ConversationUnreadNotification, tips)
} }

@ -28,9 +28,10 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
) )
// FriendNotificationSender
type FriendNotificationSender struct { type FriendNotificationSender struct {
*rpcclient.NotificationSender *rpcclient.NotificationSender
// 找不到报错 // if not finded, return err
getUsersInfo func(ctx context.Context, userIDs []string) ([]CommonUser, error) getUsersInfo func(ctx context.Context, userIDs []string) ([]CommonUser, error)
// db controller // db controller
db controller.FriendDatabase db controller.FriendDatabase
@ -38,12 +39,14 @@ type FriendNotificationSender struct {
type friendNotificationSenderOptions func(*FriendNotificationSender) type friendNotificationSenderOptions func(*FriendNotificationSender)
// WithFriendDB
func WithFriendDB(db controller.FriendDatabase) friendNotificationSenderOptions { func WithFriendDB(db controller.FriendDatabase) friendNotificationSenderOptions {
return func(s *FriendNotificationSender) { return func(s *FriendNotificationSender) {
s.db = db s.db = db
} }
} }
// WithDBFunc
func WithDBFunc( func WithDBFunc(
fn func(ctx context.Context, userIDs []string) (users []*relationTb.UserModel, err error), fn func(ctx context.Context, userIDs []string) (users []*relationTb.UserModel, err error),
) friendNotificationSenderOptions { ) friendNotificationSenderOptions {
@ -56,12 +59,14 @@ func WithDBFunc(
for _, user := range users { for _, user := range users {
result = append(result, user) result = append(result, user)
} }
return result, nil return result, nil
} }
s.getUsersInfo = f s.getUsersInfo = f
} }
} }
// WithRpcFunc
func WithRpcFunc( func WithRpcFunc(
fn func(ctx context.Context, userIDs []string) ([]*sdkws.UserInfo, error), fn func(ctx context.Context, userIDs []string) ([]*sdkws.UserInfo, error),
) friendNotificationSenderOptions { ) friendNotificationSenderOptions {
@ -74,12 +79,14 @@ func WithRpcFunc(
for _, user := range users { for _, user := range users {
result = append(result, user) result = append(result, user)
} }
return result, err return result, err
} }
s.getUsersInfo = f s.getUsersInfo = f
} }
} }
// NewFriendNotificationSender
func NewFriendNotificationSender( func NewFriendNotificationSender(
msgRpcClient *rpcclient.MessageRpcClient, msgRpcClient *rpcclient.MessageRpcClient,
opts ...friendNotificationSenderOptions, opts ...friendNotificationSenderOptions,
@ -90,6 +97,7 @@ func NewFriendNotificationSender(
for _, opt := range opts { for _, opt := range opts {
opt(f) opt(f)
} }
return f return f
} }
@ -105,6 +113,7 @@ func (f *FriendNotificationSender) getUsersInfoMap(
for _, user := range users { for _, user := range users {
result[user.GetUserID()] = user.(*sdkws.UserInfo) result[user.GetUserID()] = user.(*sdkws.UserInfo)
} }
return result, nil return result, nil
} }
@ -114,16 +123,20 @@ func (f *FriendNotificationSender) getFromToUserNickname(
) (string, string, error) { ) (string, string, error) {
users, err := f.getUsersInfoMap(ctx, []string{fromUserID, toUserID}) users, err := f.getUsersInfoMap(ctx, []string{fromUserID, toUserID})
if err != nil { if err != nil {
return "", "", nil return "", "", err
} }
return users[fromUserID].Nickname, users[toUserID].Nickname, nil return users[fromUserID].Nickname, users[toUserID].Nickname, nil
} }
// UserInfoUpdatedNotification
func (f *FriendNotificationSender) UserInfoUpdatedNotification(ctx context.Context, changedUserID string) error { func (f *FriendNotificationSender) UserInfoUpdatedNotification(ctx context.Context, changedUserID string) error {
tips := sdkws.UserInfoUpdatedTips{UserID: changedUserID} tips := sdkws.UserInfoUpdatedTips{UserID: changedUserID}
return f.Notification(ctx, mcontext.GetOpUserID(ctx), changedUserID, constant.UserInfoUpdatedNotification, &tips) return f.Notification(ctx, mcontext.GetOpUserID(ctx), changedUserID, constant.UserInfoUpdatedNotification, &tips)
} }
// FriendApplicationAddNotification
func (f *FriendNotificationSender) FriendApplicationAddNotification( func (f *FriendNotificationSender) FriendApplicationAddNotification(
ctx context.Context, ctx context.Context,
req *pbFriend.ApplyToAddFriendReq, req *pbFriend.ApplyToAddFriendReq,
@ -132,9 +145,11 @@ func (f *FriendNotificationSender) FriendApplicationAddNotification(
FromUserID: req.FromUserID, FromUserID: req.FromUserID,
ToUserID: req.ToUserID, ToUserID: req.ToUserID,
}} }}
return f.Notification(ctx, req.FromUserID, req.ToUserID, constant.FriendApplicationNotification, &tips) return f.Notification(ctx, req.FromUserID, req.ToUserID, constant.FriendApplicationNotification, &tips)
} }
// FriendApplicationAgreedNotification
func (c *FriendNotificationSender) FriendApplicationAgreedNotification( func (c *FriendNotificationSender) FriendApplicationAgreedNotification(
ctx context.Context, ctx context.Context,
req *pbFriend.RespondFriendApplyReq, req *pbFriend.RespondFriendApplyReq,
@ -143,6 +158,7 @@ func (c *FriendNotificationSender) FriendApplicationAgreedNotification(
FromUserID: req.FromUserID, FromUserID: req.FromUserID,
ToUserID: req.ToUserID, ToUserID: req.ToUserID,
}, HandleMsg: req.HandleMsg} }, HandleMsg: req.HandleMsg}
return c.Notification(ctx, req.ToUserID, req.FromUserID, constant.FriendApplicationApprovedNotification, &tips) return c.Notification(ctx, req.ToUserID, req.FromUserID, constant.FriendApplicationApprovedNotification, &tips)
} }
@ -154,9 +170,11 @@ func (c *FriendNotificationSender) FriendApplicationRefusedNotification(
FromUserID: req.FromUserID, FromUserID: req.FromUserID,
ToUserID: req.ToUserID, ToUserID: req.ToUserID,
}, HandleMsg: req.HandleMsg} }, HandleMsg: req.HandleMsg}
return c.Notification(ctx, req.ToUserID, req.FromUserID, constant.FriendApplicationRejectedNotification, &tips) return c.Notification(ctx, req.ToUserID, req.FromUserID, constant.FriendApplicationRejectedNotification, &tips)
} }
// FriendAddedNotification
func (c *FriendNotificationSender) FriendAddedNotification( func (c *FriendNotificationSender) FriendAddedNotification(
ctx context.Context, ctx context.Context,
operationID, opUserID, fromUserID, toUserID string, operationID, opUserID, fromUserID, toUserID string,
@ -178,31 +196,39 @@ func (c *FriendNotificationSender) FriendAddedNotification(
if err != nil { if err != nil {
return err return err
} }
return c.Notification(ctx, fromUserID, toUserID, constant.FriendAddedNotification, &tips) return c.Notification(ctx, fromUserID, toUserID, constant.FriendAddedNotification, &tips)
} }
// FriendDeletedNotification
func (c *FriendNotificationSender) FriendDeletedNotification(ctx context.Context, req *pbFriend.DeleteFriendReq) error { func (c *FriendNotificationSender) FriendDeletedNotification(ctx context.Context, req *pbFriend.DeleteFriendReq) error {
tips := sdkws.FriendDeletedTips{FromToUserID: &sdkws.FromToUserID{ tips := sdkws.FriendDeletedTips{FromToUserID: &sdkws.FromToUserID{
FromUserID: req.OwnerUserID, FromUserID: req.OwnerUserID,
ToUserID: req.FriendUserID, ToUserID: req.FriendUserID,
}} }}
return c.Notification(ctx, req.OwnerUserID, req.FriendUserID, constant.FriendDeletedNotification, &tips) return c.Notification(ctx, req.OwnerUserID, req.FriendUserID, constant.FriendDeletedNotification, &tips)
} }
// FriendRemarkSetNotification
func (c *FriendNotificationSender) FriendRemarkSetNotification(ctx context.Context, fromUserID, toUserID string) error { func (c *FriendNotificationSender) FriendRemarkSetNotification(ctx context.Context, fromUserID, toUserID string) error {
tips := sdkws.FriendInfoChangedTips{FromToUserID: &sdkws.FromToUserID{}} tips := sdkws.FriendInfoChangedTips{FromToUserID: &sdkws.FromToUserID{}}
tips.FromToUserID.FromUserID = fromUserID tips.FromToUserID.FromUserID = fromUserID
tips.FromToUserID.ToUserID = toUserID tips.FromToUserID.ToUserID = toUserID
return c.Notification(ctx, fromUserID, toUserID, constant.FriendRemarkSetNotification, &tips) return c.Notification(ctx, fromUserID, toUserID, constant.FriendRemarkSetNotification, &tips)
} }
// BlackAddedNotification
func (c *FriendNotificationSender) BlackAddedNotification(ctx context.Context, req *pbFriend.AddBlackReq) error { func (c *FriendNotificationSender) BlackAddedNotification(ctx context.Context, req *pbFriend.AddBlackReq) error {
tips := sdkws.BlackAddedTips{FromToUserID: &sdkws.FromToUserID{}} tips := sdkws.BlackAddedTips{FromToUserID: &sdkws.FromToUserID{}}
tips.FromToUserID.FromUserID = req.OwnerUserID tips.FromToUserID.FromUserID = req.OwnerUserID
tips.FromToUserID.ToUserID = req.BlackUserID tips.FromToUserID.ToUserID = req.BlackUserID
return c.Notification(ctx, req.OwnerUserID, req.BlackUserID, constant.BlackAddedNotification, &tips) return c.Notification(ctx, req.OwnerUserID, req.BlackUserID, constant.BlackAddedNotification, &tips)
} }
// BlackDeletedNotification
func (c *FriendNotificationSender) BlackDeletedNotification(ctx context.Context, req *pbFriend.RemoveBlackReq) { func (c *FriendNotificationSender) BlackDeletedNotification(ctx context.Context, req *pbFriend.RemoveBlackReq) {
blackDeletedTips := sdkws.BlackDeletedTips{FromToUserID: &sdkws.FromToUserID{ blackDeletedTips := sdkws.BlackDeletedTips{FromToUserID: &sdkws.FromToUserID{
FromUserID: req.OwnerUserID, FromUserID: req.OwnerUserID,
@ -211,6 +237,7 @@ func (c *FriendNotificationSender) BlackDeletedNotification(ctx context.Context,
c.Notification(ctx, req.OwnerUserID, req.BlackUserID, constant.BlackDeletedNotification, &blackDeletedTips) c.Notification(ctx, req.OwnerUserID, req.BlackUserID, constant.BlackDeletedNotification, &blackDeletedTips)
} }
// FriendInfoUpdatedNotification
func (c *FriendNotificationSender) FriendInfoUpdatedNotification( func (c *FriendNotificationSender) FriendInfoUpdatedNotification(
ctx context.Context, ctx context.Context,
changedUserID string, changedUserID string,

@ -30,6 +30,7 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils" "github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
) )
// NewGroupNotificationSender
func NewGroupNotificationSender( func NewGroupNotificationSender(
db controller.GroupDatabase, db controller.GroupDatabase,
msgRpcClient *rpcclient.MessageRpcClient, msgRpcClient *rpcclient.MessageRpcClient,
@ -43,6 +44,7 @@ func NewGroupNotificationSender(
} }
} }
// GroupNotificationSender
type GroupNotificationSender struct { type GroupNotificationSender struct {
*rpcclient.NotificationSender *rpcclient.NotificationSender
getUsersInfo func(ctx context.Context, userIDs []string) ([]CommonUser, error) getUsersInfo func(ctx context.Context, userIDs []string) ([]CommonUser, error)
@ -57,6 +59,7 @@ func (g *GroupNotificationSender) getUser(ctx context.Context, userID string) (*
if len(users) == 0 { if len(users) == 0 {
return nil, errs.ErrUserIDNotFound.Wrap(fmt.Sprintf("user %s not found", userID)) return nil, errs.ErrUserIDNotFound.Wrap(fmt.Sprintf("user %s not found", userID))
} }
return &sdkws.PublicUserInfo{ return &sdkws.PublicUserInfo{
UserID: users[0].GetUserID(), UserID: users[0].GetUserID(),
Nickname: users[0].GetNickname(), Nickname: users[0].GetNickname(),
@ -78,6 +81,7 @@ func (g *GroupNotificationSender) getGroupInfo(ctx context.Context, groupID stri
if err != nil { if err != nil {
return nil, err return nil, err
} }
return &sdkws.GroupInfo{ return &sdkws.GroupInfo{
GroupID: gm.GroupID, GroupID: gm.GroupID,
GroupName: gm.GroupName, GroupName: gm.GroupName,
@ -122,7 +126,7 @@ func (g *GroupNotificationSender) getGroupMembers(ctx context.Context, groupID s
res = append(res, g.groupMemberDB2PB(member, user.AppMangerLevel)) res = append(res, g.groupMemberDB2PB(member, user.AppMangerLevel))
delete(users, member.UserID) delete(users, member.UserID)
} }
//for userID, info := range users { // for userID, info := range users {
// if info.AppMangerLevel == constant.AppAdmin { // if info.AppMangerLevel == constant.AppAdmin {
// res = append(res, &sdkws.GroupMemberFullInfo{ // res = append(res, &sdkws.GroupMemberFullInfo{
// GroupID: groupID, // GroupID: groupID,
@ -132,7 +136,7 @@ func (g *GroupNotificationSender) getGroupMembers(ctx context.Context, groupID s
// AppMangerLevel: info.AppMangerLevel, // AppMangerLevel: info.AppMangerLevel,
// }) // })
// } // }
//} // }
return res, nil return res, nil
} }
@ -145,6 +149,7 @@ func (g *GroupNotificationSender) getGroupMemberMap(ctx context.Context, groupID
for i, member := range members { for i, member := range members {
m[member.UserID] = members[i] m[member.UserID] = members[i]
} }
return m, nil return m, nil
} }
@ -156,6 +161,7 @@ func (g *GroupNotificationSender) getGroupMember(ctx context.Context, groupID st
if len(members) == 0 { if len(members) == 0 {
return nil, errs.ErrInternalServer.Wrap(fmt.Sprintf("group %s member %s not found", groupID, userID)) return nil, errs.ErrInternalServer.Wrap(fmt.Sprintf("group %s member %s not found", groupID, userID))
} }
return members[0], nil return members[0], nil
} }
@ -165,6 +171,7 @@ func (g *GroupNotificationSender) getGroupOwnerAndAdminUserID(ctx context.Contex
return nil, err return nil, err
} }
fn := func(e *relation.GroupMemberModel) string { return e.UserID } fn := func(e *relation.GroupMemberModel) string { return e.UserID }
return utils.Slice(members, fn), nil return utils.Slice(members, fn), nil
} }
@ -216,6 +223,7 @@ func (g *GroupNotificationSender) getUsersInfoMap(ctx context.Context, userIDs [
for _, user := range users { for _, user := range users {
result[user.GetUserID()] = user.(*sdkws.UserInfo) result[user.GetUserID()] = user.(*sdkws.UserInfo)
} }
return result, nil return result, nil
} }
@ -255,37 +263,47 @@ func (g *GroupNotificationSender) fillOpUser(ctx context.Context, opUser **sdkws
(*opUser).FaceURL = user.FaceURL (*opUser).FaceURL = user.FaceURL
} }
} }
return nil return nil
} }
// GroupCreatedNotification
func (g *GroupNotificationSender) GroupCreatedNotification(ctx context.Context, tips *sdkws.GroupCreatedTips) (err error) { func (g *GroupNotificationSender) GroupCreatedNotification(ctx context.Context, tips *sdkws.GroupCreatedTips) (err error) {
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil { if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
return err return err
} }
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupCreatedNotification, tips) return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupCreatedNotification, tips)
} }
// GroupInfoSetNotification
func (g *GroupNotificationSender) GroupInfoSetNotification(ctx context.Context, tips *sdkws.GroupInfoSetTips) (err error) { func (g *GroupNotificationSender) GroupInfoSetNotification(ctx context.Context, tips *sdkws.GroupInfoSetTips) (err error) {
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil { if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
return err return err
} }
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupInfoSetNotification, tips, rpcclient.WithRpcGetUserName()) return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupInfoSetNotification, tips, rpcclient.WithRpcGetUserName())
} }
// GroupInfoSetNameNotification
func (g *GroupNotificationSender) GroupInfoSetNameNotification(ctx context.Context, tips *sdkws.GroupInfoSetNameTips) (err error) { func (g *GroupNotificationSender) GroupInfoSetNameNotification(ctx context.Context, tips *sdkws.GroupInfoSetNameTips) (err error) {
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil { if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
return err return err
} }
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupInfoSetNameNotification, tips) return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupInfoSetNameNotification, tips)
} }
// GroupInfoSetAnnouncementNotification
func (g *GroupNotificationSender) GroupInfoSetAnnouncementNotification(ctx context.Context, tips *sdkws.GroupInfoSetAnnouncementTips) (err error) { func (g *GroupNotificationSender) GroupInfoSetAnnouncementNotification(ctx context.Context, tips *sdkws.GroupInfoSetAnnouncementTips) (err error) {
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil { if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
return err return err
} }
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupInfoSetAnnouncementNotification, tips, rpcclient.WithRpcGetUserName()) return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupInfoSetAnnouncementNotification, tips, rpcclient.WithRpcGetUserName())
} }
// JoinGroupApplicationNotification
func (g *GroupNotificationSender) JoinGroupApplicationNotification(ctx context.Context, req *pbGroup.JoinGroupReq) (err error) { func (g *GroupNotificationSender) JoinGroupApplicationNotification(ctx context.Context, req *pbGroup.JoinGroupReq) (err error) {
group, err := g.getGroupInfo(ctx, req.GroupID) group, err := g.getGroupInfo(ctx, req.GroupID)
if err != nil { if err != nil {
@ -307,9 +325,11 @@ func (g *GroupNotificationSender) JoinGroupApplicationNotification(ctx context.C
log.ZError(ctx, "JoinGroupApplicationNotification failed", err, "group", req.GroupID, "userID", userID) log.ZError(ctx, "JoinGroupApplicationNotification failed", err, "group", req.GroupID, "userID", userID)
} }
} }
return nil return nil
} }
// MemberQuitNotification
func (g *GroupNotificationSender) MemberQuitNotification(ctx context.Context, member *sdkws.GroupMemberFullInfo) (err error) { func (g *GroupNotificationSender) MemberQuitNotification(ctx context.Context, member *sdkws.GroupMemberFullInfo) (err error) {
defer log.ZDebug(ctx, "return") defer log.ZDebug(ctx, "return")
defer func() { defer func() {
@ -322,9 +342,11 @@ func (g *GroupNotificationSender) MemberQuitNotification(ctx context.Context, me
return err return err
} }
tips := &sdkws.MemberQuitTips{Group: group, QuitUser: member} tips := &sdkws.MemberQuitTips{Group: group, QuitUser: member}
return g.Notification(ctx, mcontext.GetOpUserID(ctx), member.GroupID, constant.MemberQuitNotification, tips) return g.Notification(ctx, mcontext.GetOpUserID(ctx), member.GroupID, constant.MemberQuitNotification, tips)
} }
// GroupApplicationAcceptedNotification
func (g *GroupNotificationSender) GroupApplicationAcceptedNotification(ctx context.Context, req *pbGroup.GroupApplicationResponseReq) (err error) { func (g *GroupNotificationSender) GroupApplicationAcceptedNotification(ctx context.Context, req *pbGroup.GroupApplicationResponseReq) (err error) {
defer log.ZDebug(ctx, "return") defer log.ZDebug(ctx, "return")
defer func() { defer func() {
@ -350,9 +372,11 @@ func (g *GroupNotificationSender) GroupApplicationAcceptedNotification(ctx conte
log.ZError(ctx, "failed", err) log.ZError(ctx, "failed", err)
} }
} }
return nil return nil
} }
// GroupApplicationRejectedNotification
func (g *GroupNotificationSender) GroupApplicationRejectedNotification(ctx context.Context, req *pbGroup.GroupApplicationResponseReq) (err error) { func (g *GroupNotificationSender) GroupApplicationRejectedNotification(ctx context.Context, req *pbGroup.GroupApplicationResponseReq) (err error) {
group, err := g.getGroupInfo(ctx, req.GroupID) group, err := g.getGroupInfo(ctx, req.GroupID)
if err != nil { if err != nil {
@ -372,9 +396,11 @@ func (g *GroupNotificationSender) GroupApplicationRejectedNotification(ctx conte
log.ZError(ctx, "failed", err) log.ZError(ctx, "failed", err)
} }
} }
return nil return nil
} }
// GroupOwnerTransferredNotification
func (g *GroupNotificationSender) GroupOwnerTransferredNotification(ctx context.Context, req *pbGroup.TransferGroupOwnerReq) (err error) { func (g *GroupNotificationSender) GroupOwnerTransferredNotification(ctx context.Context, req *pbGroup.TransferGroupOwnerReq) (err error) {
group, err := g.getGroupInfo(ctx, req.GroupID) group, err := g.getGroupInfo(ctx, req.GroupID)
if err != nil { if err != nil {
@ -389,16 +415,20 @@ func (g *GroupNotificationSender) GroupOwnerTransferredNotification(ctx context.
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil { if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
return err return err
} }
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupOwnerTransferredNotification, tips) return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupOwnerTransferredNotification, tips)
} }
// MemberKickedNotification
func (g *GroupNotificationSender) MemberKickedNotification(ctx context.Context, tips *sdkws.MemberKickedTips) (err error) { func (g *GroupNotificationSender) MemberKickedNotification(ctx context.Context, tips *sdkws.MemberKickedTips) (err error) {
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil { if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
return err return err
} }
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.MemberKickedNotification, tips) return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.MemberKickedNotification, tips)
} }
// MemberInvitedNotification
func (g *GroupNotificationSender) MemberInvitedNotification(ctx context.Context, groupID, reason string, invitedUserIDList []string) (err error) { func (g *GroupNotificationSender) MemberInvitedNotification(ctx context.Context, groupID, reason string, invitedUserIDList []string) (err error) {
group, err := g.getGroupInfo(ctx, groupID) group, err := g.getGroupInfo(ctx, groupID)
if err != nil { if err != nil {
@ -415,9 +445,11 @@ func (g *GroupNotificationSender) MemberInvitedNotification(ctx context.Context,
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil { if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
return err return err
} }
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.MemberInvitedNotification, tips) return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.MemberInvitedNotification, tips)
} }
// MemberEnterNotification
func (g *GroupNotificationSender) MemberEnterNotification(ctx context.Context, req *pbGroup.GroupApplicationResponseReq) (err error) { func (g *GroupNotificationSender) MemberEnterNotification(ctx context.Context, req *pbGroup.GroupApplicationResponseReq) (err error) {
group, err := g.getGroupInfo(ctx, req.GroupID) group, err := g.getGroupInfo(ctx, req.GroupID)
if err != nil { if err != nil {
@ -435,9 +467,11 @@ func (g *GroupNotificationSender) GroupDismissedNotification(ctx context.Context
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil { if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
return err return err
} }
return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupDismissedNotification, tips) return g.Notification(ctx, mcontext.GetOpUserID(ctx), tips.Group.GroupID, constant.GroupDismissedNotification, tips)
} }
// GroupMemberMutedNotification
func (g *GroupNotificationSender) GroupMemberMutedNotification(ctx context.Context, groupID, groupMemberUserID string, mutedSeconds uint32) (err error) { func (g *GroupNotificationSender) GroupMemberMutedNotification(ctx context.Context, groupID, groupMemberUserID string, mutedSeconds uint32) (err error) {
group, err := g.getGroupInfo(ctx, groupID) group, err := g.getGroupInfo(ctx, groupID)
if err != nil { if err != nil {
@ -454,6 +488,7 @@ func (g *GroupNotificationSender) GroupMemberMutedNotification(ctx context.Conte
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil { if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
return err return err
} }
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberMutedNotification, tips) return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberMutedNotification, tips)
} }
@ -470,6 +505,7 @@ func (g *GroupNotificationSender) GroupMemberCancelMutedNotification(ctx context
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil { if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
return err return err
} }
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberCancelMutedNotification, tips) return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberCancelMutedNotification, tips)
} }
@ -489,6 +525,7 @@ func (g *GroupNotificationSender) GroupMutedNotification(ctx context.Context, gr
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil { if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
return err return err
} }
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMutedNotification, tips) return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMutedNotification, tips)
} }
@ -508,9 +545,11 @@ func (g *GroupNotificationSender) GroupCancelMutedNotification(ctx context.Conte
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil { if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
return err return err
} }
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupCancelMutedNotification, tips) return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupCancelMutedNotification, tips)
} }
// GroupMemberInfoSetNotification
func (g *GroupNotificationSender) GroupMemberInfoSetNotification(ctx context.Context, groupID, groupMemberUserID string) (err error) { func (g *GroupNotificationSender) GroupMemberInfoSetNotification(ctx context.Context, groupID, groupMemberUserID string) (err error) {
group, err := g.getGroupInfo(ctx, groupID) group, err := g.getGroupInfo(ctx, groupID)
if err != nil { if err != nil {
@ -524,6 +563,7 @@ func (g *GroupNotificationSender) GroupMemberInfoSetNotification(ctx context.Con
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil { if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
return err return err
} }
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberInfoSetNotification, tips) return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberInfoSetNotification, tips)
} }
@ -540,6 +580,7 @@ func (g *GroupNotificationSender) GroupMemberSetToAdminNotification(ctx context.
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil { if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
return err return err
} }
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberSetToAdminNotification, tips) return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberSetToAdminNotification, tips)
} }
@ -556,9 +597,11 @@ func (g *GroupNotificationSender) GroupMemberSetToOrdinaryUserNotification(ctx c
if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil { if err := g.fillOpUser(ctx, &tips.OpUser, tips.Group.GroupID); err != nil {
return err return err
} }
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberSetToOrdinaryUserNotification, tips) return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.GroupMemberSetToOrdinaryUserNotification, tips)
} }
// MemberEnterDirectlyNotification
func (g *GroupNotificationSender) MemberEnterDirectlyNotification(ctx context.Context, groupID string, entrantUserID string) (err error) { func (g *GroupNotificationSender) MemberEnterDirectlyNotification(ctx context.Context, groupID string, entrantUserID string) (err error) {
defer log.ZDebug(ctx, "return") defer log.ZDebug(ctx, "return")
defer func() { defer func() {
@ -575,9 +618,11 @@ func (g *GroupNotificationSender) MemberEnterDirectlyNotification(ctx context.Co
return err return err
} }
tips := &sdkws.MemberEnterTips{Group: group, EntrantUser: user} tips := &sdkws.MemberEnterTips{Group: group, EntrantUser: user}
return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.MemberEnterNotification, tips) return g.Notification(ctx, mcontext.GetOpUserID(ctx), group.GroupID, constant.MemberEnterNotification, tips)
} }
// SuperGroupNotification
func (g *GroupNotificationSender) SuperGroupNotification(ctx context.Context, sendID, recvID string) (err error) { func (g *GroupNotificationSender) SuperGroupNotification(ctx context.Context, sendID, recvID string) (err error) {
defer log.ZDebug(ctx, "return") defer log.ZDebug(ctx, "return")
defer func() { defer func() {
@ -586,5 +631,6 @@ func (g *GroupNotificationSender) SuperGroupNotification(ctx context.Context, se
} }
}() }()
err = g.Notification(ctx, sendID, recvID, constant.SuperGroupUpdateNotification, nil) err = g.Notification(ctx, sendID, recvID, constant.SuperGroupUpdateNotification, nil)
return err return err
} }

@ -22,23 +22,28 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient" "github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
) )
// MsgNotificationSender
type MsgNotificationSender struct { type MsgNotificationSender struct {
*rpcclient.NotificationSender *rpcclient.NotificationSender
} }
// NewMsgNotificationSender
func NewMsgNotificationSender(opts ...rpcclient.NotificationSenderOptions) *MsgNotificationSender { func NewMsgNotificationSender(opts ...rpcclient.NotificationSenderOptions) *MsgNotificationSender {
return &MsgNotificationSender{rpcclient.NewNotificationSender(opts...)} return &MsgNotificationSender{rpcclient.NewNotificationSender(opts...)}
} }
// UserDeleteMsgsNotification
func (m *MsgNotificationSender) UserDeleteMsgsNotification(ctx context.Context, userID, conversationID string, seqs []int64) error { func (m *MsgNotificationSender) UserDeleteMsgsNotification(ctx context.Context, userID, conversationID string, seqs []int64) error {
tips := sdkws.DeleteMsgsTips{ tips := sdkws.DeleteMsgsTips{
UserID: userID, UserID: userID,
ConversationID: conversationID, ConversationID: conversationID,
Seqs: seqs, Seqs: seqs,
} }
return m.Notification(ctx, userID, userID, constant.DeleteMsgsNotification, &tips) return m.Notification(ctx, userID, userID, constant.DeleteMsgsNotification, &tips)
} }
// MarkAsReadNotification
func (m *MsgNotificationSender) MarkAsReadNotification(ctx context.Context, conversationID string, sesstionType int32, sendID, recvID string, seqs []int64, hasReadSeq int64) error { func (m *MsgNotificationSender) MarkAsReadNotification(ctx context.Context, conversationID string, sesstionType int32, sendID, recvID string, seqs []int64, hasReadSeq int64) error {
tips := &sdkws.MarkAsReadTips{ tips := &sdkws.MarkAsReadTips{
MarkAsReadUserID: sendID, MarkAsReadUserID: sendID,
@ -46,5 +51,6 @@ func (m *MsgNotificationSender) MarkAsReadNotification(ctx context.Context, conv
Seqs: seqs, Seqs: seqs,
HasReadSeq: hasReadSeq, HasReadSeq: hasReadSeq,
} }
return m.NotificationWithSesstionType(ctx, sendID, recvID, constant.HasReadReceipt, sesstionType, tips) return m.NotificationWithSesstionType(ctx, sendID, recvID, constant.HasReadReceipt, sesstionType, tips)
} }

@ -24,17 +24,20 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/push" "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/push"
) )
// Push
type Push struct { type Push struct {
conn grpc.ClientConnInterface conn grpc.ClientConnInterface
Client push.PushMsgServiceClient Client push.PushMsgServiceClient
discov discoveryregistry.SvcDiscoveryRegistry discov discoveryregistry.SvcDiscoveryRegistry
} }
// NewPush
func NewPush(discov discoveryregistry.SvcDiscoveryRegistry) *Push { func NewPush(discov discoveryregistry.SvcDiscoveryRegistry) *Push {
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImPushName) conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImPushName)
if err != nil { if err != nil {
panic(err) panic(err)
} }
return &Push{ return &Push{
discov: discov, discov: discov,
conn: conn, conn: conn,
@ -42,12 +45,15 @@ func NewPush(discov discoveryregistry.SvcDiscoveryRegistry) *Push {
} }
} }
// PushRpcClient
type PushRpcClient Push type PushRpcClient Push
// NewPushRpcClient
func NewPushRpcClient(discov discoveryregistry.SvcDiscoveryRegistry) PushRpcClient { func NewPushRpcClient(discov discoveryregistry.SvcDiscoveryRegistry) PushRpcClient {
return PushRpcClient(*NewPush(discov)) return PushRpcClient(*NewPush(discov))
} }
// DelUserPushToken
func (p *PushRpcClient) DelUserPushToken( func (p *PushRpcClient) DelUserPushToken(
ctx context.Context, ctx context.Context,
req *push.DelUserPushTokenReq, req *push.DelUserPushTokenReq,

@ -28,6 +28,7 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/third" "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/third"
) )
// Third
type Third struct { type Third struct {
conn grpc.ClientConnInterface conn grpc.ClientConnInterface
Client third.ThirdClient Client third.ThirdClient
@ -35,20 +36,22 @@ type Third struct {
MinioClient *minio.Client MinioClient *minio.Client
} }
// NewThird
func NewThird(discov discoveryregistry.SvcDiscoveryRegistry) *Third { func NewThird(discov discoveryregistry.SvcDiscoveryRegistry) *Third {
var minioClient *minio.Client
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImThirdName) conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImThirdName)
if err != nil { if err != nil {
panic(err) panic(err)
} }
client := third.NewThirdClient(conn) client := third.NewThirdClient(conn)
minioClient, err := minioInit() minioClient, err = minioInit()
return &Third{discov: discov, Client: client, conn: conn, MinioClient: minioClient} return &Third{discov: discov, Client: client, conn: conn, MinioClient: minioClient}
} }
func minioInit() (*minio.Client, error) { func minioInit() (*minio.Client, error) {
minioClient := &minio.Client{} var minioClient *minio.Client
var initUrl string initUrl := config.Config.Object.Minio.Endpoint
initUrl = config.Config.Object.Minio.Endpoint
minioUrl, err := url.Parse(initUrl) minioUrl, err := url.Parse(initUrl)
if err != nil { if err != nil {
return nil, err return nil, err
@ -66,5 +69,6 @@ func minioInit() (*minio.Client, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
return minioClient, nil return minioClient, nil
} }

@ -29,32 +29,39 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils" "github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
) )
// User
type User struct { type User struct {
conn grpc.ClientConnInterface conn grpc.ClientConnInterface
Client user.UserClient Client user.UserClient
Discov discoveryregistry.SvcDiscoveryRegistry Discov discoveryregistry.SvcDiscoveryRegistry
} }
// NewUser
func NewUser(discov discoveryregistry.SvcDiscoveryRegistry) *User { func NewUser(discov discoveryregistry.SvcDiscoveryRegistry) *User {
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImUserName) conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImUserName)
if err != nil { if err != nil {
panic(err) panic(err)
} }
client := user.NewUserClient(conn) client := user.NewUserClient(conn)
return &User{Discov: discov, Client: client, conn: conn} return &User{Discov: discov, Client: client, conn: conn}
} }
type UserRpcClient User type UserRpcClient User
// NewUserRpcClientByUser
func NewUserRpcClientByUser(user *User) *UserRpcClient { func NewUserRpcClientByUser(user *User) *UserRpcClient {
rpc := UserRpcClient(*user) rpc := UserRpcClient(*user)
return &rpc return &rpc
} }
// NewUserRpcClient
func NewUserRpcClient(client discoveryregistry.SvcDiscoveryRegistry) UserRpcClient { func NewUserRpcClient(client discoveryregistry.SvcDiscoveryRegistry) UserRpcClient {
return UserRpcClient(*NewUser(client)) return UserRpcClient(*NewUser(client))
} }
// GetUsersInfo
func (u *UserRpcClient) GetUsersInfo(ctx context.Context, userIDs []string) ([]*sdkws.UserInfo, error) { func (u *UserRpcClient) GetUsersInfo(ctx context.Context, userIDs []string) ([]*sdkws.UserInfo, error) {
resp, err := u.Client.GetDesignateUsers(ctx, &user.GetDesignateUsersReq{ resp, err := u.Client.GetDesignateUsers(ctx, &user.GetDesignateUsersReq{
UserIDs: userIDs, UserIDs: userIDs,
@ -67,27 +74,33 @@ func (u *UserRpcClient) GetUsersInfo(ctx context.Context, userIDs []string) ([]*
})); len(ids) > 0 { })); len(ids) > 0 {
return nil, errs.ErrUserIDNotFound.Wrap(strings.Join(ids, ",")) return nil, errs.ErrUserIDNotFound.Wrap(strings.Join(ids, ","))
} }
return resp.UsersInfo, nil return resp.UsersInfo, nil
} }
// GetUserInfo
func (u *UserRpcClient) GetUserInfo(ctx context.Context, userID string) (*sdkws.UserInfo, error) { func (u *UserRpcClient) GetUserInfo(ctx context.Context, userID string) (*sdkws.UserInfo, error) {
users, err := u.GetUsersInfo(ctx, []string{userID}) users, err := u.GetUsersInfo(ctx, []string{userID})
if err != nil { if err != nil {
return nil, err return nil, err
} }
return users[0], nil return users[0], nil
} }
// GetUsersInfoMap
func (u *UserRpcClient) GetUsersInfoMap(ctx context.Context, userIDs []string) (map[string]*sdkws.UserInfo, error) { func (u *UserRpcClient) GetUsersInfoMap(ctx context.Context, userIDs []string) (map[string]*sdkws.UserInfo, error) {
users, err := u.GetUsersInfo(ctx, userIDs) users, err := u.GetUsersInfo(ctx, userIDs)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return utils.SliceToMap(users, func(e *sdkws.UserInfo) string { return utils.SliceToMap(users, func(e *sdkws.UserInfo) string {
return e.UserID return e.UserID
}), nil }), nil
} }
// GetPublicUserInfos
func (u *UserRpcClient) GetPublicUserInfos( func (u *UserRpcClient) GetPublicUserInfos(
ctx context.Context, ctx context.Context,
userIDs []string, userIDs []string,
@ -97,6 +110,7 @@ func (u *UserRpcClient) GetPublicUserInfos(
if err != nil { if err != nil {
return nil, err return nil, err
} }
return utils.Slice(users, func(e *sdkws.UserInfo) *sdkws.PublicUserInfo { return utils.Slice(users, func(e *sdkws.UserInfo) *sdkws.PublicUserInfo {
return &sdkws.PublicUserInfo{ return &sdkws.PublicUserInfo{
UserID: e.UserID, UserID: e.UserID,
@ -107,14 +121,17 @@ func (u *UserRpcClient) GetPublicUserInfos(
}), nil }), nil
} }
// GetPublicUserInfo
func (u *UserRpcClient) GetPublicUserInfo(ctx context.Context, userID string) (*sdkws.PublicUserInfo, error) { func (u *UserRpcClient) GetPublicUserInfo(ctx context.Context, userID string) (*sdkws.PublicUserInfo, error) {
users, err := u.GetPublicUserInfos(ctx, []string{userID}, true) users, err := u.GetPublicUserInfos(ctx, []string{userID}, true)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return users[0], nil return users[0], nil
} }
// GetPublicUserInfoMap
func (u *UserRpcClient) GetPublicUserInfoMap( func (u *UserRpcClient) GetPublicUserInfoMap(
ctx context.Context, ctx context.Context,
userIDs []string, userIDs []string,
@ -124,11 +141,13 @@ func (u *UserRpcClient) GetPublicUserInfoMap(
if err != nil { if err != nil {
return nil, err return nil, err
} }
return utils.SliceToMap(users, func(e *sdkws.PublicUserInfo) string { return utils.SliceToMap(users, func(e *sdkws.PublicUserInfo) string {
return e.UserID return e.UserID
}), nil }), nil
} }
// GetUserGlobalMsgRecvOpt
func (u *UserRpcClient) GetUserGlobalMsgRecvOpt(ctx context.Context, userID string) (int32, error) { func (u *UserRpcClient) GetUserGlobalMsgRecvOpt(ctx context.Context, userID string) (int32, error) {
resp, err := u.Client.GetGlobalRecvMessageOpt(ctx, &user.GetGlobalRecvMessageOptReq{ resp, err := u.Client.GetGlobalRecvMessageOpt(ctx, &user.GetGlobalRecvMessageOptReq{
UserID: userID, UserID: userID,
@ -136,21 +155,26 @@ func (u *UserRpcClient) GetUserGlobalMsgRecvOpt(ctx context.Context, userID stri
if err != nil { if err != nil {
return 0, err return 0, err
} }
return resp.GlobalRecvMsgOpt, err return resp.GlobalRecvMsgOpt, err
} }
// Access
func (u *UserRpcClient) Access(ctx context.Context, ownerUserID string) error { func (u *UserRpcClient) Access(ctx context.Context, ownerUserID string) error {
_, err := u.GetUserInfo(ctx, ownerUserID) _, err := u.GetUserInfo(ctx, ownerUserID)
if err != nil { if err != nil {
return err return err
} }
return tokenverify.CheckAccessV3(ctx, ownerUserID) return tokenverify.CheckAccessV3(ctx, ownerUserID)
} }
// GetAllUserIDs
func (u *UserRpcClient) GetAllUserIDs(ctx context.Context, pageNumber, showNumber int32) ([]string, error) { func (u *UserRpcClient) GetAllUserIDs(ctx context.Context, pageNumber, showNumber int32) ([]string, error) {
resp, err := u.Client.GetAllUserID(ctx, &user.GetAllUserIDReq{Pagination: &sdkws.RequestPagination{PageNumber: pageNumber, ShowNumber: showNumber}}) resp, err := u.Client.GetAllUserID(ctx, &user.GetAllUserIDReq{Pagination: &sdkws.RequestPagination{PageNumber: pageNumber, ShowNumber: showNumber}})
if err != nil { if err != nil {
return nil, err return nil, err
} }
return resp.UserIDs, nil return resp.UserIDs, nil
} }

@ -34,6 +34,7 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils" "github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
) )
// Start
func Start( func Start(
rpcPort int, rpcPort int,
rpcRegisterName string, rpcRegisterName string,
@ -108,5 +109,6 @@ func Start(
} }
} }
}() }()
return utils.Wrap1(srv.Serve(listener)) return utils.Wrap1(srv.Serve(listener))
} }

@ -21,6 +21,7 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log" "github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
) )
// Statistics num
type Statistics struct { type Statistics struct {
AllCount *uint64 AllCount *uint64
ModuleName string ModuleName string
@ -63,8 +64,10 @@ func (s *Statistics) output() {
} }
} }
// NewStatistics
func NewStatistics(allCount *uint64, moduleName, printArgs string, sleepTime int) *Statistics { func NewStatistics(allCount *uint64, moduleName, printArgs string, sleepTime int) *Statistics {
p := &Statistics{AllCount: allCount, ModuleName: moduleName, SleepTime: uint64(sleepTime), PrintArgs: printArgs} p := &Statistics{AllCount: allCount, ModuleName: moduleName, SleepTime: uint64(sleepTime), PrintArgs: printArgs}
go p.output() go p.output()
return p return p
} }

Loading…
Cancel
Save