diff --git a/config/config.go b/config/config.go index 1b8ccf6..8276063 100644 --- a/config/config.go +++ b/config/config.go @@ -22,6 +22,7 @@ const ( var ( NameSpace string = "egg-im" MySQL string = "root:Fnuo123com@@tcp(119.23.182.117:3306)/egg-im?charset=utf8&parseTime=true&loc=Local" + BusinessMySQL string = "root:Fnuo123com@@tcp(119.23.182.117:3306)/egg?charset=utf8&parseTime=true&loc=Local" RedisIP string = "120.24.28.6:32572" RedisPassword string = "" @@ -41,6 +42,7 @@ func Init() { } MySQL = configmap.Data["mysql"] + BusinessMySQL = configmap.Data["businessMySQL"] RedisIP = configmap.Data["redisIP"] RedisPassword = configmap.Data["redisPassword"] PushRoomSubscribeNum, _ = strconv.Atoi(configmap.Data["pushRoomSubscribeNum"]) diff --git a/internal/business/api/business_ext.go b/internal/business/api/business_ext.go index d09551f..7e628a7 100644 --- a/internal/business/api/business_ext.go +++ b/internal/business/api/business_ext.go @@ -5,15 +5,19 @@ import ( "egg-im/internal/business/app" comm "egg-im/internal/business/comm" "egg-im/internal/business/comm/utils" + "egg-im/internal/business/domain/user/model/business" "egg-im/internal/business/domain/user/repo" friend2 "egg-im/internal/logic/domain/friend" "egg-im/internal/logic/domain/group/model" repo2 "egg-im/internal/logic/domain/group/repo" "egg-im/internal/logic/domain/message/service" + "egg-im/pkg/db" + "egg-im/pkg/gerrors" "egg-im/pkg/grpclib" "egg-im/pkg/pb" "encoding/json" "errors" + "github.com/jinzhu/gorm" "strconv" "time" ) @@ -266,7 +270,23 @@ func (s *BusinessExtServer) GetUser(ctx context.Context, req *pb.GetUserReq) (*p user, err = app.UserApp.Get(ctx, userId) } - return &pb.GetUserResp{User: user}, nil + var businessUser business.User + err := db.DB.First(&businessUser, "phone_number = ?", user.PhoneNumber).Error + if err != nil && err != gorm.ErrRecordNotFound { + return nil, gerrors.WrapError(err) + } + var businessUserLevel business.UserLevel + err = db.DB.First(&businessUserLevel, "id = ?", businessUser.Level).Error + if err != nil && err != gorm.ErrRecordNotFound { + return nil, gerrors.WrapError(err) + } + + return &pb.GetUserResp{User: user, BusinessInfo: &pb.BusinessInfo{ + Uid: businessUser.Id, + LevelName: businessUserLevel.LevelName, + LevelId: int32(businessUserLevel.Id), + IsRealName: businessUser.IsRealName == 1, + }}, nil } func (s *BusinessExtServer) UpdateUser(ctx context.Context, req *pb.UpdateUserReq) (*pb.Empty, error) { diff --git a/internal/business/domain/user/model/business/user.go b/internal/business/domain/user/model/business/user.go index 8134ec2..da30839 100644 --- a/internal/business/domain/user/model/business/user.go +++ b/internal/business/domain/user/model/business/user.go @@ -1,37 +1,10 @@ -package model - -import ( - "egg-im/pkg/pb" - "time" -) +package business // User 账户 type User struct { - Id int64 // 用户id - PhoneNumber string // 手机号 - Nickname string // 昵称 - Sex int32 // 性别,1:男;2:女 - AvatarUrl string // 用户头像 - Extra string // 附加属性 - CreateTime time.Time // 创建时间 - UpdateTime time.Time // 更新时间 - IsAutoAddedFriends int // 是否自动被添加好友 -} - -func (u *User) ToProto() *pb.User { - if u == nil { - return nil - } - - return &pb.User{ - UserId: u.Id, - Nickname: u.Nickname, - Sex: u.Sex, - AvatarUrl: u.AvatarUrl, - Extra: u.Extra, - CreateTime: u.CreateTime.Unix(), - UpdateTime: u.UpdateTime.Unix(), - IsAutoAddedFriends: int64(u.IsAutoAddedFriends), - PhoneNumber: u.PhoneNumber, - } + Id int64 // 用户id + Level int //用户等级id + IsRealName int //是否实名(0:未实名 1.已实名) + CreateAt string // 创建时间 + UpdateAt string // 更新时间 } diff --git a/internal/business/domain/user/model/business/user_level.go b/internal/business/domain/user/model/business/user_level.go index da30839..d2bc992 100644 --- a/internal/business/domain/user/model/business/user_level.go +++ b/internal/business/domain/user/model/business/user_level.go @@ -1,10 +1,13 @@ package business -// User 账户 -type User struct { - Id int64 // 用户id - Level int //用户等级id - IsRealName int //是否实名(0:未实名 1.已实名) - CreateAt string // 创建时间 - UpdateAt string // 更新时间 +type UserLevel struct { + Id int `json:"id" ` + LevelName string `json:"level_name" ` + LevelWeight int `json:"level_weight" ` + ChoosableNum int `json:"choosable_num" ` + AutoUpdate int `json:"auto_update" ` + IsUse int `json:"is_use" ` + Memo string `json:"memo" ` + CreateAt string `json:"create_at" ` + UpdateAt string `json:"update_at" ` } diff --git a/pkg/db/db.go b/pkg/db/db.go index 070b48e..6b92ea3 100644 --- a/pkg/db/db.go +++ b/pkg/db/db.go @@ -13,13 +13,15 @@ import ( ) var ( - DB *gorm.DB - RedisCli *redis.Client - RedisUtil *util.RedisUtil + DB *gorm.DB + BusinessDB *gorm.DB + RedisCli *redis.Client + RedisUtil *util.RedisUtil ) func Init() { InitMysql(config.MySQL) + InitBusinessMysql(config.BusinessMySQL) InitRedis(config.RedisIP, config.RedisPassword) } @@ -36,6 +38,19 @@ func InitMysql(dataSource string) { logger.Logger.Info("init mysql ok") } +// InitBusinessMysql 初始化MySQL +func InitBusinessMysql(dataSource string) { + logger.Logger.Info("init mysql") + var err error + BusinessDB, err = gorm.Open("mysql", dataSource) + if err != nil { + panic(err) + } + BusinessDB.SingularTable(true) + BusinessDB.LogMode(true) + logger.Logger.Info("init business mysql ok") +} + // InitRedis 初始化Redis func InitRedis(addr, password string) { logger.Logger.Info("init redis") @@ -60,5 +75,6 @@ func InitByTest() { logger.Target = logger.Console InitMysql(config.MySQL) + InitBusinessMysql(config.BusinessMySQL) InitRedis(config.RedisIP, config.RedisPassword) } diff --git a/pkg/pb/business.ext.pb.go b/pkg/pb/business.ext.pb.go index eb058fd..306f612 100644 --- a/pkg/pb/business.ext.pb.go +++ b/pkg/pb/business.ext.pb.go @@ -96,7 +96,7 @@ const ( GroupNoticePublishType_UNKNOWN_PUBLISH GroupNoticePublishType = 0 // 未知 GroupNoticePublishType_ONLY_PUBLISH GroupNoticePublishType = 1 // 仅发布 GroupNoticePublishType_PUBLISH_AND_NOTICE GroupNoticePublishType = 2 // 发布并通知 - GroupNoticePublishType_NOTICE_AND_TOP_UP GroupNoticePublishType = 3 // 存在骗钱行为 + GroupNoticePublishType_NOTICE_AND_TOP_UP GroupNoticePublishType = 3 // 通知并置顶 ) // Enum value maps for GroupNoticePublishType. @@ -1151,6 +1151,77 @@ func (x *User) GetPhoneNumber() string { return "" } +type BusinessInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid int64 `protobuf:"varint,1,opt,name=Uid,proto3" json:"Uid,omitempty"` // 用户id + LevelName string `protobuf:"bytes,2,opt,name=LevelName,proto3" json:"LevelName,omitempty"` // 会员等级名称 + LevelId int32 `protobuf:"varint,3,opt,name=LevelId,proto3" json:"LevelId,omitempty"` // 会员等级 + IsRealName bool `protobuf:"varint,4,opt,name=IsRealName,proto3" json:"IsRealName,omitempty"` // 是否实名 +} + +func (x *BusinessInfo) Reset() { + *x = BusinessInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_business_ext_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BusinessInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BusinessInfo) ProtoMessage() {} + +func (x *BusinessInfo) ProtoReflect() protoreflect.Message { + mi := &file_business_ext_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BusinessInfo.ProtoReflect.Descriptor instead. +func (*BusinessInfo) Descriptor() ([]byte, []int) { + return file_business_ext_proto_rawDescGZIP(), []int{15} +} + +func (x *BusinessInfo) GetUid() int64 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *BusinessInfo) GetLevelName() string { + if x != nil { + return x.LevelName + } + return "" +} + +func (x *BusinessInfo) GetLevelId() int32 { + if x != nil { + return x.LevelId + } + return 0 +} + +func (x *BusinessInfo) GetIsRealName() bool { + if x != nil { + return x.IsRealName + } + return false +} + type GetUserReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1163,7 +1234,7 @@ type GetUserReq struct { func (x *GetUserReq) Reset() { *x = GetUserReq{} if protoimpl.UnsafeEnabled { - mi := &file_business_ext_proto_msgTypes[15] + mi := &file_business_ext_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1176,7 +1247,7 @@ func (x *GetUserReq) String() string { func (*GetUserReq) ProtoMessage() {} func (x *GetUserReq) ProtoReflect() protoreflect.Message { - mi := &file_business_ext_proto_msgTypes[15] + mi := &file_business_ext_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1189,7 +1260,7 @@ func (x *GetUserReq) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserReq.ProtoReflect.Descriptor instead. func (*GetUserReq) Descriptor() ([]byte, []int) { - return file_business_ext_proto_rawDescGZIP(), []int{15} + return file_business_ext_proto_rawDescGZIP(), []int{16} } func (x *GetUserReq) GetUserId() int64 { @@ -1211,13 +1282,14 @@ type GetUserResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // 用户信息 + User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // 用户信息 + BusinessInfo *BusinessInfo `protobuf:"bytes,2,opt,name=businessInfo,proto3" json:"businessInfo,omitempty"` // 用户业务信息 } func (x *GetUserResp) Reset() { *x = GetUserResp{} if protoimpl.UnsafeEnabled { - mi := &file_business_ext_proto_msgTypes[16] + mi := &file_business_ext_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1230,7 +1302,7 @@ func (x *GetUserResp) String() string { func (*GetUserResp) ProtoMessage() {} func (x *GetUserResp) ProtoReflect() protoreflect.Message { - mi := &file_business_ext_proto_msgTypes[16] + mi := &file_business_ext_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1243,7 +1315,7 @@ func (x *GetUserResp) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserResp.ProtoReflect.Descriptor instead. func (*GetUserResp) Descriptor() ([]byte, []int) { - return file_business_ext_proto_rawDescGZIP(), []int{16} + return file_business_ext_proto_rawDescGZIP(), []int{17} } func (x *GetUserResp) GetUser() *User { @@ -1253,6 +1325,13 @@ func (x *GetUserResp) GetUser() *User { return nil } +func (x *GetUserResp) GetBusinessInfo() *BusinessInfo { + if x != nil { + return x.BusinessInfo + } + return nil +} + type UpdateUserReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1267,7 +1346,7 @@ type UpdateUserReq struct { func (x *UpdateUserReq) Reset() { *x = UpdateUserReq{} if protoimpl.UnsafeEnabled { - mi := &file_business_ext_proto_msgTypes[17] + mi := &file_business_ext_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1280,7 +1359,7 @@ func (x *UpdateUserReq) String() string { func (*UpdateUserReq) ProtoMessage() {} func (x *UpdateUserReq) ProtoReflect() protoreflect.Message { - mi := &file_business_ext_proto_msgTypes[17] + mi := &file_business_ext_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1293,7 +1372,7 @@ func (x *UpdateUserReq) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateUserReq.ProtoReflect.Descriptor instead. func (*UpdateUserReq) Descriptor() ([]byte, []int) { - return file_business_ext_proto_rawDescGZIP(), []int{17} + return file_business_ext_proto_rawDescGZIP(), []int{18} } func (x *UpdateUserReq) GetNickname() string { @@ -1335,7 +1414,7 @@ type SearchUserReq struct { func (x *SearchUserReq) Reset() { *x = SearchUserReq{} if protoimpl.UnsafeEnabled { - mi := &file_business_ext_proto_msgTypes[18] + mi := &file_business_ext_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1348,7 +1427,7 @@ func (x *SearchUserReq) String() string { func (*SearchUserReq) ProtoMessage() {} func (x *SearchUserReq) ProtoReflect() protoreflect.Message { - mi := &file_business_ext_proto_msgTypes[18] + mi := &file_business_ext_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1361,7 +1440,7 @@ func (x *SearchUserReq) ProtoReflect() protoreflect.Message { // Deprecated: Use SearchUserReq.ProtoReflect.Descriptor instead. func (*SearchUserReq) Descriptor() ([]byte, []int) { - return file_business_ext_proto_rawDescGZIP(), []int{18} + return file_business_ext_proto_rawDescGZIP(), []int{19} } func (x *SearchUserReq) GetKey() string { @@ -1382,7 +1461,7 @@ type SearchUserResp struct { func (x *SearchUserResp) Reset() { *x = SearchUserResp{} if protoimpl.UnsafeEnabled { - mi := &file_business_ext_proto_msgTypes[19] + mi := &file_business_ext_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1395,7 +1474,7 @@ func (x *SearchUserResp) String() string { func (*SearchUserResp) ProtoMessage() {} func (x *SearchUserResp) ProtoReflect() protoreflect.Message { - mi := &file_business_ext_proto_msgTypes[19] + mi := &file_business_ext_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1408,7 +1487,7 @@ func (x *SearchUserResp) ProtoReflect() protoreflect.Message { // Deprecated: Use SearchUserResp.ProtoReflect.Descriptor instead. func (*SearchUserResp) Descriptor() ([]byte, []int) { - return file_business_ext_proto_rawDescGZIP(), []int{19} + return file_business_ext_proto_rawDescGZIP(), []int{20} } func (x *SearchUserResp) GetUsers() []*User { @@ -1538,13 +1617,24 @@ var file_business_ext_proto_rawDesc = []byte{ 0x12, 0x69, 0x73, 0x41, 0x75, 0x74, 0x6f, 0x41, 0x64, 0x64, 0x65, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, - 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3b, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, - 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, - 0x6f, 0x6e, 0x65, 0x22, 0x2b, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, + 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x78, 0x0a, 0x0c, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, + 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x03, 0x55, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x4c, 0x65, 0x76, 0x65, + 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x4c, 0x65, 0x76, + 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x49, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x64, + 0x12, 0x1e, 0x0a, 0x0a, 0x49, 0x73, 0x52, 0x65, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x49, 0x73, 0x52, 0x65, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, + 0x22, 0x3b, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x17, + 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x22, 0x61, 0x0a, + 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x04, + 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x0c, 0x62, 0x75, + 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x0c, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x72, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, @@ -1634,7 +1724,7 @@ func file_business_ext_proto_rawDescGZIP() []byte { } var file_business_ext_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_business_ext_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_business_ext_proto_msgTypes = make([]protoimpl.MessageInfo, 21) var file_business_ext_proto_goTypes = []interface{}{ (ComplainType)(0), // 0: pb.ComplainType (GroupNoticePublishType)(0), // 1: pb.GroupNoticePublishType @@ -1653,12 +1743,13 @@ var file_business_ext_proto_goTypes = []interface{}{ (*CloudUploadFileReq)(nil), // 14: pb.CloudUploadFileReq (*CloudUploadFileResp)(nil), // 15: pb.CloudUploadFileResp (*User)(nil), // 16: pb.User - (*GetUserReq)(nil), // 17: pb.GetUserReq - (*GetUserResp)(nil), // 18: pb.GetUserResp - (*UpdateUserReq)(nil), // 19: pb.UpdateUserReq - (*SearchUserReq)(nil), // 20: pb.SearchUserReq - (*SearchUserResp)(nil), // 21: pb.SearchUserResp - (*Empty)(nil), // 22: pb.Empty + (*BusinessInfo)(nil), // 17: pb.BusinessInfo + (*GetUserReq)(nil), // 18: pb.GetUserReq + (*GetUserResp)(nil), // 19: pb.GetUserResp + (*UpdateUserReq)(nil), // 20: pb.UpdateUserReq + (*SearchUserReq)(nil), // 21: pb.SearchUserReq + (*SearchUserResp)(nil), // 22: pb.SearchUserResp + (*Empty)(nil), // 23: pb.Empty } var file_business_ext_proto_depIdxs = []int32{ 1, // 0: pb.ViewGroupNoticeResp.publish_type:type_name -> pb.GroupNoticePublishType @@ -1667,36 +1758,37 @@ var file_business_ext_proto_depIdxs = []int32{ 16, // 3: pb.IsFriendsResp.user:type_name -> pb.User 10, // 4: pb.EmoticonListResp.emoticons:type_name -> pb.Emoticon 16, // 5: pb.GetUserResp.user:type_name -> pb.User - 16, // 6: pb.SearchUserResp.users:type_name -> pb.User - 12, // 7: pb.BusinessExt.SignIn:input_type -> pb.SignInReq - 17, // 8: pb.BusinessExt.GetUser:input_type -> pb.GetUserReq - 19, // 9: pb.BusinessExt.UpdateUser:input_type -> pb.UpdateUserReq - 20, // 10: pb.BusinessExt.SearchUser:input_type -> pb.SearchUserReq - 14, // 11: pb.BusinessExt.CloudUploadFile:input_type -> pb.CloudUploadFileReq - 22, // 12: pb.BusinessExt.EmoticonList:input_type -> pb.Empty - 8, // 13: pb.BusinessExt.IsFriends:input_type -> pb.IsFriendsReq - 7, // 14: pb.BusinessExt.ComplainGroup:input_type -> pb.ComplainGroupReq - 6, // 15: pb.BusinessExt.PublishGroupNotice:input_type -> pb.PublishGroupNoticeReq - 4, // 16: pb.BusinessExt.ViewGroupNotice:input_type -> pb.ViewGroupNoticeReq - 2, // 17: pb.BusinessExt.LikeGroupNotice:input_type -> pb.LikeGroupNoticeReq - 3, // 18: pb.BusinessExt.CancelLikeGroupNotice:input_type -> pb.CancelLikeGroupNoticeReq - 13, // 19: pb.BusinessExt.SignIn:output_type -> pb.SignInResp - 18, // 20: pb.BusinessExt.GetUser:output_type -> pb.GetUserResp - 22, // 21: pb.BusinessExt.UpdateUser:output_type -> pb.Empty - 21, // 22: pb.BusinessExt.SearchUser:output_type -> pb.SearchUserResp - 15, // 23: pb.BusinessExt.CloudUploadFile:output_type -> pb.CloudUploadFileResp - 11, // 24: pb.BusinessExt.EmoticonList:output_type -> pb.EmoticonListResp - 9, // 25: pb.BusinessExt.IsFriends:output_type -> pb.IsFriendsResp - 22, // 26: pb.BusinessExt.ComplainGroup:output_type -> pb.Empty - 22, // 27: pb.BusinessExt.PublishGroupNotice:output_type -> pb.Empty - 5, // 28: pb.BusinessExt.ViewGroupNotice:output_type -> pb.ViewGroupNoticeResp - 22, // 29: pb.BusinessExt.LikeGroupNotice:output_type -> pb.Empty - 22, // 30: pb.BusinessExt.CancelLikeGroupNotice:output_type -> pb.Empty - 19, // [19:31] is the sub-list for method output_type - 7, // [7:19] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 17, // 6: pb.GetUserResp.businessInfo:type_name -> pb.BusinessInfo + 16, // 7: pb.SearchUserResp.users:type_name -> pb.User + 12, // 8: pb.BusinessExt.SignIn:input_type -> pb.SignInReq + 18, // 9: pb.BusinessExt.GetUser:input_type -> pb.GetUserReq + 20, // 10: pb.BusinessExt.UpdateUser:input_type -> pb.UpdateUserReq + 21, // 11: pb.BusinessExt.SearchUser:input_type -> pb.SearchUserReq + 14, // 12: pb.BusinessExt.CloudUploadFile:input_type -> pb.CloudUploadFileReq + 23, // 13: pb.BusinessExt.EmoticonList:input_type -> pb.Empty + 8, // 14: pb.BusinessExt.IsFriends:input_type -> pb.IsFriendsReq + 7, // 15: pb.BusinessExt.ComplainGroup:input_type -> pb.ComplainGroupReq + 6, // 16: pb.BusinessExt.PublishGroupNotice:input_type -> pb.PublishGroupNoticeReq + 4, // 17: pb.BusinessExt.ViewGroupNotice:input_type -> pb.ViewGroupNoticeReq + 2, // 18: pb.BusinessExt.LikeGroupNotice:input_type -> pb.LikeGroupNoticeReq + 3, // 19: pb.BusinessExt.CancelLikeGroupNotice:input_type -> pb.CancelLikeGroupNoticeReq + 13, // 20: pb.BusinessExt.SignIn:output_type -> pb.SignInResp + 19, // 21: pb.BusinessExt.GetUser:output_type -> pb.GetUserResp + 23, // 22: pb.BusinessExt.UpdateUser:output_type -> pb.Empty + 22, // 23: pb.BusinessExt.SearchUser:output_type -> pb.SearchUserResp + 15, // 24: pb.BusinessExt.CloudUploadFile:output_type -> pb.CloudUploadFileResp + 11, // 25: pb.BusinessExt.EmoticonList:output_type -> pb.EmoticonListResp + 9, // 26: pb.BusinessExt.IsFriends:output_type -> pb.IsFriendsResp + 23, // 27: pb.BusinessExt.ComplainGroup:output_type -> pb.Empty + 23, // 28: pb.BusinessExt.PublishGroupNotice:output_type -> pb.Empty + 5, // 29: pb.BusinessExt.ViewGroupNotice:output_type -> pb.ViewGroupNoticeResp + 23, // 30: pb.BusinessExt.LikeGroupNotice:output_type -> pb.Empty + 23, // 31: pb.BusinessExt.CancelLikeGroupNotice:output_type -> pb.Empty + 20, // [20:32] is the sub-list for method output_type + 8, // [8:20] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_business_ext_proto_init() } @@ -1887,7 +1979,7 @@ func file_business_ext_proto_init() { } } file_business_ext_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserReq); i { + switch v := v.(*BusinessInfo); i { case 0: return &v.state case 1: @@ -1899,7 +1991,7 @@ func file_business_ext_proto_init() { } } file_business_ext_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserResp); i { + switch v := v.(*GetUserReq); i { case 0: return &v.state case 1: @@ -1911,7 +2003,7 @@ func file_business_ext_proto_init() { } } file_business_ext_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserReq); i { + switch v := v.(*GetUserResp); i { case 0: return &v.state case 1: @@ -1923,7 +2015,7 @@ func file_business_ext_proto_init() { } } file_business_ext_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchUserReq); i { + switch v := v.(*UpdateUserReq); i { case 0: return &v.state case 1: @@ -1935,6 +2027,18 @@ func file_business_ext_proto_init() { } } file_business_ext_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchUserReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_business_ext_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SearchUserResp); i { case 0: return &v.state @@ -1953,7 +2057,7 @@ func file_business_ext_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_business_ext_proto_rawDesc, NumEnums: 2, - NumMessages: 20, + NumMessages: 21, NumExtensions: 0, NumServices: 1, }, @@ -1968,6 +2072,7 @@ func file_business_ext_proto_init() { file_business_ext_proto_depIdxs = nil } + // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.32.0 or later. @@ -2147,6 +2252,7 @@ type BusinessExtServer interface { LikeGroupNotice(context.Context, *LikeGroupNoticeReq) (*Empty, error) // 取消点赞群公告 CancelLikeGroupNotice(context.Context, *CancelLikeGroupNoticeReq) (*Empty, error) + mustEmbedUnimplementedBusinessExtServer() } // UnimplementedBusinessExtServer must be embedded to have forward compatible implementations. @@ -2189,6 +2295,14 @@ func (UnimplementedBusinessExtServer) LikeGroupNotice(context.Context, *LikeGrou func (UnimplementedBusinessExtServer) CancelLikeGroupNotice(context.Context, *CancelLikeGroupNoticeReq) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method CancelLikeGroupNotice not implemented") } +func (UnimplementedBusinessExtServer) mustEmbedUnimplementedBusinessExtServer() {} + +// UnsafeBusinessExtServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to BusinessExtServer will +// result in compilation errors. +type UnsafeBusinessExtServer interface { + mustEmbedUnimplementedBusinessExtServer() +} func RegisterBusinessExtServer(s grpc.ServiceRegistrar, srv BusinessExtServer) { s.RegisterService(&BusinessExt_ServiceDesc, srv) @@ -2468,4 +2582,4 @@ var BusinessExt_ServiceDesc = grpc.ServiceDesc{ }, Streams: []grpc.StreamDesc{}, Metadata: "business.ext.proto", -} +} \ No newline at end of file