diff --git a/config/config.yaml b/config/config.yaml index 7e5912ea2..e9db39cf1 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -117,6 +117,7 @@ push: accessID: 111 secretKey: 111 +appmanageruid: "openIM123456" secret: tuoyun multiloginpolicy: diff --git a/src/api/friend/add_blacklist.go b/src/api/friend/add_blacklist.go index 107c47a5e..1e03b53ec 100644 --- a/src/api/friend/add_blacklist.go +++ b/src/api/friend/add_blacklist.go @@ -11,10 +11,11 @@ import ( "strings" ) +/* type paramsAddBlackList struct { OperationID string `json:"operationID" binding:"required"` UID string `json:"uid" binding:"required"` -} +}*/ func AddBlacklist(c *gin.Context) { log.Info("", "", "api add blacklist init ....") @@ -32,6 +33,7 @@ func AddBlacklist(c *gin.Context) { Uid: params.UID, OperationID: params.OperationID, Token: c.Request.Header.Get("token"), + OwnerUid: params.OwnerUid, } log.Info(req.Token, req.OperationID, "api add blacklist is server:userID=%s", req.Uid) RpcResp, err := client.AddBlacklist(context.Background(), req) diff --git a/src/api/friend/add_friend.go b/src/api/friend/add_friend.go index 58dbf762c..88a4ea731 100644 --- a/src/api/friend/add_friend.go +++ b/src/api/friend/add_friend.go @@ -11,18 +11,54 @@ import ( "strings" ) +type paramsImportFriendReq struct { + OperationID string `json:"operationID" binding:"required"` + UID string `json:"uid" binding:"required"` + OwnerUid string `json:"ownerUid"` +} + type paramsAddFriend struct { OperationID string `json:"operationID" binding:"required"` UID string `json:"uid" binding:"required"` ReqMessage string `json:"reqMessage"` } +// +func ImportFriend(c *gin.Context) { + log.Info("", "", "ImportFriend init ....") + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := pbFriend.NewFriendClient(etcdConn) + + params := paramsImportFriendReq{} + if err := c.BindJSON(¶ms); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &pbFriend.ImportFriendReq{ + Uid: params.UID, + OperationID: params.OperationID, + OwnerUid: params.OwnerUid, + Token: c.Request.Header.Get("token"), + } + log.Info(req.Token, req.OperationID, "api add friend is server") + RpcResp, err := client.ImportFriend(context.Background(), req) + if err != nil { + log.Error(req.Token, req.OperationID, "err=%s,ImportFriend failed", err) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "cImportFriend failed"}) + return + } + log.InfoByArgs("ImportFriend success,args=%s", RpcResp.String()) + resp := gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg} + c.JSON(http.StatusOK, resp) + log.InfoByArgs("ImportFriend success return,get args=%s,return args=%s", req.String(), RpcResp.String()) +} + func AddFriend(c *gin.Context) { log.Info("", "", "api add friend init ....") etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) client := pbFriend.NewFriendClient(etcdConn) - //defer etcdConn.Close() params := paramsAddFriend{} if err := c.BindJSON(¶ms); err != nil { diff --git a/src/api/friend/get_friends_info.go b/src/api/friend/get_friends_info.go index c50c9967c..21266d032 100644 --- a/src/api/friend/get_friends_info.go +++ b/src/api/friend/get_friends_info.go @@ -15,6 +15,7 @@ import ( type paramsSearchFriend struct { OperationID string `json:"operationID" binding:"required"` UID string `json:"uid" binding:"required"` + OwnerUid string `json:"ownerUid"` } func GetFriendsInfo(c *gin.Context) { diff --git a/src/api/manage/management_chat.go b/src/api/manage/management_chat.go new file mode 100644 index 000000000..e57851b1d --- /dev/null +++ b/src/api/manage/management_chat.go @@ -0,0 +1,204 @@ +/* +** description(""). +** copyright('open-im,www.open-im.io'). +** author("fg,Gordon@tuoyun.net"). +** time(2021/9/15 15:23). + */ +package manage + +import ( + "Open_IM/src/common/config" + "Open_IM/src/common/constant" + "Open_IM/src/common/log" + "Open_IM/src/grpc-etcdv3/getcdv3" + pbChat "Open_IM/src/proto/chat" + "Open_IM/src/utils" + "context" + "github.com/gin-gonic/gin" + "github.com/go-playground/validator/v10" + "github.com/mitchellh/mapstructure" + "net/http" + "strings" +) + +var validate *validator.Validate + +type paramsManagementSendMsg struct { + OperationID string `json:"operationID" binding:"required"` + SendID string `json:"sendID" binding:"required"` + RecvID string `json:"recvID" binding:"required"` + SenderNickName string `json:"senderNickName" ` + SenderFaceURL string `json:"senderFaceURL" ` + ForceList []string `json:"forceList" ` + Content map[string]interface{} `json:"content" binding:"required"` + ContentType int32 `json:"contentType" binding:"required"` + SessionType int32 `json:"sessionType" binding:"required"` +} + +func newUserSendMsgReq(token string, params *paramsManagementSendMsg) *pbChat.UserSendMsgReq { + var newContent string + switch params.ContentType { + case constant.Text: + newContent = params.Content["text"].(string) + case constant.Picture: + fallthrough + case constant.Custom: + fallthrough + case constant.Voice: + fallthrough + case constant.File: + newContent = utils.StructToJsonString(params.Content) + default: + + } + pbData := pbChat.UserSendMsgReq{ + ReqIdentifier: constant.WSSendMsg, + Token: token, + SendID: params.SendID, + SenderNickName: params.SenderNickName, + SenderFaceURL: params.SenderFaceURL, + OperationID: params.OperationID, + PlatformID: 0, + SessionType: params.SessionType, + MsgFrom: constant.UserMsgType, + ContentType: params.ContentType, + RecvID: params.RecvID, + ForceList: params.ForceList, + Content: newContent, + ClientMsgID: utils.GetMsgID(params.SendID), + } + return &pbData +} +func init() { + validate = validator.New() +} +func ManagementSendMsg(c *gin.Context) { + var data interface{} + params := paramsManagementSendMsg{} + if err := c.BindJSON(¶ms); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + log.ErrorByKv("json unmarshal err", c.PostForm("operationID"), "err", err.Error(), "content", c.PostForm("content")) + return + } + switch params.ContentType { + case constant.Text: + data = TextElem{} + case constant.Picture: + data = PictureElem{} + case constant.Custom: + data = CustomElem{} + default: + c.JSON(http.StatusBadRequest, gin.H{"errCode": 404, "errMsg": "contentType err"}) + log.ErrorByKv("contentType err", c.PostForm("operationID"), "content", c.PostForm("content")) + return + } + if err := mapstructure.WeakDecode(params.Content, &data); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": err.Error()}) + log.ErrorByKv("content to Data struct err", "", "err", err.Error()) + return + } else if err := validate.Struct(data); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 403, "errMsg": err.Error()}) + log.ErrorByKv("data args validate err", "", "err", err.Error()) + return + } + + token := c.Request.Header.Get("token") + if !utils.VerifyToken(token, config.Config.AppManagerUid) { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "token validate err,not authorized", "sendTime": 0, "MsgID": ""}) + return + } + + log.InfoByKv("Ws call success to ManagementSendMsgReq", params.OperationID, "Parameters", params) + + pbData := newUserSendMsgReq(token, ¶ms) + log.Info("", "", "api ManagementSendMsg call start..., [data: %s]", pbData.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + client := pbChat.NewChatClient(etcdConn) + + log.Info("", "", "api ManagementSendMsg call, api call rpc...") + + reply, _ := client.UserSendMsg(context.Background(), pbData) + log.Info("", "", "api ManagementSendMsg call end..., [data: %s] [reply: %s]", pbData.String(), reply.String()) + + c.JSON(http.StatusOK, gin.H{ + "errCode": reply.ErrCode, + "errMsg": reply.ErrMsg, + "sendTime": reply.SendTime, + "msgID": reply.ClientMsgID, + }) + +} + +type PictureBaseInfo struct { + UUID string `mapstructure:"uuid"` + Type string `mapstructure:"type" validate:"required"` + Size int64 `mapstructure:"size" validate:"required"` + Width int32 `mapstructure:"width" validate:"required"` + Height int32 `mapstructure:"height" validate:"required"` + Url string `mapstructure:"url" validate:"required"` +} + +type PictureElem struct { + SourcePath string `mapstructure:"sourcePath"` + SourcePicture PictureBaseInfo `mapstructure:"sourcePicture" validate:"required"` + BigPicture PictureBaseInfo `mapstructure:"bigPicture" ` + SnapshotPicture PictureBaseInfo `mapstructure:"snapshotPicture"` +} +type SoundElem struct { + UUID string `mapstructure:"uuid"` + SoundPath string `mapstructure:"soundPath"` + SourceURL string `mapstructure:"sourceUrl"` + DataSize int64 `mapstructure:"dataSize"` + Duration int64 `mapstructure:"duration"` +} +type VideoElem struct { + VideoPath string `mapstructure:"videoPath"` + VideoUUID string `mapstructure:"videoUUID"` + VideoURL string `mapstructure:"videoUrl"` + VideoType string `mapstructure:"videoType"` + VideoSize int64 `mapstructure:"videoSize"` + Duration int64 `mapstructure:"duration"` + SnapshotPath string `mapstructure:"snapshotPath"` + SnapshotUUID string `mapstructure:"snapshotUUID"` + SnapshotSize int64 `mapstructure:"snapshotSize"` + SnapshotURL string `mapstructure:"snapshotUrl"` + SnapshotWidth int32 `mapstructure:"snapshotWidth"` + SnapshotHeight int32 `mapstructure:"snapshotHeight"` +} +type FileElem struct { + FilePath string `mapstructure:"filePath"` + UUID string `mapstructure:"uuid"` + SourceURL string `mapstructure:"sourceUrl"` + FileName string `mapstructure:"fileName"` + FileSize int64 `mapstructure:"fileSize"` +} + +//type MergeElem struct { +// Title string `json:"title"` +// AbstractList []string `json:"abstractList"` +// MultiMessage []*MsgStruct `json:"multiMessage"` +//} +type AtElem struct { + Text string `mapstructure:"text"` + AtUserList []string `mapstructure:"atUserList"` + IsAtSelf bool `mapstructure:"isAtSelf"` +} +type LocationElem struct { + Description string `mapstructure:"description"` + Longitude float64 `mapstructure:"longitude"` + Latitude float64 `mapstructure:"latitude"` +} +type CustomElem struct { + Data string `mapstructure:"data" validate:"required"` + Description string `mapstructure:"description"` + Extension string `mapstructure:"extension"` +} +type TextElem struct { + Text string `mapstructure:"text" validate:"required"` +} + +//type QuoteElem struct { +// Text string `json:"text"` +// QuoteMessage *MsgStruct `json:"quoteMessage"` +//} diff --git a/src/api/manage/management_user.go b/src/api/manage/management_user.go new file mode 100644 index 000000000..578788c8d --- /dev/null +++ b/src/api/manage/management_user.go @@ -0,0 +1,78 @@ +/* +** description(""). +** copyright('open-im,www.open-im.io'). +** author("fg,Gordon@tuoyun.net"). +** time(2021/9/15 10:28). + */ +package manage + +import ( + "Open_IM/src/common/config" + "Open_IM/src/common/log" + "Open_IM/src/grpc-etcdv3/getcdv3" + pbUser "Open_IM/src/proto/user" + "context" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +type paramsDeleteUsers struct { + OperationID string `json:"operationID" binding:"required"` + DeleteUidList []string `json:"deleteUidList" binding:"required"` +} +type paramsGetAllUsersUid struct { + OperationID string `json:"operationID" binding:"required"` +} + +func DeleteUser(c *gin.Context) { + params := paramsDeleteUsers{} + if err := c.BindJSON(¶ms); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + log.InfoByKv("DeleteUser req come here", params.OperationID, "DeleteUidList", params.DeleteUidList) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pbUser.NewUserClient(etcdConn) + //defer etcdConn.Close() + + req := &pbUser.DeleteUsersReq{ + OperationID: params.OperationID, + DeleteUidList: params.DeleteUidList, + Token: c.Request.Header.Get("token"), + } + RpcResp, err := client.DeleteUsers(context.Background(), req) + if err != nil { + + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call delete users rpc server failed"}) + return + } + log.InfoByKv("call delete user rpc server is success", params.OperationID, "resp args", RpcResp.String()) + resp := gin.H{"errCode": RpcResp.CommonResp.ErrorCode, "errMsg": RpcResp.CommonResp.ErrorMsg, "failedUidList": RpcResp.FailedUidList} + c.JSON(http.StatusOK, resp) +} +func GetAllUsersUid(c *gin.Context) { + params := paramsGetAllUsersUid{} + if err := c.BindJSON(¶ms); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + log.InfoByKv("GetAllUsersUid req come here", params.OperationID) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pbUser.NewUserClient(etcdConn) + //defer etcdConn.Close() + + req := &pbUser.GetAllUsersUidReq{ + OperationID: params.OperationID, + Token: c.Request.Header.Get("token"), + } + RpcResp, err := client.GetAllUsersUid(context.Background(), req) + if err != nil { + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error(), "uidList": []string{}}) + return + } + log.InfoByKv("call GetAllUsersUid rpc server is success", params.OperationID, "resp args", RpcResp.String()) + resp := gin.H{"errCode": RpcResp.CommonResp.ErrorCode, "errMsg": RpcResp.CommonResp.ErrorMsg, "uidList": RpcResp.UidList} + c.JSON(http.StatusOK, resp) + +} diff --git a/src/api/open_im_api.go b/src/api/open_im_api.go index 5dffd3134..681459c70 100644 --- a/src/api/open_im_api.go +++ b/src/api/open_im_api.go @@ -5,6 +5,7 @@ import ( apiChat "Open_IM/src/api/chat" "Open_IM/src/api/friend" "Open_IM/src/api/group" + "Open_IM/src/api/manage" apiThird "Open_IM/src/api/third" "Open_IM/src/api/user" "Open_IM/src/utils" @@ -47,6 +48,7 @@ func main() { friendRouterGroup.POST("/add_friend_response", friend.AddFriendResponse) friendRouterGroup.POST("/set_friend_comment", friend.SetFriendComment) friendRouterGroup.POST("/is_friend", friend.IsFriend) + friendRouterGroup.POST("/import_friend", friend.ImportFriend) } //group related routing group groupRouterGroup := r.Group("/group") @@ -84,6 +86,12 @@ func main() { chatGroup.POST("/pull_msg", apiChat.UserPullMsg) chatGroup.POST("/send_msg", apiChat.UserSendMsg) } + managementGroup := r.Group("/manager") + { + managementGroup.POST("/delete_user", manage.DeleteUser) + managementGroup.POST("/send_msg", manage.ManagementSendMsg) + managementGroup.POST("/get_all_users_uid", manage.GetAllUsersUid) + } ginPort := flag.Int("port", 10000, "get ginServerPort from cmd,default 10000 as port") flag.Parse() diff --git a/src/api/user/update_user_info.go b/src/api/user/update_user_info.go index eeb7841fd..0e296452e 100644 --- a/src/api/user/update_user_info.go +++ b/src/api/user/update_user_info.go @@ -22,6 +22,7 @@ type paramsStruct struct { Birth string `json:"birth"` Email string `json:"email"` Ex string `json:"ex"` + Uid string `json:"uid"` } func UpdateUserInfo(c *gin.Context) { @@ -46,6 +47,7 @@ func UpdateUserInfo(c *gin.Context) { Birth: params.Birth, Email: params.Email, Ex: params.Ex, + Uid: params.Uid, } log.InfoByKv("api update user info is server", req.OperationID, req.Token) RpcResp, err := client.UpdateUserInfo(context.Background(), req) diff --git a/src/common/config/config.go b/src/common/config/config.go index d91922dae..435fd694a 100644 --- a/src/common/config/config.go +++ b/src/common/config/config.go @@ -124,8 +124,8 @@ type config struct { MsgToPush string `yaml:"msgToPush"` } } - - Secret string + AppManagerUid string + Secret string MultiLoginPolicy struct { OnlyOneTerminalAccess bool `yaml:"onlyOneTerminalAccess"` diff --git a/src/common/constant/constant.go b/src/common/constant/constant.go index a5f491e52..793c66ed1 100644 --- a/src/common/constant/constant.go +++ b/src/common/constant/constant.go @@ -30,6 +30,7 @@ const ( Video = 104 File = 105 AtText = 106 + Custom = 110 SyncSenderMsg = 108 //SysRelated diff --git a/src/common/db/mysql_model/im_mysql_model/user_model.go b/src/common/db/mysql_model/im_mysql_model/user_model.go index 559665700..11777de18 100644 --- a/src/common/db/mysql_model/im_mysql_model/user_model.go +++ b/src/common/db/mysql_model/im_mysql_model/user_model.go @@ -30,6 +30,17 @@ func UserRegister(pb *pbAuth.UserRegisterReq) error { return nil } +func UserDelete(uid string) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + err = dbConn.Table("user").Where("uid=?", uid).Delete(User{}).Error + if err != nil { + return err + } + return nil +} func FindUserByUID(uid string) (*User, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { diff --git a/src/proto/friend/friend.pb.go b/src/proto/friend/friend.pb.go index f4d50b462..dc4e655f0 100644 --- a/src/proto/friend/friend.pb.go +++ b/src/proto/friend/friend.pb.go @@ -1,16 +1,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: friend/friend.proto -package friend +package friend // import "friend" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" + context "golang.org/x/net/context" grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" ) // Reference imports to suppress errors if they are not otherwise used. @@ -22,11 +21,11 @@ var _ = math.Inf // 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.ProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type CommonResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode,proto3" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg,proto3" json:"errorMsg,omitempty"` + ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` + ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -36,17 +35,16 @@ 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_1a7db849dd7bb41b, []int{0} + return fileDescriptor_friend_17d6a40c7694c30a, []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 (m *CommonResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommonResp.Merge(m, src) +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) @@ -72,9 +70,9 @@ func (m *CommonResp) GetErrorMsg() string { } type GetFriendsInfoReq struct { - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,3,opt,name=Token,proto3" json:"Token,omitempty"` + Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + Token string `protobuf:"bytes,3,opt,name=Token" json:"Token,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -84,17 +82,16 @@ func (m *GetFriendsInfoReq) Reset() { *m = GetFriendsInfoReq{} } func (m *GetFriendsInfoReq) String() string { return proto.CompactTextString(m) } func (*GetFriendsInfoReq) ProtoMessage() {} func (*GetFriendsInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_1a7db849dd7bb41b, []int{1} + return fileDescriptor_friend_17d6a40c7694c30a, []int{1} } - func (m *GetFriendsInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetFriendsInfoReq.Unmarshal(m, b) } func (m *GetFriendsInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_GetFriendsInfoReq.Marshal(b, m, deterministic) } -func (m *GetFriendsInfoReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetFriendsInfoReq.Merge(m, src) +func (dst *GetFriendsInfoReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFriendsInfoReq.Merge(dst, src) } func (m *GetFriendsInfoReq) XXX_Size() int { return xxx_messageInfo_GetFriendsInfoReq.Size(m) @@ -127,9 +124,9 @@ func (m *GetFriendsInfoReq) GetToken() string { } type GetFriendInfoResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode,proto3" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg,proto3" json:"errorMsg,omitempty"` - Data *GetFriendData `protobuf:"bytes,3,opt,name=Data,proto3" json:"Data,omitempty"` + ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` + ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` + Data *GetFriendData `protobuf:"bytes,3,opt,name=Data" json:"Data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -139,17 +136,16 @@ 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_1a7db849dd7bb41b, []int{2} + return fileDescriptor_friend_17d6a40c7694c30a, []int{2} } - 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 (m *GetFriendInfoResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetFriendInfoResp.Merge(m, src) +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) @@ -182,17 +178,17 @@ func (m *GetFriendInfoResp) GetData() *GetFriendData { } type GetFriendData struct { - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - Icon string `protobuf:"bytes,2,opt,name=icon,proto3" json:"icon,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Gender int32 `protobuf:"varint,4,opt,name=gender,proto3" json:"gender,omitempty"` - Mobile string `protobuf:"bytes,5,opt,name=mobile,proto3" json:"mobile,omitempty"` - Birth string `protobuf:"bytes,6,opt,name=birth,proto3" json:"birth,omitempty"` - Email string `protobuf:"bytes,7,opt,name=email,proto3" json:"email,omitempty"` - Ex string `protobuf:"bytes,8,opt,name=ex,proto3" json:"ex,omitempty"` - Comment string `protobuf:"bytes,9,opt,name=comment,proto3" json:"comment,omitempty"` - IsFriend int32 `protobuf:"varint,10,opt,name=isFriend,proto3" json:"isFriend,omitempty"` - IsInBlackList int32 `protobuf:"varint,11,opt,name=isInBlackList,proto3" json:"isInBlackList,omitempty"` + Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` + Icon string `protobuf:"bytes,2,opt,name=icon" json:"icon,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` + Gender int32 `protobuf:"varint,4,opt,name=gender" json:"gender,omitempty"` + Mobile string `protobuf:"bytes,5,opt,name=mobile" json:"mobile,omitempty"` + Birth string `protobuf:"bytes,6,opt,name=birth" json:"birth,omitempty"` + Email string `protobuf:"bytes,7,opt,name=email" json:"email,omitempty"` + Ex string `protobuf:"bytes,8,opt,name=ex" json:"ex,omitempty"` + Comment string `protobuf:"bytes,9,opt,name=comment" json:"comment,omitempty"` + IsFriend int32 `protobuf:"varint,10,opt,name=isFriend" json:"isFriend,omitempty"` + IsInBlackList int32 `protobuf:"varint,11,opt,name=isInBlackList" json:"isInBlackList,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -202,17 +198,16 @@ func (m *GetFriendData) Reset() { *m = GetFriendData{} } func (m *GetFriendData) String() string { return proto.CompactTextString(m) } func (*GetFriendData) ProtoMessage() {} func (*GetFriendData) Descriptor() ([]byte, []int) { - return fileDescriptor_1a7db849dd7bb41b, []int{3} + return fileDescriptor_friend_17d6a40c7694c30a, []int{3} } - func (m *GetFriendData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetFriendData.Unmarshal(m, b) } func (m *GetFriendData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_GetFriendData.Marshal(b, m, deterministic) } -func (m *GetFriendData) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetFriendData.Merge(m, src) +func (dst *GetFriendData) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFriendData.Merge(dst, src) } func (m *GetFriendData) XXX_Size() int { return xxx_messageInfo_GetFriendData.Size(m) @@ -301,10 +296,10 @@ func (m *GetFriendData) GetIsInBlackList() int32 { } type AddFriendReq struct { - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,3,opt,name=Token,proto3" json:"Token,omitempty"` - ReqMessage string `protobuf:"bytes,4,opt,name=ReqMessage,proto3" json:"ReqMessage,omitempty"` + Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + Token string `protobuf:"bytes,3,opt,name=Token" json:"Token,omitempty"` + ReqMessage string `protobuf:"bytes,4,opt,name=ReqMessage" json:"ReqMessage,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -314,17 +309,16 @@ func (m *AddFriendReq) Reset() { *m = AddFriendReq{} } func (m *AddFriendReq) String() string { return proto.CompactTextString(m) } func (*AddFriendReq) ProtoMessage() {} func (*AddFriendReq) Descriptor() ([]byte, []int) { - return fileDescriptor_1a7db849dd7bb41b, []int{4} + return fileDescriptor_friend_17d6a40c7694c30a, []int{4} } - func (m *AddFriendReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddFriendReq.Unmarshal(m, b) } func (m *AddFriendReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_AddFriendReq.Marshal(b, m, deterministic) } -func (m *AddFriendReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddFriendReq.Merge(m, src) +func (dst *AddFriendReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddFriendReq.Merge(dst, src) } func (m *AddFriendReq) XXX_Size() int { return xxx_messageInfo_AddFriendReq.Size(m) @@ -363,9 +357,71 @@ func (m *AddFriendReq) GetReqMessage() string { return "" } +type ImportFriendReq struct { + Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + Token string `protobuf:"bytes,3,opt,name=Token" json:"Token,omitempty"` + OwnerUid string `protobuf:"bytes,4,opt,name=OwnerUid" json:"OwnerUid,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ImportFriendReq) Reset() { *m = ImportFriendReq{} } +func (m *ImportFriendReq) String() string { return proto.CompactTextString(m) } +func (*ImportFriendReq) ProtoMessage() {} +func (*ImportFriendReq) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_17d6a40c7694c30a, []int{5} +} +func (m *ImportFriendReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ImportFriendReq.Unmarshal(m, b) +} +func (m *ImportFriendReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ImportFriendReq.Marshal(b, m, deterministic) +} +func (dst *ImportFriendReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_ImportFriendReq.Merge(dst, src) +} +func (m *ImportFriendReq) XXX_Size() int { + return xxx_messageInfo_ImportFriendReq.Size(m) +} +func (m *ImportFriendReq) XXX_DiscardUnknown() { + xxx_messageInfo_ImportFriendReq.DiscardUnknown(m) +} + +var xxx_messageInfo_ImportFriendReq proto.InternalMessageInfo + +func (m *ImportFriendReq) GetUid() string { + if m != nil { + return m.Uid + } + return "" +} + +func (m *ImportFriendReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *ImportFriendReq) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *ImportFriendReq) GetOwnerUid() string { + if m != nil { + return m.OwnerUid + } + return "" +} + type GetFriendApplyReq struct { - OperationID string `protobuf:"bytes,1,opt,name=OperationID,proto3" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,2,opt,name=Token,proto3" json:"Token,omitempty"` + OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"` + Token string `protobuf:"bytes,2,opt,name=Token" json:"Token,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -375,17 +431,16 @@ func (m *GetFriendApplyReq) Reset() { *m = GetFriendApplyReq{} } func (m *GetFriendApplyReq) String() string { return proto.CompactTextString(m) } func (*GetFriendApplyReq) ProtoMessage() {} func (*GetFriendApplyReq) Descriptor() ([]byte, []int) { - return fileDescriptor_1a7db849dd7bb41b, []int{5} + return fileDescriptor_friend_17d6a40c7694c30a, []int{6} } - func (m *GetFriendApplyReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetFriendApplyReq.Unmarshal(m, b) } func (m *GetFriendApplyReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_GetFriendApplyReq.Marshal(b, m, deterministic) } -func (m *GetFriendApplyReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetFriendApplyReq.Merge(m, src) +func (dst *GetFriendApplyReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFriendApplyReq.Merge(dst, src) } func (m *GetFriendApplyReq) XXX_Size() int { return xxx_messageInfo_GetFriendApplyReq.Size(m) @@ -411,9 +466,9 @@ func (m *GetFriendApplyReq) GetToken() string { } type GetFriendApplyResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode,proto3" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg,proto3" json:"errorMsg,omitempty"` - Data []*ApplyUserInfo `protobuf:"bytes,4,rep,name=data,proto3" json:"data,omitempty"` + ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` + ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` + Data []*ApplyUserInfo `protobuf:"bytes,4,rep,name=data" json:"data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -423,17 +478,16 @@ func (m *GetFriendApplyResp) Reset() { *m = GetFriendApplyResp{} } func (m *GetFriendApplyResp) String() string { return proto.CompactTextString(m) } func (*GetFriendApplyResp) ProtoMessage() {} func (*GetFriendApplyResp) Descriptor() ([]byte, []int) { - return fileDescriptor_1a7db849dd7bb41b, []int{6} + return fileDescriptor_friend_17d6a40c7694c30a, []int{7} } - func (m *GetFriendApplyResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetFriendApplyResp.Unmarshal(m, b) } func (m *GetFriendApplyResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_GetFriendApplyResp.Marshal(b, m, deterministic) } -func (m *GetFriendApplyResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetFriendApplyResp.Merge(m, src) +func (dst *GetFriendApplyResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFriendApplyResp.Merge(dst, src) } func (m *GetFriendApplyResp) XXX_Size() int { return xxx_messageInfo_GetFriendApplyResp.Size(m) @@ -466,17 +520,17 @@ func (m *GetFriendApplyResp) GetData() []*ApplyUserInfo { } type ApplyUserInfo struct { - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Icon string `protobuf:"bytes,3,opt,name=icon,proto3" json:"icon,omitempty"` - Gender int32 `protobuf:"varint,4,opt,name=gender,proto3" json:"gender,omitempty"` - Mobile string `protobuf:"bytes,5,opt,name=mobile,proto3" json:"mobile,omitempty"` - Birth string `protobuf:"bytes,6,opt,name=birth,proto3" json:"birth,omitempty"` - Email string `protobuf:"bytes,7,opt,name=email,proto3" json:"email,omitempty"` - Ex string `protobuf:"bytes,8,opt,name=ex,proto3" json:"ex,omitempty"` - Flag int32 `protobuf:"varint,9,opt,name=flag,proto3" json:"flag,omitempty"` - ApplyTime string `protobuf:"bytes,10,opt,name=applyTime,proto3" json:"applyTime,omitempty"` - ReqMessage string `protobuf:"bytes,11,opt,name=reqMessage,proto3" json:"reqMessage,omitempty"` + Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + Icon string `protobuf:"bytes,3,opt,name=icon" json:"icon,omitempty"` + Gender int32 `protobuf:"varint,4,opt,name=gender" json:"gender,omitempty"` + Mobile string `protobuf:"bytes,5,opt,name=mobile" json:"mobile,omitempty"` + Birth string `protobuf:"bytes,6,opt,name=birth" json:"birth,omitempty"` + Email string `protobuf:"bytes,7,opt,name=email" json:"email,omitempty"` + Ex string `protobuf:"bytes,8,opt,name=ex" json:"ex,omitempty"` + Flag int32 `protobuf:"varint,9,opt,name=flag" json:"flag,omitempty"` + ApplyTime string `protobuf:"bytes,10,opt,name=applyTime" json:"applyTime,omitempty"` + ReqMessage string `protobuf:"bytes,11,opt,name=reqMessage" json:"reqMessage,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -486,17 +540,16 @@ func (m *ApplyUserInfo) Reset() { *m = ApplyUserInfo{} } func (m *ApplyUserInfo) String() string { return proto.CompactTextString(m) } func (*ApplyUserInfo) ProtoMessage() {} func (*ApplyUserInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_1a7db849dd7bb41b, []int{7} + return fileDescriptor_friend_17d6a40c7694c30a, []int{8} } - func (m *ApplyUserInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ApplyUserInfo.Unmarshal(m, b) } func (m *ApplyUserInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ApplyUserInfo.Marshal(b, m, deterministic) } -func (m *ApplyUserInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ApplyUserInfo.Merge(m, src) +func (dst *ApplyUserInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ApplyUserInfo.Merge(dst, src) } func (m *ApplyUserInfo) XXX_Size() int { return xxx_messageInfo_ApplyUserInfo.Size(m) @@ -585,8 +638,8 @@ func (m *ApplyUserInfo) GetReqMessage() string { } type GetFriendListReq struct { - OperationID string `protobuf:"bytes,1,opt,name=OperationID,proto3" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,2,opt,name=Token,proto3" json:"Token,omitempty"` + OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"` + Token string `protobuf:"bytes,2,opt,name=Token" json:"Token,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -596,17 +649,16 @@ func (m *GetFriendListReq) Reset() { *m = GetFriendListReq{} } func (m *GetFriendListReq) String() string { return proto.CompactTextString(m) } func (*GetFriendListReq) ProtoMessage() {} func (*GetFriendListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_1a7db849dd7bb41b, []int{8} + return fileDescriptor_friend_17d6a40c7694c30a, []int{9} } - func (m *GetFriendListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetFriendListReq.Unmarshal(m, b) } func (m *GetFriendListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_GetFriendListReq.Marshal(b, m, deterministic) } -func (m *GetFriendListReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetFriendListReq.Merge(m, src) +func (dst *GetFriendListReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFriendListReq.Merge(dst, src) } func (m *GetFriendListReq) XXX_Size() int { return xxx_messageInfo_GetFriendListReq.Size(m) @@ -632,9 +684,9 @@ func (m *GetFriendListReq) GetToken() string { } type GetFriendListResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode,proto3" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg,proto3" json:"errorMsg,omitempty"` - Data []*UserInfo `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"` + ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` + ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` + Data []*UserInfo `protobuf:"bytes,3,rep,name=data" json:"data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -644,17 +696,16 @@ func (m *GetFriendListResp) Reset() { *m = GetFriendListResp{} } func (m *GetFriendListResp) String() string { return proto.CompactTextString(m) } func (*GetFriendListResp) ProtoMessage() {} func (*GetFriendListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_1a7db849dd7bb41b, []int{9} + return fileDescriptor_friend_17d6a40c7694c30a, []int{10} } - func (m *GetFriendListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetFriendListResp.Unmarshal(m, b) } func (m *GetFriendListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_GetFriendListResp.Marshal(b, m, deterministic) } -func (m *GetFriendListResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetFriendListResp.Merge(m, src) +func (dst *GetFriendListResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFriendListResp.Merge(dst, src) } func (m *GetFriendListResp) XXX_Size() int { return xxx_messageInfo_GetFriendListResp.Size(m) @@ -687,16 +738,16 @@ func (m *GetFriendListResp) GetData() []*UserInfo { } type UserInfo struct { - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Icon string `protobuf:"bytes,2,opt,name=icon,proto3" json:"icon,omitempty"` - Gender int32 `protobuf:"varint,4,opt,name=gender,proto3" json:"gender,omitempty"` - Mobile string `protobuf:"bytes,5,opt,name=mobile,proto3" json:"mobile,omitempty"` - Birth string `protobuf:"bytes,6,opt,name=birth,proto3" json:"birth,omitempty"` - Email string `protobuf:"bytes,7,opt,name=email,proto3" json:"email,omitempty"` - Ex string `protobuf:"bytes,8,opt,name=ex,proto3" json:"ex,omitempty"` - Comment string `protobuf:"bytes,9,opt,name=comment,proto3" json:"comment,omitempty"` - IsInBlackList int32 `protobuf:"varint,10,opt,name=isInBlackList,proto3" json:"isInBlackList,omitempty"` + Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` + Icon string `protobuf:"bytes,2,opt,name=icon" json:"icon,omitempty"` + Gender int32 `protobuf:"varint,4,opt,name=gender" json:"gender,omitempty"` + Mobile string `protobuf:"bytes,5,opt,name=mobile" json:"mobile,omitempty"` + Birth string `protobuf:"bytes,6,opt,name=birth" json:"birth,omitempty"` + Email string `protobuf:"bytes,7,opt,name=email" json:"email,omitempty"` + Ex string `protobuf:"bytes,8,opt,name=ex" json:"ex,omitempty"` + Comment string `protobuf:"bytes,9,opt,name=comment" json:"comment,omitempty"` + IsInBlackList int32 `protobuf:"varint,10,opt,name=isInBlackList" json:"isInBlackList,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -706,17 +757,16 @@ 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_1a7db849dd7bb41b, []int{10} + return fileDescriptor_friend_17d6a40c7694c30a, []int{11} } - func (m *UserInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserInfo.Unmarshal(m, b) } func (m *UserInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_UserInfo.Marshal(b, m, deterministic) } -func (m *UserInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserInfo.Merge(m, src) +func (dst *UserInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserInfo.Merge(dst, src) } func (m *UserInfo) XXX_Size() int { return xxx_messageInfo_UserInfo.Size(m) @@ -798,9 +848,10 @@ func (m *UserInfo) GetIsInBlackList() int32 { } type AddBlacklistReq struct { - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,3,opt,name=Token,proto3" json:"Token,omitempty"` + Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + Token string `protobuf:"bytes,3,opt,name=Token" json:"Token,omitempty"` + OwnerUid string `protobuf:"bytes,4,opt,name=OwnerUid" json:"OwnerUid,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -810,17 +861,16 @@ func (m *AddBlacklistReq) Reset() { *m = AddBlacklistReq{} } func (m *AddBlacklistReq) String() string { return proto.CompactTextString(m) } func (*AddBlacklistReq) ProtoMessage() {} func (*AddBlacklistReq) Descriptor() ([]byte, []int) { - return fileDescriptor_1a7db849dd7bb41b, []int{11} + return fileDescriptor_friend_17d6a40c7694c30a, []int{12} } - func (m *AddBlacklistReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddBlacklistReq.Unmarshal(m, b) } func (m *AddBlacklistReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_AddBlacklistReq.Marshal(b, m, deterministic) } -func (m *AddBlacklistReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddBlacklistReq.Merge(m, src) +func (dst *AddBlacklistReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddBlacklistReq.Merge(dst, src) } func (m *AddBlacklistReq) XXX_Size() int { return xxx_messageInfo_AddBlacklistReq.Size(m) @@ -852,10 +902,17 @@ func (m *AddBlacklistReq) GetToken() string { return "" } +func (m *AddBlacklistReq) GetOwnerUid() string { + if m != nil { + return m.OwnerUid + } + return "" +} + type RemoveBlacklistReq struct { - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,3,opt,name=Token,proto3" json:"Token,omitempty"` + Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + Token string `protobuf:"bytes,3,opt,name=Token" json:"Token,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -865,17 +922,16 @@ func (m *RemoveBlacklistReq) Reset() { *m = RemoveBlacklistReq{} } func (m *RemoveBlacklistReq) String() string { return proto.CompactTextString(m) } func (*RemoveBlacklistReq) ProtoMessage() {} func (*RemoveBlacklistReq) Descriptor() ([]byte, []int) { - return fileDescriptor_1a7db849dd7bb41b, []int{12} + return fileDescriptor_friend_17d6a40c7694c30a, []int{13} } - func (m *RemoveBlacklistReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RemoveBlacklistReq.Unmarshal(m, b) } func (m *RemoveBlacklistReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_RemoveBlacklistReq.Marshal(b, m, deterministic) } -func (m *RemoveBlacklistReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveBlacklistReq.Merge(m, src) +func (dst *RemoveBlacklistReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveBlacklistReq.Merge(dst, src) } func (m *RemoveBlacklistReq) XXX_Size() int { return xxx_messageInfo_RemoveBlacklistReq.Size(m) @@ -908,8 +964,8 @@ func (m *RemoveBlacklistReq) GetToken() string { } type GetBlacklistReq struct { - OperationID string `protobuf:"bytes,1,opt,name=OperationID,proto3" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` + OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"` + Token string `protobuf:"bytes,2,opt,name=token" json:"token,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -919,17 +975,16 @@ 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_1a7db849dd7bb41b, []int{13} + return fileDescriptor_friend_17d6a40c7694c30a, []int{14} } - 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 (m *GetBlacklistReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetBlacklistReq.Merge(m, src) +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) @@ -955,9 +1010,9 @@ func (m *GetBlacklistReq) GetToken() string { } type GetBlacklistResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode,proto3" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg,proto3" json:"errorMsg,omitempty"` - Data []*UserInfo `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"` + ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` + ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` + Data []*UserInfo `protobuf:"bytes,3,rep,name=data" json:"data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -967,17 +1022,16 @@ 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_1a7db849dd7bb41b, []int{14} + return fileDescriptor_friend_17d6a40c7694c30a, []int{15} } - 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 (m *GetBlacklistResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetBlacklistResp.Merge(m, src) +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) @@ -1010,9 +1064,9 @@ func (m *GetBlacklistResp) GetData() []*UserInfo { } type IsFriendReq struct { - Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` - ReceiveUid string `protobuf:"bytes,2,opt,name=receiveUid,proto3" json:"receiveUid,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` + ReceiveUid string `protobuf:"bytes,2,opt,name=receiveUid" json:"receiveUid,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1022,17 +1076,16 @@ func (m *IsFriendReq) Reset() { *m = IsFriendReq{} } func (m *IsFriendReq) String() string { return proto.CompactTextString(m) } func (*IsFriendReq) ProtoMessage() {} func (*IsFriendReq) Descriptor() ([]byte, []int) { - return fileDescriptor_1a7db849dd7bb41b, []int{15} + return fileDescriptor_friend_17d6a40c7694c30a, []int{16} } - func (m *IsFriendReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_IsFriendReq.Unmarshal(m, b) } func (m *IsFriendReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_IsFriendReq.Marshal(b, m, deterministic) } -func (m *IsFriendReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_IsFriendReq.Merge(m, src) +func (dst *IsFriendReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_IsFriendReq.Merge(dst, src) } func (m *IsFriendReq) XXX_Size() int { return xxx_messageInfo_IsFriendReq.Size(m) @@ -1065,9 +1118,9 @@ func (m *IsFriendReq) GetOperationID() string { } type IsFriendResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode,proto3" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg,proto3" json:"errorMsg,omitempty"` - ShipType int32 `protobuf:"varint,3,opt,name=shipType,proto3" json:"shipType,omitempty"` + ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` + ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` + ShipType int32 `protobuf:"varint,3,opt,name=shipType" json:"shipType,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1077,17 +1130,16 @@ func (m *IsFriendResp) Reset() { *m = IsFriendResp{} } func (m *IsFriendResp) String() string { return proto.CompactTextString(m) } func (*IsFriendResp) ProtoMessage() {} func (*IsFriendResp) Descriptor() ([]byte, []int) { - return fileDescriptor_1a7db849dd7bb41b, []int{16} + return fileDescriptor_friend_17d6a40c7694c30a, []int{17} } - func (m *IsFriendResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_IsFriendResp.Unmarshal(m, b) } func (m *IsFriendResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_IsFriendResp.Marshal(b, m, deterministic) } -func (m *IsFriendResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_IsFriendResp.Merge(m, src) +func (dst *IsFriendResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_IsFriendResp.Merge(dst, src) } func (m *IsFriendResp) XXX_Size() int { return xxx_messageInfo_IsFriendResp.Size(m) @@ -1120,9 +1172,9 @@ func (m *IsFriendResp) GetShipType() int32 { } type IsInBlackListReq struct { - SendUid string `protobuf:"bytes,1,opt,name=sendUid,proto3" json:"sendUid,omitempty"` - ReceiveUid string `protobuf:"bytes,2,opt,name=receiveUid,proto3" json:"receiveUid,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + SendUid string `protobuf:"bytes,1,opt,name=sendUid" json:"sendUid,omitempty"` + ReceiveUid string `protobuf:"bytes,2,opt,name=receiveUid" json:"receiveUid,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1132,17 +1184,16 @@ func (m *IsInBlackListReq) Reset() { *m = IsInBlackListReq{} } func (m *IsInBlackListReq) String() string { return proto.CompactTextString(m) } func (*IsInBlackListReq) ProtoMessage() {} func (*IsInBlackListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_1a7db849dd7bb41b, []int{17} + return fileDescriptor_friend_17d6a40c7694c30a, []int{18} } - func (m *IsInBlackListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_IsInBlackListReq.Unmarshal(m, b) } func (m *IsInBlackListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_IsInBlackListReq.Marshal(b, m, deterministic) } -func (m *IsInBlackListReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_IsInBlackListReq.Merge(m, src) +func (dst *IsInBlackListReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_IsInBlackListReq.Merge(dst, src) } func (m *IsInBlackListReq) XXX_Size() int { return xxx_messageInfo_IsInBlackListReq.Size(m) @@ -1175,9 +1226,9 @@ func (m *IsInBlackListReq) GetOperationID() string { } type IsInBlackListResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode,proto3" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg,proto3" json:"errorMsg,omitempty"` - Response bool `protobuf:"varint,3,opt,name=response,proto3" json:"response,omitempty"` + ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` + ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` + Response bool `protobuf:"varint,3,opt,name=response" json:"response,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1187,17 +1238,16 @@ func (m *IsInBlackListResp) Reset() { *m = IsInBlackListResp{} } func (m *IsInBlackListResp) String() string { return proto.CompactTextString(m) } func (*IsInBlackListResp) ProtoMessage() {} func (*IsInBlackListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_1a7db849dd7bb41b, []int{18} + return fileDescriptor_friend_17d6a40c7694c30a, []int{19} } - func (m *IsInBlackListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_IsInBlackListResp.Unmarshal(m, b) } func (m *IsInBlackListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_IsInBlackListResp.Marshal(b, m, deterministic) } -func (m *IsInBlackListResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_IsInBlackListResp.Merge(m, src) +func (dst *IsInBlackListResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_IsInBlackListResp.Merge(dst, src) } func (m *IsInBlackListResp) XXX_Size() int { return xxx_messageInfo_IsInBlackListResp.Size(m) @@ -1230,9 +1280,9 @@ func (m *IsInBlackListResp) GetResponse() bool { } type DeleteFriendReq struct { - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,3,opt,name=Token,proto3" json:"Token,omitempty"` + Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + Token string `protobuf:"bytes,3,opt,name=Token" json:"Token,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1242,17 +1292,16 @@ func (m *DeleteFriendReq) Reset() { *m = DeleteFriendReq{} } func (m *DeleteFriendReq) String() string { return proto.CompactTextString(m) } func (*DeleteFriendReq) ProtoMessage() {} func (*DeleteFriendReq) Descriptor() ([]byte, []int) { - return fileDescriptor_1a7db849dd7bb41b, []int{19} + return fileDescriptor_friend_17d6a40c7694c30a, []int{20} } - func (m *DeleteFriendReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteFriendReq.Unmarshal(m, b) } func (m *DeleteFriendReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DeleteFriendReq.Marshal(b, m, deterministic) } -func (m *DeleteFriendReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteFriendReq.Merge(m, src) +func (dst *DeleteFriendReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteFriendReq.Merge(dst, src) } func (m *DeleteFriendReq) XXX_Size() int { return xxx_messageInfo_DeleteFriendReq.Size(m) @@ -1285,10 +1334,10 @@ func (m *DeleteFriendReq) GetToken() string { } type AddFriendResponseReq struct { - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - Flag int32 `protobuf:"varint,2,opt,name=flag,proto3" json:"flag,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=OperationID,proto3" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,4,opt,name=Token,proto3" json:"Token,omitempty"` + Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` + Flag int32 `protobuf:"varint,2,opt,name=flag" json:"flag,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` + Token string `protobuf:"bytes,4,opt,name=Token" json:"Token,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1298,17 +1347,16 @@ func (m *AddFriendResponseReq) Reset() { *m = AddFriendResponseReq{} } func (m *AddFriendResponseReq) String() string { return proto.CompactTextString(m) } func (*AddFriendResponseReq) ProtoMessage() {} func (*AddFriendResponseReq) Descriptor() ([]byte, []int) { - return fileDescriptor_1a7db849dd7bb41b, []int{20} + return fileDescriptor_friend_17d6a40c7694c30a, []int{21} } - func (m *AddFriendResponseReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddFriendResponseReq.Unmarshal(m, b) } func (m *AddFriendResponseReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_AddFriendResponseReq.Marshal(b, m, deterministic) } -func (m *AddFriendResponseReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddFriendResponseReq.Merge(m, src) +func (dst *AddFriendResponseReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddFriendResponseReq.Merge(dst, src) } func (m *AddFriendResponseReq) XXX_Size() int { return xxx_messageInfo_AddFriendResponseReq.Size(m) @@ -1348,10 +1396,10 @@ func (m *AddFriendResponseReq) GetToken() string { } type SetFriendCommentReq struct { - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID,proto3" json:"operationID,omitempty"` - Comment string `protobuf:"bytes,3,opt,name=comment,proto3" json:"comment,omitempty"` - Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` + Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + Comment string `protobuf:"bytes,3,opt,name=comment" json:"comment,omitempty"` + Token string `protobuf:"bytes,4,opt,name=token" json:"token,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1361,17 +1409,16 @@ func (m *SetFriendCommentReq) Reset() { *m = SetFriendCommentReq{} } func (m *SetFriendCommentReq) String() string { return proto.CompactTextString(m) } func (*SetFriendCommentReq) ProtoMessage() {} func (*SetFriendCommentReq) Descriptor() ([]byte, []int) { - return fileDescriptor_1a7db849dd7bb41b, []int{21} + return fileDescriptor_friend_17d6a40c7694c30a, []int{22} } - func (m *SetFriendCommentReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetFriendCommentReq.Unmarshal(m, b) } func (m *SetFriendCommentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SetFriendCommentReq.Marshal(b, m, deterministic) } -func (m *SetFriendCommentReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetFriendCommentReq.Merge(m, src) +func (dst *SetFriendCommentReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetFriendCommentReq.Merge(dst, src) } func (m *SetFriendCommentReq) XXX_Size() int { return xxx_messageInfo_SetFriendCommentReq.Size(m) @@ -1416,6 +1463,7 @@ func init() { proto.RegisterType((*GetFriendInfoResp)(nil), "friend.GetFriendInfoResp") proto.RegisterType((*GetFriendData)(nil), "friend.GetFriendData") proto.RegisterType((*AddFriendReq)(nil), "friend.AddFriendReq") + proto.RegisterType((*ImportFriendReq)(nil), "friend.ImportFriendReq") proto.RegisterType((*GetFriendApplyReq)(nil), "friend.GetFriendApplyReq") proto.RegisterType((*GetFriendApplyResp)(nil), "friend.GetFriendApplyResp") proto.RegisterType((*ApplyUserInfo)(nil), "friend.ApplyUserInfo") @@ -1435,83 +1483,16 @@ func init() { proto.RegisterType((*SetFriendCommentReq)(nil), "friend.SetFriendCommentReq") } -func init() { - proto.RegisterFile("friend/friend.proto", fileDescriptor_1a7db849dd7bb41b) -} - -var fileDescriptor_1a7db849dd7bb41b = []byte{ - // 914 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0x5b, 0x6f, 0xeb, 0x44, - 0x10, 0x56, 0xec, 0x24, 0x4d, 0x26, 0xc9, 0x49, 0xb2, 0x0d, 0x60, 0xcc, 0x11, 0x8a, 0xac, 0xf3, - 0x70, 0x78, 0x39, 0x48, 0x07, 0x9d, 0xa7, 0x3e, 0xa5, 0x09, 0xad, 0x42, 0xa9, 0x90, 0xdc, 0xf6, - 0x05, 0x04, 0x92, 0x1b, 0x4f, 0x5c, 0xab, 0xbe, 0xd5, 0x6b, 0xaa, 0xf4, 0x17, 0xf0, 0xcc, 0x1f, - 0x45, 0xfc, 0x04, 0xb4, 0xbb, 0xbe, 0xac, 0x2f, 0x85, 0x4a, 0x69, 0xcb, 0x53, 0x3c, 0xdf, 0x6e, - 0x67, 0x76, 0x66, 0xbe, 0xb9, 0x14, 0x0e, 0xb7, 0xb1, 0x8b, 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0xe2, 0xda, 0x8d, 0x93, 0x1b, 0xad, 0x2b, 0x62, 0xc1, 0x05, 0x86, 0xa2, 0x6f, 0xb9, 0x9e, 0x76, - 0x20, 0x50, 0x2e, 0x90, 0x37, 0xa0, 0xe0, 0x4e, 0xeb, 0x71, 0x48, 0xc1, 0x1d, 0xd1, 0xe0, 0x60, - 0x13, 0xfa, 0x3e, 0x06, 0x89, 0xd6, 0xe7, 0x60, 0x26, 0xb2, 0xc0, 0xb8, 0x54, 0xf8, 0xa3, 0x01, - 0x7f, 0x47, 0x2e, 0x93, 0x77, 0x30, 0x72, 0xe9, 0x3a, 0x38, 0xf6, 0xac, 0xcd, 0xed, 0x8f, 0x2e, - 0x4d, 0xb4, 0x01, 0xbf, 0x50, 0x06, 0x8d, 0x1d, 0x0c, 0x17, 0xb6, 0x2d, 0xfe, 0xe4, 0x59, 0xf3, - 0x4c, 0xbe, 0x06, 0x30, 0xf1, 0xee, 0x1c, 0x29, 0xb5, 0x1c, 0xe4, 0x51, 0xea, 0x9b, 0x12, 0x62, - 0x9c, 0x49, 0x3c, 0x58, 0x44, 0x91, 0xf7, 0xc0, 0xcc, 0x57, 0x8c, 0xb5, 0xfe, 0xc5, 0x98, 0x22, - 0x93, 0xea, 0x01, 0x48, 0x55, 0xd9, 0xbe, 0xac, 0xb2, 0x19, 0xab, 0xda, 0x73, 0x55, 0x66, 0x15, - 0x57, 0x7d, 0x45, 0x31, 0xe6, 0xc4, 0xe5, 0x57, 0x8c, 0x3f, 0x14, 0x18, 0x95, 0xf0, 0x66, 0x56, - 0x71, 0x06, 0x29, 0x12, 0x83, 0x32, 0xa6, 0xa9, 0x12, 0xd3, 0x5e, 0x93, 0x55, 0x04, 0xda, 0x5b, - 0xcf, 0x72, 0x38, 0xa5, 0x3a, 0x26, 0xff, 0x66, 0x01, 0xb3, 0x98, 0x2b, 0x97, 0xae, 0x8f, 0x9c, - 0x50, 0x7d, 0xb3, 0x00, 0x58, 0x46, 0xe3, 0x22, 0xa3,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0x9a, 0x50, 0x85, 0xf3, 0xd5, 0xf6, 0x52, 0x38, 0x5f, 0x6f, - 0x04, 0x0b, 0x18, 0x3a, 0x52, 0x3b, 0x2f, 0x9c, 0xaf, 0xcc, 0x0b, 0x5d, 0x6b, 0x3e, 0x10, 0xf1, - 0xb3, 0xa5, 0xaa, 0x2f, 0x54, 0x54, 0x7a, 0x41, 0xa3, 0xf3, 0xdf, 0xc3, 0xd4, 0xaa, 0x56, 0x35, - 0x79, 0xdb, 0xc0, 0xcc, 0xbc, 0xe0, 0x1b, 0xd5, 0x2c, 0x61, 0x42, 0x2b, 0x65, 0x4a, 0xbe, 0xca, - 0xee, 0x35, 0x14, 0x70, 0x93, 0x92, 0xe3, 0xf1, 0xcf, 0x23, 0x01, 0x1e, 0x89, 0x9f, 0xeb, 0x2e, - 0xff, 0xbf, 0xf1, 0xbb, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x5d, 0x57, 0x24, 0x62, 0x4e, 0x0e, - 0x00, 0x00, -} - // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConnInterface +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.SupportPackageIsVersion6 +const _ = grpc.SupportPackageIsVersion4 + +// Client API for Friend service -// FriendClient is the client API for Friend service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type FriendClient interface { GetFriendsInfo(ctx context.Context, in *GetFriendsInfoReq, opts ...grpc.CallOption) (*GetFriendInfoResp, error) AddFriend(ctx context.Context, in *AddFriendReq, opts ...grpc.CallOption) (*CommonResp, error) @@ -1526,19 +1507,20 @@ type FriendClient interface { DeleteFriend(ctx context.Context, in *DeleteFriendReq, opts ...grpc.CallOption) (*CommonResp, error) AddFriendResponse(ctx context.Context, in *AddFriendResponseReq, opts ...grpc.CallOption) (*CommonResp, error) SetFriendComment(ctx context.Context, in *SetFriendCommentReq, opts ...grpc.CallOption) (*CommonResp, error) + ImportFriend(ctx context.Context, in *ImportFriendReq, opts ...grpc.CallOption) (*CommonResp, error) } type friendClient struct { - cc grpc.ClientConnInterface + cc *grpc.ClientConn } -func NewFriendClient(cc grpc.ClientConnInterface) FriendClient { +func NewFriendClient(cc *grpc.ClientConn) FriendClient { return &friendClient{cc} } func (c *friendClient) GetFriendsInfo(ctx context.Context, in *GetFriendsInfoReq, opts ...grpc.CallOption) (*GetFriendInfoResp, error) { out := new(GetFriendInfoResp) - err := c.cc.Invoke(ctx, "/friend.friend/getFriendsInfo", in, out, opts...) + err := grpc.Invoke(ctx, "/friend.friend/getFriendsInfo", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1547,7 +1529,7 @@ func (c *friendClient) GetFriendsInfo(ctx context.Context, in *GetFriendsInfoReq func (c *friendClient) AddFriend(ctx context.Context, in *AddFriendReq, opts ...grpc.CallOption) (*CommonResp, error) { out := new(CommonResp) - err := c.cc.Invoke(ctx, "/friend.friend/addFriend", in, out, opts...) + err := grpc.Invoke(ctx, "/friend.friend/addFriend", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1556,7 +1538,7 @@ func (c *friendClient) AddFriend(ctx context.Context, in *AddFriendReq, opts ... func (c *friendClient) GetFriendApplyList(ctx context.Context, in *GetFriendApplyReq, opts ...grpc.CallOption) (*GetFriendApplyResp, error) { out := new(GetFriendApplyResp) - err := c.cc.Invoke(ctx, "/friend.friend/getFriendApplyList", in, out, opts...) + err := grpc.Invoke(ctx, "/friend.friend/getFriendApplyList", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1565,7 +1547,7 @@ func (c *friendClient) GetFriendApplyList(ctx context.Context, in *GetFriendAppl func (c *friendClient) GetSelfApplyList(ctx context.Context, in *GetFriendApplyReq, opts ...grpc.CallOption) (*GetFriendApplyResp, error) { out := new(GetFriendApplyResp) - err := c.cc.Invoke(ctx, "/friend.friend/getSelfApplyList", in, out, opts...) + err := grpc.Invoke(ctx, "/friend.friend/getSelfApplyList", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1574,7 +1556,7 @@ func (c *friendClient) GetSelfApplyList(ctx context.Context, in *GetFriendApplyR func (c *friendClient) GetFriendList(ctx context.Context, in *GetFriendListReq, opts ...grpc.CallOption) (*GetFriendListResp, error) { out := new(GetFriendListResp) - err := c.cc.Invoke(ctx, "/friend.friend/getFriendList", in, out, opts...) + err := grpc.Invoke(ctx, "/friend.friend/getFriendList", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1583,7 +1565,7 @@ func (c *friendClient) GetFriendList(ctx context.Context, in *GetFriendListReq, func (c *friendClient) AddBlacklist(ctx context.Context, in *AddBlacklistReq, opts ...grpc.CallOption) (*CommonResp, error) { out := new(CommonResp) - err := c.cc.Invoke(ctx, "/friend.friend/addBlacklist", in, out, opts...) + err := grpc.Invoke(ctx, "/friend.friend/addBlacklist", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1592,7 +1574,7 @@ func (c *friendClient) AddBlacklist(ctx context.Context, in *AddBlacklistReq, op func (c *friendClient) RemoveBlacklist(ctx context.Context, in *RemoveBlacklistReq, opts ...grpc.CallOption) (*CommonResp, error) { out := new(CommonResp) - err := c.cc.Invoke(ctx, "/friend.friend/removeBlacklist", in, out, opts...) + err := grpc.Invoke(ctx, "/friend.friend/removeBlacklist", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1601,7 +1583,7 @@ func (c *friendClient) RemoveBlacklist(ctx context.Context, in *RemoveBlacklistR func (c *friendClient) IsFriend(ctx context.Context, in *IsFriendReq, opts ...grpc.CallOption) (*IsFriendResp, error) { out := new(IsFriendResp) - err := c.cc.Invoke(ctx, "/friend.friend/isFriend", in, out, opts...) + err := grpc.Invoke(ctx, "/friend.friend/isFriend", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1610,7 +1592,7 @@ func (c *friendClient) IsFriend(ctx context.Context, in *IsFriendReq, opts ...gr func (c *friendClient) IsInBlackList(ctx context.Context, in *IsInBlackListReq, opts ...grpc.CallOption) (*IsInBlackListResp, error) { out := new(IsInBlackListResp) - err := c.cc.Invoke(ctx, "/friend.friend/isInBlackList", in, out, opts...) + err := grpc.Invoke(ctx, "/friend.friend/isInBlackList", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1619,7 +1601,7 @@ func (c *friendClient) IsInBlackList(ctx context.Context, in *IsInBlackListReq, func (c *friendClient) GetBlacklist(ctx context.Context, in *GetBlacklistReq, opts ...grpc.CallOption) (*GetBlacklistResp, error) { out := new(GetBlacklistResp) - err := c.cc.Invoke(ctx, "/friend.friend/getBlacklist", in, out, opts...) + err := grpc.Invoke(ctx, "/friend.friend/getBlacklist", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1628,7 +1610,7 @@ func (c *friendClient) GetBlacklist(ctx context.Context, in *GetBlacklistReq, op func (c *friendClient) DeleteFriend(ctx context.Context, in *DeleteFriendReq, opts ...grpc.CallOption) (*CommonResp, error) { out := new(CommonResp) - err := c.cc.Invoke(ctx, "/friend.friend/deleteFriend", in, out, opts...) + err := grpc.Invoke(ctx, "/friend.friend/deleteFriend", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1637,7 +1619,7 @@ func (c *friendClient) DeleteFriend(ctx context.Context, in *DeleteFriendReq, op func (c *friendClient) AddFriendResponse(ctx context.Context, in *AddFriendResponseReq, opts ...grpc.CallOption) (*CommonResp, error) { out := new(CommonResp) - err := c.cc.Invoke(ctx, "/friend.friend/addFriendResponse", in, out, opts...) + err := grpc.Invoke(ctx, "/friend.friend/addFriendResponse", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1646,14 +1628,24 @@ func (c *friendClient) AddFriendResponse(ctx context.Context, in *AddFriendRespo func (c *friendClient) SetFriendComment(ctx context.Context, in *SetFriendCommentReq, opts ...grpc.CallOption) (*CommonResp, error) { out := new(CommonResp) - err := c.cc.Invoke(ctx, "/friend.friend/setFriendComment", in, out, opts...) + err := grpc.Invoke(ctx, "/friend.friend/setFriendComment", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } -// FriendServer is the server API for Friend service. +func (c *friendClient) ImportFriend(ctx context.Context, in *ImportFriendReq, opts ...grpc.CallOption) (*CommonResp, error) { + out := new(CommonResp) + err := grpc.Invoke(ctx, "/friend.friend/ImportFriend", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Friend service + type FriendServer interface { GetFriendsInfo(context.Context, *GetFriendsInfoReq) (*GetFriendInfoResp, error) AddFriend(context.Context, *AddFriendReq) (*CommonResp, error) @@ -1668,50 +1660,7 @@ type FriendServer interface { DeleteFriend(context.Context, *DeleteFriendReq) (*CommonResp, error) AddFriendResponse(context.Context, *AddFriendResponseReq) (*CommonResp, error) SetFriendComment(context.Context, *SetFriendCommentReq) (*CommonResp, error) -} - -// UnimplementedFriendServer can be embedded to have forward compatible implementations. -type UnimplementedFriendServer struct { -} - -func (*UnimplementedFriendServer) GetFriendsInfo(ctx context.Context, req *GetFriendsInfoReq) (*GetFriendInfoResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetFriendsInfo not implemented") -} -func (*UnimplementedFriendServer) AddFriend(ctx context.Context, req *AddFriendReq) (*CommonResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddFriend not implemented") -} -func (*UnimplementedFriendServer) GetFriendApplyList(ctx context.Context, req *GetFriendApplyReq) (*GetFriendApplyResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetFriendApplyList not implemented") -} -func (*UnimplementedFriendServer) GetSelfApplyList(ctx context.Context, req *GetFriendApplyReq) (*GetFriendApplyResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSelfApplyList not implemented") -} -func (*UnimplementedFriendServer) GetFriendList(ctx context.Context, req *GetFriendListReq) (*GetFriendListResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetFriendList not implemented") -} -func (*UnimplementedFriendServer) AddBlacklist(ctx context.Context, req *AddBlacklistReq) (*CommonResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddBlacklist not implemented") -} -func (*UnimplementedFriendServer) RemoveBlacklist(ctx context.Context, req *RemoveBlacklistReq) (*CommonResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveBlacklist not implemented") -} -func (*UnimplementedFriendServer) IsFriend(ctx context.Context, req *IsFriendReq) (*IsFriendResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method IsFriend not implemented") -} -func (*UnimplementedFriendServer) IsInBlackList(ctx context.Context, req *IsInBlackListReq) (*IsInBlackListResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method IsInBlackList not implemented") -} -func (*UnimplementedFriendServer) GetBlacklist(ctx context.Context, req *GetBlacklistReq) (*GetBlacklistResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetBlacklist not implemented") -} -func (*UnimplementedFriendServer) DeleteFriend(ctx context.Context, req *DeleteFriendReq) (*CommonResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteFriend not implemented") -} -func (*UnimplementedFriendServer) AddFriendResponse(ctx context.Context, req *AddFriendResponseReq) (*CommonResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddFriendResponse not implemented") -} -func (*UnimplementedFriendServer) SetFriendComment(ctx context.Context, req *SetFriendCommentReq) (*CommonResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetFriendComment not implemented") + ImportFriend(context.Context, *ImportFriendReq) (*CommonResp, error) } func RegisterFriendServer(s *grpc.Server, srv FriendServer) { @@ -1952,6 +1901,24 @@ func _Friend_SetFriendComment_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Friend_ImportFriend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ImportFriendReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FriendServer).ImportFriend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/friend.friend/ImportFriend", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FriendServer).ImportFriend(ctx, req.(*ImportFriendReq)) + } + return interceptor(ctx, in, info, handler) +} + var _Friend_serviceDesc = grpc.ServiceDesc{ ServiceName: "friend.friend", HandlerType: (*FriendServer)(nil), @@ -2008,7 +1975,77 @@ var _Friend_serviceDesc = grpc.ServiceDesc{ MethodName: "setFriendComment", Handler: _Friend_SetFriendComment_Handler, }, + { + MethodName: "ImportFriend", + Handler: _Friend_ImportFriend_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "friend/friend.proto", } + +func init() { proto.RegisterFile("friend/friend.proto", fileDescriptor_friend_17d6a40c7694c30a) } + +var fileDescriptor_friend_17d6a40c7694c30a = []byte{ + // 956 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcd, 0x6e, 0xdb, 0x46, + 0x10, 0x86, 0x48, 0xc9, 0x96, 0x46, 0x52, 0x24, 0xaf, 0xdd, 0x96, 0x65, 0x83, 0xc2, 0x20, 0x72, + 0x48, 0x2f, 0x29, 0x90, 0x22, 0x27, 0x9f, 0x14, 0xbb, 0x0e, 0xd8, 0x34, 0x08, 0xc0, 0xd8, 0x97, + 0x16, 0x2d, 0x40, 0x8b, 0x23, 0x86, 0x08, 0xc9, 0x65, 0xb8, 0x6c, 0x2c, 0x3f, 0x41, 0xcf, 0x7d, + 0x8e, 0xbe, 0x5c, 0x1f, 0xa1, 0xd8, 0x5d, 0x2e, 0xb9, 0xfc, 0x71, 0x1b, 0x40, 0xb1, 0x73, 0xd2, + 0xce, 0xec, 0x6a, 0x66, 0x67, 0xe6, 0x9b, 0x6f, 0x87, 0x70, 0xb8, 0xc9, 0x23, 0x4c, 0x83, 0xef, + 0xe5, 0xcf, 0x93, 0x2c, 0xa7, 0x05, 0x25, 0x7b, 0x52, 0x72, 0xce, 0x01, 0x4e, 0x69, 0x92, 0xd0, + 0xd4, 0x43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xd7, 0xf8, 0xce, 0x3e, 0xea, + 0x2a, 0x65, 0xf0, 0x8d, 0xd7, 0xab, 0x0e, 0xbe, 0x4d, 0x2f, 0x75, 0xf0, 0x5d, 0x22, 0x58, 0xc1, + 0x2c, 0xd4, 0xe8, 0xbc, 0x0e, 0xbe, 0xf5, 0x5e, 0xd8, 0x56, 0xff, 0x86, 0xcc, 0x5f, 0xa0, 0x75, + 0x7d, 0x6d, 0xa2, 0xc5, 0x05, 0xbd, 0xc1, 0xff, 0x08, 0x07, 0x7e, 0xbb, 0xab, 0xc9, 0xc3, 0x1e, + 0x64, 0x56, 0x0d, 0xdf, 0x6b, 0xe6, 0x14, 0x96, 0xac, 0xd5, 0xa6, 0xe4, 0x1b, 0x75, 0xae, 0xa7, + 0x81, 0x7b, 0x8d, 0x9c, 0xc0, 0x4c, 0x9f, 0xfe, 0xeb, 0x40, 0x5a, 0xdf, 0x04, 0x7d, 0x7f, 0x7e, + 0xbe, 0xf8, 0x65, 0x2e, 0x95, 0x27, 0xf2, 0xe7, 0x6a, 0x4f, 0x7c, 0x09, 0xff, 0xf0, 0x6f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x03, 0x5f, 0x15, 0x72, 0x20, 0x0f, 0x00, 0x00, +} diff --git a/src/proto/friend/friend.proto b/src/proto/friend/friend.proto index c2aaea090..7fb864054 100644 --- a/src/proto/friend/friend.proto +++ b/src/proto/friend/friend.proto @@ -40,6 +40,16 @@ message AddFriendReq{ } +message ImportFriendReq{ + string uid = 1; + string OperationID = 2; + string Token = 3; + string OwnerUid = 4; +} + + + + message GetFriendApplyReq{ string OperationID = 1; string Token = 2; @@ -91,6 +101,7 @@ message AddBlacklistReq{ string uid = 1; string OperationID = 2; string Token = 3; + string OwnerUid = 4; } @@ -167,4 +178,5 @@ service friend{ rpc deleteFriend(DeleteFriendReq) returns(CommonResp); rpc addFriendResponse(AddFriendResponseReq) returns(CommonResp); rpc setFriendComment(SetFriendCommentReq) returns(CommonResp); + rpc ImportFriend(ImportFriendReq) returns(CommonResp); } \ No newline at end of file diff --git a/src/proto/user/user.pb.go b/src/proto/user/user.pb.go index d52ef19b4..b98ecbe95 100644 --- a/src/proto/user/user.pb.go +++ b/src/proto/user/user.pb.go @@ -1,16 +1,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: user/user.proto -package user +package user // import "user" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" + context "golang.org/x/net/context" grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" ) // Reference imports to suppress errors if they are not otherwise used. @@ -22,11 +21,11 @@ var _ = math.Inf // 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.ProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type CommonResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode,proto3" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg,proto3" json:"errorMsg,omitempty"` + ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` + ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -36,17 +35,16 @@ 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_ed89022014131a74, []int{0} + return fileDescriptor_user_9367ac00c24112e8, []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 (m *CommonResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommonResp.Merge(m, src) +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) @@ -71,10 +69,202 @@ func (m *CommonResp) GetErrorMsg() string { return "" } +type DeleteUsersResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + FailedUidList []string `protobuf:"bytes,2,rep,name=failedUidList" json:"failedUidList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteUsersResp) Reset() { *m = DeleteUsersResp{} } +func (m *DeleteUsersResp) String() string { return proto.CompactTextString(m) } +func (*DeleteUsersResp) ProtoMessage() {} +func (*DeleteUsersResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_9367ac00c24112e8, []int{1} +} +func (m *DeleteUsersResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteUsersResp.Unmarshal(m, b) +} +func (m *DeleteUsersResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteUsersResp.Marshal(b, m, deterministic) +} +func (dst *DeleteUsersResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteUsersResp.Merge(dst, src) +} +func (m *DeleteUsersResp) XXX_Size() int { + return xxx_messageInfo_DeleteUsersResp.Size(m) +} +func (m *DeleteUsersResp) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteUsersResp.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteUsersResp proto.InternalMessageInfo + +func (m *DeleteUsersResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *DeleteUsersResp) GetFailedUidList() []string { + if m != nil { + return m.FailedUidList + } + return nil +} + +type DeleteUsersReq struct { + DeleteUidList []string `protobuf:"bytes,2,rep,name=deleteUidList" json:"deleteUidList,omitempty"` + Token string `protobuf:"bytes,3,opt,name=token" json:"token,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 *DeleteUsersReq) Reset() { *m = DeleteUsersReq{} } +func (m *DeleteUsersReq) String() string { return proto.CompactTextString(m) } +func (*DeleteUsersReq) ProtoMessage() {} +func (*DeleteUsersReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_9367ac00c24112e8, []int{2} +} +func (m *DeleteUsersReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteUsersReq.Unmarshal(m, b) +} +func (m *DeleteUsersReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteUsersReq.Marshal(b, m, deterministic) +} +func (dst *DeleteUsersReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteUsersReq.Merge(dst, src) +} +func (m *DeleteUsersReq) XXX_Size() int { + return xxx_messageInfo_DeleteUsersReq.Size(m) +} +func (m *DeleteUsersReq) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteUsersReq.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteUsersReq proto.InternalMessageInfo + +func (m *DeleteUsersReq) GetDeleteUidList() []string { + if m != nil { + return m.DeleteUidList + } + return nil +} + +func (m *DeleteUsersReq) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *DeleteUsersReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetAllUsersUidReq struct { + Token string `protobuf:"bytes,2,opt,name=token" json:"token,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 *GetAllUsersUidReq) Reset() { *m = GetAllUsersUidReq{} } +func (m *GetAllUsersUidReq) String() string { return proto.CompactTextString(m) } +func (*GetAllUsersUidReq) ProtoMessage() {} +func (*GetAllUsersUidReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_9367ac00c24112e8, []int{3} +} +func (m *GetAllUsersUidReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetAllUsersUidReq.Unmarshal(m, b) +} +func (m *GetAllUsersUidReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetAllUsersUidReq.Marshal(b, m, deterministic) +} +func (dst *GetAllUsersUidReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAllUsersUidReq.Merge(dst, src) +} +func (m *GetAllUsersUidReq) XXX_Size() int { + return xxx_messageInfo_GetAllUsersUidReq.Size(m) +} +func (m *GetAllUsersUidReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetAllUsersUidReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetAllUsersUidReq proto.InternalMessageInfo + +func (m *GetAllUsersUidReq) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *GetAllUsersUidReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetAllUsersUidResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + UidList []string `protobuf:"bytes,2,rep,name=uidList" json:"uidList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetAllUsersUidResp) Reset() { *m = GetAllUsersUidResp{} } +func (m *GetAllUsersUidResp) String() string { return proto.CompactTextString(m) } +func (*GetAllUsersUidResp) ProtoMessage() {} +func (*GetAllUsersUidResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_9367ac00c24112e8, []int{4} +} +func (m *GetAllUsersUidResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetAllUsersUidResp.Unmarshal(m, b) +} +func (m *GetAllUsersUidResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetAllUsersUidResp.Marshal(b, m, deterministic) +} +func (dst *GetAllUsersUidResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAllUsersUidResp.Merge(dst, src) +} +func (m *GetAllUsersUidResp) XXX_Size() int { + return xxx_messageInfo_GetAllUsersUidResp.Size(m) +} +func (m *GetAllUsersUidResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetAllUsersUidResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetAllUsersUidResp proto.InternalMessageInfo + +func (m *GetAllUsersUidResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetAllUsersUidResp) GetUidList() []string { + if m != nil { + return m.UidList + } + return nil +} + type GetUserInfoReq struct { - UserIDList []string `protobuf:"bytes,1,rep,name=userIDList,proto3" json:"userIDList,omitempty"` - Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + UserIDList []string `protobuf:"bytes,1,rep,name=userIDList" json:"userIDList,omitempty"` + Token string `protobuf:"bytes,2,opt,name=token" json:"token,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -84,17 +274,16 @@ 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_ed89022014131a74, []int{1} + return fileDescriptor_user_9367ac00c24112e8, []int{5} } - 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 (m *GetUserInfoReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetUserInfoReq.Merge(m, src) +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) @@ -127,9 +316,9 @@ func (m *GetUserInfoReq) GetOperationID() string { } type GetUserInfoResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode,proto3" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg,proto3" json:"errorMsg,omitempty"` - Data []*UserInfo `protobuf:"bytes,3,rep,name=Data,proto3" json:"Data,omitempty"` + ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` + ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` + Data []*UserInfo `protobuf:"bytes,3,rep,name=Data" json:"Data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -139,17 +328,16 @@ 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_ed89022014131a74, []int{2} + return fileDescriptor_user_9367ac00c24112e8, []int{6} } - 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 (m *GetUserInfoResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetUserInfoResp.Merge(m, src) +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) @@ -182,14 +370,14 @@ func (m *GetUserInfoResp) GetData() []*UserInfo { } type UserInfo struct { - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Icon string `protobuf:"bytes,3,opt,name=icon,proto3" json:"icon,omitempty"` - Gender int32 `protobuf:"varint,4,opt,name=gender,proto3" json:"gender,omitempty"` - Mobile string `protobuf:"bytes,5,opt,name=mobile,proto3" json:"mobile,omitempty"` - Birth string `protobuf:"bytes,6,opt,name=birth,proto3" json:"birth,omitempty"` - Email string `protobuf:"bytes,7,opt,name=email,proto3" json:"email,omitempty"` - Ex string `protobuf:"bytes,8,opt,name=ex,proto3" json:"ex,omitempty"` + Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + Icon string `protobuf:"bytes,3,opt,name=icon" json:"icon,omitempty"` + Gender int32 `protobuf:"varint,4,opt,name=gender" json:"gender,omitempty"` + Mobile string `protobuf:"bytes,5,opt,name=mobile" json:"mobile,omitempty"` + Birth string `protobuf:"bytes,6,opt,name=birth" json:"birth,omitempty"` + Email string `protobuf:"bytes,7,opt,name=email" json:"email,omitempty"` + Ex string `protobuf:"bytes,8,opt,name=ex" json:"ex,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -199,17 +387,16 @@ 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_ed89022014131a74, []int{3} + return fileDescriptor_user_9367ac00c24112e8, []int{7} } - func (m *UserInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserInfo.Unmarshal(m, b) } func (m *UserInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_UserInfo.Marshal(b, m, deterministic) } -func (m *UserInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserInfo.Merge(m, src) +func (dst *UserInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserInfo.Merge(dst, src) } func (m *UserInfo) XXX_Size() int { return xxx_messageInfo_UserInfo.Size(m) @@ -277,8 +464,8 @@ func (m *UserInfo) GetEx() string { } type LogoutReq struct { - OperationID string `protobuf:"bytes,1,opt,name=OperationID,proto3" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` + OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"` + Token string `protobuf:"bytes,2,opt,name=token" json:"token,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -288,17 +475,16 @@ func (m *LogoutReq) Reset() { *m = LogoutReq{} } func (m *LogoutReq) String() string { return proto.CompactTextString(m) } func (*LogoutReq) ProtoMessage() {} func (*LogoutReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ed89022014131a74, []int{4} + return fileDescriptor_user_9367ac00c24112e8, []int{8} } - func (m *LogoutReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LogoutReq.Unmarshal(m, b) } func (m *LogoutReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LogoutReq.Marshal(b, m, deterministic) } -func (m *LogoutReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_LogoutReq.Merge(m, src) +func (dst *LogoutReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_LogoutReq.Merge(dst, src) } func (m *LogoutReq) XXX_Size() int { return xxx_messageInfo_LogoutReq.Size(m) @@ -324,15 +510,16 @@ func (m *LogoutReq) GetToken() string { } type UpdateUserInfoReq struct { - Icon string `protobuf:"bytes,1,opt,name=icon,proto3" json:"icon,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Gender int32 `protobuf:"varint,3,opt,name=gender,proto3" json:"gender,omitempty"` - Mobile string `protobuf:"bytes,4,opt,name=mobile,proto3" json:"mobile,omitempty"` - Birth string `protobuf:"bytes,5,opt,name=birth,proto3" json:"birth,omitempty"` - Email string `protobuf:"bytes,6,opt,name=email,proto3" json:"email,omitempty"` - Ex string `protobuf:"bytes,7,opt,name=ex,proto3" json:"ex,omitempty"` - Token string `protobuf:"bytes,8,opt,name=token,proto3" json:"token,omitempty"` - OperationID string `protobuf:"bytes,9,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + Icon string `protobuf:"bytes,1,opt,name=icon" json:"icon,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + Gender int32 `protobuf:"varint,3,opt,name=gender" json:"gender,omitempty"` + Mobile string `protobuf:"bytes,4,opt,name=mobile" json:"mobile,omitempty"` + Birth string `protobuf:"bytes,5,opt,name=birth" json:"birth,omitempty"` + Email string `protobuf:"bytes,6,opt,name=email" json:"email,omitempty"` + Ex string `protobuf:"bytes,7,opt,name=ex" json:"ex,omitempty"` + Token string `protobuf:"bytes,8,opt,name=token" json:"token,omitempty"` + OperationID string `protobuf:"bytes,9,opt,name=OperationID" json:"OperationID,omitempty"` + Uid string `protobuf:"bytes,10,opt,name=Uid" json:"Uid,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -342,17 +529,16 @@ 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_ed89022014131a74, []int{5} + return fileDescriptor_user_9367ac00c24112e8, []int{9} } - 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 (m *UpdateUserInfoReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateUserInfoReq.Merge(m, src) +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) @@ -426,8 +612,19 @@ func (m *UpdateUserInfoReq) GetOperationID() string { return "" } +func (m *UpdateUserInfoReq) GetUid() string { + if m != nil { + return m.Uid + } + return "" +} + func init() { proto.RegisterType((*CommonResp)(nil), "user.CommonResp") + proto.RegisterType((*DeleteUsersResp)(nil), "user.DeleteUsersResp") + proto.RegisterType((*DeleteUsersReq)(nil), "user.DeleteUsersReq") + proto.RegisterType((*GetAllUsersUidReq)(nil), "user.GetAllUsersUidReq") + proto.RegisterType((*GetAllUsersUidResp)(nil), "user.GetAllUsersUidResp") proto.RegisterType((*GetUserInfoReq)(nil), "user.GetUserInfoReq") proto.RegisterType((*GetUserInfoResp)(nil), "user.GetUserInfoResp") proto.RegisterType((*UserInfo)(nil), "user.UserInfo") @@ -435,67 +632,34 @@ func init() { proto.RegisterType((*UpdateUserInfoReq)(nil), "user.UpdateUserInfoReq") } -func init() { - proto.RegisterFile("user/user.proto", fileDescriptor_ed89022014131a74) -} - -var fileDescriptor_ed89022014131a74 = []byte{ - // 416 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff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, 0x20, 0x3c, 0x35, 0x09, 0x5f, 0xf6, 0x5b, 0x74, 0x6e, 0xdd, - 0xfc, 0xa6, 0x7b, 0x18, 0xee, 0xed, 0x7d, 0xf0, 0xc5, 0xd7, 0xd4, 0x83, 0xfe, 0xac, 0x5d, 0x73, - 0x97, 0x6f, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xf8, 0x6d, 0x34, 0xa2, 0xaa, 0x03, 0x00, 0x00, -} - // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConnInterface +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.SupportPackageIsVersion6 +const _ = grpc.SupportPackageIsVersion4 + +// Client API for User service -// UserClient is the client API for User service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type UserClient interface { GetUserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error) UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteUsers(ctx context.Context, in *DeleteUsersReq, opts ...grpc.CallOption) (*DeleteUsersResp, error) + GetAllUsersUid(ctx context.Context, in *GetAllUsersUidReq, opts ...grpc.CallOption) (*GetAllUsersUidResp, error) } type userClient struct { - cc grpc.ClientConnInterface + cc *grpc.ClientConn } -func NewUserClient(cc grpc.ClientConnInterface) UserClient { +func NewUserClient(cc *grpc.ClientConn) UserClient { return &userClient{cc} } func (c *userClient) GetUserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error) { out := new(GetUserInfoResp) - err := c.cc.Invoke(ctx, "/user.user/getUserInfo", in, out, opts...) + err := grpc.Invoke(ctx, "/user.user/getUserInfo", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -504,28 +668,38 @@ func (c *userClient) GetUserInfo(ctx context.Context, in *GetUserInfoReq, opts . func (c *userClient) UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*CommonResp, error) { out := new(CommonResp) - err := c.cc.Invoke(ctx, "/user.user/UpdateUserInfo", in, out, opts...) + err := grpc.Invoke(ctx, "/user.user/UpdateUserInfo", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } -// UserServer is the server API for User service. -type UserServer interface { - GetUserInfo(context.Context, *GetUserInfoReq) (*GetUserInfoResp, error) - UpdateUserInfo(context.Context, *UpdateUserInfoReq) (*CommonResp, error) +func (c *userClient) DeleteUsers(ctx context.Context, in *DeleteUsersReq, opts ...grpc.CallOption) (*DeleteUsersResp, error) { + out := new(DeleteUsersResp) + err := grpc.Invoke(ctx, "/user.user/DeleteUsers", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil } -// UnimplementedUserServer can be embedded to have forward compatible implementations. -type UnimplementedUserServer struct { +func (c *userClient) GetAllUsersUid(ctx context.Context, in *GetAllUsersUidReq, opts ...grpc.CallOption) (*GetAllUsersUidResp, error) { + out := new(GetAllUsersUidResp) + err := grpc.Invoke(ctx, "/user.user/GetAllUsersUid", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (*UnimplementedUserServer) GetUserInfo(ctx context.Context, req *GetUserInfoReq) (*GetUserInfoResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetUserInfo not implemented") -} -func (*UnimplementedUserServer) UpdateUserInfo(ctx context.Context, req *UpdateUserInfoReq) (*CommonResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateUserInfo not implemented") +// Server API for User service + +type UserServer interface { + GetUserInfo(context.Context, *GetUserInfoReq) (*GetUserInfoResp, error) + UpdateUserInfo(context.Context, *UpdateUserInfoReq) (*CommonResp, error) + DeleteUsers(context.Context, *DeleteUsersReq) (*DeleteUsersResp, error) + GetAllUsersUid(context.Context, *GetAllUsersUidReq) (*GetAllUsersUidResp, error) } func RegisterUserServer(s *grpc.Server, srv UserServer) { @@ -568,6 +742,42 @@ func _User_UpdateUserInfo_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _User_DeleteUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteUsersReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).DeleteUsers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/DeleteUsers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).DeleteUsers(ctx, req.(*DeleteUsersReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetAllUsersUid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAllUsersUidReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetAllUsersUid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/GetAllUsersUid", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetAllUsersUid(ctx, req.(*GetAllUsersUidReq)) + } + return interceptor(ctx, in, info, handler) +} + var _User_serviceDesc = grpc.ServiceDesc{ ServiceName: "user.user", HandlerType: (*UserServer)(nil), @@ -580,7 +790,56 @@ var _User_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateUserInfo", Handler: _User_UpdateUserInfo_Handler, }, + { + MethodName: "DeleteUsers", + Handler: _User_DeleteUsers_Handler, + }, + { + MethodName: "GetAllUsersUid", + Handler: _User_GetAllUsersUid_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "user/user.proto", } + +func init() { proto.RegisterFile("user/user.proto", fileDescriptor_user_9367ac00c24112e8) } + +var fileDescriptor_user_9367ac00c24112e8 = []byte{ + // 560 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0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x0f, 0x5a, 0xd9, 0xc8, 0x05, 0x00, 0x00, +} diff --git a/src/proto/user/user.proto b/src/proto/user/user.proto index 0046442c4..d95960125 100644 --- a/src/proto/user/user.proto +++ b/src/proto/user/user.proto @@ -6,7 +6,25 @@ message CommonResp{ int32 errorCode = 1; string errorMsg = 2; } +message DeleteUsersResp{ + CommonResp commonResp = 1; + repeated string failedUidList = 2; +} +message DeleteUsersReq{ + repeated string deleteUidList = 2; + string token = 3; + string OperationID = 4; +} +message GetAllUsersUidReq{ + string token = 2; + string operationID = 3; +} +message GetAllUsersUidResp{ + CommonResp commonResp = 1; + repeated string uidList = 2; + +} message GetUserInfoReq{ repeated string userIDList = 1; string token = 2; @@ -44,9 +62,12 @@ message UpdateUserInfoReq{ string ex = 7; string token = 8; string OperationID = 9; + string Uid = 10; } service user { rpc getUserInfo(GetUserInfoReq) returns(GetUserInfoResp); rpc UpdateUserInfo(UpdateUserInfoReq) returns(CommonResp); + rpc DeleteUsers(DeleteUsersReq)returns(DeleteUsersResp); + rpc GetAllUsersUid(GetAllUsersUidReq)returns(GetAllUsersUidResp); } diff --git a/src/push/content_struct/content.go b/src/push/content_struct/content.go index 6821c6a52..c27b3f92a 100644 --- a/src/push/content_struct/content.go +++ b/src/push/content_struct/content.go @@ -20,6 +20,7 @@ func NewContentStructString(isDisplay int32, ID string, text string) string { c := Content{IsDisplay: isDisplay, ID: ID, Text: text} return c.contentToString() } + func (c *Content) contentToString() string { data, _ := json.Marshal(c) dataString := string(data) @@ -62,6 +63,13 @@ type NotificationContent struct { DefaultTips string `json:"defaultTips"` Detail string `json:"detail"` } + +func (c *NotificationContent) ContentToString() string { + data, _ := json.Marshal(c) + dataString := string(data) + return dataString +} + type KickGroupMemberApiReq struct { GroupID string `json:"groupID"` UidList []string `json:"uidList"` diff --git a/src/rpc/friend/friend/add_blacklist.go b/src/rpc/friend/friend/add_blacklist.go index 2a611f9f5..809410ce4 100644 --- a/src/rpc/friend/friend/add_blacklist.go +++ b/src/rpc/friend/friend/add_blacklist.go @@ -17,7 +17,23 @@ func (s *friendServer) AddBlacklist(ctx context.Context, req *pbFriend.AddBlackl log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) return &pbFriend.CommonResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil } - err = im_mysql_model.InsertInToUserBlackList(claims.UID, req.Uid) + + isMagagerFlag := 0 + tokenUid := claims.UID + if tokenUid == config.Config.AppManagerUid { + isMagagerFlag = 1 + } + if isMagagerFlag == 0 { + err = im_mysql_model.InsertInToUserBlackList(claims.UID, req.Uid) + if err != nil { + log.Error(req.Token, req.OperationID, "err=%s,Failed to add blacklist", err.Error()) + return &pbFriend.CommonResp{ErrorCode: config.ErrMysql.ErrCode, ErrorMsg: config.ErrMysql.ErrMsg}, nil + } + log.Info(req.Token, req.OperationID, "rpc add blacklist success return,uid=%s", req.Uid) + return &pbFriend.CommonResp{}, nil + } + + err = im_mysql_model.InsertInToUserBlackList(req.OwnerUid, req.Uid) if err != nil { log.Error(req.Token, req.OperationID, "err=%s,Failed to add blacklist", err.Error()) return &pbFriend.CommonResp{ErrorCode: config.ErrMysql.ErrCode, ErrorMsg: config.ErrMysql.ErrMsg}, nil diff --git a/src/rpc/friend/friend/add_friend.go b/src/rpc/friend/friend/add_friend.go index b1ae999e0..d6d081235 100644 --- a/src/rpc/friend/friend/add_friend.go +++ b/src/rpc/friend/friend/add_friend.go @@ -51,3 +51,66 @@ func (s *friendServer) AddFriend(ctx context.Context, req *pbFriend.AddFriendReq } return &pbFriend.CommonResp{}, nil } + +func (s *friendServer) ImportFriend(ctx context.Context, req *pbFriend.ImportFriendReq) (*pbFriend.CommonResp, error) { + log.Info(req.Token, req.OperationID, "ImportFriendis server,userid=%s", req.OwnerUid) + //Parse token, to find current user information + claims, err := utils.ParseToken(req.Token) + if err != nil { + log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) + return &pbFriend.CommonResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil + } + if claims.UID != config.Config.AppManagerUid { + log.Error(req.Token, req.OperationID, "not magager uid", claims.UID, config.Config.AppManagerUid) + return &pbFriend.CommonResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil + } + + if _, err = im_mysql_model.FindUserByUID(req.Uid); err != nil { + log.Error(req.Token, req.OperationID, "this user not exists,cant not add friend", req.Uid) + return &pbFriend.CommonResp{ErrorCode: config.ErrAddFriend.ErrCode, ErrorMsg: config.ErrSearchUserInfo.ErrMsg}, nil + } + + if _, err = im_mysql_model.FindUserByUID(req.OwnerUid); err != nil { + log.Error(req.Token, req.OperationID, "this user not exists,cant not add friend", req.OwnerUid) + return &pbFriend.CommonResp{ErrorCode: config.ErrAddFriend.ErrCode, ErrorMsg: config.ErrSearchUserInfo.ErrMsg}, nil + } + + _, err = im_mysql_model.FindFriendRelationshipFromFriend(req.OwnerUid, req.Uid) + + if err != nil { + log.Error("", req.OperationID, err.Error()) + } + //Establish two single friendship + err = im_mysql_model.InsertToFriend(req.OwnerUid, req.Uid, 1) + if err != nil { + log.Error(req.Token, req.OperationID, "err=%s,create friendship failed", err.Error()) + } + err = im_mysql_model.InsertToFriend(req.Uid, req.OwnerUid, 1) + if err != nil { + log.Error(req.Token, req.OperationID, "err=%s,create friendship failed", err.Error()) + } + + logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ + SendID: req.OwnerUid, + RecvID: req.Uid, + Content: content_struct.NewContentStructString(0, "", " add you as a friend."), + SendTime: utils.GetCurrentTimestampBySecond(), + MsgFrom: constant.UserMsgType, //Notification message identification + ContentType: constant.AcceptFriendApplicationTip, //Add friend flag + SessionType: constant.SingleChatType, + OperationID: req.OperationID, + }) + + logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ + SendID: req.Uid, + RecvID: req.OwnerUid, + Content: content_struct.NewContentStructString(0, "", " add you as a friend."), + SendTime: utils.GetCurrentTimestampBySecond(), + MsgFrom: constant.UserMsgType, //Notification message identification + ContentType: constant.AcceptFriendApplicationTip, //Add friend flag + SessionType: constant.SingleChatType, + OperationID: req.OperationID, + }) + + return &pbFriend.CommonResp{}, nil +} diff --git a/src/rpc/group/group/create_group.go b/src/rpc/group/group/create_group.go index 1a8fceeec..971887dcb 100644 --- a/src/rpc/group/group/create_group.go +++ b/src/rpc/group/group/create_group.go @@ -7,7 +7,10 @@ import ( "Open_IM/src/common/db/mysql_model/im_mysql_model" "Open_IM/src/common/log" "Open_IM/src/grpc-etcdv3/getcdv3" + pbChat "Open_IM/src/proto/chat" pbGroup "Open_IM/src/proto/group" + "Open_IM/src/push/content_struct" + "Open_IM/src/push/logic" "Open_IM/src/utils" "context" "google.golang.org/grpc" @@ -82,22 +85,30 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR return &pbGroup.CreateGroupResp{ErrorCode: config.ErrCreateGroup.ErrCode, ErrorMsg: config.ErrCreateGroup.ErrMsg}, nil } - //Add the group owner to the group first, otherwise the group creation will fail - us, err := im_mysql_model.FindUserByUID(claims.UID) - if err != nil { - log.Error("", req.OperationID, "find userInfo failed", err.Error()) - return &pbGroup.CreateGroupResp{ErrorCode: config.ErrCreateGroup.ErrCode, ErrorMsg: config.ErrCreateGroup.ErrMsg}, nil - } - err = im_mysql_model.InsertIntoGroupMember(groupId, claims.UID, us.Name, us.Icon, constant.GroupOwner) - if err != nil { - log.Error("", req.OperationID, "create group chat failed,err=%s", err.Error()) - return &pbGroup.CreateGroupResp{ErrorCode: config.ErrCreateGroup.ErrCode, ErrorMsg: config.ErrCreateGroup.ErrMsg}, nil + isMagagerFlag := 0 + tokenUid := claims.UID + if tokenUid == config.Config.AppManagerUid { + isMagagerFlag = 1 } - err = db.DB.AddGroupMember(groupId, claims.UID) - if err != nil { - log.Error("", "", "create mongo group member failed, db.DB.AddGroupMember fail [err: %s]", err.Error()) - return &pbGroup.CreateGroupResp{ErrorCode: config.ErrCreateGroup.ErrCode, ErrorMsg: config.ErrCreateGroup.ErrMsg}, nil + if isMagagerFlag == 0 { + //Add the group owner to the group first, otherwise the group creation will fail + us, err := im_mysql_model.FindUserByUID(claims.UID) + if err != nil { + log.Error("", req.OperationID, "find userInfo failed", err.Error()) + return &pbGroup.CreateGroupResp{ErrorCode: config.ErrCreateGroup.ErrCode, ErrorMsg: config.ErrCreateGroup.ErrMsg}, nil + } + err = im_mysql_model.InsertIntoGroupMember(groupId, claims.UID, us.Name, us.Icon, constant.GroupOwner) + if err != nil { + log.Error("", req.OperationID, "create group chat failed,err=%s", err.Error()) + return &pbGroup.CreateGroupResp{ErrorCode: config.ErrCreateGroup.ErrCode, ErrorMsg: config.ErrCreateGroup.ErrMsg}, nil + } + + err = db.DB.AddGroupMember(groupId, claims.UID) + if err != nil { + log.Error("", "", "create mongo group member failed, db.DB.AddGroupMember fail [err: %s]", err.Error()) + return &pbGroup.CreateGroupResp{ErrorCode: config.ErrCreateGroup.ErrCode, ErrorMsg: config.ErrCreateGroup.ErrMsg}, nil + } } //Binding group id and member id @@ -116,17 +127,33 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR log.Error("", "", "add mongo group member failed, db.DB.AddGroupMember fail [err: %s]", err.Error()) } } - ////Push message when create group chat - //logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ - // SendID: claims.UID, - // RecvID: groupId, - // Content: content_struct.NewContentStructString(0, "", req.String()), - // SendTime: utils.GetCurrentTimestampBySecond(), - // MsgFrom: constant.SysMsgType, //Notification message identification - // ContentType: constant.CreateGroupTip, //Add friend flag - // SessionType: constant.GroupChatType, - // OperationID: req.OperationID, - //}) + + if isMagagerFlag == 1 { + + //type NotificationContent struct { + // IsDisplay int32 `json:"isDisplay"` + // DefaultTips string `json:"defaultTips"` + // Detail string `json:"detail"` + //} n := NotificationContent{ + // IsDisplay: 1, + // DefaultTips: "You have joined the group chat:" + createGroupResp.Data.GroupName, + // Detail: createGroupResp.Data.GroupId, + // } + + ////Push message when create group chat + n := content_struct.NotificationContent{1, req.GroupName, groupId} + logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ + SendID: claims.UID, + RecvID: groupId, + Content: n.ContentToString(), + SendTime: utils.GetCurrentTimestampByNano(), + MsgFrom: constant.SysMsgType, //Notification message identification + ContentType: constant.CreateGroupTip, //Add friend flag + SessionType: constant.GroupChatType, + OperationID: req.OperationID, + }) + } + log.Info(req.Token, req.OperationID, "rpc create group success return") return &pbGroup.CreateGroupResp{GroupID: groupId}, nil } diff --git a/src/rpc/group/group/group.go b/src/rpc/group/group/group.go index 2c4bffc01..0fca4ae56 100644 --- a/src/rpc/group/group/group.go +++ b/src/rpc/group/group/group.go @@ -2,7 +2,12 @@ package group import ( "Open_IM/src/common/config" + "Open_IM/src/common/constant" "Open_IM/src/common/db" + pbChat "Open_IM/src/proto/chat" + "Open_IM/src/push/content_struct" + "Open_IM/src/push/logic" + "encoding/json" imdb "Open_IM/src/common/db/mysql_model/im_mysql_model" "Open_IM/src/common/log" @@ -59,7 +64,7 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite } log.Info(claims.UID, req.OperationID, "recv req: ", req.String()) - if !imdb.IsExistGroupMember(req.GroupID, claims.UID) { + if !imdb.IsExistGroupMember(req.GroupID, claims.UID) && claims.UID != config.Config.AppManagerUid { log.Error(req.Token, req.OperationID, "err= invite user not in group") return &pbGroup.InviteUserToGroupResp{ErrorCode: config.ErrAccess.ErrCode, ErrorMsg: config.ErrAccess.ErrMsg}, nil } @@ -94,16 +99,6 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite resp.Id2Result = append(resp.Id2Result, &resultNode) continue } - /* - err = imdb.InsertGroupRequest(req.GroupID, fromUserInfo.UID, fromUserInfo.Name, fromUserInfo.Icon, toUserInfo.UID, req.Reason, "invited", 1) - if err != nil { - log.Error(v, req.OperationID, "InsertGroupRequest failed, err: ", err.Error(), "params: ", - req.GroupID, fromUserInfo.UID, fromUserInfo.Name, fromUserInfo.Icon, toUserInfo.UID, req.Reason) - resultNode.Result = -1 - resp.Id2Result = append(resp.Id2Result, &resultNode) - continue - } - */ err = imdb.InsertGroupMember(req.GroupID, toUserInfo.UID, toUserInfo.Name, toUserInfo.Icon, 0) if err != nil { @@ -122,22 +117,42 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite } resp.ErrorCode = 0 resp.ErrorMsg = "ok" - /* - var chatMsg pbChat.WSToMsgSvrChatMsg - chatMsg.SendID = claims.UID - chatMsg.RecvID = req.GroupID - content, _ := json.Marshal(req) - chatMsg.Content = string(content) - chatMsg.SendTime = utils.GetCurrentTimestampBySecond() - chatMsg.MsgFrom = constant.UserMsgType - chatMsg.ContentType = constant.InviteUserToGroupTip - chatMsg.SessionType = constant.GroupChatType - logic.SendMsgByWS(&chatMsg) - */ + + if claims.UID == config.Config.AppManagerUid { + var iu inviteUserToGroupReq + iu.GroupID = req.GroupID + iu.OperationID = req.OperationID + iu.Reason = req.Reason + iu.UidList = req.UidList + n := content_struct.NotificationContent{1, req.GroupID, iu.ContentToString()} + logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ + SendID: claims.UID, + RecvID: req.GroupID, + Content: n.ContentToString(), + SendTime: utils.GetCurrentTimestampByNano(), + MsgFrom: constant.UserMsgType, + ContentType: constant.InviteUserToGroupTip, + SessionType: constant.GroupChatType, + OperationID: req.OperationID, + }) + } return &resp, nil } +type inviteUserToGroupReq struct { + GroupID string `json:"groupID"` + UidList []string `json:"uidList"` + Reason string `json:"reason"` + OperationID string `json:"operationID"` +} + +func (c *inviteUserToGroupReq) ContentToString() string { + data, _ := json.Marshal(c) + dataString := string(data) + return dataString +} + func (s *groupServer) GetGroupAllMember(ctx context.Context, req *pbGroup.GetGroupAllMemberReq) (*pbGroup.GetGroupAllMemberResp, error) { claims, err := utils.ParseToken(req.Token) if err != nil { @@ -209,6 +224,28 @@ func (s *groupServer) GetGroupMemberList(ctx context.Context, req *pbGroup.GetGr return &resp, nil } +type groupMemberFullInfo struct { + GroupId string `json:"groupID"` + UserId string `json:"userId"` + Role int `json:"role"` + JoinTime uint64 `json:"joinTime"` + NickName string `json:"nickName"` + FaceUrl string `json:"faceUrl"` +} + +type kickGroupMemberApiReq struct { + GroupID string `json:"groupID"` + UidListInfo []groupMemberFullInfo `json:"uidListInfo"` + Reason string `json:"reason"` + OperationID string `json:"operationID"` +} + +func (c *kickGroupMemberApiReq) ContentToString() string { + data, _ := json.Marshal(c) + dataString := string(data) + return dataString +} + func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGroupMemberReq) (*pbGroup.KickGroupMemberResp, error) { claims, err := utils.ParseToken(req.Token) if err != nil { @@ -230,6 +267,12 @@ func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGrou break } } + if flag != 1 { + if claims.UID == config.Config.AppManagerUid { + flag = 1 + } + } + if flag != 1 { log.Error(claims.UID, req.OperationID, "no access kick") return &pbGroup.KickGroupMemberResp{ErrorCode: config.ErrAccess.ErrCode, ErrorMsg: config.ErrAccess.ErrMsg}, nil @@ -262,29 +305,48 @@ func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGrou } } + var kq kickGroupMemberApiReq - /* - var chatMsg pbChat.WSToMsgSvrChatMsg - chatMsg.SendID = claims.UID - chatMsg.RecvID = req.GroupID - content, _ := json.Marshal(req) - chatMsg.Content = string(content) - chatMsg.SendTime = utils.GetCurrentTimestampBySecond() - chatMsg.MsgFrom = constant.UserMsgType - chatMsg.ContentType = constant.KickGroupMemberTip - chatMsg.SessionType = constant.GroupChatType - logic.SendMsgByWS(&chatMsg) - - for _, v := range req.UidList { - kickChatMsg := chatMsg - kickChatMsg.RecvID = v - kickChatMsg.SendTime = utils.GetCurrentTimestampBySecond() - kickChatMsg.SessionType = constant.SingleChatType - logic.SendMsgByWS(&kickChatMsg) - } - */ + kq.GroupID = req.GroupID + kq.OperationID = req.OperationID + kq.Reason = req.Reason + var gf groupMemberFullInfo + for _, v := range req.UidListInfo { + gf.UserId = v.UserId + gf.GroupId = req.GroupID + kq.UidListInfo = append(kq.UidListInfo, gf) + } + n := content_struct.NotificationContent{1, req.GroupID, kq.ContentToString()} + + if claims.UID == config.Config.AppManagerUid { + log.Info("", req.OperationID, claims.UID, req.GroupID) + logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ + SendID: claims.UID, + RecvID: req.GroupID, + Content: n.ContentToString(), + SendTime: utils.GetCurrentTimestampByNano(), + MsgFrom: constant.UserMsgType, + ContentType: constant.KickGroupMemberTip, + SessionType: constant.GroupChatType, + OperationID: req.OperationID, + }) + + for _, v := range req.UidListInfo { + log.Info("", req.OperationID, claims.UID, v.UserId) + logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ + SendID: claims.UID, + RecvID: v.UserId, + Content: n.ContentToString(), + SendTime: utils.GetCurrentTimestampBySecond(), + MsgFrom: constant.UserMsgType, + ContentType: constant.KickGroupMemberTip, + SessionType: constant.SingleChatType, + OperationID: req.OperationID, + }) + } + } resp.ErrorCode = 0 return &resp, nil } diff --git a/src/rpc/user/user/management_user.go b/src/rpc/user/user/management_user.go new file mode 100644 index 000000000..4c27300de --- /dev/null +++ b/src/rpc/user/user/management_user.go @@ -0,0 +1,61 @@ +/* +** description(""). +** copyright('open-im,www.open-im.io'). +** author("fg,Gordon@tuoyun.net"). +** time(2021/9/15 10:28). + */ +package user + +import ( + "Open_IM/src/common/config" + "Open_IM/src/common/db/mysql_model/im_mysql_model" + "Open_IM/src/common/log" + pbUser "Open_IM/src/proto/user" + "Open_IM/src/utils" + "context" +) + +func (s *userServer) DeleteUsers(_ context.Context, req *pbUser.DeleteUsersReq) (*pbUser.DeleteUsersResp, error) { + log.InfoByKv("rpc DeleteUsers arrived server", req.OperationID, "args", req.String()) + var resp pbUser.DeleteUsersResp + c, err := utils.ParseToken(req.Token) + if err != nil { + log.ErrorByKv("parse token failed", req.OperationID, "err", err.Error()) + return &pbUser.DeleteUsersResp{CommonResp: &pbUser.CommonResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: err.Error()}, FailedUidList: req.DeleteUidList}, nil + } + if c.UID != config.Config.AppManagerUid { + log.ErrorByKv(" Authentication failed", req.OperationID, "args", c) + return &pbUser.DeleteUsersResp{CommonResp: &pbUser.CommonResp{ErrorCode: 401, ErrorMsg: "not authorized"}, FailedUidList: req.DeleteUidList}, nil + } + for _, uid := range req.DeleteUidList { + err = im_mysql_model.UserDelete(uid) + if err != nil { + resp.CommonResp.ErrorCode = 201 + resp.CommonResp.ErrorMsg = "some uid deleted failed" + resp.FailedUidList = append(resp.FailedUidList, uid) + } + } + return &resp, nil + +} + +func (s *userServer) GetAllUsersUid(_ context.Context, req *pbUser.GetAllUsersUidReq) (*pbUser.GetAllUsersUidResp, error) { + log.InfoByKv("rpc GetAllUsersUid arrived server", req.OperationID, "args", req.String()) + c, err := utils.ParseToken(req.Token) + if err != nil { + log.InfoByKv("parse token failed", req.OperationID, "err", err.Error()) + return &pbUser.GetAllUsersUidResp{CommonResp: &pbUser.CommonResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: err.Error()}}, nil + } + if c.UID != config.Config.AppManagerUid { + log.ErrorByKv(" Authentication failed", req.OperationID, "args", c) + return &pbUser.GetAllUsersUidResp{CommonResp: &pbUser.CommonResp{ErrorCode: 401, ErrorMsg: "not authorized"}}, nil + } + uidList, err := im_mysql_model.SelectAllUID() + if err != nil { + log.ErrorByKv("db get failed", req.OperationID, "err", err.Error()) + return &pbUser.GetAllUsersUidResp{CommonResp: &pbUser.CommonResp{ErrorCode: config.ErrMysql.ErrCode, ErrorMsg: err.Error()}}, nil + } else { + return &pbUser.GetAllUsersUidResp{CommonResp: &pbUser.CommonResp{ErrorCode: 0, ErrorMsg: ""}, UidList: uidList}, nil + } + +} diff --git a/src/rpc/user/user/update_user_info.go b/src/rpc/user/user/update_user_info.go index f4a2c1233..952352596 100644 --- a/src/rpc/user/user/update_user_info.go +++ b/src/rpc/user/user/update_user_info.go @@ -22,7 +22,15 @@ func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbUser.UpdateUserI log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) return &pbUser.CommonResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: err.Error()}, nil } - err = im_mysql_model.UpDateUserInfo(claims.UID, req.Name, req.Icon, req.Mobile, req.Birth, req.Email, req.Ex, req.Gender) + + ownerUid := "" + if claims.UID == config.Config.AppManagerUid { + ownerUid = req.Uid + } else { + ownerUid = claims.UID + } + + err = im_mysql_model.UpDateUserInfo(ownerUid, req.Name, req.Icon, req.Mobile, req.Birth, req.Email, req.Ex, req.Gender) if err != nil { log.Error(req.Token, req.OperationID, "update user some attribute failed,err=%s", err.Error()) return &pbUser.CommonResp{ErrorCode: config.ErrModifyUserInfo.ErrCode, ErrorMsg: config.ErrModifyUserInfo.ErrMsg}, nil @@ -43,7 +51,7 @@ func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbUser.UpdateUserI log.ErrorByKv("get friend list rpc server failed", req.OperationID, "err", err.Error(), "req", req.String()) } - self, err := im_mysql_model.FindUserByUID(claims.UID) + self, err := im_mysql_model.FindUserByUID(ownerUid) if err != nil { log.ErrorByKv("get self info failed", req.OperationID, "err", err.Error(), "req", req.String()) } @@ -53,12 +61,12 @@ func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbUser.UpdateUserI } for _, v := range RpcResp.Data { logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ - SendID: claims.UID, + SendID: ownerUid, RecvID: v.Uid, SenderNickName: name, SenderFaceURL: faceUrl, - Content: claims.UID + "'s info has changed", - SendTime: utils.GetCurrentTimestampBySecond(), + Content: ownerUid + "'s info has changed", + SendTime: utils.GetCurrentTimestampByNano(), MsgFrom: constant.SysMsgType, ContentType: constant.SetSelfInfoTip, SessionType: constant.SingleChatType, diff --git a/src/utils/strings.go b/src/utils/strings.go index 76cf00b9b..f676da884 100644 --- a/src/utils/strings.go +++ b/src/utils/strings.go @@ -8,6 +8,7 @@ package utils import ( "encoding/json" + "math/rand" "strconv" ) @@ -53,3 +54,11 @@ func JsonStringToStruct(s string, args interface{}) error { err := json.Unmarshal([]byte(s), args) return err } + +func GetMsgID(sendID string) string { + t := int64ToString(GetCurrentTimestampByNano()) + return Md5(t + sendID + int64ToString(rand.Int63n(GetCurrentTimestampByNano()))) +} +func int64ToString(i int64) string { + return strconv.FormatInt(i, 10) +}