diff --git a/go.sum b/go.sum index 611ccdbf2..7efb70a38 100644 --- a/go.sum +++ b/go.sum @@ -509,6 +509,7 @@ github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4er github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= diff --git a/internal/msggateway/message_handler.go b/internal/msggateway/message_handler.go index cc143374a..f4baa4d3c 100644 --- a/internal/msggateway/message_handler.go +++ b/internal/msggateway/message_handler.go @@ -81,7 +81,7 @@ func (g GrpcHandler) SendMessage(context context.Context, data Req) ([]byte, err if err := proto.Unmarshal(data.Data, &msgData); err != nil { return nil, err } - if err := g.validate.Struct(msgData); err != nil { + if err := g.validate.Struct(&msgData); err != nil { return nil, err } req := msg.SendMsgReq{MsgData: &msgData} diff --git a/pkg/common/db/table/unrelation/msg.go b/pkg/common/db/table/unrelation/msg.go index a0e916f09..4b9c445f1 100644 --- a/pkg/common/db/table/unrelation/msg.go +++ b/pkg/common/db/table/unrelation/msg.go @@ -26,12 +26,3 @@ type MsgModel struct { AttachedInfo string `bson:"attachedInfo"` Ex string `bson:"ex"` } - -type ReadDiffusionMsgModel struct { - *MsgModel -} - -type WriteDiffusionMsgModel struct { - *MsgModel - UserID string `bson:"user_id"` -}