diff --git a/comm/imodule.go b/comm/imodule.go index d1b49bfc8..41299d8b0 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -6,8 +6,8 @@ import ( ) type ( - //红点接口 - IReddot interface { + //红点获取接口 + IGetReddot interface { Reddot(session IUserSession, rid ...ReddotType) (reddot map[ReddotType]bool) } //埋点中心更新通知 @@ -44,7 +44,7 @@ type ( SendMailByCid(session IUserSession, cid string, res []*pb.UserAssets) bool SendNewMail(mail *pb.DBMailData, uid ...string) bool // 批量发送邮件 支持跨服 SendMailByUID(uid string, cid string, res []*cfg.Gameatn, Param []string) bool - IReddot + IGetReddot } //道具背包接口 IItems interface { @@ -214,7 +214,7 @@ type ( // 校验主线是否通关 CheckCommpleteStage(uid string, stageId int32) (b bool) ///红点 - IReddot + IGetReddot } //任务 ITask interface { @@ -231,11 +231,9 @@ type ( // 获取已完成的日任务列表 GetTaskDayFinished(uid string) []*pb.TaskData ///红点 - IReddot + IGetReddot } - - //好友 IFriend interface { // 重置点赞列表和每日友情点 @@ -304,7 +302,7 @@ type ( // Check Rtype84 Rtype85 Rtype86 CheckPagodaMaxFloor(uid string, pagodaType int32) int32 // 查询塔通关难度type 1 表示普通塔 2 赛季塔 ///红点 - IReddot + IGetReddot } IHeroFetter interface { @@ -326,7 +324,7 @@ type ( IViking interface { CompleteAllLevel(session IUserSession) (errdata *pb.ErrorData) CheckUserBaseVikingInfo(uid string) (data []*pb.DBVikingRank) // 查询玩家最佳通关记录 - IReddot + IGetReddot // 自动购买门票 AutoBuyTicket(session IUserSession, bossId, difficulty int32) (errdata *pb.ErrorData) // 自动战斗 战斗信息 @@ -337,7 +335,7 @@ type ( IHunting interface { CompleteAllLevel(session IUserSession) (errdata *pb.ErrorData) CheckUserBaseHuntingInfo(uid string) (data []*pb.DBHuntingRank) // 查询玩家最佳通关记录 - IReddot + IGetReddot } // 公会 ISociaty interface { @@ -355,14 +353,14 @@ type ( // 任务条件达成通知 // TaskcondNotify(uid string, condIds []int32) error // 红点 - IReddot + IGetReddot } //星座图 IHoroscope interface { //计算新作图属性 ComputeHeroNumeric(uid string, hero ...*pb.DBHero) ///红点 - IReddot + IGetReddot } IPrivilege interface { // 创建一个新的特权卡 @@ -384,7 +382,7 @@ type ( //武馆 IMartialhall interface { ///红点 - IReddot + IGetReddot } // 世界任务 IWorldtask interface { @@ -408,7 +406,7 @@ type ( //竞技场 IArena interface { ///红点 - IReddot + IGetReddot //设置用户积分 SetUserIntegral(session IUserSession, Integral int32) (err error) //获取匹配战斗角色列表 @@ -416,7 +414,7 @@ type ( } IGourmet interface { ///红点 - IReddot + IGetReddot } ILibrary interface { @@ -451,7 +449,7 @@ type ( ISmithy interface { CheckActivateAtlasCollect(uid string, id string) - IReddot // 铁匠铺红点 + IGetReddot // 铁匠铺红点 } IPandaAtlas interface { @@ -510,4 +508,9 @@ type ( //完成任务并校验接口 FinishConditionAndCheck(uid string, finishcondiIds []int32, condiIds ...int32) (condis []*pb.ConIProgress, err error) } + //红点模块接口 + IReddot interface { + //推送红点 + PushReddot(session IUserSession, reddot ...ReddotType) (errdata *pb.ErrorData) + } ) diff --git a/modules/horoscope/modelhoroscope.go b/modules/horoscope/modelhoroscope.go index 6d87e66d0..fc0caab9a 100644 --- a/modules/horoscope/modelhoroscope.go +++ b/modules/horoscope/modelhoroscope.go @@ -9,6 +9,10 @@ import ( cfg "go_dreamfactory/sys/configure/structs" "go_dreamfactory/sys/db" "math" + + "go.mongodb.org/mongo-driver/bson/primitive" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/x/bsonx" ) ///星座图 数据组件 @@ -22,21 +26,30 @@ func (this *modelHoroscope) Init(service core.IService, module core.IModule, com this.TableName = comm.TableHoroscope this.MCompModel.Init(service, module, comp, opt) this.module = module.(*Horoscope) + // 通过uid创建索引 + this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ + Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}}, + }) return } //查询用户装备数据 -func (this *modelHoroscope) queryInfo(uId string) (result *pb.DBHoroscope, err error) { +func (this *modelHoroscope) queryInfo(uid string) (result *pb.DBHoroscope, err error) { result = &pb.DBHoroscope{ - Uid: uId, + Uid: uid, Nodes: make(map[int32]int32), } - if err = this.Get(uId, result); err != nil && err != mgo.MongodbNil { + if err = this.Get(uid, result); err != nil && err != mgo.MongodbNil { this.module.Errorln(err) return } if err == mgo.MongodbNil { - err = nil + result = &pb.DBHoroscope{ + Id: primitive.NewObjectID().Hex(), + Uid: uid, + Nodes: make(map[int32]int32), + } + err = this.Add(uid, result) } return } diff --git a/modules/reddot/module.go b/modules/reddot/module.go index 6e3ad40fc..560906b5d 100644 --- a/modules/reddot/module.go +++ b/modules/reddot/module.go @@ -5,6 +5,7 @@ import ( "go_dreamfactory/lego/base" "go_dreamfactory/lego/core" "go_dreamfactory/modules" + "go_dreamfactory/pb" ) /* @@ -103,3 +104,16 @@ func (this *Reddot) OnInstallComp() { this.ModuleBase.OnInstallComp() this.api_comp = this.RegisterComp(new(apiComp)).(*apiComp) } + +//推送红点 +func (this *Reddot) PushReddot(session comm.IUserSession, reddot ...comm.ReddotType) (errdata *pb.ErrorData) { + if len(reddot) <= 0 { + return + } + rids := make([]int32, len(reddot)) + for i, v := range reddot { + rids[i] = int32(v) + } + session.SendMsg(string(this.GetType()), "change", &pb.ReddotChangePush{Rids: rids}) + return +} diff --git a/modules/smithy/api_receive.go b/modules/smithy/api_receive.go index 9aa2e8fe9..3c1086ba1 100644 --- a/modules/smithy/api_receive.go +++ b/modules/smithy/api_receive.go @@ -25,7 +25,6 @@ func (this *apiComp) TaskAward(session comm.IUserSession, req *pb.SmithyTaskAwar if err := this.module.modelTask.updateTaskRecord(session.GetUserId(), req.TaskId); err != nil { var errCustom = new(comm.CustomError) if errors.As(err, &errCustom) { - //code = errCustom.Code errdata = &pb.ErrorData{ Code: errCustom.Code, Title: errCustom.Code.ToString(), diff --git a/modules/smithy/api_refuse.go b/modules/smithy/api_refuse.go index 2cbe5c01e..535c7a95f 100644 --- a/modules/smithy/api_refuse.go +++ b/modules/smithy/api_refuse.go @@ -1,6 +1,7 @@ package smithy import ( + "errors" "go_dreamfactory/comm" "go_dreamfactory/pb" ) @@ -22,10 +23,19 @@ func (this *apiComp) Refuse(session comm.IUserSession, req *pb.SmithyRefuseReq) cus, err := this.module.modelTrade.updateCustomer(session.GetUserId(), req.CustomerId) if err != nil { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_DBError, - Title: pb.ErrorCode_DBError.ToString(), - Message: err.Error(), + var errCustom = new(comm.CustomError) + if errors.As(err, &errCustom) { + errdata = &pb.ErrorData{ + Code: errCustom.Code, + Title: errCustom.Code.ToString(), + Message: err.Error(), + } + } else { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + Message: err.Error(), + } } return } diff --git a/modules/smithy/model_task.go b/modules/smithy/model_task.go index 4d3b988e0..6bb186d44 100644 --- a/modules/smithy/model_task.go +++ b/modules/smithy/model_task.go @@ -86,29 +86,35 @@ func (this *modelTask) TCondFinishNotify(uid string, conds []*pb.ConIProgress) { tt.Received = 1 } dt.Tasks = append(dt.Tasks, tt) - update["tasks"] = dt.Tasks - if err := this.Change(uid, update); err != nil { - this.module.Error(err.Error()) - return - } + } + update["tasks"] = dt.Tasks + if err := this.Change(uid, update); err != nil { + this.module.Error(err.Error()) return } + return } - for _, t := range dt.Tasks { - for k, v := range condMap { - // update - if t.TaskId == k { - t.Cond = v - } else { - //add - dt.Tasks = append(dt.Tasks, &pb.TujianTask{ - TaskId: k, - Cond: v, - }) + var newTask []*pb.TujianTask + existTaskMap := make(map[int32]*pb.TujianTask) + for _, task := range dt.Tasks { + existTaskMap[task.TaskId] = task + } + + for k, v := range condMap { + if task, ok := existTaskMap[k]; ok { + task.Cond = v + if v.State == pb.BuriedItemFinishState_buried_finish { + task.Received = 1 } + } else { + newTask = append(newTask, &pb.TujianTask{ + TaskId: k, + Cond: v, + }) } } + dt.Tasks = append(dt.Tasks, newTask...) update["tasks"] = dt.Tasks if len(update) > 0 { @@ -120,44 +126,30 @@ func (this *modelTask) TCondFinishNotify(uid string, conds []*pb.ConIProgress) { } func (this *modelTask) updateTaskRecord(uid string, taskId int32) error { - // if !this.checkTaskStatus(uid, taskId) { - // return comm.NewCustomError(pb.ErrorCode_SmithyTaskNoFinished) - // } dt, err := this.getTaskRecord(uid) if err != nil { if err == mongo.ErrNoDocuments { - // tj := &pb.DBTujianTask{Uid: uid} - // tj.Tasks = append(tj.Tasks, &pb.TujianTask{TaskId: taskId, Received: 2}) - // return this.Add(uid, tj) return comm.NewCustomError(pb.ErrorCode_SmithyTaskNoFinished) } return err } - // taskMap := make(map[int32]int32) update := make(map[string]interface{}) if dt.Uid != "" { for _, v := range dt.Tasks { if v.TaskId == taskId { - if v.Cond != nil && v.Cond.State == pb.BuriedItemFinishState_buried_finish { + if v.Received == 1 { v.Received = 2 + } else if v.Received == 2 { + return comm.NewCustomError(pb.ErrorCode_SmithyTaskReceived) + } else { + return comm.NewCustomError(pb.ErrorCode_SmithyTaskNoFinished) } - } else { - return comm.NewCustomError(pb.ErrorCode_SmithyTaskNoFinished) + break } - // taskMap[v.TaskId] = v.Received - // } } - // if t, ok := taskMap[taskId]; ok { - // if t == 2 { - // return comm.NewCustomError(pb.ErrorCode_SmithyTaskReceived) - // } else { - // update["received"] = 2 - // } - // } else { - // dt.Tasks = append(dt.Tasks, &pb.TujianTask{TaskId: taskId, Received: 2}) update["tasks"] = dt.Tasks } @@ -183,15 +175,3 @@ func (this *modelTask) checkReddot17107(uid string) bool { } return false } - -// 检查任务状态 -// func (this *modelTask) checkTaskStatus(uid string, taskId int32) bool { -// conf, _ := this.module.configure.GetSmithyTask(taskId) -// if conf == nil { -// return false -// } -// // if ec := this.module.ModuleRtask.CheckCondi(uid, conf.TypeId); ec != nil { -// // return false -// // } -// return true -// } diff --git a/modules/smithy/model_trade.go b/modules/smithy/model_trade.go index b6e2507d5..3436ea64e 100644 --- a/modules/smithy/model_trade.go +++ b/modules/smithy/model_trade.go @@ -136,7 +136,7 @@ func (s *modelTrade) updateCustomer(uid string, customerId int32) (*pb.DBCustome //上限 limit := s.module.modelStove.StoveSkillAddCustomer(uid) left := limit - cus.Total - if left <= 0 { + if left < 0 { return nil, comm.NewCustomError(pb.ErrorCode_SmithyCustomerLimit) } diff --git a/modules/worldtask/model_worldtask.go b/modules/worldtask/model_worldtask.go index 5661e5d40..462eb08c0 100644 --- a/modules/worldtask/model_worldtask.go +++ b/modules/worldtask/model_worldtask.go @@ -12,6 +12,7 @@ import ( "go_dreamfactory/utils" "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/x/bsonx" ) type ModelWorldtask struct { @@ -25,6 +26,9 @@ func (this *ModelWorldtask) Init(service core.IService, module core.IModule, com this.TableName = comm.TableWorldtask this.moduleWorldtask = module.(*Worldtask) this.service = service + this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ + Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}}, + }) return } diff --git a/pb/horoscope_db.pb.go b/pb/horoscope_db.pb.go index 68ae775f0..971f435d5 100644 --- a/pb/horoscope_db.pb.go +++ b/pb/horoscope_db.pb.go @@ -26,9 +26,10 @@ type DBHoroscope struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid" bson:"_id"` - Nodes map[int32]int32 `protobuf:"bytes,2,rep,name=nodes,proto3" json:"nodes" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //节点信息 key:是节点id value:等级 - Lastrest int64 `protobuf:"varint,3,opt,name=lastrest,proto3" json:"lastrest"` //上次重置时间 + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"` //uid + Nodes map[int32]int32 `protobuf:"bytes,3,rep,name=nodes,proto3" json:"nodes" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //节点信息 key:是节点id value:等级 + Lastrest int64 `protobuf:"varint,4,opt,name=lastrest,proto3" json:"lastrest"` //上次重置时间 } func (x *DBHoroscope) Reset() { @@ -63,6 +64,13 @@ func (*DBHoroscope) Descriptor() ([]byte, []int) { return file_horoscope_horoscope_db_proto_rawDescGZIP(), []int{0} } +func (x *DBHoroscope) GetId() string { + if x != nil { + return x.Id + } + return "" +} + func (x *DBHoroscope) GetUid() string { if x != nil { return x.Uid @@ -88,13 +96,14 @@ var File_horoscope_horoscope_db_proto protoreflect.FileDescriptor var file_horoscope_horoscope_db_proto_rawDesc = []byte{ 0x0a, 0x1c, 0x68, 0x6f, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2f, 0x68, 0x6f, 0x72, 0x6f, - 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa4, - 0x01, 0x0a, 0x0b, 0x44, 0x42, 0x48, 0x6f, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x10, - 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, - 0x12, 0x2d, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x73, 0x63, 0x6f, 0x70, 0x65, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb4, + 0x01, 0x0a, 0x0b, 0x44, 0x42, 0x48, 0x6f, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, + 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, + 0x12, 0x2d, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x44, 0x42, 0x48, 0x6f, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x12, - 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x72, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x72, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x72, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x0a, 0x0a, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, diff --git a/pb/notify_db.pb.go b/pb/notify_db.pb.go index 5c24edd17..e0526d67a 100644 --- a/pb/notify_db.pb.go +++ b/pb/notify_db.pb.go @@ -20,6 +20,50 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +//通知 +type NotifyEvent int32 + +const ( + NotifyEvent_Notify_1001 NotifyEvent = 0 +) + +// Enum value maps for NotifyEvent. +var ( + NotifyEvent_name = map[int32]string{ + 0: "Notify_1001", + } + NotifyEvent_value = map[string]int32{ + "Notify_1001": 0, + } +) + +func (x NotifyEvent) Enum() *NotifyEvent { + p := new(NotifyEvent) + *p = x + return p +} + +func (x NotifyEvent) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (NotifyEvent) Descriptor() protoreflect.EnumDescriptor { + return file_notify_notify_db_proto_enumTypes[0].Descriptor() +} + +func (NotifyEvent) Type() protoreflect.EnumType { + return &file_notify_notify_db_proto_enumTypes[0] +} + +func (x NotifyEvent) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use NotifyEvent.Descriptor instead. +func (NotifyEvent) EnumDescriptor() ([]byte, []int) { + return file_notify_notify_db_proto_rawDescGZIP(), []int{0} +} + //系统公告数据结构 type DBSystemNotify struct { state protoimpl.MessageState @@ -121,7 +165,9 @@ var file_notify_notify_db_proto_rawDesc = []byte{ 0x73, 0x74, 0x6f, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x74, 0x6f, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x06, 0x5a, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x2a, 0x1e, 0x0a, + 0x0b, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0f, 0x0a, 0x0b, + 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x5f, 0x31, 0x30, 0x30, 0x31, 0x10, 0x00, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } @@ -137,9 +183,11 @@ func file_notify_notify_db_proto_rawDescGZIP() []byte { return file_notify_notify_db_proto_rawDescData } +var file_notify_notify_db_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_notify_notify_db_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_notify_notify_db_proto_goTypes = []interface{}{ - (*DBSystemNotify)(nil), // 0: DBSystemNotify + (NotifyEvent)(0), // 0: NotifyEvent + (*DBSystemNotify)(nil), // 1: DBSystemNotify } var file_notify_notify_db_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type @@ -173,13 +221,14 @@ func file_notify_notify_db_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_notify_notify_db_proto_rawDesc, - NumEnums: 0, + NumEnums: 1, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, GoTypes: file_notify_notify_db_proto_goTypes, DependencyIndexes: file_notify_notify_db_proto_depIdxs, + EnumInfos: file_notify_notify_db_proto_enumTypes, MessageInfos: file_notify_notify_db_proto_msgTypes, }.Build() File_notify_notify_db_proto = out.File diff --git a/pb/notify_msg.pb.go b/pb/notify_msg.pb.go index 2b0edaa39..d90eb0c1f 100644 --- a/pb/notify_msg.pb.go +++ b/pb/notify_msg.pb.go @@ -205,6 +205,45 @@ func (x *NotifyGetListResp) GetSysNotify() []*DBSystemNotify { return nil } +//通知事件推送 +type NotifyEventPush struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *NotifyEventPush) Reset() { + *x = NotifyEventPush{} + if protoimpl.UnsafeEnabled { + mi := &file_notify_notify_msg_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotifyEventPush) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotifyEventPush) ProtoMessage() {} + +func (x *NotifyEventPush) ProtoReflect() protoreflect.Message { + mi := &file_notify_notify_msg_proto_msgTypes[3] + 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 NotifyEventPush.ProtoReflect.Descriptor instead. +func (*NotifyEventPush) Descriptor() ([]byte, []int) { + return file_notify_notify_msg_proto_rawDescGZIP(), []int{3} +} + var File_notify_notify_msg_proto protoreflect.FileDescriptor var file_notify_notify_msg_proto_rawDesc = []byte{ @@ -235,8 +274,9 @@ var file_notify_notify_msg_proto_rawDesc = []byte{ 0x52, 0x0c, 0x4c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x09, 0x53, 0x79, 0x73, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x44, 0x42, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4e, 0x6f, 0x74, 0x69, - 0x66, 0x79, 0x52, 0x09, 0x53, 0x79, 0x73, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x42, 0x06, 0x5a, - 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x66, 0x79, 0x52, 0x09, 0x53, 0x79, 0x73, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x22, 0x11, 0x0a, + 0x0f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x75, 0x73, 0x68, + 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -251,21 +291,22 @@ func file_notify_notify_msg_proto_rawDescGZIP() []byte { return file_notify_notify_msg_proto_rawDescData } -var file_notify_notify_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_notify_notify_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_notify_notify_msg_proto_goTypes = []interface{}{ (*NotifyErrorNotifyPush)(nil), // 0: NotifyErrorNotifyPush (*NotifyGetListReq)(nil), // 1: NotifyGetListReq (*NotifyGetListResp)(nil), // 2: NotifyGetListResp - (ErrorCode)(0), // 3: ErrorCode - (*anypb.Any)(nil), // 4: google.protobuf.Any - (*ErrorData)(nil), // 5: ErrorData - (*DBSystemNotify)(nil), // 6: DBSystemNotify + (*NotifyEventPush)(nil), // 3: NotifyEventPush + (ErrorCode)(0), // 4: ErrorCode + (*anypb.Any)(nil), // 5: google.protobuf.Any + (*ErrorData)(nil), // 6: ErrorData + (*DBSystemNotify)(nil), // 7: DBSystemNotify } var file_notify_notify_msg_proto_depIdxs = []int32{ - 3, // 0: NotifyErrorNotifyPush.Code:type_name -> ErrorCode - 4, // 1: NotifyErrorNotifyPush.arg:type_name -> google.protobuf.Any - 5, // 2: NotifyErrorNotifyPush.err:type_name -> ErrorData - 6, // 3: NotifyGetListResp.SysNotify:type_name -> DBSystemNotify + 4, // 0: NotifyErrorNotifyPush.Code:type_name -> ErrorCode + 5, // 1: NotifyErrorNotifyPush.arg:type_name -> google.protobuf.Any + 6, // 2: NotifyErrorNotifyPush.err:type_name -> ErrorData + 7, // 3: NotifyGetListResp.SysNotify:type_name -> DBSystemNotify 4, // [4:4] is the sub-list for method output_type 4, // [4:4] is the sub-list for method input_type 4, // [4:4] is the sub-list for extension type_name @@ -318,6 +359,18 @@ func file_notify_notify_msg_proto_init() { return nil } } + file_notify_notify_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NotifyEventPush); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -325,7 +378,7 @@ func file_notify_notify_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_notify_notify_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 3, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/reddot_msg.pb.go b/pb/reddot_msg.pb.go index b35001ef4..8f2e9b3ad 100644 --- a/pb/reddot_msg.pb.go +++ b/pb/reddot_msg.pb.go @@ -201,6 +201,54 @@ func (x *ReddotGetResp) GetReddot() map[int32]bool { return nil } +//推送红点改变 +type ReddotChangePush struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Rids []int32 `protobuf:"varint,1,rep,packed,name=rids,proto3" json:"rids"` +} + +func (x *ReddotChangePush) Reset() { + *x = ReddotChangePush{} + if protoimpl.UnsafeEnabled { + mi := &file_reddot_reddot_msg_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReddotChangePush) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReddotChangePush) ProtoMessage() {} + +func (x *ReddotChangePush) ProtoReflect() protoreflect.Message { + mi := &file_reddot_reddot_msg_proto_msgTypes[4] + 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 ReddotChangePush.ProtoReflect.Descriptor instead. +func (*ReddotChangePush) Descriptor() ([]byte, []int) { + return file_reddot_reddot_msg_proto_rawDescGZIP(), []int{4} +} + +func (x *ReddotChangePush) GetRids() []int32 { + if x != nil { + return x.Rids + } + return nil +} + var File_reddot_reddot_msg_proto protoreflect.FileDescriptor var file_reddot_reddot_msg_proto_rawDesc = []byte{ @@ -225,8 +273,10 @@ var file_reddot_reddot_msg_proto_rawDesc = []byte{ 0x52, 0x65, 0x64, 0x64, 0x6f, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x26, 0x0a, 0x10, 0x52, 0x65, 0x64, 0x64, 0x6f, + 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x75, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x72, + 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x04, 0x72, 0x69, 0x64, 0x73, 0x42, + 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -241,18 +291,19 @@ func file_reddot_reddot_msg_proto_rawDescGZIP() []byte { return file_reddot_reddot_msg_proto_rawDescData } -var file_reddot_reddot_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_reddot_reddot_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_reddot_reddot_msg_proto_goTypes = []interface{}{ (*ReddotGetAllReq)(nil), // 0: ReddotGetAllReq (*ReddotGetAllResp)(nil), // 1: ReddotGetAllResp (*ReddotGetReq)(nil), // 2: ReddotGetReq (*ReddotGetResp)(nil), // 3: ReddotGetResp - nil, // 4: ReddotGetAllResp.ReddotEntry - nil, // 5: ReddotGetResp.ReddotEntry + (*ReddotChangePush)(nil), // 4: ReddotChangePush + nil, // 5: ReddotGetAllResp.ReddotEntry + nil, // 6: ReddotGetResp.ReddotEntry } var file_reddot_reddot_msg_proto_depIdxs = []int32{ - 4, // 0: ReddotGetAllResp.reddot:type_name -> ReddotGetAllResp.ReddotEntry - 5, // 1: ReddotGetResp.reddot:type_name -> ReddotGetResp.ReddotEntry + 5, // 0: ReddotGetAllResp.reddot:type_name -> ReddotGetAllResp.ReddotEntry + 6, // 1: ReddotGetResp.reddot:type_name -> ReddotGetResp.ReddotEntry 2, // [2:2] is the sub-list for method output_type 2, // [2:2] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name @@ -314,6 +365,18 @@ func file_reddot_reddot_msg_proto_init() { return nil } } + file_reddot_reddot_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReddotChangePush); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -321,7 +384,7 @@ func file_reddot_reddot_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_reddot_reddot_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 7, NumExtensions: 0, NumServices: 0, },