From 2bdaaa5a33f06e3e45ba20ad1b0cd3ea7d2275d2 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Wed, 20 Apr 2022 20:58:51 +0800 Subject: [PATCH 01/51] log --- cmd/Open-IM-SDK-Core | 2 +- internal/api/auth/auth.go | 34 +++++++++++++--------- internal/msg_gateway/gate/ws_server.go | 14 ++++----- internal/rpc/auth/auth.go | 40 ++++++++++++++------------ pkg/common/token_verify/jwt_token.go | 8 +++--- 5 files changed, 54 insertions(+), 44 deletions(-) diff --git a/cmd/Open-IM-SDK-Core b/cmd/Open-IM-SDK-Core index 539290887..666684b5a 160000 --- a/cmd/Open-IM-SDK-Core +++ b/cmd/Open-IM-SDK-Core @@ -1 +1 @@ -Subproject commit 539290887aff41515b291b7ecf174af25887f870 +Subproject commit 666684b5ac6af2bc259cbfd8021d9ddc31d1bff8 diff --git a/internal/api/auth/auth.go b/internal/api/auth/auth.go index 5e40298c2..abc909748 100644 --- a/internal/api/auth/auth.go +++ b/internal/api/auth/auth.go @@ -17,8 +17,9 @@ import ( func UserRegister(c *gin.Context) { params := api.UserRegisterReq{} if err := c.BindJSON(¶ms); err != nil { - log.NewError("0", "BindJSON failed ", err.Error()) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + errMsg := " BindJSON failed " + err.Error() + log.NewError("0", errMsg) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg}) return } @@ -37,22 +38,24 @@ func UserRegister(c *gin.Context) { client := rpc.NewAuthClient(etcdConn) reply, err := client.UserRegister(context.Background(), req) if err != nil { - log.NewError(req.OperationID, "call rpc err ", err.Error()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "internal service err"}) + errMsg := req.OperationID + " " + "client.UserRegister failed " + err.Error() + req.String() + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) return } if reply.CommonResp.ErrCode != 0 { - log.NewError(req.OperationID, "UserRegister failed ", err) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": reply.CommonResp.ErrMsg}) + errMsg := req.OperationID + " " + " client.UserRegister failed " + reply.CommonResp.ErrMsg + req.String() + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) return - } pbDataToken := &rpc.UserTokenReq{Platform: params.Platform, FromUserID: params.UserID, OperationID: params.OperationID} replyToken, err := client.UserToken(context.Background(), pbDataToken) if err != nil { - log.NewError(req.OperationID, "UserToken failed ", err.Error(), pbDataToken) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + errMsg := req.OperationID + " " + " client.UserToken failed " + err.Error() + pbDataToken.String() + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) return } resp := api.UserRegisterResp{CommResp: api.CommResp{ErrCode: replyToken.CommonResp.ErrCode, ErrMsg: replyToken.CommonResp.ErrMsg}, @@ -65,14 +68,16 @@ func UserRegister(c *gin.Context) { func UserToken(c *gin.Context) { params := api.UserTokenReq{} if err := c.BindJSON(¶ms); err != nil { - log.NewError("0", "BindJSON failed ", err.Error()) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + errMsg := " BindJSON failed " + err.Error() + log.NewError("0", errMsg) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg}) return } if params.Secret != config.Config.Secret { + errMsg := params.OperationID + " params.Secret != config.Config.Secret " log.NewError(params.OperationID, "params.Secret != config.Config.Secret", params.Secret, config.Config.Secret) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "not authorized"}) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": errMsg}) return } req := &rpc.UserTokenReq{Platform: params.Platform, FromUserID: params.UserID, OperationID: params.OperationID} @@ -81,8 +86,9 @@ func UserToken(c *gin.Context) { client := rpc.NewAuthClient(etcdConn) reply, err := client.UserToken(context.Background(), req) if err != nil { - log.NewError(req.OperationID, "UserToken failed ", err.Error(), req.String()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + errMsg := req.OperationID + " UserToken failed " + err.Error() + req.String() + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) return } resp := api.UserTokenResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg}, diff --git a/internal/msg_gateway/gate/ws_server.go b/internal/msg_gateway/gate/ws_server.go index dd18f7bc8..e6f3a317e 100644 --- a/internal/msg_gateway/gate/ws_server.go +++ b/internal/msg_gateway/gate/ws_server.go @@ -54,7 +54,7 @@ func (ws *WServer) wsHandler(w http.ResponseWriter, r *http.Request) { query := r.URL.Query() conn, err := ws.wsUpGrader.Upgrade(w, r, nil) //Conn is obtained through the upgraded escalator if err != nil { - log.ErrorByKv("upgrade http conn err", "", "err", err) + log.ErrorByKv("upgrade http conn err", "", "err", err, query) return } else { //Connection mapping relationship, @@ -196,6 +196,7 @@ func (ws *WServer) addUserConn(uid string, platformID int32, conn *UserConn, tok func (ws *WServer) delUserConn(conn *UserConn) { rwLock.Lock() defer rwLock.Unlock() + operationID := utils.OperationIDGenerator() var platform, uid string if oldStringMap, ok := ws.wsConnToUser[conn]; ok { for k, v := range oldStringMap { @@ -212,9 +213,9 @@ func (ws *WServer) delUserConn(conn *UserConn) { for _, v := range ws.wsUserToConn { count = count + len(v) } - log.WarnByKv("WS delete operation", "", "wsUser deleted", ws.wsUserToConn, "disconnection_uid", uid, "disconnection_platform", platform, "online_user_num", len(ws.wsUserToConn), "online_conn_num", count) + log.NewWarn(operationID, "WS delete operation", "", "wsUser deleted", ws.wsUserToConn, "disconnection_uid", uid, "disconnection_platform", platform, "online_user_num", len(ws.wsUserToConn), "online_conn_num", count) } else { - log.WarnByKv("WS delete operation", "", "wsUser deleted", ws.wsUserToConn, "disconnection_uid", uid, "disconnection_platform", platform, "online_user_num", len(ws.wsUserToConn)) + log.NewWarn(operationID, "WS delete operation", "", "wsUser deleted", ws.wsUserToConn, "disconnection_uid", uid, "disconnection_platform", platform, "online_user_num", len(ws.wsUserToConn)) } userCount = uint64(len(ws.wsUserToConn)) delete(ws.wsConnToUser, conn) @@ -222,8 +223,7 @@ func (ws *WServer) delUserConn(conn *UserConn) { } err := conn.Close() if err != nil { - log.ErrorByKv("close err", "", "uid", uid, "platform", platform) - + log.Error(operationID, " close err", "", "uid", uid, "platform", platform) } } @@ -267,7 +267,7 @@ func (ws *WServer) headerCheck(w http.ResponseWriter, r *http.Request) bool { operationID = query["operationID"][0] } if len(query["token"]) != 0 && len(query["sendID"]) != 0 && len(query["platformID"]) != 0 { - if ok, err, msg := token_verify.WsVerifyToken(query["token"][0], query["sendID"][0], query["platformID"][0]); !ok { + if ok, err, msg := token_verify.WsVerifyToken(query["token"][0], query["sendID"][0], query["platformID"][0], operationID); !ok { // e := err.(*constant.ErrInfo) log.Error(operationID, "Token verify failed ", "query ", query, msg, err.Error()) w.Header().Set("Sec-Websocket-Version", "13") @@ -281,7 +281,7 @@ func (ws *WServer) headerCheck(w http.ResponseWriter, r *http.Request) bool { } else { log.Error(operationID, "Args err", "query", query) w.Header().Set("Sec-Websocket-Version", "13") - w.Header().Set("ws_err_msg", "args err") + w.Header().Set("ws_err_msg", "args err, need token, sendID, platformID") http.Error(w, http.StatusText(status), status) return false } diff --git a/internal/rpc/auth/auth.go b/internal/rpc/auth/auth.go index 1aa0ec50b..15927bf5b 100644 --- a/internal/rpc/auth/auth.go +++ b/internal/rpc/auth/auth.go @@ -20,38 +20,41 @@ import ( ) func (rpc *rpcAuth) UserRegister(_ context.Context, req *pbAuth.UserRegisterReq) (*pbAuth.UserRegisterResp, error) { - log.NewInfo(req.OperationID, "UserRegister args ", req.String()) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) var user db.User utils.CopyStructFields(&user, req.UserInfo) if req.UserInfo.Birth != 0 { user.Birth = utils.UnixSecondToTime(int64(req.UserInfo.Birth)) } + log.Debug(req.OperationID, "copy ", user, req.UserInfo) err := imdb.UserRegister(user) if err != nil { - log.NewError(req.OperationID, "UserRegister failed ", err.Error(), user) - return &pbAuth.UserRegisterResp{CommonResp: &pbAuth.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + errMsg := req.OperationID + " imdb.UserRegister failed " + err.Error() + user.UserID + log.NewError(req.OperationID, errMsg, user) + return &pbAuth.UserRegisterResp{CommonResp: &pbAuth.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}}, nil } - log.NewInfo(req.OperationID, "rpc UserRegister return") + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", pbAuth.UserRegisterResp{CommonResp: &pbAuth.CommonResp{}}) return &pbAuth.UserRegisterResp{CommonResp: &pbAuth.CommonResp{}}, nil } func (rpc *rpcAuth) UserToken(_ context.Context, req *pbAuth.UserTokenReq) (*pbAuth.UserTokenResp, error) { - log.NewInfo(req.OperationID, "UserToken args ", req.String()) - + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) _, err := imdb.GetUserByUserID(req.FromUserID) if err != nil { - log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), req.FromUserID) - return &pbAuth.UserTokenResp{CommonResp: &pbAuth.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + errMsg := req.OperationID + " imdb.GetUserByUserID failed " + err.Error() + req.FromUserID + log.NewError(req.OperationID, errMsg) + return &pbAuth.UserTokenResp{CommonResp: &pbAuth.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}}, nil } tokens, expTime, err := token_verify.CreateToken(req.FromUserID, req.Platform) if err != nil { - log.NewError(req.OperationID, "CreateToken failed ", err.Error(), req.FromUserID, req.Platform) - return &pbAuth.UserTokenResp{CommonResp: &pbAuth.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + errMsg := req.OperationID + " token_verify.CreateToken failed " + err.Error() + req.FromUserID + utils.Int32ToString(req.Platform) + log.NewError(req.OperationID, errMsg) + return &pbAuth.UserTokenResp{CommonResp: &pbAuth.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}}, nil } - log.NewInfo(req.OperationID, "rpc UserToken return ", tokens, expTime) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", pbAuth.UserTokenResp{CommonResp: &pbAuth.CommonResp{}, Token: tokens, ExpiredTime: expTime}) return &pbAuth.UserTokenResp{CommonResp: &pbAuth.CommonResp{}, Token: tokens, ExpiredTime: expTime}, nil } @@ -73,15 +76,16 @@ func NewRpcAuthServer(port int) *rpcAuth { } func (rpc *rpcAuth) Run() { - log.NewInfo("0", "rpc auth start...") + operationID := utils.OperationIDGenerator() + log.NewInfo(operationID, "rpc auth start...") address := utils.ServerIP + ":" + strconv.Itoa(rpc.rpcPort) listener, err := net.Listen("tcp", address) if err != nil { - log.NewError("0", "listen network failed ", err.Error(), address) + log.NewError(operationID, "listen network failed ", err.Error(), address) return } - log.NewInfo("0", "listen network success, ", address, listener) + log.NewInfo(operationID, "listen network success, ", address, listener) //grpc server srv := grpc.NewServer() defer srv.GracefulStop() @@ -90,15 +94,15 @@ func (rpc *rpcAuth) Run() { pbAuth.RegisterAuthServer(srv, rpc) err = getcdv3.RegisterEtcd(rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), utils.ServerIP, rpc.rpcPort, rpc.rpcRegisterName, 10) if err != nil { - log.NewError("0", "RegisterEtcd failed ", err.Error(), + log.NewError(operationID, "RegisterEtcd failed ", err.Error(), rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), utils.ServerIP, rpc.rpcPort, rpc.rpcRegisterName) return } - log.NewInfo("0", "RegisterAuthServer ok ", rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), utils.ServerIP, rpc.rpcPort, rpc.rpcRegisterName) + log.NewInfo(operationID, "RegisterAuthServer ok ", rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), utils.ServerIP, rpc.rpcPort, rpc.rpcRegisterName) err = srv.Serve(listener) if err != nil { - log.NewError("0", "Serve failed ", err.Error()) + log.NewError(operationID, "Serve failed ", err.Error()) return } - log.NewInfo("0", "rpc auth ok") + log.NewInfo(operationID, "rpc auth ok") } diff --git a/pkg/common/token_verify/jwt_token.go b/pkg/common/token_verify/jwt_token.go index e58424623..876f4e847 100644 --- a/pkg/common/token_verify/jwt_token.go +++ b/pkg/common/token_verify/jwt_token.go @@ -206,7 +206,7 @@ func ParseRedisInterfaceToken(redisToken interface{}) (*Claims, error) { func VerifyToken(token, uid string) (bool, error) { claims, err := ParseToken(token, "") if err != nil { - return false, err + return false, utils.Wrap(err, "ParseToken failed") } if claims.UID != uid { return false, &constant.ErrTokenUnknown @@ -215,8 +215,8 @@ func VerifyToken(token, uid string) (bool, error) { log.NewDebug("", claims.UID, claims.Platform) return true, nil } -func WsVerifyToken(token, uid string, platformID string) (bool, error, string) { - claims, err := ParseToken(token, "") +func WsVerifyToken(token, uid string, platformID string, operationID string) (bool, error, string) { + claims, err := ParseToken(token, operationID) if err != nil { return false, utils.Wrap(err, "parse token err"), "parse token err" } @@ -226,6 +226,6 @@ func WsVerifyToken(token, uid string, platformID string) (bool, error, string) { if claims.Platform != constant.PlatformIDToName(utils.StringToInt32(platformID)) { return false, utils.Wrap(&constant.ErrTokenUnknown, "platform is not same to token platform"), "platform is not same to token platform" } - log.NewDebug("", claims.UID, claims.Platform) + log.NewDebug(operationID, utils.GetSelfFuncName(), " check ok ", claims.UID, uid, claims.Platform) return true, nil, "" } From 0a0c206998c9d5722f8660cfc7ccbe1d63db8531 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Fri, 22 Apr 2022 18:56:39 +0800 Subject: [PATCH 02/51] add cache --- cmd/open_im_api/main.go | 1 + internal/api/user/user.go | 39 +++++++++++++++++++++++++++++++++++ pkg/proto/friend/friend.proto | 3 +++ pkg/proto/user/user.proto | 4 ++++ 4 files changed, 47 insertions(+) diff --git a/cmd/open_im_api/main.go b/cmd/open_im_api/main.go index cf1783117..dcf9a26b8 100644 --- a/cmd/open_im_api/main.go +++ b/cmd/open_im_api/main.go @@ -42,6 +42,7 @@ func main() { userRouterGroup.POST("/get_users_info", user.GetUsersInfo) //1 userRouterGroup.POST("/get_self_user_info", user.GetSelfUserInfo) //1 userRouterGroup.POST("/get_users_online_status", user.GetUsersOnlineStatus) //1 + userRouterGroup.POST("/get_users_info_from_cache", user.GetUsersInfoFromCache) } //friend routing group friendRouterGroup := r.Group("/friend") diff --git a/internal/api/user/user.go b/internal/api/user/user.go index 4fbbcf5ef..93c800259 100644 --- a/internal/api/user/user.go +++ b/internal/api/user/user.go @@ -18,6 +18,45 @@ import ( "strings" ) +//todo +func GetUsersInfoFromCache(c *gin.Context) { + params := api.GetUsersInfoReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": http.StatusBadRequest, "errMsg": err.Error()}) + return + } + req := &rpc.GetUserInfoReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(params.OperationID, "GetUserInfo args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := rpc.NewUserClient(etcdConn) + RpcResp, err := client.GetUserInfo(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "GetUserInfo failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) + return + } + var publicUserInfoList []*open_im_sdk.PublicUserInfo + for _, v := range RpcResp.UserInfoList { + publicUserInfoList = append(publicUserInfoList, + &open_im_sdk.PublicUserInfo{UserID: v.UserID, Nickname: v.Nickname, FaceURL: v.FaceURL, Gender: v.Gender, Ex: v.Ex}) + } + + resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, UserInfoList: publicUserInfoList} + resp.Data = jsonData.JsonDataList(resp.UserInfoList) + log.NewInfo(req.OperationID, "GetUserInfo api return ", resp) + c.JSON(http.StatusOK, resp) +} + func GetUsersInfo(c *gin.Context) { params := api.GetUsersInfoReq{} if err := c.BindJSON(¶ms); err != nil { diff --git a/pkg/proto/friend/friend.proto b/pkg/proto/friend/friend.proto index 0050582d1..8f7827edc 100644 --- a/pkg/proto/friend/friend.proto +++ b/pkg/proto/friend/friend.proto @@ -166,4 +166,7 @@ service friend{ rpc addFriendResponse(AddFriendResponseReq) returns(AddFriendResponseResp); rpc setFriendRemark(SetFriendRemarkReq) returns(SetFriendRemarkResp); rpc importFriend(ImportFriendReq) returns(ImportFriendResp); + + rpc CheckFriendFromCache(IsFriendReq) returns(IsFriendResp); + rpc CheckBlockFromCache(IsInBlackListReq) returns(IsFriendResp); } \ No newline at end of file diff --git a/pkg/proto/user/user.proto b/pkg/proto/user/user.proto index d5914db41..3fbfd0162 100644 --- a/pkg/proto/user/user.proto +++ b/pkg/proto/user/user.proto @@ -315,4 +315,8 @@ service user { rpc GetBlockUsers(GetBlockUsersReq) returns (GetBlockUsersResp); rpc GetBlockUserById(GetBlockUserByIdReq) returns (GetBlockUserByIdResp); rpc DeleteUser(DeleteUserReq) returns (DeleteUserResp); + + + rpc GetUserInfoFromCache(GetUserInfoReq) returns(GetUserInfoResp); + } From df17dd749f31bbb214c7ef9cd2e40e2b0d6040a4 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Sun, 24 Apr 2022 11:23:54 +0800 Subject: [PATCH 03/51] add rpc conversation --- cmd/rpc/open_im_conversation/Makefile | 24 ++ cmd/rpc/open_im_conversation/main.go | 16 + config/config.yaml | 2 + internal/rpc/conversation/conversaion.go | 72 ++++ pkg/common/config/config.go | 1 + pkg/proto/conversation/conversation.pb.go | 429 ++++++++++++++++++++++ pkg/proto/conversation/conversation.proto | 2 +- script/check_all.sh | 1 + script/path_info.cfg | 4 +- script/start_rpc_service.sh | 2 + 10 files changed, 551 insertions(+), 2 deletions(-) create mode 100644 cmd/rpc/open_im_conversation/Makefile create mode 100644 cmd/rpc/open_im_conversation/main.go create mode 100644 internal/rpc/conversation/conversaion.go create mode 100644 pkg/proto/conversation/conversation.pb.go diff --git a/cmd/rpc/open_im_conversation/Makefile b/cmd/rpc/open_im_conversation/Makefile new file mode 100644 index 000000000..c1a5578bc --- /dev/null +++ b/cmd/rpc/open_im_conversation/Makefile @@ -0,0 +1,24 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_conversation +BIN_DIR=../../../bin/ + +all: gotool build + +build: + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" + +run: + @go run ./ + +gotool: + go fmt ./ + go vet ./ + +install: + make build + mv ${BINARY_NAME} ${BIN_DIR} + +clean: + @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi + diff --git a/cmd/rpc/open_im_conversation/main.go b/cmd/rpc/open_im_conversation/main.go new file mode 100644 index 000000000..47570a85b --- /dev/null +++ b/cmd/rpc/open_im_conversation/main.go @@ -0,0 +1,16 @@ +package main + +import ( + rpcConversation "Open_IM/internal/rpc/conversation" + "flag" + "fmt" +) + +func main() { + rpcPort := flag.Int("port", 11300, "RpcConversation default listen port 11300") + flag.Parse() + fmt.Println("start conversation rpc server, port: ", *rpcPort) + rpcServer := rpcConversation.NewRpcConversationServer(*rpcPort) + rpcServer.Run() + +} diff --git a/config/config.yaml b/config/config.yaml index 39a69298f..fec3424fc 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -123,6 +123,7 @@ rpcport: #rpc服务端口 默认即可 openImAdminCmsPort: [ 11000 ] openImOfficePort: [ 11100 ] openImOrganizationPort: [ 11200 ] + openImConversatinPort: [ 11300 ] c2c: callbackBeforeSendMsg: switch: false @@ -146,6 +147,7 @@ rpcregistername: #rpc注册服务名,默认即可 openImAdminCMSName: AdminCMS openImOfficeName: Office openImOrganizationName: Organization + openImConversationName: Conversation log: storageLocation: ../logs/ diff --git a/internal/rpc/conversation/conversaion.go b/internal/rpc/conversation/conversaion.go new file mode 100644 index 000000000..cd45763c9 --- /dev/null +++ b/internal/rpc/conversation/conversaion.go @@ -0,0 +1,72 @@ +package conversation + +import ( + "Open_IM/pkg/common/constant" + _ "Open_IM/pkg/common/db" + _ "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + _ "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbConversation "Open_IM/pkg/proto/conversation" + "Open_IM/pkg/utils" + "context" + "net" + "strconv" + "strings" + + "Open_IM/pkg/common/config" + + "google.golang.org/grpc" +) + +type rpcConversation struct { + rpcPort int + rpcRegisterName string + etcdSchema string + etcdAddr []string +} + +func (rpc *rpcConversation) ModifyConversationField(c context.Context, req *pbConversation.ModifyConversationFieldReq) (*pbConversation.ModifyConversationFieldResp, error) { + panic("implement me") +} + +func NewRpcConversationServer(port int) *rpcConversation { + log.NewPrivateLog(constant.LogFileName) + return &rpcConversation{ + rpcPort: port, + rpcRegisterName: config.Config.RpcRegisterName.OpenImConversationName, + etcdSchema: config.Config.Etcd.EtcdSchema, + etcdAddr: config.Config.Etcd.EtcdAddr, + } +} + +func (rpc *rpcConversation) Run() { + log.NewInfo("0", "rpc conversation start...") + + address := utils.ServerIP + ":" + strconv.Itoa(rpc.rpcPort) + listener, err := net.Listen("tcp", address) + if err != nil { + log.NewError("0", "listen network failed ", err.Error(), address) + return + } + log.NewInfo("0", "listen network success, ", address, listener) + //grpc server + srv := grpc.NewServer() + defer srv.GracefulStop() + + //service registers with etcd + pbConversation.RegisterConversationServer(srv, rpc) + err = getcdv3.RegisterEtcd(rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), utils.ServerIP, rpc.rpcPort, rpc.rpcRegisterName, 10) + if err != nil { + log.NewError("0", "RegisterEtcd failed ", err.Error(), + rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), utils.ServerIP, rpc.rpcPort, rpc.rpcRegisterName) + return + } + log.NewInfo("0", "RegisterConversationServer ok ", rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), utils.ServerIP, rpc.rpcPort, rpc.rpcRegisterName) + err = srv.Serve(listener) + if err != nil { + log.NewError("0", "Serve failed ", err.Error()) + return + } + log.NewInfo("0", "rpc conversation ok") +} diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index aed2c1173..49e0e0849 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -118,6 +118,7 @@ type config struct { OpenImAdminCMSName string `yaml:"openImAdminCMSName"` OpenImOfficeName string `yaml:"openImOfficeName"` OpenImOrganizationName string `yaml:"openImOrganizationName"` + OpenImConversationName string `yaml:"openImConversationName"` } Etcd struct { EtcdSchema string `yaml:"etcdSchema"` diff --git a/pkg/proto/conversation/conversation.pb.go b/pkg/proto/conversation/conversation.pb.go new file mode 100644 index 000000000..bf76bfe67 --- /dev/null +++ b/pkg/proto/conversation/conversation.pb.go @@ -0,0 +1,429 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: conversation/conversation.proto + +package conversation // import "./conversation" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type CommonResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CommonResp) Reset() { *m = CommonResp{} } +func (m *CommonResp) String() string { return proto.CompactTextString(m) } +func (*CommonResp) ProtoMessage() {} +func (*CommonResp) Descriptor() ([]byte, []int) { + return fileDescriptor_conversation_e6bf38f800b9bed2, []int{0} +} +func (m *CommonResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommonResp.Unmarshal(m, b) +} +func (m *CommonResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommonResp.Marshal(b, m, deterministic) +} +func (dst *CommonResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommonResp.Merge(dst, src) +} +func (m *CommonResp) XXX_Size() int { + return xxx_messageInfo_CommonResp.Size(m) +} +func (m *CommonResp) XXX_DiscardUnknown() { + xxx_messageInfo_CommonResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CommonResp proto.InternalMessageInfo + +func (m *CommonResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *CommonResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type Conversation struct { + OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID" json:"ownerUserID,omitempty"` + ConversationID string `protobuf:"bytes,2,opt,name=conversationID" json:"conversationID,omitempty"` + RecvMsgOpt int32 `protobuf:"varint,3,opt,name=recvMsgOpt" json:"recvMsgOpt,omitempty"` + ConversationType int32 `protobuf:"varint,4,opt,name=conversationType" json:"conversationType,omitempty"` + UserID string `protobuf:"bytes,5,opt,name=userID" json:"userID,omitempty"` + GroupID string `protobuf:"bytes,6,opt,name=groupID" json:"groupID,omitempty"` + UnreadCount int32 `protobuf:"varint,7,opt,name=unreadCount" json:"unreadCount,omitempty"` + DraftTextTime int64 `protobuf:"varint,8,opt,name=draftTextTime" json:"draftTextTime,omitempty"` + IsPinned bool `protobuf:"varint,9,opt,name=isPinned" json:"isPinned,omitempty"` + AttachedInfo string `protobuf:"bytes,10,opt,name=attachedInfo" json:"attachedInfo,omitempty"` + IsPrivateChat bool `protobuf:"varint,11,opt,name=isPrivateChat" json:"isPrivateChat,omitempty"` + GroupAtType int32 `protobuf:"varint,12,opt,name=groupAtType" json:"groupAtType,omitempty"` + IsNotInGroup bool `protobuf:"varint,13,opt,name=isNotInGroup" json:"isNotInGroup,omitempty"` + Ex string `protobuf:"bytes,14,opt,name=ex" json:"ex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Conversation) Reset() { *m = Conversation{} } +func (m *Conversation) String() string { return proto.CompactTextString(m) } +func (*Conversation) ProtoMessage() {} +func (*Conversation) Descriptor() ([]byte, []int) { + return fileDescriptor_conversation_e6bf38f800b9bed2, []int{1} +} +func (m *Conversation) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Conversation.Unmarshal(m, b) +} +func (m *Conversation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Conversation.Marshal(b, m, deterministic) +} +func (dst *Conversation) XXX_Merge(src proto.Message) { + xxx_messageInfo_Conversation.Merge(dst, src) +} +func (m *Conversation) XXX_Size() int { + return xxx_messageInfo_Conversation.Size(m) +} +func (m *Conversation) XXX_DiscardUnknown() { + xxx_messageInfo_Conversation.DiscardUnknown(m) +} + +var xxx_messageInfo_Conversation proto.InternalMessageInfo + +func (m *Conversation) GetOwnerUserID() string { + if m != nil { + return m.OwnerUserID + } + return "" +} + +func (m *Conversation) GetConversationID() string { + if m != nil { + return m.ConversationID + } + return "" +} + +func (m *Conversation) GetRecvMsgOpt() int32 { + if m != nil { + return m.RecvMsgOpt + } + return 0 +} + +func (m *Conversation) GetConversationType() int32 { + if m != nil { + return m.ConversationType + } + return 0 +} + +func (m *Conversation) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *Conversation) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *Conversation) GetUnreadCount() int32 { + if m != nil { + return m.UnreadCount + } + return 0 +} + +func (m *Conversation) GetDraftTextTime() int64 { + if m != nil { + return m.DraftTextTime + } + return 0 +} + +func (m *Conversation) GetIsPinned() bool { + if m != nil { + return m.IsPinned + } + return false +} + +func (m *Conversation) GetAttachedInfo() string { + if m != nil { + return m.AttachedInfo + } + return "" +} + +func (m *Conversation) GetIsPrivateChat() bool { + if m != nil { + return m.IsPrivateChat + } + return false +} + +func (m *Conversation) GetGroupAtType() int32 { + if m != nil { + return m.GroupAtType + } + return 0 +} + +func (m *Conversation) GetIsNotInGroup() bool { + if m != nil { + return m.IsNotInGroup + } + return false +} + +func (m *Conversation) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +type ModifyConversationFieldReq struct { + Conversation *Conversation `protobuf:"bytes,1,opt,name=conversation" json:"conversation,omitempty"` + FieldType int32 `protobuf:"varint,2,opt,name=fieldType" json:"fieldType,omitempty"` + UserIDList []string `protobuf:"bytes,3,rep,name=userIDList" json:"userIDList,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ModifyConversationFieldReq) Reset() { *m = ModifyConversationFieldReq{} } +func (m *ModifyConversationFieldReq) String() string { return proto.CompactTextString(m) } +func (*ModifyConversationFieldReq) ProtoMessage() {} +func (*ModifyConversationFieldReq) Descriptor() ([]byte, []int) { + return fileDescriptor_conversation_e6bf38f800b9bed2, []int{2} +} +func (m *ModifyConversationFieldReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ModifyConversationFieldReq.Unmarshal(m, b) +} +func (m *ModifyConversationFieldReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ModifyConversationFieldReq.Marshal(b, m, deterministic) +} +func (dst *ModifyConversationFieldReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_ModifyConversationFieldReq.Merge(dst, src) +} +func (m *ModifyConversationFieldReq) XXX_Size() int { + return xxx_messageInfo_ModifyConversationFieldReq.Size(m) +} +func (m *ModifyConversationFieldReq) XXX_DiscardUnknown() { + xxx_messageInfo_ModifyConversationFieldReq.DiscardUnknown(m) +} + +var xxx_messageInfo_ModifyConversationFieldReq proto.InternalMessageInfo + +func (m *ModifyConversationFieldReq) GetConversation() *Conversation { + if m != nil { + return m.Conversation + } + return nil +} + +func (m *ModifyConversationFieldReq) GetFieldType() int32 { + if m != nil { + return m.FieldType + } + return 0 +} + +func (m *ModifyConversationFieldReq) GetUserIDList() []string { + if m != nil { + return m.UserIDList + } + return nil +} + +func (m *ModifyConversationFieldReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type ModifyConversationFieldResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ModifyConversationFieldResp) Reset() { *m = ModifyConversationFieldResp{} } +func (m *ModifyConversationFieldResp) String() string { return proto.CompactTextString(m) } +func (*ModifyConversationFieldResp) ProtoMessage() {} +func (*ModifyConversationFieldResp) Descriptor() ([]byte, []int) { + return fileDescriptor_conversation_e6bf38f800b9bed2, []int{3} +} +func (m *ModifyConversationFieldResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ModifyConversationFieldResp.Unmarshal(m, b) +} +func (m *ModifyConversationFieldResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ModifyConversationFieldResp.Marshal(b, m, deterministic) +} +func (dst *ModifyConversationFieldResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_ModifyConversationFieldResp.Merge(dst, src) +} +func (m *ModifyConversationFieldResp) XXX_Size() int { + return xxx_messageInfo_ModifyConversationFieldResp.Size(m) +} +func (m *ModifyConversationFieldResp) XXX_DiscardUnknown() { + xxx_messageInfo_ModifyConversationFieldResp.DiscardUnknown(m) +} + +var xxx_messageInfo_ModifyConversationFieldResp proto.InternalMessageInfo + +func (m *ModifyConversationFieldResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func init() { + proto.RegisterType((*CommonResp)(nil), "conversation.CommonResp") + proto.RegisterType((*Conversation)(nil), "conversation.Conversation") + proto.RegisterType((*ModifyConversationFieldReq)(nil), "conversation.ModifyConversationFieldReq") + proto.RegisterType((*ModifyConversationFieldResp)(nil), "conversation.ModifyConversationFieldResp") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// Client API for Conversation service + +type ConversationClient interface { + ModifyConversationField(ctx context.Context, in *ModifyConversationFieldReq, opts ...grpc.CallOption) (*ModifyConversationFieldResp, error) +} + +type conversationClient struct { + cc *grpc.ClientConn +} + +func NewConversationClient(cc *grpc.ClientConn) ConversationClient { + return &conversationClient{cc} +} + +func (c *conversationClient) ModifyConversationField(ctx context.Context, in *ModifyConversationFieldReq, opts ...grpc.CallOption) (*ModifyConversationFieldResp, error) { + out := new(ModifyConversationFieldResp) + err := grpc.Invoke(ctx, "/conversation.conversation/ModifyConversationField", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Conversation service + +type ConversationServer interface { + ModifyConversationField(context.Context, *ModifyConversationFieldReq) (*ModifyConversationFieldResp, error) +} + +func RegisterConversationServer(s *grpc.Server, srv ConversationServer) { + s.RegisterService(&_Conversation_serviceDesc, srv) +} + +func _Conversation_ModifyConversationField_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModifyConversationFieldReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConversationServer).ModifyConversationField(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/conversation.conversation/ModifyConversationField", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConversationServer).ModifyConversationField(ctx, req.(*ModifyConversationFieldReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _Conversation_serviceDesc = grpc.ServiceDesc{ + ServiceName: "conversation.conversation", + HandlerType: (*ConversationServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ModifyConversationField", + Handler: _Conversation_ModifyConversationField_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "conversation/conversation.proto", +} + +func init() { + proto.RegisterFile("conversation/conversation.proto", fileDescriptor_conversation_e6bf38f800b9bed2) +} + +var fileDescriptor_conversation_e6bf38f800b9bed2 = []byte{ + // 475 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xdf, 0x8a, 0xd3, 0x40, + 0x14, 0x87, 0x49, 0xbb, 0xdb, 0x6d, 0x4e, 0xbb, 0x45, 0xe6, 0x42, 0x87, 0xae, 0x7f, 0x42, 0x10, + 0x89, 0x5e, 0x54, 0x58, 0x6f, 0x04, 0x61, 0x41, 0x53, 0x94, 0x80, 0xd5, 0x65, 0xa8, 0x08, 0xde, + 0xc5, 0xe6, 0xb4, 0x3b, 0x60, 0x67, 0xe2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x33, 0xaf, 0xf7, 0xfc, 0x77, 0x78, 0x71, 0x22, 0xe0, 0xc1, 0x81, + 0x83, 0x48, 0x16, 0x06, 0x1e, 0xfe, 0x9a, 0xc3, 0xe7, 0x77, 0xec, 0xd4, 0xf5, 0xbb, 0x47, 0xdf, + 0xce, 0x46, 0xc1, 0xaf, 0xfd, 0xc6, 0x2f, 0xbe, 0x77, 0xdc, 0x8f, 0xfe, 0xea, 0x5f, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x8d, 0x8a, 0xf6, 0x60, 0x0b, 0x04, 0x00, 0x00, +} diff --git a/pkg/proto/conversation/conversation.proto b/pkg/proto/conversation/conversation.proto index 2dfcc7ed5..5ae5f1142 100644 --- a/pkg/proto/conversation/conversation.proto +++ b/pkg/proto/conversation/conversation.proto @@ -32,7 +32,7 @@ message ModifyConversationFieldReq{ message ModifyConversationFieldResp{ CommonResp commonResp = 1; } -service user { +service conversation { rpc ModifyConversationField(ModifyConversationFieldReq)returns(ModifyConversationFieldResp); } diff --git a/script/check_all.sh b/script/check_all.sh index c434c65d2..0e828fd54 100644 --- a/script/check_all.sh +++ b/script/check_all.sh @@ -21,6 +21,7 @@ service_port_name=( openImStatisticsPort openImOfficePort openImOrganizationPort + openImConversationPort ) switch=$(cat $config_path | grep demoswitch |awk -F '[:]' '{print $NF}') for i in ${service_port_name[*]}; do diff --git a/script/path_info.cfg b/script/path_info.cfg index b50fc18fb..3071a0a5d 100644 --- a/script/path_info.cfg +++ b/script/path_info.cfg @@ -50,6 +50,7 @@ service_source_root=( ../cmd/rpc/open_im_statistics/ ../cmd/rpc/open_im_office/ ../cmd/rpc/open_im_organization/ + ../cmd/rpc/open_im_conversation/ ${msg_gateway_source_root} ${msg_transfer_source_root} ${msg_source_root} @@ -71,7 +72,8 @@ service_names=( open_im_message_cms open_im_statistics open_im_office - open_im_organization + open_im_organization + open_im_conversation ${msg_gateway_name} ${msg_transfer_name} ${msg_name} diff --git a/script/start_rpc_service.sh b/script/start_rpc_service.sh index 20e7991b4..2e249bbc1 100644 --- a/script/start_rpc_service.sh +++ b/script/start_rpc_service.sh @@ -20,6 +20,7 @@ service_filename=( ${msg_name} open_im_office open_im_organization + open_im_conversation ) #service config port name @@ -38,6 +39,7 @@ service_port_name=( openImOfflineMessagePort openImOfficePort openImOrganizationPort + openImConversationPort ) for ((i = 0; i < ${#service_filename[*]}; i++)); do From 4acbe4b31a35680cbe5d97a952734ee0eccfd8ae Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Sun, 24 Apr 2022 11:49:01 +0800 Subject: [PATCH 04/51] config --- config/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.yaml b/config/config.yaml index fec3424fc..b1f7b7b3a 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -123,7 +123,7 @@ rpcport: #rpc服务端口 默认即可 openImAdminCmsPort: [ 11000 ] openImOfficePort: [ 11100 ] openImOrganizationPort: [ 11200 ] - openImConversatinPort: [ 11300 ] + openImConversationPort: [ 11300 ] c2c: callbackBeforeSendMsg: switch: false From 4eb96617307f8019648b492c5f0ae307c738ae0b Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Sun, 24 Apr 2022 11:50:36 +0800 Subject: [PATCH 05/51] fix docker-compose --- cmd/open_im_cms_api/main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/open_im_cms_api/main.go b/cmd/open_im_cms_api/main.go index 262020fea..024439075 100644 --- a/cmd/open_im_cms_api/main.go +++ b/cmd/open_im_cms_api/main.go @@ -3,7 +3,9 @@ package main import ( "Open_IM/internal/cms_api" "Open_IM/pkg/utils" + "flag" "fmt" + "strconv" "github.com/gin-gonic/gin" ) @@ -12,6 +14,7 @@ func main() { gin.SetMode(gin.ReleaseMode) router := cms_api.NewGinRouter() router.Use(utils.CorsHandler()) - fmt.Println("start cms api server, port: ", 8000) - router.Run(":" + "8000") + ginPort := flag.Int("port", 8000, "get ginServerPort from cmd,default 10000 as port") + fmt.Println("start cms api server, port: ", ginPort) + router.Run(":" + strconv.Itoa(*ginPort)) } From 1809c59f25bc44cbe5c6ce1e6727cde47f255e38 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Sun, 24 Apr 2022 11:53:50 +0800 Subject: [PATCH 06/51] config --- cmd/rpc/open_im_conversation/main.go | 2 +- config/config.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/rpc/open_im_conversation/main.go b/cmd/rpc/open_im_conversation/main.go index 47570a85b..dc43063e6 100644 --- a/cmd/rpc/open_im_conversation/main.go +++ b/cmd/rpc/open_im_conversation/main.go @@ -7,7 +7,7 @@ import ( ) func main() { - rpcPort := flag.Int("port", 11300, "RpcConversation default listen port 11300") + rpcPort := flag.Int("port", 11400, "RpcConversation default listen port 11300") flag.Parse() fmt.Println("start conversation rpc server, port: ", *rpcPort) rpcServer := rpcConversation.NewRpcConversationServer(*rpcPort) diff --git a/config/config.yaml b/config/config.yaml index b1f7b7b3a..445357150 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -123,7 +123,7 @@ rpcport: #rpc服务端口 默认即可 openImAdminCmsPort: [ 11000 ] openImOfficePort: [ 11100 ] openImOrganizationPort: [ 11200 ] - openImConversationPort: [ 11300 ] + openImConversationPort: [ 11400 ] c2c: callbackBeforeSendMsg: switch: false From 150af5ff8b4381f2b00c97207e725237306f0907 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Sun, 24 Apr 2022 15:55:19 +0800 Subject: [PATCH 07/51] @ people update --- internal/rpc/conversation/conversaion.go | 105 +++- internal/rpc/msg/send_msg.go | 77 ++- pkg/common/constant/constant.go | 10 + .../im_mysql_model/conversation_model.go | 145 +++++ .../mysql_model/im_mysql_model/user_model.go | 99 ---- pkg/proto/sdk_ws/ws.pb.go | 496 +++++++++--------- pkg/proto/sdk_ws/ws.proto | 3 +- 7 files changed, 568 insertions(+), 367 deletions(-) create mode 100644 pkg/common/db/mysql_model/im_mysql_model/conversation_model.go diff --git a/internal/rpc/conversation/conversaion.go b/internal/rpc/conversation/conversaion.go index cd45763c9..409c1e488 100644 --- a/internal/rpc/conversation/conversaion.go +++ b/internal/rpc/conversation/conversaion.go @@ -1,11 +1,11 @@ package conversation import ( + chat "Open_IM/internal/rpc/msg" "Open_IM/pkg/common/constant" - _ "Open_IM/pkg/common/db" - _ "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/db" + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" "Open_IM/pkg/common/log" - _ "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" pbConversation "Open_IM/pkg/proto/conversation" "Open_IM/pkg/utils" @@ -27,9 +27,104 @@ type rpcConversation struct { } func (rpc *rpcConversation) ModifyConversationField(c context.Context, req *pbConversation.ModifyConversationFieldReq) (*pbConversation.ModifyConversationFieldResp, error) { - panic("implement me") + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp := &pbConversation.ModifyConversationFieldResp{} + var err error + if req.Conversation.ConversationType == constant.GroupChatType { + groupInfo, err := imdb.GetGroupInfoByGroupID(req.Conversation.GroupID) + if err != nil { + log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", req.Conversation.GroupID, err.Error()) + resp.CommonResp = &pbConversation.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + if groupInfo.Status == constant.GroupStatusDismissed && !req.Conversation.IsNotInGroup { + errMsg := "group status is dismissed" + resp.CommonResp = &pbConversation.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg} + return resp, nil + } + } + var conversation db.Conversation + if err := utils.CopyStructFields(&conversation, req.Conversation); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", *req.Conversation, err.Error()) + } + haveUserID, _ := imdb.GetExistConversationUserIDList(req.Conversation.ConversationID) + switch req.FieldType { + case constant.RecvMsgOpt: + for _, v := range req.UserIDList { + if err = db.DB.SetSingleConversationRecvMsgOpt(v, req.Conversation.ConversationID, req.Conversation.RecvMsgOpt); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "cache failed, rpc return", err.Error()) + resp.CommonResp = &pbConversation.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + } + err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"recv_msg_opt": conversation.RecvMsgOpt}) + case constant.GroupAtType: + err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"group_at_type": conversation.GroupAtType}) + case constant.IsNotInGroup: + err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"is_not_in_group": conversation.IsNotInGroup}) + case constant.IsPinned: + err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"is_pinned": conversation.IsPinned}) + case constant.IsPrivateChat: + err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"is_private_chat": conversation.IsPrivateChat}) + case constant.Ex: + err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"ex": conversation.Ex}) + case constant.AttachedInfo: + err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"attached_info": conversation.AttachedInfo}) + } + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "UpdateColumnsConversations error", err.Error()) + resp.CommonResp = &pbConversation.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + for _, v := range utils.DifferenceString(haveUserID, req.UserIDList) { + conversation.OwnerUserID = v + err := imdb.SetOneConversation(conversation) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation error", err.Error()) + resp.CommonResp = &pbConversation.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + } + // notification + if req.Conversation.ConversationType == constant.SingleChatType && req.FieldType == constant.IsPrivateChat { + //sync peer user conversation if conversation is singleChatType + if err := syncPeerUserConversation(req.Conversation, req.OperationID); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "syncPeerUserConversation", err.Error()) + resp.CommonResp = &pbConversation.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + } else { + for _, v := range req.UserIDList { + chat.ConversationChangeNotification(req.OperationID, v) + } + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return", resp.String()) + resp.CommonResp = &pbConversation.CommonResp{} + return resp, nil +} +func syncPeerUserConversation(conversation *pbConversation.Conversation, operationID string) error { + peerUserConversation := db.Conversation{ + OwnerUserID: conversation.UserID, + ConversationID: utils.GetConversationIDBySessionType(conversation.OwnerUserID, constant.SingleChatType), + ConversationType: constant.SingleChatType, + UserID: conversation.OwnerUserID, + GroupID: "", + RecvMsgOpt: 0, + UnreadCount: 0, + DraftTextTime: 0, + IsPinned: false, + IsPrivateChat: conversation.IsPrivateChat, + AttachedInfo: "", + Ex: "", + } + err := imdb.PeerUserSetConversation(peerUserConversation) + if err != nil { + log.NewError(operationID, utils.GetSelfFuncName(), "SetConversation error", err.Error()) + return err + } + chat.ConversationSetPrivateNotification(operationID, conversation.OwnerUserID, conversation.UserID, conversation.IsPrivateChat) + return nil } - func NewRpcConversationServer(port int) *rpcConversation { log.NewPrivateLog(constant.LogFileName) return &rpcConversation{ diff --git a/internal/rpc/msg/send_msg.go b/internal/rpc/msg/send_msg.go index 141c072ec..16fba65dc 100644 --- a/internal/rpc/msg/send_msg.go +++ b/internal/rpc/msg/send_msg.go @@ -7,6 +7,7 @@ import ( "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" pbChat "Open_IM/pkg/proto/chat" + pbConversation "Open_IM/pkg/proto/conversation" rpc "Open_IM/pkg/proto/friend" pbGroup "Open_IM/pkg/proto/group" sdk_ws "Open_IM/pkg/proto/sdk_ws" @@ -227,6 +228,12 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S log.Error(pb.Token, pb.OperationID, "rpc send_msg getGroupInfo failed, err = %s", reply.ErrMsg) return returnMsg(&replay, pb, reply.ErrCode, reply.ErrMsg, "", 0) } + memberUserIDList := func(all []*sdk_ws.GroupMemberFullInfo) (result []string) { + for _, v := range all { + result = append(result, v.UserID) + } + return result + }(reply.MemberList) var addUidList []string switch pb.MsgData.ContentType { case constant.MemberKickedNotification: @@ -247,31 +254,65 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S case constant.MemberQuitNotification: addUidList = append(addUidList, pb.MsgData.SendID) case constant.AtText: - //tagMe := utils.IsContain(c.loginUserID, s.AtElem.AtUserList) - //tagAll := utils.IsContain(constant.AtAllString, pb.MsgData.AtUserIDList) - //if tagAll { - // if tagMe { - // lc.GroupAtType = constant.AtAllAtMe - // return - // } - // lc.GroupAtType = constant.AtAll - // return - //} - //if tagMe { - // lc.GroupAtType = constant.AtMe - //} + var conversationReq pbConversation.ModifyConversationFieldReq + var tag bool + var atUserID []string + conversation := pbConversation.Conversation{ + OwnerUserID: pb.MsgData.SendID, + ConversationID: utils.GetConversationIDBySessionType(pb.MsgData.GroupID, constant.GroupChatType), + ConversationType: constant.GroupChatType, + GroupID: pb.MsgData.GroupID, + } + conversationReq.Conversation = &conversation + conversationReq.OperationID = pb.OperationID + conversationReq.FieldType = constant.GroupAtType + tagAll := utils.IsContain(constant.AtAllString, pb.MsgData.AtUserIDList) + if tagAll { + atUserID = utils.DifferenceString([]string{constant.AtAllString}, pb.MsgData.AtUserIDList) + if len(atUserID) == 0 { //just @everyone + conversationReq.UserIDList = memberUserIDList + conversation.GroupAtType = constant.AtAll + } else { //@Everyone and @other people + conversationReq.UserIDList = atUserID + conversation.GroupAtType = constant.AtAllAtMe + tag = true + } + } else { + conversationReq.UserIDList = pb.MsgData.AtUserIDList + conversation.GroupAtType = constant.AtMe + } + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName) + client := pbConversation.NewConversationClient(etcdConn) + conversationReply, err := client.ModifyConversationField(context.Background(), &conversationReq) + if err != nil { + log.NewError(conversationReq.OperationID, "ModifyConversationField rpc failed, ", conversationReq.String(), err.Error()) + } else if conversationReply.CommonResp.ErrCode != 0 { + log.NewError(conversationReq.OperationID, "ModifyConversationField rpc failed, ", conversationReq.String(), conversationReply.String()) + } + if tag { + conversationReq.UserIDList = utils.DifferenceString(atUserID, memberUserIDList) + conversation.GroupAtType = constant.AtAll + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName) + client := pbConversation.NewConversationClient(etcdConn) + conversationReply, err := client.ModifyConversationField(context.Background(), &conversationReq) + if err != nil { + log.NewError(conversationReq.OperationID, "ModifyConversationField rpc failed, ", conversationReq.String(), err.Error()) + } else if conversationReply.CommonResp.ErrCode != 0 { + log.NewError(conversationReq.OperationID, "ModifyConversationField rpc failed, ", conversationReq.String(), conversationReply.String()) + } + } default: } groupID := pb.MsgData.GroupID - for _, v := range reply.MemberList { - pb.MsgData.RecvID = v.UserID - isSend := modifyMessageByUserMessageReceiveOpt(v.UserID, groupID, constant.GroupChatType, pb) + for _, v := range memberUserIDList { + pb.MsgData.RecvID = v + isSend := modifyMessageByUserMessageReceiveOpt(v, groupID, constant.GroupChatType, pb) if isSend { msgToMQ.MsgData = pb.MsgData - err := rpc.sendMsgToKafka(&msgToMQ, v.UserID) + err := rpc.sendMsgToKafka(&msgToMQ, v) if err != nil { - log.NewError(msgToMQ.OperationID, "kafka send msg err:UserId", v.UserID, msgToMQ.String()) + log.NewError(msgToMQ.OperationID, "kafka send msg err:UserId", v, msgToMQ.String()) return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) } } diff --git a/pkg/common/constant/constant.go b/pkg/common/constant/constant.go index 87eae8d4b..9a66fd919 100644 --- a/pkg/common/constant/constant.go +++ b/pkg/common/constant/constant.go @@ -214,6 +214,16 @@ var ContentType2PushContent = map[int64]string{ Common: "你收到一条新消息", } +const ( + RecvMsgOpt = 1 + IsPinned = 2 + AttachedInfo = 3 + IsPrivateChat = 4 + GroupAtType = 5 + IsNotInGroup = 6 + Ex = 7 +) + const ( AppOrdinaryUsers = 1 AppAdmin = 2 diff --git a/pkg/common/db/mysql_model/im_mysql_model/conversation_model.go b/pkg/common/db/mysql_model/im_mysql_model/conversation_model.go new file mode 100644 index 000000000..2c252222d --- /dev/null +++ b/pkg/common/db/mysql_model/im_mysql_model/conversation_model.go @@ -0,0 +1,145 @@ +package im_mysql_model + +import ( + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" +) + +func SetConversation(conversation db.Conversation) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + dbConn.LogMode(false) + newConversation := conversation + if dbConn.Model(&db.Conversation{}).Find(&newConversation).RowsAffected == 0 { + log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "not exist in db, create") + return dbConn.Model(&db.Conversation{}).Create(conversation).Error + // if exist, then update record + } else { + log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "exist in db, update") + //force update + return dbConn.Model(conversation).Where("owner_user_id = ? and conversation_id = ?", conversation.OwnerUserID, conversation.ConversationID). + Update(map[string]interface{}{"recv_msg_opt": conversation.RecvMsgOpt, "is_pinned": conversation.IsPinned, "is_private_chat": conversation.IsPrivateChat, + "group_at_type": conversation.GroupAtType, "is_not_in_group": conversation.IsNotInGroup}).Error + } +} +func SetOneConversation(conversation db.Conversation) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + dbConn.LogMode(false) + return dbConn.Model(&db.Conversation{}).Create(conversation).Error + +} + +func PeerUserSetConversation(conversation db.Conversation) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + dbConn.LogMode(false) + newConversation := conversation + if dbConn.Model(&db.Conversation{}).Find(&newConversation).RowsAffected == 0 { + log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "not exist in db, create") + return dbConn.Model(&db.Conversation{}).Create(conversation).Error + // if exist, then update record + } + log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "exist in db, update") + //force update + return dbConn.Model(conversation).Where("owner_user_id = ? and conversation_id = ?", conversation.OwnerUserID, conversation.ConversationID). + Update(map[string]interface{}{"is_private_chat": conversation.IsPrivateChat}).Error + +} + +func SetRecvMsgOpt(conversation db.Conversation) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + dbConn.LogMode(false) + newConversation := conversation + if dbConn.Model(&db.Conversation{}).Find(&newConversation).RowsAffected == 0 { + log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "not exist in db, create") + return dbConn.Model(&db.Conversation{}).Create(conversation).Error + // if exist, then update record + } else { + log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "exist in db, update") + //force update + return dbConn.Model(conversation).Where("owner_user_id = ? and conversation_id = ?", conversation.OwnerUserID, conversation.ConversationID). + Update(map[string]interface{}{"recv_msg_opt": conversation.RecvMsgOpt}).Error + } +} + +func GetUserAllConversations(ownerUserID string) ([]db.Conversation, error) { + var conversations []db.Conversation + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return conversations, err + } + dbConn.LogMode(false) + err = dbConn.Model(&db.Conversation{}).Where("owner_user_id=?", ownerUserID).Find(&conversations).Error + return conversations, err +} +func GetMultipleUserConversationByConversationID(ownerUserIDList []string, conversationID string) ([]db.Conversation, error) { + var conversations []db.Conversation + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return conversations, err + } + dbConn.LogMode(false) + err = dbConn.Model(&db.Conversation{}).Where("owner_user_id IN ? and conversation_id=?", ownerUserIDList, conversationID).Find(&conversations).Error + return conversations, err +} +func GetExistConversationUserIDList(conversationID string) ([]string, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + var resultArr []string + err = dbConn.Table("conversations").Where(" conversation_id=?", conversationID).Pluck("owner_user_id", &resultArr).Error + if err != nil { + return nil, err + } + return resultArr, nil +} + +func GetConversation(OwnerUserID, conversationID string) (db.Conversation, error) { + var conversation db.Conversation + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return conversation, err + } + err = dbConn.Table("conversations").Where("owner_user_id=? and conversation_id=?", OwnerUserID, conversationID).Take(&conversation).Error + return conversation, err +} + +func GetConversations(OwnerUserID string, conversationIDs []string) ([]db.Conversation, error) { + var conversations []db.Conversation + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return conversations, err + } + err = dbConn.Model(&db.Conversation{}).Where("conversation_id IN (?) and owner_user_id=?", conversationIDs, OwnerUserID).Find(&conversations).Error + return conversations, err +} +func GetConversationsByConversationIDMultipleOwner(OwnerUserIDList []string, conversationID string) ([]db.Conversation, error) { + var conversations []db.Conversation + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return conversations, err + } + err = dbConn.Model(&db.Conversation{}).Where("owner_user_id IN (?) and conversation_id=?", OwnerUserIDList, conversationID).Find(&conversations).Error + return conversations, err +} +func UpdateColumnsConversations(ownerUserIDList []string, conversationID string, args map[string]interface{}) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + dbConn.LogMode(false) + return dbConn.Model(&db.Conversation{}).Where("owner_user_id IN ? and conversation_id=?", ownerUserIDList, conversationID).Updates(args).Error + +} diff --git a/pkg/common/db/mysql_model/im_mysql_model/user_model.go b/pkg/common/db/mysql_model/im_mysql_model/user_model.go index 5e805686d..c519ec2d0 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/user_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/user_model.go @@ -4,7 +4,6 @@ import ( "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" "Open_IM/pkg/common/db" - "Open_IM/pkg/common/log" "Open_IM/pkg/utils" "fmt" "time" @@ -305,101 +304,3 @@ func GetBlockUsersNumCount() (int32, error) { } return count, nil } - -func SetConversation(conversation db.Conversation) error { - dbConn, err := db.DB.MysqlDB.DefaultGormDB() - if err != nil { - return err - } - dbConn.LogMode(false) - newConversation := conversation - if dbConn.Model(&db.Conversation{}).Find(&newConversation).RowsAffected == 0 { - log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "not exist in db, create") - return dbConn.Model(&db.Conversation{}).Create(conversation).Error - // if exist, then update record - } else { - log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "exist in db, update") - //force update - return dbConn.Model(conversation).Where("owner_user_id = ? and conversation_id = ?", conversation.OwnerUserID, conversation.ConversationID). - Update(map[string]interface{}{"recv_msg_opt": conversation.RecvMsgOpt, "is_pinned": conversation.IsPinned, "is_private_chat": conversation.IsPrivateChat, - "group_at_type": conversation.GroupAtType, "is_not_in_group": conversation.IsNotInGroup}).Error - } -} - -func PeerUserSetConversation(conversation db.Conversation) error { - dbConn, err := db.DB.MysqlDB.DefaultGormDB() - if err != nil { - return err - } - dbConn.LogMode(false) - newConversation := conversation - if dbConn.Model(&db.Conversation{}).Find(&newConversation).RowsAffected == 0 { - log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "not exist in db, create") - return dbConn.Model(&db.Conversation{}).Create(conversation).Error - // if exist, then update record - } - log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "exist in db, update") - //force update - return dbConn.Model(conversation).Where("owner_user_id = ? and conversation_id = ?", conversation.OwnerUserID, conversation.ConversationID). - Update(map[string]interface{}{"is_private_chat": conversation.IsPrivateChat}).Error - -} - -func SetRecvMsgOpt(conversation db.Conversation) error { - dbConn, err := db.DB.MysqlDB.DefaultGormDB() - if err != nil { - return err - } - dbConn.LogMode(false) - newConversation := conversation - if dbConn.Model(&db.Conversation{}).Find(&newConversation).RowsAffected == 0 { - log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "not exist in db, create") - return dbConn.Model(&db.Conversation{}).Create(conversation).Error - // if exist, then update record - } else { - log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "exist in db, update") - //force update - return dbConn.Model(conversation).Where("owner_user_id = ? and conversation_id = ?", conversation.OwnerUserID, conversation.ConversationID). - Update(map[string]interface{}{"recv_msg_opt": conversation.RecvMsgOpt}).Error - } -} - -func GetUserAllConversations(ownerUserID string) ([]db.Conversation, error) { - var conversations []db.Conversation - dbConn, err := db.DB.MysqlDB.DefaultGormDB() - if err != nil { - return conversations, err - } - dbConn.LogMode(false) - err = dbConn.Model(&db.Conversation{}).Where("owner_user_id=?", ownerUserID).Find(&conversations).Error - return conversations, err -} - -func GetConversation(OwnerUserID, conversationID string) (db.Conversation, error) { - var conversation db.Conversation - dbConn, err := db.DB.MysqlDB.DefaultGormDB() - if err != nil { - return conversation, err - } - err = dbConn.Table("conversations").Where("owner_user_id=? and conversation_id=?", OwnerUserID, conversationID).Take(&conversation).Error - return conversation, err -} - -func GetConversations(OwnerUserID string, conversationIDs []string) ([]db.Conversation, error) { - var conversations []db.Conversation - dbConn, err := db.DB.MysqlDB.DefaultGormDB() - if err != nil { - return conversations, err - } - err = dbConn.Model(&db.Conversation{}).Where("conversation_id IN (?) and owner_user_id=?", conversationIDs, OwnerUserID).Find(&conversations).Error - return conversations, err -} -func GetConversationsByConversationIDMultipleOwner(OwnerUserIDList []string, conversationID string) ([]db.Conversation, error) { - var conversations []db.Conversation - dbConn, err := db.DB.MysqlDB.DefaultGormDB() - if err != nil { - return conversations, err - } - err = dbConn.Model(&db.Conversation{}).Where("owner_user_id IN (?) and conversation_id=?", OwnerUserIDList, conversationID).Find(&conversations).Error - return conversations, err -} diff --git a/pkg/proto/sdk_ws/ws.pb.go b/pkg/proto/sdk_ws/ws.pb.go index 582686707..2f5ca5e67 100644 --- a/pkg/proto/sdk_ws/ws.pb.go +++ b/pkg/proto/sdk_ws/ws.pb.go @@ -40,7 +40,7 @@ func (m *GroupInfo) Reset() { *m = GroupInfo{} } func (m *GroupInfo) String() string { return proto.CompactTextString(m) } func (*GroupInfo) ProtoMessage() {} func (*GroupInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{0} + return fileDescriptor_ws_8b0ea2633e539530, []int{0} } func (m *GroupInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupInfo.Unmarshal(m, b) @@ -165,7 +165,7 @@ func (m *GroupMemberFullInfo) Reset() { *m = GroupMemberFullInfo{} } func (m *GroupMemberFullInfo) String() string { return proto.CompactTextString(m) } func (*GroupMemberFullInfo) ProtoMessage() {} func (*GroupMemberFullInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{1} + return fileDescriptor_ws_8b0ea2633e539530, []int{1} } func (m *GroupMemberFullInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupMemberFullInfo.Unmarshal(m, b) @@ -277,7 +277,7 @@ func (m *PublicUserInfo) Reset() { *m = PublicUserInfo{} } func (m *PublicUserInfo) String() string { return proto.CompactTextString(m) } func (*PublicUserInfo) ProtoMessage() {} func (*PublicUserInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{2} + return fileDescriptor_ws_8b0ea2633e539530, []int{2} } func (m *PublicUserInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PublicUserInfo.Unmarshal(m, b) @@ -352,7 +352,7 @@ func (m *UserInfo) Reset() { *m = UserInfo{} } func (m *UserInfo) String() string { return proto.CompactTextString(m) } func (*UserInfo) ProtoMessage() {} func (*UserInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{3} + return fileDescriptor_ws_8b0ea2633e539530, []int{3} } func (m *UserInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserInfo.Unmarshal(m, b) @@ -459,7 +459,7 @@ func (m *FriendInfo) Reset() { *m = FriendInfo{} } func (m *FriendInfo) String() string { return proto.CompactTextString(m) } func (*FriendInfo) ProtoMessage() {} func (*FriendInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{4} + return fileDescriptor_ws_8b0ea2633e539530, []int{4} } func (m *FriendInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendInfo.Unmarshal(m, b) @@ -544,7 +544,7 @@ func (m *BlackInfo) Reset() { *m = BlackInfo{} } func (m *BlackInfo) String() string { return proto.CompactTextString(m) } func (*BlackInfo) ProtoMessage() {} func (*BlackInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{5} + return fileDescriptor_ws_8b0ea2633e539530, []int{5} } func (m *BlackInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BlackInfo.Unmarshal(m, b) @@ -625,7 +625,7 @@ func (m *GroupRequest) Reset() { *m = GroupRequest{} } func (m *GroupRequest) String() string { return proto.CompactTextString(m) } func (*GroupRequest) ProtoMessage() {} func (*GroupRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{6} + return fileDescriptor_ws_8b0ea2633e539530, []int{6} } func (m *GroupRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupRequest.Unmarshal(m, b) @@ -733,7 +733,7 @@ func (m *FriendRequest) Reset() { *m = FriendRequest{} } func (m *FriendRequest) String() string { return proto.CompactTextString(m) } func (*FriendRequest) ProtoMessage() {} func (*FriendRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{7} + return fileDescriptor_ws_8b0ea2633e539530, []int{7} } func (m *FriendRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendRequest.Unmarshal(m, b) @@ -878,7 +878,7 @@ func (m *Department) Reset() { *m = Department{} } func (m *Department) String() string { return proto.CompactTextString(m) } func (*Department) ProtoMessage() {} func (*Department) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{8} + return fileDescriptor_ws_8b0ea2633e539530, []int{8} } func (m *Department) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Department.Unmarshal(m, b) @@ -989,7 +989,7 @@ func (m *OrganizationUser) Reset() { *m = OrganizationUser{} } func (m *OrganizationUser) String() string { return proto.CompactTextString(m) } func (*OrganizationUser) ProtoMessage() {} func (*OrganizationUser) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{9} + return fileDescriptor_ws_8b0ea2633e539530, []int{9} } func (m *OrganizationUser) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OrganizationUser.Unmarshal(m, b) @@ -1103,7 +1103,7 @@ func (m *DepartmentMember) Reset() { *m = DepartmentMember{} } func (m *DepartmentMember) String() string { return proto.CompactTextString(m) } func (*DepartmentMember) ProtoMessage() {} func (*DepartmentMember) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{10} + return fileDescriptor_ws_8b0ea2633e539530, []int{10} } func (m *DepartmentMember) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DepartmentMember.Unmarshal(m, b) @@ -1184,7 +1184,7 @@ func (m *UserDepartmentMember) Reset() { *m = UserDepartmentMember{} } func (m *UserDepartmentMember) String() string { return proto.CompactTextString(m) } func (*UserDepartmentMember) ProtoMessage() {} func (*UserDepartmentMember) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{11} + return fileDescriptor_ws_8b0ea2633e539530, []int{11} } func (m *UserDepartmentMember) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserDepartmentMember.Unmarshal(m, b) @@ -1230,7 +1230,7 @@ func (m *UserInDepartment) Reset() { *m = UserInDepartment{} } func (m *UserInDepartment) String() string { return proto.CompactTextString(m) } func (*UserInDepartment) ProtoMessage() {} func (*UserInDepartment) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{12} + return fileDescriptor_ws_8b0ea2633e539530, []int{12} } func (m *UserInDepartment) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserInDepartment.Unmarshal(m, b) @@ -1277,7 +1277,7 @@ func (m *PullMessageBySeqListResp) Reset() { *m = PullMessageBySeqListRe func (m *PullMessageBySeqListResp) String() string { return proto.CompactTextString(m) } func (*PullMessageBySeqListResp) ProtoMessage() {} func (*PullMessageBySeqListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{13} + return fileDescriptor_ws_8b0ea2633e539530, []int{13} } func (m *PullMessageBySeqListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PullMessageBySeqListResp.Unmarshal(m, b) @@ -1331,7 +1331,7 @@ func (m *PullMessageBySeqListReq) Reset() { *m = PullMessageBySeqListReq func (m *PullMessageBySeqListReq) String() string { return proto.CompactTextString(m) } func (*PullMessageBySeqListReq) ProtoMessage() {} func (*PullMessageBySeqListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{14} + return fileDescriptor_ws_8b0ea2633e539530, []int{14} } func (m *PullMessageBySeqListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PullMessageBySeqListReq.Unmarshal(m, b) @@ -1382,7 +1382,7 @@ func (m *GetMaxAndMinSeqReq) Reset() { *m = GetMaxAndMinSeqReq{} } func (m *GetMaxAndMinSeqReq) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqReq) ProtoMessage() {} func (*GetMaxAndMinSeqReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{15} + return fileDescriptor_ws_8b0ea2633e539530, []int{15} } func (m *GetMaxAndMinSeqReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqReq.Unmarshal(m, b) @@ -1414,7 +1414,7 @@ func (m *GetMaxAndMinSeqResp) Reset() { *m = GetMaxAndMinSeqResp{} } func (m *GetMaxAndMinSeqResp) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqResp) ProtoMessage() {} func (*GetMaxAndMinSeqResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{16} + return fileDescriptor_ws_8b0ea2633e539530, []int{16} } func (m *GetMaxAndMinSeqResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqResp.Unmarshal(m, b) @@ -1461,7 +1461,7 @@ func (m *UserSendMsgResp) Reset() { *m = UserSendMsgResp{} } func (m *UserSendMsgResp) String() string { return proto.CompactTextString(m) } func (*UserSendMsgResp) ProtoMessage() {} func (*UserSendMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{17} + return fileDescriptor_ws_8b0ea2633e539530, []int{17} } func (m *UserSendMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserSendMsgResp.Unmarshal(m, b) @@ -1521,6 +1521,7 @@ type MsgData struct { Status int32 `protobuf:"varint,17,opt,name=status" json:"status,omitempty"` Options map[string]bool `protobuf:"bytes,18,rep,name=options" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,19,opt,name=offlinePushInfo" json:"offlinePushInfo,omitempty"` + AtUserIDList []string `protobuf:"bytes,20,rep,name=atUserIDList" json:"atUserIDList,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1530,7 +1531,7 @@ func (m *MsgData) Reset() { *m = MsgData{} } func (m *MsgData) String() string { return proto.CompactTextString(m) } func (*MsgData) ProtoMessage() {} func (*MsgData) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{18} + return fileDescriptor_ws_8b0ea2633e539530, []int{18} } func (m *MsgData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgData.Unmarshal(m, b) @@ -1676,7 +1677,13 @@ func (m *MsgData) GetOfflinePushInfo() *OfflinePushInfo { return nil } -// repeated string atUserIDList = 17; +func (m *MsgData) GetAtUserIDList() []string { + if m != nil { + return m.AtUserIDList + } + return nil +} + type OfflinePushInfo struct { Title string `protobuf:"bytes,1,opt,name=title" json:"title,omitempty"` Desc string `protobuf:"bytes,2,opt,name=desc" json:"desc,omitempty"` @@ -1692,7 +1699,7 @@ func (m *OfflinePushInfo) Reset() { *m = OfflinePushInfo{} } func (m *OfflinePushInfo) String() string { return proto.CompactTextString(m) } func (*OfflinePushInfo) ProtoMessage() {} func (*OfflinePushInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{19} + return fileDescriptor_ws_8b0ea2633e539530, []int{19} } func (m *OfflinePushInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OfflinePushInfo.Unmarshal(m, b) @@ -1760,7 +1767,7 @@ func (m *TipsComm) Reset() { *m = TipsComm{} } func (m *TipsComm) String() string { return proto.CompactTextString(m) } func (*TipsComm) ProtoMessage() {} func (*TipsComm) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{20} + return fileDescriptor_ws_8b0ea2633e539530, []int{20} } func (m *TipsComm) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TipsComm.Unmarshal(m, b) @@ -1817,7 +1824,7 @@ func (m *GroupCreatedTips) Reset() { *m = GroupCreatedTips{} } func (m *GroupCreatedTips) String() string { return proto.CompactTextString(m) } func (*GroupCreatedTips) ProtoMessage() {} func (*GroupCreatedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{21} + return fileDescriptor_ws_8b0ea2633e539530, []int{21} } func (m *GroupCreatedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupCreatedTips.Unmarshal(m, b) @@ -1886,7 +1893,7 @@ func (m *GroupInfoSetTips) Reset() { *m = GroupInfoSetTips{} } func (m *GroupInfoSetTips) String() string { return proto.CompactTextString(m) } func (*GroupInfoSetTips) ProtoMessage() {} func (*GroupInfoSetTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{22} + return fileDescriptor_ws_8b0ea2633e539530, []int{22} } func (m *GroupInfoSetTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupInfoSetTips.Unmarshal(m, b) @@ -1941,7 +1948,7 @@ func (m *JoinGroupApplicationTips) Reset() { *m = JoinGroupApplicationTi func (m *JoinGroupApplicationTips) String() string { return proto.CompactTextString(m) } func (*JoinGroupApplicationTips) ProtoMessage() {} func (*JoinGroupApplicationTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{23} + return fileDescriptor_ws_8b0ea2633e539530, []int{23} } func (m *JoinGroupApplicationTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_JoinGroupApplicationTips.Unmarshal(m, b) @@ -1997,7 +2004,7 @@ func (m *MemberQuitTips) Reset() { *m = MemberQuitTips{} } func (m *MemberQuitTips) String() string { return proto.CompactTextString(m) } func (*MemberQuitTips) ProtoMessage() {} func (*MemberQuitTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{24} + return fileDescriptor_ws_8b0ea2633e539530, []int{24} } func (m *MemberQuitTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MemberQuitTips.Unmarshal(m, b) @@ -2052,7 +2059,7 @@ func (m *GroupApplicationAcceptedTips) Reset() { *m = GroupApplicationAc func (m *GroupApplicationAcceptedTips) String() string { return proto.CompactTextString(m) } func (*GroupApplicationAcceptedTips) ProtoMessage() {} func (*GroupApplicationAcceptedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{25} + return fileDescriptor_ws_8b0ea2633e539530, []int{25} } func (m *GroupApplicationAcceptedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupApplicationAcceptedTips.Unmarshal(m, b) @@ -2107,7 +2114,7 @@ func (m *GroupApplicationRejectedTips) Reset() { *m = GroupApplicationRe func (m *GroupApplicationRejectedTips) String() string { return proto.CompactTextString(m) } func (*GroupApplicationRejectedTips) ProtoMessage() {} func (*GroupApplicationRejectedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{26} + return fileDescriptor_ws_8b0ea2633e539530, []int{26} } func (m *GroupApplicationRejectedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupApplicationRejectedTips.Unmarshal(m, b) @@ -2163,7 +2170,7 @@ func (m *GroupOwnerTransferredTips) Reset() { *m = GroupOwnerTransferred func (m *GroupOwnerTransferredTips) String() string { return proto.CompactTextString(m) } func (*GroupOwnerTransferredTips) ProtoMessage() {} func (*GroupOwnerTransferredTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{27} + return fileDescriptor_ws_8b0ea2633e539530, []int{27} } func (m *GroupOwnerTransferredTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupOwnerTransferredTips.Unmarshal(m, b) @@ -2226,7 +2233,7 @@ func (m *MemberKickedTips) Reset() { *m = MemberKickedTips{} } func (m *MemberKickedTips) String() string { return proto.CompactTextString(m) } func (*MemberKickedTips) ProtoMessage() {} func (*MemberKickedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{28} + return fileDescriptor_ws_8b0ea2633e539530, []int{28} } func (m *MemberKickedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MemberKickedTips.Unmarshal(m, b) @@ -2289,7 +2296,7 @@ func (m *MemberInvitedTips) Reset() { *m = MemberInvitedTips{} } func (m *MemberInvitedTips) String() string { return proto.CompactTextString(m) } func (*MemberInvitedTips) ProtoMessage() {} func (*MemberInvitedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{29} + return fileDescriptor_ws_8b0ea2633e539530, []int{29} } func (m *MemberInvitedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MemberInvitedTips.Unmarshal(m, b) @@ -2351,7 +2358,7 @@ func (m *MemberEnterTips) Reset() { *m = MemberEnterTips{} } func (m *MemberEnterTips) String() string { return proto.CompactTextString(m) } func (*MemberEnterTips) ProtoMessage() {} func (*MemberEnterTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{30} + return fileDescriptor_ws_8b0ea2633e539530, []int{30} } func (m *MemberEnterTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MemberEnterTips.Unmarshal(m, b) @@ -2405,7 +2412,7 @@ func (m *GroupDismissedTips) Reset() { *m = GroupDismissedTips{} } func (m *GroupDismissedTips) String() string { return proto.CompactTextString(m) } func (*GroupDismissedTips) ProtoMessage() {} func (*GroupDismissedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{31} + return fileDescriptor_ws_8b0ea2633e539530, []int{31} } func (m *GroupDismissedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupDismissedTips.Unmarshal(m, b) @@ -2461,7 +2468,7 @@ func (m *GroupMemberMutedTips) Reset() { *m = GroupMemberMutedTips{} } func (m *GroupMemberMutedTips) String() string { return proto.CompactTextString(m) } func (*GroupMemberMutedTips) ProtoMessage() {} func (*GroupMemberMutedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{32} + return fileDescriptor_ws_8b0ea2633e539530, []int{32} } func (m *GroupMemberMutedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupMemberMutedTips.Unmarshal(m, b) @@ -2530,7 +2537,7 @@ func (m *GroupMemberCancelMutedTips) Reset() { *m = GroupMemberCancelMut func (m *GroupMemberCancelMutedTips) String() string { return proto.CompactTextString(m) } func (*GroupMemberCancelMutedTips) ProtoMessage() {} func (*GroupMemberCancelMutedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{33} + return fileDescriptor_ws_8b0ea2633e539530, []int{33} } func (m *GroupMemberCancelMutedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupMemberCancelMutedTips.Unmarshal(m, b) @@ -2591,7 +2598,7 @@ func (m *GroupMutedTips) Reset() { *m = GroupMutedTips{} } func (m *GroupMutedTips) String() string { return proto.CompactTextString(m) } func (*GroupMutedTips) ProtoMessage() {} func (*GroupMutedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{34} + return fileDescriptor_ws_8b0ea2633e539530, []int{34} } func (m *GroupMutedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupMutedTips.Unmarshal(m, b) @@ -2645,7 +2652,7 @@ func (m *GroupCancelMutedTips) Reset() { *m = GroupCancelMutedTips{} } func (m *GroupCancelMutedTips) String() string { return proto.CompactTextString(m) } func (*GroupCancelMutedTips) ProtoMessage() {} func (*GroupCancelMutedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{35} + return fileDescriptor_ws_8b0ea2633e539530, []int{35} } func (m *GroupCancelMutedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupCancelMutedTips.Unmarshal(m, b) @@ -2700,7 +2707,7 @@ func (m *GroupMemberInfoSetTips) Reset() { *m = GroupMemberInfoSetTips{} func (m *GroupMemberInfoSetTips) String() string { return proto.CompactTextString(m) } func (*GroupMemberInfoSetTips) ProtoMessage() {} func (*GroupMemberInfoSetTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{36} + return fileDescriptor_ws_8b0ea2633e539530, []int{36} } func (m *GroupMemberInfoSetTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupMemberInfoSetTips.Unmarshal(m, b) @@ -2760,7 +2767,7 @@ func (m *OrganizationChangedTips) Reset() { *m = OrganizationChangedTips func (m *OrganizationChangedTips) String() string { return proto.CompactTextString(m) } func (*OrganizationChangedTips) ProtoMessage() {} func (*OrganizationChangedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{37} + return fileDescriptor_ws_8b0ea2633e539530, []int{37} } func (m *OrganizationChangedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OrganizationChangedTips.Unmarshal(m, b) @@ -2807,7 +2814,7 @@ func (m *FriendApplication) Reset() { *m = FriendApplication{} } func (m *FriendApplication) String() string { return proto.CompactTextString(m) } func (*FriendApplication) ProtoMessage() {} func (*FriendApplication) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{38} + return fileDescriptor_ws_8b0ea2633e539530, []int{38} } func (m *FriendApplication) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendApplication.Unmarshal(m, b) @@ -2860,7 +2867,7 @@ func (m *FromToUserID) Reset() { *m = FromToUserID{} } func (m *FromToUserID) String() string { return proto.CompactTextString(m) } func (*FromToUserID) ProtoMessage() {} func (*FromToUserID) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{39} + return fileDescriptor_ws_8b0ea2633e539530, []int{39} } func (m *FromToUserID) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FromToUserID.Unmarshal(m, b) @@ -2906,7 +2913,7 @@ func (m *FriendApplicationTips) Reset() { *m = FriendApplicationTips{} } func (m *FriendApplicationTips) String() string { return proto.CompactTextString(m) } func (*FriendApplicationTips) ProtoMessage() {} func (*FriendApplicationTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{40} + return fileDescriptor_ws_8b0ea2633e539530, []int{40} } func (m *FriendApplicationTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendApplicationTips.Unmarshal(m, b) @@ -2946,7 +2953,7 @@ func (m *FriendApplicationApprovedTips) Reset() { *m = FriendApplication func (m *FriendApplicationApprovedTips) String() string { return proto.CompactTextString(m) } func (*FriendApplicationApprovedTips) ProtoMessage() {} func (*FriendApplicationApprovedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{41} + return fileDescriptor_ws_8b0ea2633e539530, []int{41} } func (m *FriendApplicationApprovedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendApplicationApprovedTips.Unmarshal(m, b) @@ -2993,7 +3000,7 @@ func (m *FriendApplicationRejectedTips) Reset() { *m = FriendApplication func (m *FriendApplicationRejectedTips) String() string { return proto.CompactTextString(m) } func (*FriendApplicationRejectedTips) ProtoMessage() {} func (*FriendApplicationRejectedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{42} + return fileDescriptor_ws_8b0ea2633e539530, []int{42} } func (m *FriendApplicationRejectedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendApplicationRejectedTips.Unmarshal(m, b) @@ -3041,7 +3048,7 @@ func (m *FriendAddedTips) Reset() { *m = FriendAddedTips{} } func (m *FriendAddedTips) String() string { return proto.CompactTextString(m) } func (*FriendAddedTips) ProtoMessage() {} func (*FriendAddedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{43} + return fileDescriptor_ws_8b0ea2633e539530, []int{43} } func (m *FriendAddedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendAddedTips.Unmarshal(m, b) @@ -3094,7 +3101,7 @@ func (m *FriendDeletedTips) Reset() { *m = FriendDeletedTips{} } func (m *FriendDeletedTips) String() string { return proto.CompactTextString(m) } func (*FriendDeletedTips) ProtoMessage() {} func (*FriendDeletedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{44} + return fileDescriptor_ws_8b0ea2633e539530, []int{44} } func (m *FriendDeletedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendDeletedTips.Unmarshal(m, b) @@ -3132,7 +3139,7 @@ func (m *BlackAddedTips) Reset() { *m = BlackAddedTips{} } func (m *BlackAddedTips) String() string { return proto.CompactTextString(m) } func (*BlackAddedTips) ProtoMessage() {} func (*BlackAddedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{45} + return fileDescriptor_ws_8b0ea2633e539530, []int{45} } func (m *BlackAddedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BlackAddedTips.Unmarshal(m, b) @@ -3170,7 +3177,7 @@ func (m *BlackDeletedTips) Reset() { *m = BlackDeletedTips{} } func (m *BlackDeletedTips) String() string { return proto.CompactTextString(m) } func (*BlackDeletedTips) ProtoMessage() {} func (*BlackDeletedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{46} + return fileDescriptor_ws_8b0ea2633e539530, []int{46} } func (m *BlackDeletedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BlackDeletedTips.Unmarshal(m, b) @@ -3208,7 +3215,7 @@ func (m *FriendInfoChangedTips) Reset() { *m = FriendInfoChangedTips{} } func (m *FriendInfoChangedTips) String() string { return proto.CompactTextString(m) } func (*FriendInfoChangedTips) ProtoMessage() {} func (*FriendInfoChangedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{47} + return fileDescriptor_ws_8b0ea2633e539530, []int{47} } func (m *FriendInfoChangedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendInfoChangedTips.Unmarshal(m, b) @@ -3247,7 +3254,7 @@ func (m *UserInfoUpdatedTips) Reset() { *m = UserInfoUpdatedTips{} } func (m *UserInfoUpdatedTips) String() string { return proto.CompactTextString(m) } func (*UserInfoUpdatedTips) ProtoMessage() {} func (*UserInfoUpdatedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{48} + return fileDescriptor_ws_8b0ea2633e539530, []int{48} } func (m *UserInfoUpdatedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserInfoUpdatedTips.Unmarshal(m, b) @@ -3286,7 +3293,7 @@ func (m *ConversationUpdateTips) Reset() { *m = ConversationUpdateTips{} func (m *ConversationUpdateTips) String() string { return proto.CompactTextString(m) } func (*ConversationUpdateTips) ProtoMessage() {} func (*ConversationUpdateTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{49} + return fileDescriptor_ws_8b0ea2633e539530, []int{49} } func (m *ConversationUpdateTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ConversationUpdateTips.Unmarshal(m, b) @@ -3326,7 +3333,7 @@ func (m *ConversationSetPrivateTips) Reset() { *m = ConversationSetPriva func (m *ConversationSetPrivateTips) String() string { return proto.CompactTextString(m) } func (*ConversationSetPrivateTips) ProtoMessage() {} func (*ConversationSetPrivateTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{50} + return fileDescriptor_ws_8b0ea2633e539530, []int{50} } func (m *ConversationSetPrivateTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ConversationSetPrivateTips.Unmarshal(m, b) @@ -3380,7 +3387,7 @@ func (m *RequestPagination) Reset() { *m = RequestPagination{} } func (m *RequestPagination) String() string { return proto.CompactTextString(m) } func (*RequestPagination) ProtoMessage() {} func (*RequestPagination) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{51} + return fileDescriptor_ws_8b0ea2633e539530, []int{51} } func (m *RequestPagination) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RequestPagination.Unmarshal(m, b) @@ -3426,7 +3433,7 @@ func (m *ResponsePagination) Reset() { *m = ResponsePagination{} } func (m *ResponsePagination) String() string { return proto.CompactTextString(m) } func (*ResponsePagination) ProtoMessage() {} func (*ResponsePagination) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{52} + return fileDescriptor_ws_8b0ea2633e539530, []int{52} } func (m *ResponsePagination) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ResponsePagination.Unmarshal(m, b) @@ -3479,7 +3486,7 @@ func (m *SignalReq) Reset() { *m = SignalReq{} } func (m *SignalReq) String() string { return proto.CompactTextString(m) } func (*SignalReq) ProtoMessage() {} func (*SignalReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{53} + return fileDescriptor_ws_8b0ea2633e539530, []int{53} } func (m *SignalReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalReq.Unmarshal(m, b) @@ -3746,7 +3753,7 @@ func (m *SignalResp) Reset() { *m = SignalResp{} } func (m *SignalResp) String() string { return proto.CompactTextString(m) } func (*SignalResp) ProtoMessage() {} func (*SignalResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{54} + return fileDescriptor_ws_8b0ea2633e539530, []int{54} } func (m *SignalResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalResp.Unmarshal(m, b) @@ -4014,7 +4021,7 @@ func (m *InvitationInfo) Reset() { *m = InvitationInfo{} } func (m *InvitationInfo) String() string { return proto.CompactTextString(m) } func (*InvitationInfo) ProtoMessage() {} func (*InvitationInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{55} + return fileDescriptor_ws_8b0ea2633e539530, []int{55} } func (m *InvitationInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InvitationInfo.Unmarshal(m, b) @@ -4110,7 +4117,7 @@ func (m *ParticipantMetaData) Reset() { *m = ParticipantMetaData{} } func (m *ParticipantMetaData) String() string { return proto.CompactTextString(m) } func (*ParticipantMetaData) ProtoMessage() {} func (*ParticipantMetaData) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{56} + return fileDescriptor_ws_8b0ea2633e539530, []int{56} } func (m *ParticipantMetaData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ParticipantMetaData.Unmarshal(m, b) @@ -4165,7 +4172,7 @@ func (m *SignalInviteReq) Reset() { *m = SignalInviteReq{} } func (m *SignalInviteReq) String() string { return proto.CompactTextString(m) } func (*SignalInviteReq) ProtoMessage() {} func (*SignalInviteReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{57} + return fileDescriptor_ws_8b0ea2633e539530, []int{57} } func (m *SignalInviteReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalInviteReq.Unmarshal(m, b) @@ -4226,7 +4233,7 @@ func (m *SignalInviteReply) Reset() { *m = SignalInviteReply{} } func (m *SignalInviteReply) String() string { return proto.CompactTextString(m) } func (*SignalInviteReply) ProtoMessage() {} func (*SignalInviteReply) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{58} + return fileDescriptor_ws_8b0ea2633e539530, []int{58} } func (m *SignalInviteReply) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalInviteReply.Unmarshal(m, b) @@ -4281,7 +4288,7 @@ func (m *SignalInviteInGroupReq) Reset() { *m = SignalInviteInGroupReq{} func (m *SignalInviteInGroupReq) String() string { return proto.CompactTextString(m) } func (*SignalInviteInGroupReq) ProtoMessage() {} func (*SignalInviteInGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{59} + return fileDescriptor_ws_8b0ea2633e539530, []int{59} } func (m *SignalInviteInGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalInviteInGroupReq.Unmarshal(m, b) @@ -4342,7 +4349,7 @@ func (m *SignalInviteInGroupReply) Reset() { *m = SignalInviteInGroupRep func (m *SignalInviteInGroupReply) String() string { return proto.CompactTextString(m) } func (*SignalInviteInGroupReply) ProtoMessage() {} func (*SignalInviteInGroupReply) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{60} + return fileDescriptor_ws_8b0ea2633e539530, []int{60} } func (m *SignalInviteInGroupReply) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalInviteInGroupReply.Unmarshal(m, b) @@ -4397,7 +4404,7 @@ func (m *SignalCancelReq) Reset() { *m = SignalCancelReq{} } func (m *SignalCancelReq) String() string { return proto.CompactTextString(m) } func (*SignalCancelReq) ProtoMessage() {} func (*SignalCancelReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{61} + return fileDescriptor_ws_8b0ea2633e539530, []int{61} } func (m *SignalCancelReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalCancelReq.Unmarshal(m, b) @@ -4455,7 +4462,7 @@ func (m *SignalCancelReply) Reset() { *m = SignalCancelReply{} } func (m *SignalCancelReply) String() string { return proto.CompactTextString(m) } func (*SignalCancelReply) ProtoMessage() {} func (*SignalCancelReply) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{62} + return fileDescriptor_ws_8b0ea2633e539530, []int{62} } func (m *SignalCancelReply) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalCancelReply.Unmarshal(m, b) @@ -4490,7 +4497,7 @@ func (m *SignalAcceptReq) Reset() { *m = SignalAcceptReq{} } func (m *SignalAcceptReq) String() string { return proto.CompactTextString(m) } func (*SignalAcceptReq) ProtoMessage() {} func (*SignalAcceptReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{63} + return fileDescriptor_ws_8b0ea2633e539530, []int{63} } func (m *SignalAcceptReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalAcceptReq.Unmarshal(m, b) @@ -4558,7 +4565,7 @@ func (m *SignalAcceptReply) Reset() { *m = SignalAcceptReply{} } func (m *SignalAcceptReply) String() string { return proto.CompactTextString(m) } func (*SignalAcceptReply) ProtoMessage() {} func (*SignalAcceptReply) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{64} + return fileDescriptor_ws_8b0ea2633e539530, []int{64} } func (m *SignalAcceptReply) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalAcceptReply.Unmarshal(m, b) @@ -4612,7 +4619,7 @@ func (m *SignalHungUpReq) Reset() { *m = SignalHungUpReq{} } func (m *SignalHungUpReq) String() string { return proto.CompactTextString(m) } func (*SignalHungUpReq) ProtoMessage() {} func (*SignalHungUpReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{65} + return fileDescriptor_ws_8b0ea2633e539530, []int{65} } func (m *SignalHungUpReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalHungUpReq.Unmarshal(m, b) @@ -4663,7 +4670,7 @@ func (m *SignalHungUpReply) Reset() { *m = SignalHungUpReply{} } func (m *SignalHungUpReply) String() string { return proto.CompactTextString(m) } func (*SignalHungUpReply) ProtoMessage() {} func (*SignalHungUpReply) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{66} + return fileDescriptor_ws_8b0ea2633e539530, []int{66} } func (m *SignalHungUpReply) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalHungUpReply.Unmarshal(m, b) @@ -4698,7 +4705,7 @@ func (m *SignalRejectReq) Reset() { *m = SignalRejectReq{} } func (m *SignalRejectReq) String() string { return proto.CompactTextString(m) } func (*SignalRejectReq) ProtoMessage() {} func (*SignalRejectReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{67} + return fileDescriptor_ws_8b0ea2633e539530, []int{67} } func (m *SignalRejectReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalRejectReq.Unmarshal(m, b) @@ -4763,7 +4770,7 @@ func (m *SignalRejectReply) Reset() { *m = SignalRejectReply{} } func (m *SignalRejectReply) String() string { return proto.CompactTextString(m) } func (*SignalRejectReply) ProtoMessage() {} func (*SignalRejectReply) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{68} + return fileDescriptor_ws_8b0ea2633e539530, []int{68} } func (m *SignalRejectReply) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalRejectReply.Unmarshal(m, b) @@ -4797,7 +4804,7 @@ func (m *DelMsgListReq) Reset() { *m = DelMsgListReq{} } func (m *DelMsgListReq) String() string { return proto.CompactTextString(m) } func (*DelMsgListReq) ProtoMessage() {} func (*DelMsgListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{69} + return fileDescriptor_ws_8b0ea2633e539530, []int{69} } func (m *DelMsgListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DelMsgListReq.Unmarshal(m, b) @@ -4857,7 +4864,7 @@ func (m *DelMsgListResp) Reset() { *m = DelMsgListResp{} } func (m *DelMsgListResp) String() string { return proto.CompactTextString(m) } func (*DelMsgListResp) ProtoMessage() {} func (*DelMsgListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_0aa1613bcc1a3980, []int{70} + return fileDescriptor_ws_8b0ea2633e539530, []int{70} } func (m *DelMsgListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DelMsgListResp.Unmarshal(m, b) @@ -4966,198 +4973,199 @@ func init() { proto.RegisterType((*DelMsgListResp)(nil), "server_api_params.DelMsgListResp") } -func init() { proto.RegisterFile("sdk_ws/ws.proto", fileDescriptor_ws_0aa1613bcc1a3980) } - -var fileDescriptor_ws_0aa1613bcc1a3980 = []byte{ - // 3033 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5b, 0xcf, 0x6f, 0x24, 0x47, - 0xf5, 0xff, 0x76, 0x8f, 0x67, 0xec, 0x79, 0xe3, 0xf1, 0x8f, 0xde, 0xfd, 0x3a, 0x83, 0xd9, 0x2c, - 0xa6, 0xb1, 0x42, 0x08, 0xb0, 0x41, 0x89,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 0xb4, 0x70, 0x5d, 0xd7, 0xb9, 0x67, 0xd6, 0x60, 0x2f, - 0xc1, 0x4a, 0x92, 0x1d, 0x94, 0x83, 0xdb, 0xcb, 0x42, 0x19, 0xee, 0x35, 0x3e, 0x07, 0x15, 0x8b, - 0x33, 0xde, 0x08, 0x53, 0x4d, 0xc9, 0xa8, 0x56, 0x05, 0xf6, 0xbb, 0x26, 0xac, 0xdc, 0x8d, 0x87, - 0x2e, 0xf5, 0xbf, 0x2b, 0xca, 0x4d, 0xb1, 0x80, 0xcf, 0x92, 0x72, 0x37, 0xa0, 0x43, 0xe8, 0x30, - 0xf0, 0x93, 0xa3, 0xbd, 0x12, 0x37, 0x95, 0xa5, 0x82, 0x3d, 0x37, 0x29, 0x29, 0x37, 0xb5, 0xa4, - 0xbc, 0x06, 0xad, 0x90, 0x1d, 0xf8, 0x41, 0x1e, 0xf7, 0x92, 0x12, 0x31, 0x4f, 0x02, 0x22, 0xb2, - 0x73, 0x11, 0xf3, 0x39, 0xa3, 0x4c, 0xd4, 0x0b, 0x63, 0x13, 0x75, 0x5b, 0x4d, 0xd4, 0x3a, 0xf0, - 0x50, 0x03, 0x1e, 0xe1, 0xea, 0x14, 0x70, 0xfd, 0xc9, 0x80, 0x95, 0x12, 0x6e, 0xac, 0x41, 0x27, - 0xc2, 0x55, 0x8d, 0x40, 0x73, 0x4c, 0x04, 0x16, 0x71, 0xd3, 0x50, 0xe3, 0x86, 0x47, 0x1a, 0x4b, - 0x7c, 0xa5, 0xde, 0x2f, 0x68, 0xde, 0x5b, 0x40, 0x5c, 0x05, 0x2c, 0xa4, 0x94, 0xaa, 0xbb, 0xa5, - 0x55, 0xdd, 0xd5, 0x3c, 0xfa, 0x07, 0x03, 0x2e, 0x72, 0x2f, 0xd7, 0x86, 0x71, 0x17, 0x56, 0x58, - 0x25, 0x12, 0x64, 0xa2, 0xf9, 0xd4, 0x98, 0x44, 0x51, 0x0d, 0x1a, 0xa7, 0x26, 0xcc, 0x15, 0x7a, - 0x95, 0x4e, 0x64, 0xe6, 0x19, 0xa7, 0xb0, 0x6a, 0x8f, 0x53, 0x13, 0xb6, 0x3f, 0x30, 0x60, 0x05, - 0x53, 0x9b, 0x32, 0xcf, 0xcf, 0xdd, 0xec, 0xb7, 0xe0, 0x62, 0xb5, 0xe7, 0x3b, 0x7e, 0x92, 0xf6, - 0xcc, 0x8d, 0xc6, 0xb4, 0xa6, 0x8f, 0x55, 0x60, 0x7f, 0x0f, 0x7a, 0xfb, 0x59, 0x10, 0xec, 0x92, - 0x24, 0x71, 0x87, 0x64, 0xeb, 0x51, 0x9f, 0x8c, 0x38, 0xdf, 0x21, 0x49, 0xc4, 0x27, 0x07, 0x89, - 0xe3, 0x6d, 0xe6, 0x11, 0x61, 0x7c, 0xd3, 0xc9, 0x49, 0xee, 0x57, 0x12, 0xc7, 0x7c, 0x85, 0x94, - 0x25, 0x1c, 0x52, 0xd6, 0x15, 0x98, 0x0b, 0xb8, 0x59, 0x0d, 0x61, 0xd6, 0xfa, 0x18, 0xb3, 0x76, - 0x93, 0xe1, 0x8e, 0x9b, 0xba, 0x8e, 0x68, 0x67, 0x87, 0xf0, 0xdc, 0xf8, 0xde, 0x47, 0x13, 0x03, - 0x98, 0x17, 0x59, 0xa2, 0x4a, 0xf1, 0x19, 0x2d, 0xe2, 0x57, 0x65, 0x71, 0xb3, 0x13, 0xd4, 0x23, - 0xec, 0xe8, 0x3a, 0x39, 0x69, 0x5f, 0x04, 0xeb, 0x26, 0x49, 0x77, 0xdd, 0x87, 0xd7, 0xa8, 0xb7, - 0xeb, 0xd3, 0x3e, 0x19, 0x39, 0x64, 0x64, 0x5f, 0x87, 0x0b, 0x35, 0x6e, 0x12, 0x89, 0x89, 0xee, - 0x3e, 0xec, 0x93, 0x91, 0x30, 0xa0, 0xeb, 0x48, 0x4a, 0xf0, 0x45, 0x2b, 0x59, 0xbf, 0x49, 0xca, - 0x1e, 0xc1, 0x32, 0x77, 0x55, 0x9f, 0x50, 0x6f, 0x37, 0x19, 0x0a, 0x15, 0x1b, 0xd0, 0x41, 0x04, - 0x76, 0x93, 0x61, 0x59, 0x10, 0x2a, 0x2c, 0xde, 0x62, 0x10, 0xf8, 0xdc, 0x25, 0xa2, 0x85, 0x1c, - 0x8d, 0xc2, 0xe2, 0xd3, 0x2e, 0x21, 0x72, 0x7f, 0xc4, 0xe7, 0x63, 0xc3, 0x29, 0x68, 0xfb, 0x83, - 0x26, 0xcc, 0x4b, 0x40, 0xc5, 0x54, 0xe3, 0x35, 0x78, 0x81, 0x17, 0x52, 0x98, 0x2d, 0x07, 0x27, - 0xe5, 0x56, 0x13, 0x29, 0x75, 0x73, 0xda, 0xd0, 0x37, 0xa7, 0x15, 0x9b, 0xe6, 0xea, 0x36, 0x55, - 0xc6, 0xd5, 0xac, 0x8f, 0x8b, 0x27, 0x07, 0xb1, 0x5e, 0xee, 0x07, 0x6e, 0x7a, 0xc8, 0xe2, 0x50, - 0x96, 0xd4, 0x4d, 0xa7, 0xc6, 0xe7, 0x09, 0x09, 0x79, 0x45, 0x45, 0x81, 0x0b, 0x43, 0x85, 0xcb, - 0xf3, 0x37, 0x72, 0xf2, 0xca, 0x02, 0xf7, 0x32, 0x3a, 0x13, 0x6d, 0x4b, 0x12, 0x9f, 0x51, 0x91, - 0xdb, 0xb0, 0x80, 0x50, 0x59, 0x7c, 0xe4, 0x61, 0x32, 0xbc, 0x11, 0xb3, 0x50, 0xee, 0x68, 0x72, - 0x52, 0x8c, 0x9c, 0xd1, 0x34, 0xcf, 0x8b, 0x1d, 0x94, 0x55, 0x58, 0x5c, 0x56, 0x92, 0xa2, 0x7a, - 0x58, 0x74, 0x72, 0xd2, 0x5a, 0x81, 0x46, 0x42, 0x46, 0xb2, 0x24, 0xe0, 0x3f, 0x35, 0xcf, 0x2d, - 0xeb, 0x9e, 0xab, 0xac, 0xf1, 0x2b, 0xe2, 0xab, 0xba, 0xc6, 0x97, 0x0b, 0xe7, 0xaa, 0xb6, 0x70, - 0x5e, 0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53, 0xe1, 0xd8, 0x7f, 0x36, 0x61, 0x45, 0xec, 0x6c, - 0xb6, 0x85, 0xdb, 0x3d, 0x21, 0xf4, 0x0a, 0x34, 0xc5, 0x34, 0x94, 0xd9, 0xe2, 0xf4, 0xdd, 0x10, - 0x36, 0xb5, 0xae, 0x42, 0x8b, 0x45, 0x22, 0xc5, 0x60, 0x22, 0x7b, 0x61, 0x92, 0x90, 0x7e, 0x3c, - 0xe5, 0x48, 0x29, 0xeb, 0x06, 0x40, 0x58, 0x66, 0x14, 0x5c, 0xba, 0xa7, 0xd5, 0xa1, 0x48, 0x72, - 0x70, 0x8b, 0x65, 0xb8, 0x38, 0xa3, 0x6a, 0x38, 0x3a, 0xd3, 0xda, 0x83, 0x25, 0x61, 0xf6, 0xdd, - 0x7c, 0x5b, 0x2c, 0x7c, 0x30, 0x7d, 0x8f, 0x15, 0x69, 0xfb, 0x97, 0x86, 0x84, 0x91, 0x7f, 0xed, - 0x13, 0xc4, 0xbe, 0x84, 0xc4, 0x98, 0x09, 0x92, 0x75, 0x58, 0x08, 0x33, 0x65, 0x97, 0xde, 0x70, - 0x0a, 0xba, 0x74, 0x51, 0x63, 0x6a, 0x17, 0xd9, 0xbf, 0x32, 0xa0, 0xf7, 0x06, 0xf3, 0xa9, 0xf8, - 0x70, 0x2d, 0x8a, 0x02, 0x79, 0x90, 0x3a, 0xb3, 0xcf, 0xbf, 0x06, 0x6d, 0x17, 0xd5, 0xd0, 0x54, - 0xba, 0x7d, 0x8a, 0x9d, 0x77, 0x29, 0xa3, 0x6c, 0xa2, 0x1a, 0xea, 0x26, 0xca, 0x7e, 0xcf, 0x80, +func init() { proto.RegisterFile("sdk_ws/ws.proto", fileDescriptor_ws_8b0ea2633e539530) } + +var fileDescriptor_ws_8b0ea2633e539530 = []byte{ + // 3049 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5b, 0xcb, 0x6f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, 0x37, 0x46, 0x6d, 0x18, 0xe4, 0x05, 0xcd, 0xf3, 0x00, 0x8b, 0x3d, 0x99, 0x39, 0x9a, 0x0e, + 0x12, 0x7c, 0xf2, 0x97, 0xfd, 0x89, 0x82, 0xa6, 0x85, 0xeb, 0xba, 0xce, 0x3d, 0xb3, 0x06, 0x7b, + 0x09, 0x56, 0x92, 0xec, 0xa0, 0x1c, 0xdc, 0x5e, 0x16, 0xca, 0x70, 0xaf, 0xf1, 0x39, 0xa8, 0x58, + 0x9c, 0xf1, 0x46, 0x98, 0x6a, 0x4a, 0x46, 0xb5, 0x2a, 0xb0, 0xdf, 0x35, 0x61, 0xe5, 0x6e, 0x3c, + 0x74, 0xa9, 0xff, 0x6d, 0x51, 0x6e, 0x8a, 0x05, 0x7c, 0x96, 0x94, 0xbb, 0x01, 0x1d, 0x42, 0x87, + 0x81, 0x9f, 0x1c, 0xed, 0x95, 0xb8, 0xa9, 0x2c, 0x15, 0xec, 0xb9, 0x49, 0x49, 0xb9, 0xa9, 0x25, + 0xe5, 0x35, 0x68, 0x85, 0xec, 0xc0, 0x0f, 0xf2, 0xb8, 0x97, 0x94, 0x88, 0x79, 0x12, 0x10, 0x91, + 0x9d, 0x8b, 0x98, 0xcf, 0x19, 0x65, 0xa2, 0x5e, 0x18, 0x9b, 0xa8, 0xdb, 0x6a, 0xa2, 0xd6, 0x81, + 0x87, 0x1a, 0xf0, 0x08, 0x57, 0xa7, 0x80, 0xeb, 0x8f, 0x06, 0xac, 0x94, 0x70, 0x63, 0x0d, 0x3a, + 0x11, 0xae, 0x6a, 0x04, 0x9a, 0x63, 0x22, 0xb0, 0x88, 0x9b, 0x86, 0x1a, 0x37, 0x3c, 0xd2, 0x58, + 0xe2, 0x2b, 0xf5, 0x7e, 0x41, 0xf3, 0xde, 0x02, 0xe2, 0x2a, 0x60, 0x21, 0xa5, 0x54, 0xdd, 0x2d, + 0xad, 0xea, 0xae, 0xe6, 0xd1, 0xdf, 0x19, 0x70, 0x91, 0x7b, 0xb9, 0x36, 0x8c, 0xbb, 0xb0, 0xc2, + 0x2a, 0x91, 0x20, 0x13, 0xcd, 0x27, 0xc6, 0x24, 0x8a, 0x6a, 0xd0, 0x38, 0x35, 0x61, 0xae, 0xd0, + 0xab, 0x74, 0x22, 0x33, 0xcf, 0x38, 0x85, 0x55, 0x7b, 0x9c, 0x9a, 0xb0, 0xfd, 0x7b, 0x03, 0x56, + 0x30, 0xb5, 0x29, 0xf3, 0xfc, 0xdc, 0xcd, 0x7e, 0x0b, 0x2e, 0x56, 0x7b, 0xbe, 0xe3, 0x27, 0x69, + 0xcf, 0xdc, 0x68, 0x4c, 0x6b, 0xfa, 0x58, 0x05, 0xf6, 0x77, 0xa0, 0xb7, 0x9f, 0x05, 0xc1, 0x2e, + 0x49, 0x12, 0x77, 0x48, 0xb6, 0x1e, 0xf5, 0xc9, 0x88, 0xf3, 0x1d, 0x92, 0x44, 0x7c, 0x72, 0x90, + 0x38, 0xde, 0x66, 0x1e, 0x11, 0xc6, 0x37, 0x9d, 0x9c, 0xe4, 0x7e, 0x25, 0x71, 0xcc, 0x57, 0x48, + 0x59, 0xc2, 0x21, 0x65, 0x5d, 0x81, 0xb9, 0x80, 0x9b, 0xd5, 0x10, 0x66, 0xad, 0x8f, 0x31, 0x6b, + 0x37, 0x19, 0xee, 0xb8, 0xa9, 0xeb, 0x88, 0x76, 0x76, 0x08, 0xcf, 0x8d, 0xef, 0x7d, 0x34, 0x31, + 0x80, 0x79, 0x91, 0x25, 0xaa, 0x14, 0x9f, 0xd1, 0x22, 0x7e, 0x55, 0x16, 0x37, 0x3b, 0x41, 0x3d, + 0xc2, 0x8e, 0xae, 0x93, 0x93, 0xf6, 0x45, 0xb0, 0x6e, 0x92, 0x74, 0xd7, 0x7d, 0x78, 0x8d, 0x7a, + 0xbb, 0x3e, 0xed, 0x93, 0x91, 0x43, 0x46, 0xf6, 0x75, 0xb8, 0x50, 0xe3, 0x26, 0x91, 0x98, 0xe8, + 0xee, 0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x67, 0xda, 0x1e, 0x2c, + 0xdc, 0xf3, 0xa3, 0x64, 0x9b, 0x85, 0x21, 0x77, 0x96, 0x47, 0x52, 0x9e, 0xc7, 0x0d, 0x11, 0x13, + 0x92, 0xe2, 0xe1, 0xe4, 0x91, 0x43, 0x37, 0x0b, 0x52, 0xde, 0x34, 0x9f, 0xdc, 0x0a, 0x4b, 0x9c, + 0xab, 0x24, 0x8c, 0xee, 0xa0, 0x34, 0xda, 0xa9, 0x70, 0xec, 0x3f, 0x99, 0xb0, 0x22, 0x76, 0x3f, + 0xdb, 0x22, 0x34, 0x3c, 0x21, 0xf4, 0x0a, 0x34, 0xc5, 0x54, 0x95, 0x19, 0xe5, 0xf4, 0x1d, 0x13, + 0x36, 0xb5, 0xae, 0x42, 0x8b, 0x45, 0x22, 0x0d, 0x61, 0xb2, 0x7b, 0x61, 0x92, 0x90, 0x7e, 0x84, + 0xe5, 0x48, 0x29, 0xeb, 0x06, 0x40, 0x58, 0x66, 0x1d, 0x5c, 0xde, 0xa7, 0xd5, 0xa1, 0x48, 0x72, + 0x70, 0x8b, 0xa5, 0xba, 0x38, 0xc7, 0x6a, 0x38, 0x3a, 0xd3, 0xda, 0x83, 0x25, 0x61, 0xf6, 0xdd, + 0x7c, 0xeb, 0x2c, 0x7c, 0x30, 0x7d, 0x8f, 0x15, 0x69, 0xfb, 0xe7, 0x86, 0x84, 0x91, 0x7f, 0xed, + 0x13, 0xc4, 0xbe, 0x84, 0xc4, 0x98, 0x09, 0x92, 0x75, 0x58, 0x08, 0x33, 0x65, 0x27, 0xdf, 0x70, + 0x0a, 0xba, 0x74, 0x51, 0x63, 0x6a, 0x17, 0xd9, 0xbf, 0x30, 0xa0, 0xf7, 0x06, 0xf3, 0xa9, 0xf8, + 0x70, 0x2d, 0x8a, 0x02, 0x79, 0xd8, 0x3a, 0xb3, 0xcf, 0xbf, 0x02, 0x6d, 0x17, 0xd5, 0xd0, 0x54, + 0xba, 0x7d, 0x8a, 0xdd, 0x79, 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x16, 0x2c, 0xa9, 0x06, 0xcc, 0xf2, 0xdc, 0x6d, 0xeb, 0xd2, 0x37, 0xd6, 0xaf, 0xbc, 0x8c, 0x7f, + 0xcc, 0x7a, 0xbd, 0x06, 0xe2, 0x41, 0x4b, 0xfc, 0x51, 0xeb, 0xd5, 0xff, 0x06, 0x00, 0x00, 0xff, + 0xff, 0xf8, 0x91, 0x1b, 0x32, 0xbb, 0x35, 0x00, 0x00, } diff --git a/pkg/proto/sdk_ws/ws.proto b/pkg/proto/sdk_ws/ws.proto index 713c4574f..c2a89652f 100644 --- a/pkg/proto/sdk_ws/ws.proto +++ b/pkg/proto/sdk_ws/ws.proto @@ -213,8 +213,9 @@ message MsgData { int32 status = 17; map options = 18; OfflinePushInfo offlinePushInfo = 19; + repeated string atUserIDList = 20; + } -// repeated string atUserIDList = 20; message OfflinePushInfo{ string title = 1; string desc = 2; From e73f0a916a13722ed5063bfc422e4d42a85a4a63 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Sun, 24 Apr 2022 16:55:47 +0800 Subject: [PATCH 08/51] add modify conversation api --- cmd/open_im_api/main.go | 1 + internal/api/conversation/conversation.go | 32 +++++++++++++++++++++++ pkg/base_info/conversation_api_struct.go | 9 +++++++ 3 files changed, 42 insertions(+) diff --git a/cmd/open_im_api/main.go b/cmd/open_im_api/main.go index cf1783117..b27892d9b 100644 --- a/cmd/open_im_api/main.go +++ b/cmd/open_im_api/main.go @@ -129,6 +129,7 @@ func main() { conversationGroup.POST("/set_conversation", conversation.SetConversation) conversationGroup.POST("/batch_set_conversation", conversation.BatchSetConversations) conversationGroup.POST("/set_recv_msg_opt", conversation.SetRecvMsgOpt) + conversationGroup.POST("/modify_conversation_field", conversation.ModifyConversationField) } // office officeGroup := r.Group("/office") diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go index 3d580864f..dcaa2b62e 100644 --- a/internal/api/conversation/conversation.go +++ b/internal/api/conversation/conversation.go @@ -5,6 +5,7 @@ import ( "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbConversation "Open_IM/pkg/proto/conversation" pbUser "Open_IM/pkg/proto/user" "Open_IM/pkg/utils" "context" @@ -44,6 +45,37 @@ func SetConversation(c *gin.Context) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) c.JSON(http.StatusOK, resp) } +func ModifyConversationField(c *gin.Context) { + var ( + req api.ModifyConversationFieldReq + resp api.ModifyConversationFieldResp + reqPb pbConversation.ModifyConversationFieldReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + reqPb.Conversation = &pbConversation.Conversation{} + err := utils.CopyStructFields(&reqPb, req) + err = utils.CopyStructFields(reqPb.Conversation, req.Conversation) + if err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", reqPb.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName) + client := pbConversation.NewConversationClient(etcdConn) + respPb, err := client.ModifyConversationField(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "GetAllConversationMsgOpt rpc failed, " + err.Error()}) + return + } + resp.ErrMsg = respPb.CommonResp.ErrMsg + resp.ErrCode = respPb.CommonResp.ErrCode + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} func BatchSetConversations(c *gin.Context) { var ( diff --git a/pkg/base_info/conversation_api_struct.go b/pkg/base_info/conversation_api_struct.go index 5e9d021f6..30890f7eb 100644 --- a/pkg/base_info/conversation_api_struct.go +++ b/pkg/base_info/conversation_api_struct.go @@ -58,6 +58,15 @@ type SetConversationReq struct { type SetConversationResp struct { CommResp } +type ModifyConversationFieldReq struct { + Conversation + FieldType int32 `json:"fieldType" binding:"required"` + UserIDList []string `json:"userIDList" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} +type ModifyConversationFieldResp struct { + CommResp +} type BatchSetConversationsReq struct { Conversations []Conversation `json:"conversations" binding:"required"` From 3247d84b6b3761ac57eeb6e13b9f54f61df5bef2 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Sun, 24 Apr 2022 17:27:26 +0800 Subject: [PATCH 09/51] add modify conversation api --- internal/rpc/conversation/conversaion.go | 16 ++++++++-------- internal/rpc/msg/send_msg.go | 2 +- pkg/common/constant/constant.go | 14 +++++++------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/internal/rpc/conversation/conversaion.go b/internal/rpc/conversation/conversaion.go index 409c1e488..aec03fd26 100644 --- a/internal/rpc/conversation/conversaion.go +++ b/internal/rpc/conversation/conversaion.go @@ -49,7 +49,7 @@ func (rpc *rpcConversation) ModifyConversationField(c context.Context, req *pbCo } haveUserID, _ := imdb.GetExistConversationUserIDList(req.Conversation.ConversationID) switch req.FieldType { - case constant.RecvMsgOpt: + case constant.FieldRecvMsgOpt: for _, v := range req.UserIDList { if err = db.DB.SetSingleConversationRecvMsgOpt(v, req.Conversation.ConversationID, req.Conversation.RecvMsgOpt); err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), "cache failed, rpc return", err.Error()) @@ -58,17 +58,17 @@ func (rpc *rpcConversation) ModifyConversationField(c context.Context, req *pbCo } } err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"recv_msg_opt": conversation.RecvMsgOpt}) - case constant.GroupAtType: + case constant.FieldGroupAtType: err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"group_at_type": conversation.GroupAtType}) - case constant.IsNotInGroup: + case constant.FieldIsNotInGroup: err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"is_not_in_group": conversation.IsNotInGroup}) - case constant.IsPinned: + case constant.FieldIsPinned: err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"is_pinned": conversation.IsPinned}) - case constant.IsPrivateChat: + case constant.FieldIsPrivateChat: err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"is_private_chat": conversation.IsPrivateChat}) - case constant.Ex: + case constant.FieldEx: err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"ex": conversation.Ex}) - case constant.AttachedInfo: + case constant.FieldAttachedInfo: err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"attached_info": conversation.AttachedInfo}) } if err != nil { @@ -86,7 +86,7 @@ func (rpc *rpcConversation) ModifyConversationField(c context.Context, req *pbCo } } // notification - if req.Conversation.ConversationType == constant.SingleChatType && req.FieldType == constant.IsPrivateChat { + if req.Conversation.ConversationType == constant.SingleChatType && req.FieldType == constant.FieldIsPrivateChat { //sync peer user conversation if conversation is singleChatType if err := syncPeerUserConversation(req.Conversation, req.OperationID); err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), "syncPeerUserConversation", err.Error()) diff --git a/internal/rpc/msg/send_msg.go b/internal/rpc/msg/send_msg.go index 16fba65dc..21dae7207 100644 --- a/internal/rpc/msg/send_msg.go +++ b/internal/rpc/msg/send_msg.go @@ -265,7 +265,7 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S } conversationReq.Conversation = &conversation conversationReq.OperationID = pb.OperationID - conversationReq.FieldType = constant.GroupAtType + conversationReq.FieldType = constant.FieldGroupAtType tagAll := utils.IsContain(constant.AtAllString, pb.MsgData.AtUserIDList) if tagAll { atUserID = utils.DifferenceString([]string{constant.AtAllString}, pb.MsgData.AtUserIDList) diff --git a/pkg/common/constant/constant.go b/pkg/common/constant/constant.go index 9a66fd919..2e624dd5e 100644 --- a/pkg/common/constant/constant.go +++ b/pkg/common/constant/constant.go @@ -215,13 +215,13 @@ var ContentType2PushContent = map[int64]string{ } const ( - RecvMsgOpt = 1 - IsPinned = 2 - AttachedInfo = 3 - IsPrivateChat = 4 - GroupAtType = 5 - IsNotInGroup = 6 - Ex = 7 + FieldRecvMsgOpt = 1 + FieldIsPinned = 2 + FieldAttachedInfo = 3 + FieldIsPrivateChat = 4 + FieldGroupAtType = 5 + FieldIsNotInGroup = 6 + FieldEx = 7 ) const ( From 545f9cad2d92adb1ba26412442d5b92c093b3d99 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Sun, 24 Apr 2022 17:30:53 +0800 Subject: [PATCH 10/51] add modify conversation api --- internal/rpc/msg/send_msg.go | 79 ++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/internal/rpc/msg/send_msg.go b/internal/rpc/msg/send_msg.go index 21dae7207..f87278dc5 100644 --- a/internal/rpc/msg/send_msg.go +++ b/internal/rpc/msg/send_msg.go @@ -254,44 +254,34 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S case constant.MemberQuitNotification: addUidList = append(addUidList, pb.MsgData.SendID) case constant.AtText: - var conversationReq pbConversation.ModifyConversationFieldReq - var tag bool - var atUserID []string - conversation := pbConversation.Conversation{ - OwnerUserID: pb.MsgData.SendID, - ConversationID: utils.GetConversationIDBySessionType(pb.MsgData.GroupID, constant.GroupChatType), - ConversationType: constant.GroupChatType, - GroupID: pb.MsgData.GroupID, - } - conversationReq.Conversation = &conversation - conversationReq.OperationID = pb.OperationID - conversationReq.FieldType = constant.FieldGroupAtType - tagAll := utils.IsContain(constant.AtAllString, pb.MsgData.AtUserIDList) - if tagAll { - atUserID = utils.DifferenceString([]string{constant.AtAllString}, pb.MsgData.AtUserIDList) - if len(atUserID) == 0 { //just @everyone - conversationReq.UserIDList = memberUserIDList - conversation.GroupAtType = constant.AtAll - } else { //@Everyone and @other people - conversationReq.UserIDList = atUserID - conversation.GroupAtType = constant.AtAllAtMe - tag = true + go func() { + var conversationReq pbConversation.ModifyConversationFieldReq + var tag bool + var atUserID []string + conversation := pbConversation.Conversation{ + OwnerUserID: pb.MsgData.SendID, + ConversationID: utils.GetConversationIDBySessionType(pb.MsgData.GroupID, constant.GroupChatType), + ConversationType: constant.GroupChatType, + GroupID: pb.MsgData.GroupID, + } + conversationReq.Conversation = &conversation + conversationReq.OperationID = pb.OperationID + conversationReq.FieldType = constant.FieldGroupAtType + tagAll := utils.IsContain(constant.AtAllString, pb.MsgData.AtUserIDList) + if tagAll { + atUserID = utils.DifferenceString([]string{constant.AtAllString}, pb.MsgData.AtUserIDList) + if len(atUserID) == 0 { //just @everyone + conversationReq.UserIDList = memberUserIDList + conversation.GroupAtType = constant.AtAll + } else { //@Everyone and @other people + conversationReq.UserIDList = atUserID + conversation.GroupAtType = constant.AtAllAtMe + tag = true + } + } else { + conversationReq.UserIDList = pb.MsgData.AtUserIDList + conversation.GroupAtType = constant.AtMe } - } else { - conversationReq.UserIDList = pb.MsgData.AtUserIDList - conversation.GroupAtType = constant.AtMe - } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName) - client := pbConversation.NewConversationClient(etcdConn) - conversationReply, err := client.ModifyConversationField(context.Background(), &conversationReq) - if err != nil { - log.NewError(conversationReq.OperationID, "ModifyConversationField rpc failed, ", conversationReq.String(), err.Error()) - } else if conversationReply.CommonResp.ErrCode != 0 { - log.NewError(conversationReq.OperationID, "ModifyConversationField rpc failed, ", conversationReq.String(), conversationReply.String()) - } - if tag { - conversationReq.UserIDList = utils.DifferenceString(atUserID, memberUserIDList) - conversation.GroupAtType = constant.AtAll etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName) client := pbConversation.NewConversationClient(etcdConn) conversationReply, err := client.ModifyConversationField(context.Background(), &conversationReq) @@ -300,8 +290,19 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S } else if conversationReply.CommonResp.ErrCode != 0 { log.NewError(conversationReq.OperationID, "ModifyConversationField rpc failed, ", conversationReq.String(), conversationReply.String()) } - } - + if tag { + conversationReq.UserIDList = utils.DifferenceString(atUserID, memberUserIDList) + conversation.GroupAtType = constant.AtAll + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName) + client := pbConversation.NewConversationClient(etcdConn) + conversationReply, err := client.ModifyConversationField(context.Background(), &conversationReq) + if err != nil { + log.NewError(conversationReq.OperationID, "ModifyConversationField rpc failed, ", conversationReq.String(), err.Error()) + } else if conversationReply.CommonResp.ErrCode != 0 { + log.NewError(conversationReq.OperationID, "ModifyConversationField rpc failed, ", conversationReq.String(), conversationReply.String()) + } + } + }() default: } groupID := pb.MsgData.GroupID From d1ebcde7254f75f9d6c241e13aea02ab8b994cac Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Sun, 24 Apr 2022 17:42:41 +0800 Subject: [PATCH 11/51] work_moments --- cmd/open_im_cms_api/main.go | 2 +- internal/rpc/office/office.go | 37 +- pkg/base_info/work_moments_struct.go | 9 +- pkg/common/db/mongoModel.go | 38 +- pkg/proto/office/office.pb.go | 3063 -------------------------- pkg/proto/office/office.proto | 21 +- 6 files changed, 68 insertions(+), 3102 deletions(-) delete mode 100644 pkg/proto/office/office.pb.go diff --git a/cmd/open_im_cms_api/main.go b/cmd/open_im_cms_api/main.go index 024439075..20e6380db 100644 --- a/cmd/open_im_cms_api/main.go +++ b/cmd/open_im_cms_api/main.go @@ -14,7 +14,7 @@ func main() { gin.SetMode(gin.ReleaseMode) router := cms_api.NewGinRouter() router.Use(utils.CorsHandler()) - ginPort := flag.Int("port", 8000, "get ginServerPort from cmd,default 10000 as port") + ginPort := flag.Int("port", 8000, "get ginServerPort from cmd,default 8000 as port") fmt.Println("start cms api server, port: ", ginPort) router.Run(":" + strconv.Itoa(*ginPort)) } diff --git a/internal/rpc/office/office.go b/internal/rpc/office/office.go index ea4095f04..e0b54dddf 100644 --- a/internal/rpc/office/office.go +++ b/internal/rpc/office/office.go @@ -303,6 +303,7 @@ func (s *officeServer) CreateOneWorkMoment(_ context.Context, req *pbOffice.Crea UserID: workMoment.UserID, FaceURL: createUser.FaceURL, UserName: createUser.Nickname, + CreateTime: workMoment.CreateTime, } msg.WorkMomentSendNotification(req.OperationID, workMoment.UserID, atUser.UserID, workMomentNotificationMsg) } @@ -375,13 +376,13 @@ func isUserCanSeeWorkMoment(userID string, workMoment db.WorkMoment) bool { func (s *officeServer) LikeOneWorkMoment(_ context.Context, req *pbOffice.LikeOneWorkMomentReq) (resp *pbOffice.LikeOneWorkMomentResp, err error) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) resp = &pbOffice.LikeOneWorkMomentResp{CommonResp: &pbOffice.CommonResp{}} - userName, err := imdb.GetUserNameByUserID(req.UserID) + user, err := imdb.GetUserByUserID(req.UserID) if err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserNameByUserID failed", err.Error()) resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} return resp, nil } - workMoment, like, err := db.DB.LikeOneWorkMoment(req.UserID, userName, req.WorkMomentID) + workMoment, like, err := db.DB.LikeOneWorkMoment(req.UserID, user.Nickname, req.WorkMomentID) if err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), "LikeOneWorkMoment failed ", err.Error()) resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} @@ -391,9 +392,10 @@ func (s *officeServer) LikeOneWorkMoment(_ context.Context, req *pbOffice.LikeOn NotificationMsgType: constant.WorkMomentLikeNotification, WorkMomentID: workMoment.WorkMomentID, WorkMomentContent: workMoment.Content, - UserID: workMoment.UserID, - FaceURL: workMoment.FaceURL, - UserName: workMoment.UserName, + UserID: user.UserID, + FaceURL: user.FaceURL, + UserName: user.Nickname, + CreateTime: int32(time.Now().Unix()), } // send notification if like { @@ -442,16 +444,11 @@ func (s *officeServer) CommentOneWorkMoment(_ context.Context, req *pbOffice.Com UserID: workMoment.UserID, FaceURL: workMoment.FaceURL, UserName: workMoment.UserName, - Comment: &pbOffice.Comment{ - UserID: comment.UserID, - UserName: comment.UserName, - FaceURL: commentUser.FaceURL, - ReplyUserID: comment.ReplyUserID, - ReplyUserName: comment.ReplyUserName, - ContentID: comment.ContentID, - Content: comment.Content, - CreateTime: comment.CreateTime, - }, + ReplyUserID: comment.ReplyUserID, + ReplyUserName: comment.ReplyUserName, + ContentID: comment.ContentID, + Content: comment.Content, + CreateTime: comment.CreateTime, } msg.WorkMomentSendNotification(req.OperationID, req.UserID, workMoment.UserID, workMomentNotificationMsg) if req.ReplyUserID != "" { @@ -488,10 +485,14 @@ func (s *officeServer) GetWorkMomentByID(_ context.Context, req *pbOffice.GetWor func (s *officeServer) GetUserWorkMoments(_ context.Context, req *pbOffice.GetUserWorkMomentsReq) (resp *pbOffice.GetUserWorkMomentsResp, err error) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) resp = &pbOffice.GetUserWorkMomentsResp{CommonResp: &pbOffice.CommonResp{}, WorkMoments: []*pbOffice.WorkMoment{}} - //resp.WorkMoments = make([]*pbOffice.WorkMoment, 0) - workMoments, err := db.DB.GetUserWorkMoments(req.UserID, req.Pagination.ShowNumber, req.Pagination.PageNumber) + var workMoments []db.WorkMoment + if req.UserID == req.OpUserID { + workMoments, err = db.DB.GetUserSelfWorkMoments(req.UserID, req.Pagination.ShowNumber, req.Pagination.PageNumber) + } else { + workMoments, err = db.DB.GetUserWorkMoments(req.OpUserID, req.UserID, req.Pagination.ShowNumber, req.Pagination.PageNumber) + } if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), err) + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserWorkMoments failed", err.Error()) resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} return resp, nil } diff --git a/pkg/base_info/work_moments_struct.go b/pkg/base_info/work_moments_struct.go index ecc80f834..9ed09a832 100644 --- a/pkg/base_info/work_moments_struct.go +++ b/pkg/base_info/work_moments_struct.go @@ -50,13 +50,10 @@ type WorkMoment struct { Content string `json:"content"` LikeUserList []*WorkMomentUser `json:"likeUsers"` Comments []*Comment `json:"comments"` - FaceURL string `json:"faceUrl"` + FaceURL string `json:"faceURL"` UserName string `json:"userName"` - //Permission int32 `json:"permission"` - //PermissionUserIDList []string `json:"permissionUserIDList"` - //PermissionGroupIDList []string `json:"permissionGroupIDList"` - AtUserList []*WorkMomentUser `json:"atUsers"` - CreateTime int32 `json:"createTime"` + AtUserList []*WorkMomentUser `json:"atUsers"` + CreateTime int32 `json:"createTime"` } type WorkMomentUser struct { diff --git a/pkg/common/db/mongoModel.go b/pkg/common/db/mongoModel.go index f44799ecf..14adb3057 100644 --- a/pkg/common/db/mongoModel.go +++ b/pkg/common/db/mongoModel.go @@ -11,12 +11,14 @@ import ( "errors" "fmt" "github.com/gogo/protobuf/sortkeys" + "go.etcd.io/etcd/clientv3" + "go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/mongo/options" "math/rand" //"github.com/garyburd/redigo/redis" "github.com/golang/protobuf/proto" - "gopkg.in/mgo.v2/bson" + "go.mongodb.org/mongo-driver/bson" "strconv" "time" @@ -659,7 +661,7 @@ func (d *DataBases) CommentOneWorkMoment(comment *Comment, workMomentID string) return workMoment, err } -func (d *DataBases) GetUserWorkMoments(userID string, showNumber, pageNumber int32) ([]WorkMoment, error) { +func (d *DataBases) GetUserSelfWorkMoments(userID string, showNumber, pageNumber int32) ([]WorkMoment, error) { ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cWorkMoment) var workMomentList []WorkMoment @@ -672,15 +674,39 @@ func (d *DataBases) GetUserWorkMoments(userID string, showNumber, pageNumber int return workMomentList, err } +func (d *DataBases) GetUserWorkMoments(opUserID, userID string, showNumber, pageNumber int32) ([]WorkMoment, error) { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cWorkMoment) + var workMomentList []WorkMoment + findOpts := options.Find().SetLimit(int64(showNumber)).SetSkip(int64(showNumber) * (int64(pageNumber) - 1)).SetSort(bson.M{"create_time": -1}) + result, err := c.Find(ctx, bson.D{ // 等价条件: select * from + {"user_id", userID}, + {"$or", bson.A{ + bson.D{{"permission", constant.WorkMomentPermissionCantSee}, {opUserID, bson.D{{"$in", "permission_user_id_list"}}}}, + bson.D{{"permission", constant.WorkMomentPermissionCanSee}, {opUserID, bson.D{{"$in", "permission_user_id_list"}}}}, + bson.D{{"permission", constant.WorkMomentPublic}}, + }}, + }, findOpts) + if err != nil { + return workMomentList, nil + } + err = result.All(ctx, &workMomentList) + return workMomentList, err +} + func (d *DataBases) GetUserFriendWorkMoments(friendIDList []*string, showNumber, pageNumber int32, userID string) ([]WorkMoment, error) { ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cWorkMoment) var workMomentList []WorkMoment findOpts := options.Find().SetLimit(int64(showNumber)).SetSkip(int64(showNumber) * (int64(pageNumber) - 1)).SetSort(bson.M{"create_time": -1}) - result, err := c.Find(ctx, - bson.M{"user_id": friendIDList, "$or": bson.M{"who_can_see_user_id_list": bson.M{"$elemMatch": bson.M{"$eq": userID}}, - "who_cant_see_user_id_list": bson.M{"$nin": userID}}, - }, findOpts) + result, err := c.Find(ctx, bson.D{ // 等价条件: select * from t where user_id in friend_id_list and () or () or (); + {"user_id", bson.D{{"$in", friendIDList}}}, + {"$or", bson.A{ + bson.D{{"permission", constant.WorkMomentPermissionCantSee}, {userID, bson.D{{"$in", "permission_user_id_list"}}}}, + bson.D{{"permission", constant.WorkMomentPermissionCanSee}, {userID, bson.D{{"$in", "permission_user_id_list"}}}}, + bson.D{{"permission", constant.WorkMomentPublic}}, + }}, + }, findOpts) if err != nil { return workMomentList, err } diff --git a/pkg/proto/office/office.pb.go b/pkg/proto/office/office.pb.go deleted file mode 100644 index f0a67fd91..000000000 --- a/pkg/proto/office/office.pb.go +++ /dev/null @@ -1,3063 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: office/office.proto - -package office // import "./office" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import sdk_ws "Open_IM/pkg/proto/sdk_ws" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type CommonResp struct { - ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CommonResp) Reset() { *m = CommonResp{} } -func (m *CommonResp) String() string { return proto.CompactTextString(m) } -func (*CommonResp) ProtoMessage() {} -func (*CommonResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{0} -} -func (m *CommonResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CommonResp.Unmarshal(m, b) -} -func (m *CommonResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CommonResp.Marshal(b, m, deterministic) -} -func (dst *CommonResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommonResp.Merge(dst, src) -} -func (m *CommonResp) XXX_Size() int { - return xxx_messageInfo_CommonResp.Size(m) -} -func (m *CommonResp) XXX_DiscardUnknown() { - xxx_messageInfo_CommonResp.DiscardUnknown(m) -} - -var xxx_messageInfo_CommonResp proto.InternalMessageInfo - -func (m *CommonResp) GetErrCode() int32 { - if m != nil { - return m.ErrCode - } - return 0 -} - -func (m *CommonResp) GetErrMsg() string { - if m != nil { - return m.ErrMsg - } - return "" -} - -type TagUser struct { - UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` - UserName string `protobuf:"bytes,2,opt,name=userName" json:"userName,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TagUser) Reset() { *m = TagUser{} } -func (m *TagUser) String() string { return proto.CompactTextString(m) } -func (*TagUser) ProtoMessage() {} -func (*TagUser) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{1} -} -func (m *TagUser) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TagUser.Unmarshal(m, b) -} -func (m *TagUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TagUser.Marshal(b, m, deterministic) -} -func (dst *TagUser) XXX_Merge(src proto.Message) { - xxx_messageInfo_TagUser.Merge(dst, src) -} -func (m *TagUser) XXX_Size() int { - return xxx_messageInfo_TagUser.Size(m) -} -func (m *TagUser) XXX_DiscardUnknown() { - xxx_messageInfo_TagUser.DiscardUnknown(m) -} - -var xxx_messageInfo_TagUser proto.InternalMessageInfo - -func (m *TagUser) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *TagUser) GetUserName() string { - if m != nil { - return m.UserName - } - return "" -} - -type Tag struct { - TagID string `protobuf:"bytes,1,opt,name=tagID" json:"tagID,omitempty"` - TagName string `protobuf:"bytes,2,opt,name=tagName" json:"tagName,omitempty"` - UserList []*TagUser `protobuf:"bytes,3,rep,name=userList" json:"userList,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Tag) Reset() { *m = Tag{} } -func (m *Tag) String() string { return proto.CompactTextString(m) } -func (*Tag) ProtoMessage() {} -func (*Tag) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{2} -} -func (m *Tag) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Tag.Unmarshal(m, b) -} -func (m *Tag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Tag.Marshal(b, m, deterministic) -} -func (dst *Tag) XXX_Merge(src proto.Message) { - xxx_messageInfo_Tag.Merge(dst, src) -} -func (m *Tag) XXX_Size() int { - return xxx_messageInfo_Tag.Size(m) -} -func (m *Tag) XXX_DiscardUnknown() { - xxx_messageInfo_Tag.DiscardUnknown(m) -} - -var xxx_messageInfo_Tag proto.InternalMessageInfo - -func (m *Tag) GetTagID() string { - if m != nil { - return m.TagID - } - return "" -} - -func (m *Tag) GetTagName() string { - if m != nil { - return m.TagName - } - return "" -} - -func (m *Tag) GetUserList() []*TagUser { - if m != nil { - return m.UserList - } - return nil -} - -type GetUserTagsReq struct { - UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetUserTagsReq) Reset() { *m = GetUserTagsReq{} } -func (m *GetUserTagsReq) String() string { return proto.CompactTextString(m) } -func (*GetUserTagsReq) ProtoMessage() {} -func (*GetUserTagsReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{3} -} -func (m *GetUserTagsReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetUserTagsReq.Unmarshal(m, b) -} -func (m *GetUserTagsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetUserTagsReq.Marshal(b, m, deterministic) -} -func (dst *GetUserTagsReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetUserTagsReq.Merge(dst, src) -} -func (m *GetUserTagsReq) XXX_Size() int { - return xxx_messageInfo_GetUserTagsReq.Size(m) -} -func (m *GetUserTagsReq) XXX_DiscardUnknown() { - xxx_messageInfo_GetUserTagsReq.DiscardUnknown(m) -} - -var xxx_messageInfo_GetUserTagsReq proto.InternalMessageInfo - -func (m *GetUserTagsReq) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *GetUserTagsReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type GetUserTagsResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - Tags []*Tag `protobuf:"bytes,2,rep,name=tags" json:"tags,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetUserTagsResp) Reset() { *m = GetUserTagsResp{} } -func (m *GetUserTagsResp) String() string { return proto.CompactTextString(m) } -func (*GetUserTagsResp) ProtoMessage() {} -func (*GetUserTagsResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{4} -} -func (m *GetUserTagsResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetUserTagsResp.Unmarshal(m, b) -} -func (m *GetUserTagsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetUserTagsResp.Marshal(b, m, deterministic) -} -func (dst *GetUserTagsResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetUserTagsResp.Merge(dst, src) -} -func (m *GetUserTagsResp) XXX_Size() int { - return xxx_messageInfo_GetUserTagsResp.Size(m) -} -func (m *GetUserTagsResp) XXX_DiscardUnknown() { - xxx_messageInfo_GetUserTagsResp.DiscardUnknown(m) -} - -var xxx_messageInfo_GetUserTagsResp proto.InternalMessageInfo - -func (m *GetUserTagsResp) GetCommonResp() *CommonResp { - if m != nil { - return m.CommonResp - } - return nil -} - -func (m *GetUserTagsResp) GetTags() []*Tag { - if m != nil { - return m.Tags - } - return nil -} - -type CreateTagReq struct { - TagName string `protobuf:"bytes,1,opt,name=tagName" json:"tagName,omitempty"` - UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` - UserIDList []string `protobuf:"bytes,3,rep,name=userIDList" json:"userIDList,omitempty"` - OperationID string `protobuf:"bytes,4,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateTagReq) Reset() { *m = CreateTagReq{} } -func (m *CreateTagReq) String() string { return proto.CompactTextString(m) } -func (*CreateTagReq) ProtoMessage() {} -func (*CreateTagReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{5} -} -func (m *CreateTagReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateTagReq.Unmarshal(m, b) -} -func (m *CreateTagReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateTagReq.Marshal(b, m, deterministic) -} -func (dst *CreateTagReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateTagReq.Merge(dst, src) -} -func (m *CreateTagReq) XXX_Size() int { - return xxx_messageInfo_CreateTagReq.Size(m) -} -func (m *CreateTagReq) XXX_DiscardUnknown() { - xxx_messageInfo_CreateTagReq.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateTagReq proto.InternalMessageInfo - -func (m *CreateTagReq) GetTagName() string { - if m != nil { - return m.TagName - } - return "" -} - -func (m *CreateTagReq) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *CreateTagReq) GetUserIDList() []string { - if m != nil { - return m.UserIDList - } - return nil -} - -func (m *CreateTagReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type CreateTagResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateTagResp) Reset() { *m = CreateTagResp{} } -func (m *CreateTagResp) String() string { return proto.CompactTextString(m) } -func (*CreateTagResp) ProtoMessage() {} -func (*CreateTagResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{6} -} -func (m *CreateTagResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateTagResp.Unmarshal(m, b) -} -func (m *CreateTagResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateTagResp.Marshal(b, m, deterministic) -} -func (dst *CreateTagResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateTagResp.Merge(dst, src) -} -func (m *CreateTagResp) XXX_Size() int { - return xxx_messageInfo_CreateTagResp.Size(m) -} -func (m *CreateTagResp) XXX_DiscardUnknown() { - xxx_messageInfo_CreateTagResp.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateTagResp proto.InternalMessageInfo - -func (m *CreateTagResp) GetCommonResp() *CommonResp { - if m != nil { - return m.CommonResp - } - return nil -} - -type DeleteTagReq struct { - UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` - TagID string `protobuf:"bytes,2,opt,name=tagID" json:"tagID,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteTagReq) Reset() { *m = DeleteTagReq{} } -func (m *DeleteTagReq) String() string { return proto.CompactTextString(m) } -func (*DeleteTagReq) ProtoMessage() {} -func (*DeleteTagReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{7} -} -func (m *DeleteTagReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteTagReq.Unmarshal(m, b) -} -func (m *DeleteTagReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteTagReq.Marshal(b, m, deterministic) -} -func (dst *DeleteTagReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteTagReq.Merge(dst, src) -} -func (m *DeleteTagReq) XXX_Size() int { - return xxx_messageInfo_DeleteTagReq.Size(m) -} -func (m *DeleteTagReq) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteTagReq.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteTagReq proto.InternalMessageInfo - -func (m *DeleteTagReq) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *DeleteTagReq) GetTagID() string { - if m != nil { - return m.TagID - } - return "" -} - -func (m *DeleteTagReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type DeleteTagResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteTagResp) Reset() { *m = DeleteTagResp{} } -func (m *DeleteTagResp) String() string { return proto.CompactTextString(m) } -func (*DeleteTagResp) ProtoMessage() {} -func (*DeleteTagResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{8} -} -func (m *DeleteTagResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteTagResp.Unmarshal(m, b) -} -func (m *DeleteTagResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteTagResp.Marshal(b, m, deterministic) -} -func (dst *DeleteTagResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteTagResp.Merge(dst, src) -} -func (m *DeleteTagResp) XXX_Size() int { - return xxx_messageInfo_DeleteTagResp.Size(m) -} -func (m *DeleteTagResp) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteTagResp.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteTagResp proto.InternalMessageInfo - -func (m *DeleteTagResp) GetCommonResp() *CommonResp { - if m != nil { - return m.CommonResp - } - return nil -} - -type SetTagReq struct { - UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` - TagID string `protobuf:"bytes,2,opt,name=tagID" json:"tagID,omitempty"` - NewName string `protobuf:"bytes,3,opt,name=newName" json:"newName,omitempty"` - IncreaseUserIDList []string `protobuf:"bytes,4,rep,name=increaseUserIDList" json:"increaseUserIDList,omitempty"` - ReduceUserIDList []string `protobuf:"bytes,5,rep,name=reduceUserIDList" json:"reduceUserIDList,omitempty"` - OperationID string `protobuf:"bytes,6,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SetTagReq) Reset() { *m = SetTagReq{} } -func (m *SetTagReq) String() string { return proto.CompactTextString(m) } -func (*SetTagReq) ProtoMessage() {} -func (*SetTagReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{9} -} -func (m *SetTagReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SetTagReq.Unmarshal(m, b) -} -func (m *SetTagReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SetTagReq.Marshal(b, m, deterministic) -} -func (dst *SetTagReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetTagReq.Merge(dst, src) -} -func (m *SetTagReq) XXX_Size() int { - return xxx_messageInfo_SetTagReq.Size(m) -} -func (m *SetTagReq) XXX_DiscardUnknown() { - xxx_messageInfo_SetTagReq.DiscardUnknown(m) -} - -var xxx_messageInfo_SetTagReq proto.InternalMessageInfo - -func (m *SetTagReq) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *SetTagReq) GetTagID() string { - if m != nil { - return m.TagID - } - return "" -} - -func (m *SetTagReq) GetNewName() string { - if m != nil { - return m.NewName - } - return "" -} - -func (m *SetTagReq) GetIncreaseUserIDList() []string { - if m != nil { - return m.IncreaseUserIDList - } - return nil -} - -func (m *SetTagReq) GetReduceUserIDList() []string { - if m != nil { - return m.ReduceUserIDList - } - return nil -} - -func (m *SetTagReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type SetTagResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SetTagResp) Reset() { *m = SetTagResp{} } -func (m *SetTagResp) String() string { return proto.CompactTextString(m) } -func (*SetTagResp) ProtoMessage() {} -func (*SetTagResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{10} -} -func (m *SetTagResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SetTagResp.Unmarshal(m, b) -} -func (m *SetTagResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SetTagResp.Marshal(b, m, deterministic) -} -func (dst *SetTagResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetTagResp.Merge(dst, src) -} -func (m *SetTagResp) XXX_Size() int { - return xxx_messageInfo_SetTagResp.Size(m) -} -func (m *SetTagResp) XXX_DiscardUnknown() { - xxx_messageInfo_SetTagResp.DiscardUnknown(m) -} - -var xxx_messageInfo_SetTagResp proto.InternalMessageInfo - -func (m *SetTagResp) GetCommonResp() *CommonResp { - if m != nil { - return m.CommonResp - } - return nil -} - -type SendMsg2TagReq struct { - TagList []string `protobuf:"bytes,1,rep,name=tagList" json:"tagList,omitempty"` - UserList []string `protobuf:"bytes,2,rep,name=UserList" json:"UserList,omitempty"` - GroupList []string `protobuf:"bytes,3,rep,name=GroupList" json:"GroupList,omitempty"` - SendID string `protobuf:"bytes,4,opt,name=sendID" json:"sendID,omitempty"` - SenderPlatformID int32 `protobuf:"varint,5,opt,name=senderPlatformID" json:"senderPlatformID,omitempty"` - Content string `protobuf:"bytes,6,opt,name=content" json:"content,omitempty"` - OperationID string `protobuf:"bytes,7,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SendMsg2TagReq) Reset() { *m = SendMsg2TagReq{} } -func (m *SendMsg2TagReq) String() string { return proto.CompactTextString(m) } -func (*SendMsg2TagReq) ProtoMessage() {} -func (*SendMsg2TagReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{11} -} -func (m *SendMsg2TagReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SendMsg2TagReq.Unmarshal(m, b) -} -func (m *SendMsg2TagReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SendMsg2TagReq.Marshal(b, m, deterministic) -} -func (dst *SendMsg2TagReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_SendMsg2TagReq.Merge(dst, src) -} -func (m *SendMsg2TagReq) XXX_Size() int { - return xxx_messageInfo_SendMsg2TagReq.Size(m) -} -func (m *SendMsg2TagReq) XXX_DiscardUnknown() { - xxx_messageInfo_SendMsg2TagReq.DiscardUnknown(m) -} - -var xxx_messageInfo_SendMsg2TagReq proto.InternalMessageInfo - -func (m *SendMsg2TagReq) GetTagList() []string { - if m != nil { - return m.TagList - } - return nil -} - -func (m *SendMsg2TagReq) GetUserList() []string { - if m != nil { - return m.UserList - } - return nil -} - -func (m *SendMsg2TagReq) GetGroupList() []string { - if m != nil { - return m.GroupList - } - return nil -} - -func (m *SendMsg2TagReq) GetSendID() string { - if m != nil { - return m.SendID - } - return "" -} - -func (m *SendMsg2TagReq) GetSenderPlatformID() int32 { - if m != nil { - return m.SenderPlatformID - } - return 0 -} - -func (m *SendMsg2TagReq) GetContent() string { - if m != nil { - return m.Content - } - return "" -} - -func (m *SendMsg2TagReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type SendMsg2TagResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SendMsg2TagResp) Reset() { *m = SendMsg2TagResp{} } -func (m *SendMsg2TagResp) String() string { return proto.CompactTextString(m) } -func (*SendMsg2TagResp) ProtoMessage() {} -func (*SendMsg2TagResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{12} -} -func (m *SendMsg2TagResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SendMsg2TagResp.Unmarshal(m, b) -} -func (m *SendMsg2TagResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SendMsg2TagResp.Marshal(b, m, deterministic) -} -func (dst *SendMsg2TagResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_SendMsg2TagResp.Merge(dst, src) -} -func (m *SendMsg2TagResp) XXX_Size() int { - return xxx_messageInfo_SendMsg2TagResp.Size(m) -} -func (m *SendMsg2TagResp) XXX_DiscardUnknown() { - xxx_messageInfo_SendMsg2TagResp.DiscardUnknown(m) -} - -var xxx_messageInfo_SendMsg2TagResp proto.InternalMessageInfo - -func (m *SendMsg2TagResp) GetCommonResp() *CommonResp { - if m != nil { - return m.CommonResp - } - return nil -} - -type GetTagSendLogsReq struct { - Pagination *sdk_ws.RequestPagination `protobuf:"bytes,1,opt,name=Pagination" json:"Pagination,omitempty"` - UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetTagSendLogsReq) Reset() { *m = GetTagSendLogsReq{} } -func (m *GetTagSendLogsReq) String() string { return proto.CompactTextString(m) } -func (*GetTagSendLogsReq) ProtoMessage() {} -func (*GetTagSendLogsReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{13} -} -func (m *GetTagSendLogsReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetTagSendLogsReq.Unmarshal(m, b) -} -func (m *GetTagSendLogsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetTagSendLogsReq.Marshal(b, m, deterministic) -} -func (dst *GetTagSendLogsReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTagSendLogsReq.Merge(dst, src) -} -func (m *GetTagSendLogsReq) XXX_Size() int { - return xxx_messageInfo_GetTagSendLogsReq.Size(m) -} -func (m *GetTagSendLogsReq) XXX_DiscardUnknown() { - xxx_messageInfo_GetTagSendLogsReq.DiscardUnknown(m) -} - -var xxx_messageInfo_GetTagSendLogsReq proto.InternalMessageInfo - -func (m *GetTagSendLogsReq) GetPagination() *sdk_ws.RequestPagination { - if m != nil { - return m.Pagination - } - return nil -} - -func (m *GetTagSendLogsReq) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *GetTagSendLogsReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type TagSendLog struct { - UserList []*TagUser `protobuf:"bytes,1,rep,name=userList" json:"userList,omitempty"` - Content string `protobuf:"bytes,2,opt,name=content" json:"content,omitempty"` - SendTime int64 `protobuf:"varint,3,opt,name=sendTime" json:"sendTime,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TagSendLog) Reset() { *m = TagSendLog{} } -func (m *TagSendLog) String() string { return proto.CompactTextString(m) } -func (*TagSendLog) ProtoMessage() {} -func (*TagSendLog) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{14} -} -func (m *TagSendLog) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TagSendLog.Unmarshal(m, b) -} -func (m *TagSendLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TagSendLog.Marshal(b, m, deterministic) -} -func (dst *TagSendLog) XXX_Merge(src proto.Message) { - xxx_messageInfo_TagSendLog.Merge(dst, src) -} -func (m *TagSendLog) XXX_Size() int { - return xxx_messageInfo_TagSendLog.Size(m) -} -func (m *TagSendLog) XXX_DiscardUnknown() { - xxx_messageInfo_TagSendLog.DiscardUnknown(m) -} - -var xxx_messageInfo_TagSendLog proto.InternalMessageInfo - -func (m *TagSendLog) GetUserList() []*TagUser { - if m != nil { - return m.UserList - } - return nil -} - -func (m *TagSendLog) GetContent() string { - if m != nil { - return m.Content - } - return "" -} - -func (m *TagSendLog) GetSendTime() int64 { - if m != nil { - return m.SendTime - } - return 0 -} - -type GetTagSendLogsResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,2,opt,name=Pagination" json:"Pagination,omitempty"` - TagSendLogs []*TagSendLog `protobuf:"bytes,3,rep,name=tagSendLogs" json:"tagSendLogs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetTagSendLogsResp) Reset() { *m = GetTagSendLogsResp{} } -func (m *GetTagSendLogsResp) String() string { return proto.CompactTextString(m) } -func (*GetTagSendLogsResp) ProtoMessage() {} -func (*GetTagSendLogsResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{15} -} -func (m *GetTagSendLogsResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetTagSendLogsResp.Unmarshal(m, b) -} -func (m *GetTagSendLogsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetTagSendLogsResp.Marshal(b, m, deterministic) -} -func (dst *GetTagSendLogsResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTagSendLogsResp.Merge(dst, src) -} -func (m *GetTagSendLogsResp) XXX_Size() int { - return xxx_messageInfo_GetTagSendLogsResp.Size(m) -} -func (m *GetTagSendLogsResp) XXX_DiscardUnknown() { - xxx_messageInfo_GetTagSendLogsResp.DiscardUnknown(m) -} - -var xxx_messageInfo_GetTagSendLogsResp proto.InternalMessageInfo - -func (m *GetTagSendLogsResp) GetCommonResp() *CommonResp { - if m != nil { - return m.CommonResp - } - return nil -} - -func (m *GetTagSendLogsResp) GetPagination() *sdk_ws.ResponsePagination { - if m != nil { - return m.Pagination - } - return nil -} - -func (m *GetTagSendLogsResp) GetTagSendLogs() []*TagSendLog { - if m != nil { - return m.TagSendLogs - } - return nil -} - -type GetUserTagByIDReq struct { - UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` - TagID string `protobuf:"bytes,2,opt,name=tagID" json:"tagID,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetUserTagByIDReq) Reset() { *m = GetUserTagByIDReq{} } -func (m *GetUserTagByIDReq) String() string { return proto.CompactTextString(m) } -func (*GetUserTagByIDReq) ProtoMessage() {} -func (*GetUserTagByIDReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{16} -} -func (m *GetUserTagByIDReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetUserTagByIDReq.Unmarshal(m, b) -} -func (m *GetUserTagByIDReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetUserTagByIDReq.Marshal(b, m, deterministic) -} -func (dst *GetUserTagByIDReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetUserTagByIDReq.Merge(dst, src) -} -func (m *GetUserTagByIDReq) XXX_Size() int { - return xxx_messageInfo_GetUserTagByIDReq.Size(m) -} -func (m *GetUserTagByIDReq) XXX_DiscardUnknown() { - xxx_messageInfo_GetUserTagByIDReq.DiscardUnknown(m) -} - -var xxx_messageInfo_GetUserTagByIDReq proto.InternalMessageInfo - -func (m *GetUserTagByIDReq) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *GetUserTagByIDReq) GetTagID() string { - if m != nil { - return m.TagID - } - return "" -} - -func (m *GetUserTagByIDReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type GetUserTagByIDResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - Tag *Tag `protobuf:"bytes,2,opt,name=tag" json:"tag,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetUserTagByIDResp) Reset() { *m = GetUserTagByIDResp{} } -func (m *GetUserTagByIDResp) String() string { return proto.CompactTextString(m) } -func (*GetUserTagByIDResp) ProtoMessage() {} -func (*GetUserTagByIDResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{17} -} -func (m *GetUserTagByIDResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetUserTagByIDResp.Unmarshal(m, b) -} -func (m *GetUserTagByIDResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetUserTagByIDResp.Marshal(b, m, deterministic) -} -func (dst *GetUserTagByIDResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetUserTagByIDResp.Merge(dst, src) -} -func (m *GetUserTagByIDResp) XXX_Size() int { - return xxx_messageInfo_GetUserTagByIDResp.Size(m) -} -func (m *GetUserTagByIDResp) XXX_DiscardUnknown() { - xxx_messageInfo_GetUserTagByIDResp.DiscardUnknown(m) -} - -var xxx_messageInfo_GetUserTagByIDResp proto.InternalMessageInfo - -func (m *GetUserTagByIDResp) GetCommonResp() *CommonResp { - if m != nil { - return m.CommonResp - } - return nil -} - -func (m *GetUserTagByIDResp) GetTag() *Tag { - if m != nil { - return m.Tag - } - return nil -} - -type LikeUser struct { - UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` - UserName string `protobuf:"bytes,2,opt,name=userName" json:"userName,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LikeUser) Reset() { *m = LikeUser{} } -func (m *LikeUser) String() string { return proto.CompactTextString(m) } -func (*LikeUser) ProtoMessage() {} -func (*LikeUser) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{18} -} -func (m *LikeUser) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_LikeUser.Unmarshal(m, b) -} -func (m *LikeUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_LikeUser.Marshal(b, m, deterministic) -} -func (dst *LikeUser) XXX_Merge(src proto.Message) { - xxx_messageInfo_LikeUser.Merge(dst, src) -} -func (m *LikeUser) XXX_Size() int { - return xxx_messageInfo_LikeUser.Size(m) -} -func (m *LikeUser) XXX_DiscardUnknown() { - xxx_messageInfo_LikeUser.DiscardUnknown(m) -} - -var xxx_messageInfo_LikeUser proto.InternalMessageInfo - -func (m *LikeUser) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *LikeUser) GetUserName() string { - if m != nil { - return m.UserName - } - return "" -} - -type NotificationUser struct { - UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` - UserName string `protobuf:"bytes,2,opt,name=userName" json:"userName,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NotificationUser) Reset() { *m = NotificationUser{} } -func (m *NotificationUser) String() string { return proto.CompactTextString(m) } -func (*NotificationUser) ProtoMessage() {} -func (*NotificationUser) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{19} -} -func (m *NotificationUser) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NotificationUser.Unmarshal(m, b) -} -func (m *NotificationUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NotificationUser.Marshal(b, m, deterministic) -} -func (dst *NotificationUser) XXX_Merge(src proto.Message) { - xxx_messageInfo_NotificationUser.Merge(dst, src) -} -func (m *NotificationUser) XXX_Size() int { - return xxx_messageInfo_NotificationUser.Size(m) -} -func (m *NotificationUser) XXX_DiscardUnknown() { - xxx_messageInfo_NotificationUser.DiscardUnknown(m) -} - -var xxx_messageInfo_NotificationUser proto.InternalMessageInfo - -func (m *NotificationUser) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *NotificationUser) GetUserName() string { - if m != nil { - return m.UserName - } - return "" -} - -type Comment struct { - UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` - UserName string `protobuf:"bytes,2,opt,name=userName" json:"userName,omitempty"` - FaceURL string `protobuf:"bytes,3,opt,name=faceURL" json:"faceURL,omitempty"` - ReplyUserID string `protobuf:"bytes,4,opt,name=replyUserID" json:"replyUserID,omitempty"` - ReplyUserName string `protobuf:"bytes,5,opt,name=replyUserName" json:"replyUserName,omitempty"` - ContentID string `protobuf:"bytes,6,opt,name=contentID" json:"contentID,omitempty"` - Content string `protobuf:"bytes,7,opt,name=content" json:"content,omitempty"` - CreateTime int32 `protobuf:"varint,8,opt,name=createTime" json:"createTime,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Comment) Reset() { *m = Comment{} } -func (m *Comment) String() string { return proto.CompactTextString(m) } -func (*Comment) ProtoMessage() {} -func (*Comment) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{20} -} -func (m *Comment) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Comment.Unmarshal(m, b) -} -func (m *Comment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Comment.Marshal(b, m, deterministic) -} -func (dst *Comment) XXX_Merge(src proto.Message) { - xxx_messageInfo_Comment.Merge(dst, src) -} -func (m *Comment) XXX_Size() int { - return xxx_messageInfo_Comment.Size(m) -} -func (m *Comment) XXX_DiscardUnknown() { - xxx_messageInfo_Comment.DiscardUnknown(m) -} - -var xxx_messageInfo_Comment proto.InternalMessageInfo - -func (m *Comment) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *Comment) GetUserName() string { - if m != nil { - return m.UserName - } - return "" -} - -func (m *Comment) GetFaceURL() string { - if m != nil { - return m.FaceURL - } - return "" -} - -func (m *Comment) GetReplyUserID() string { - if m != nil { - return m.ReplyUserID - } - return "" -} - -func (m *Comment) GetReplyUserName() string { - if m != nil { - return m.ReplyUserName - } - return "" -} - -func (m *Comment) GetContentID() string { - if m != nil { - return m.ContentID - } - return "" -} - -func (m *Comment) GetContent() string { - if m != nil { - return m.Content - } - return "" -} - -func (m *Comment) GetCreateTime() int32 { - if m != nil { - return m.CreateTime - } - return 0 -} - -type PermissionGroup struct { - GroupName string `protobuf:"bytes,1,opt,name=groupName" json:"groupName,omitempty"` - GroupID string `protobuf:"bytes,2,opt,name=groupID" json:"groupID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PermissionGroup) Reset() { *m = PermissionGroup{} } -func (m *PermissionGroup) String() string { return proto.CompactTextString(m) } -func (*PermissionGroup) ProtoMessage() {} -func (*PermissionGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{21} -} -func (m *PermissionGroup) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PermissionGroup.Unmarshal(m, b) -} -func (m *PermissionGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PermissionGroup.Marshal(b, m, deterministic) -} -func (dst *PermissionGroup) XXX_Merge(src proto.Message) { - xxx_messageInfo_PermissionGroup.Merge(dst, src) -} -func (m *PermissionGroup) XXX_Size() int { - return xxx_messageInfo_PermissionGroup.Size(m) -} -func (m *PermissionGroup) XXX_DiscardUnknown() { - xxx_messageInfo_PermissionGroup.DiscardUnknown(m) -} - -var xxx_messageInfo_PermissionGroup proto.InternalMessageInfo - -func (m *PermissionGroup) GetGroupName() string { - if m != nil { - return m.GroupName - } - return "" -} - -func (m *PermissionGroup) GetGroupID() string { - if m != nil { - return m.GroupID - } - return "" -} - -type WorkMomentUser struct { - UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` - UserName string `protobuf:"bytes,2,opt,name=userName" json:"userName,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WorkMomentUser) Reset() { *m = WorkMomentUser{} } -func (m *WorkMomentUser) String() string { return proto.CompactTextString(m) } -func (*WorkMomentUser) ProtoMessage() {} -func (*WorkMomentUser) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{22} -} -func (m *WorkMomentUser) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WorkMomentUser.Unmarshal(m, b) -} -func (m *WorkMomentUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WorkMomentUser.Marshal(b, m, deterministic) -} -func (dst *WorkMomentUser) XXX_Merge(src proto.Message) { - xxx_messageInfo_WorkMomentUser.Merge(dst, src) -} -func (m *WorkMomentUser) XXX_Size() int { - return xxx_messageInfo_WorkMomentUser.Size(m) -} -func (m *WorkMomentUser) XXX_DiscardUnknown() { - xxx_messageInfo_WorkMomentUser.DiscardUnknown(m) -} - -var xxx_messageInfo_WorkMomentUser proto.InternalMessageInfo - -func (m *WorkMomentUser) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *WorkMomentUser) GetUserName() string { - if m != nil { - return m.UserName - } - return "" -} - -type WorkMoment struct { - WorkMomentID string `protobuf:"bytes,1,opt,name=workMomentID" json:"workMomentID,omitempty"` - UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` - UserName string `protobuf:"bytes,3,opt,name=userName" json:"userName,omitempty"` - FaceURL string `protobuf:"bytes,4,opt,name=faceURL" json:"faceURL,omitempty"` - Content string `protobuf:"bytes,5,opt,name=content" json:"content,omitempty"` - LikeUserList []*WorkMomentUser `protobuf:"bytes,6,rep,name=likeUserList" json:"likeUserList,omitempty"` - Comments []*Comment `protobuf:"bytes,7,rep,name=comments" json:"comments,omitempty"` - Permission int32 `protobuf:"varint,8,opt,name=permission" json:"permission,omitempty"` - PermissionUserList []*WorkMomentUser `protobuf:"bytes,9,rep,name=permissionUserList" json:"permissionUserList,omitempty"` - PermissionGroupList []*PermissionGroup `protobuf:"bytes,10,rep,name=permissionGroupList" json:"permissionGroupList,omitempty"` - AtUserList []*WorkMomentUser `protobuf:"bytes,11,rep,name=atUserList" json:"atUserList,omitempty"` - CreateTime int32 `protobuf:"varint,12,opt,name=createTime" json:"createTime,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WorkMoment) Reset() { *m = WorkMoment{} } -func (m *WorkMoment) String() string { return proto.CompactTextString(m) } -func (*WorkMoment) ProtoMessage() {} -func (*WorkMoment) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{23} -} -func (m *WorkMoment) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WorkMoment.Unmarshal(m, b) -} -func (m *WorkMoment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WorkMoment.Marshal(b, m, deterministic) -} -func (dst *WorkMoment) XXX_Merge(src proto.Message) { - xxx_messageInfo_WorkMoment.Merge(dst, src) -} -func (m *WorkMoment) XXX_Size() int { - return xxx_messageInfo_WorkMoment.Size(m) -} -func (m *WorkMoment) XXX_DiscardUnknown() { - xxx_messageInfo_WorkMoment.DiscardUnknown(m) -} - -var xxx_messageInfo_WorkMoment proto.InternalMessageInfo - -func (m *WorkMoment) GetWorkMomentID() string { - if m != nil { - return m.WorkMomentID - } - return "" -} - -func (m *WorkMoment) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *WorkMoment) GetUserName() string { - if m != nil { - return m.UserName - } - return "" -} - -func (m *WorkMoment) GetFaceURL() string { - if m != nil { - return m.FaceURL - } - return "" -} - -func (m *WorkMoment) GetContent() string { - if m != nil { - return m.Content - } - return "" -} - -func (m *WorkMoment) GetLikeUserList() []*WorkMomentUser { - if m != nil { - return m.LikeUserList - } - return nil -} - -func (m *WorkMoment) GetComments() []*Comment { - if m != nil { - return m.Comments - } - return nil -} - -func (m *WorkMoment) GetPermission() int32 { - if m != nil { - return m.Permission - } - return 0 -} - -func (m *WorkMoment) GetPermissionUserList() []*WorkMomentUser { - if m != nil { - return m.PermissionUserList - } - return nil -} - -func (m *WorkMoment) GetPermissionGroupList() []*PermissionGroup { - if m != nil { - return m.PermissionGroupList - } - return nil -} - -func (m *WorkMoment) GetAtUserList() []*WorkMomentUser { - if m != nil { - return m.AtUserList - } - return nil -} - -func (m *WorkMoment) GetCreateTime() int32 { - if m != nil { - return m.CreateTime - } - return 0 -} - -type CreateOneWorkMomentReq struct { - WorkMoment *WorkMoment `protobuf:"bytes,1,opt,name=workMoment" json:"workMoment,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateOneWorkMomentReq) Reset() { *m = CreateOneWorkMomentReq{} } -func (m *CreateOneWorkMomentReq) String() string { return proto.CompactTextString(m) } -func (*CreateOneWorkMomentReq) ProtoMessage() {} -func (*CreateOneWorkMomentReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{24} -} -func (m *CreateOneWorkMomentReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateOneWorkMomentReq.Unmarshal(m, b) -} -func (m *CreateOneWorkMomentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateOneWorkMomentReq.Marshal(b, m, deterministic) -} -func (dst *CreateOneWorkMomentReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateOneWorkMomentReq.Merge(dst, src) -} -func (m *CreateOneWorkMomentReq) XXX_Size() int { - return xxx_messageInfo_CreateOneWorkMomentReq.Size(m) -} -func (m *CreateOneWorkMomentReq) XXX_DiscardUnknown() { - xxx_messageInfo_CreateOneWorkMomentReq.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateOneWorkMomentReq proto.InternalMessageInfo - -func (m *CreateOneWorkMomentReq) GetWorkMoment() *WorkMoment { - if m != nil { - return m.WorkMoment - } - return nil -} - -func (m *CreateOneWorkMomentReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type CreateOneWorkMomentResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateOneWorkMomentResp) Reset() { *m = CreateOneWorkMomentResp{} } -func (m *CreateOneWorkMomentResp) String() string { return proto.CompactTextString(m) } -func (*CreateOneWorkMomentResp) ProtoMessage() {} -func (*CreateOneWorkMomentResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{25} -} -func (m *CreateOneWorkMomentResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateOneWorkMomentResp.Unmarshal(m, b) -} -func (m *CreateOneWorkMomentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateOneWorkMomentResp.Marshal(b, m, deterministic) -} -func (dst *CreateOneWorkMomentResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateOneWorkMomentResp.Merge(dst, src) -} -func (m *CreateOneWorkMomentResp) XXX_Size() int { - return xxx_messageInfo_CreateOneWorkMomentResp.Size(m) -} -func (m *CreateOneWorkMomentResp) XXX_DiscardUnknown() { - xxx_messageInfo_CreateOneWorkMomentResp.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateOneWorkMomentResp proto.InternalMessageInfo - -func (m *CreateOneWorkMomentResp) GetCommonResp() *CommonResp { - if m != nil { - return m.CommonResp - } - return nil -} - -type DeleteOneWorkMomentReq struct { - WorkMomentID string `protobuf:"bytes,1,opt,name=workMomentID" json:"workMomentID,omitempty"` - UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteOneWorkMomentReq) Reset() { *m = DeleteOneWorkMomentReq{} } -func (m *DeleteOneWorkMomentReq) String() string { return proto.CompactTextString(m) } -func (*DeleteOneWorkMomentReq) ProtoMessage() {} -func (*DeleteOneWorkMomentReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{26} -} -func (m *DeleteOneWorkMomentReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteOneWorkMomentReq.Unmarshal(m, b) -} -func (m *DeleteOneWorkMomentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteOneWorkMomentReq.Marshal(b, m, deterministic) -} -func (dst *DeleteOneWorkMomentReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteOneWorkMomentReq.Merge(dst, src) -} -func (m *DeleteOneWorkMomentReq) XXX_Size() int { - return xxx_messageInfo_DeleteOneWorkMomentReq.Size(m) -} -func (m *DeleteOneWorkMomentReq) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteOneWorkMomentReq.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteOneWorkMomentReq proto.InternalMessageInfo - -func (m *DeleteOneWorkMomentReq) GetWorkMomentID() string { - if m != nil { - return m.WorkMomentID - } - return "" -} - -func (m *DeleteOneWorkMomentReq) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *DeleteOneWorkMomentReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type DeleteOneWorkMomentResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeleteOneWorkMomentResp) Reset() { *m = DeleteOneWorkMomentResp{} } -func (m *DeleteOneWorkMomentResp) String() string { return proto.CompactTextString(m) } -func (*DeleteOneWorkMomentResp) ProtoMessage() {} -func (*DeleteOneWorkMomentResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{27} -} -func (m *DeleteOneWorkMomentResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteOneWorkMomentResp.Unmarshal(m, b) -} -func (m *DeleteOneWorkMomentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteOneWorkMomentResp.Marshal(b, m, deterministic) -} -func (dst *DeleteOneWorkMomentResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteOneWorkMomentResp.Merge(dst, src) -} -func (m *DeleteOneWorkMomentResp) XXX_Size() int { - return xxx_messageInfo_DeleteOneWorkMomentResp.Size(m) -} -func (m *DeleteOneWorkMomentResp) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteOneWorkMomentResp.DiscardUnknown(m) -} - -var xxx_messageInfo_DeleteOneWorkMomentResp proto.InternalMessageInfo - -func (m *DeleteOneWorkMomentResp) GetCommonResp() *CommonResp { - if m != nil { - return m.CommonResp - } - return nil -} - -type LikeOneWorkMomentReq struct { - UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` - WorkMomentID string `protobuf:"bytes,2,opt,name=WorkMomentID" json:"WorkMomentID,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LikeOneWorkMomentReq) Reset() { *m = LikeOneWorkMomentReq{} } -func (m *LikeOneWorkMomentReq) String() string { return proto.CompactTextString(m) } -func (*LikeOneWorkMomentReq) ProtoMessage() {} -func (*LikeOneWorkMomentReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{28} -} -func (m *LikeOneWorkMomentReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_LikeOneWorkMomentReq.Unmarshal(m, b) -} -func (m *LikeOneWorkMomentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_LikeOneWorkMomentReq.Marshal(b, m, deterministic) -} -func (dst *LikeOneWorkMomentReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_LikeOneWorkMomentReq.Merge(dst, src) -} -func (m *LikeOneWorkMomentReq) XXX_Size() int { - return xxx_messageInfo_LikeOneWorkMomentReq.Size(m) -} -func (m *LikeOneWorkMomentReq) XXX_DiscardUnknown() { - xxx_messageInfo_LikeOneWorkMomentReq.DiscardUnknown(m) -} - -var xxx_messageInfo_LikeOneWorkMomentReq proto.InternalMessageInfo - -func (m *LikeOneWorkMomentReq) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *LikeOneWorkMomentReq) GetWorkMomentID() string { - if m != nil { - return m.WorkMomentID - } - return "" -} - -func (m *LikeOneWorkMomentReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type LikeOneWorkMomentResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LikeOneWorkMomentResp) Reset() { *m = LikeOneWorkMomentResp{} } -func (m *LikeOneWorkMomentResp) String() string { return proto.CompactTextString(m) } -func (*LikeOneWorkMomentResp) ProtoMessage() {} -func (*LikeOneWorkMomentResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{29} -} -func (m *LikeOneWorkMomentResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_LikeOneWorkMomentResp.Unmarshal(m, b) -} -func (m *LikeOneWorkMomentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_LikeOneWorkMomentResp.Marshal(b, m, deterministic) -} -func (dst *LikeOneWorkMomentResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_LikeOneWorkMomentResp.Merge(dst, src) -} -func (m *LikeOneWorkMomentResp) XXX_Size() int { - return xxx_messageInfo_LikeOneWorkMomentResp.Size(m) -} -func (m *LikeOneWorkMomentResp) XXX_DiscardUnknown() { - xxx_messageInfo_LikeOneWorkMomentResp.DiscardUnknown(m) -} - -var xxx_messageInfo_LikeOneWorkMomentResp proto.InternalMessageInfo - -func (m *LikeOneWorkMomentResp) GetCommonResp() *CommonResp { - if m != nil { - return m.CommonResp - } - return nil -} - -type CommentOneWorkMomentReq struct { - UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` - WorkMomentID string `protobuf:"bytes,2,opt,name=workMomentID" json:"workMomentID,omitempty"` - ReplyUserID string `protobuf:"bytes,3,opt,name=replyUserID" json:"replyUserID,omitempty"` - Content string `protobuf:"bytes,4,opt,name=content" json:"content,omitempty"` - OperationID string `protobuf:"bytes,5,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CommentOneWorkMomentReq) Reset() { *m = CommentOneWorkMomentReq{} } -func (m *CommentOneWorkMomentReq) String() string { return proto.CompactTextString(m) } -func (*CommentOneWorkMomentReq) ProtoMessage() {} -func (*CommentOneWorkMomentReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{30} -} -func (m *CommentOneWorkMomentReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CommentOneWorkMomentReq.Unmarshal(m, b) -} -func (m *CommentOneWorkMomentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CommentOneWorkMomentReq.Marshal(b, m, deterministic) -} -func (dst *CommentOneWorkMomentReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommentOneWorkMomentReq.Merge(dst, src) -} -func (m *CommentOneWorkMomentReq) XXX_Size() int { - return xxx_messageInfo_CommentOneWorkMomentReq.Size(m) -} -func (m *CommentOneWorkMomentReq) XXX_DiscardUnknown() { - xxx_messageInfo_CommentOneWorkMomentReq.DiscardUnknown(m) -} - -var xxx_messageInfo_CommentOneWorkMomentReq proto.InternalMessageInfo - -func (m *CommentOneWorkMomentReq) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *CommentOneWorkMomentReq) GetWorkMomentID() string { - if m != nil { - return m.WorkMomentID - } - return "" -} - -func (m *CommentOneWorkMomentReq) GetReplyUserID() string { - if m != nil { - return m.ReplyUserID - } - return "" -} - -func (m *CommentOneWorkMomentReq) GetContent() string { - if m != nil { - return m.Content - } - return "" -} - -func (m *CommentOneWorkMomentReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type CommentOneWorkMomentResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CommentOneWorkMomentResp) Reset() { *m = CommentOneWorkMomentResp{} } -func (m *CommentOneWorkMomentResp) String() string { return proto.CompactTextString(m) } -func (*CommentOneWorkMomentResp) ProtoMessage() {} -func (*CommentOneWorkMomentResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{31} -} -func (m *CommentOneWorkMomentResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CommentOneWorkMomentResp.Unmarshal(m, b) -} -func (m *CommentOneWorkMomentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CommentOneWorkMomentResp.Marshal(b, m, deterministic) -} -func (dst *CommentOneWorkMomentResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommentOneWorkMomentResp.Merge(dst, src) -} -func (m *CommentOneWorkMomentResp) XXX_Size() int { - return xxx_messageInfo_CommentOneWorkMomentResp.Size(m) -} -func (m *CommentOneWorkMomentResp) XXX_DiscardUnknown() { - xxx_messageInfo_CommentOneWorkMomentResp.DiscardUnknown(m) -} - -var xxx_messageInfo_CommentOneWorkMomentResp proto.InternalMessageInfo - -func (m *CommentOneWorkMomentResp) GetCommonResp() *CommonResp { - if m != nil { - return m.CommonResp - } - return nil -} - -type GetWorkMomentByIDReq struct { - WorkMomentID string `protobuf:"bytes,1,opt,name=workMomentID" json:"workMomentID,omitempty"` - OpUserID string `protobuf:"bytes,2,opt,name=opUserID" json:"opUserID,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetWorkMomentByIDReq) Reset() { *m = GetWorkMomentByIDReq{} } -func (m *GetWorkMomentByIDReq) String() string { return proto.CompactTextString(m) } -func (*GetWorkMomentByIDReq) ProtoMessage() {} -func (*GetWorkMomentByIDReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{32} -} -func (m *GetWorkMomentByIDReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetWorkMomentByIDReq.Unmarshal(m, b) -} -func (m *GetWorkMomentByIDReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetWorkMomentByIDReq.Marshal(b, m, deterministic) -} -func (dst *GetWorkMomentByIDReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetWorkMomentByIDReq.Merge(dst, src) -} -func (m *GetWorkMomentByIDReq) XXX_Size() int { - return xxx_messageInfo_GetWorkMomentByIDReq.Size(m) -} -func (m *GetWorkMomentByIDReq) XXX_DiscardUnknown() { - xxx_messageInfo_GetWorkMomentByIDReq.DiscardUnknown(m) -} - -var xxx_messageInfo_GetWorkMomentByIDReq proto.InternalMessageInfo - -func (m *GetWorkMomentByIDReq) GetWorkMomentID() string { - if m != nil { - return m.WorkMomentID - } - return "" -} - -func (m *GetWorkMomentByIDReq) GetOpUserID() string { - if m != nil { - return m.OpUserID - } - return "" -} - -func (m *GetWorkMomentByIDReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type GetWorkMomentByIDResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - WorkMoment *WorkMoment `protobuf:"bytes,2,opt,name=workMoment" json:"workMoment,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetWorkMomentByIDResp) Reset() { *m = GetWorkMomentByIDResp{} } -func (m *GetWorkMomentByIDResp) String() string { return proto.CompactTextString(m) } -func (*GetWorkMomentByIDResp) ProtoMessage() {} -func (*GetWorkMomentByIDResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{33} -} -func (m *GetWorkMomentByIDResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetWorkMomentByIDResp.Unmarshal(m, b) -} -func (m *GetWorkMomentByIDResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetWorkMomentByIDResp.Marshal(b, m, deterministic) -} -func (dst *GetWorkMomentByIDResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetWorkMomentByIDResp.Merge(dst, src) -} -func (m *GetWorkMomentByIDResp) XXX_Size() int { - return xxx_messageInfo_GetWorkMomentByIDResp.Size(m) -} -func (m *GetWorkMomentByIDResp) XXX_DiscardUnknown() { - xxx_messageInfo_GetWorkMomentByIDResp.DiscardUnknown(m) -} - -var xxx_messageInfo_GetWorkMomentByIDResp proto.InternalMessageInfo - -func (m *GetWorkMomentByIDResp) GetCommonResp() *CommonResp { - if m != nil { - return m.CommonResp - } - return nil -} - -func (m *GetWorkMomentByIDResp) GetWorkMoment() *WorkMoment { - if m != nil { - return m.WorkMoment - } - return nil -} - -type ChangeWorkMomentPermissionReq struct { - WorkMomentID string `protobuf:"bytes,1,opt,name=workMomentID" json:"workMomentID,omitempty"` - OpUserID string `protobuf:"bytes,2,opt,name=opUserID" json:"opUserID,omitempty"` - Permission int32 `protobuf:"varint,3,opt,name=permission" json:"permission,omitempty"` - PermissionUserIDList []string `protobuf:"bytes,4,rep,name=permissionUserIDList" json:"permissionUserIDList,omitempty"` - OperationID string `protobuf:"bytes,5,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChangeWorkMomentPermissionReq) Reset() { *m = ChangeWorkMomentPermissionReq{} } -func (m *ChangeWorkMomentPermissionReq) String() string { return proto.CompactTextString(m) } -func (*ChangeWorkMomentPermissionReq) ProtoMessage() {} -func (*ChangeWorkMomentPermissionReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{34} -} -func (m *ChangeWorkMomentPermissionReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChangeWorkMomentPermissionReq.Unmarshal(m, b) -} -func (m *ChangeWorkMomentPermissionReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChangeWorkMomentPermissionReq.Marshal(b, m, deterministic) -} -func (dst *ChangeWorkMomentPermissionReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChangeWorkMomentPermissionReq.Merge(dst, src) -} -func (m *ChangeWorkMomentPermissionReq) XXX_Size() int { - return xxx_messageInfo_ChangeWorkMomentPermissionReq.Size(m) -} -func (m *ChangeWorkMomentPermissionReq) XXX_DiscardUnknown() { - xxx_messageInfo_ChangeWorkMomentPermissionReq.DiscardUnknown(m) -} - -var xxx_messageInfo_ChangeWorkMomentPermissionReq proto.InternalMessageInfo - -func (m *ChangeWorkMomentPermissionReq) GetWorkMomentID() string { - if m != nil { - return m.WorkMomentID - } - return "" -} - -func (m *ChangeWorkMomentPermissionReq) GetOpUserID() string { - if m != nil { - return m.OpUserID - } - return "" -} - -func (m *ChangeWorkMomentPermissionReq) GetPermission() int32 { - if m != nil { - return m.Permission - } - return 0 -} - -func (m *ChangeWorkMomentPermissionReq) GetPermissionUserIDList() []string { - if m != nil { - return m.PermissionUserIDList - } - return nil -} - -func (m *ChangeWorkMomentPermissionReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type ChangeWorkMomentPermissionResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChangeWorkMomentPermissionResp) Reset() { *m = ChangeWorkMomentPermissionResp{} } -func (m *ChangeWorkMomentPermissionResp) String() string { return proto.CompactTextString(m) } -func (*ChangeWorkMomentPermissionResp) ProtoMessage() {} -func (*ChangeWorkMomentPermissionResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{35} -} -func (m *ChangeWorkMomentPermissionResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChangeWorkMomentPermissionResp.Unmarshal(m, b) -} -func (m *ChangeWorkMomentPermissionResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChangeWorkMomentPermissionResp.Marshal(b, m, deterministic) -} -func (dst *ChangeWorkMomentPermissionResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChangeWorkMomentPermissionResp.Merge(dst, src) -} -func (m *ChangeWorkMomentPermissionResp) XXX_Size() int { - return xxx_messageInfo_ChangeWorkMomentPermissionResp.Size(m) -} -func (m *ChangeWorkMomentPermissionResp) XXX_DiscardUnknown() { - xxx_messageInfo_ChangeWorkMomentPermissionResp.DiscardUnknown(m) -} - -var xxx_messageInfo_ChangeWorkMomentPermissionResp proto.InternalMessageInfo - -func (m *ChangeWorkMomentPermissionResp) GetCommonResp() *CommonResp { - if m != nil { - return m.CommonResp - } - return nil -} - -type GetUserWorkMomentsReq struct { - UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` - Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=Pagination" json:"Pagination,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetUserWorkMomentsReq) Reset() { *m = GetUserWorkMomentsReq{} } -func (m *GetUserWorkMomentsReq) String() string { return proto.CompactTextString(m) } -func (*GetUserWorkMomentsReq) ProtoMessage() {} -func (*GetUserWorkMomentsReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{36} -} -func (m *GetUserWorkMomentsReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetUserWorkMomentsReq.Unmarshal(m, b) -} -func (m *GetUserWorkMomentsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetUserWorkMomentsReq.Marshal(b, m, deterministic) -} -func (dst *GetUserWorkMomentsReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetUserWorkMomentsReq.Merge(dst, src) -} -func (m *GetUserWorkMomentsReq) XXX_Size() int { - return xxx_messageInfo_GetUserWorkMomentsReq.Size(m) -} -func (m *GetUserWorkMomentsReq) XXX_DiscardUnknown() { - xxx_messageInfo_GetUserWorkMomentsReq.DiscardUnknown(m) -} - -var xxx_messageInfo_GetUserWorkMomentsReq proto.InternalMessageInfo - -func (m *GetUserWorkMomentsReq) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *GetUserWorkMomentsReq) GetPagination() *sdk_ws.RequestPagination { - if m != nil { - return m.Pagination - } - return nil -} - -func (m *GetUserWorkMomentsReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type GetUserWorkMomentsResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - WorkMoments []*WorkMoment `protobuf:"bytes,2,rep,name=workMoments" json:"workMoments,omitempty"` - Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,3,opt,name=Pagination" json:"Pagination,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetUserWorkMomentsResp) Reset() { *m = GetUserWorkMomentsResp{} } -func (m *GetUserWorkMomentsResp) String() string { return proto.CompactTextString(m) } -func (*GetUserWorkMomentsResp) ProtoMessage() {} -func (*GetUserWorkMomentsResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{37} -} -func (m *GetUserWorkMomentsResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetUserWorkMomentsResp.Unmarshal(m, b) -} -func (m *GetUserWorkMomentsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetUserWorkMomentsResp.Marshal(b, m, deterministic) -} -func (dst *GetUserWorkMomentsResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetUserWorkMomentsResp.Merge(dst, src) -} -func (m *GetUserWorkMomentsResp) XXX_Size() int { - return xxx_messageInfo_GetUserWorkMomentsResp.Size(m) -} -func (m *GetUserWorkMomentsResp) XXX_DiscardUnknown() { - xxx_messageInfo_GetUserWorkMomentsResp.DiscardUnknown(m) -} - -var xxx_messageInfo_GetUserWorkMomentsResp proto.InternalMessageInfo - -func (m *GetUserWorkMomentsResp) GetCommonResp() *CommonResp { - if m != nil { - return m.CommonResp - } - return nil -} - -func (m *GetUserWorkMomentsResp) GetWorkMoments() []*WorkMoment { - if m != nil { - return m.WorkMoments - } - return nil -} - -func (m *GetUserWorkMomentsResp) GetPagination() *sdk_ws.ResponsePagination { - if m != nil { - return m.Pagination - } - return nil -} - -type GetUserFriendWorkMomentsReq struct { - UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` - Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=Pagination" json:"Pagination,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetUserFriendWorkMomentsReq) Reset() { *m = GetUserFriendWorkMomentsReq{} } -func (m *GetUserFriendWorkMomentsReq) String() string { return proto.CompactTextString(m) } -func (*GetUserFriendWorkMomentsReq) ProtoMessage() {} -func (*GetUserFriendWorkMomentsReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{38} -} -func (m *GetUserFriendWorkMomentsReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetUserFriendWorkMomentsReq.Unmarshal(m, b) -} -func (m *GetUserFriendWorkMomentsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetUserFriendWorkMomentsReq.Marshal(b, m, deterministic) -} -func (dst *GetUserFriendWorkMomentsReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetUserFriendWorkMomentsReq.Merge(dst, src) -} -func (m *GetUserFriendWorkMomentsReq) XXX_Size() int { - return xxx_messageInfo_GetUserFriendWorkMomentsReq.Size(m) -} -func (m *GetUserFriendWorkMomentsReq) XXX_DiscardUnknown() { - xxx_messageInfo_GetUserFriendWorkMomentsReq.DiscardUnknown(m) -} - -var xxx_messageInfo_GetUserFriendWorkMomentsReq proto.InternalMessageInfo - -func (m *GetUserFriendWorkMomentsReq) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *GetUserFriendWorkMomentsReq) GetPagination() *sdk_ws.RequestPagination { - if m != nil { - return m.Pagination - } - return nil -} - -func (m *GetUserFriendWorkMomentsReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type GetUserFriendWorkMomentsResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - WorkMoments []*WorkMoment `protobuf:"bytes,2,rep,name=workMoments" json:"workMoments,omitempty"` - Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,3,opt,name=Pagination" json:"Pagination,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetUserFriendWorkMomentsResp) Reset() { *m = GetUserFriendWorkMomentsResp{} } -func (m *GetUserFriendWorkMomentsResp) String() string { return proto.CompactTextString(m) } -func (*GetUserFriendWorkMomentsResp) ProtoMessage() {} -func (*GetUserFriendWorkMomentsResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{39} -} -func (m *GetUserFriendWorkMomentsResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetUserFriendWorkMomentsResp.Unmarshal(m, b) -} -func (m *GetUserFriendWorkMomentsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetUserFriendWorkMomentsResp.Marshal(b, m, deterministic) -} -func (dst *GetUserFriendWorkMomentsResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetUserFriendWorkMomentsResp.Merge(dst, src) -} -func (m *GetUserFriendWorkMomentsResp) XXX_Size() int { - return xxx_messageInfo_GetUserFriendWorkMomentsResp.Size(m) -} -func (m *GetUserFriendWorkMomentsResp) XXX_DiscardUnknown() { - xxx_messageInfo_GetUserFriendWorkMomentsResp.DiscardUnknown(m) -} - -var xxx_messageInfo_GetUserFriendWorkMomentsResp proto.InternalMessageInfo - -func (m *GetUserFriendWorkMomentsResp) GetCommonResp() *CommonResp { - if m != nil { - return m.CommonResp - } - return nil -} - -func (m *GetUserFriendWorkMomentsResp) GetWorkMoments() []*WorkMoment { - if m != nil { - return m.WorkMoments - } - return nil -} - -func (m *GetUserFriendWorkMomentsResp) GetPagination() *sdk_ws.ResponsePagination { - if m != nil { - return m.Pagination - } - return nil -} - -type WorkMomentNotificationMsg struct { - NotificationMsgType int32 `protobuf:"varint,1,opt,name=notificationMsgType" json:"notificationMsgType,omitempty"` - Comment *Comment `protobuf:"bytes,2,opt,name=comment" json:"comment,omitempty"` - WorkMomentID string `protobuf:"bytes,3,opt,name=workMomentID" json:"workMomentID,omitempty"` - UserID string `protobuf:"bytes,4,opt,name=userID" json:"userID,omitempty"` - UserName string `protobuf:"bytes,5,opt,name=userName" json:"userName,omitempty"` - FaceURL string `protobuf:"bytes,6,opt,name=faceURL" json:"faceURL,omitempty"` - WorkMomentContent string `protobuf:"bytes,7,opt,name=workMomentContent" json:"workMomentContent,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WorkMomentNotificationMsg) Reset() { *m = WorkMomentNotificationMsg{} } -func (m *WorkMomentNotificationMsg) String() string { return proto.CompactTextString(m) } -func (*WorkMomentNotificationMsg) ProtoMessage() {} -func (*WorkMomentNotificationMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{40} -} -func (m *WorkMomentNotificationMsg) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WorkMomentNotificationMsg.Unmarshal(m, b) -} -func (m *WorkMomentNotificationMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WorkMomentNotificationMsg.Marshal(b, m, deterministic) -} -func (dst *WorkMomentNotificationMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_WorkMomentNotificationMsg.Merge(dst, src) -} -func (m *WorkMomentNotificationMsg) XXX_Size() int { - return xxx_messageInfo_WorkMomentNotificationMsg.Size(m) -} -func (m *WorkMomentNotificationMsg) XXX_DiscardUnknown() { - xxx_messageInfo_WorkMomentNotificationMsg.DiscardUnknown(m) -} - -var xxx_messageInfo_WorkMomentNotificationMsg proto.InternalMessageInfo - -func (m *WorkMomentNotificationMsg) GetNotificationMsgType() int32 { - if m != nil { - return m.NotificationMsgType - } - return 0 -} - -func (m *WorkMomentNotificationMsg) GetComment() *Comment { - if m != nil { - return m.Comment - } - return nil -} - -func (m *WorkMomentNotificationMsg) GetWorkMomentID() string { - if m != nil { - return m.WorkMomentID - } - return "" -} - -func (m *WorkMomentNotificationMsg) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *WorkMomentNotificationMsg) GetUserName() string { - if m != nil { - return m.UserName - } - return "" -} - -func (m *WorkMomentNotificationMsg) GetFaceURL() string { - if m != nil { - return m.FaceURL - } - return "" -} - -func (m *WorkMomentNotificationMsg) GetWorkMomentContent() string { - if m != nil { - return m.WorkMomentContent - } - return "" -} - -type SetUserWorkMomentsLevelReq struct { - UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` - Level int32 `protobuf:"varint,2,opt,name=level" json:"level,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SetUserWorkMomentsLevelReq) Reset() { *m = SetUserWorkMomentsLevelReq{} } -func (m *SetUserWorkMomentsLevelReq) String() string { return proto.CompactTextString(m) } -func (*SetUserWorkMomentsLevelReq) ProtoMessage() {} -func (*SetUserWorkMomentsLevelReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{41} -} -func (m *SetUserWorkMomentsLevelReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SetUserWorkMomentsLevelReq.Unmarshal(m, b) -} -func (m *SetUserWorkMomentsLevelReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SetUserWorkMomentsLevelReq.Marshal(b, m, deterministic) -} -func (dst *SetUserWorkMomentsLevelReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetUserWorkMomentsLevelReq.Merge(dst, src) -} -func (m *SetUserWorkMomentsLevelReq) XXX_Size() int { - return xxx_messageInfo_SetUserWorkMomentsLevelReq.Size(m) -} -func (m *SetUserWorkMomentsLevelReq) XXX_DiscardUnknown() { - xxx_messageInfo_SetUserWorkMomentsLevelReq.DiscardUnknown(m) -} - -var xxx_messageInfo_SetUserWorkMomentsLevelReq proto.InternalMessageInfo - -func (m *SetUserWorkMomentsLevelReq) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *SetUserWorkMomentsLevelReq) GetLevel() int32 { - if m != nil { - return m.Level - } - return 0 -} - -func (m *SetUserWorkMomentsLevelReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type SetUserWorkMomentsLevelResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SetUserWorkMomentsLevelResp) Reset() { *m = SetUserWorkMomentsLevelResp{} } -func (m *SetUserWorkMomentsLevelResp) String() string { return proto.CompactTextString(m) } -func (*SetUserWorkMomentsLevelResp) ProtoMessage() {} -func (*SetUserWorkMomentsLevelResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_02f43b66ea327245, []int{42} -} -func (m *SetUserWorkMomentsLevelResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SetUserWorkMomentsLevelResp.Unmarshal(m, b) -} -func (m *SetUserWorkMomentsLevelResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SetUserWorkMomentsLevelResp.Marshal(b, m, deterministic) -} -func (dst *SetUserWorkMomentsLevelResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetUserWorkMomentsLevelResp.Merge(dst, src) -} -func (m *SetUserWorkMomentsLevelResp) XXX_Size() int { - return xxx_messageInfo_SetUserWorkMomentsLevelResp.Size(m) -} -func (m *SetUserWorkMomentsLevelResp) XXX_DiscardUnknown() { - xxx_messageInfo_SetUserWorkMomentsLevelResp.DiscardUnknown(m) -} - -var xxx_messageInfo_SetUserWorkMomentsLevelResp proto.InternalMessageInfo - -func (m *SetUserWorkMomentsLevelResp) GetCommonResp() *CommonResp { - if m != nil { - return m.CommonResp - } - return nil -} - -func init() { - proto.RegisterType((*CommonResp)(nil), "office.CommonResp") - proto.RegisterType((*TagUser)(nil), "office.TagUser") - proto.RegisterType((*Tag)(nil), "office.Tag") - proto.RegisterType((*GetUserTagsReq)(nil), "office.GetUserTagsReq") - proto.RegisterType((*GetUserTagsResp)(nil), "office.GetUserTagsResp") - proto.RegisterType((*CreateTagReq)(nil), "office.CreateTagReq") - proto.RegisterType((*CreateTagResp)(nil), "office.CreateTagResp") - proto.RegisterType((*DeleteTagReq)(nil), "office.DeleteTagReq") - proto.RegisterType((*DeleteTagResp)(nil), "office.DeleteTagResp") - proto.RegisterType((*SetTagReq)(nil), "office.SetTagReq") - proto.RegisterType((*SetTagResp)(nil), "office.SetTagResp") - proto.RegisterType((*SendMsg2TagReq)(nil), "office.SendMsg2TagReq") - proto.RegisterType((*SendMsg2TagResp)(nil), "office.SendMsg2TagResp") - proto.RegisterType((*GetTagSendLogsReq)(nil), "office.GetTagSendLogsReq") - proto.RegisterType((*TagSendLog)(nil), "office.TagSendLog") - proto.RegisterType((*GetTagSendLogsResp)(nil), "office.GetTagSendLogsResp") - proto.RegisterType((*GetUserTagByIDReq)(nil), "office.GetUserTagByIDReq") - proto.RegisterType((*GetUserTagByIDResp)(nil), "office.GetUserTagByIDResp") - proto.RegisterType((*LikeUser)(nil), "office.LikeUser") - proto.RegisterType((*NotificationUser)(nil), "office.NotificationUser") - proto.RegisterType((*Comment)(nil), "office.Comment") - proto.RegisterType((*PermissionGroup)(nil), "office.PermissionGroup") - proto.RegisterType((*WorkMomentUser)(nil), "office.WorkMomentUser") - proto.RegisterType((*WorkMoment)(nil), "office.WorkMoment") - proto.RegisterType((*CreateOneWorkMomentReq)(nil), "office.CreateOneWorkMomentReq") - proto.RegisterType((*CreateOneWorkMomentResp)(nil), "office.CreateOneWorkMomentResp") - proto.RegisterType((*DeleteOneWorkMomentReq)(nil), "office.DeleteOneWorkMomentReq") - proto.RegisterType((*DeleteOneWorkMomentResp)(nil), "office.DeleteOneWorkMomentResp") - proto.RegisterType((*LikeOneWorkMomentReq)(nil), "office.LikeOneWorkMomentReq") - proto.RegisterType((*LikeOneWorkMomentResp)(nil), "office.LikeOneWorkMomentResp") - proto.RegisterType((*CommentOneWorkMomentReq)(nil), "office.CommentOneWorkMomentReq") - proto.RegisterType((*CommentOneWorkMomentResp)(nil), "office.CommentOneWorkMomentResp") - proto.RegisterType((*GetWorkMomentByIDReq)(nil), "office.GetWorkMomentByIDReq") - proto.RegisterType((*GetWorkMomentByIDResp)(nil), "office.GetWorkMomentByIDResp") - proto.RegisterType((*ChangeWorkMomentPermissionReq)(nil), "office.ChangeWorkMomentPermissionReq") - proto.RegisterType((*ChangeWorkMomentPermissionResp)(nil), "office.ChangeWorkMomentPermissionResp") - proto.RegisterType((*GetUserWorkMomentsReq)(nil), "office.GetUserWorkMomentsReq") - proto.RegisterType((*GetUserWorkMomentsResp)(nil), "office.GetUserWorkMomentsResp") - proto.RegisterType((*GetUserFriendWorkMomentsReq)(nil), "office.GetUserFriendWorkMomentsReq") - proto.RegisterType((*GetUserFriendWorkMomentsResp)(nil), "office.GetUserFriendWorkMomentsResp") - proto.RegisterType((*WorkMomentNotificationMsg)(nil), "office.WorkMomentNotificationMsg") - proto.RegisterType((*SetUserWorkMomentsLevelReq)(nil), "office.SetUserWorkMomentsLevelReq") - proto.RegisterType((*SetUserWorkMomentsLevelResp)(nil), "office.SetUserWorkMomentsLevelResp") -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// Client API for OfficeService service - -type OfficeServiceClient interface { - GetUserTags(ctx context.Context, in *GetUserTagsReq, opts ...grpc.CallOption) (*GetUserTagsResp, error) - CreateTag(ctx context.Context, in *CreateTagReq, opts ...grpc.CallOption) (*CreateTagResp, error) - DeleteTag(ctx context.Context, in *DeleteTagReq, opts ...grpc.CallOption) (*DeleteTagResp, error) - SetTag(ctx context.Context, in *SetTagReq, opts ...grpc.CallOption) (*SetTagResp, error) - SendMsg2Tag(ctx context.Context, in *SendMsg2TagReq, opts ...grpc.CallOption) (*SendMsg2TagResp, error) - GetTagSendLogs(ctx context.Context, in *GetTagSendLogsReq, opts ...grpc.CallOption) (*GetTagSendLogsResp, error) - GetUserTagByID(ctx context.Context, in *GetUserTagByIDReq, opts ...grpc.CallOption) (*GetUserTagByIDResp, error) - CreateOneWorkMoment(ctx context.Context, in *CreateOneWorkMomentReq, opts ...grpc.CallOption) (*CreateOneWorkMomentResp, error) - DeleteOneWorkMoment(ctx context.Context, in *DeleteOneWorkMomentReq, opts ...grpc.CallOption) (*DeleteOneWorkMomentResp, error) - LikeOneWorkMoment(ctx context.Context, in *LikeOneWorkMomentReq, opts ...grpc.CallOption) (*LikeOneWorkMomentResp, error) - CommentOneWorkMoment(ctx context.Context, in *CommentOneWorkMomentReq, opts ...grpc.CallOption) (*CommentOneWorkMomentResp, error) - GetWorkMomentByID(ctx context.Context, in *GetWorkMomentByIDReq, opts ...grpc.CallOption) (*GetWorkMomentByIDResp, error) - ChangeWorkMomentPermission(ctx context.Context, in *ChangeWorkMomentPermissionReq, opts ...grpc.CallOption) (*ChangeWorkMomentPermissionResp, error) - // / user self - GetUserWorkMoments(ctx context.Context, in *GetUserWorkMomentsReq, opts ...grpc.CallOption) (*GetUserWorkMomentsResp, error) - // / users friend - GetUserFriendWorkMoments(ctx context.Context, in *GetUserFriendWorkMomentsReq, opts ...grpc.CallOption) (*GetUserFriendWorkMomentsResp, error) - SetUserWorkMomentsLevel(ctx context.Context, in *SetUserWorkMomentsLevelReq, opts ...grpc.CallOption) (*SetUserWorkMomentsLevelResp, error) -} - -type officeServiceClient struct { - cc *grpc.ClientConn -} - -func NewOfficeServiceClient(cc *grpc.ClientConn) OfficeServiceClient { - return &officeServiceClient{cc} -} - -func (c *officeServiceClient) GetUserTags(ctx context.Context, in *GetUserTagsReq, opts ...grpc.CallOption) (*GetUserTagsResp, error) { - out := new(GetUserTagsResp) - err := grpc.Invoke(ctx, "/office.OfficeService/GetUserTags", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *officeServiceClient) CreateTag(ctx context.Context, in *CreateTagReq, opts ...grpc.CallOption) (*CreateTagResp, error) { - out := new(CreateTagResp) - err := grpc.Invoke(ctx, "/office.OfficeService/CreateTag", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *officeServiceClient) DeleteTag(ctx context.Context, in *DeleteTagReq, opts ...grpc.CallOption) (*DeleteTagResp, error) { - out := new(DeleteTagResp) - err := grpc.Invoke(ctx, "/office.OfficeService/DeleteTag", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *officeServiceClient) SetTag(ctx context.Context, in *SetTagReq, opts ...grpc.CallOption) (*SetTagResp, error) { - out := new(SetTagResp) - err := grpc.Invoke(ctx, "/office.OfficeService/SetTag", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *officeServiceClient) SendMsg2Tag(ctx context.Context, in *SendMsg2TagReq, opts ...grpc.CallOption) (*SendMsg2TagResp, error) { - out := new(SendMsg2TagResp) - err := grpc.Invoke(ctx, "/office.OfficeService/SendMsg2Tag", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *officeServiceClient) GetTagSendLogs(ctx context.Context, in *GetTagSendLogsReq, opts ...grpc.CallOption) (*GetTagSendLogsResp, error) { - out := new(GetTagSendLogsResp) - err := grpc.Invoke(ctx, "/office.OfficeService/GetTagSendLogs", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *officeServiceClient) GetUserTagByID(ctx context.Context, in *GetUserTagByIDReq, opts ...grpc.CallOption) (*GetUserTagByIDResp, error) { - out := new(GetUserTagByIDResp) - err := grpc.Invoke(ctx, "/office.OfficeService/GetUserTagByID", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *officeServiceClient) CreateOneWorkMoment(ctx context.Context, in *CreateOneWorkMomentReq, opts ...grpc.CallOption) (*CreateOneWorkMomentResp, error) { - out := new(CreateOneWorkMomentResp) - err := grpc.Invoke(ctx, "/office.OfficeService/CreateOneWorkMoment", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *officeServiceClient) DeleteOneWorkMoment(ctx context.Context, in *DeleteOneWorkMomentReq, opts ...grpc.CallOption) (*DeleteOneWorkMomentResp, error) { - out := new(DeleteOneWorkMomentResp) - err := grpc.Invoke(ctx, "/office.OfficeService/DeleteOneWorkMoment", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *officeServiceClient) LikeOneWorkMoment(ctx context.Context, in *LikeOneWorkMomentReq, opts ...grpc.CallOption) (*LikeOneWorkMomentResp, error) { - out := new(LikeOneWorkMomentResp) - err := grpc.Invoke(ctx, "/office.OfficeService/LikeOneWorkMoment", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *officeServiceClient) CommentOneWorkMoment(ctx context.Context, in *CommentOneWorkMomentReq, opts ...grpc.CallOption) (*CommentOneWorkMomentResp, error) { - out := new(CommentOneWorkMomentResp) - err := grpc.Invoke(ctx, "/office.OfficeService/CommentOneWorkMoment", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *officeServiceClient) GetWorkMomentByID(ctx context.Context, in *GetWorkMomentByIDReq, opts ...grpc.CallOption) (*GetWorkMomentByIDResp, error) { - out := new(GetWorkMomentByIDResp) - err := grpc.Invoke(ctx, "/office.OfficeService/GetWorkMomentByID", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *officeServiceClient) ChangeWorkMomentPermission(ctx context.Context, in *ChangeWorkMomentPermissionReq, opts ...grpc.CallOption) (*ChangeWorkMomentPermissionResp, error) { - out := new(ChangeWorkMomentPermissionResp) - err := grpc.Invoke(ctx, "/office.OfficeService/ChangeWorkMomentPermission", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *officeServiceClient) GetUserWorkMoments(ctx context.Context, in *GetUserWorkMomentsReq, opts ...grpc.CallOption) (*GetUserWorkMomentsResp, error) { - out := new(GetUserWorkMomentsResp) - err := grpc.Invoke(ctx, "/office.OfficeService/GetUserWorkMoments", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *officeServiceClient) GetUserFriendWorkMoments(ctx context.Context, in *GetUserFriendWorkMomentsReq, opts ...grpc.CallOption) (*GetUserFriendWorkMomentsResp, error) { - out := new(GetUserFriendWorkMomentsResp) - err := grpc.Invoke(ctx, "/office.OfficeService/GetUserFriendWorkMoments", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *officeServiceClient) SetUserWorkMomentsLevel(ctx context.Context, in *SetUserWorkMomentsLevelReq, opts ...grpc.CallOption) (*SetUserWorkMomentsLevelResp, error) { - out := new(SetUserWorkMomentsLevelResp) - err := grpc.Invoke(ctx, "/office.OfficeService/SetUserWorkMomentsLevel", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for OfficeService service - -type OfficeServiceServer interface { - GetUserTags(context.Context, *GetUserTagsReq) (*GetUserTagsResp, error) - CreateTag(context.Context, *CreateTagReq) (*CreateTagResp, error) - DeleteTag(context.Context, *DeleteTagReq) (*DeleteTagResp, error) - SetTag(context.Context, *SetTagReq) (*SetTagResp, error) - SendMsg2Tag(context.Context, *SendMsg2TagReq) (*SendMsg2TagResp, error) - GetTagSendLogs(context.Context, *GetTagSendLogsReq) (*GetTagSendLogsResp, error) - GetUserTagByID(context.Context, *GetUserTagByIDReq) (*GetUserTagByIDResp, error) - CreateOneWorkMoment(context.Context, *CreateOneWorkMomentReq) (*CreateOneWorkMomentResp, error) - DeleteOneWorkMoment(context.Context, *DeleteOneWorkMomentReq) (*DeleteOneWorkMomentResp, error) - LikeOneWorkMoment(context.Context, *LikeOneWorkMomentReq) (*LikeOneWorkMomentResp, error) - CommentOneWorkMoment(context.Context, *CommentOneWorkMomentReq) (*CommentOneWorkMomentResp, error) - GetWorkMomentByID(context.Context, *GetWorkMomentByIDReq) (*GetWorkMomentByIDResp, error) - ChangeWorkMomentPermission(context.Context, *ChangeWorkMomentPermissionReq) (*ChangeWorkMomentPermissionResp, error) - // / user self - GetUserWorkMoments(context.Context, *GetUserWorkMomentsReq) (*GetUserWorkMomentsResp, error) - // / users friend - GetUserFriendWorkMoments(context.Context, *GetUserFriendWorkMomentsReq) (*GetUserFriendWorkMomentsResp, error) - SetUserWorkMomentsLevel(context.Context, *SetUserWorkMomentsLevelReq) (*SetUserWorkMomentsLevelResp, error) -} - -func RegisterOfficeServiceServer(s *grpc.Server, srv OfficeServiceServer) { - s.RegisterService(&_OfficeService_serviceDesc, srv) -} - -func _OfficeService_GetUserTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetUserTagsReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OfficeServiceServer).GetUserTags(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/office.OfficeService/GetUserTags", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OfficeServiceServer).GetUserTags(ctx, req.(*GetUserTagsReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _OfficeService_CreateTag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateTagReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OfficeServiceServer).CreateTag(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/office.OfficeService/CreateTag", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OfficeServiceServer).CreateTag(ctx, req.(*CreateTagReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _OfficeService_DeleteTag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteTagReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OfficeServiceServer).DeleteTag(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/office.OfficeService/DeleteTag", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OfficeServiceServer).DeleteTag(ctx, req.(*DeleteTagReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _OfficeService_SetTag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetTagReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OfficeServiceServer).SetTag(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/office.OfficeService/SetTag", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OfficeServiceServer).SetTag(ctx, req.(*SetTagReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _OfficeService_SendMsg2Tag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendMsg2TagReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OfficeServiceServer).SendMsg2Tag(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/office.OfficeService/SendMsg2Tag", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OfficeServiceServer).SendMsg2Tag(ctx, req.(*SendMsg2TagReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _OfficeService_GetTagSendLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetTagSendLogsReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OfficeServiceServer).GetTagSendLogs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/office.OfficeService/GetTagSendLogs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OfficeServiceServer).GetTagSendLogs(ctx, req.(*GetTagSendLogsReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _OfficeService_GetUserTagByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetUserTagByIDReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OfficeServiceServer).GetUserTagByID(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/office.OfficeService/GetUserTagByID", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OfficeServiceServer).GetUserTagByID(ctx, req.(*GetUserTagByIDReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _OfficeService_CreateOneWorkMoment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateOneWorkMomentReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OfficeServiceServer).CreateOneWorkMoment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/office.OfficeService/CreateOneWorkMoment", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OfficeServiceServer).CreateOneWorkMoment(ctx, req.(*CreateOneWorkMomentReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _OfficeService_DeleteOneWorkMoment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteOneWorkMomentReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OfficeServiceServer).DeleteOneWorkMoment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/office.OfficeService/DeleteOneWorkMoment", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OfficeServiceServer).DeleteOneWorkMoment(ctx, req.(*DeleteOneWorkMomentReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _OfficeService_LikeOneWorkMoment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LikeOneWorkMomentReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OfficeServiceServer).LikeOneWorkMoment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/office.OfficeService/LikeOneWorkMoment", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OfficeServiceServer).LikeOneWorkMoment(ctx, req.(*LikeOneWorkMomentReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _OfficeService_CommentOneWorkMoment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CommentOneWorkMomentReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OfficeServiceServer).CommentOneWorkMoment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/office.OfficeService/CommentOneWorkMoment", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OfficeServiceServer).CommentOneWorkMoment(ctx, req.(*CommentOneWorkMomentReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _OfficeService_GetWorkMomentByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetWorkMomentByIDReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OfficeServiceServer).GetWorkMomentByID(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/office.OfficeService/GetWorkMomentByID", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OfficeServiceServer).GetWorkMomentByID(ctx, req.(*GetWorkMomentByIDReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _OfficeService_ChangeWorkMomentPermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChangeWorkMomentPermissionReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OfficeServiceServer).ChangeWorkMomentPermission(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/office.OfficeService/ChangeWorkMomentPermission", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OfficeServiceServer).ChangeWorkMomentPermission(ctx, req.(*ChangeWorkMomentPermissionReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _OfficeService_GetUserWorkMoments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetUserWorkMomentsReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OfficeServiceServer).GetUserWorkMoments(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/office.OfficeService/GetUserWorkMoments", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OfficeServiceServer).GetUserWorkMoments(ctx, req.(*GetUserWorkMomentsReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _OfficeService_GetUserFriendWorkMoments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetUserFriendWorkMomentsReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OfficeServiceServer).GetUserFriendWorkMoments(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/office.OfficeService/GetUserFriendWorkMoments", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OfficeServiceServer).GetUserFriendWorkMoments(ctx, req.(*GetUserFriendWorkMomentsReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _OfficeService_SetUserWorkMomentsLevel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetUserWorkMomentsLevelReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OfficeServiceServer).SetUserWorkMomentsLevel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/office.OfficeService/SetUserWorkMomentsLevel", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OfficeServiceServer).SetUserWorkMomentsLevel(ctx, req.(*SetUserWorkMomentsLevelReq)) - } - return interceptor(ctx, in, info, handler) -} - -var _OfficeService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "office.OfficeService", - HandlerType: (*OfficeServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetUserTags", - Handler: _OfficeService_GetUserTags_Handler, - }, - { - MethodName: "CreateTag", - Handler: _OfficeService_CreateTag_Handler, - }, - { - MethodName: "DeleteTag", - Handler: _OfficeService_DeleteTag_Handler, - }, - { - MethodName: "SetTag", - Handler: _OfficeService_SetTag_Handler, - }, - { - MethodName: "SendMsg2Tag", - Handler: _OfficeService_SendMsg2Tag_Handler, - }, - { - MethodName: "GetTagSendLogs", - Handler: _OfficeService_GetTagSendLogs_Handler, - }, - { - MethodName: "GetUserTagByID", - Handler: _OfficeService_GetUserTagByID_Handler, - }, - { - MethodName: "CreateOneWorkMoment", - Handler: _OfficeService_CreateOneWorkMoment_Handler, - }, - { - MethodName: "DeleteOneWorkMoment", - Handler: _OfficeService_DeleteOneWorkMoment_Handler, - }, - { - MethodName: "LikeOneWorkMoment", - Handler: _OfficeService_LikeOneWorkMoment_Handler, - }, - { - MethodName: "CommentOneWorkMoment", - Handler: _OfficeService_CommentOneWorkMoment_Handler, - }, - { - MethodName: "GetWorkMomentByID", - Handler: _OfficeService_GetWorkMomentByID_Handler, - }, - { - MethodName: "ChangeWorkMomentPermission", - Handler: _OfficeService_ChangeWorkMomentPermission_Handler, - }, - { - MethodName: "GetUserWorkMoments", - Handler: _OfficeService_GetUserWorkMoments_Handler, - }, - { - MethodName: "GetUserFriendWorkMoments", - Handler: _OfficeService_GetUserFriendWorkMoments_Handler, - }, - { - MethodName: "SetUserWorkMomentsLevel", - Handler: _OfficeService_SetUserWorkMomentsLevel_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "office/office.proto", -} - -func init() { proto.RegisterFile("office/office.proto", fileDescriptor_office_02f43b66ea327245) } - -var fileDescriptor_office_02f43b66ea327245 = []byte{ - // 1604 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x59, 0xcd, 0x6e, 0x1c, 0xc5, - 0x13, 0xd7, 0xec, 0xa7, 0xb7, 0xd6, 0x89, 0xe3, 0xb6, 0x63, 0x6f, 0x26, 0xb1, 0xe3, 0xff, 0x24, - 0xf9, 0x2b, 0x7c, 0xc8, 0x46, 0x4b, 0x84, 0x10, 0x88, 0x08, 0xc5, 0x9b, 0x58, 0x0b, 0xde, 0xc4, - 0x8c, 0x6d, 0x22, 0x38, 0x60, 0x4d, 0xd6, 0xed, 0x61, 0xe4, 0xdd, 0x99, 0xc9, 0xf4, 0xd8, 0x26, - 0x27, 0xa4, 0x9c, 0xb9, 0x71, 0x80, 0x0b, 0x4f, 0xc1, 0x33, 0x70, 0xe0, 0x84, 0x38, 0xf0, 0x06, - 0xbc, 0x03, 0x57, 0xd4, 0x3d, 0x33, 0xfd, 0x31, 0x1f, 0xbb, 0x9b, 0x01, 0x24, 0x38, 0x79, 0xab, - 0xbb, 0xba, 0xba, 0xea, 0xd7, 0xd5, 0xbf, 0xae, 0x29, 0xc3, 0x92, 0x77, 0x72, 0xe2, 0x0c, 0xf1, - 0x56, 0xf4, 0x67, 0xd3, 0x0f, 0xbc, 0xd0, 0x43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, 0xb7, 0xa9, 0x16, 0x9f, 0x58, 0x4d, 0x3d, 0x31, 0x09, 0xcb, 0xba, 0x8a, 0xe5, 0x7b, 0x30, - 0x3f, 0x8a, 0xb3, 0x95, 0x51, 0x55, 0x83, 0x5d, 0xd9, 0x95, 0x24, 0xab, 0xd5, 0xe0, 0x4d, 0x45, - 0x97, 0x52, 0xdc, 0x30, 0x4a, 0x30, 0xd2, 0x69, 0xaa, 0x14, 0x17, 0x27, 0x9e, 0xc9, 0x15, 0xe8, - 0xa1, 0xf9, 0xfc, 0x50, 0x92, 0x43, 0x13, 0x23, 0xe8, 0x11, 0x20, 0x21, 0x71, 0x77, 0x5a, 0x13, - 0xdd, 0xc9, 0x59, 0x81, 0xfa, 0xb0, 0xe4, 0xab, 0x87, 0xcf, 0x0c, 0x01, 0x33, 0xb4, 0x9a, 0x18, - 0x4a, 0xe5, 0x87, 0x99, 0xb7, 0x06, 0xbd, 0x03, 0x60, 0x85, 0xdc, 0x95, 0xf6, 0x44, 0x57, 0x24, - 0xcd, 0x54, 0x7e, 0xce, 0x67, 0xf2, 0xd3, 0x85, 0x95, 0xa8, 0xd8, 0x7b, 0xe2, 0x62, 0x61, 0x86, - 0x92, 0x5e, 0x17, 0x40, 0x64, 0x41, 0x9a, 0x8e, 0x24, 0x55, 0x49, 0x6b, 0x86, 0x4a, 0x7a, 0x00, - 0xab, 0xb9, 0xfb, 0x95, 0x7c, 0x7d, 0xcf, 0x61, 0x25, 0x2a, 0x03, 0x33, 0xee, 0xff, 0x95, 0xc4, - 0x9e, 0xce, 0xe0, 0x03, 0x58, 0xcd, 0xdd, 0xb7, 0x64, 0x18, 0x21, 0x2c, 0x53, 0x9e, 0xce, 0x04, - 0x51, 0x74, 0xc1, 0x0d, 0x98, 0x7f, 0x2a, 0x07, 0x17, 0xb9, 0xaf, 0x8c, 0xcd, 0x10, 0xc4, 0xc7, - 0x70, 0x35, 0x67, 0xd7, 0x92, 0x21, 0xfc, 0xa8, 0xc1, 0x6a,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, 0x76, 0x7b, 0x3f, 0xfa, 0xf3, - 0xac, 0xc1, 0xfe, 0xa7, 0xf6, 0xf6, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x70, 0x91, 0x17, 0x98, - 0x95, 0x1b, 0x00, 0x00, -} diff --git a/pkg/proto/office/office.proto b/pkg/proto/office/office.proto index 63d04955a..04ead1788 100644 --- a/pkg/proto/office/office.proto +++ b/pkg/proto/office/office.proto @@ -220,8 +220,9 @@ message ChangeWorkMomentPermissionResp { message GetUserWorkMomentsReq { string userID = 1; - server_api_params.RequestPagination Pagination = 2; - string operationID = 3; + string opUserID = 2; + server_api_params.RequestPagination Pagination = 3; + string operationID = 4; } message GetUserWorkMomentsResp { @@ -244,12 +245,16 @@ message GetUserFriendWorkMomentsResp { message WorkMomentNotificationMsg { int32 notificationMsgType = 1; - Comment comment = 2; - string workMomentID = 3; - string userID = 4; - string userName = 5; - string faceURL = 6; - string workMomentContent = 7; + string replyUserName = 2; + string replyUserID = 3; + string content = 4; + string contentID = 5; + string workMomentID = 6; + string userID = 7; + string userName = 8; + string faceURL = 9; + string workMomentContent = 10; + int32 createTime = 11; } message SetUserWorkMomentsLevelReq { From 010f24e5c3cd091259ea59fbe59a4466003bce40 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Sun, 24 Apr 2022 17:46:47 +0800 Subject: [PATCH 12/51] work_moments --- pkg/common/db/mongoModel.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/common/db/mongoModel.go b/pkg/common/db/mongoModel.go index 14adb3057..6ff42d558 100644 --- a/pkg/common/db/mongoModel.go +++ b/pkg/common/db/mongoModel.go @@ -11,8 +11,6 @@ import ( "errors" "fmt" "github.com/gogo/protobuf/sortkeys" - "go.etcd.io/etcd/clientv3" - "go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/mongo/options" "math/rand" @@ -682,7 +680,7 @@ func (d *DataBases) GetUserWorkMoments(opUserID, userID string, showNumber, page result, err := c.Find(ctx, bson.D{ // 等价条件: select * from {"user_id", userID}, {"$or", bson.A{ - bson.D{{"permission", constant.WorkMomentPermissionCantSee}, {opUserID, bson.D{{"$in", "permission_user_id_list"}}}}, + bson.D{{"permission", constant.WorkMomentPermissionCantSee}, {opUserID, bson.D{{"$nin", "permission_user_id_list"}}}}, bson.D{{"permission", constant.WorkMomentPermissionCanSee}, {opUserID, bson.D{{"$in", "permission_user_id_list"}}}}, bson.D{{"permission", constant.WorkMomentPublic}}, }}, @@ -702,7 +700,7 @@ func (d *DataBases) GetUserFriendWorkMoments(friendIDList []*string, showNumber, result, err := c.Find(ctx, bson.D{ // 等价条件: select * from t where user_id in friend_id_list and () or () or (); {"user_id", bson.D{{"$in", friendIDList}}}, {"$or", bson.A{ - bson.D{{"permission", constant.WorkMomentPermissionCantSee}, {userID, bson.D{{"$in", "permission_user_id_list"}}}}, + bson.D{{"permission", constant.WorkMomentPermissionCantSee}, {userID, bson.D{{"$nin", "permission_user_id_list"}}}}, bson.D{{"permission", constant.WorkMomentPermissionCanSee}, {userID, bson.D{{"$in", "permission_user_id_list"}}}}, bson.D{{"permission", constant.WorkMomentPublic}}, }}, From 318eb2f47d3d96d01a4da71c8a1319a5a6a21147 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Sun, 24 Apr 2022 17:54:02 +0800 Subject: [PATCH 13/51] shell update --- config/config.yaml | 4 ++-- script/check_all.sh | 4 ++-- script/msg_gateway_start.sh | 2 +- script/start_rpc_service.sh | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 445357150..aab4e1737 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -113,8 +113,8 @@ credential: #腾讯cos,发送图片、视频、文件时需要,请自行申 rpcport: #rpc服务端口 默认即可 openImUserPort: [ 10100 ] openImFriendPort: [ 10200 ] - openImOfflineMessagePort: [ 10300 ] - openImOnlineRelayPort: [ 10400 ] + openImMessagePort: [ 10300 ] + openImMessageGatewayPort: [ 10400 ] openImGroupPort: [ 10500 ] openImAuthPort: [ 10600 ] openImPushPort: [ 10700 ] diff --git a/script/check_all.sh b/script/check_all.sh index 0e828fd54..2ecd800b0 100644 --- a/script/check_all.sh +++ b/script/check_all.sh @@ -8,8 +8,8 @@ service_port_name=( openImApiPort openImUserPort openImFriendPort - openImOfflineMessagePort - openImOnlineRelayPort + openImMessagePort + openImMessageGatewayPort openImGroupPort openImAuthPort openImPushPort diff --git a/script/msg_gateway_start.sh b/script/msg_gateway_start.sh index 7c107f16a..d61edf692 100644 --- a/script/msg_gateway_start.sh +++ b/script/msg_gateway_start.sh @@ -5,7 +5,7 @@ source ./path_info.cfg source ./function.sh ulimit -n 200000 -list1=$(cat $config_path | grep openImOnlineRelayPort | awk -F '[:]' '{print $NF}') +list1=$(cat $config_path | grep openImMessageGatewayPort | awk -F '[:]' '{print $NF}') list2=$(cat $config_path | grep openImWsPort | awk -F '[:]' '{print $NF}') list_to_string $list1 rpc_ports=($ports_array) diff --git a/script/start_rpc_service.sh b/script/start_rpc_service.sh index 2e249bbc1..6e60bcdcd 100644 --- a/script/start_rpc_service.sh +++ b/script/start_rpc_service.sh @@ -36,7 +36,7 @@ service_port_name=( openImAdminCmsPort openImMessageCmsPort openImStatisticsPort - openImOfflineMessagePort + openImMessagePort openImOfficePort openImOrganizationPort openImConversationPort From 1b968903e2df23e917472cd2eb306f3e2b113ea9 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Sun, 24 Apr 2022 18:00:04 +0800 Subject: [PATCH 14/51] work_moments --- internal/api/office/work_moments.go | 5 +++-- pkg/base_info/work_moments_struct.go | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/api/office/work_moments.go b/internal/api/office/work_moments.go index fcea9a1a0..267bc7e3b 100644 --- a/internal/api/office/work_moments.go +++ b/internal/api/office/work_moments.go @@ -223,7 +223,7 @@ func GetUserWorkMoments(c *gin.Context) { return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) - ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + ok, opUserID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) if !ok { log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) @@ -234,7 +234,8 @@ func GetUserWorkMoments(c *gin.Context) { PageNumber: req.PageNumber, ShowNumber: req.ShowNumber, } - reqPb.UserID = userID + reqPb.OpUserID = opUserID + reqPb.UserID = req.UserID etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.GetUserWorkMoments(context.Background(), &reqPb) diff --git a/pkg/base_info/work_moments_struct.go b/pkg/base_info/work_moments_struct.go index 9ed09a832..d27493261 100644 --- a/pkg/base_info/work_moments_struct.go +++ b/pkg/base_info/work_moments_struct.go @@ -80,6 +80,7 @@ type GetWorkMomentByIDResp struct { type GetUserWorkMomentsReq struct { WorkMomentsUserCommonReq + UserID string `json:"userID"` } type GetUserWorkMomentsResp struct { From 03b35721a26de3bcea36a19e2807e8f3164befaa Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Sun, 24 Apr 2022 18:01:27 +0800 Subject: [PATCH 15/51] work_moments --- pkg/proto/office/office.pb.go | 3104 +++++++++++++++++++++++++++++++++ 1 file changed, 3104 insertions(+) create mode 100644 pkg/proto/office/office.pb.go diff --git a/pkg/proto/office/office.pb.go b/pkg/proto/office/office.pb.go new file mode 100644 index 000000000..3c5ff4bf5 --- /dev/null +++ b/pkg/proto/office/office.pb.go @@ -0,0 +1,3104 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: office/office.proto + +package office // import "./office" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import sdk_ws "Open_IM/pkg/proto/sdk_ws" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type CommonResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CommonResp) Reset() { *m = CommonResp{} } +func (m *CommonResp) String() string { return proto.CompactTextString(m) } +func (*CommonResp) ProtoMessage() {} +func (*CommonResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{0} +} +func (m *CommonResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommonResp.Unmarshal(m, b) +} +func (m *CommonResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommonResp.Marshal(b, m, deterministic) +} +func (dst *CommonResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommonResp.Merge(dst, src) +} +func (m *CommonResp) XXX_Size() int { + return xxx_messageInfo_CommonResp.Size(m) +} +func (m *CommonResp) XXX_DiscardUnknown() { + xxx_messageInfo_CommonResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CommonResp proto.InternalMessageInfo + +func (m *CommonResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *CommonResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type TagUser struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + UserName string `protobuf:"bytes,2,opt,name=userName" json:"userName,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TagUser) Reset() { *m = TagUser{} } +func (m *TagUser) String() string { return proto.CompactTextString(m) } +func (*TagUser) ProtoMessage() {} +func (*TagUser) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{1} +} +func (m *TagUser) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TagUser.Unmarshal(m, b) +} +func (m *TagUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TagUser.Marshal(b, m, deterministic) +} +func (dst *TagUser) XXX_Merge(src proto.Message) { + xxx_messageInfo_TagUser.Merge(dst, src) +} +func (m *TagUser) XXX_Size() int { + return xxx_messageInfo_TagUser.Size(m) +} +func (m *TagUser) XXX_DiscardUnknown() { + xxx_messageInfo_TagUser.DiscardUnknown(m) +} + +var xxx_messageInfo_TagUser proto.InternalMessageInfo + +func (m *TagUser) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *TagUser) GetUserName() string { + if m != nil { + return m.UserName + } + return "" +} + +type Tag struct { + TagID string `protobuf:"bytes,1,opt,name=tagID" json:"tagID,omitempty"` + TagName string `protobuf:"bytes,2,opt,name=tagName" json:"tagName,omitempty"` + UserList []*TagUser `protobuf:"bytes,3,rep,name=userList" json:"userList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Tag) Reset() { *m = Tag{} } +func (m *Tag) String() string { return proto.CompactTextString(m) } +func (*Tag) ProtoMessage() {} +func (*Tag) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{2} +} +func (m *Tag) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Tag.Unmarshal(m, b) +} +func (m *Tag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Tag.Marshal(b, m, deterministic) +} +func (dst *Tag) XXX_Merge(src proto.Message) { + xxx_messageInfo_Tag.Merge(dst, src) +} +func (m *Tag) XXX_Size() int { + return xxx_messageInfo_Tag.Size(m) +} +func (m *Tag) XXX_DiscardUnknown() { + xxx_messageInfo_Tag.DiscardUnknown(m) +} + +var xxx_messageInfo_Tag proto.InternalMessageInfo + +func (m *Tag) GetTagID() string { + if m != nil { + return m.TagID + } + return "" +} + +func (m *Tag) GetTagName() string { + if m != nil { + return m.TagName + } + return "" +} + +func (m *Tag) GetUserList() []*TagUser { + if m != nil { + return m.UserList + } + return nil +} + +type GetUserTagsReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserTagsReq) Reset() { *m = GetUserTagsReq{} } +func (m *GetUserTagsReq) String() string { return proto.CompactTextString(m) } +func (*GetUserTagsReq) ProtoMessage() {} +func (*GetUserTagsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{3} +} +func (m *GetUserTagsReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserTagsReq.Unmarshal(m, b) +} +func (m *GetUserTagsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserTagsReq.Marshal(b, m, deterministic) +} +func (dst *GetUserTagsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserTagsReq.Merge(dst, src) +} +func (m *GetUserTagsReq) XXX_Size() int { + return xxx_messageInfo_GetUserTagsReq.Size(m) +} +func (m *GetUserTagsReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserTagsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserTagsReq proto.InternalMessageInfo + +func (m *GetUserTagsReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetUserTagsReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetUserTagsResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + Tags []*Tag `protobuf:"bytes,2,rep,name=tags" json:"tags,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserTagsResp) Reset() { *m = GetUserTagsResp{} } +func (m *GetUserTagsResp) String() string { return proto.CompactTextString(m) } +func (*GetUserTagsResp) ProtoMessage() {} +func (*GetUserTagsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{4} +} +func (m *GetUserTagsResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserTagsResp.Unmarshal(m, b) +} +func (m *GetUserTagsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserTagsResp.Marshal(b, m, deterministic) +} +func (dst *GetUserTagsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserTagsResp.Merge(dst, src) +} +func (m *GetUserTagsResp) XXX_Size() int { + return xxx_messageInfo_GetUserTagsResp.Size(m) +} +func (m *GetUserTagsResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserTagsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserTagsResp proto.InternalMessageInfo + +func (m *GetUserTagsResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetUserTagsResp) GetTags() []*Tag { + if m != nil { + return m.Tags + } + return nil +} + +type CreateTagReq struct { + TagName string `protobuf:"bytes,1,opt,name=tagName" json:"tagName,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + UserIDList []string `protobuf:"bytes,3,rep,name=userIDList" json:"userIDList,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateTagReq) Reset() { *m = CreateTagReq{} } +func (m *CreateTagReq) String() string { return proto.CompactTextString(m) } +func (*CreateTagReq) ProtoMessage() {} +func (*CreateTagReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{5} +} +func (m *CreateTagReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateTagReq.Unmarshal(m, b) +} +func (m *CreateTagReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateTagReq.Marshal(b, m, deterministic) +} +func (dst *CreateTagReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateTagReq.Merge(dst, src) +} +func (m *CreateTagReq) XXX_Size() int { + return xxx_messageInfo_CreateTagReq.Size(m) +} +func (m *CreateTagReq) XXX_DiscardUnknown() { + xxx_messageInfo_CreateTagReq.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateTagReq proto.InternalMessageInfo + +func (m *CreateTagReq) GetTagName() string { + if m != nil { + return m.TagName + } + return "" +} + +func (m *CreateTagReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *CreateTagReq) GetUserIDList() []string { + if m != nil { + return m.UserIDList + } + return nil +} + +func (m *CreateTagReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type CreateTagResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateTagResp) Reset() { *m = CreateTagResp{} } +func (m *CreateTagResp) String() string { return proto.CompactTextString(m) } +func (*CreateTagResp) ProtoMessage() {} +func (*CreateTagResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{6} +} +func (m *CreateTagResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateTagResp.Unmarshal(m, b) +} +func (m *CreateTagResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateTagResp.Marshal(b, m, deterministic) +} +func (dst *CreateTagResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateTagResp.Merge(dst, src) +} +func (m *CreateTagResp) XXX_Size() int { + return xxx_messageInfo_CreateTagResp.Size(m) +} +func (m *CreateTagResp) XXX_DiscardUnknown() { + xxx_messageInfo_CreateTagResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateTagResp proto.InternalMessageInfo + +func (m *CreateTagResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type DeleteTagReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + TagID string `protobuf:"bytes,2,opt,name=tagID" json:"tagID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteTagReq) Reset() { *m = DeleteTagReq{} } +func (m *DeleteTagReq) String() string { return proto.CompactTextString(m) } +func (*DeleteTagReq) ProtoMessage() {} +func (*DeleteTagReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{7} +} +func (m *DeleteTagReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteTagReq.Unmarshal(m, b) +} +func (m *DeleteTagReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteTagReq.Marshal(b, m, deterministic) +} +func (dst *DeleteTagReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteTagReq.Merge(dst, src) +} +func (m *DeleteTagReq) XXX_Size() int { + return xxx_messageInfo_DeleteTagReq.Size(m) +} +func (m *DeleteTagReq) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteTagReq.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteTagReq proto.InternalMessageInfo + +func (m *DeleteTagReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *DeleteTagReq) GetTagID() string { + if m != nil { + return m.TagID + } + return "" +} + +func (m *DeleteTagReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type DeleteTagResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteTagResp) Reset() { *m = DeleteTagResp{} } +func (m *DeleteTagResp) String() string { return proto.CompactTextString(m) } +func (*DeleteTagResp) ProtoMessage() {} +func (*DeleteTagResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{8} +} +func (m *DeleteTagResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteTagResp.Unmarshal(m, b) +} +func (m *DeleteTagResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteTagResp.Marshal(b, m, deterministic) +} +func (dst *DeleteTagResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteTagResp.Merge(dst, src) +} +func (m *DeleteTagResp) XXX_Size() int { + return xxx_messageInfo_DeleteTagResp.Size(m) +} +func (m *DeleteTagResp) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteTagResp.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteTagResp proto.InternalMessageInfo + +func (m *DeleteTagResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type SetTagReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + TagID string `protobuf:"bytes,2,opt,name=tagID" json:"tagID,omitempty"` + NewName string `protobuf:"bytes,3,opt,name=newName" json:"newName,omitempty"` + IncreaseUserIDList []string `protobuf:"bytes,4,rep,name=increaseUserIDList" json:"increaseUserIDList,omitempty"` + ReduceUserIDList []string `protobuf:"bytes,5,rep,name=reduceUserIDList" json:"reduceUserIDList,omitempty"` + OperationID string `protobuf:"bytes,6,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetTagReq) Reset() { *m = SetTagReq{} } +func (m *SetTagReq) String() string { return proto.CompactTextString(m) } +func (*SetTagReq) ProtoMessage() {} +func (*SetTagReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{9} +} +func (m *SetTagReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetTagReq.Unmarshal(m, b) +} +func (m *SetTagReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetTagReq.Marshal(b, m, deterministic) +} +func (dst *SetTagReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetTagReq.Merge(dst, src) +} +func (m *SetTagReq) XXX_Size() int { + return xxx_messageInfo_SetTagReq.Size(m) +} +func (m *SetTagReq) XXX_DiscardUnknown() { + xxx_messageInfo_SetTagReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SetTagReq proto.InternalMessageInfo + +func (m *SetTagReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *SetTagReq) GetTagID() string { + if m != nil { + return m.TagID + } + return "" +} + +func (m *SetTagReq) GetNewName() string { + if m != nil { + return m.NewName + } + return "" +} + +func (m *SetTagReq) GetIncreaseUserIDList() []string { + if m != nil { + return m.IncreaseUserIDList + } + return nil +} + +func (m *SetTagReq) GetReduceUserIDList() []string { + if m != nil { + return m.ReduceUserIDList + } + return nil +} + +func (m *SetTagReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type SetTagResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetTagResp) Reset() { *m = SetTagResp{} } +func (m *SetTagResp) String() string { return proto.CompactTextString(m) } +func (*SetTagResp) ProtoMessage() {} +func (*SetTagResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{10} +} +func (m *SetTagResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetTagResp.Unmarshal(m, b) +} +func (m *SetTagResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetTagResp.Marshal(b, m, deterministic) +} +func (dst *SetTagResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetTagResp.Merge(dst, src) +} +func (m *SetTagResp) XXX_Size() int { + return xxx_messageInfo_SetTagResp.Size(m) +} +func (m *SetTagResp) XXX_DiscardUnknown() { + xxx_messageInfo_SetTagResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SetTagResp proto.InternalMessageInfo + +func (m *SetTagResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type SendMsg2TagReq struct { + TagList []string `protobuf:"bytes,1,rep,name=tagList" json:"tagList,omitempty"` + UserList []string `protobuf:"bytes,2,rep,name=UserList" json:"UserList,omitempty"` + GroupList []string `protobuf:"bytes,3,rep,name=GroupList" json:"GroupList,omitempty"` + SendID string `protobuf:"bytes,4,opt,name=sendID" json:"sendID,omitempty"` + SenderPlatformID int32 `protobuf:"varint,5,opt,name=senderPlatformID" json:"senderPlatformID,omitempty"` + Content string `protobuf:"bytes,6,opt,name=content" json:"content,omitempty"` + OperationID string `protobuf:"bytes,7,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SendMsg2TagReq) Reset() { *m = SendMsg2TagReq{} } +func (m *SendMsg2TagReq) String() string { return proto.CompactTextString(m) } +func (*SendMsg2TagReq) ProtoMessage() {} +func (*SendMsg2TagReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{11} +} +func (m *SendMsg2TagReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SendMsg2TagReq.Unmarshal(m, b) +} +func (m *SendMsg2TagReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SendMsg2TagReq.Marshal(b, m, deterministic) +} +func (dst *SendMsg2TagReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SendMsg2TagReq.Merge(dst, src) +} +func (m *SendMsg2TagReq) XXX_Size() int { + return xxx_messageInfo_SendMsg2TagReq.Size(m) +} +func (m *SendMsg2TagReq) XXX_DiscardUnknown() { + xxx_messageInfo_SendMsg2TagReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SendMsg2TagReq proto.InternalMessageInfo + +func (m *SendMsg2TagReq) GetTagList() []string { + if m != nil { + return m.TagList + } + return nil +} + +func (m *SendMsg2TagReq) GetUserList() []string { + if m != nil { + return m.UserList + } + return nil +} + +func (m *SendMsg2TagReq) GetGroupList() []string { + if m != nil { + return m.GroupList + } + return nil +} + +func (m *SendMsg2TagReq) GetSendID() string { + if m != nil { + return m.SendID + } + return "" +} + +func (m *SendMsg2TagReq) GetSenderPlatformID() int32 { + if m != nil { + return m.SenderPlatformID + } + return 0 +} + +func (m *SendMsg2TagReq) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *SendMsg2TagReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type SendMsg2TagResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SendMsg2TagResp) Reset() { *m = SendMsg2TagResp{} } +func (m *SendMsg2TagResp) String() string { return proto.CompactTextString(m) } +func (*SendMsg2TagResp) ProtoMessage() {} +func (*SendMsg2TagResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{12} +} +func (m *SendMsg2TagResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SendMsg2TagResp.Unmarshal(m, b) +} +func (m *SendMsg2TagResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SendMsg2TagResp.Marshal(b, m, deterministic) +} +func (dst *SendMsg2TagResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SendMsg2TagResp.Merge(dst, src) +} +func (m *SendMsg2TagResp) XXX_Size() int { + return xxx_messageInfo_SendMsg2TagResp.Size(m) +} +func (m *SendMsg2TagResp) XXX_DiscardUnknown() { + xxx_messageInfo_SendMsg2TagResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SendMsg2TagResp proto.InternalMessageInfo + +func (m *SendMsg2TagResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type GetTagSendLogsReq struct { + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,1,opt,name=Pagination" json:"Pagination,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetTagSendLogsReq) Reset() { *m = GetTagSendLogsReq{} } +func (m *GetTagSendLogsReq) String() string { return proto.CompactTextString(m) } +func (*GetTagSendLogsReq) ProtoMessage() {} +func (*GetTagSendLogsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{13} +} +func (m *GetTagSendLogsReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetTagSendLogsReq.Unmarshal(m, b) +} +func (m *GetTagSendLogsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetTagSendLogsReq.Marshal(b, m, deterministic) +} +func (dst *GetTagSendLogsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTagSendLogsReq.Merge(dst, src) +} +func (m *GetTagSendLogsReq) XXX_Size() int { + return xxx_messageInfo_GetTagSendLogsReq.Size(m) +} +func (m *GetTagSendLogsReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetTagSendLogsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetTagSendLogsReq proto.InternalMessageInfo + +func (m *GetTagSendLogsReq) GetPagination() *sdk_ws.RequestPagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetTagSendLogsReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetTagSendLogsReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type TagSendLog struct { + UserList []*TagUser `protobuf:"bytes,1,rep,name=userList" json:"userList,omitempty"` + Content string `protobuf:"bytes,2,opt,name=content" json:"content,omitempty"` + SendTime int64 `protobuf:"varint,3,opt,name=sendTime" json:"sendTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TagSendLog) Reset() { *m = TagSendLog{} } +func (m *TagSendLog) String() string { return proto.CompactTextString(m) } +func (*TagSendLog) ProtoMessage() {} +func (*TagSendLog) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{14} +} +func (m *TagSendLog) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TagSendLog.Unmarshal(m, b) +} +func (m *TagSendLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TagSendLog.Marshal(b, m, deterministic) +} +func (dst *TagSendLog) XXX_Merge(src proto.Message) { + xxx_messageInfo_TagSendLog.Merge(dst, src) +} +func (m *TagSendLog) XXX_Size() int { + return xxx_messageInfo_TagSendLog.Size(m) +} +func (m *TagSendLog) XXX_DiscardUnknown() { + xxx_messageInfo_TagSendLog.DiscardUnknown(m) +} + +var xxx_messageInfo_TagSendLog proto.InternalMessageInfo + +func (m *TagSendLog) GetUserList() []*TagUser { + if m != nil { + return m.UserList + } + return nil +} + +func (m *TagSendLog) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *TagSendLog) GetSendTime() int64 { + if m != nil { + return m.SendTime + } + return 0 +} + +type GetTagSendLogsResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,2,opt,name=Pagination" json:"Pagination,omitempty"` + TagSendLogs []*TagSendLog `protobuf:"bytes,3,rep,name=tagSendLogs" json:"tagSendLogs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetTagSendLogsResp) Reset() { *m = GetTagSendLogsResp{} } +func (m *GetTagSendLogsResp) String() string { return proto.CompactTextString(m) } +func (*GetTagSendLogsResp) ProtoMessage() {} +func (*GetTagSendLogsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{15} +} +func (m *GetTagSendLogsResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetTagSendLogsResp.Unmarshal(m, b) +} +func (m *GetTagSendLogsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetTagSendLogsResp.Marshal(b, m, deterministic) +} +func (dst *GetTagSendLogsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTagSendLogsResp.Merge(dst, src) +} +func (m *GetTagSendLogsResp) XXX_Size() int { + return xxx_messageInfo_GetTagSendLogsResp.Size(m) +} +func (m *GetTagSendLogsResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetTagSendLogsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetTagSendLogsResp proto.InternalMessageInfo + +func (m *GetTagSendLogsResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetTagSendLogsResp) GetPagination() *sdk_ws.ResponsePagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetTagSendLogsResp) GetTagSendLogs() []*TagSendLog { + if m != nil { + return m.TagSendLogs + } + return nil +} + +type GetUserTagByIDReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + TagID string `protobuf:"bytes,2,opt,name=tagID" json:"tagID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserTagByIDReq) Reset() { *m = GetUserTagByIDReq{} } +func (m *GetUserTagByIDReq) String() string { return proto.CompactTextString(m) } +func (*GetUserTagByIDReq) ProtoMessage() {} +func (*GetUserTagByIDReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{16} +} +func (m *GetUserTagByIDReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserTagByIDReq.Unmarshal(m, b) +} +func (m *GetUserTagByIDReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserTagByIDReq.Marshal(b, m, deterministic) +} +func (dst *GetUserTagByIDReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserTagByIDReq.Merge(dst, src) +} +func (m *GetUserTagByIDReq) XXX_Size() int { + return xxx_messageInfo_GetUserTagByIDReq.Size(m) +} +func (m *GetUserTagByIDReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserTagByIDReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserTagByIDReq proto.InternalMessageInfo + +func (m *GetUserTagByIDReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetUserTagByIDReq) GetTagID() string { + if m != nil { + return m.TagID + } + return "" +} + +func (m *GetUserTagByIDReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetUserTagByIDResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + Tag *Tag `protobuf:"bytes,2,opt,name=tag" json:"tag,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserTagByIDResp) Reset() { *m = GetUserTagByIDResp{} } +func (m *GetUserTagByIDResp) String() string { return proto.CompactTextString(m) } +func (*GetUserTagByIDResp) ProtoMessage() {} +func (*GetUserTagByIDResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{17} +} +func (m *GetUserTagByIDResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserTagByIDResp.Unmarshal(m, b) +} +func (m *GetUserTagByIDResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserTagByIDResp.Marshal(b, m, deterministic) +} +func (dst *GetUserTagByIDResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserTagByIDResp.Merge(dst, src) +} +func (m *GetUserTagByIDResp) XXX_Size() int { + return xxx_messageInfo_GetUserTagByIDResp.Size(m) +} +func (m *GetUserTagByIDResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserTagByIDResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserTagByIDResp proto.InternalMessageInfo + +func (m *GetUserTagByIDResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetUserTagByIDResp) GetTag() *Tag { + if m != nil { + return m.Tag + } + return nil +} + +type LikeUser struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + UserName string `protobuf:"bytes,2,opt,name=userName" json:"userName,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LikeUser) Reset() { *m = LikeUser{} } +func (m *LikeUser) String() string { return proto.CompactTextString(m) } +func (*LikeUser) ProtoMessage() {} +func (*LikeUser) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{18} +} +func (m *LikeUser) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LikeUser.Unmarshal(m, b) +} +func (m *LikeUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LikeUser.Marshal(b, m, deterministic) +} +func (dst *LikeUser) XXX_Merge(src proto.Message) { + xxx_messageInfo_LikeUser.Merge(dst, src) +} +func (m *LikeUser) XXX_Size() int { + return xxx_messageInfo_LikeUser.Size(m) +} +func (m *LikeUser) XXX_DiscardUnknown() { + xxx_messageInfo_LikeUser.DiscardUnknown(m) +} + +var xxx_messageInfo_LikeUser proto.InternalMessageInfo + +func (m *LikeUser) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *LikeUser) GetUserName() string { + if m != nil { + return m.UserName + } + return "" +} + +type NotificationUser struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + UserName string `protobuf:"bytes,2,opt,name=userName" json:"userName,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NotificationUser) Reset() { *m = NotificationUser{} } +func (m *NotificationUser) String() string { return proto.CompactTextString(m) } +func (*NotificationUser) ProtoMessage() {} +func (*NotificationUser) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{19} +} +func (m *NotificationUser) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NotificationUser.Unmarshal(m, b) +} +func (m *NotificationUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NotificationUser.Marshal(b, m, deterministic) +} +func (dst *NotificationUser) XXX_Merge(src proto.Message) { + xxx_messageInfo_NotificationUser.Merge(dst, src) +} +func (m *NotificationUser) XXX_Size() int { + return xxx_messageInfo_NotificationUser.Size(m) +} +func (m *NotificationUser) XXX_DiscardUnknown() { + xxx_messageInfo_NotificationUser.DiscardUnknown(m) +} + +var xxx_messageInfo_NotificationUser proto.InternalMessageInfo + +func (m *NotificationUser) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *NotificationUser) GetUserName() string { + if m != nil { + return m.UserName + } + return "" +} + +type Comment struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + UserName string `protobuf:"bytes,2,opt,name=userName" json:"userName,omitempty"` + FaceURL string `protobuf:"bytes,3,opt,name=faceURL" json:"faceURL,omitempty"` + ReplyUserID string `protobuf:"bytes,4,opt,name=replyUserID" json:"replyUserID,omitempty"` + ReplyUserName string `protobuf:"bytes,5,opt,name=replyUserName" json:"replyUserName,omitempty"` + ContentID string `protobuf:"bytes,6,opt,name=contentID" json:"contentID,omitempty"` + Content string `protobuf:"bytes,7,opt,name=content" json:"content,omitempty"` + CreateTime int32 `protobuf:"varint,8,opt,name=createTime" json:"createTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Comment) Reset() { *m = Comment{} } +func (m *Comment) String() string { return proto.CompactTextString(m) } +func (*Comment) ProtoMessage() {} +func (*Comment) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{20} +} +func (m *Comment) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Comment.Unmarshal(m, b) +} +func (m *Comment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Comment.Marshal(b, m, deterministic) +} +func (dst *Comment) XXX_Merge(src proto.Message) { + xxx_messageInfo_Comment.Merge(dst, src) +} +func (m *Comment) XXX_Size() int { + return xxx_messageInfo_Comment.Size(m) +} +func (m *Comment) XXX_DiscardUnknown() { + xxx_messageInfo_Comment.DiscardUnknown(m) +} + +var xxx_messageInfo_Comment proto.InternalMessageInfo + +func (m *Comment) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *Comment) GetUserName() string { + if m != nil { + return m.UserName + } + return "" +} + +func (m *Comment) GetFaceURL() string { + if m != nil { + return m.FaceURL + } + return "" +} + +func (m *Comment) GetReplyUserID() string { + if m != nil { + return m.ReplyUserID + } + return "" +} + +func (m *Comment) GetReplyUserName() string { + if m != nil { + return m.ReplyUserName + } + return "" +} + +func (m *Comment) GetContentID() string { + if m != nil { + return m.ContentID + } + return "" +} + +func (m *Comment) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *Comment) GetCreateTime() int32 { + if m != nil { + return m.CreateTime + } + return 0 +} + +type PermissionGroup struct { + GroupName string `protobuf:"bytes,1,opt,name=groupName" json:"groupName,omitempty"` + GroupID string `protobuf:"bytes,2,opt,name=groupID" json:"groupID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PermissionGroup) Reset() { *m = PermissionGroup{} } +func (m *PermissionGroup) String() string { return proto.CompactTextString(m) } +func (*PermissionGroup) ProtoMessage() {} +func (*PermissionGroup) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{21} +} +func (m *PermissionGroup) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PermissionGroup.Unmarshal(m, b) +} +func (m *PermissionGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PermissionGroup.Marshal(b, m, deterministic) +} +func (dst *PermissionGroup) XXX_Merge(src proto.Message) { + xxx_messageInfo_PermissionGroup.Merge(dst, src) +} +func (m *PermissionGroup) XXX_Size() int { + return xxx_messageInfo_PermissionGroup.Size(m) +} +func (m *PermissionGroup) XXX_DiscardUnknown() { + xxx_messageInfo_PermissionGroup.DiscardUnknown(m) +} + +var xxx_messageInfo_PermissionGroup proto.InternalMessageInfo + +func (m *PermissionGroup) GetGroupName() string { + if m != nil { + return m.GroupName + } + return "" +} + +func (m *PermissionGroup) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +type WorkMomentUser struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + UserName string `protobuf:"bytes,2,opt,name=userName" json:"userName,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WorkMomentUser) Reset() { *m = WorkMomentUser{} } +func (m *WorkMomentUser) String() string { return proto.CompactTextString(m) } +func (*WorkMomentUser) ProtoMessage() {} +func (*WorkMomentUser) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{22} +} +func (m *WorkMomentUser) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_WorkMomentUser.Unmarshal(m, b) +} +func (m *WorkMomentUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_WorkMomentUser.Marshal(b, m, deterministic) +} +func (dst *WorkMomentUser) XXX_Merge(src proto.Message) { + xxx_messageInfo_WorkMomentUser.Merge(dst, src) +} +func (m *WorkMomentUser) XXX_Size() int { + return xxx_messageInfo_WorkMomentUser.Size(m) +} +func (m *WorkMomentUser) XXX_DiscardUnknown() { + xxx_messageInfo_WorkMomentUser.DiscardUnknown(m) +} + +var xxx_messageInfo_WorkMomentUser proto.InternalMessageInfo + +func (m *WorkMomentUser) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *WorkMomentUser) GetUserName() string { + if m != nil { + return m.UserName + } + return "" +} + +type WorkMoment struct { + WorkMomentID string `protobuf:"bytes,1,opt,name=workMomentID" json:"workMomentID,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + UserName string `protobuf:"bytes,3,opt,name=userName" json:"userName,omitempty"` + FaceURL string `protobuf:"bytes,4,opt,name=faceURL" json:"faceURL,omitempty"` + Content string `protobuf:"bytes,5,opt,name=content" json:"content,omitempty"` + LikeUserList []*WorkMomentUser `protobuf:"bytes,6,rep,name=likeUserList" json:"likeUserList,omitempty"` + Comments []*Comment `protobuf:"bytes,7,rep,name=comments" json:"comments,omitempty"` + Permission int32 `protobuf:"varint,8,opt,name=permission" json:"permission,omitempty"` + PermissionUserList []*WorkMomentUser `protobuf:"bytes,9,rep,name=permissionUserList" json:"permissionUserList,omitempty"` + PermissionGroupList []*PermissionGroup `protobuf:"bytes,10,rep,name=permissionGroupList" json:"permissionGroupList,omitempty"` + AtUserList []*WorkMomentUser `protobuf:"bytes,11,rep,name=atUserList" json:"atUserList,omitempty"` + CreateTime int32 `protobuf:"varint,12,opt,name=createTime" json:"createTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WorkMoment) Reset() { *m = WorkMoment{} } +func (m *WorkMoment) String() string { return proto.CompactTextString(m) } +func (*WorkMoment) ProtoMessage() {} +func (*WorkMoment) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{23} +} +func (m *WorkMoment) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_WorkMoment.Unmarshal(m, b) +} +func (m *WorkMoment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_WorkMoment.Marshal(b, m, deterministic) +} +func (dst *WorkMoment) XXX_Merge(src proto.Message) { + xxx_messageInfo_WorkMoment.Merge(dst, src) +} +func (m *WorkMoment) XXX_Size() int { + return xxx_messageInfo_WorkMoment.Size(m) +} +func (m *WorkMoment) XXX_DiscardUnknown() { + xxx_messageInfo_WorkMoment.DiscardUnknown(m) +} + +var xxx_messageInfo_WorkMoment proto.InternalMessageInfo + +func (m *WorkMoment) GetWorkMomentID() string { + if m != nil { + return m.WorkMomentID + } + return "" +} + +func (m *WorkMoment) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *WorkMoment) GetUserName() string { + if m != nil { + return m.UserName + } + return "" +} + +func (m *WorkMoment) GetFaceURL() string { + if m != nil { + return m.FaceURL + } + return "" +} + +func (m *WorkMoment) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *WorkMoment) GetLikeUserList() []*WorkMomentUser { + if m != nil { + return m.LikeUserList + } + return nil +} + +func (m *WorkMoment) GetComments() []*Comment { + if m != nil { + return m.Comments + } + return nil +} + +func (m *WorkMoment) GetPermission() int32 { + if m != nil { + return m.Permission + } + return 0 +} + +func (m *WorkMoment) GetPermissionUserList() []*WorkMomentUser { + if m != nil { + return m.PermissionUserList + } + return nil +} + +func (m *WorkMoment) GetPermissionGroupList() []*PermissionGroup { + if m != nil { + return m.PermissionGroupList + } + return nil +} + +func (m *WorkMoment) GetAtUserList() []*WorkMomentUser { + if m != nil { + return m.AtUserList + } + return nil +} + +func (m *WorkMoment) GetCreateTime() int32 { + if m != nil { + return m.CreateTime + } + return 0 +} + +type CreateOneWorkMomentReq struct { + WorkMoment *WorkMoment `protobuf:"bytes,1,opt,name=workMoment" json:"workMoment,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateOneWorkMomentReq) Reset() { *m = CreateOneWorkMomentReq{} } +func (m *CreateOneWorkMomentReq) String() string { return proto.CompactTextString(m) } +func (*CreateOneWorkMomentReq) ProtoMessage() {} +func (*CreateOneWorkMomentReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{24} +} +func (m *CreateOneWorkMomentReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateOneWorkMomentReq.Unmarshal(m, b) +} +func (m *CreateOneWorkMomentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateOneWorkMomentReq.Marshal(b, m, deterministic) +} +func (dst *CreateOneWorkMomentReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateOneWorkMomentReq.Merge(dst, src) +} +func (m *CreateOneWorkMomentReq) XXX_Size() int { + return xxx_messageInfo_CreateOneWorkMomentReq.Size(m) +} +func (m *CreateOneWorkMomentReq) XXX_DiscardUnknown() { + xxx_messageInfo_CreateOneWorkMomentReq.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateOneWorkMomentReq proto.InternalMessageInfo + +func (m *CreateOneWorkMomentReq) GetWorkMoment() *WorkMoment { + if m != nil { + return m.WorkMoment + } + return nil +} + +func (m *CreateOneWorkMomentReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type CreateOneWorkMomentResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateOneWorkMomentResp) Reset() { *m = CreateOneWorkMomentResp{} } +func (m *CreateOneWorkMomentResp) String() string { return proto.CompactTextString(m) } +func (*CreateOneWorkMomentResp) ProtoMessage() {} +func (*CreateOneWorkMomentResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{25} +} +func (m *CreateOneWorkMomentResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateOneWorkMomentResp.Unmarshal(m, b) +} +func (m *CreateOneWorkMomentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateOneWorkMomentResp.Marshal(b, m, deterministic) +} +func (dst *CreateOneWorkMomentResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateOneWorkMomentResp.Merge(dst, src) +} +func (m *CreateOneWorkMomentResp) XXX_Size() int { + return xxx_messageInfo_CreateOneWorkMomentResp.Size(m) +} +func (m *CreateOneWorkMomentResp) XXX_DiscardUnknown() { + xxx_messageInfo_CreateOneWorkMomentResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateOneWorkMomentResp proto.InternalMessageInfo + +func (m *CreateOneWorkMomentResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type DeleteOneWorkMomentReq struct { + WorkMomentID string `protobuf:"bytes,1,opt,name=workMomentID" json:"workMomentID,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteOneWorkMomentReq) Reset() { *m = DeleteOneWorkMomentReq{} } +func (m *DeleteOneWorkMomentReq) String() string { return proto.CompactTextString(m) } +func (*DeleteOneWorkMomentReq) ProtoMessage() {} +func (*DeleteOneWorkMomentReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{26} +} +func (m *DeleteOneWorkMomentReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteOneWorkMomentReq.Unmarshal(m, b) +} +func (m *DeleteOneWorkMomentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteOneWorkMomentReq.Marshal(b, m, deterministic) +} +func (dst *DeleteOneWorkMomentReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteOneWorkMomentReq.Merge(dst, src) +} +func (m *DeleteOneWorkMomentReq) XXX_Size() int { + return xxx_messageInfo_DeleteOneWorkMomentReq.Size(m) +} +func (m *DeleteOneWorkMomentReq) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteOneWorkMomentReq.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteOneWorkMomentReq proto.InternalMessageInfo + +func (m *DeleteOneWorkMomentReq) GetWorkMomentID() string { + if m != nil { + return m.WorkMomentID + } + return "" +} + +func (m *DeleteOneWorkMomentReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *DeleteOneWorkMomentReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type DeleteOneWorkMomentResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteOneWorkMomentResp) Reset() { *m = DeleteOneWorkMomentResp{} } +func (m *DeleteOneWorkMomentResp) String() string { return proto.CompactTextString(m) } +func (*DeleteOneWorkMomentResp) ProtoMessage() {} +func (*DeleteOneWorkMomentResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{27} +} +func (m *DeleteOneWorkMomentResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteOneWorkMomentResp.Unmarshal(m, b) +} +func (m *DeleteOneWorkMomentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteOneWorkMomentResp.Marshal(b, m, deterministic) +} +func (dst *DeleteOneWorkMomentResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteOneWorkMomentResp.Merge(dst, src) +} +func (m *DeleteOneWorkMomentResp) XXX_Size() int { + return xxx_messageInfo_DeleteOneWorkMomentResp.Size(m) +} +func (m *DeleteOneWorkMomentResp) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteOneWorkMomentResp.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteOneWorkMomentResp proto.InternalMessageInfo + +func (m *DeleteOneWorkMomentResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type LikeOneWorkMomentReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + WorkMomentID string `protobuf:"bytes,2,opt,name=WorkMomentID" json:"WorkMomentID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LikeOneWorkMomentReq) Reset() { *m = LikeOneWorkMomentReq{} } +func (m *LikeOneWorkMomentReq) String() string { return proto.CompactTextString(m) } +func (*LikeOneWorkMomentReq) ProtoMessage() {} +func (*LikeOneWorkMomentReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{28} +} +func (m *LikeOneWorkMomentReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LikeOneWorkMomentReq.Unmarshal(m, b) +} +func (m *LikeOneWorkMomentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LikeOneWorkMomentReq.Marshal(b, m, deterministic) +} +func (dst *LikeOneWorkMomentReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_LikeOneWorkMomentReq.Merge(dst, src) +} +func (m *LikeOneWorkMomentReq) XXX_Size() int { + return xxx_messageInfo_LikeOneWorkMomentReq.Size(m) +} +func (m *LikeOneWorkMomentReq) XXX_DiscardUnknown() { + xxx_messageInfo_LikeOneWorkMomentReq.DiscardUnknown(m) +} + +var xxx_messageInfo_LikeOneWorkMomentReq proto.InternalMessageInfo + +func (m *LikeOneWorkMomentReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *LikeOneWorkMomentReq) GetWorkMomentID() string { + if m != nil { + return m.WorkMomentID + } + return "" +} + +func (m *LikeOneWorkMomentReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type LikeOneWorkMomentResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LikeOneWorkMomentResp) Reset() { *m = LikeOneWorkMomentResp{} } +func (m *LikeOneWorkMomentResp) String() string { return proto.CompactTextString(m) } +func (*LikeOneWorkMomentResp) ProtoMessage() {} +func (*LikeOneWorkMomentResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{29} +} +func (m *LikeOneWorkMomentResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LikeOneWorkMomentResp.Unmarshal(m, b) +} +func (m *LikeOneWorkMomentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LikeOneWorkMomentResp.Marshal(b, m, deterministic) +} +func (dst *LikeOneWorkMomentResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_LikeOneWorkMomentResp.Merge(dst, src) +} +func (m *LikeOneWorkMomentResp) XXX_Size() int { + return xxx_messageInfo_LikeOneWorkMomentResp.Size(m) +} +func (m *LikeOneWorkMomentResp) XXX_DiscardUnknown() { + xxx_messageInfo_LikeOneWorkMomentResp.DiscardUnknown(m) +} + +var xxx_messageInfo_LikeOneWorkMomentResp proto.InternalMessageInfo + +func (m *LikeOneWorkMomentResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type CommentOneWorkMomentReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + WorkMomentID string `protobuf:"bytes,2,opt,name=workMomentID" json:"workMomentID,omitempty"` + ReplyUserID string `protobuf:"bytes,3,opt,name=replyUserID" json:"replyUserID,omitempty"` + Content string `protobuf:"bytes,4,opt,name=content" json:"content,omitempty"` + OperationID string `protobuf:"bytes,5,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CommentOneWorkMomentReq) Reset() { *m = CommentOneWorkMomentReq{} } +func (m *CommentOneWorkMomentReq) String() string { return proto.CompactTextString(m) } +func (*CommentOneWorkMomentReq) ProtoMessage() {} +func (*CommentOneWorkMomentReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{30} +} +func (m *CommentOneWorkMomentReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommentOneWorkMomentReq.Unmarshal(m, b) +} +func (m *CommentOneWorkMomentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommentOneWorkMomentReq.Marshal(b, m, deterministic) +} +func (dst *CommentOneWorkMomentReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommentOneWorkMomentReq.Merge(dst, src) +} +func (m *CommentOneWorkMomentReq) XXX_Size() int { + return xxx_messageInfo_CommentOneWorkMomentReq.Size(m) +} +func (m *CommentOneWorkMomentReq) XXX_DiscardUnknown() { + xxx_messageInfo_CommentOneWorkMomentReq.DiscardUnknown(m) +} + +var xxx_messageInfo_CommentOneWorkMomentReq proto.InternalMessageInfo + +func (m *CommentOneWorkMomentReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *CommentOneWorkMomentReq) GetWorkMomentID() string { + if m != nil { + return m.WorkMomentID + } + return "" +} + +func (m *CommentOneWorkMomentReq) GetReplyUserID() string { + if m != nil { + return m.ReplyUserID + } + return "" +} + +func (m *CommentOneWorkMomentReq) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *CommentOneWorkMomentReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type CommentOneWorkMomentResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CommentOneWorkMomentResp) Reset() { *m = CommentOneWorkMomentResp{} } +func (m *CommentOneWorkMomentResp) String() string { return proto.CompactTextString(m) } +func (*CommentOneWorkMomentResp) ProtoMessage() {} +func (*CommentOneWorkMomentResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{31} +} +func (m *CommentOneWorkMomentResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommentOneWorkMomentResp.Unmarshal(m, b) +} +func (m *CommentOneWorkMomentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommentOneWorkMomentResp.Marshal(b, m, deterministic) +} +func (dst *CommentOneWorkMomentResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommentOneWorkMomentResp.Merge(dst, src) +} +func (m *CommentOneWorkMomentResp) XXX_Size() int { + return xxx_messageInfo_CommentOneWorkMomentResp.Size(m) +} +func (m *CommentOneWorkMomentResp) XXX_DiscardUnknown() { + xxx_messageInfo_CommentOneWorkMomentResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CommentOneWorkMomentResp proto.InternalMessageInfo + +func (m *CommentOneWorkMomentResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type GetWorkMomentByIDReq struct { + WorkMomentID string `protobuf:"bytes,1,opt,name=workMomentID" json:"workMomentID,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=opUserID" json:"opUserID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetWorkMomentByIDReq) Reset() { *m = GetWorkMomentByIDReq{} } +func (m *GetWorkMomentByIDReq) String() string { return proto.CompactTextString(m) } +func (*GetWorkMomentByIDReq) ProtoMessage() {} +func (*GetWorkMomentByIDReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{32} +} +func (m *GetWorkMomentByIDReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetWorkMomentByIDReq.Unmarshal(m, b) +} +func (m *GetWorkMomentByIDReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetWorkMomentByIDReq.Marshal(b, m, deterministic) +} +func (dst *GetWorkMomentByIDReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetWorkMomentByIDReq.Merge(dst, src) +} +func (m *GetWorkMomentByIDReq) XXX_Size() int { + return xxx_messageInfo_GetWorkMomentByIDReq.Size(m) +} +func (m *GetWorkMomentByIDReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetWorkMomentByIDReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetWorkMomentByIDReq proto.InternalMessageInfo + +func (m *GetWorkMomentByIDReq) GetWorkMomentID() string { + if m != nil { + return m.WorkMomentID + } + return "" +} + +func (m *GetWorkMomentByIDReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *GetWorkMomentByIDReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetWorkMomentByIDResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + WorkMoment *WorkMoment `protobuf:"bytes,2,opt,name=workMoment" json:"workMoment,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetWorkMomentByIDResp) Reset() { *m = GetWorkMomentByIDResp{} } +func (m *GetWorkMomentByIDResp) String() string { return proto.CompactTextString(m) } +func (*GetWorkMomentByIDResp) ProtoMessage() {} +func (*GetWorkMomentByIDResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{33} +} +func (m *GetWorkMomentByIDResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetWorkMomentByIDResp.Unmarshal(m, b) +} +func (m *GetWorkMomentByIDResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetWorkMomentByIDResp.Marshal(b, m, deterministic) +} +func (dst *GetWorkMomentByIDResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetWorkMomentByIDResp.Merge(dst, src) +} +func (m *GetWorkMomentByIDResp) XXX_Size() int { + return xxx_messageInfo_GetWorkMomentByIDResp.Size(m) +} +func (m *GetWorkMomentByIDResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetWorkMomentByIDResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetWorkMomentByIDResp proto.InternalMessageInfo + +func (m *GetWorkMomentByIDResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetWorkMomentByIDResp) GetWorkMoment() *WorkMoment { + if m != nil { + return m.WorkMoment + } + return nil +} + +type ChangeWorkMomentPermissionReq struct { + WorkMomentID string `protobuf:"bytes,1,opt,name=workMomentID" json:"workMomentID,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=opUserID" json:"opUserID,omitempty"` + Permission int32 `protobuf:"varint,3,opt,name=permission" json:"permission,omitempty"` + PermissionUserIDList []string `protobuf:"bytes,4,rep,name=permissionUserIDList" json:"permissionUserIDList,omitempty"` + OperationID string `protobuf:"bytes,5,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChangeWorkMomentPermissionReq) Reset() { *m = ChangeWorkMomentPermissionReq{} } +func (m *ChangeWorkMomentPermissionReq) String() string { return proto.CompactTextString(m) } +func (*ChangeWorkMomentPermissionReq) ProtoMessage() {} +func (*ChangeWorkMomentPermissionReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{34} +} +func (m *ChangeWorkMomentPermissionReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChangeWorkMomentPermissionReq.Unmarshal(m, b) +} +func (m *ChangeWorkMomentPermissionReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChangeWorkMomentPermissionReq.Marshal(b, m, deterministic) +} +func (dst *ChangeWorkMomentPermissionReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChangeWorkMomentPermissionReq.Merge(dst, src) +} +func (m *ChangeWorkMomentPermissionReq) XXX_Size() int { + return xxx_messageInfo_ChangeWorkMomentPermissionReq.Size(m) +} +func (m *ChangeWorkMomentPermissionReq) XXX_DiscardUnknown() { + xxx_messageInfo_ChangeWorkMomentPermissionReq.DiscardUnknown(m) +} + +var xxx_messageInfo_ChangeWorkMomentPermissionReq proto.InternalMessageInfo + +func (m *ChangeWorkMomentPermissionReq) GetWorkMomentID() string { + if m != nil { + return m.WorkMomentID + } + return "" +} + +func (m *ChangeWorkMomentPermissionReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *ChangeWorkMomentPermissionReq) GetPermission() int32 { + if m != nil { + return m.Permission + } + return 0 +} + +func (m *ChangeWorkMomentPermissionReq) GetPermissionUserIDList() []string { + if m != nil { + return m.PermissionUserIDList + } + return nil +} + +func (m *ChangeWorkMomentPermissionReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type ChangeWorkMomentPermissionResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChangeWorkMomentPermissionResp) Reset() { *m = ChangeWorkMomentPermissionResp{} } +func (m *ChangeWorkMomentPermissionResp) String() string { return proto.CompactTextString(m) } +func (*ChangeWorkMomentPermissionResp) ProtoMessage() {} +func (*ChangeWorkMomentPermissionResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{35} +} +func (m *ChangeWorkMomentPermissionResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChangeWorkMomentPermissionResp.Unmarshal(m, b) +} +func (m *ChangeWorkMomentPermissionResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChangeWorkMomentPermissionResp.Marshal(b, m, deterministic) +} +func (dst *ChangeWorkMomentPermissionResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChangeWorkMomentPermissionResp.Merge(dst, src) +} +func (m *ChangeWorkMomentPermissionResp) XXX_Size() int { + return xxx_messageInfo_ChangeWorkMomentPermissionResp.Size(m) +} +func (m *ChangeWorkMomentPermissionResp) XXX_DiscardUnknown() { + xxx_messageInfo_ChangeWorkMomentPermissionResp.DiscardUnknown(m) +} + +var xxx_messageInfo_ChangeWorkMomentPermissionResp proto.InternalMessageInfo + +func (m *ChangeWorkMomentPermissionResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type GetUserWorkMomentsReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=opUserID" json:"opUserID,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,3,opt,name=Pagination" json:"Pagination,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserWorkMomentsReq) Reset() { *m = GetUserWorkMomentsReq{} } +func (m *GetUserWorkMomentsReq) String() string { return proto.CompactTextString(m) } +func (*GetUserWorkMomentsReq) ProtoMessage() {} +func (*GetUserWorkMomentsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{36} +} +func (m *GetUserWorkMomentsReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserWorkMomentsReq.Unmarshal(m, b) +} +func (m *GetUserWorkMomentsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserWorkMomentsReq.Marshal(b, m, deterministic) +} +func (dst *GetUserWorkMomentsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserWorkMomentsReq.Merge(dst, src) +} +func (m *GetUserWorkMomentsReq) XXX_Size() int { + return xxx_messageInfo_GetUserWorkMomentsReq.Size(m) +} +func (m *GetUserWorkMomentsReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserWorkMomentsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserWorkMomentsReq proto.InternalMessageInfo + +func (m *GetUserWorkMomentsReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetUserWorkMomentsReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *GetUserWorkMomentsReq) GetPagination() *sdk_ws.RequestPagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetUserWorkMomentsReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetUserWorkMomentsResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + WorkMoments []*WorkMoment `protobuf:"bytes,2,rep,name=workMoments" json:"workMoments,omitempty"` + Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,3,opt,name=Pagination" json:"Pagination,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserWorkMomentsResp) Reset() { *m = GetUserWorkMomentsResp{} } +func (m *GetUserWorkMomentsResp) String() string { return proto.CompactTextString(m) } +func (*GetUserWorkMomentsResp) ProtoMessage() {} +func (*GetUserWorkMomentsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{37} +} +func (m *GetUserWorkMomentsResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserWorkMomentsResp.Unmarshal(m, b) +} +func (m *GetUserWorkMomentsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserWorkMomentsResp.Marshal(b, m, deterministic) +} +func (dst *GetUserWorkMomentsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserWorkMomentsResp.Merge(dst, src) +} +func (m *GetUserWorkMomentsResp) XXX_Size() int { + return xxx_messageInfo_GetUserWorkMomentsResp.Size(m) +} +func (m *GetUserWorkMomentsResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserWorkMomentsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserWorkMomentsResp proto.InternalMessageInfo + +func (m *GetUserWorkMomentsResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetUserWorkMomentsResp) GetWorkMoments() []*WorkMoment { + if m != nil { + return m.WorkMoments + } + return nil +} + +func (m *GetUserWorkMomentsResp) GetPagination() *sdk_ws.ResponsePagination { + if m != nil { + return m.Pagination + } + return nil +} + +type GetUserFriendWorkMomentsReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=Pagination" json:"Pagination,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserFriendWorkMomentsReq) Reset() { *m = GetUserFriendWorkMomentsReq{} } +func (m *GetUserFriendWorkMomentsReq) String() string { return proto.CompactTextString(m) } +func (*GetUserFriendWorkMomentsReq) ProtoMessage() {} +func (*GetUserFriendWorkMomentsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{38} +} +func (m *GetUserFriendWorkMomentsReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserFriendWorkMomentsReq.Unmarshal(m, b) +} +func (m *GetUserFriendWorkMomentsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserFriendWorkMomentsReq.Marshal(b, m, deterministic) +} +func (dst *GetUserFriendWorkMomentsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserFriendWorkMomentsReq.Merge(dst, src) +} +func (m *GetUserFriendWorkMomentsReq) XXX_Size() int { + return xxx_messageInfo_GetUserFriendWorkMomentsReq.Size(m) +} +func (m *GetUserFriendWorkMomentsReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserFriendWorkMomentsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserFriendWorkMomentsReq proto.InternalMessageInfo + +func (m *GetUserFriendWorkMomentsReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetUserFriendWorkMomentsReq) GetPagination() *sdk_ws.RequestPagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetUserFriendWorkMomentsReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetUserFriendWorkMomentsResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + WorkMoments []*WorkMoment `protobuf:"bytes,2,rep,name=workMoments" json:"workMoments,omitempty"` + Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,3,opt,name=Pagination" json:"Pagination,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserFriendWorkMomentsResp) Reset() { *m = GetUserFriendWorkMomentsResp{} } +func (m *GetUserFriendWorkMomentsResp) String() string { return proto.CompactTextString(m) } +func (*GetUserFriendWorkMomentsResp) ProtoMessage() {} +func (*GetUserFriendWorkMomentsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{39} +} +func (m *GetUserFriendWorkMomentsResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserFriendWorkMomentsResp.Unmarshal(m, b) +} +func (m *GetUserFriendWorkMomentsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserFriendWorkMomentsResp.Marshal(b, m, deterministic) +} +func (dst *GetUserFriendWorkMomentsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserFriendWorkMomentsResp.Merge(dst, src) +} +func (m *GetUserFriendWorkMomentsResp) XXX_Size() int { + return xxx_messageInfo_GetUserFriendWorkMomentsResp.Size(m) +} +func (m *GetUserFriendWorkMomentsResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserFriendWorkMomentsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserFriendWorkMomentsResp proto.InternalMessageInfo + +func (m *GetUserFriendWorkMomentsResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetUserFriendWorkMomentsResp) GetWorkMoments() []*WorkMoment { + if m != nil { + return m.WorkMoments + } + return nil +} + +func (m *GetUserFriendWorkMomentsResp) GetPagination() *sdk_ws.ResponsePagination { + if m != nil { + return m.Pagination + } + return nil +} + +type WorkMomentNotificationMsg struct { + NotificationMsgType int32 `protobuf:"varint,1,opt,name=notificationMsgType" json:"notificationMsgType,omitempty"` + ReplyUserName string `protobuf:"bytes,2,opt,name=replyUserName" json:"replyUserName,omitempty"` + ReplyUserID string `protobuf:"bytes,3,opt,name=replyUserID" json:"replyUserID,omitempty"` + Content string `protobuf:"bytes,4,opt,name=content" json:"content,omitempty"` + ContentID string `protobuf:"bytes,5,opt,name=contentID" json:"contentID,omitempty"` + WorkMomentID string `protobuf:"bytes,6,opt,name=workMomentID" json:"workMomentID,omitempty"` + UserID string `protobuf:"bytes,7,opt,name=userID" json:"userID,omitempty"` + UserName string `protobuf:"bytes,8,opt,name=userName" json:"userName,omitempty"` + FaceURL string `protobuf:"bytes,9,opt,name=faceURL" json:"faceURL,omitempty"` + WorkMomentContent string `protobuf:"bytes,10,opt,name=workMomentContent" json:"workMomentContent,omitempty"` + CreateTime int32 `protobuf:"varint,11,opt,name=createTime" json:"createTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WorkMomentNotificationMsg) Reset() { *m = WorkMomentNotificationMsg{} } +func (m *WorkMomentNotificationMsg) String() string { return proto.CompactTextString(m) } +func (*WorkMomentNotificationMsg) ProtoMessage() {} +func (*WorkMomentNotificationMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{40} +} +func (m *WorkMomentNotificationMsg) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_WorkMomentNotificationMsg.Unmarshal(m, b) +} +func (m *WorkMomentNotificationMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_WorkMomentNotificationMsg.Marshal(b, m, deterministic) +} +func (dst *WorkMomentNotificationMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_WorkMomentNotificationMsg.Merge(dst, src) +} +func (m *WorkMomentNotificationMsg) XXX_Size() int { + return xxx_messageInfo_WorkMomentNotificationMsg.Size(m) +} +func (m *WorkMomentNotificationMsg) XXX_DiscardUnknown() { + xxx_messageInfo_WorkMomentNotificationMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_WorkMomentNotificationMsg proto.InternalMessageInfo + +func (m *WorkMomentNotificationMsg) GetNotificationMsgType() int32 { + if m != nil { + return m.NotificationMsgType + } + return 0 +} + +func (m *WorkMomentNotificationMsg) GetReplyUserName() string { + if m != nil { + return m.ReplyUserName + } + return "" +} + +func (m *WorkMomentNotificationMsg) GetReplyUserID() string { + if m != nil { + return m.ReplyUserID + } + return "" +} + +func (m *WorkMomentNotificationMsg) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *WorkMomentNotificationMsg) GetContentID() string { + if m != nil { + return m.ContentID + } + return "" +} + +func (m *WorkMomentNotificationMsg) GetWorkMomentID() string { + if m != nil { + return m.WorkMomentID + } + return "" +} + +func (m *WorkMomentNotificationMsg) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *WorkMomentNotificationMsg) GetUserName() string { + if m != nil { + return m.UserName + } + return "" +} + +func (m *WorkMomentNotificationMsg) GetFaceURL() string { + if m != nil { + return m.FaceURL + } + return "" +} + +func (m *WorkMomentNotificationMsg) GetWorkMomentContent() string { + if m != nil { + return m.WorkMomentContent + } + return "" +} + +func (m *WorkMomentNotificationMsg) GetCreateTime() int32 { + if m != nil { + return m.CreateTime + } + return 0 +} + +type SetUserWorkMomentsLevelReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + Level int32 `protobuf:"varint,2,opt,name=level" json:"level,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetUserWorkMomentsLevelReq) Reset() { *m = SetUserWorkMomentsLevelReq{} } +func (m *SetUserWorkMomentsLevelReq) String() string { return proto.CompactTextString(m) } +func (*SetUserWorkMomentsLevelReq) ProtoMessage() {} +func (*SetUserWorkMomentsLevelReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{41} +} +func (m *SetUserWorkMomentsLevelReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetUserWorkMomentsLevelReq.Unmarshal(m, b) +} +func (m *SetUserWorkMomentsLevelReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetUserWorkMomentsLevelReq.Marshal(b, m, deterministic) +} +func (dst *SetUserWorkMomentsLevelReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetUserWorkMomentsLevelReq.Merge(dst, src) +} +func (m *SetUserWorkMomentsLevelReq) XXX_Size() int { + return xxx_messageInfo_SetUserWorkMomentsLevelReq.Size(m) +} +func (m *SetUserWorkMomentsLevelReq) XXX_DiscardUnknown() { + xxx_messageInfo_SetUserWorkMomentsLevelReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SetUserWorkMomentsLevelReq proto.InternalMessageInfo + +func (m *SetUserWorkMomentsLevelReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *SetUserWorkMomentsLevelReq) GetLevel() int32 { + if m != nil { + return m.Level + } + return 0 +} + +func (m *SetUserWorkMomentsLevelReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type SetUserWorkMomentsLevelResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetUserWorkMomentsLevelResp) Reset() { *m = SetUserWorkMomentsLevelResp{} } +func (m *SetUserWorkMomentsLevelResp) String() string { return proto.CompactTextString(m) } +func (*SetUserWorkMomentsLevelResp) ProtoMessage() {} +func (*SetUserWorkMomentsLevelResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_45d86d1784e03bf7, []int{42} +} +func (m *SetUserWorkMomentsLevelResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetUserWorkMomentsLevelResp.Unmarshal(m, b) +} +func (m *SetUserWorkMomentsLevelResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetUserWorkMomentsLevelResp.Marshal(b, m, deterministic) +} +func (dst *SetUserWorkMomentsLevelResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetUserWorkMomentsLevelResp.Merge(dst, src) +} +func (m *SetUserWorkMomentsLevelResp) XXX_Size() int { + return xxx_messageInfo_SetUserWorkMomentsLevelResp.Size(m) +} +func (m *SetUserWorkMomentsLevelResp) XXX_DiscardUnknown() { + xxx_messageInfo_SetUserWorkMomentsLevelResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SetUserWorkMomentsLevelResp proto.InternalMessageInfo + +func (m *SetUserWorkMomentsLevelResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func init() { + proto.RegisterType((*CommonResp)(nil), "office.CommonResp") + proto.RegisterType((*TagUser)(nil), "office.TagUser") + proto.RegisterType((*Tag)(nil), "office.Tag") + proto.RegisterType((*GetUserTagsReq)(nil), "office.GetUserTagsReq") + proto.RegisterType((*GetUserTagsResp)(nil), "office.GetUserTagsResp") + proto.RegisterType((*CreateTagReq)(nil), "office.CreateTagReq") + proto.RegisterType((*CreateTagResp)(nil), "office.CreateTagResp") + proto.RegisterType((*DeleteTagReq)(nil), "office.DeleteTagReq") + proto.RegisterType((*DeleteTagResp)(nil), "office.DeleteTagResp") + proto.RegisterType((*SetTagReq)(nil), "office.SetTagReq") + proto.RegisterType((*SetTagResp)(nil), "office.SetTagResp") + proto.RegisterType((*SendMsg2TagReq)(nil), "office.SendMsg2TagReq") + proto.RegisterType((*SendMsg2TagResp)(nil), "office.SendMsg2TagResp") + proto.RegisterType((*GetTagSendLogsReq)(nil), "office.GetTagSendLogsReq") + proto.RegisterType((*TagSendLog)(nil), "office.TagSendLog") + proto.RegisterType((*GetTagSendLogsResp)(nil), "office.GetTagSendLogsResp") + proto.RegisterType((*GetUserTagByIDReq)(nil), "office.GetUserTagByIDReq") + proto.RegisterType((*GetUserTagByIDResp)(nil), "office.GetUserTagByIDResp") + proto.RegisterType((*LikeUser)(nil), "office.LikeUser") + proto.RegisterType((*NotificationUser)(nil), "office.NotificationUser") + proto.RegisterType((*Comment)(nil), "office.Comment") + proto.RegisterType((*PermissionGroup)(nil), "office.PermissionGroup") + proto.RegisterType((*WorkMomentUser)(nil), "office.WorkMomentUser") + proto.RegisterType((*WorkMoment)(nil), "office.WorkMoment") + proto.RegisterType((*CreateOneWorkMomentReq)(nil), "office.CreateOneWorkMomentReq") + proto.RegisterType((*CreateOneWorkMomentResp)(nil), "office.CreateOneWorkMomentResp") + proto.RegisterType((*DeleteOneWorkMomentReq)(nil), "office.DeleteOneWorkMomentReq") + proto.RegisterType((*DeleteOneWorkMomentResp)(nil), "office.DeleteOneWorkMomentResp") + proto.RegisterType((*LikeOneWorkMomentReq)(nil), "office.LikeOneWorkMomentReq") + proto.RegisterType((*LikeOneWorkMomentResp)(nil), "office.LikeOneWorkMomentResp") + proto.RegisterType((*CommentOneWorkMomentReq)(nil), "office.CommentOneWorkMomentReq") + proto.RegisterType((*CommentOneWorkMomentResp)(nil), "office.CommentOneWorkMomentResp") + proto.RegisterType((*GetWorkMomentByIDReq)(nil), "office.GetWorkMomentByIDReq") + proto.RegisterType((*GetWorkMomentByIDResp)(nil), "office.GetWorkMomentByIDResp") + proto.RegisterType((*ChangeWorkMomentPermissionReq)(nil), "office.ChangeWorkMomentPermissionReq") + proto.RegisterType((*ChangeWorkMomentPermissionResp)(nil), "office.ChangeWorkMomentPermissionResp") + proto.RegisterType((*GetUserWorkMomentsReq)(nil), "office.GetUserWorkMomentsReq") + proto.RegisterType((*GetUserWorkMomentsResp)(nil), "office.GetUserWorkMomentsResp") + proto.RegisterType((*GetUserFriendWorkMomentsReq)(nil), "office.GetUserFriendWorkMomentsReq") + proto.RegisterType((*GetUserFriendWorkMomentsResp)(nil), "office.GetUserFriendWorkMomentsResp") + proto.RegisterType((*WorkMomentNotificationMsg)(nil), "office.WorkMomentNotificationMsg") + proto.RegisterType((*SetUserWorkMomentsLevelReq)(nil), "office.SetUserWorkMomentsLevelReq") + proto.RegisterType((*SetUserWorkMomentsLevelResp)(nil), "office.SetUserWorkMomentsLevelResp") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// Client API for OfficeService service + +type OfficeServiceClient interface { + GetUserTags(ctx context.Context, in *GetUserTagsReq, opts ...grpc.CallOption) (*GetUserTagsResp, error) + CreateTag(ctx context.Context, in *CreateTagReq, opts ...grpc.CallOption) (*CreateTagResp, error) + DeleteTag(ctx context.Context, in *DeleteTagReq, opts ...grpc.CallOption) (*DeleteTagResp, error) + SetTag(ctx context.Context, in *SetTagReq, opts ...grpc.CallOption) (*SetTagResp, error) + SendMsg2Tag(ctx context.Context, in *SendMsg2TagReq, opts ...grpc.CallOption) (*SendMsg2TagResp, error) + GetTagSendLogs(ctx context.Context, in *GetTagSendLogsReq, opts ...grpc.CallOption) (*GetTagSendLogsResp, error) + GetUserTagByID(ctx context.Context, in *GetUserTagByIDReq, opts ...grpc.CallOption) (*GetUserTagByIDResp, error) + CreateOneWorkMoment(ctx context.Context, in *CreateOneWorkMomentReq, opts ...grpc.CallOption) (*CreateOneWorkMomentResp, error) + DeleteOneWorkMoment(ctx context.Context, in *DeleteOneWorkMomentReq, opts ...grpc.CallOption) (*DeleteOneWorkMomentResp, error) + LikeOneWorkMoment(ctx context.Context, in *LikeOneWorkMomentReq, opts ...grpc.CallOption) (*LikeOneWorkMomentResp, error) + CommentOneWorkMoment(ctx context.Context, in *CommentOneWorkMomentReq, opts ...grpc.CallOption) (*CommentOneWorkMomentResp, error) + GetWorkMomentByID(ctx context.Context, in *GetWorkMomentByIDReq, opts ...grpc.CallOption) (*GetWorkMomentByIDResp, error) + ChangeWorkMomentPermission(ctx context.Context, in *ChangeWorkMomentPermissionReq, opts ...grpc.CallOption) (*ChangeWorkMomentPermissionResp, error) + // / user self + GetUserWorkMoments(ctx context.Context, in *GetUserWorkMomentsReq, opts ...grpc.CallOption) (*GetUserWorkMomentsResp, error) + // / users friend + GetUserFriendWorkMoments(ctx context.Context, in *GetUserFriendWorkMomentsReq, opts ...grpc.CallOption) (*GetUserFriendWorkMomentsResp, error) + SetUserWorkMomentsLevel(ctx context.Context, in *SetUserWorkMomentsLevelReq, opts ...grpc.CallOption) (*SetUserWorkMomentsLevelResp, error) +} + +type officeServiceClient struct { + cc *grpc.ClientConn +} + +func NewOfficeServiceClient(cc *grpc.ClientConn) OfficeServiceClient { + return &officeServiceClient{cc} +} + +func (c *officeServiceClient) GetUserTags(ctx context.Context, in *GetUserTagsReq, opts ...grpc.CallOption) (*GetUserTagsResp, error) { + out := new(GetUserTagsResp) + err := grpc.Invoke(ctx, "/office.OfficeService/GetUserTags", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) CreateTag(ctx context.Context, in *CreateTagReq, opts ...grpc.CallOption) (*CreateTagResp, error) { + out := new(CreateTagResp) + err := grpc.Invoke(ctx, "/office.OfficeService/CreateTag", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) DeleteTag(ctx context.Context, in *DeleteTagReq, opts ...grpc.CallOption) (*DeleteTagResp, error) { + out := new(DeleteTagResp) + err := grpc.Invoke(ctx, "/office.OfficeService/DeleteTag", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) SetTag(ctx context.Context, in *SetTagReq, opts ...grpc.CallOption) (*SetTagResp, error) { + out := new(SetTagResp) + err := grpc.Invoke(ctx, "/office.OfficeService/SetTag", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) SendMsg2Tag(ctx context.Context, in *SendMsg2TagReq, opts ...grpc.CallOption) (*SendMsg2TagResp, error) { + out := new(SendMsg2TagResp) + err := grpc.Invoke(ctx, "/office.OfficeService/SendMsg2Tag", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) GetTagSendLogs(ctx context.Context, in *GetTagSendLogsReq, opts ...grpc.CallOption) (*GetTagSendLogsResp, error) { + out := new(GetTagSendLogsResp) + err := grpc.Invoke(ctx, "/office.OfficeService/GetTagSendLogs", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) GetUserTagByID(ctx context.Context, in *GetUserTagByIDReq, opts ...grpc.CallOption) (*GetUserTagByIDResp, error) { + out := new(GetUserTagByIDResp) + err := grpc.Invoke(ctx, "/office.OfficeService/GetUserTagByID", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) CreateOneWorkMoment(ctx context.Context, in *CreateOneWorkMomentReq, opts ...grpc.CallOption) (*CreateOneWorkMomentResp, error) { + out := new(CreateOneWorkMomentResp) + err := grpc.Invoke(ctx, "/office.OfficeService/CreateOneWorkMoment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) DeleteOneWorkMoment(ctx context.Context, in *DeleteOneWorkMomentReq, opts ...grpc.CallOption) (*DeleteOneWorkMomentResp, error) { + out := new(DeleteOneWorkMomentResp) + err := grpc.Invoke(ctx, "/office.OfficeService/DeleteOneWorkMoment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) LikeOneWorkMoment(ctx context.Context, in *LikeOneWorkMomentReq, opts ...grpc.CallOption) (*LikeOneWorkMomentResp, error) { + out := new(LikeOneWorkMomentResp) + err := grpc.Invoke(ctx, "/office.OfficeService/LikeOneWorkMoment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) CommentOneWorkMoment(ctx context.Context, in *CommentOneWorkMomentReq, opts ...grpc.CallOption) (*CommentOneWorkMomentResp, error) { + out := new(CommentOneWorkMomentResp) + err := grpc.Invoke(ctx, "/office.OfficeService/CommentOneWorkMoment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) GetWorkMomentByID(ctx context.Context, in *GetWorkMomentByIDReq, opts ...grpc.CallOption) (*GetWorkMomentByIDResp, error) { + out := new(GetWorkMomentByIDResp) + err := grpc.Invoke(ctx, "/office.OfficeService/GetWorkMomentByID", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) ChangeWorkMomentPermission(ctx context.Context, in *ChangeWorkMomentPermissionReq, opts ...grpc.CallOption) (*ChangeWorkMomentPermissionResp, error) { + out := new(ChangeWorkMomentPermissionResp) + err := grpc.Invoke(ctx, "/office.OfficeService/ChangeWorkMomentPermission", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) GetUserWorkMoments(ctx context.Context, in *GetUserWorkMomentsReq, opts ...grpc.CallOption) (*GetUserWorkMomentsResp, error) { + out := new(GetUserWorkMomentsResp) + err := grpc.Invoke(ctx, "/office.OfficeService/GetUserWorkMoments", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) GetUserFriendWorkMoments(ctx context.Context, in *GetUserFriendWorkMomentsReq, opts ...grpc.CallOption) (*GetUserFriendWorkMomentsResp, error) { + out := new(GetUserFriendWorkMomentsResp) + err := grpc.Invoke(ctx, "/office.OfficeService/GetUserFriendWorkMoments", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) SetUserWorkMomentsLevel(ctx context.Context, in *SetUserWorkMomentsLevelReq, opts ...grpc.CallOption) (*SetUserWorkMomentsLevelResp, error) { + out := new(SetUserWorkMomentsLevelResp) + err := grpc.Invoke(ctx, "/office.OfficeService/SetUserWorkMomentsLevel", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for OfficeService service + +type OfficeServiceServer interface { + GetUserTags(context.Context, *GetUserTagsReq) (*GetUserTagsResp, error) + CreateTag(context.Context, *CreateTagReq) (*CreateTagResp, error) + DeleteTag(context.Context, *DeleteTagReq) (*DeleteTagResp, error) + SetTag(context.Context, *SetTagReq) (*SetTagResp, error) + SendMsg2Tag(context.Context, *SendMsg2TagReq) (*SendMsg2TagResp, error) + GetTagSendLogs(context.Context, *GetTagSendLogsReq) (*GetTagSendLogsResp, error) + GetUserTagByID(context.Context, *GetUserTagByIDReq) (*GetUserTagByIDResp, error) + CreateOneWorkMoment(context.Context, *CreateOneWorkMomentReq) (*CreateOneWorkMomentResp, error) + DeleteOneWorkMoment(context.Context, *DeleteOneWorkMomentReq) (*DeleteOneWorkMomentResp, error) + LikeOneWorkMoment(context.Context, *LikeOneWorkMomentReq) (*LikeOneWorkMomentResp, error) + CommentOneWorkMoment(context.Context, *CommentOneWorkMomentReq) (*CommentOneWorkMomentResp, error) + GetWorkMomentByID(context.Context, *GetWorkMomentByIDReq) (*GetWorkMomentByIDResp, error) + ChangeWorkMomentPermission(context.Context, *ChangeWorkMomentPermissionReq) (*ChangeWorkMomentPermissionResp, error) + // / user self + GetUserWorkMoments(context.Context, *GetUserWorkMomentsReq) (*GetUserWorkMomentsResp, error) + // / users friend + GetUserFriendWorkMoments(context.Context, *GetUserFriendWorkMomentsReq) (*GetUserFriendWorkMomentsResp, error) + SetUserWorkMomentsLevel(context.Context, *SetUserWorkMomentsLevelReq) (*SetUserWorkMomentsLevelResp, error) +} + +func RegisterOfficeServiceServer(s *grpc.Server, srv OfficeServiceServer) { + s.RegisterService(&_OfficeService_serviceDesc, srv) +} + +func _OfficeService_GetUserTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserTagsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).GetUserTags(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/GetUserTags", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).GetUserTags(ctx, req.(*GetUserTagsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_CreateTag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateTagReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).CreateTag(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/CreateTag", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).CreateTag(ctx, req.(*CreateTagReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_DeleteTag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteTagReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).DeleteTag(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/DeleteTag", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).DeleteTag(ctx, req.(*DeleteTagReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_SetTag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetTagReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).SetTag(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/SetTag", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).SetTag(ctx, req.(*SetTagReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_SendMsg2Tag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendMsg2TagReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).SendMsg2Tag(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/SendMsg2Tag", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).SendMsg2Tag(ctx, req.(*SendMsg2TagReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_GetTagSendLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTagSendLogsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).GetTagSendLogs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/GetTagSendLogs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).GetTagSendLogs(ctx, req.(*GetTagSendLogsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_GetUserTagByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserTagByIDReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).GetUserTagByID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/GetUserTagByID", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).GetUserTagByID(ctx, req.(*GetUserTagByIDReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_CreateOneWorkMoment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateOneWorkMomentReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).CreateOneWorkMoment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/CreateOneWorkMoment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).CreateOneWorkMoment(ctx, req.(*CreateOneWorkMomentReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_DeleteOneWorkMoment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteOneWorkMomentReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).DeleteOneWorkMoment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/DeleteOneWorkMoment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).DeleteOneWorkMoment(ctx, req.(*DeleteOneWorkMomentReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_LikeOneWorkMoment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LikeOneWorkMomentReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).LikeOneWorkMoment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/LikeOneWorkMoment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).LikeOneWorkMoment(ctx, req.(*LikeOneWorkMomentReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_CommentOneWorkMoment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CommentOneWorkMomentReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).CommentOneWorkMoment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/CommentOneWorkMoment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).CommentOneWorkMoment(ctx, req.(*CommentOneWorkMomentReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_GetWorkMomentByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetWorkMomentByIDReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).GetWorkMomentByID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/GetWorkMomentByID", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).GetWorkMomentByID(ctx, req.(*GetWorkMomentByIDReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_ChangeWorkMomentPermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChangeWorkMomentPermissionReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).ChangeWorkMomentPermission(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/ChangeWorkMomentPermission", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).ChangeWorkMomentPermission(ctx, req.(*ChangeWorkMomentPermissionReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_GetUserWorkMoments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserWorkMomentsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).GetUserWorkMoments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/GetUserWorkMoments", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).GetUserWorkMoments(ctx, req.(*GetUserWorkMomentsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_GetUserFriendWorkMoments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserFriendWorkMomentsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).GetUserFriendWorkMoments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/GetUserFriendWorkMoments", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).GetUserFriendWorkMoments(ctx, req.(*GetUserFriendWorkMomentsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_SetUserWorkMomentsLevel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetUserWorkMomentsLevelReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).SetUserWorkMomentsLevel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/SetUserWorkMomentsLevel", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).SetUserWorkMomentsLevel(ctx, req.(*SetUserWorkMomentsLevelReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _OfficeService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "office.OfficeService", + HandlerType: (*OfficeServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetUserTags", + Handler: _OfficeService_GetUserTags_Handler, + }, + { + MethodName: "CreateTag", + Handler: _OfficeService_CreateTag_Handler, + }, + { + MethodName: "DeleteTag", + Handler: _OfficeService_DeleteTag_Handler, + }, + { + MethodName: "SetTag", + Handler: _OfficeService_SetTag_Handler, + }, + { + MethodName: "SendMsg2Tag", + Handler: _OfficeService_SendMsg2Tag_Handler, + }, + { + MethodName: "GetTagSendLogs", + Handler: _OfficeService_GetTagSendLogs_Handler, + }, + { + MethodName: "GetUserTagByID", + Handler: _OfficeService_GetUserTagByID_Handler, + }, + { + MethodName: "CreateOneWorkMoment", + Handler: _OfficeService_CreateOneWorkMoment_Handler, + }, + { + MethodName: "DeleteOneWorkMoment", + Handler: _OfficeService_DeleteOneWorkMoment_Handler, + }, + { + MethodName: "LikeOneWorkMoment", + Handler: _OfficeService_LikeOneWorkMoment_Handler, + }, + { + MethodName: "CommentOneWorkMoment", + Handler: _OfficeService_CommentOneWorkMoment_Handler, + }, + { + MethodName: "GetWorkMomentByID", + Handler: _OfficeService_GetWorkMomentByID_Handler, + }, + { + MethodName: "ChangeWorkMomentPermission", + Handler: _OfficeService_ChangeWorkMomentPermission_Handler, + }, + { + MethodName: "GetUserWorkMoments", + Handler: _OfficeService_GetUserWorkMoments_Handler, + }, + { + MethodName: "GetUserFriendWorkMoments", + Handler: _OfficeService_GetUserFriendWorkMoments_Handler, + }, + { + MethodName: "SetUserWorkMomentsLevel", + Handler: _OfficeService_SetUserWorkMomentsLevel_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "office/office.proto", +} + +func init() { proto.RegisterFile("office/office.proto", fileDescriptor_office_45d86d1784e03bf7) } + +var fileDescriptor_office_45d86d1784e03bf7 = []byte{ + // 1621 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x59, 0x4f, 0x6f, 0xdc, 0x44, + 0x14, 0x97, 0x77, 0xb3, 0xd9, 0xec, 0xdb, 0xb4, 0x69, 0x26, 0xff, 0xb6, 0x6e, 0x93, 0x06, 0xb7, + 0x45, 0x15, 0xa0, 0x04, 0x85, 0x0a, 0x21, 0x10, 0x15, 0x6a, 0xb6, 0x8d, 0x16, 0xb2, 0x6d, 0x70, + 0x12, 0x2a, 0x38, 0x10, 0xb9, 0x9b, 0x89, 0xb1, 0xb2, 0xb1, 0x5d, 0x8f, 0x93, 0xd0, 0x13, 0x52, + 0xcf, 0x70, 0xe2, 0xcc, 0xa7, 0xe0, 0x33, 0x70, 0xe0, 0x84, 0x38, 0xf0, 0x0d, 0xf8, 0x0e, 0x5c, + 0xd1, 0x8c, 0xed, 0xf9, 0x63, 0x8f, 0x77, 0x17, 0x17, 0x0e, 0x9c, 0xd6, 0xef, 0xcd, 0x9b, 0x37, + 0xef, 0xfd, 0xe6, 0xcd, 0x9b, 0x37, 0x6f, 0x61, 0x21, 0x38, 0x39, 0xf1, 0x06, 0x78, 0x33, 0xf9, + 0xd9, 0x08, 0xa3, 0x20, 0x0e, 0xd0, 0x74, 0x42, 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cd, 0x34, 0xd3, 0x3f, + 0x7c, 0xd9, 0xeb, 0xfe, 0x17, 0xc9, 0xcb, 0x65, 0x58, 0x29, 0x8b, 0x54, 0xc4, 0x6a, 0x15, 0xea, + 0xb1, 0xe3, 0xa6, 0x20, 0x29, 0x17, 0x0a, 0xe5, 0x5b, 0x0f, 0x60, 0x66, 0xd7, 0x3b, 0xc5, 0x95, + 0xef, 0xe9, 0xc7, 0x70, 0xed, 0x49, 0x10, 0x7b, 0x27, 0xde, 0x80, 0x99, 0x5e, 0x59, 0xcf, 0x5f, + 0x06, 0x34, 0xa9, 0x07, 0x34, 0x8a, 0x2a, 0xcc, 0xa7, 0x31, 0x79, 0xe2, 0x0c, 0xf0, 0xa1, 0xbd, + 0x9b, 0x25, 0xdb, 0x94, 0xa4, 0x60, 0x47, 0x38, 0x1c, 0xbe, 0x4c, 0x72, 0x64, 0x76, 0x9d, 0x49, + 0x2c, 0x74, 0x07, 0xae, 0x70, 0x92, 0x29, 0x6f, 0x30, 0x19, 0x95, 0x49, 0x73, 0x55, 0x1a, 0xe6, + 0x3c, 0xad, 0x0a, 0x86, 0x7c, 0x26, 0x9a, 0xea, 0x99, 0x58, 0x03, 0x18, 0x24, 0x97, 0x25, 0x3d, + 0x15, 0x33, 0x2c, 0x4f, 0x49, 0x1c, 0xab, 0x07, 0x73, 0x7b, 0x38, 0x3a, 0xf3, 0x08, 0xf1, 0x02, + 0x9f, 0x25, 0x3f, 0xba, 0x94, 0x4b, 0x3f, 0xa4, 0x5b, 0x5d, 0x30, 0xe8, 0x52, 0x8c, 0xe0, 0x51, + 0x95, 0x91, 0x56, 0x17, 0xae, 0x3e, 0x0b, 0xa2, 0xd3, 0x7e, 0x40, 0x61, 0xac, 0xbc, 0x15, 0xdf, + 0x4f, 0x01, 0x08, 0x35, 0xc8, 0x82, 0xd9, 0x4b, 0x4e, 0x71, 0x45, 0x0a, 0xaf, 0x34, 0x0d, 0xc9, + 0xcb, 0xd4, 0xcb, 0x77, 0x6c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, 0xcd, 0x72, 0xfb, 0xfe, 0x8f, 0x88, 0xff, 0x50, 0x87, 0xeb, 0x62, 0x09, 0xf9, 0x61, 0xd1, + 0x27, 0x2e, 0x7a, 0x17, 0x16, 0x7c, 0x95, 0x75, 0xf0, 0x32, 0xcc, 0x1a, 0x92, 0xba, 0xa1, 0x62, + 0x65, 0x5f, 0xd3, 0x55, 0xf6, 0xaf, 0x73, 0x81, 0x28, 0xaf, 0x82, 0x46, 0xfe, 0x55, 0x90, 0xcf, + 0x67, 0xd3, 0x23, 0x4b, 0x8c, 0x66, 0x69, 0xed, 0x3c, 0x53, 0x5e, 0x3b, 0xb7, 0xd4, 0xda, 0xf9, + 0x1d, 0x98, 0x17, 0xda, 0xb7, 0x53, 0x9b, 0x81, 0xc9, 0x14, 0x07, 0x72, 0xb5, 0x5f, 0xbb, 0x50, + 0xfb, 0x0d, 0xc1, 0xdc, 0x2f, 0x1c, 0xe6, 0x5d, 0x7c, 0x81, 0x87, 0x63, 0x1e, 0xbd, 0x43, 0x2a, + 0xc3, 0xd0, 0x6e, 0xd8, 0x09, 0x31, 0x41, 0x3c, 0x7f, 0x0e, 0x37, 0x4a, 0x57, 0xab, 0x16, 0xcd, + 0x5b, 0xaf, 0x00, 0xae, 0x3c, 0x65, 0x12, 0xfb, 0x38, 0xba, 0xf0, 0x06, 0x18, 0x3d, 0x80, 0xb6, + 0xd4, 0xa8, 0x45, 0xbc, 0x42, 0x56, 0x3b, 0xc1, 0xe6, 0x8a, 0x96, 0x4f, 0x42, 0xf4, 0x01, 0xb4, + 0x78, 0xef, 0x13, 0x2d, 0xf2, 0xe5, 0xa5, 0x96, 0xac, 0xb9, 0xa4, 0xe1, 0x26, 0x33, 0x79, 0x43, + 0x52, 0xcc, 0x94, 0x7b, 0xa0, 0x62, 0xa6, 0xda, 0xb9, 0xdc, 0x84, 0xe9, 0xa4, 0x63, 0x87, 0xe6, + 0x33, 0x01, 0xde, 0x94, 0x34, 0x51, 0x9e, 0x45, 0x42,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0xf3, 0xf6, 0x58, 0x19, 0x12, 0x3e, 0x9c, 0xff, 0x6a, 0x6e, 0x23, 0xfd, 0x1f, 0xf0, 0xa3, 0xe4, + 0xe7, 0xf9, 0x34, 0xfb, 0x93, 0xef, 0xbd, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x01, 0xfa, 0xac, + 0xd6, 0x26, 0x1c, 0x00, 0x00, +} From 6500ba48a7d63377807de53e0e65758fa3e9e557 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Sun, 24 Apr 2022 18:23:44 +0800 Subject: [PATCH 16/51] work_moments --- internal/rpc/office/office.go | 4 ++-- pkg/common/db/mongoModel.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/rpc/office/office.go b/internal/rpc/office/office.go index e0b54dddf..dffaa872a 100644 --- a/internal/rpc/office/office.go +++ b/internal/rpc/office/office.go @@ -485,6 +485,7 @@ func (s *officeServer) GetWorkMomentByID(_ context.Context, req *pbOffice.GetWor func (s *officeServer) GetUserWorkMoments(_ context.Context, req *pbOffice.GetUserWorkMomentsReq) (resp *pbOffice.GetUserWorkMomentsResp, err error) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) resp = &pbOffice.GetUserWorkMomentsResp{CommonResp: &pbOffice.CommonResp{}, WorkMoments: []*pbOffice.WorkMoment{}} + resp.Pagination = &pbCommon.ResponsePagination{CurrentPage: req.Pagination.PageNumber, ShowNumber: req.Pagination.ShowNumber} var workMoments []db.WorkMoment if req.UserID == req.OpUserID { workMoments, err = db.DB.GetUserSelfWorkMoments(req.UserID, req.Pagination.ShowNumber, req.Pagination.PageNumber) @@ -499,7 +500,6 @@ func (s *officeServer) GetUserWorkMoments(_ context.Context, req *pbOffice.GetUs if err := utils.CopyStructFields(&resp.WorkMoments, workMoments); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - resp.Pagination = &pbCommon.ResponsePagination{CurrentPage: req.Pagination.PageNumber, ShowNumber: req.Pagination.ShowNumber} log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) return resp, nil } @@ -507,6 +507,7 @@ func (s *officeServer) GetUserWorkMoments(_ context.Context, req *pbOffice.GetUs func (s *officeServer) GetUserFriendWorkMoments(_ context.Context, req *pbOffice.GetUserFriendWorkMomentsReq) (resp *pbOffice.GetUserFriendWorkMomentsResp, err error) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) resp = &pbOffice.GetUserFriendWorkMomentsResp{CommonResp: &pbOffice.CommonResp{}, WorkMoments: []*pbOffice.WorkMoment{}} + resp.Pagination = &pbCommon.ResponsePagination{CurrentPage: req.Pagination.PageNumber, ShowNumber: req.Pagination.ShowNumber} //resp.WorkMoments = make([]*pbOffice.WorkMoment, 0) friendIDList, err := imdb.GetFriendIDListByUserID(req.UserID) if err != nil { @@ -524,7 +525,6 @@ func (s *officeServer) GetUserFriendWorkMoments(_ context.Context, req *pbOffice if err := utils.CopyStructFields(&resp.WorkMoments, workMoments); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - resp.Pagination = &pbCommon.ResponsePagination{CurrentPage: req.Pagination.PageNumber, ShowNumber: req.Pagination.ShowNumber} log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) return resp, nil } diff --git a/pkg/common/db/mongoModel.go b/pkg/common/db/mongoModel.go index 6ff42d558..dbda0f346 100644 --- a/pkg/common/db/mongoModel.go +++ b/pkg/common/db/mongoModel.go @@ -680,8 +680,8 @@ func (d *DataBases) GetUserWorkMoments(opUserID, userID string, showNumber, page result, err := c.Find(ctx, bson.D{ // 等价条件: select * from {"user_id", userID}, {"$or", bson.A{ - bson.D{{"permission", constant.WorkMomentPermissionCantSee}, {opUserID, bson.D{{"$nin", "permission_user_id_list"}}}}, - bson.D{{"permission", constant.WorkMomentPermissionCanSee}, {opUserID, bson.D{{"$in", "permission_user_id_list"}}}}, + bson.D{{"permission", constant.WorkMomentPermissionCantSee}, {"permission_user_id_list", bson.D{{"$nin", bson.A{userID}}}}}, + bson.D{{"permission", constant.WorkMomentPermissionCanSee}, {"permission_user_id_list", bson.D{{"$in", bson.A{userID}}}}}, bson.D{{"permission", constant.WorkMomentPublic}}, }}, }, findOpts) @@ -700,8 +700,8 @@ func (d *DataBases) GetUserFriendWorkMoments(friendIDList []*string, showNumber, result, err := c.Find(ctx, bson.D{ // 等价条件: select * from t where user_id in friend_id_list and () or () or (); {"user_id", bson.D{{"$in", friendIDList}}}, {"$or", bson.A{ - bson.D{{"permission", constant.WorkMomentPermissionCantSee}, {userID, bson.D{{"$nin", "permission_user_id_list"}}}}, - bson.D{{"permission", constant.WorkMomentPermissionCanSee}, {userID, bson.D{{"$in", "permission_user_id_list"}}}}, + bson.D{{"permission", constant.WorkMomentPermissionCantSee}, {"permission_user_id_list", bson.D{{"$nin", bson.A{userID}}}}}, + bson.D{{"permission", constant.WorkMomentPermissionCanSee}, {"permission_user_id_list", bson.D{{"$in", bson.A{userID}}}}}, bson.D{{"permission", constant.WorkMomentPublic}}, }}, }, findOpts) From 30df45ef2ed323cfcb8f5242d0afe1429ae9fe3b Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Sun, 24 Apr 2022 18:49:03 +0800 Subject: [PATCH 17/51] work_moments --- pkg/common/db/mongoModel.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pkg/common/db/mongoModel.go b/pkg/common/db/mongoModel.go index dbda0f346..fe4ec5ab8 100644 --- a/pkg/common/db/mongoModel.go +++ b/pkg/common/db/mongoModel.go @@ -697,13 +697,17 @@ func (d *DataBases) GetUserFriendWorkMoments(friendIDList []*string, showNumber, c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cWorkMoment) var workMomentList []WorkMoment findOpts := options.Find().SetLimit(int64(showNumber)).SetSkip(int64(showNumber) * (int64(pageNumber) - 1)).SetSort(bson.M{"create_time": -1}) - result, err := c.Find(ctx, bson.D{ // 等价条件: select * from t where user_id in friend_id_list and () or () or (); - {"user_id", bson.D{{"$in", friendIDList}}}, + result, err := c.Find(ctx, bson.D{ {"$or", bson.A{ - bson.D{{"permission", constant.WorkMomentPermissionCantSee}, {"permission_user_id_list", bson.D{{"$nin", bson.A{userID}}}}}, - bson.D{{"permission", constant.WorkMomentPermissionCanSee}, {"permission_user_id_list", bson.D{{"$in", bson.A{userID}}}}}, - bson.D{{"permission", constant.WorkMomentPublic}}, - }}, + bson.D{{"user_id", userID}}, //self + bson.D{{"user_id", bson.D{{"$in", friendIDList}}}, + {"$or", bson.A{ + bson.D{{"permission", constant.WorkMomentPermissionCantSee}, {"permission_user_id_list", bson.D{{"$nin", bson.A{userID}}}}}, + bson.D{{"permission", constant.WorkMomentPermissionCanSee}, {"permission_user_id_list", bson.D{{"$in", bson.A{userID}}}}}, + bson.D{{"permission", constant.WorkMomentPublic}}, + }}}, + }, + }, }, findOpts) if err != nil { return workMomentList, err From bccaf163438eb2a766d7a8732024f8ff72c800a1 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 25 Apr 2022 10:07:14 +0800 Subject: [PATCH 18/51] work_moments --- internal/api/office/work_moments.go | 3 +-- pkg/common/db/model.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/api/office/work_moments.go b/internal/api/office/work_moments.go index 267bc7e3b..b5960ade7 100644 --- a/internal/api/office/work_moments.go +++ b/internal/api/office/work_moments.go @@ -201,8 +201,7 @@ func GetWorkMomentByID(c *gin.Context) { if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - //resp.Data.WorkMoment = respPb.WorkMoment - resp.Data.WorkMoment = &apiStruct.WorkMoment{} + resp.Data.WorkMoment = &apiStruct.WorkMoment{LikeUserList: []*apiStruct.WorkMomentUser{}, Comments: []*apiStruct.Comment{}, AtUserList: []*apiStruct.WorkMomentUser{}} if err := utils.CopyStructFields(&resp.Data.WorkMoment, respPb.WorkMoment); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } diff --git a/pkg/common/db/model.go b/pkg/common/db/model.go index 3ffce9ddf..2fe0ed367 100644 --- a/pkg/common/db/model.go +++ b/pkg/common/db/model.go @@ -73,7 +73,7 @@ func init() { cCommentMsgModels := []mongo.IndexModel{ { - Keys: bson.M{"create_time": -1, "user_id": -1}, + Keys: bson.A{bson.D{{"create_time", -1}, {"user_id", -1}}}, }, } result, err := dataBase.Collection(cCommentMsg).Indexes().CreateMany(context.Background(), cCommentMsgModels, opts) From 03c3eea54efd39628a37a3b373d5863e17c87291 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 25 Apr 2022 10:35:20 +0800 Subject: [PATCH 19/51] work_moments --- internal/api/office/work_moments.go | 81 +++++++++++++++++++++++++++-- 1 file changed, 77 insertions(+), 4 deletions(-) diff --git a/internal/api/office/work_moments.go b/internal/api/office/work_moments.go index b5960ade7..7cfe54fb2 100644 --- a/internal/api/office/work_moments.go +++ b/internal/api/office/work_moments.go @@ -243,11 +243,48 @@ func GetUserWorkMoments(c *gin.Context) { c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserWorkMoments rpc server failed" + err.Error()}) return } + resp.Data.WorkMoments = []*apiStruct.WorkMoment{} if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - if err := utils.CopyStructFields(&resp.Data.WorkMoments, respPb.WorkMoments); err != nil { - log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + //if err := utils.CopyStructFields(&resp.Data.WorkMoments, respPb.WorkMoments); err != nil { + // log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + //} + for _, v := range respPb.WorkMoments { + workMoment := apiStruct.WorkMoment{ + WorkMomentID: v.WorkMomentID, + UserID: v.UserID, + Content: v.Content, + FaceURL: v.FaceURL, + UserName: v.UserName, + CreateTime: v.CreateTime, + Comments: make([]*apiStruct.Comment, len(v.Comments)), + LikeUserList: make([]*apiStruct.WorkMomentUser, len(v.LikeUserList)), + AtUserList: make([]*apiStruct.WorkMomentUser, len(v.AtUserList)), + } + for i, comment := range v.Comments { + workMoment.Comments[i] = &apiStruct.Comment{ + UserID: comment.UserID, + UserName: comment.UserName, + ReplyUserID: comment.ReplyUserID, + ReplyUserName: comment.ReplyUserID, + ContentID: comment.ContentID, + Content: comment.Content, + CreateTime: comment.CreateTime, + } + } + for i, likeUser := range v.LikeUserList { + workMoment.LikeUserList[i] = &apiStruct.WorkMomentUser{ + UserID: likeUser.UserID, + UserName: likeUser.UserName, + } + } + for i, atUser := range v.AtUserList { + workMoment.AtUserList[i] = &apiStruct.WorkMomentUser{ + UserID: atUser.UserID, + UserName: atUser.UserName, + } + } } resp.Data.ShowNumber = respPb.Pagination.ShowNumber resp.Data.CurrentPage = respPb.Pagination.CurrentPage @@ -291,8 +328,44 @@ func GetUserFriendWorkMoments(c *gin.Context) { if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - if err := utils.CopyStructFields(&resp.Data.WorkMoments, respPb.WorkMoments); err != nil { - log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + //if err := utils.CopyStructFields(&resp.Data.WorkMoments, respPb.WorkMoments); err != nil { + // log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + //} + for _, v := range respPb.WorkMoments { + workMoment := apiStruct.WorkMoment{ + WorkMomentID: v.WorkMomentID, + UserID: v.UserID, + Content: v.Content, + FaceURL: v.FaceURL, + UserName: v.UserName, + CreateTime: v.CreateTime, + Comments: make([]*apiStruct.Comment, len(v.Comments)), + LikeUserList: make([]*apiStruct.WorkMomentUser, len(v.LikeUserList)), + AtUserList: make([]*apiStruct.WorkMomentUser, len(v.AtUserList)), + } + for i, comment := range v.Comments { + workMoment.Comments[i] = &apiStruct.Comment{ + UserID: comment.UserID, + UserName: comment.UserName, + ReplyUserID: comment.ReplyUserID, + ReplyUserName: comment.ReplyUserID, + ContentID: comment.ContentID, + Content: comment.Content, + CreateTime: comment.CreateTime, + } + } + for i, likeUser := range v.LikeUserList { + workMoment.LikeUserList[i] = &apiStruct.WorkMomentUser{ + UserID: likeUser.UserID, + UserName: likeUser.UserName, + } + } + for i, atUser := range v.AtUserList { + workMoment.AtUserList[i] = &apiStruct.WorkMomentUser{ + UserID: atUser.UserID, + UserName: atUser.UserName, + } + } } resp.Data.ShowNumber = respPb.Pagination.ShowNumber resp.Data.CurrentPage = respPb.Pagination.CurrentPage From ac31c612b3920512d51ae44e652a6d95213d249f Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 25 Apr 2022 10:40:31 +0800 Subject: [PATCH 20/51] work_moments --- internal/api/office/work_moments.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/api/office/work_moments.go b/internal/api/office/work_moments.go index 7cfe54fb2..4b1f211d5 100644 --- a/internal/api/office/work_moments.go +++ b/internal/api/office/work_moments.go @@ -285,6 +285,7 @@ func GetUserWorkMoments(c *gin.Context) { UserName: atUser.UserName, } } + resp.Data.WorkMoments = append(resp.Data.WorkMoments, &workMoment) } resp.Data.ShowNumber = respPb.Pagination.ShowNumber resp.Data.CurrentPage = respPb.Pagination.CurrentPage @@ -331,6 +332,7 @@ func GetUserFriendWorkMoments(c *gin.Context) { //if err := utils.CopyStructFields(&resp.Data.WorkMoments, respPb.WorkMoments); err != nil { // log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) //} + resp.Data.WorkMoments = []*apiStruct.WorkMoment{} for _, v := range respPb.WorkMoments { workMoment := apiStruct.WorkMoment{ WorkMomentID: v.WorkMomentID, @@ -366,6 +368,7 @@ func GetUserFriendWorkMoments(c *gin.Context) { UserName: atUser.UserName, } } + resp.Data.WorkMoments = append(resp.Data.WorkMoments, &workMoment) } resp.Data.ShowNumber = respPb.Pagination.ShowNumber resp.Data.CurrentPage = respPb.Pagination.CurrentPage From a426c8bb2668ac200d818fd73956cd73fa3a9f96 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Mon, 25 Apr 2022 15:45:39 +0800 Subject: [PATCH 21/51] Adjust port --- cmd/Open-IM-SDK-Core | 2 +- cmd/open_im_demo/main.go | 2 +- config/config.yaml | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/Open-IM-SDK-Core b/cmd/Open-IM-SDK-Core index 539290887..b0897aa3a 160000 --- a/cmd/Open-IM-SDK-Core +++ b/cmd/Open-IM-SDK-Core @@ -1 +1 @@ -Subproject commit 539290887aff41515b291b7ecf174af25887f870 +Subproject commit b0897aa3abe719729c2ce099404f08806917bfe3 diff --git a/cmd/open_im_demo/main.go b/cmd/open_im_demo/main.go index af7809547..4cfd4b552 100644 --- a/cmd/open_im_demo/main.go +++ b/cmd/open_im_demo/main.go @@ -23,7 +23,7 @@ func main() { r := gin.Default() r.Use(utils.CorsHandler()) - authRouterGroup := r.Group("/auth") + authRouterGroup := r.Group("/demo") { authRouterGroup.POST("/code", register.SendVerificationCode) authRouterGroup.POST("/verify", register.Verify) diff --git a/config/config.yaml b/config/config.yaml index aab4e1737..f68ec633d 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -76,11 +76,11 @@ endpoints: rpc_office: openim_rpc_office api: - openImApiPort: [ 10000 ] #api服务端口,默认即可,需要开放此端口或做nginx转发 + openImApiPort: [ 10002 ] #api服务端口,默认即可,需要开放此端口或做nginx转发 cmsapi: - openImCmsApiPort: [ 8000 ] #管理后台api服务端口,默认即可,需要开放此端口或做nginx转发 + openImCmsApiPort: [ 10006 ] #管理后台api服务端口,默认即可,需要开放此端口或做nginx转发 sdk: - openImSdkWsPort: [ 30000 ] #jssdk服务端口,默认即可,项目中使用jssdk才需开放此端口或做nginx转发 + openImSdkWsPort: [ 10003 ] #jssdk服务端口,默认即可,项目中使用jssdk才需开放此端口或做nginx转发 #对象存储服务,以下配置二选一,目前支持两种,腾讯云和minio,二者配置好其中一种即可(如果使用minio参考https://doc.rentsoft.cn/#/qa/minio搭建minio服务器) credential: #腾讯cos,发送图片、视频、文件时需要,请自行申请后替换,必须修改 tencent: @@ -92,8 +92,8 @@ credential: #腾讯cos,发送图片、视频、文件时需要,请自行申 minio: #MinIO 发送图片、视频、文件时需要,请自行申请后替换,必须修改。 客户端初始化InitSDK,中 object_storage参数为minio bucket: openim location: us-east-1 - endpoint: http://127.0.0.1:9000 #minio外网ip 这个ip是给客户端访问的 - endpointInner: http://127.0.0.1:9000 #minio内网地址 如果im server 可以通过内网访问到 minio就可以填写 + endpoint: http://127.0.0.1:10005 #minio外网ip 这个ip是给客户端访问的 + endpointInner: http://127.0.0.1:10005 #minio内网地址 如果im server 可以通过内网访问到 minio就可以填写 endpointInnerEnable: true #是否启用minio内网地址 启用可以让桶初始化,IM server连接minio走内网地址访问 accessKeyID: user12345 secretAccessKey: key12345 @@ -166,7 +166,7 @@ modulename: #日志文件按模块命名,默认即可 pushName: push longconnsvr: - openImWsPort: [ 17778 ] # ws服务端口,默认即可,要开放此端口或做nginx转发 + openImWsPort: [ 10001 ] # ws服务端口,默认即可,要开放此端口或做nginx转发 websocketMaxConnNum: 10000 websocketMaxMsgLen: 4096 websocketTimeOut: 10 @@ -634,7 +634,7 @@ notification: demoswitch: true demo: #demo对外服务端口,默认即可,需要开放此端口或做nginx转发 - openImDemoPort: [ 42233 ] + openImDemoPort: [ 10004 ] alismsverify: #阿里云短信配置,在阿里云申请成功后修改以下四项,必须修改 accessKeyId: LTAI5tJPkn4HuuePdiLdGqe7 accessKeySecret: 4n9OJ7ZCVN1U6KeHDAtOyNeVZcjOuV From 9d691f24520245d0e3d0724b447a44d17a6ff5a4 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Mon, 25 Apr 2022 16:21:48 +0800 Subject: [PATCH 22/51] Adjust port --- config/config.yaml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index f68ec633d..285dd0434 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -111,19 +111,19 @@ credential: #腾讯cos,发送图片、视频、文件时需要,请自行申 rpcport: #rpc服务端口 默认即可 - openImUserPort: [ 10100 ] - openImFriendPort: [ 10200 ] - openImMessagePort: [ 10300 ] - openImMessageGatewayPort: [ 10400 ] - openImGroupPort: [ 10500 ] - openImAuthPort: [ 10600 ] - openImPushPort: [ 10700 ] - openImStatisticsPort: [ 10800 ] - openImMessageCmsPort: [ 10900 ] - openImAdminCmsPort: [ 11000 ] - openImOfficePort: [ 11100 ] - openImOrganizationPort: [ 11200 ] - openImConversationPort: [ 11400 ] + openImUserPort: [ 10110 ] + openImFriendPort: [ 10120 ] + openImMessagePort: [ 10130 ] + openImMessageGatewayPort: [ 10140 ] + openImGroupPort: [ 10150 ] + openImAuthPort: [ 10160 ] + openImPushPort: [ 10170 ] + openImStatisticsPort: [ 10180 ] + openImMessageCmsPort: [ 10190 ] + openImAdminCmsPort: [ 10200 ] + openImOfficePort: [ 10210 ] + openImOrganizationPort: [ 10220 ] + openImConversationPort: [ 10230 ] c2c: callbackBeforeSendMsg: switch: false From e2905d01accdc30280e63209611900bcbf5d5a9e Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Mon, 25 Apr 2022 16:47:51 +0800 Subject: [PATCH 23/51] Adjust port --- internal/demo/register/login.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/demo/register/login.go b/internal/demo/register/login.go index e6de926dc..1c9d65fce 100644 --- a/internal/demo/register/login.go +++ b/internal/demo/register/login.go @@ -46,7 +46,7 @@ func Login(c *gin.Context) { c.JSON(http.StatusOK, gin.H{"errCode": constant.PasswordErr, "errMsg": "password err"}) return } - url := fmt.Sprintf("http://%s:10000/auth/user_token", utils.ServerIP) + url := fmt.Sprintf("http://%s:%d/auth/user_token", utils.ServerIP, config.Config.Api.GinPort) openIMGetUserToken := api.UserTokenReq{} openIMGetUserToken.OperationID = params.OperationID openIMGetUserToken.Platform = params.Platform From f754e951f7974a085233cfb5a951ec4bc67d42df Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Mon, 25 Apr 2022 16:55:56 +0800 Subject: [PATCH 24/51] Adjust port --- internal/demo/register/login.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/demo/register/login.go b/internal/demo/register/login.go index 1c9d65fce..3e20e3d4a 100644 --- a/internal/demo/register/login.go +++ b/internal/demo/register/login.go @@ -46,7 +46,7 @@ func Login(c *gin.Context) { c.JSON(http.StatusOK, gin.H{"errCode": constant.PasswordErr, "errMsg": "password err"}) return } - url := fmt.Sprintf("http://%s:%d/auth/user_token", utils.ServerIP, config.Config.Api.GinPort) + url := fmt.Sprintf("http://%s:%s/auth/user_token", utils.ServerIP, config.Config.Api.GinPort[0]) openIMGetUserToken := api.UserTokenReq{} openIMGetUserToken.OperationID = params.OperationID openIMGetUserToken.Platform = params.Platform From 7659cca8ba34452012735b598a8c2fbe7e68fca8 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Mon, 25 Apr 2022 16:58:05 +0800 Subject: [PATCH 25/51] Adjust port --- internal/demo/register/login.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/demo/register/login.go b/internal/demo/register/login.go index 3e20e3d4a..24ebc3e80 100644 --- a/internal/demo/register/login.go +++ b/internal/demo/register/login.go @@ -46,7 +46,7 @@ func Login(c *gin.Context) { c.JSON(http.StatusOK, gin.H{"errCode": constant.PasswordErr, "errMsg": "password err"}) return } - url := fmt.Sprintf("http://%s:%s/auth/user_token", utils.ServerIP, config.Config.Api.GinPort[0]) + url := fmt.Sprintf("http://%s:%d/auth/user_token", utils.ServerIP, config.Config.Api.GinPort[0]) openIMGetUserToken := api.UserTokenReq{} openIMGetUserToken.OperationID = params.OperationID openIMGetUserToken.Platform = params.Platform From a89bb33015d4dda9db40320b28b7a10d9b40bff6 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Mon, 25 Apr 2022 16:58:35 +0800 Subject: [PATCH 26/51] Adjust port --- internal/demo/register/login.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/demo/register/login.go b/internal/demo/register/login.go index 24ebc3e80..b5d587844 100644 --- a/internal/demo/register/login.go +++ b/internal/demo/register/login.go @@ -42,7 +42,7 @@ func Login(c *gin.Context) { return } if r.Password != params.Password { - log.NewError(params.OperationID, "password err", params.Password, account, r.Password, r.Account) + log.NewError(params.OperationID, "password err", params.Password, account, r.Password, r.Account) c.JSON(http.StatusOK, gin.H{"errCode": constant.PasswordErr, "errMsg": "password err"}) return } From 51ee2df755460569541c536177b5aabaeea6da48 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Mon, 25 Apr 2022 17:13:54 +0800 Subject: [PATCH 27/51] flag parse update --- cmd/open_im_cms_api/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/open_im_cms_api/main.go b/cmd/open_im_cms_api/main.go index 20e6380db..d4889dc9d 100644 --- a/cmd/open_im_cms_api/main.go +++ b/cmd/open_im_cms_api/main.go @@ -15,6 +15,7 @@ func main() { router := cms_api.NewGinRouter() router.Use(utils.CorsHandler()) ginPort := flag.Int("port", 8000, "get ginServerPort from cmd,default 8000 as port") + flag.Parse() fmt.Println("start cms api server, port: ", ginPort) router.Run(":" + strconv.Itoa(*ginPort)) } From d12d03fd5ee826c0c9540f71fe60d1ed927bdc3a Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Mon, 25 Apr 2022 17:28:43 +0800 Subject: [PATCH 28/51] Adjust port --- script/check_all.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/script/check_all.sh b/script/check_all.sh index 2ecd800b0..79a233bde 100644 --- a/script/check_all.sh +++ b/script/check_all.sh @@ -4,8 +4,11 @@ source ./style_info.cfg source ./path_info.cfg source ./function.sh service_port_name=( - openImCmsApiPort + openImWsPort openImApiPort + openImSdkWsPort + openImDemoPort + openImCmsApiPort openImUserPort openImFriendPort openImMessagePort @@ -13,13 +16,10 @@ service_port_name=( openImGroupPort openImAuthPort openImPushPort - openImWsPort - openImSdkWsPort - openImDemoPort - openImAdminCmsPort - openImMessageCmsPort openImStatisticsPort + openImMessageCmsPort openImOfficePort + openImAdminCmsPort openImOrganizationPort openImConversationPort ) From fdc462d0714404746e0980f5dfd1c3ca1cc50cd8 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Mon, 25 Apr 2022 17:30:13 +0800 Subject: [PATCH 29/51] Adjust port --- script/check_all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/check_all.sh b/script/check_all.sh index 79a233bde..60abfad69 100644 --- a/script/check_all.sh +++ b/script/check_all.sh @@ -18,8 +18,8 @@ service_port_name=( openImPushPort openImStatisticsPort openImMessageCmsPort - openImOfficePort openImAdminCmsPort + openImOfficePort openImOrganizationPort openImConversationPort ) From b3077fc15de76586b1d003214bf98fb2d5dbdd24 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Mon, 25 Apr 2022 19:14:51 +0800 Subject: [PATCH 30/51] conversation update --- pkg/common/db/mysql_model/im_mysql_model/conversation_model.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/common/db/mysql_model/im_mysql_model/conversation_model.go b/pkg/common/db/mysql_model/im_mysql_model/conversation_model.go index 2c252222d..ae90907bf 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/conversation_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/conversation_model.go @@ -140,6 +140,6 @@ func UpdateColumnsConversations(ownerUserIDList []string, conversationID string, return err } dbConn.LogMode(false) - return dbConn.Model(&db.Conversation{}).Where("owner_user_id IN ? and conversation_id=?", ownerUserIDList, conversationID).Updates(args).Error + return dbConn.Debug().Model(&db.Conversation{}).Where("owner_user_id IN ? and conversation_id=?", ownerUserIDList, conversationID).Updates(args).Error } From eebe9cbd5faa621cc5ebaff01f503089ae10b66a Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Mon, 25 Apr 2022 19:41:17 +0800 Subject: [PATCH 31/51] conversation update --- pkg/common/db/mysql_model/im_mysql_model/conversation_model.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/common/db/mysql_model/im_mysql_model/conversation_model.go b/pkg/common/db/mysql_model/im_mysql_model/conversation_model.go index ae90907bf..6dc010784 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/conversation_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/conversation_model.go @@ -140,6 +140,6 @@ func UpdateColumnsConversations(ownerUserIDList []string, conversationID string, return err } dbConn.LogMode(false) - return dbConn.Debug().Model(&db.Conversation{}).Where("owner_user_id IN ? and conversation_id=?", ownerUserIDList, conversationID).Updates(args).Error + return dbConn.Debug().Model(&db.Conversation{}).Where("owner_user_id IN (?) and conversation_id=?", ownerUserIDList, conversationID).Updates(args).Error } From 9a9f26c435405fe419e6170ad4b2054a7f81e906 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Mon, 25 Apr 2022 19:56:46 +0800 Subject: [PATCH 32/51] conversation update --- internal/rpc/conversation/conversaion.go | 2 +- .../db/mysql_model/im_mysql_model/conversation_model.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/rpc/conversation/conversaion.go b/internal/rpc/conversation/conversaion.go index aec03fd26..7012e0924 100644 --- a/internal/rpc/conversation/conversaion.go +++ b/internal/rpc/conversation/conversaion.go @@ -47,7 +47,7 @@ func (rpc *rpcConversation) ModifyConversationField(c context.Context, req *pbCo if err := utils.CopyStructFields(&conversation, req.Conversation); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", *req.Conversation, err.Error()) } - haveUserID, _ := imdb.GetExistConversationUserIDList(req.Conversation.ConversationID) + haveUserID, _ := imdb.GetExistConversationUserIDList(req.UserIDList, req.Conversation.ConversationID) switch req.FieldType { case constant.FieldRecvMsgOpt: for _, v := range req.UserIDList { diff --git a/pkg/common/db/mysql_model/im_mysql_model/conversation_model.go b/pkg/common/db/mysql_model/im_mysql_model/conversation_model.go index 6dc010784..0af86c57d 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/conversation_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/conversation_model.go @@ -93,13 +93,13 @@ func GetMultipleUserConversationByConversationID(ownerUserIDList []string, conve err = dbConn.Model(&db.Conversation{}).Where("owner_user_id IN ? and conversation_id=?", ownerUserIDList, conversationID).Find(&conversations).Error return conversations, err } -func GetExistConversationUserIDList(conversationID string) ([]string, error) { +func GetExistConversationUserIDList(ownerUserIDList []string, conversationID string) ([]string, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return nil, err } var resultArr []string - err = dbConn.Table("conversations").Where(" conversation_id=?", conversationID).Pluck("owner_user_id", &resultArr).Error + err = dbConn.Table("conversations").Where(" owner_user_id IN (?) and conversation_id=?", ownerUserIDList, conversationID).Pluck("owner_user_id", &resultArr).Error if err != nil { return nil, err } From 80301f2cb2d65f9adc773f15f56999702efba3e1 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 25 Apr 2022 19:57:35 +0800 Subject: [PATCH 33/51] alter router --- internal/cms_api/router.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cms_api/router.go b/internal/cms_api/router.go index 941cc5bf5..a0221d536 100644 --- a/internal/cms_api/router.go +++ b/internal/cms_api/router.go @@ -15,7 +15,7 @@ import ( func NewGinRouter() *gin.Engine { gin.SetMode(gin.ReleaseMode) baseRouter := gin.Default() - router := baseRouter.Group("/api") + router := baseRouter.Group("/cms") router.Use(middleware.CorsHandler()) adminRouterGroup := router.Group("/admin") { From a03f89fb68e6313aaeed4432e5c11ce3b0ba85ce Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 25 Apr 2022 20:05:21 +0800 Subject: [PATCH 34/51] cache rpc --- cmd/rpc/open_im_rpc/Makefile | 23 +++++ cmd/rpc/open_im_rpc/main.go | 15 ++++ config/config.yaml | 1 + internal/api/third/minio_init.go | 11 +-- internal/api/user/user.go | 140 ++++++++++++++++++++++++++----- internal/rpc/cache/cache.go | 103 +++++++++++++++++++++++ internal/rpc/office/office.go | 5 +- pkg/common/config/config.go | 1 + pkg/common/db/redisModel.go | 23 +++++ pkg/proto/cache/cache.proto | 44 ++++++++++ 10 files changed, 338 insertions(+), 28 deletions(-) create mode 100644 cmd/rpc/open_im_rpc/Makefile create mode 100644 cmd/rpc/open_im_rpc/main.go create mode 100644 internal/rpc/cache/cache.go create mode 100644 pkg/proto/cache/cache.proto diff --git a/cmd/rpc/open_im_rpc/Makefile b/cmd/rpc/open_im_rpc/Makefile new file mode 100644 index 000000000..b86230c64 --- /dev/null +++ b/cmd/rpc/open_im_rpc/Makefile @@ -0,0 +1,23 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_office +BIN_DIR=../../../bin/ + +all: gotool build + +build: + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" + +run: + @go run ./ + +gotool: + go fmt ./ + go vet ./ + +install: + make build + mv ${BINARY_NAME} ${BIN_DIR} + +clean: + @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi diff --git a/cmd/rpc/open_im_rpc/main.go b/cmd/rpc/open_im_rpc/main.go new file mode 100644 index 000000000..efe887c1e --- /dev/null +++ b/cmd/rpc/open_im_rpc/main.go @@ -0,0 +1,15 @@ +package main + +import ( + rpc "Open_IM/internal/rpc/cache" + "flag" + "fmt" +) + +func main() { + rpcPort := flag.Int("port", 11500, "rpc listening port") + flag.Parse() + fmt.Println("start office rpc server, port: ", *rpcPort) + rpcServer := rpc.NewOfficeServer(*rpcPort) + rpcServer.Run() +} diff --git a/config/config.yaml b/config/config.yaml index 285dd0434..4bb653511 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -148,6 +148,7 @@ rpcregistername: #rpc注册服务名,默认即可 openImOfficeName: Office openImOrganizationName: Organization openImConversationName: Conversation + openImCacheName: Cache log: storageLocation: ../logs/ diff --git a/internal/api/third/minio_init.go b/internal/api/third/minio_init.go index b3d66b934..2c00965bf 100644 --- a/internal/api/third/minio_init.go +++ b/internal/api/third/minio_init.go @@ -7,6 +7,7 @@ import ( "context" "github.com/minio/minio-go/v7" "github.com/minio/minio-go/v7/pkg/credentials" + "github.com/minio/minio-go/v7/pkg/policy" url2 "net/url" ) @@ -58,10 +59,10 @@ func MinioInit() { } } // 自动化桶public的代码 - //err = minioClient.SetBucketPolicy(context.Background(), config.Config.Credential.Minio.Bucket, policy.BucketPolicyReadWrite) - //if err != nil { - // log.NewError("", utils.GetSelfFuncName(), "SetBucketPolicy failed please set in web", err.Error()) - // return - //} + err = minioClient.SetBucketPolicy(context.Background(), config.Config.Credential.Minio.Bucket, policy.BucketPolicyReadWrite) + if err != nil { + log.NewDebug("", utils.GetSelfFuncName(), "SetBucketPolicy failed please set in web", err.Error()) + return + } log.NewInfo(operationID, utils.GetSelfFuncName(), "minio create and set policy success") } diff --git a/internal/api/user/user.go b/internal/api/user/user.go index 4fbbcf5ef..e56689897 100644 --- a/internal/api/user/user.go +++ b/internal/api/user/user.go @@ -8,6 +8,7 @@ import ( "Open_IM/pkg/common/log" "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" + "Open_IM/pkg/proto/cache" pbRelay "Open_IM/pkg/proto/relay" open_im_sdk "Open_IM/pkg/proto/sdk_ws" rpc "Open_IM/pkg/proto/user" @@ -25,34 +26,100 @@ func GetUsersInfo(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"errCode": http.StatusBadRequest, "errMsg": err.Error()}) return } - req := &rpc.GetUserInfoReq{} - utils.CopyStructFields(req, ¶ms) + getUserInfoReq := &rpc.GetUserInfoReq{} + getUserInfoReq.OperationID = params.OperationID var ok bool - ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + ok, getUserInfoReq.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), getUserInfoReq.OperationID) if !ok { - log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + log.NewError(getUserInfoReq.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) return } - log.NewInfo(params.OperationID, "GetUserInfo args ", req.String()) + log.NewInfo(params.OperationID, "GetUserInfo args ", getUserInfoReq.String()) + reqCacheGetUserInfo := &cache.GetUserInfoReq{} + utils.CopyStructFields(reqCacheGetUserInfo, ¶ms) + var userInfoList []*open_im_sdk.UserInfo + var publicUserInfoList []*open_im_sdk.PublicUserInfo + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + cacheClient := cache.NewCacheClient(etcdConn) + cacheResp, err := cacheClient.GetUserInfo(context.Background(), reqCacheGetUserInfo) + if err != nil { + log.NewError(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "GetUserInfo failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed: " + err.Error()}) + return + } + if cacheResp.CommonResp.ErrCode != 0 { + log.NewError(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "GetUserInfo failed", cacheResp.CommonResp) + resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}} + resp.Data = []map[string]interface{}{} + log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp) + c.JSON(http.StatusOK, resp) + return + } + log.NewInfo(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "cacheResp:", cacheResp.String()) + userInfoList = cacheResp.UserInfoList + var needCacheUserIDList []string + for _, userID := range reqCacheGetUserInfo.UserIDList { + isGetUserInfoFromCache := false + for _, cacheUser := range userInfoList { + if cacheUser.UserID == userID { + isGetUserInfoFromCache = true + } + } + if !isGetUserInfoFromCache { + needCacheUserIDList = append(needCacheUserIDList, userID) + } + } + if len(needCacheUserIDList) == 0 { + log.NewInfo(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "get all userInfo from cache success") + for _, v := range userInfoList { + publicUserInfoList = append(publicUserInfoList, + &open_im_sdk.PublicUserInfo{UserID: v.UserID, Nickname: v.Nickname, FaceURL: v.FaceURL, Gender: v.Gender, Ex: v.Ex}) + } + resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}, UserInfoList: publicUserInfoList} + resp.Data = jsonData.JsonDataList(resp.UserInfoList) + log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp) + c.JSON(http.StatusOK, resp) + return + } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + log.NewDebug(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "need cache user list", needCacheUserIDList) + getUserInfoReq.UserIDList = needCacheUserIDList + etcdConn = getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) client := rpc.NewUserClient(etcdConn) - RpcResp, err := client.GetUserInfo(context.Background(), req) + rpcResp, err := client.GetUserInfo(context.Background(), getUserInfoReq) if err != nil { - log.NewError(req.OperationID, "GetUserInfo failed ", err.Error(), req.String()) + log.NewError(getUserInfoReq.OperationID, "GetUserInfo failed ", err.Error(), getUserInfoReq.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed" + err.Error()}) + return + } + if rpcResp.CommonResp.ErrCode != 0 { + log.NewError(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "GetUserInfo failed", cacheResp.CommonResp) + resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}} + resp.Data = []map[string]interface{}{} + log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp) + c.JSON(http.StatusOK, resp) + return + } + userInfoList = append(userInfoList, rpcResp.UserInfoList...) + cacheUpdateUserInfoReq := &cache.UpdateUserInfoReq{ + UserInfoList: rpcResp.UserInfoList, + OperationID: getUserInfoReq.OperationID, + } + _, err = cacheClient.UpdateUserInfo(context.Background(), cacheUpdateUserInfoReq) + if err != nil { + log.NewError(getUserInfoReq.OperationID, "GetUserInfo failed ", err.Error()) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) return } - var publicUserInfoList []*open_im_sdk.PublicUserInfo - for _, v := range RpcResp.UserInfoList { + userInfoList = rpcResp.UserInfoList + for _, v := range userInfoList { publicUserInfoList = append(publicUserInfoList, &open_im_sdk.PublicUserInfo{UserID: v.UserID, Nickname: v.Nickname, FaceURL: v.FaceURL, Gender: v.Gender, Ex: v.Ex}) } - - resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, UserInfoList: publicUserInfoList} + resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: rpcResp.CommonResp.ErrCode, ErrMsg: rpcResp.CommonResp.ErrMsg}, UserInfoList: publicUserInfoList} resp.Data = jsonData.JsonDataList(resp.UserInfoList) - log.NewInfo(req.OperationID, "GetUserInfo api return ", resp) + log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp) c.JSON(http.StatusOK, resp) } @@ -75,18 +142,34 @@ func UpdateUserInfo(c *gin.Context) { return } log.NewInfo(params.OperationID, "UpdateUserInfo args ", req.String()) - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) - client := rpc.NewUserClient(etcdConn) - RpcResp, err := client.UpdateUserInfo(context.Background(), req) + etcdConnUser := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := rpc.NewUserClient(etcdConnUser) + rpcResp, err := client.UpdateUserInfo(context.Background(), req) if err != nil { log.NewError(req.OperationID, "UpdateUserInfo failed ", err.Error(), req.String()) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) return } - resp := api.UpdateUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} - log.NewInfo(req.OperationID, "UpdateUserInfo api return ", resp) - c.JSON(http.StatusOK, resp) + if rpcResp.CommonResp.ErrCode != 0 { + log.NewError(req.OperationID, utils.GetSelfFuncName(), rpcResp.CommonResp.String()) + resp := api.UpdateUserInfoResp{CommResp: api.CommResp{ErrCode: rpcResp.CommonResp.ErrCode, ErrMsg: rpcResp.CommonResp.ErrMsg}} + c.JSON(http.StatusOK, resp) + return + } else { + updateUserInfoReq := &cache.UpdateUserInfoReq{UserInfoList: []*open_im_sdk.UserInfo{req.UserInfo}} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), updateUserInfoReq.String()) + etcdConnCache := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + cacheClient := cache.NewCacheClient(etcdConnCache) + cacheResp, err := cacheClient.UpdateUserInfo(context.Background(), updateUserInfoReq) + if err != nil { + log.NewError(req.OperationID, "UpdateUserInfo cache failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed: " + err.Error()}) + return + } + resp := api.UpdateUserInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}} + log.NewInfo(req.OperationID, "UpdateUserInfo api return ", resp) + c.JSON(http.StatusOK, resp) + } } func GetSelfUserInfo(c *gin.Context) { @@ -118,6 +201,22 @@ func GetSelfUserInfo(c *gin.Context) { return } if len(RpcResp.UserInfoList) == 1 { + updateUserInfoReq := &cache.UpdateUserInfoReq{UserInfoList: []*open_im_sdk.UserInfo{RpcResp.UserInfoList[0]}} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), updateUserInfoReq.String()) + etcdConnCache := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + cacheClient := cache.NewCacheClient(etcdConnCache) + cacheResp, err := cacheClient.UpdateUserInfo(context.Background(), updateUserInfoReq) + if err != nil { + log.NewError(req.OperationID, "UpdateUserInfo cache failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed: " + err.Error()}) + return + } + if cacheResp.CommonResp.ErrCode != 0 { + log.NewError(req.OperationID, utils.GetSelfFuncName(), cacheResp.CommonResp.String()) + resp := api.UpdateUserInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}} + c.JSON(http.StatusOK, resp) + return + } resp := api.GetSelfUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, UserInfo: RpcResp.UserInfoList[0]} resp.Data = jsonData.JsonDataOne(resp.UserInfo) log.NewInfo(req.OperationID, "GetUserInfo api return ", resp) @@ -127,7 +226,6 @@ func GetSelfUserInfo(c *gin.Context) { log.NewInfo(req.OperationID, "GetUserInfo api return ", resp) c.JSON(http.StatusOK, resp) } - } func GetUsersOnlineStatus(c *gin.Context) { diff --git a/internal/rpc/cache/cache.go b/internal/rpc/cache/cache.go new file mode 100644 index 000000000..e172ed723 --- /dev/null +++ b/internal/rpc/cache/cache.go @@ -0,0 +1,103 @@ +package cache + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbCache "Open_IM/pkg/proto/cache" + commonPb "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "google.golang.org/grpc" + "net" + "strconv" + "strings" +) + +type cacheServer struct { + rpcPort int + rpcRegisterName string + etcdSchema string + etcdAddr []string +} + +func NewOfficeServer(port int) *cacheServer { + log.NewPrivateLog(constant.LogFileName) + return &cacheServer{ + rpcPort: port, + rpcRegisterName: config.Config.RpcRegisterName.OpenImOfficeName, + etcdSchema: config.Config.Etcd.EtcdSchema, + etcdAddr: config.Config.Etcd.EtcdAddr, + } +} + +func (s *cacheServer) Run() { + log.NewInfo("0", "cacheServer rpc start ") + ip := utils.ServerIP + registerAddress := ip + ":" + strconv.Itoa(s.rpcPort) + //listener network + listener, err := net.Listen("tcp", registerAddress) + if err != nil { + log.NewError("0", "Listen failed ", err.Error(), registerAddress) + return + } + log.NewInfo("0", "listen network success, ", registerAddress, listener) + defer listener.Close() + //grpc server + srv := grpc.NewServer() + defer srv.GracefulStop() + pbCache.RegisterCacheServer(srv, s) + err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName, 10) + if err != nil { + log.NewError("0", "RegisterEtcd failed ", err.Error()) + return + } + err = srv.Serve(listener) + if err != nil { + log.NewError("0", "Serve failed ", err.Error()) + return + } + log.NewInfo("0", "message cms rpc success") +} + +func (s *cacheServer) GetUserInfo(_ context.Context, req *pbCache.GetUserInfoReq) (resp *pbCache.GetUserInfoResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbCache.GetUserInfoResp{ + UserInfoList: []*commonPb.UserInfo{}, + CommonResp: &pbCache.CommonResp{}, + } + for _, userID := range req.UserIDList { + userInfo, err := db.DB.GetUserInfo(userID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "get userInfo from cache failed", err.Error()) + continue + } + resp.UserInfoList = append(resp.UserInfoList, userInfo) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *cacheServer) UpdateUserInfo(_ context.Context, req *pbCache.UpdateUserInfoReq) (resp *pbCache.UpdateUserInfoResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbCache.UpdateUserInfoResp{ + CommonResp: &pbCache.CommonResp{}, + } + for _, userInfo := range req.UserInfoList { + if err := db.DB.SetUserInfo(userInfo); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "set userInfo to cache failed", err.Error()) + return resp, nil + } + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *cacheServer) UpdateAllUserToCache(_ context.Context, req *pbCache.UpdateAllUserToCacheReq) (resp *pbCache.UpdateAllUserToCacheResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbCache.UpdateAllUserToCacheResp{CommonResp: &pbCache.CommonResp{}} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} diff --git a/internal/rpc/office/office.go b/internal/rpc/office/office.go index dffaa872a..3fd9fb6fe 100644 --- a/internal/rpc/office/office.go +++ b/internal/rpc/office/office.go @@ -508,14 +508,15 @@ func (s *officeServer) GetUserFriendWorkMoments(_ context.Context, req *pbOffice log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) resp = &pbOffice.GetUserFriendWorkMomentsResp{CommonResp: &pbOffice.CommonResp{}, WorkMoments: []*pbOffice.WorkMoment{}} resp.Pagination = &pbCommon.ResponsePagination{CurrentPage: req.Pagination.PageNumber, ShowNumber: req.Pagination.ShowNumber} - //resp.WorkMoments = make([]*pbOffice.WorkMoment, 0) friendIDList, err := imdb.GetFriendIDListByUserID(req.UserID) if err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetFriendIDListByUserID", err.Error()) resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} return resp, nil } - log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "friendIDList: ", friendIDList) + for _, friendID := range friendIDList { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), *friendID) + } workMoments, err := db.DB.GetUserFriendWorkMoments(friendIDList, req.Pagination.ShowNumber, req.Pagination.PageNumber, req.UserID) if err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserFriendWorkMoments", err.Error()) diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index 49e0e0849..bd4998335 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -119,6 +119,7 @@ type config struct { OpenImOfficeName string `yaml:"openImOfficeName"` OpenImOrganizationName string `yaml:"openImOrganizationName"` OpenImConversationName string `yaml:"openImConversationName"` + OpenImCacheName string `yaml:"openImCacheName"` } Etcd struct { EtcdSchema string `yaml:"etcdSchema"` diff --git a/pkg/common/db/redisModel.go b/pkg/common/db/redisModel.go index 2faa9a6d8..9b32b18d7 100644 --- a/pkg/common/db/redisModel.go +++ b/pkg/common/db/redisModel.go @@ -3,6 +3,8 @@ package db import ( "Open_IM/pkg/common/constant" log2 "Open_IM/pkg/common/log" + pbCommon "Open_IM/pkg/proto/sdk_ws" + "encoding/json" "github.com/garyburd/redigo/redis" ) @@ -15,6 +17,7 @@ const ( uidPidToken = "UID_PID_TOKEN_STATUS:" conversationReceiveMessageOpt = "CON_RECV_MSG_OPT:" GetuiToken = "GETUI" + UserInfoCache = "USER_INFO_CACHE:" ) func (d *DataBases) Exec(cmd string, key interface{}, args ...interface{}) (interface{}, error) { @@ -155,3 +158,23 @@ func (d *DataBases) GetGetuiToken() (string, error) { result, err := redis.String(d.Exec("GET", GetuiToken)) return result, err } + +func (d *DataBases) SetUserInfo(userInfo *pbCommon.UserInfo) error { + b, _ := json.Marshal(&userInfo) + m := map[string]interface{}{} + if err := json.Unmarshal(b, &m); err != nil { + return err + } + _, err := d.Exec("hmset", UserInfoCache+userInfo.UserID, redis.Args{}.Add().AddFlat(m)...) + return err +} + +func (d *DataBases) GetUserInfo(userID string) (*pbCommon.UserInfo, error) { + result, err := redis.String(d.Exec("HGETALL", UserInfoCache+userID)) + if err != nil { + return nil, err + } + userInfo := &pbCommon.UserInfo{} + err = json.Unmarshal([]byte(result), userInfo) + return userInfo, err +} diff --git a/pkg/proto/cache/cache.proto b/pkg/proto/cache/cache.proto new file mode 100644 index 000000000..cecfabd3c --- /dev/null +++ b/pkg/proto/cache/cache.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; +import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +option go_package = "./cache;cache"; +package cache; + +message CommonResp{ + int32 errCode = 1; + string errMsg = 2; +} + +message GetUserInfoReq{ + repeated string userIDList = 1; + string operationID = 3; +} + +message GetUserInfoResp{ + CommonResp commonResp = 1; + repeated server_api_params.UserInfo UserInfoList = 2; +} + + +message UpdateUserInfoReq{ + repeated server_api_params.UserInfo UserInfoList = 1; + string operationID = 2; +} + +message UpdateUserInfoResp{ + CommonResp commonResp = 1; +} + +message UpdateAllUserToCacheReq{ + string operationID = 1; +} + +message UpdateAllUserToCacheResp{ + CommonResp commonResp = 1; +} + + +service cache{ + rpc GetUserInfo(GetUserInfoReq) returns(GetUserInfoResp); + rpc UpdateUserInfo(UpdateUserInfoReq) returns(UpdateUserInfoResp); + rpc UpdateAllUserToCache(UpdateAllUserToCacheReq) returns(UpdateAllUserToCacheResp); +} From 9f9ebd838ac928da422895b07219f7bc1b111950 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 25 Apr 2022 20:16:43 +0800 Subject: [PATCH 35/51] cache rpc --- pkg/proto/cache/cache.pb.go | 501 ++++++++++++++++++++++++++++++++++++ 1 file changed, 501 insertions(+) create mode 100644 pkg/proto/cache/cache.pb.go diff --git a/pkg/proto/cache/cache.pb.go b/pkg/proto/cache/cache.pb.go new file mode 100644 index 000000000..649784738 --- /dev/null +++ b/pkg/proto/cache/cache.pb.go @@ -0,0 +1,501 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: cache/cache.proto + +package cache // import "./cache" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import sdk_ws "Open_IM/pkg/proto/sdk_ws" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type CommonResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CommonResp) Reset() { *m = CommonResp{} } +func (m *CommonResp) String() string { return proto.CompactTextString(m) } +func (*CommonResp) ProtoMessage() {} +func (*CommonResp) Descriptor() ([]byte, []int) { + return fileDescriptor_cache_613af94c3da056d4, []int{0} +} +func (m *CommonResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommonResp.Unmarshal(m, b) +} +func (m *CommonResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommonResp.Marshal(b, m, deterministic) +} +func (dst *CommonResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommonResp.Merge(dst, src) +} +func (m *CommonResp) XXX_Size() int { + return xxx_messageInfo_CommonResp.Size(m) +} +func (m *CommonResp) XXX_DiscardUnknown() { + xxx_messageInfo_CommonResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CommonResp proto.InternalMessageInfo + +func (m *CommonResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *CommonResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type GetUserInfoReq struct { + UserIDList []string `protobuf:"bytes,1,rep,name=userIDList" json:"userIDList,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserInfoReq) Reset() { *m = GetUserInfoReq{} } +func (m *GetUserInfoReq) String() string { return proto.CompactTextString(m) } +func (*GetUserInfoReq) ProtoMessage() {} +func (*GetUserInfoReq) Descriptor() ([]byte, []int) { + return fileDescriptor_cache_613af94c3da056d4, []int{1} +} +func (m *GetUserInfoReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserInfoReq.Unmarshal(m, b) +} +func (m *GetUserInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserInfoReq.Marshal(b, m, deterministic) +} +func (dst *GetUserInfoReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserInfoReq.Merge(dst, src) +} +func (m *GetUserInfoReq) XXX_Size() int { + return xxx_messageInfo_GetUserInfoReq.Size(m) +} +func (m *GetUserInfoReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserInfoReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserInfoReq proto.InternalMessageInfo + +func (m *GetUserInfoReq) GetUserIDList() []string { + if m != nil { + return m.UserIDList + } + return nil +} + +func (m *GetUserInfoReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetUserInfoResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + UserInfoList []*sdk_ws.UserInfo `protobuf:"bytes,2,rep,name=UserInfoList" json:"UserInfoList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserInfoResp) Reset() { *m = GetUserInfoResp{} } +func (m *GetUserInfoResp) String() string { return proto.CompactTextString(m) } +func (*GetUserInfoResp) ProtoMessage() {} +func (*GetUserInfoResp) Descriptor() ([]byte, []int) { + return fileDescriptor_cache_613af94c3da056d4, []int{2} +} +func (m *GetUserInfoResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserInfoResp.Unmarshal(m, b) +} +func (m *GetUserInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserInfoResp.Marshal(b, m, deterministic) +} +func (dst *GetUserInfoResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserInfoResp.Merge(dst, src) +} +func (m *GetUserInfoResp) XXX_Size() int { + return xxx_messageInfo_GetUserInfoResp.Size(m) +} +func (m *GetUserInfoResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserInfoResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserInfoResp proto.InternalMessageInfo + +func (m *GetUserInfoResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetUserInfoResp) GetUserInfoList() []*sdk_ws.UserInfo { + if m != nil { + return m.UserInfoList + } + return nil +} + +type UpdateUserInfoReq struct { + UserInfoList []*sdk_ws.UserInfo `protobuf:"bytes,1,rep,name=UserInfoList" json:"UserInfoList,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateUserInfoReq) Reset() { *m = UpdateUserInfoReq{} } +func (m *UpdateUserInfoReq) String() string { return proto.CompactTextString(m) } +func (*UpdateUserInfoReq) ProtoMessage() {} +func (*UpdateUserInfoReq) Descriptor() ([]byte, []int) { + return fileDescriptor_cache_613af94c3da056d4, []int{3} +} +func (m *UpdateUserInfoReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateUserInfoReq.Unmarshal(m, b) +} +func (m *UpdateUserInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateUserInfoReq.Marshal(b, m, deterministic) +} +func (dst *UpdateUserInfoReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateUserInfoReq.Merge(dst, src) +} +func (m *UpdateUserInfoReq) XXX_Size() int { + return xxx_messageInfo_UpdateUserInfoReq.Size(m) +} +func (m *UpdateUserInfoReq) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateUserInfoReq.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateUserInfoReq proto.InternalMessageInfo + +func (m *UpdateUserInfoReq) GetUserInfoList() []*sdk_ws.UserInfo { + if m != nil { + return m.UserInfoList + } + return nil +} + +func (m *UpdateUserInfoReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type UpdateUserInfoResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateUserInfoResp) Reset() { *m = UpdateUserInfoResp{} } +func (m *UpdateUserInfoResp) String() string { return proto.CompactTextString(m) } +func (*UpdateUserInfoResp) ProtoMessage() {} +func (*UpdateUserInfoResp) Descriptor() ([]byte, []int) { + return fileDescriptor_cache_613af94c3da056d4, []int{4} +} +func (m *UpdateUserInfoResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateUserInfoResp.Unmarshal(m, b) +} +func (m *UpdateUserInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateUserInfoResp.Marshal(b, m, deterministic) +} +func (dst *UpdateUserInfoResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateUserInfoResp.Merge(dst, src) +} +func (m *UpdateUserInfoResp) XXX_Size() int { + return xxx_messageInfo_UpdateUserInfoResp.Size(m) +} +func (m *UpdateUserInfoResp) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateUserInfoResp.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateUserInfoResp proto.InternalMessageInfo + +func (m *UpdateUserInfoResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type UpdateAllUserToCacheReq struct { + OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateAllUserToCacheReq) Reset() { *m = UpdateAllUserToCacheReq{} } +func (m *UpdateAllUserToCacheReq) String() string { return proto.CompactTextString(m) } +func (*UpdateAllUserToCacheReq) ProtoMessage() {} +func (*UpdateAllUserToCacheReq) Descriptor() ([]byte, []int) { + return fileDescriptor_cache_613af94c3da056d4, []int{5} +} +func (m *UpdateAllUserToCacheReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateAllUserToCacheReq.Unmarshal(m, b) +} +func (m *UpdateAllUserToCacheReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateAllUserToCacheReq.Marshal(b, m, deterministic) +} +func (dst *UpdateAllUserToCacheReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateAllUserToCacheReq.Merge(dst, src) +} +func (m *UpdateAllUserToCacheReq) XXX_Size() int { + return xxx_messageInfo_UpdateAllUserToCacheReq.Size(m) +} +func (m *UpdateAllUserToCacheReq) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateAllUserToCacheReq.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateAllUserToCacheReq proto.InternalMessageInfo + +func (m *UpdateAllUserToCacheReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type UpdateAllUserToCacheResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateAllUserToCacheResp) Reset() { *m = UpdateAllUserToCacheResp{} } +func (m *UpdateAllUserToCacheResp) String() string { return proto.CompactTextString(m) } +func (*UpdateAllUserToCacheResp) ProtoMessage() {} +func (*UpdateAllUserToCacheResp) Descriptor() ([]byte, []int) { + return fileDescriptor_cache_613af94c3da056d4, []int{6} +} +func (m *UpdateAllUserToCacheResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateAllUserToCacheResp.Unmarshal(m, b) +} +func (m *UpdateAllUserToCacheResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateAllUserToCacheResp.Marshal(b, m, deterministic) +} +func (dst *UpdateAllUserToCacheResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateAllUserToCacheResp.Merge(dst, src) +} +func (m *UpdateAllUserToCacheResp) XXX_Size() int { + return xxx_messageInfo_UpdateAllUserToCacheResp.Size(m) +} +func (m *UpdateAllUserToCacheResp) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateAllUserToCacheResp.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateAllUserToCacheResp proto.InternalMessageInfo + +func (m *UpdateAllUserToCacheResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func init() { + proto.RegisterType((*CommonResp)(nil), "cache.CommonResp") + proto.RegisterType((*GetUserInfoReq)(nil), "cache.GetUserInfoReq") + proto.RegisterType((*GetUserInfoResp)(nil), "cache.GetUserInfoResp") + proto.RegisterType((*UpdateUserInfoReq)(nil), "cache.UpdateUserInfoReq") + proto.RegisterType((*UpdateUserInfoResp)(nil), "cache.UpdateUserInfoResp") + proto.RegisterType((*UpdateAllUserToCacheReq)(nil), "cache.UpdateAllUserToCacheReq") + proto.RegisterType((*UpdateAllUserToCacheResp)(nil), "cache.UpdateAllUserToCacheResp") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// Client API for Cache service + +type CacheClient interface { + GetUserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error) + UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*UpdateUserInfoResp, error) + UpdateAllUserToCache(ctx context.Context, in *UpdateAllUserToCacheReq, opts ...grpc.CallOption) (*UpdateAllUserToCacheResp, error) +} + +type cacheClient struct { + cc *grpc.ClientConn +} + +func NewCacheClient(cc *grpc.ClientConn) CacheClient { + return &cacheClient{cc} +} + +func (c *cacheClient) GetUserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error) { + out := new(GetUserInfoResp) + err := grpc.Invoke(ctx, "/cache.cache/GetUserInfo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cacheClient) UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*UpdateUserInfoResp, error) { + out := new(UpdateUserInfoResp) + err := grpc.Invoke(ctx, "/cache.cache/UpdateUserInfo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cacheClient) UpdateAllUserToCache(ctx context.Context, in *UpdateAllUserToCacheReq, opts ...grpc.CallOption) (*UpdateAllUserToCacheResp, error) { + out := new(UpdateAllUserToCacheResp) + err := grpc.Invoke(ctx, "/cache.cache/UpdateAllUserToCache", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Cache service + +type CacheServer interface { + GetUserInfo(context.Context, *GetUserInfoReq) (*GetUserInfoResp, error) + UpdateUserInfo(context.Context, *UpdateUserInfoReq) (*UpdateUserInfoResp, error) + UpdateAllUserToCache(context.Context, *UpdateAllUserToCacheReq) (*UpdateAllUserToCacheResp, error) +} + +func RegisterCacheServer(s *grpc.Server, srv CacheServer) { + s.RegisterService(&_Cache_serviceDesc, srv) +} + +func _Cache_GetUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CacheServer).GetUserInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cache.cache/GetUserInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CacheServer).GetUserInfo(ctx, req.(*GetUserInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Cache_UpdateUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CacheServer).UpdateUserInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cache.cache/UpdateUserInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CacheServer).UpdateUserInfo(ctx, req.(*UpdateUserInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Cache_UpdateAllUserToCache_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateAllUserToCacheReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CacheServer).UpdateAllUserToCache(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cache.cache/UpdateAllUserToCache", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CacheServer).UpdateAllUserToCache(ctx, req.(*UpdateAllUserToCacheReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _Cache_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cache.cache", + HandlerType: (*CacheServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetUserInfo", + Handler: _Cache_GetUserInfo_Handler, + }, + { + MethodName: "UpdateUserInfo", + Handler: _Cache_UpdateUserInfo_Handler, + }, + { + MethodName: "UpdateAllUserToCache", + Handler: _Cache_UpdateAllUserToCache_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cache/cache.proto", +} + +func init() { proto.RegisterFile("cache/cache.proto", fileDescriptor_cache_613af94c3da056d4) } + +var fileDescriptor_cache_613af94c3da056d4 = []byte{ + // 383 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0x5d, 0x4f, 0xe2, 0x40, + 0x14, 0xcd, 0x40, 0x60, 0xc3, 0xed, 0x2e, 0x84, 0xc9, 0x2e, 0x5b, 0x6b, 0x82, 0xb5, 0x4f, 0x7d, + 0x6a, 0x23, 0x3e, 0x62, 0x34, 0x0a, 0x86, 0x90, 0x48, 0x4c, 0x26, 0x12, 0x13, 0x5f, 0x9a, 0x0a, + 0x23, 0x12, 0xa0, 0x33, 0xce, 0x54, 0xf8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x3e, 0xf5, + 0xb8, 0x2f, 0xfc, 0x85, 0x74, 0xb6, 0x37, 0xa5, 0x00, 0xd6, 0x12, 0xea, 0x43, 0x3e, 0xf6, 0x43, + 0x9a, 0xb4, 0x97, 0x65, 0x45, 0x3f, 0x64, 0xcd, 0xfa, 0x2f, 0xe4, 0xfd, 0xf7, 0x00, 0x67, 0xef, + 0xdd, 0x6b, 0x02, 0x56, 0x1b, 0xfe, 0xc7, 0x44, 0x97, 0xf3, 0x79, 0xc4, 0x75, 0xc7, 0x3a, 0x51, + 0x7b, 0x64, 0x23, 0xa3, 0x02, 0xe5, 0x55, 0x0c, 0x40, 0xdf, 0x0d, 0xde, 0x4b, 0x4b, 0xeb, 0x1d, + 0x41, 0xfc, 0x2b, 0xf1, 0x19, 0x68, 0x89, 0xd7, 0xc5, 0xff, 0xd6, 0xb8, 0xf4, 0x37, 0x32, 0x1a, + 0xbb, 0xd2, 0x92, 0xe3, 0x6b, 0xa8, 0xa6, 0x87, 0x83, 0xf5, 0x75, 0x67, 0xee, 0xad, 0x8c, 0x83, + 0x2f, 0x2a, 0x92, 0xe3, 0x7b, 0xf8, 0xbb, 0xcb, 0x1d, 0x6e, 0xa6, 0x20, 0xb9, 0xb9, 0x19, 0x47, + 0xdf, 0xd6, 0x25, 0xbf, 0xaa, 0x3d, 0xfc, 0x71, 0xe2, 0x5d, 0x6c, 0xab, 0xf3, 0xb1, 0xac, 0x16, + 0xed, 0xf4, 0x23, 0x00, 0x00, 0xff, 0xff, 0x14, 0x24, 0x83, 0x9c, 0xa7, 0x03, 0x00, 0x00, +} From 08f968dced9099f0c78702ec881e44250f06fb49 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 25 Apr 2022 20:20:34 +0800 Subject: [PATCH 36/51] cache rpc --- internal/rpc/office/office.go | 2 +- pkg/common/db/mongoModel.go | 2 +- pkg/common/db/mysql_model/im_mysql_model/friend_model.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/rpc/office/office.go b/internal/rpc/office/office.go index 3fd9fb6fe..4862e4d07 100644 --- a/internal/rpc/office/office.go +++ b/internal/rpc/office/office.go @@ -515,7 +515,7 @@ func (s *officeServer) GetUserFriendWorkMoments(_ context.Context, req *pbOffice return resp, nil } for _, friendID := range friendIDList { - log.NewDebug(req.OperationID, utils.GetSelfFuncName(), *friendID) + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), friendID) } workMoments, err := db.DB.GetUserFriendWorkMoments(friendIDList, req.Pagination.ShowNumber, req.Pagination.PageNumber, req.UserID) if err != nil { diff --git a/pkg/common/db/mongoModel.go b/pkg/common/db/mongoModel.go index fe4ec5ab8..408e50802 100644 --- a/pkg/common/db/mongoModel.go +++ b/pkg/common/db/mongoModel.go @@ -692,7 +692,7 @@ func (d *DataBases) GetUserWorkMoments(opUserID, userID string, showNumber, page return workMomentList, err } -func (d *DataBases) GetUserFriendWorkMoments(friendIDList []*string, showNumber, pageNumber int32, userID string) ([]WorkMoment, error) { +func (d *DataBases) GetUserFriendWorkMoments(friendIDList []string, showNumber, pageNumber int32, userID string) ([]WorkMoment, error) { ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cWorkMoment) var workMomentList []WorkMoment diff --git a/pkg/common/db/mysql_model/im_mysql_model/friend_model.go b/pkg/common/db/mysql_model/im_mysql_model/friend_model.go index 08d4597dc..a7b14f198 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/friend_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/friend_model.go @@ -49,12 +49,12 @@ func GetFriendListByUserID(OwnerUserID string) ([]db.Friend, error) { return friends, nil } -func GetFriendIDListByUserID(OwnerUserID string) ([]*string, error) { +func GetFriendIDListByUserID(OwnerUserID string) ([]string, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return nil, err } - var friendIDList []*string + var friendIDList []string err = dbConn.Table("friends").Select("friend_user_id").Where("owner_user_id=?", OwnerUserID).Find(&friendIDList).Error if err != nil { return nil, err From bd7266653f625900777e40618342475084de8778 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 25 Apr 2022 20:29:33 +0800 Subject: [PATCH 37/51] cache rpc --- pkg/common/db/mysql_model/im_mysql_model/friend_model.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/common/db/mysql_model/im_mysql_model/friend_model.go b/pkg/common/db/mysql_model/im_mysql_model/friend_model.go index a7b14f198..600da2f79 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/friend_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/friend_model.go @@ -55,7 +55,7 @@ func GetFriendIDListByUserID(OwnerUserID string) ([]string, error) { return nil, err } var friendIDList []string - err = dbConn.Table("friends").Select("friend_user_id").Where("owner_user_id=?", OwnerUserID).Find(&friendIDList).Error + err = dbConn.Table("friends").Where("owner_user_id=?", OwnerUserID).Pluck("friend_user_id", &friendIDList).Error if err != nil { return nil, err } From ab706f4076a1c011aea9e0095dad00a914133a2f Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Mon, 25 Apr 2022 21:13:32 +0800 Subject: [PATCH 38/51] fix bug --- cmd/open_im_api/main.go | 2 +- cmd/open_im_cms_api/main.go | 2 +- internal/api/user/user.go | 32 ++++++++++++++++---------------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cmd/open_im_api/main.go b/cmd/open_im_api/main.go index b27892d9b..888b7e728 100644 --- a/cmd/open_im_api/main.go +++ b/cmd/open_im_api/main.go @@ -174,7 +174,7 @@ func main() { } go apiThird.MinioInit() - ginPort := flag.Int("port", 10000, "get ginServerPort from cmd,default 10000 as port") + ginPort := flag.Int("port", 10002, "get ginServerPort from cmd,default 10000 as port") flag.Parse() fmt.Println("start api server, port: ", *ginPort) err := r.Run(":" + strconv.Itoa(*ginPort)) diff --git a/cmd/open_im_cms_api/main.go b/cmd/open_im_cms_api/main.go index d4889dc9d..e4061561c 100644 --- a/cmd/open_im_cms_api/main.go +++ b/cmd/open_im_cms_api/main.go @@ -14,7 +14,7 @@ func main() { gin.SetMode(gin.ReleaseMode) router := cms_api.NewGinRouter() router.Use(utils.CorsHandler()) - ginPort := flag.Int("port", 8000, "get ginServerPort from cmd,default 8000 as port") + ginPort := flag.Int("port", 10006, "get ginServerPort from cmd,default 8000 as port") flag.Parse() fmt.Println("start cms api server, port: ", ginPort) router.Run(":" + strconv.Itoa(*ginPort)) diff --git a/internal/api/user/user.go b/internal/api/user/user.go index e56689897..46e51af45 100644 --- a/internal/api/user/user.go +++ b/internal/api/user/user.go @@ -205,22 +205,22 @@ func GetSelfUserInfo(c *gin.Context) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), updateUserInfoReq.String()) etcdConnCache := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) cacheClient := cache.NewCacheClient(etcdConnCache) - cacheResp, err := cacheClient.UpdateUserInfo(context.Background(), updateUserInfoReq) - if err != nil { - log.NewError(req.OperationID, "UpdateUserInfo cache failed ", err.Error(), req.String()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed: " + err.Error()}) - return - } - if cacheResp.CommonResp.ErrCode != 0 { - log.NewError(req.OperationID, utils.GetSelfFuncName(), cacheResp.CommonResp.String()) - resp := api.UpdateUserInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}} - c.JSON(http.StatusOK, resp) - return - } - resp := api.GetSelfUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, UserInfo: RpcResp.UserInfoList[0]} - resp.Data = jsonData.JsonDataOne(resp.UserInfo) - log.NewInfo(req.OperationID, "GetUserInfo api return ", resp) - c.JSON(http.StatusOK, resp) + := cacheClient.UpdateUserInfo(context.Background(), updateUserInfoReq) + //if err != nil { + // log.NewError(req.OperationID, "UpdateUserInfo cache failed ", err.Error(), req.String()) + // c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed: " + err.Error()}) + // return + //} + //if cacheResp.CommonResp.ErrCode != 0 { + // log.NewError(req.OperationID, utils.GetSelfFuncName(), cacheResp.CommonResp.String()) + // resp := api.UpdateUserInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}} + // c.JSON(http.StatusOK, resp) + // return + //} + //resp := api.GetSelfUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, UserInfo: RpcResp.UserInfoList[0]} + //resp.Data = jsonData.JsonDataOne(resp.UserInfo) + //log.NewInfo(req.OperationID, "GetUserInfo api return ", resp) + //c.JSON(http.StatusOK, resp) } else { resp := api.GetSelfUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} log.NewInfo(req.OperationID, "GetUserInfo api return ", resp) From 4ee84e10fd7d45d7fc4034d736072c2925f721a4 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Mon, 25 Apr 2022 21:13:46 +0800 Subject: [PATCH 39/51] fix bug --- internal/api/user/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/user/user.go b/internal/api/user/user.go index 46e51af45..ad06838cf 100644 --- a/internal/api/user/user.go +++ b/internal/api/user/user.go @@ -205,7 +205,7 @@ func GetSelfUserInfo(c *gin.Context) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), updateUserInfoReq.String()) etcdConnCache := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) cacheClient := cache.NewCacheClient(etcdConnCache) - := cacheClient.UpdateUserInfo(context.Background(), updateUserInfoReq) + cacheClient.UpdateUserInfo(context.Background(), updateUserInfoReq) //if err != nil { // log.NewError(req.OperationID, "UpdateUserInfo cache failed ", err.Error(), req.String()) // c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed: " + err.Error()}) From 0bdb0668206dfe202cf4d0e7d4c72935f7b431c6 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 26 Apr 2022 09:09:33 +0800 Subject: [PATCH 40/51] add cache --- cmd/open_im_api/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/open_im_api/main.go b/cmd/open_im_api/main.go index dcf9a26b8..a33e21eab 100644 --- a/cmd/open_im_api/main.go +++ b/cmd/open_im_api/main.go @@ -34,7 +34,7 @@ func main() { r := gin.Default() r.Use(utils.CorsHandler()) - log.Info("load config: ", config.Config) + log.Info("load config: ", config.Config) // user routing group, which handles user registration and login services userRouterGroup := r.Group("/user") { From 7e44f7f110cc8bc5e8fe84accf8ba7ebfe0dcf83 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 26 Apr 2022 10:33:49 +0800 Subject: [PATCH 41/51] cache rpc --- cmd/rpc/open_im_cache/Makefile | 24 +++++ cmd/rpc/open_im_cache/main.go | 16 ++++ config/config.yaml | 1 + internal/api/user/user.go | 156 +++++++-------------------------- pkg/proto/cache/cache.proto | 28 ++++-- script/check_all.sh | 1 + script/path_info.cfg | 2 + script/start_rpc_service.sh | 2 + 8 files changed, 100 insertions(+), 130 deletions(-) create mode 100644 cmd/rpc/open_im_cache/Makefile create mode 100644 cmd/rpc/open_im_cache/main.go diff --git a/cmd/rpc/open_im_cache/Makefile b/cmd/rpc/open_im_cache/Makefile new file mode 100644 index 000000000..1cb1e959e --- /dev/null +++ b/cmd/rpc/open_im_cache/Makefile @@ -0,0 +1,24 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_cache +BIN_DIR=../../../bin/ + +all: gotool build + +build: + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" + +run: + @go run ./ + +gotool: + go fmt ./ + go vet ./ + +install: + make build + mv ${BINARY_NAME} ${BIN_DIR} + +clean: + @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi + diff --git a/cmd/rpc/open_im_cache/main.go b/cmd/rpc/open_im_cache/main.go new file mode 100644 index 000000000..2ab2eefa8 --- /dev/null +++ b/cmd/rpc/open_im_cache/main.go @@ -0,0 +1,16 @@ +package main + +import ( + rpcCache "Open_IM/internal/rpc/cache" + "flag" + "fmt" +) + +func main() { + rpcPort := flag.Int("port", 10600, "RpcToken default listen port 10800") + flag.Parse() + fmt.Println("start auth rpc server, port: ", *rpcPort) + rpcServer := rpcCache.NewOfficeServer(*rpcPort) + rpcServer.Run() + +} diff --git a/config/config.yaml b/config/config.yaml index 4bb653511..770fc31f6 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -124,6 +124,7 @@ rpcport: #rpc服务端口 默认即可 openImOfficePort: [ 10210 ] openImOrganizationPort: [ 10220 ] openImConversationPort: [ 10230 ] + openImCachePort: [10240] c2c: callbackBeforeSendMsg: switch: false diff --git a/internal/api/user/user.go b/internal/api/user/user.go index b7cb4c3df..af8448522 100644 --- a/internal/api/user/user.go +++ b/internal/api/user/user.go @@ -8,7 +8,6 @@ import ( "Open_IM/pkg/common/log" "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" - "Open_IM/pkg/proto/cache" pbRelay "Open_IM/pkg/proto/relay" open_im_sdk "Open_IM/pkg/proto/sdk_ws" rpc "Open_IM/pkg/proto/user" @@ -58,6 +57,14 @@ func GetUsersInfoFromCache(c *gin.Context) { c.JSON(http.StatusOK, resp) } +func GetUserFriendFromCache(c *gin.Context) { + +} + +func GetBlackListFromCache(c *gin.Context) { + +} + func GetUsersInfo(c *gin.Context) { params := api.GetUsersInfoReq{} if err := c.BindJSON(¶ms); err != nil { @@ -65,100 +72,34 @@ func GetUsersInfo(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"errCode": http.StatusBadRequest, "errMsg": err.Error()}) return } - getUserInfoReq := &rpc.GetUserInfoReq{} - getUserInfoReq.OperationID = params.OperationID + req := &rpc.GetUserInfoReq{} + utils.CopyStructFields(req, ¶ms) var ok bool - ok, getUserInfoReq.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), getUserInfoReq.OperationID) + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) if !ok { - log.NewError(getUserInfoReq.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) return } - log.NewInfo(params.OperationID, "GetUserInfo args ", getUserInfoReq.String()) - reqCacheGetUserInfo := &cache.GetUserInfoReq{} - utils.CopyStructFields(reqCacheGetUserInfo, ¶ms) - var userInfoList []*open_im_sdk.UserInfo - var publicUserInfoList []*open_im_sdk.PublicUserInfo - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) - cacheClient := cache.NewCacheClient(etcdConn) - cacheResp, err := cacheClient.GetUserInfo(context.Background(), reqCacheGetUserInfo) - if err != nil { - log.NewError(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "GetUserInfo failed", err.Error()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed: " + err.Error()}) - return - } - if cacheResp.CommonResp.ErrCode != 0 { - log.NewError(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "GetUserInfo failed", cacheResp.CommonResp) - resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}} - resp.Data = []map[string]interface{}{} - log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp) - c.JSON(http.StatusOK, resp) - return - } - log.NewInfo(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "cacheResp:", cacheResp.String()) - userInfoList = cacheResp.UserInfoList - var needCacheUserIDList []string - for _, userID := range reqCacheGetUserInfo.UserIDList { - isGetUserInfoFromCache := false - for _, cacheUser := range userInfoList { - if cacheUser.UserID == userID { - isGetUserInfoFromCache = true - } - } - if !isGetUserInfoFromCache { - needCacheUserIDList = append(needCacheUserIDList, userID) - } - } - if len(needCacheUserIDList) == 0 { - log.NewInfo(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "get all userInfo from cache success") - for _, v := range userInfoList { - publicUserInfoList = append(publicUserInfoList, - &open_im_sdk.PublicUserInfo{UserID: v.UserID, Nickname: v.Nickname, FaceURL: v.FaceURL, Gender: v.Gender, Ex: v.Ex}) - } - resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}, UserInfoList: publicUserInfoList} - resp.Data = jsonData.JsonDataList(resp.UserInfoList) - log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp) - c.JSON(http.StatusOK, resp) - return - } + log.NewInfo(params.OperationID, "GetUserInfo args ", req.String()) - log.NewDebug(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "need cache user list", needCacheUserIDList) - getUserInfoReq.UserIDList = needCacheUserIDList - etcdConn = getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) client := rpc.NewUserClient(etcdConn) - rpcResp, err := client.GetUserInfo(context.Background(), getUserInfoReq) - if err != nil { - log.NewError(getUserInfoReq.OperationID, "GetUserInfo failed ", err.Error(), getUserInfoReq.String()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed" + err.Error()}) - return - } - if rpcResp.CommonResp.ErrCode != 0 { - log.NewError(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "GetUserInfo failed", cacheResp.CommonResp) - resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}} - resp.Data = []map[string]interface{}{} - log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp) - c.JSON(http.StatusOK, resp) - return - } - userInfoList = append(userInfoList, rpcResp.UserInfoList...) - cacheUpdateUserInfoReq := &cache.UpdateUserInfoReq{ - UserInfoList: rpcResp.UserInfoList, - OperationID: getUserInfoReq.OperationID, - } - _, err = cacheClient.UpdateUserInfo(context.Background(), cacheUpdateUserInfoReq) + RpcResp, err := client.GetUserInfo(context.Background(), req) if err != nil { - log.NewError(getUserInfoReq.OperationID, "GetUserInfo failed ", err.Error()) + log.NewError(req.OperationID, "GetUserInfo failed ", err.Error(), req.String()) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) return } - userInfoList = rpcResp.UserInfoList - for _, v := range userInfoList { + var publicUserInfoList []*open_im_sdk.PublicUserInfo + for _, v := range RpcResp.UserInfoList { publicUserInfoList = append(publicUserInfoList, &open_im_sdk.PublicUserInfo{UserID: v.UserID, Nickname: v.Nickname, FaceURL: v.FaceURL, Gender: v.Gender, Ex: v.Ex}) } - resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: rpcResp.CommonResp.ErrCode, ErrMsg: rpcResp.CommonResp.ErrMsg}, UserInfoList: publicUserInfoList} + + resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, UserInfoList: publicUserInfoList} resp.Data = jsonData.JsonDataList(resp.UserInfoList) - log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp) + log.NewInfo(req.OperationID, "GetUserInfo api return ", resp) c.JSON(http.StatusOK, resp) } @@ -181,34 +122,18 @@ func UpdateUserInfo(c *gin.Context) { return } log.NewInfo(params.OperationID, "UpdateUserInfo args ", req.String()) - etcdConnUser := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) - client := rpc.NewUserClient(etcdConnUser) - rpcResp, err := client.UpdateUserInfo(context.Background(), req) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := rpc.NewUserClient(etcdConn) + RpcResp, err := client.UpdateUserInfo(context.Background(), req) if err != nil { log.NewError(req.OperationID, "UpdateUserInfo failed ", err.Error(), req.String()) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) return } - if rpcResp.CommonResp.ErrCode != 0 { - log.NewError(req.OperationID, utils.GetSelfFuncName(), rpcResp.CommonResp.String()) - resp := api.UpdateUserInfoResp{CommResp: api.CommResp{ErrCode: rpcResp.CommonResp.ErrCode, ErrMsg: rpcResp.CommonResp.ErrMsg}} - c.JSON(http.StatusOK, resp) - return - } else { - updateUserInfoReq := &cache.UpdateUserInfoReq{UserInfoList: []*open_im_sdk.UserInfo{req.UserInfo}} - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), updateUserInfoReq.String()) - etcdConnCache := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) - cacheClient := cache.NewCacheClient(etcdConnCache) - cacheResp, err := cacheClient.UpdateUserInfo(context.Background(), updateUserInfoReq) - if err != nil { - log.NewError(req.OperationID, "UpdateUserInfo cache failed ", err.Error(), req.String()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed: " + err.Error()}) - return - } - resp := api.UpdateUserInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}} - log.NewInfo(req.OperationID, "UpdateUserInfo api return ", resp) - c.JSON(http.StatusOK, resp) - } + resp := api.UpdateUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + log.NewInfo(req.OperationID, "UpdateUserInfo api return ", resp) + c.JSON(http.StatusOK, resp) } func GetSelfUserInfo(c *gin.Context) { @@ -240,31 +165,16 @@ func GetSelfUserInfo(c *gin.Context) { return } if len(RpcResp.UserInfoList) == 1 { - updateUserInfoReq := &cache.UpdateUserInfoReq{UserInfoList: []*open_im_sdk.UserInfo{RpcResp.UserInfoList[0]}} - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), updateUserInfoReq.String()) - etcdConnCache := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) - cacheClient := cache.NewCacheClient(etcdConnCache) - cacheClient.UpdateUserInfo(context.Background(), updateUserInfoReq) - //if err != nil { - // log.NewError(req.OperationID, "UpdateUserInfo cache failed ", err.Error(), req.String()) - // c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed: " + err.Error()}) - // return - //} - //if cacheResp.CommonResp.ErrCode != 0 { - // log.NewError(req.OperationID, utils.GetSelfFuncName(), cacheResp.CommonResp.String()) - // resp := api.UpdateUserInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}} - // c.JSON(http.StatusOK, resp) - // return - //} - //resp := api.GetSelfUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, UserInfo: RpcResp.UserInfoList[0]} - //resp.Data = jsonData.JsonDataOne(resp.UserInfo) - //log.NewInfo(req.OperationID, "GetUserInfo api return ", resp) - //c.JSON(http.StatusOK, resp) + resp := api.GetSelfUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, UserInfo: RpcResp.UserInfoList[0]} + resp.Data = jsonData.JsonDataOne(resp.UserInfo) + log.NewInfo(req.OperationID, "GetUserInfo api return ", resp) + c.JSON(http.StatusOK, resp) } else { resp := api.GetSelfUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} log.NewInfo(req.OperationID, "GetUserInfo api return ", resp) c.JSON(http.StatusOK, resp) } + } func GetUsersOnlineStatus(c *gin.Context) { diff --git a/pkg/proto/cache/cache.proto b/pkg/proto/cache/cache.proto index cecfabd3c..c618c20f8 100644 --- a/pkg/proto/cache/cache.proto +++ b/pkg/proto/cache/cache.proto @@ -15,12 +15,12 @@ message GetUserInfoReq{ message GetUserInfoResp{ CommonResp commonResp = 1; - repeated server_api_params.UserInfo UserInfoList = 2; + repeated server_api_params.UserInfo userInfoList = 2; } message UpdateUserInfoReq{ - repeated server_api_params.UserInfo UserInfoList = 1; + repeated server_api_params.UserInfo userInfoList = 1; string operationID = 2; } @@ -28,17 +28,31 @@ message UpdateUserInfoResp{ CommonResp commonResp = 1; } -message UpdateAllUserToCacheReq{ - string operationID = 1; + +message GetFriendInfoReq { + } -message UpdateAllUserToCacheResp{ - CommonResp commonResp = 1; +message GetFriendInfoResp { + +} + + +message UpdateFriendInfoReq{ + repeated server_api_params.FriendInfo friendInfoList = 1; + string operationID = 2; } +message UpdateFriendInfoResp{ + CommonResp commonResp = 1; +} service cache{ rpc GetUserInfo(GetUserInfoReq) returns(GetUserInfoResp); rpc UpdateUserInfo(UpdateUserInfoReq) returns(UpdateUserInfoResp); - rpc UpdateAllUserToCache(UpdateAllUserToCacheReq) returns(UpdateAllUserToCacheResp); + rpc GetFriendInfo(GetFriendInfoReq) returns(GetFriendInfoResp); + rpc UpdateFriendInfo(UpdateFriendInfoReq) returns(UpdateFriendInfoResp); + rpc } + + diff --git a/script/check_all.sh b/script/check_all.sh index 60abfad69..ccd62684b 100644 --- a/script/check_all.sh +++ b/script/check_all.sh @@ -22,6 +22,7 @@ service_port_name=( openImOfficePort openImOrganizationPort openImConversationPort + openImCachePort ) switch=$(cat $config_path | grep demoswitch |awk -F '[:]' '{print $NF}') for i in ${service_port_name[*]}; do diff --git a/script/path_info.cfg b/script/path_info.cfg index 3071a0a5d..9c9b0c264 100644 --- a/script/path_info.cfg +++ b/script/path_info.cfg @@ -51,6 +51,7 @@ service_source_root=( ../cmd/rpc/open_im_office/ ../cmd/rpc/open_im_organization/ ../cmd/rpc/open_im_conversation/ + ../cmd/rpc/open_im_cache/ ${msg_gateway_source_root} ${msg_transfer_source_root} ${msg_source_root} @@ -74,6 +75,7 @@ service_names=( open_im_office open_im_organization open_im_conversation + open_im_cache ${msg_gateway_name} ${msg_transfer_name} ${msg_name} diff --git a/script/start_rpc_service.sh b/script/start_rpc_service.sh index 6e60bcdcd..351bd2797 100644 --- a/script/start_rpc_service.sh +++ b/script/start_rpc_service.sh @@ -21,6 +21,7 @@ service_filename=( open_im_office open_im_organization open_im_conversation + open_im_cache ) #service config port name @@ -40,6 +41,7 @@ service_port_name=( openImOfficePort openImOrganizationPort openImConversationPort + openImCachePort ) for ((i = 0; i < ${#service_filename[*]}; i++)); do From 8f07f8e9e1bb84154985856eb8afd9cea5a1440e Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 26 Apr 2022 11:19:14 +0800 Subject: [PATCH 42/51] cache rpc --- cmd/rpc/open_im_cache/main.go | 2 +- internal/api/user/user.go | 96 ++++++- internal/rpc/cache/cache.go | 23 +- pkg/proto/cache/cache.pb.go | 501 ---------------------------------- pkg/proto/cache/cache.proto | 26 +- 5 files changed, 121 insertions(+), 527 deletions(-) delete mode 100644 pkg/proto/cache/cache.pb.go diff --git a/cmd/rpc/open_im_cache/main.go b/cmd/rpc/open_im_cache/main.go index 2ab2eefa8..bc50cc28e 100644 --- a/cmd/rpc/open_im_cache/main.go +++ b/cmd/rpc/open_im_cache/main.go @@ -10,7 +10,7 @@ func main() { rpcPort := flag.Int("port", 10600, "RpcToken default listen port 10800") flag.Parse() fmt.Println("start auth rpc server, port: ", *rpcPort) - rpcServer := rpcCache.NewOfficeServer(*rpcPort) + rpcServer := rpcCache.NewCacheServer(*rpcPort) rpcServer.Run() } diff --git a/internal/api/user/user.go b/internal/api/user/user.go index af8448522..d6b733f03 100644 --- a/internal/api/user/user.go +++ b/internal/api/user/user.go @@ -8,6 +8,7 @@ import ( "Open_IM/pkg/common/log" "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" + cacheRpc "Open_IM/pkg/proto/cache" pbRelay "Open_IM/pkg/proto/relay" open_im_sdk "Open_IM/pkg/proto/sdk_ws" rpc "Open_IM/pkg/proto/user" @@ -18,7 +19,6 @@ import ( "strings" ) -//todo func GetUsersInfoFromCache(c *gin.Context) { params := api.GetUsersInfoReq{} if err := c.BindJSON(¶ms); err != nil { @@ -26,34 +26,100 @@ func GetUsersInfoFromCache(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"errCode": http.StatusBadRequest, "errMsg": err.Error()}) return } - req := &rpc.GetUserInfoReq{} - utils.CopyStructFields(req, ¶ms) + getUserInfoReq := &rpc.GetUserInfoReq{} + getUserInfoReq.OperationID = params.OperationID var ok bool - ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + ok, getUserInfoReq.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), getUserInfoReq.OperationID) if !ok { - log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + log.NewError(getUserInfoReq.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) return } - log.NewInfo(params.OperationID, "GetUserInfo args ", req.String()) + log.NewInfo(params.OperationID, "GetUserInfo args ", getUserInfoReq.String()) + reqCacheGetUserInfo := &cacheRpc.GetUserInfoReq{} + utils.CopyStructFields(reqCacheGetUserInfo, ¶ms) + var userInfoList []*open_im_sdk.UserInfo + var publicUserInfoList []*open_im_sdk.PublicUserInfo + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + cacheClient := cacheRpc.NewCacheClient(etcdConn) + cacheResp, err := cacheClient.GetUserInfo(context.Background(), reqCacheGetUserInfo) + if err != nil { + log.NewError(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "GetUserInfo failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed: " + err.Error()}) + return + } + if cacheResp.CommonResp.ErrCode != 0 { + log.NewError(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "GetUserInfo failed", cacheResp.CommonResp) + resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}} + resp.Data = []map[string]interface{}{} + log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp) + c.JSON(http.StatusOK, resp) + return + } + log.NewInfo(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "cacheResp:", cacheResp.String()) + userInfoList = cacheResp.UserInfoList + var needCacheUserIDList []string + for _, userID := range reqCacheGetUserInfo.UserIDList { + isGetUserInfoFromCache := false + for _, cacheUser := range userInfoList { + if cacheUser.UserID == userID { + isGetUserInfoFromCache = true + } + } + if !isGetUserInfoFromCache { + needCacheUserIDList = append(needCacheUserIDList, userID) + } + } + if len(needCacheUserIDList) == 0 { + log.NewInfo(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "get all userInfo from cache success") + for _, v := range userInfoList { + publicUserInfoList = append(publicUserInfoList, + &open_im_sdk.PublicUserInfo{UserID: v.UserID, Nickname: v.Nickname, FaceURL: v.FaceURL, Gender: v.Gender, Ex: v.Ex}) + } + resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}, UserInfoList: publicUserInfoList} + resp.Data = jsonData.JsonDataList(resp.UserInfoList) + log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp) + c.JSON(http.StatusOK, resp) + return + } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + log.NewDebug(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "need cache user list", needCacheUserIDList) + getUserInfoReq.UserIDList = needCacheUserIDList + etcdConn = getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) client := rpc.NewUserClient(etcdConn) - RpcResp, err := client.GetUserInfo(context.Background(), req) + rpcResp, err := client.GetUserInfo(context.Background(), getUserInfoReq) if err != nil { - log.NewError(req.OperationID, "GetUserInfo failed ", err.Error(), req.String()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) + log.NewError(getUserInfoReq.OperationID, "GetUserInfo failed ", err.Error(), getUserInfoReq.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed" + err.Error()}) return } - var publicUserInfoList []*open_im_sdk.PublicUserInfo - for _, v := range RpcResp.UserInfoList { + if rpcResp.CommonResp.ErrCode != 0 { + log.NewError(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "GetUserInfo failed", cacheResp.CommonResp) + resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}} + resp.Data = []map[string]interface{}{} + log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp) + c.JSON(http.StatusOK, resp) + return + } + userInfoList = append(userInfoList, rpcResp.UserInfoList...) + cacheUpdateUserInfoReq := &cacheRpc.UpdateUserInfoReq{ + UserInfoList: rpcResp.UserInfoList, + OperationID: getUserInfoReq.OperationID, + } + _, err = cacheClient.UpdateUserInfo(context.Background(), cacheUpdateUserInfoReq) + if err != nil { + log.NewError(getUserInfoReq.OperationID, "GetUserInfo failed ", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed:" + err.Error()}) + return + } + userInfoList = rpcResp.UserInfoList + for _, v := range userInfoList { publicUserInfoList = append(publicUserInfoList, &open_im_sdk.PublicUserInfo{UserID: v.UserID, Nickname: v.Nickname, FaceURL: v.FaceURL, Gender: v.Gender, Ex: v.Ex}) } - - resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, UserInfoList: publicUserInfoList} + resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: rpcResp.CommonResp.ErrCode, ErrMsg: rpcResp.CommonResp.ErrMsg}, UserInfoList: publicUserInfoList} resp.Data = jsonData.JsonDataList(resp.UserInfoList) - log.NewInfo(req.OperationID, "GetUserInfo api return ", resp) + log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp) c.JSON(http.StatusOK, resp) } diff --git a/internal/rpc/cache/cache.go b/internal/rpc/cache/cache.go index e172ed723..693d89cb5 100644 --- a/internal/rpc/cache/cache.go +++ b/internal/rpc/cache/cache.go @@ -23,11 +23,11 @@ type cacheServer struct { etcdAddr []string } -func NewOfficeServer(port int) *cacheServer { +func NewCacheServer(port int) *cacheServer { log.NewPrivateLog(constant.LogFileName) return &cacheServer{ rpcPort: port, - rpcRegisterName: config.Config.RpcRegisterName.OpenImOfficeName, + rpcRegisterName: config.Config.RpcRegisterName.OpenImCacheName, etcdSchema: config.Config.Etcd.EtcdSchema, etcdAddr: config.Config.Etcd.EtcdAddr, } @@ -95,9 +95,18 @@ func (s *cacheServer) UpdateUserInfo(_ context.Context, req *pbCache.UpdateUserI return resp, nil } -func (s *cacheServer) UpdateAllUserToCache(_ context.Context, req *pbCache.UpdateAllUserToCacheReq) (resp *pbCache.UpdateAllUserToCacheResp, err error) { - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) - resp = &pbCache.UpdateAllUserToCacheResp{CommonResp: &pbCache.CommonResp{}} - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) - return resp, nil +func (s *cacheServer) GetBlackList(_ context.Context, req *pbCache.GetBlackListReq) (resp *pbCache.GetBlackListResp, err error) { + return nil, nil +} + +func (s *cacheServer) UpdateBlackList(_ context.Context, req *pbCache.UpdateBlackListReq) (resp *pbCache.UpdateBlackListResp, err error) { + return nil, nil +} + +func (s *cacheServer) GetFriendInfo(_ context.Context, req *pbCache.GetFriendInfoReq) (resp *pbCache.GetFriendInfoResp, err error) { + return nil, nil +} + +func (s *cacheServer) UpdateFriendInfo(_ context.Context, req *pbCache.UpdateFriendInfoReq) (resp *pbCache.UpdateFriendInfoResp, err error) { + return nil, nil } diff --git a/pkg/proto/cache/cache.pb.go b/pkg/proto/cache/cache.pb.go deleted file mode 100644 index 649784738..000000000 --- a/pkg/proto/cache/cache.pb.go +++ /dev/null @@ -1,501 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: cache/cache.proto - -package cache // import "./cache" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import sdk_ws "Open_IM/pkg/proto/sdk_ws" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type CommonResp struct { - ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CommonResp) Reset() { *m = CommonResp{} } -func (m *CommonResp) String() string { return proto.CompactTextString(m) } -func (*CommonResp) ProtoMessage() {} -func (*CommonResp) Descriptor() ([]byte, []int) { - return fileDescriptor_cache_613af94c3da056d4, []int{0} -} -func (m *CommonResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CommonResp.Unmarshal(m, b) -} -func (m *CommonResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CommonResp.Marshal(b, m, deterministic) -} -func (dst *CommonResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommonResp.Merge(dst, src) -} -func (m *CommonResp) XXX_Size() int { - return xxx_messageInfo_CommonResp.Size(m) -} -func (m *CommonResp) XXX_DiscardUnknown() { - xxx_messageInfo_CommonResp.DiscardUnknown(m) -} - -var xxx_messageInfo_CommonResp proto.InternalMessageInfo - -func (m *CommonResp) GetErrCode() int32 { - if m != nil { - return m.ErrCode - } - return 0 -} - -func (m *CommonResp) GetErrMsg() string { - if m != nil { - return m.ErrMsg - } - return "" -} - -type GetUserInfoReq struct { - UserIDList []string `protobuf:"bytes,1,rep,name=userIDList" json:"userIDList,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetUserInfoReq) Reset() { *m = GetUserInfoReq{} } -func (m *GetUserInfoReq) String() string { return proto.CompactTextString(m) } -func (*GetUserInfoReq) ProtoMessage() {} -func (*GetUserInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_cache_613af94c3da056d4, []int{1} -} -func (m *GetUserInfoReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetUserInfoReq.Unmarshal(m, b) -} -func (m *GetUserInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetUserInfoReq.Marshal(b, m, deterministic) -} -func (dst *GetUserInfoReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetUserInfoReq.Merge(dst, src) -} -func (m *GetUserInfoReq) XXX_Size() int { - return xxx_messageInfo_GetUserInfoReq.Size(m) -} -func (m *GetUserInfoReq) XXX_DiscardUnknown() { - xxx_messageInfo_GetUserInfoReq.DiscardUnknown(m) -} - -var xxx_messageInfo_GetUserInfoReq proto.InternalMessageInfo - -func (m *GetUserInfoReq) GetUserIDList() []string { - if m != nil { - return m.UserIDList - } - return nil -} - -func (m *GetUserInfoReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type GetUserInfoResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - UserInfoList []*sdk_ws.UserInfo `protobuf:"bytes,2,rep,name=UserInfoList" json:"UserInfoList,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetUserInfoResp) Reset() { *m = GetUserInfoResp{} } -func (m *GetUserInfoResp) String() string { return proto.CompactTextString(m) } -func (*GetUserInfoResp) ProtoMessage() {} -func (*GetUserInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_cache_613af94c3da056d4, []int{2} -} -func (m *GetUserInfoResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetUserInfoResp.Unmarshal(m, b) -} -func (m *GetUserInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetUserInfoResp.Marshal(b, m, deterministic) -} -func (dst *GetUserInfoResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetUserInfoResp.Merge(dst, src) -} -func (m *GetUserInfoResp) XXX_Size() int { - return xxx_messageInfo_GetUserInfoResp.Size(m) -} -func (m *GetUserInfoResp) XXX_DiscardUnknown() { - xxx_messageInfo_GetUserInfoResp.DiscardUnknown(m) -} - -var xxx_messageInfo_GetUserInfoResp proto.InternalMessageInfo - -func (m *GetUserInfoResp) GetCommonResp() *CommonResp { - if m != nil { - return m.CommonResp - } - return nil -} - -func (m *GetUserInfoResp) GetUserInfoList() []*sdk_ws.UserInfo { - if m != nil { - return m.UserInfoList - } - return nil -} - -type UpdateUserInfoReq struct { - UserInfoList []*sdk_ws.UserInfo `protobuf:"bytes,1,rep,name=UserInfoList" json:"UserInfoList,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UpdateUserInfoReq) Reset() { *m = UpdateUserInfoReq{} } -func (m *UpdateUserInfoReq) String() string { return proto.CompactTextString(m) } -func (*UpdateUserInfoReq) ProtoMessage() {} -func (*UpdateUserInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_cache_613af94c3da056d4, []int{3} -} -func (m *UpdateUserInfoReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UpdateUserInfoReq.Unmarshal(m, b) -} -func (m *UpdateUserInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UpdateUserInfoReq.Marshal(b, m, deterministic) -} -func (dst *UpdateUserInfoReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateUserInfoReq.Merge(dst, src) -} -func (m *UpdateUserInfoReq) XXX_Size() int { - return xxx_messageInfo_UpdateUserInfoReq.Size(m) -} -func (m *UpdateUserInfoReq) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateUserInfoReq.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateUserInfoReq proto.InternalMessageInfo - -func (m *UpdateUserInfoReq) GetUserInfoList() []*sdk_ws.UserInfo { - if m != nil { - return m.UserInfoList - } - return nil -} - -func (m *UpdateUserInfoReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type UpdateUserInfoResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UpdateUserInfoResp) Reset() { *m = UpdateUserInfoResp{} } -func (m *UpdateUserInfoResp) String() string { return proto.CompactTextString(m) } -func (*UpdateUserInfoResp) ProtoMessage() {} -func (*UpdateUserInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_cache_613af94c3da056d4, []int{4} -} -func (m *UpdateUserInfoResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UpdateUserInfoResp.Unmarshal(m, b) -} -func (m *UpdateUserInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UpdateUserInfoResp.Marshal(b, m, deterministic) -} -func (dst *UpdateUserInfoResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateUserInfoResp.Merge(dst, src) -} -func (m *UpdateUserInfoResp) XXX_Size() int { - return xxx_messageInfo_UpdateUserInfoResp.Size(m) -} -func (m *UpdateUserInfoResp) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateUserInfoResp.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateUserInfoResp proto.InternalMessageInfo - -func (m *UpdateUserInfoResp) GetCommonResp() *CommonResp { - if m != nil { - return m.CommonResp - } - return nil -} - -type UpdateAllUserToCacheReq struct { - OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UpdateAllUserToCacheReq) Reset() { *m = UpdateAllUserToCacheReq{} } -func (m *UpdateAllUserToCacheReq) String() string { return proto.CompactTextString(m) } -func (*UpdateAllUserToCacheReq) ProtoMessage() {} -func (*UpdateAllUserToCacheReq) Descriptor() ([]byte, []int) { - return fileDescriptor_cache_613af94c3da056d4, []int{5} -} -func (m *UpdateAllUserToCacheReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UpdateAllUserToCacheReq.Unmarshal(m, b) -} -func (m *UpdateAllUserToCacheReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UpdateAllUserToCacheReq.Marshal(b, m, deterministic) -} -func (dst *UpdateAllUserToCacheReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateAllUserToCacheReq.Merge(dst, src) -} -func (m *UpdateAllUserToCacheReq) XXX_Size() int { - return xxx_messageInfo_UpdateAllUserToCacheReq.Size(m) -} -func (m *UpdateAllUserToCacheReq) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateAllUserToCacheReq.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateAllUserToCacheReq proto.InternalMessageInfo - -func (m *UpdateAllUserToCacheReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type UpdateAllUserToCacheResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UpdateAllUserToCacheResp) Reset() { *m = UpdateAllUserToCacheResp{} } -func (m *UpdateAllUserToCacheResp) String() string { return proto.CompactTextString(m) } -func (*UpdateAllUserToCacheResp) ProtoMessage() {} -func (*UpdateAllUserToCacheResp) Descriptor() ([]byte, []int) { - return fileDescriptor_cache_613af94c3da056d4, []int{6} -} -func (m *UpdateAllUserToCacheResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UpdateAllUserToCacheResp.Unmarshal(m, b) -} -func (m *UpdateAllUserToCacheResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UpdateAllUserToCacheResp.Marshal(b, m, deterministic) -} -func (dst *UpdateAllUserToCacheResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateAllUserToCacheResp.Merge(dst, src) -} -func (m *UpdateAllUserToCacheResp) XXX_Size() int { - return xxx_messageInfo_UpdateAllUserToCacheResp.Size(m) -} -func (m *UpdateAllUserToCacheResp) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateAllUserToCacheResp.DiscardUnknown(m) -} - -var xxx_messageInfo_UpdateAllUserToCacheResp proto.InternalMessageInfo - -func (m *UpdateAllUserToCacheResp) GetCommonResp() *CommonResp { - if m != nil { - return m.CommonResp - } - return nil -} - -func init() { - proto.RegisterType((*CommonResp)(nil), "cache.CommonResp") - proto.RegisterType((*GetUserInfoReq)(nil), "cache.GetUserInfoReq") - proto.RegisterType((*GetUserInfoResp)(nil), "cache.GetUserInfoResp") - proto.RegisterType((*UpdateUserInfoReq)(nil), "cache.UpdateUserInfoReq") - proto.RegisterType((*UpdateUserInfoResp)(nil), "cache.UpdateUserInfoResp") - proto.RegisterType((*UpdateAllUserToCacheReq)(nil), "cache.UpdateAllUserToCacheReq") - proto.RegisterType((*UpdateAllUserToCacheResp)(nil), "cache.UpdateAllUserToCacheResp") -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// Client API for Cache service - -type CacheClient interface { - GetUserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error) - UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*UpdateUserInfoResp, error) - UpdateAllUserToCache(ctx context.Context, in *UpdateAllUserToCacheReq, opts ...grpc.CallOption) (*UpdateAllUserToCacheResp, error) -} - -type cacheClient struct { - cc *grpc.ClientConn -} - -func NewCacheClient(cc *grpc.ClientConn) CacheClient { - return &cacheClient{cc} -} - -func (c *cacheClient) GetUserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error) { - out := new(GetUserInfoResp) - err := grpc.Invoke(ctx, "/cache.cache/GetUserInfo", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *cacheClient) UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*UpdateUserInfoResp, error) { - out := new(UpdateUserInfoResp) - err := grpc.Invoke(ctx, "/cache.cache/UpdateUserInfo", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *cacheClient) UpdateAllUserToCache(ctx context.Context, in *UpdateAllUserToCacheReq, opts ...grpc.CallOption) (*UpdateAllUserToCacheResp, error) { - out := new(UpdateAllUserToCacheResp) - err := grpc.Invoke(ctx, "/cache.cache/UpdateAllUserToCache", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Cache service - -type CacheServer interface { - GetUserInfo(context.Context, *GetUserInfoReq) (*GetUserInfoResp, error) - UpdateUserInfo(context.Context, *UpdateUserInfoReq) (*UpdateUserInfoResp, error) - UpdateAllUserToCache(context.Context, *UpdateAllUserToCacheReq) (*UpdateAllUserToCacheResp, error) -} - -func RegisterCacheServer(s *grpc.Server, srv CacheServer) { - s.RegisterService(&_Cache_serviceDesc, srv) -} - -func _Cache_GetUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetUserInfoReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CacheServer).GetUserInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cache.cache/GetUserInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CacheServer).GetUserInfo(ctx, req.(*GetUserInfoReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Cache_UpdateUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateUserInfoReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CacheServer).UpdateUserInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cache.cache/UpdateUserInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CacheServer).UpdateUserInfo(ctx, req.(*UpdateUserInfoReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Cache_UpdateAllUserToCache_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateAllUserToCacheReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CacheServer).UpdateAllUserToCache(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cache.cache/UpdateAllUserToCache", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CacheServer).UpdateAllUserToCache(ctx, req.(*UpdateAllUserToCacheReq)) - } - return interceptor(ctx, in, info, handler) -} - -var _Cache_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cache.cache", - HandlerType: (*CacheServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetUserInfo", - Handler: _Cache_GetUserInfo_Handler, - }, - { - MethodName: "UpdateUserInfo", - Handler: _Cache_UpdateUserInfo_Handler, - }, - { - MethodName: "UpdateAllUserToCache", - Handler: _Cache_UpdateAllUserToCache_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cache/cache.proto", -} - -func init() { proto.RegisterFile("cache/cache.proto", fileDescriptor_cache_613af94c3da056d4) } - -var fileDescriptor_cache_613af94c3da056d4 = []byte{ - // 383 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0x5d, 0x4f, 0xe2, 0x40, - 0x14, 0xcd, 0x40, 0x60, 0xc3, 0xed, 0x2e, 0x84, 0xc9, 0x2e, 0x5b, 0x6b, 0x82, 0xb5, 0x4f, 0x7d, - 0x6a, 0x23, 0x3e, 0x62, 0x34, 0x0a, 0x86, 0x90, 0x48, 0x4c, 0x26, 0x12, 0x13, 0x5f, 0x9a, 0x0a, - 0x23, 0x12, 0xa0, 0x33, 0xce, 0x54, 0xf8, 0x05, 0xfe, 0x54, 0xff, 0x87, 0xe9, 0x14, 0xb0, 0x1f, - 0x68, 0x22, 0x2f, 0x93, 0xdc, 0x8f, 0x73, 0xe6, 0x9c, 0x3b, 0x73, 0xa1, 0x3e, 0xf2, 0x47, 0xcf, - 0xd4, 0x55, 0xa7, 0xc3, 0x05, 0x0b, 0x19, 0x2e, 0xa9, 0xc0, 0x38, 0xbe, 0xe5, 0x34, 0xf0, 0xfa, - 0x03, 0x97, 0xcf, 0x26, 0xae, 0xaa, 0xb8, 0x72, 0x3c, 0xf3, 0x56, 0xd2, 0x5d, 0xc9, 0xb8, 0xd3, - 0x3a, 0x07, 0xe8, 0xb0, 0xc5, 0x82, 0x05, 0x84, 0x4a, 0x8e, 0x75, 0xf8, 0x45, 0x85, 0xe8, 0xb0, - 0x31, 0xd5, 0x91, 0x89, 0xec, 0x12, 0xd9, 0x84, 0xb8, 0x01, 0x65, 0x2a, 0xc4, 0x40, 0x4e, 0xf4, - 0x82, 0x89, 0xec, 0x0a, 0x59, 0x47, 0x16, 0x81, 0x6a, 0x8f, 0x86, 0x43, 0x49, 0x45, 0x3f, 0x78, - 0x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 0xcb, 0x1d, 0x6e, 0xa6, 0x20, 0xb9, 0xb9, 0x19, 0x47, - 0xdf, 0xd6, 0x25, 0xbf, 0xaa, 0x3d, 0xfc, 0x71, 0xe2, 0x5d, 0x6c, 0xab, 0xf3, 0xb1, 0xac, 0x16, - 0xed, 0xf4, 0x23, 0x00, 0x00, 0xff, 0xff, 0x14, 0x24, 0x83, 0x9c, 0xa7, 0x03, 0x00, 0x00, -} diff --git a/pkg/proto/cache/cache.proto b/pkg/proto/cache/cache.proto index c618c20f8..e5da4efa7 100644 --- a/pkg/proto/cache/cache.proto +++ b/pkg/proto/cache/cache.proto @@ -28,13 +28,32 @@ message UpdateUserInfoResp{ CommonResp commonResp = 1; } - message GetFriendInfoReq { - + string userID = 1; + string operationID = 2; } message GetFriendInfoResp { + repeated server_api_params.FriendInfo friendInfoList = 1; + CommonResp commonResp = 2; +} + +message UpdateBlackListReq { + repeated server_api_params.BlackInfo blackList = 1; + string operationID = 2; +} + +message UpdateBlackListResp { + CommonResp commonResp = 1; +} + +message GetBlackListReq { + string userID = 1; + string operationID = 2; +} +message GetBlackListResp { + repeated server_api_params.BlackInfo blackList = 1; } @@ -52,7 +71,8 @@ service cache{ rpc UpdateUserInfo(UpdateUserInfoReq) returns(UpdateUserInfoResp); rpc GetFriendInfo(GetFriendInfoReq) returns(GetFriendInfoResp); rpc UpdateFriendInfo(UpdateFriendInfoReq) returns(UpdateFriendInfoResp); - rpc + rpc UpdateBlackList(UpdateBlackListReq) returns(UpdateBlackListResp); + rpc GetBlackList(GetBlackListReq) returns(GetBlackListResp); } From f662defcf9d5a1ff60cb61edd0738a16d9599d20 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 26 Apr 2022 11:19:21 +0800 Subject: [PATCH 43/51] cache rpc --- pkg/proto/cache/cache.pb.go | 883 ++++++++++++++++++++++++++++++++++++ 1 file changed, 883 insertions(+) create mode 100644 pkg/proto/cache/cache.pb.go diff --git a/pkg/proto/cache/cache.pb.go b/pkg/proto/cache/cache.pb.go new file mode 100644 index 000000000..430ec0c78 --- /dev/null +++ b/pkg/proto/cache/cache.pb.go @@ -0,0 +1,883 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: cache/cache.proto + +package cache // import "./cache" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import sdk_ws "Open_IM/pkg/proto/sdk_ws" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type CommonResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CommonResp) Reset() { *m = CommonResp{} } +func (m *CommonResp) String() string { return proto.CompactTextString(m) } +func (*CommonResp) ProtoMessage() {} +func (*CommonResp) Descriptor() ([]byte, []int) { + return fileDescriptor_cache_c95b22de9c135769, []int{0} +} +func (m *CommonResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommonResp.Unmarshal(m, b) +} +func (m *CommonResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommonResp.Marshal(b, m, deterministic) +} +func (dst *CommonResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommonResp.Merge(dst, src) +} +func (m *CommonResp) XXX_Size() int { + return xxx_messageInfo_CommonResp.Size(m) +} +func (m *CommonResp) XXX_DiscardUnknown() { + xxx_messageInfo_CommonResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CommonResp proto.InternalMessageInfo + +func (m *CommonResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *CommonResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type GetUserInfoReq struct { + UserIDList []string `protobuf:"bytes,1,rep,name=userIDList" json:"userIDList,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserInfoReq) Reset() { *m = GetUserInfoReq{} } +func (m *GetUserInfoReq) String() string { return proto.CompactTextString(m) } +func (*GetUserInfoReq) ProtoMessage() {} +func (*GetUserInfoReq) Descriptor() ([]byte, []int) { + return fileDescriptor_cache_c95b22de9c135769, []int{1} +} +func (m *GetUserInfoReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserInfoReq.Unmarshal(m, b) +} +func (m *GetUserInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserInfoReq.Marshal(b, m, deterministic) +} +func (dst *GetUserInfoReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserInfoReq.Merge(dst, src) +} +func (m *GetUserInfoReq) XXX_Size() int { + return xxx_messageInfo_GetUserInfoReq.Size(m) +} +func (m *GetUserInfoReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserInfoReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserInfoReq proto.InternalMessageInfo + +func (m *GetUserInfoReq) GetUserIDList() []string { + if m != nil { + return m.UserIDList + } + return nil +} + +func (m *GetUserInfoReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetUserInfoResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + UserInfoList []*sdk_ws.UserInfo `protobuf:"bytes,2,rep,name=userInfoList" json:"userInfoList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserInfoResp) Reset() { *m = GetUserInfoResp{} } +func (m *GetUserInfoResp) String() string { return proto.CompactTextString(m) } +func (*GetUserInfoResp) ProtoMessage() {} +func (*GetUserInfoResp) Descriptor() ([]byte, []int) { + return fileDescriptor_cache_c95b22de9c135769, []int{2} +} +func (m *GetUserInfoResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserInfoResp.Unmarshal(m, b) +} +func (m *GetUserInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserInfoResp.Marshal(b, m, deterministic) +} +func (dst *GetUserInfoResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserInfoResp.Merge(dst, src) +} +func (m *GetUserInfoResp) XXX_Size() int { + return xxx_messageInfo_GetUserInfoResp.Size(m) +} +func (m *GetUserInfoResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserInfoResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserInfoResp proto.InternalMessageInfo + +func (m *GetUserInfoResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetUserInfoResp) GetUserInfoList() []*sdk_ws.UserInfo { + if m != nil { + return m.UserInfoList + } + return nil +} + +type UpdateUserInfoReq struct { + UserInfoList []*sdk_ws.UserInfo `protobuf:"bytes,1,rep,name=userInfoList" json:"userInfoList,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateUserInfoReq) Reset() { *m = UpdateUserInfoReq{} } +func (m *UpdateUserInfoReq) String() string { return proto.CompactTextString(m) } +func (*UpdateUserInfoReq) ProtoMessage() {} +func (*UpdateUserInfoReq) Descriptor() ([]byte, []int) { + return fileDescriptor_cache_c95b22de9c135769, []int{3} +} +func (m *UpdateUserInfoReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateUserInfoReq.Unmarshal(m, b) +} +func (m *UpdateUserInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateUserInfoReq.Marshal(b, m, deterministic) +} +func (dst *UpdateUserInfoReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateUserInfoReq.Merge(dst, src) +} +func (m *UpdateUserInfoReq) XXX_Size() int { + return xxx_messageInfo_UpdateUserInfoReq.Size(m) +} +func (m *UpdateUserInfoReq) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateUserInfoReq.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateUserInfoReq proto.InternalMessageInfo + +func (m *UpdateUserInfoReq) GetUserInfoList() []*sdk_ws.UserInfo { + if m != nil { + return m.UserInfoList + } + return nil +} + +func (m *UpdateUserInfoReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type UpdateUserInfoResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateUserInfoResp) Reset() { *m = UpdateUserInfoResp{} } +func (m *UpdateUserInfoResp) String() string { return proto.CompactTextString(m) } +func (*UpdateUserInfoResp) ProtoMessage() {} +func (*UpdateUserInfoResp) Descriptor() ([]byte, []int) { + return fileDescriptor_cache_c95b22de9c135769, []int{4} +} +func (m *UpdateUserInfoResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateUserInfoResp.Unmarshal(m, b) +} +func (m *UpdateUserInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateUserInfoResp.Marshal(b, m, deterministic) +} +func (dst *UpdateUserInfoResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateUserInfoResp.Merge(dst, src) +} +func (m *UpdateUserInfoResp) XXX_Size() int { + return xxx_messageInfo_UpdateUserInfoResp.Size(m) +} +func (m *UpdateUserInfoResp) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateUserInfoResp.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateUserInfoResp proto.InternalMessageInfo + +func (m *UpdateUserInfoResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type GetFriendInfoReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetFriendInfoReq) Reset() { *m = GetFriendInfoReq{} } +func (m *GetFriendInfoReq) String() string { return proto.CompactTextString(m) } +func (*GetFriendInfoReq) ProtoMessage() {} +func (*GetFriendInfoReq) Descriptor() ([]byte, []int) { + return fileDescriptor_cache_c95b22de9c135769, []int{5} +} +func (m *GetFriendInfoReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetFriendInfoReq.Unmarshal(m, b) +} +func (m *GetFriendInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetFriendInfoReq.Marshal(b, m, deterministic) +} +func (dst *GetFriendInfoReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFriendInfoReq.Merge(dst, src) +} +func (m *GetFriendInfoReq) XXX_Size() int { + return xxx_messageInfo_GetFriendInfoReq.Size(m) +} +func (m *GetFriendInfoReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetFriendInfoReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetFriendInfoReq proto.InternalMessageInfo + +func (m *GetFriendInfoReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetFriendInfoReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetFriendInfoResp struct { + FriendInfoList []*sdk_ws.FriendInfo `protobuf:"bytes,1,rep,name=friendInfoList" json:"friendInfoList,omitempty"` + CommonResp *CommonResp `protobuf:"bytes,2,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetFriendInfoResp) Reset() { *m = GetFriendInfoResp{} } +func (m *GetFriendInfoResp) String() string { return proto.CompactTextString(m) } +func (*GetFriendInfoResp) ProtoMessage() {} +func (*GetFriendInfoResp) Descriptor() ([]byte, []int) { + return fileDescriptor_cache_c95b22de9c135769, []int{6} +} +func (m *GetFriendInfoResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetFriendInfoResp.Unmarshal(m, b) +} +func (m *GetFriendInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetFriendInfoResp.Marshal(b, m, deterministic) +} +func (dst *GetFriendInfoResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFriendInfoResp.Merge(dst, src) +} +func (m *GetFriendInfoResp) XXX_Size() int { + return xxx_messageInfo_GetFriendInfoResp.Size(m) +} +func (m *GetFriendInfoResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetFriendInfoResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetFriendInfoResp proto.InternalMessageInfo + +func (m *GetFriendInfoResp) GetFriendInfoList() []*sdk_ws.FriendInfo { + if m != nil { + return m.FriendInfoList + } + return nil +} + +func (m *GetFriendInfoResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type UpdateBlackListReq struct { + BlackList []*sdk_ws.BlackInfo `protobuf:"bytes,1,rep,name=blackList" json:"blackList,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateBlackListReq) Reset() { *m = UpdateBlackListReq{} } +func (m *UpdateBlackListReq) String() string { return proto.CompactTextString(m) } +func (*UpdateBlackListReq) ProtoMessage() {} +func (*UpdateBlackListReq) Descriptor() ([]byte, []int) { + return fileDescriptor_cache_c95b22de9c135769, []int{7} +} +func (m *UpdateBlackListReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateBlackListReq.Unmarshal(m, b) +} +func (m *UpdateBlackListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateBlackListReq.Marshal(b, m, deterministic) +} +func (dst *UpdateBlackListReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateBlackListReq.Merge(dst, src) +} +func (m *UpdateBlackListReq) XXX_Size() int { + return xxx_messageInfo_UpdateBlackListReq.Size(m) +} +func (m *UpdateBlackListReq) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateBlackListReq.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateBlackListReq proto.InternalMessageInfo + +func (m *UpdateBlackListReq) GetBlackList() []*sdk_ws.BlackInfo { + if m != nil { + return m.BlackList + } + return nil +} + +func (m *UpdateBlackListReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type UpdateBlackListResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateBlackListResp) Reset() { *m = UpdateBlackListResp{} } +func (m *UpdateBlackListResp) String() string { return proto.CompactTextString(m) } +func (*UpdateBlackListResp) ProtoMessage() {} +func (*UpdateBlackListResp) Descriptor() ([]byte, []int) { + return fileDescriptor_cache_c95b22de9c135769, []int{8} +} +func (m *UpdateBlackListResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateBlackListResp.Unmarshal(m, b) +} +func (m *UpdateBlackListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateBlackListResp.Marshal(b, m, deterministic) +} +func (dst *UpdateBlackListResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateBlackListResp.Merge(dst, src) +} +func (m *UpdateBlackListResp) XXX_Size() int { + return xxx_messageInfo_UpdateBlackListResp.Size(m) +} +func (m *UpdateBlackListResp) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateBlackListResp.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateBlackListResp proto.InternalMessageInfo + +func (m *UpdateBlackListResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type GetBlackListReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetBlackListReq) Reset() { *m = GetBlackListReq{} } +func (m *GetBlackListReq) String() string { return proto.CompactTextString(m) } +func (*GetBlackListReq) ProtoMessage() {} +func (*GetBlackListReq) Descriptor() ([]byte, []int) { + return fileDescriptor_cache_c95b22de9c135769, []int{9} +} +func (m *GetBlackListReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetBlackListReq.Unmarshal(m, b) +} +func (m *GetBlackListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetBlackListReq.Marshal(b, m, deterministic) +} +func (dst *GetBlackListReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBlackListReq.Merge(dst, src) +} +func (m *GetBlackListReq) XXX_Size() int { + return xxx_messageInfo_GetBlackListReq.Size(m) +} +func (m *GetBlackListReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetBlackListReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetBlackListReq proto.InternalMessageInfo + +func (m *GetBlackListReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetBlackListReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetBlackListResp struct { + BlackList []*sdk_ws.BlackInfo `protobuf:"bytes,1,rep,name=blackList" json:"blackList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetBlackListResp) Reset() { *m = GetBlackListResp{} } +func (m *GetBlackListResp) String() string { return proto.CompactTextString(m) } +func (*GetBlackListResp) ProtoMessage() {} +func (*GetBlackListResp) Descriptor() ([]byte, []int) { + return fileDescriptor_cache_c95b22de9c135769, []int{10} +} +func (m *GetBlackListResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetBlackListResp.Unmarshal(m, b) +} +func (m *GetBlackListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetBlackListResp.Marshal(b, m, deterministic) +} +func (dst *GetBlackListResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBlackListResp.Merge(dst, src) +} +func (m *GetBlackListResp) XXX_Size() int { + return xxx_messageInfo_GetBlackListResp.Size(m) +} +func (m *GetBlackListResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetBlackListResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetBlackListResp proto.InternalMessageInfo + +func (m *GetBlackListResp) GetBlackList() []*sdk_ws.BlackInfo { + if m != nil { + return m.BlackList + } + return nil +} + +type UpdateFriendInfoReq struct { + FriendInfoList []*sdk_ws.FriendInfo `protobuf:"bytes,1,rep,name=friendInfoList" json:"friendInfoList,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateFriendInfoReq) Reset() { *m = UpdateFriendInfoReq{} } +func (m *UpdateFriendInfoReq) String() string { return proto.CompactTextString(m) } +func (*UpdateFriendInfoReq) ProtoMessage() {} +func (*UpdateFriendInfoReq) Descriptor() ([]byte, []int) { + return fileDescriptor_cache_c95b22de9c135769, []int{11} +} +func (m *UpdateFriendInfoReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateFriendInfoReq.Unmarshal(m, b) +} +func (m *UpdateFriendInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateFriendInfoReq.Marshal(b, m, deterministic) +} +func (dst *UpdateFriendInfoReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateFriendInfoReq.Merge(dst, src) +} +func (m *UpdateFriendInfoReq) XXX_Size() int { + return xxx_messageInfo_UpdateFriendInfoReq.Size(m) +} +func (m *UpdateFriendInfoReq) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateFriendInfoReq.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateFriendInfoReq proto.InternalMessageInfo + +func (m *UpdateFriendInfoReq) GetFriendInfoList() []*sdk_ws.FriendInfo { + if m != nil { + return m.FriendInfoList + } + return nil +} + +func (m *UpdateFriendInfoReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type UpdateFriendInfoResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateFriendInfoResp) Reset() { *m = UpdateFriendInfoResp{} } +func (m *UpdateFriendInfoResp) String() string { return proto.CompactTextString(m) } +func (*UpdateFriendInfoResp) ProtoMessage() {} +func (*UpdateFriendInfoResp) Descriptor() ([]byte, []int) { + return fileDescriptor_cache_c95b22de9c135769, []int{12} +} +func (m *UpdateFriendInfoResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateFriendInfoResp.Unmarshal(m, b) +} +func (m *UpdateFriendInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateFriendInfoResp.Marshal(b, m, deterministic) +} +func (dst *UpdateFriendInfoResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateFriendInfoResp.Merge(dst, src) +} +func (m *UpdateFriendInfoResp) XXX_Size() int { + return xxx_messageInfo_UpdateFriendInfoResp.Size(m) +} +func (m *UpdateFriendInfoResp) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateFriendInfoResp.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateFriendInfoResp proto.InternalMessageInfo + +func (m *UpdateFriendInfoResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func init() { + proto.RegisterType((*CommonResp)(nil), "cache.CommonResp") + proto.RegisterType((*GetUserInfoReq)(nil), "cache.GetUserInfoReq") + proto.RegisterType((*GetUserInfoResp)(nil), "cache.GetUserInfoResp") + proto.RegisterType((*UpdateUserInfoReq)(nil), "cache.UpdateUserInfoReq") + proto.RegisterType((*UpdateUserInfoResp)(nil), "cache.UpdateUserInfoResp") + proto.RegisterType((*GetFriendInfoReq)(nil), "cache.GetFriendInfoReq") + proto.RegisterType((*GetFriendInfoResp)(nil), "cache.GetFriendInfoResp") + proto.RegisterType((*UpdateBlackListReq)(nil), "cache.UpdateBlackListReq") + proto.RegisterType((*UpdateBlackListResp)(nil), "cache.UpdateBlackListResp") + proto.RegisterType((*GetBlackListReq)(nil), "cache.GetBlackListReq") + proto.RegisterType((*GetBlackListResp)(nil), "cache.GetBlackListResp") + proto.RegisterType((*UpdateFriendInfoReq)(nil), "cache.UpdateFriendInfoReq") + proto.RegisterType((*UpdateFriendInfoResp)(nil), "cache.UpdateFriendInfoResp") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// Client API for Cache service + +type CacheClient interface { + GetUserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error) + UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*UpdateUserInfoResp, error) + GetFriendInfo(ctx context.Context, in *GetFriendInfoReq, opts ...grpc.CallOption) (*GetFriendInfoResp, error) + UpdateFriendInfo(ctx context.Context, in *UpdateFriendInfoReq, opts ...grpc.CallOption) (*UpdateFriendInfoResp, error) + UpdateBlackList(ctx context.Context, in *UpdateBlackListReq, opts ...grpc.CallOption) (*UpdateBlackListResp, error) + GetBlackList(ctx context.Context, in *GetBlackListReq, opts ...grpc.CallOption) (*GetBlackListResp, error) +} + +type cacheClient struct { + cc *grpc.ClientConn +} + +func NewCacheClient(cc *grpc.ClientConn) CacheClient { + return &cacheClient{cc} +} + +func (c *cacheClient) GetUserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error) { + out := new(GetUserInfoResp) + err := grpc.Invoke(ctx, "/cache.cache/GetUserInfo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cacheClient) UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*UpdateUserInfoResp, error) { + out := new(UpdateUserInfoResp) + err := grpc.Invoke(ctx, "/cache.cache/UpdateUserInfo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cacheClient) GetFriendInfo(ctx context.Context, in *GetFriendInfoReq, opts ...grpc.CallOption) (*GetFriendInfoResp, error) { + out := new(GetFriendInfoResp) + err := grpc.Invoke(ctx, "/cache.cache/GetFriendInfo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cacheClient) UpdateFriendInfo(ctx context.Context, in *UpdateFriendInfoReq, opts ...grpc.CallOption) (*UpdateFriendInfoResp, error) { + out := new(UpdateFriendInfoResp) + err := grpc.Invoke(ctx, "/cache.cache/UpdateFriendInfo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cacheClient) UpdateBlackList(ctx context.Context, in *UpdateBlackListReq, opts ...grpc.CallOption) (*UpdateBlackListResp, error) { + out := new(UpdateBlackListResp) + err := grpc.Invoke(ctx, "/cache.cache/UpdateBlackList", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cacheClient) GetBlackList(ctx context.Context, in *GetBlackListReq, opts ...grpc.CallOption) (*GetBlackListResp, error) { + out := new(GetBlackListResp) + err := grpc.Invoke(ctx, "/cache.cache/GetBlackList", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Cache service + +type CacheServer interface { + GetUserInfo(context.Context, *GetUserInfoReq) (*GetUserInfoResp, error) + UpdateUserInfo(context.Context, *UpdateUserInfoReq) (*UpdateUserInfoResp, error) + GetFriendInfo(context.Context, *GetFriendInfoReq) (*GetFriendInfoResp, error) + UpdateFriendInfo(context.Context, *UpdateFriendInfoReq) (*UpdateFriendInfoResp, error) + UpdateBlackList(context.Context, *UpdateBlackListReq) (*UpdateBlackListResp, error) + GetBlackList(context.Context, *GetBlackListReq) (*GetBlackListResp, error) +} + +func RegisterCacheServer(s *grpc.Server, srv CacheServer) { + s.RegisterService(&_Cache_serviceDesc, srv) +} + +func _Cache_GetUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CacheServer).GetUserInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cache.cache/GetUserInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CacheServer).GetUserInfo(ctx, req.(*GetUserInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Cache_UpdateUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CacheServer).UpdateUserInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cache.cache/UpdateUserInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CacheServer).UpdateUserInfo(ctx, req.(*UpdateUserInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Cache_GetFriendInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetFriendInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CacheServer).GetFriendInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cache.cache/GetFriendInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CacheServer).GetFriendInfo(ctx, req.(*GetFriendInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Cache_UpdateFriendInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateFriendInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CacheServer).UpdateFriendInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cache.cache/UpdateFriendInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CacheServer).UpdateFriendInfo(ctx, req.(*UpdateFriendInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Cache_UpdateBlackList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateBlackListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CacheServer).UpdateBlackList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cache.cache/UpdateBlackList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CacheServer).UpdateBlackList(ctx, req.(*UpdateBlackListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Cache_GetBlackList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBlackListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CacheServer).GetBlackList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cache.cache/GetBlackList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CacheServer).GetBlackList(ctx, req.(*GetBlackListReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _Cache_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cache.cache", + HandlerType: (*CacheServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetUserInfo", + Handler: _Cache_GetUserInfo_Handler, + }, + { + MethodName: "UpdateUserInfo", + Handler: _Cache_UpdateUserInfo_Handler, + }, + { + MethodName: "GetFriendInfo", + Handler: _Cache_GetFriendInfo_Handler, + }, + { + MethodName: "UpdateFriendInfo", + Handler: _Cache_UpdateFriendInfo_Handler, + }, + { + MethodName: "UpdateBlackList", + Handler: _Cache_UpdateBlackList_Handler, + }, + { + MethodName: "GetBlackList", + Handler: _Cache_GetBlackList_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cache/cache.proto", +} + +func init() { proto.RegisterFile("cache/cache.proto", fileDescriptor_cache_c95b22de9c135769) } + +var fileDescriptor_cache_c95b22de9c135769 = []byte{ + // 527 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4d, 0x6f, 0xd3, 0x40, + 0x10, 0x95, 0x13, 0x35, 0x28, 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 0xf0, 0xbd, 0x90, 0x69, 0xf6, 0xce, 0x7f, 0xaa, 0xf5, 0x9f, 0xf5, 0x0c, 0xe0, + 0xe1, 0x6a, 0xfe, 0xad, 0x7c, 0xee, 0xfe, 0xaa, 0x42, 0x36, 0x0d, 0xf1, 0x0d, 0x34, 0xb4, 0xa9, + 0x82, 0x8f, 0xf2, 0x7b, 0xe6, 0xf8, 0xf2, 0xda, 0x65, 0xcb, 0x59, 0x9f, 0x9b, 0x3f, 0x25, 0xba, + 0xf9, 0xc9, 0x95, 0x19, 0xe1, 0x3d, 0x5e, 0xb3, 0x23, 0x39, 0xf6, 0x60, 0xd7, 0xf8, 0x87, 0xf0, + 0x60, 0x99, 0xcf, 0x30, 0xdb, 0x73, 0xcb, 0x37, 0x24, 0xc7, 0x53, 0xd8, 0xb7, 0xdd, 0x41, 0xcf, + 0x48, 0x69, 0x22, 0x1d, 0xae, 0xdd, 0x93, 0x1c, 0x4f, 0xa0, 0x69, 0x75, 0x34, 0x9a, 0xf4, 0xf5, + 0x16, 0xf5, 0xbc, 0x75, 0x5b, 0xd9, 0xbc, 0xd5, 0x9b, 0x10, 0x35, 0x27, 0x0d, 0x8c, 0x83, 0xd2, + 0x75, 0xc9, 0x7b, 0xcd, 0xcf, 0xbb, 0x61, 0xf6, 0x8c, 0xbd, 0x56, 0xdf, 0xcb, 0x9a, 0x7a, 0xa3, + 0x5e, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xb4, 0x17, 0x6d, 0x42, 0xe2, 0x06, 0x00, 0x00, +} From 16264065574976e68dba60ed3b09f87a359070e8 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 26 Apr 2022 14:13:36 +0800 Subject: [PATCH 44/51] cache rpc --- internal/rpc/cache/cache.go | 6 ++++++ internal/rpc/office/office.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/rpc/cache/cache.go b/internal/rpc/cache/cache.go index 693d89cb5..8aabca616 100644 --- a/internal/rpc/cache/cache.go +++ b/internal/rpc/cache/cache.go @@ -96,10 +96,16 @@ func (s *cacheServer) UpdateUserInfo(_ context.Context, req *pbCache.UpdateUserI } func (s *cacheServer) GetBlackList(_ context.Context, req *pbCache.GetBlackListReq) (resp *pbCache.GetBlackListResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) return nil, nil } func (s *cacheServer) UpdateBlackList(_ context.Context, req *pbCache.UpdateBlackListReq) (resp *pbCache.UpdateBlackListResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) return nil, nil } diff --git a/internal/rpc/office/office.go b/internal/rpc/office/office.go index 4862e4d07..19b21a8ec 100644 --- a/internal/rpc/office/office.go +++ b/internal/rpc/office/office.go @@ -305,7 +305,7 @@ func (s *officeServer) CreateOneWorkMoment(_ context.Context, req *pbOffice.Crea UserName: createUser.Nickname, CreateTime: workMoment.CreateTime, } - msg.WorkMomentSendNotification(req.OperationID, workMoment.UserID, atUser.UserID, workMomentNotificationMsg) + msg.WorkMomentSendNotification(req.OperationID, atUser.UserID, atUser.UserID, workMomentNotificationMsg) } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) return resp, nil From 69c46f684ff44d750f79d5e97e6407ae6d5bcb6e Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 26 Apr 2022 14:38:11 +0800 Subject: [PATCH 45/51] cache rpc --- internal/rpc/msg/work_moments_notification.go | 6 +++--- internal/rpc/office/office.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/rpc/msg/work_moments_notification.go b/internal/rpc/msg/work_moments_notification.go index af333a354..b8eaff9a4 100644 --- a/internal/rpc/msg/work_moments_notification.go +++ b/internal/rpc/msg/work_moments_notification.go @@ -12,9 +12,9 @@ import ( func WorkMomentSendNotification(operationID, sendID, recvID string, notificationMsg *pbOffice.WorkMomentNotificationMsg) { log.NewInfo(operationID, utils.GetSelfFuncName(), sendID, recvID, notificationMsg) - //if sendID == recvID { - // return - //} + if sendID == recvID { + return + } WorkMomentNotification(operationID, sendID, recvID, notificationMsg) } diff --git a/internal/rpc/office/office.go b/internal/rpc/office/office.go index 19b21a8ec..e0397d572 100644 --- a/internal/rpc/office/office.go +++ b/internal/rpc/office/office.go @@ -305,7 +305,7 @@ func (s *officeServer) CreateOneWorkMoment(_ context.Context, req *pbOffice.Crea UserName: createUser.Nickname, CreateTime: workMoment.CreateTime, } - msg.WorkMomentSendNotification(req.OperationID, atUser.UserID, atUser.UserID, workMomentNotificationMsg) + msg.WorkMomentSendNotification(req.OperationID, req.WorkMoment.UserID, atUser.UserID, workMomentNotificationMsg) } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) return resp, nil From 490f4f36f1584c1c95e8851300442d4f049c033e Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 26 Apr 2022 14:43:55 +0800 Subject: [PATCH 46/51] cache rpc --- internal/rpc/msg/work_moments_notification.go | 9 +++------ internal/rpc/office/office.go | 8 ++++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/internal/rpc/msg/work_moments_notification.go b/internal/rpc/msg/work_moments_notification.go index b8eaff9a4..a8ed67c93 100644 --- a/internal/rpc/msg/work_moments_notification.go +++ b/internal/rpc/msg/work_moments_notification.go @@ -10,12 +10,9 @@ import ( "github.com/golang/protobuf/proto" ) -func WorkMomentSendNotification(operationID, sendID, recvID string, notificationMsg *pbOffice.WorkMomentNotificationMsg) { - log.NewInfo(operationID, utils.GetSelfFuncName(), sendID, recvID, notificationMsg) - if sendID == recvID { - return - } - WorkMomentNotification(operationID, sendID, recvID, notificationMsg) +func WorkMomentSendNotification(operationID, recvID string, notificationMsg *pbOffice.WorkMomentNotificationMsg) { + log.NewInfo(operationID, utils.GetSelfFuncName(), recvID, notificationMsg) + WorkMomentNotification(operationID, recvID, recvID, notificationMsg) } func WorkMomentNotification(operationID, sendID, recvID string, m proto.Message) { diff --git a/internal/rpc/office/office.go b/internal/rpc/office/office.go index e0397d572..869a03362 100644 --- a/internal/rpc/office/office.go +++ b/internal/rpc/office/office.go @@ -305,7 +305,7 @@ func (s *officeServer) CreateOneWorkMoment(_ context.Context, req *pbOffice.Crea UserName: createUser.Nickname, CreateTime: workMoment.CreateTime, } - msg.WorkMomentSendNotification(req.OperationID, req.WorkMoment.UserID, atUser.UserID, workMomentNotificationMsg) + msg.WorkMomentSendNotification(req.OperationID, atUser.UserID, workMomentNotificationMsg) } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) return resp, nil @@ -399,7 +399,7 @@ func (s *officeServer) LikeOneWorkMoment(_ context.Context, req *pbOffice.LikeOn } // send notification if like { - msg.WorkMomentSendNotification(req.OperationID, req.UserID, workMoment.UserID, workMomentNotificationMsg) + msg.WorkMomentSendNotification(req.OperationID, workMoment.UserID, workMomentNotificationMsg) } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) return resp, nil @@ -450,9 +450,9 @@ func (s *officeServer) CommentOneWorkMoment(_ context.Context, req *pbOffice.Com Content: comment.Content, CreateTime: comment.CreateTime, } - msg.WorkMomentSendNotification(req.OperationID, req.UserID, workMoment.UserID, workMomentNotificationMsg) + msg.WorkMomentSendNotification(req.OperationID, workMoment.UserID, workMomentNotificationMsg) if req.ReplyUserID != "" { - msg.WorkMomentSendNotification(req.OperationID, req.UserID, req.ReplyUserID, workMomentNotificationMsg) + msg.WorkMomentSendNotification(req.OperationID, req.ReplyUserID, workMomentNotificationMsg) } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) return resp, nil From 338acfba759ae93d4221a2940cab00566ab58be7 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 26 Apr 2022 14:57:15 +0800 Subject: [PATCH 47/51] cache rpc --- internal/rpc/office/office.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/rpc/office/office.go b/internal/rpc/office/office.go index 869a03362..674dcf773 100644 --- a/internal/rpc/office/office.go +++ b/internal/rpc/office/office.go @@ -398,7 +398,7 @@ func (s *officeServer) LikeOneWorkMoment(_ context.Context, req *pbOffice.LikeOn CreateTime: int32(time.Now().Unix()), } // send notification - if like { + if like && workMoment.UserID != req.UserID { msg.WorkMomentSendNotification(req.OperationID, workMoment.UserID, workMomentNotificationMsg) } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) @@ -450,7 +450,9 @@ func (s *officeServer) CommentOneWorkMoment(_ context.Context, req *pbOffice.Com Content: comment.Content, CreateTime: comment.CreateTime, } - msg.WorkMomentSendNotification(req.OperationID, workMoment.UserID, workMomentNotificationMsg) + if req.UserID != workMoment.UserID { + msg.WorkMomentSendNotification(req.OperationID, workMoment.UserID, workMomentNotificationMsg) + } if req.ReplyUserID != "" { msg.WorkMomentSendNotification(req.OperationID, req.ReplyUserID, workMomentNotificationMsg) } From 39822f323fd289d25d0fcb2a735361c12aa8d4ae Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 26 Apr 2022 15:05:23 +0800 Subject: [PATCH 48/51] work moments --- internal/rpc/office/office.go | 2 +- internal/rpc/user/user.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/rpc/office/office.go b/internal/rpc/office/office.go index 674dcf773..ab9da950a 100644 --- a/internal/rpc/office/office.go +++ b/internal/rpc/office/office.go @@ -453,7 +453,7 @@ func (s *officeServer) CommentOneWorkMoment(_ context.Context, req *pbOffice.Com if req.UserID != workMoment.UserID { msg.WorkMomentSendNotification(req.OperationID, workMoment.UserID, workMomentNotificationMsg) } - if req.ReplyUserID != "" { + if req.ReplyUserID != "" && req.ReplyUserID != req.UserID { msg.WorkMomentSendNotification(req.OperationID, req.ReplyUserID, workMomentNotificationMsg) } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) diff --git a/internal/rpc/user/user.go b/internal/rpc/user/user.go index 23423bcd4..f3e688588 100644 --- a/internal/rpc/user/user.go +++ b/internal/rpc/user/user.go @@ -389,6 +389,10 @@ func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbUser.UpdateUserI log.Info(req.OperationID, "UserInfoUpdatedNotification ", req.UserInfo.UserID, v.FriendUser.UserID) chat.UserInfoUpdatedNotification(req.OperationID, req.UserInfo.UserID, v.FriendUser.UserID) } + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := pbFriend.NewFriendClient(etcdConn) + chat.UserInfoUpdatedNotification(req.OperationID, req.UserInfo.UserID, req.OpUserID) log.Info(req.OperationID, "UserInfoUpdatedNotification ", req.UserInfo.UserID, req.OpUserID) return &pbUser.UpdateUserInfoResp{CommonResp: &pbUser.CommonResp{}}, nil From 1a2aa876e326e1ae452793f35ebf06f437e1f7cb Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 26 Apr 2022 15:06:43 +0800 Subject: [PATCH 49/51] work moments --- internal/rpc/user/user.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/rpc/user/user.go b/internal/rpc/user/user.go index f3e688588..7ed1059ed 100644 --- a/internal/rpc/user/user.go +++ b/internal/rpc/user/user.go @@ -390,8 +390,8 @@ func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbUser.UpdateUserI chat.UserInfoUpdatedNotification(req.OperationID, req.UserInfo.UserID, v.FriendUser.UserID) } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) - client := pbFriend.NewFriendClient(etcdConn) + //etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + //client := pbFriend.NewFriendClient(etcdConn) chat.UserInfoUpdatedNotification(req.OperationID, req.UserInfo.UserID, req.OpUserID) log.Info(req.OperationID, "UserInfoUpdatedNotification ", req.UserInfo.UserID, req.OpUserID) From 37c40d7dda28d58fc3c523a1b3132a36a3f27863 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 26 Apr 2022 15:52:03 +0800 Subject: [PATCH 50/51] work moments --- internal/rpc/office/office.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/rpc/office/office.go b/internal/rpc/office/office.go index ab9da950a..e0ef89e43 100644 --- a/internal/rpc/office/office.go +++ b/internal/rpc/office/office.go @@ -453,7 +453,7 @@ func (s *officeServer) CommentOneWorkMoment(_ context.Context, req *pbOffice.Com if req.UserID != workMoment.UserID { msg.WorkMomentSendNotification(req.OperationID, workMoment.UserID, workMomentNotificationMsg) } - if req.ReplyUserID != "" && req.ReplyUserID != req.UserID { + if req.ReplyUserID != "" && req.ReplyUserID != workMoment.UserID && req.ReplyUserID != req.UserID { msg.WorkMomentSendNotification(req.OperationID, req.ReplyUserID, workMomentNotificationMsg) } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) From 17f6b8eb2ac13f627c2f19df56f99092a5e09d33 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 26 Apr 2022 16:01:48 +0800 Subject: [PATCH 51/51] work moments --- internal/api/user/user.go | 199 ++++++++++++++++++++++---------------- pkg/common/db/model.go | 24 ++--- 2 files changed, 125 insertions(+), 98 deletions(-) diff --git a/internal/api/user/user.go b/internal/api/user/user.go index d6b733f03..437774972 100644 --- a/internal/api/user/user.go +++ b/internal/api/user/user.go @@ -8,7 +8,6 @@ import ( "Open_IM/pkg/common/log" "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" - cacheRpc "Open_IM/pkg/proto/cache" pbRelay "Open_IM/pkg/proto/relay" open_im_sdk "Open_IM/pkg/proto/sdk_ws" rpc "Open_IM/pkg/proto/user" @@ -19,6 +18,110 @@ import ( "strings" ) +//func GetUsersInfoFromCache(c *gin.Context) { +// params := api.GetUsersInfoReq{} +// if err := c.BindJSON(¶ms); err != nil { +// log.NewError("0", "BindJSON failed ", err.Error()) +// c.JSON(http.StatusBadRequest, gin.H{"errCode": http.StatusBadRequest, "errMsg": err.Error()}) +// return +// } +// getUserInfoReq := &rpc.GetUserInfoReq{} +// getUserInfoReq.OperationID = params.OperationID +// var ok bool +// ok, getUserInfoReq.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), getUserInfoReq.OperationID) +// if !ok { +// log.NewError(getUserInfoReq.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) +// c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) +// return +// } +// log.NewInfo(params.OperationID, "GetUserInfo args ", getUserInfoReq.String()) +// reqCacheGetUserInfo := &cacheRpc.GetUserInfoReq{} +// utils.CopyStructFields(reqCacheGetUserInfo, ¶ms) +// var userInfoList []*open_im_sdk.UserInfo +// var publicUserInfoList []*open_im_sdk.PublicUserInfo +// etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) +// cacheClient := cacheRpc.NewCacheClient(etcdConn) +// cacheResp, err := cacheClient.GetUserInfo(context.Background(), reqCacheGetUserInfo) +// if err != nil { +// log.NewError(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "GetUserInfo failed", err.Error()) +// c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed: " + err.Error()}) +// return +// } +// if cacheResp.CommonResp.ErrCode != 0 { +// log.NewError(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "GetUserInfo failed", cacheResp.CommonResp) +// resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}} +// resp.Data = []map[string]interface{}{} +// log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp) +// c.JSON(http.StatusOK, resp) +// return +// } +// log.NewInfo(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "cacheResp:", cacheResp.String()) +// userInfoList = cacheResp.UserInfoList +// var needCacheUserIDList []string +// for _, userID := range reqCacheGetUserInfo.UserIDList { +// isGetUserInfoFromCache := false +// for _, cacheUser := range userInfoList { +// if cacheUser.UserID == userID { +// isGetUserInfoFromCache = true +// } +// } +// if !isGetUserInfoFromCache { +// needCacheUserIDList = append(needCacheUserIDList, userID) +// } +// } +// if len(needCacheUserIDList) == 0 { +// log.NewInfo(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "get all userInfo from cache success") +// for _, v := range userInfoList { +// publicUserInfoList = append(publicUserInfoList, +// &open_im_sdk.PublicUserInfo{UserID: v.UserID, Nickname: v.Nickname, FaceURL: v.FaceURL, Gender: v.Gender, Ex: v.Ex}) +// } +// resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}, UserInfoList: publicUserInfoList} +// resp.Data = jsonData.JsonDataList(resp.UserInfoList) +// log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp) +// c.JSON(http.StatusOK, resp) +// return +// } +// +// log.NewDebug(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "need cache user list", needCacheUserIDList) +// getUserInfoReq.UserIDList = needCacheUserIDList +// etcdConn = getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) +// client := rpc.NewUserClient(etcdConn) +// rpcResp, err := client.GetUserInfo(context.Background(), getUserInfoReq) +// if err != nil { +// log.NewError(getUserInfoReq.OperationID, "GetUserInfo failed ", err.Error(), getUserInfoReq.String()) +// c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed" + err.Error()}) +// return +// } +// if rpcResp.CommonResp.ErrCode != 0 { +// log.NewError(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "GetUserInfo failed", cacheResp.CommonResp) +// resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}} +// resp.Data = []map[string]interface{}{} +// log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp) +// c.JSON(http.StatusOK, resp) +// return +// } +// userInfoList = append(userInfoList, rpcResp.UserInfoList...) +// cacheUpdateUserInfoReq := &cacheRpc.UpdateUserInfoReq{ +// UserInfoList: rpcResp.UserInfoList, +// OperationID: getUserInfoReq.OperationID, +// } +// _, err = cacheClient.UpdateUserInfo(context.Background(), cacheUpdateUserInfoReq) +// if err != nil { +// log.NewError(getUserInfoReq.OperationID, "GetUserInfo failed ", err.Error()) +// c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed:" + err.Error()}) +// return +// } +// userInfoList = rpcResp.UserInfoList +// for _, v := range userInfoList { +// publicUserInfoList = append(publicUserInfoList, +// &open_im_sdk.PublicUserInfo{UserID: v.UserID, Nickname: v.Nickname, FaceURL: v.FaceURL, Gender: v.Gender, Ex: v.Ex}) +// } +// resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: rpcResp.CommonResp.ErrCode, ErrMsg: rpcResp.CommonResp.ErrMsg}, UserInfoList: publicUserInfoList} +// resp.Data = jsonData.JsonDataList(resp.UserInfoList) +// log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp) +// c.JSON(http.StatusOK, resp) +//} + func GetUsersInfoFromCache(c *gin.Context) { params := api.GetUsersInfoReq{} if err := c.BindJSON(¶ms); err != nil { @@ -26,100 +129,34 @@ func GetUsersInfoFromCache(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"errCode": http.StatusBadRequest, "errMsg": err.Error()}) return } - getUserInfoReq := &rpc.GetUserInfoReq{} - getUserInfoReq.OperationID = params.OperationID + req := &rpc.GetUserInfoReq{} + utils.CopyStructFields(req, ¶ms) var ok bool - ok, getUserInfoReq.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), getUserInfoReq.OperationID) + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) if !ok { - log.NewError(getUserInfoReq.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) return } - log.NewInfo(params.OperationID, "GetUserInfo args ", getUserInfoReq.String()) - reqCacheGetUserInfo := &cacheRpc.GetUserInfoReq{} - utils.CopyStructFields(reqCacheGetUserInfo, ¶ms) - var userInfoList []*open_im_sdk.UserInfo - var publicUserInfoList []*open_im_sdk.PublicUserInfo - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) - cacheClient := cacheRpc.NewCacheClient(etcdConn) - cacheResp, err := cacheClient.GetUserInfo(context.Background(), reqCacheGetUserInfo) - if err != nil { - log.NewError(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "GetUserInfo failed", err.Error()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed: " + err.Error()}) - return - } - if cacheResp.CommonResp.ErrCode != 0 { - log.NewError(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "GetUserInfo failed", cacheResp.CommonResp) - resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}} - resp.Data = []map[string]interface{}{} - log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp) - c.JSON(http.StatusOK, resp) - return - } - log.NewInfo(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "cacheResp:", cacheResp.String()) - userInfoList = cacheResp.UserInfoList - var needCacheUserIDList []string - for _, userID := range reqCacheGetUserInfo.UserIDList { - isGetUserInfoFromCache := false - for _, cacheUser := range userInfoList { - if cacheUser.UserID == userID { - isGetUserInfoFromCache = true - } - } - if !isGetUserInfoFromCache { - needCacheUserIDList = append(needCacheUserIDList, userID) - } - } - if len(needCacheUserIDList) == 0 { - log.NewInfo(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "get all userInfo from cache success") - for _, v := range userInfoList { - publicUserInfoList = append(publicUserInfoList, - &open_im_sdk.PublicUserInfo{UserID: v.UserID, Nickname: v.Nickname, FaceURL: v.FaceURL, Gender: v.Gender, Ex: v.Ex}) - } - resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}, UserInfoList: publicUserInfoList} - resp.Data = jsonData.JsonDataList(resp.UserInfoList) - log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp) - c.JSON(http.StatusOK, resp) - return - } + log.NewInfo(params.OperationID, "GetUserInfo args ", req.String()) - log.NewDebug(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "need cache user list", needCacheUserIDList) - getUserInfoReq.UserIDList = needCacheUserIDList - etcdConn = getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) client := rpc.NewUserClient(etcdConn) - rpcResp, err := client.GetUserInfo(context.Background(), getUserInfoReq) - if err != nil { - log.NewError(getUserInfoReq.OperationID, "GetUserInfo failed ", err.Error(), getUserInfoReq.String()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed" + err.Error()}) - return - } - if rpcResp.CommonResp.ErrCode != 0 { - log.NewError(getUserInfoReq.OperationID, utils.GetSelfFuncName(), "GetUserInfo failed", cacheResp.CommonResp) - resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: cacheResp.CommonResp.ErrCode, ErrMsg: cacheResp.CommonResp.ErrMsg}} - resp.Data = []map[string]interface{}{} - log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp) - c.JSON(http.StatusOK, resp) - return - } - userInfoList = append(userInfoList, rpcResp.UserInfoList...) - cacheUpdateUserInfoReq := &cacheRpc.UpdateUserInfoReq{ - UserInfoList: rpcResp.UserInfoList, - OperationID: getUserInfoReq.OperationID, - } - _, err = cacheClient.UpdateUserInfo(context.Background(), cacheUpdateUserInfoReq) + RpcResp, err := client.GetUserInfo(context.Background(), req) if err != nil { - log.NewError(getUserInfoReq.OperationID, "GetUserInfo failed ", err.Error()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed:" + err.Error()}) + log.NewError(req.OperationID, "GetUserInfo failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) return } - userInfoList = rpcResp.UserInfoList - for _, v := range userInfoList { + var publicUserInfoList []*open_im_sdk.PublicUserInfo + for _, v := range RpcResp.UserInfoList { publicUserInfoList = append(publicUserInfoList, &open_im_sdk.PublicUserInfo{UserID: v.UserID, Nickname: v.Nickname, FaceURL: v.FaceURL, Gender: v.Gender, Ex: v.Ex}) } - resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: rpcResp.CommonResp.ErrCode, ErrMsg: rpcResp.CommonResp.ErrMsg}, UserInfoList: publicUserInfoList} + + resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, UserInfoList: publicUserInfoList} resp.Data = jsonData.JsonDataList(resp.UserInfoList) - log.NewInfo(getUserInfoReq.OperationID, "GetUserInfo api return ", resp) + log.NewInfo(req.OperationID, "GetUserInfo api return ", resp) c.JSON(http.StatusOK, resp) } diff --git a/pkg/common/db/model.go b/pkg/common/db/model.go index 2fe0ed367..e50d7dc11 100644 --- a/pkg/common/db/model.go +++ b/pkg/common/db/model.go @@ -71,24 +71,14 @@ func init() { opts := options.CreateIndexes().SetMaxTime(10 * time.Second) dataBase := mongoClient.Database(config.Config.Mongo.DBDatabase) - cCommentMsgModels := []mongo.IndexModel{ - { - Keys: bson.A{bson.D{{"create_time", -1}, {"user_id", -1}}}, - }, - } - result, err := dataBase.Collection(cCommentMsg).Indexes().CreateMany(context.Background(), cCommentMsgModels, opts) - if err != nil { - fmt.Println("mongodb create cCommentMsgModels failed", result, err.Error()) - } - cSendLogModels := []mongo.IndexModel{ { - Keys: bson.M{"user_id": -1, "send_time": -1}, + Keys: bson.M{"user_id": -1}, }, } - result, err = dataBase.Collection(cSendLog).Indexes().CreateMany(context.Background(), cSendLogModels, opts) + result, err := dataBase.Collection(cSendLog).Indexes().CreateMany(context.Background(), cSendLogModels, opts) if err != nil { - fmt.Println("mongodb create cSendLogModels failed", result, err.Error()) + //fmt.Println("mongodb create cSendLogModels failed", result, err.Error()) } cChatModels := []mongo.IndexModel{ @@ -106,12 +96,12 @@ func init() { Keys: bson.M{"work_moment_id": -1}, }, { - Keys: bson.M{"user_id": -1, "create_time": -1}, + Keys: bson.M{"user_id": -1}, }, } result, err = dataBase.Collection(cWorkMoment).Indexes().CreateMany(context.Background(), cWorkMomentModels, opts) if err != nil { - fmt.Println("mongodb create cWorkMomentModels failed", result, err.Error()) + //fmt.Println("mongodb create cWorkMomentModels failed", result, err.Error()) } cTagModels := []mongo.IndexModel{ @@ -119,12 +109,12 @@ func init() { Keys: bson.M{"tag_id": -1}, }, { - Keys: bson.M{"user_id": -1, "tag_id": -1}, + Keys: bson.M{"user_id": -1}, }, } result, err = dataBase.Collection(cTag).Indexes().CreateMany(context.Background(), cTagModels, opts) if err != nil { - fmt.Println("mongodb create cTagModels failed", result, err.Error()) + //fmt.Println("mongodb create cTagModels failed", result, err.Error()) } DB.mongoClient = mongoClient