From c897d316e1c2e27dbecadb840bb23e580279a0d5 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Fri, 4 Nov 2022 09:46:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=98=9F=E5=BA=A7=E5=9B=BE?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/horoscope/api_rest.go | 51 +++++++++++ modules/horoscope/modelhoroscope.go | 3 +- pb/errorcode.pb.go | 54 ++++++------ pb/horoscope_db.pb.go | 28 ++++-- pb/horoscope_msg.pb.go | 129 ++++++++++++++++++++++++++-- pb/mail_db.pb.go | 14 +-- 6 files changed, 224 insertions(+), 55 deletions(-) create mode 100644 modules/horoscope/api_rest.go diff --git a/modules/horoscope/api_rest.go b/modules/horoscope/api_rest.go new file mode 100644 index 000000000..880a6a94c --- /dev/null +++ b/modules/horoscope/api_rest.go @@ -0,0 +1,51 @@ +package horoscope + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" + "time" + + "google.golang.org/protobuf/proto" +) + +//参数校验 +func (this *apiComp) ResetCheck(session comm.IUserSession, req *pb.HoroscopeResetReq) (code pb.ErrorCode) { + + return +} + +///获取自己的排行榜信息 +func (this *apiComp) Reset(session comm.IUserSession, req *pb.HoroscopeResetReq) (code pb.ErrorCode, data proto.Message) { + var ( + info *pb.DBHoroscope + conf *cfg.GameGlobalData + err error + ) + if code = this.ResetCheck(session, req); code != pb.ErrorCode_Success { + return + } + if info, err = this.module.modelHoroscope.queryInfo(session.GetUserId()); err != nil { + code = pb.ErrorCode_DBError + return + } + conf = this.module.configure.GetGlobalConf() + if info.Lastrest > 0 { + if time.Now().Sub(time.Unix(info.Lastrest, 0)).Seconds() < float64(conf.HoroscopeResetCd) { + code = pb.ErrorCode_HoroscopeRestCDNoEnd + return + } + } + + if code = this.module.ConsumeRes(session, []*cfg.Gameatn{conf.HoroscopeResetCost}, true); code != pb.ErrorCode_Success { + return + } + info.Nodes = make(map[int32]int32) + info.Lastrest = time.Now().Unix() + if err = this.module.modelHoroscope.updateInfo(info); err != nil { + code = pb.ErrorCode_DBError + return + } + session.SendMsg(string(this.module.GetType()), "upgrade", &pb.HoroscopeResetResp{Issucc: true}) + return +} diff --git a/modules/horoscope/modelhoroscope.go b/modules/horoscope/modelhoroscope.go index c58207f97..02362b972 100644 --- a/modules/horoscope/modelhoroscope.go +++ b/modules/horoscope/modelhoroscope.go @@ -48,7 +48,8 @@ func (this *modelHoroscope) updateInfo(info *pb.DBHoroscope) (err error) { model *db.DBModel ) err = this.Change(info.Uid, map[string]interface{}{ - "nodes": info.Nodes, + "nodes": info.Nodes, + "lastrest": info.Lastrest, }) if model, err = this.module.GetDBNoduleByUid(info.Uid, this.TableName, time.Hour); err != nil { this.module.Errorln(err) diff --git a/pb/errorcode.pb.go b/pb/errorcode.pb.go index 4456c3f7f..86c4a6f6d 100644 --- a/pb/errorcode.pb.go +++ b/pb/errorcode.pb.go @@ -228,7 +228,6 @@ const ( ErrorCode_SociatyAppyLvNoEnough ErrorCode = 30027 //申请等级不满足 ErrorCode_SociatyTaskValidation ErrorCode = 30028 //任务未完成 ErrorCode_SociatyActivityNoEnough ErrorCode = 30029 //活跃度不足 - ErrorCode_SociatyAcitvityReceive ErrorCode = 30030 //活跃度领取失败 // arena ErrorCode_ArenaTicketBuyUp ErrorCode = 3101 //票据上限 ErrorCode_ArenaTicketNotEnough ErrorCode = 3102 //票据不足 @@ -246,6 +245,7 @@ const ( ErrorCode_TrollRepeatedReward ErrorCode = 3305 //奖励重复领取 // horoscope ErrorCode_HoroscopeNotTurnedOn ErrorCode = 3401 //未开启 + ErrorCode_HoroscopeRestCDNoEnd ErrorCode = 3402 //重置cd未结束 ) // Enum value maps for ErrorCode. @@ -437,7 +437,6 @@ var ( 30027: "SociatyAppyLvNoEnough", 30028: "SociatyTaskValidation", 30029: "SociatyActivityNoEnough", - 30030: "SociatyAcitvityReceive", 3101: "ArenaTicketBuyUp", 3102: "ArenaTicketNotEnough", 3103: "ArenaTicketNpcInCd", @@ -451,6 +450,7 @@ var ( 3304: "TrollMaxItemCount", 3305: "TrollRepeatedReward", 3401: "HoroscopeNotTurnedOn", + 3402: "HoroscopeRestCDNoEnd", } ErrorCode_value = map[string]int32{ "Success": 0, @@ -639,7 +639,6 @@ var ( "SociatyAppyLvNoEnough": 30027, "SociatyTaskValidation": 30028, "SociatyActivityNoEnough": 30029, - "SociatyAcitvityReceive": 30030, "ArenaTicketBuyUp": 3101, "ArenaTicketNotEnough": 3102, "ArenaTicketNpcInCd": 3103, @@ -653,6 +652,7 @@ var ( "TrollMaxItemCount": 3304, "TrollRepeatedReward": 3305, "HoroscopeNotTurnedOn": 3401, + "HoroscopeRestCDNoEnd": 3402, } ) @@ -687,7 +687,7 @@ var File_errorcode_proto protoreflect.FileDescriptor var file_errorcode_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2a, 0xa5, 0x23, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x6f, 0x2a, 0xa2, 0x23, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12, 0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, @@ -948,29 +948,29 @@ var file_errorcode_proto_rawDesc = []byte{ 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0xcc, 0xea, 0x01, 0x12, 0x1d, 0x0a, 0x17, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4e, 0x6f, 0x45, 0x6e, - 0x6f, 0x75, 0x67, 0x68, 0x10, 0xcd, 0xea, 0x01, 0x12, 0x1c, 0x0a, 0x16, 0x53, 0x6f, 0x63, 0x69, - 0x61, 0x74, 0x79, 0x41, 0x63, 0x69, 0x74, 0x76, 0x69, 0x74, 0x79, 0x52, 0x65, 0x63, 0x65, 0x69, - 0x76, 0x65, 0x10, 0xce, 0xea, 0x01, 0x12, 0x15, 0x0a, 0x10, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x54, - 0x69, 0x63, 0x6b, 0x65, 0x74, 0x42, 0x75, 0x79, 0x55, 0x70, 0x10, 0x9d, 0x18, 0x12, 0x19, 0x0a, - 0x14, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x45, - 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x9e, 0x18, 0x12, 0x17, 0x0a, 0x12, 0x41, 0x72, 0x65, 0x6e, - 0x61, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x70, 0x63, 0x49, 0x6e, 0x43, 0x64, 0x10, 0x9f, - 0x18, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x65, 0x61, - 0x74, 0x4c, 0x65, 0x61, 0x72, 0x6e, 0x10, 0x81, 0x19, 0x12, 0x12, 0x0a, 0x0d, 0x54, 0x61, 0x6c, - 0x65, 0x6e, 0x74, 0x45, 0x72, 0x72, 0x44, 0x61, 0x74, 0x61, 0x10, 0x82, 0x19, 0x12, 0x19, 0x0a, - 0x14, 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x55, 0x6e, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x42, - 0x65, 0x66, 0x6f, 0x72, 0x65, 0x10, 0x83, 0x19, 0x12, 0x15, 0x0a, 0x10, 0x54, 0x61, 0x6c, 0x65, - 0x6e, 0x74, 0x52, 0x65, 0x73, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x10, 0x84, 0x19, 0x12, - 0x10, 0x0a, 0x0b, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x42, 0x75, 0x79, 0x4d, 0x61, 0x78, 0x10, 0xe5, - 0x19, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x53, 0x65, 0x6c, 0x6c, 0x4d, 0x61, - 0x78, 0x10, 0xe6, 0x19, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x78, - 0x53, 0x65, 0x6c, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x10, 0xe7, 0x19, 0x12, 0x16, 0x0a, 0x11, - 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x75, 0x6e, - 0x74, 0x10, 0xe8, 0x19, 0x12, 0x18, 0x0a, 0x13, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x52, 0x65, 0x70, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe9, 0x19, 0x12, 0x19, - 0x0a, 0x14, 0x48, 0x6f, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x4e, 0x6f, 0x74, 0x54, 0x75, - 0x72, 0x6e, 0x65, 0x64, 0x4f, 0x6e, 0x10, 0xc9, 0x1a, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x75, 0x67, 0x68, 0x10, 0xcd, 0xea, 0x01, 0x12, 0x15, 0x0a, 0x10, 0x41, 0x72, 0x65, 0x6e, + 0x61, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x42, 0x75, 0x79, 0x55, 0x70, 0x10, 0x9d, 0x18, 0x12, + 0x19, 0x0a, 0x14, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x6f, + 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x9e, 0x18, 0x12, 0x17, 0x0a, 0x12, 0x41, 0x72, + 0x65, 0x6e, 0x61, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x70, 0x63, 0x49, 0x6e, 0x43, 0x64, + 0x10, 0x9f, 0x18, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, + 0x65, 0x61, 0x74, 0x4c, 0x65, 0x61, 0x72, 0x6e, 0x10, 0x81, 0x19, 0x12, 0x12, 0x0a, 0x0d, 0x54, + 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x45, 0x72, 0x72, 0x44, 0x61, 0x74, 0x61, 0x10, 0x82, 0x19, 0x12, + 0x19, 0x0a, 0x14, 0x54, 0x61, 0x6c, 0x65, 0x6e, 0x74, 0x55, 0x6e, 0x4c, 0x6f, 0x63, 0x6b, 0x65, + 0x72, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x10, 0x83, 0x19, 0x12, 0x15, 0x0a, 0x10, 0x54, 0x61, + 0x6c, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x10, 0x84, + 0x19, 0x12, 0x10, 0x0a, 0x0b, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x42, 0x75, 0x79, 0x4d, 0x61, 0x78, + 0x10, 0xe5, 0x19, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x53, 0x65, 0x6c, 0x6c, + 0x4d, 0x61, 0x78, 0x10, 0xe6, 0x19, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x4d, + 0x61, 0x78, 0x53, 0x65, 0x6c, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x10, 0xe7, 0x19, 0x12, 0x16, + 0x0a, 0x11, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x10, 0xe8, 0x19, 0x12, 0x18, 0x0a, 0x13, 0x54, 0x72, 0x6f, 0x6c, 0x6c, 0x52, + 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe9, 0x19, + 0x12, 0x19, 0x0a, 0x14, 0x48, 0x6f, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x4e, 0x6f, 0x74, + 0x54, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x4f, 0x6e, 0x10, 0xc9, 0x1a, 0x12, 0x19, 0x0a, 0x14, 0x48, + 0x6f, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x73, 0x74, 0x43, 0x44, 0x4e, 0x6f, + 0x45, 0x6e, 0x64, 0x10, 0xca, 0x1a, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/horoscope_db.pb.go b/pb/horoscope_db.pb.go index 589466830..68ae775f0 100644 --- a/pb/horoscope_db.pb.go +++ b/pb/horoscope_db.pb.go @@ -26,8 +26,9 @@ 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:等级 + 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"` //上次重置时间 } func (x *DBHoroscope) Reset() { @@ -76,21 +77,30 @@ func (x *DBHoroscope) GetNodes() map[int32]int32 { return nil } +func (x *DBHoroscope) GetLastrest() int64 { + if x != nil { + return x.Lastrest + } + return 0 +} + 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, 0x88, + 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, 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, 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, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 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, + 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, + 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, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 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, } var ( diff --git a/pb/horoscope_msg.pb.go b/pb/horoscope_msg.pb.go index 9b1ac66fc..132c0685a 100644 --- a/pb/horoscope_msg.pb.go +++ b/pb/horoscope_msg.pb.go @@ -211,6 +211,93 @@ func (x *HoroscopeUpgradeResp) GetLv() int32 { return 0 } +//重置请求 +type HoroscopeResetReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *HoroscopeResetReq) Reset() { + *x = HoroscopeResetReq{} + if protoimpl.UnsafeEnabled { + mi := &file_horoscope_horoscope_msg_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HoroscopeResetReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HoroscopeResetReq) ProtoMessage() {} + +func (x *HoroscopeResetReq) ProtoReflect() protoreflect.Message { + mi := &file_horoscope_horoscope_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 HoroscopeResetReq.ProtoReflect.Descriptor instead. +func (*HoroscopeResetReq) Descriptor() ([]byte, []int) { + return file_horoscope_horoscope_msg_proto_rawDescGZIP(), []int{4} +} + +//重置请求 回应 +type HoroscopeResetResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Issucc bool `protobuf:"varint,1,opt,name=issucc,proto3" json:"issucc"` +} + +func (x *HoroscopeResetResp) Reset() { + *x = HoroscopeResetResp{} + if protoimpl.UnsafeEnabled { + mi := &file_horoscope_horoscope_msg_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HoroscopeResetResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HoroscopeResetResp) ProtoMessage() {} + +func (x *HoroscopeResetResp) ProtoReflect() protoreflect.Message { + mi := &file_horoscope_horoscope_msg_proto_msgTypes[5] + 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 HoroscopeResetResp.ProtoReflect.Descriptor instead. +func (*HoroscopeResetResp) Descriptor() ([]byte, []int) { + return file_horoscope_horoscope_msg_proto_rawDescGZIP(), []int{5} +} + +func (x *HoroscopeResetResp) GetIssucc() bool { + if x != nil { + return x.Issucc + } + return false +} + var File_horoscope_horoscope_msg_proto protoreflect.FileDescriptor var file_horoscope_horoscope_msg_proto_rawDesc = []byte{ @@ -228,8 +315,12 @@ var file_horoscope_horoscope_msg_proto_rawDesc = []byte{ 0x64, 0x22, 0x38, 0x0a, 0x14, 0x48, 0x6f, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6e, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x6c, - 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x42, 0x06, 0x5a, 0x04, 0x2e, - 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x22, 0x13, 0x0a, 0x11, 0x48, + 0x6f, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, + 0x22, 0x2c, 0x0a, 0x12, 0x48, 0x6f, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x65, 0x73, + 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x42, 0x06, + 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -244,16 +335,18 @@ func file_horoscope_horoscope_msg_proto_rawDescGZIP() []byte { return file_horoscope_horoscope_msg_proto_rawDescData } -var file_horoscope_horoscope_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_horoscope_horoscope_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_horoscope_horoscope_msg_proto_goTypes = []interface{}{ (*HoroscopeInfoReq)(nil), // 0: HoroscopeInfoReq (*HoroscopeInfoResp)(nil), // 1: HoroscopeInfoResp (*HoroscopeUpgradeReq)(nil), // 2: HoroscopeUpgradeReq (*HoroscopeUpgradeResp)(nil), // 3: HoroscopeUpgradeResp - (*DBHoroscope)(nil), // 4: DBHoroscope + (*HoroscopeResetReq)(nil), // 4: HoroscopeResetReq + (*HoroscopeResetResp)(nil), // 5: HoroscopeResetResp + (*DBHoroscope)(nil), // 6: DBHoroscope } var file_horoscope_horoscope_msg_proto_depIdxs = []int32{ - 4, // 0: HoroscopeInfoResp.info:type_name -> DBHoroscope + 6, // 0: HoroscopeInfoResp.info:type_name -> DBHoroscope 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name @@ -316,6 +409,30 @@ func file_horoscope_horoscope_msg_proto_init() { return nil } } + file_horoscope_horoscope_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HoroscopeResetReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_horoscope_horoscope_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HoroscopeResetResp); 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{ @@ -323,7 +440,7 @@ func file_horoscope_horoscope_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_horoscope_horoscope_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 6, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/mail_db.pb.go b/pb/mail_db.pb.go index b1c6071dc..0c640baa8 100644 --- a/pb/mail_db.pb.go +++ b/pb/mail_db.pb.go @@ -34,7 +34,6 @@ type DBMailData struct { Check bool `protobuf:"varint,7,opt,name=Check,proto3" json:"Check"` // 是否查看 Reward bool `protobuf:"varint,8,opt,name=Reward,proto3" json:"Reward"` // 附件领取状态 Items []*UserAssets `protobuf:"bytes,9,rep,name=Items,proto3" json:"Items"` // 附件 - Cid string `protobuf:"bytes,10,opt,name=Cid,proto3" json:"Cid"` // 邮件的配置表ID } func (x *DBMailData) Reset() { @@ -132,19 +131,12 @@ func (x *DBMailData) GetItems() []*UserAssets { return nil } -func (x *DBMailData) GetCid() string { - if x != nil { - return x.Cid - } - return "" -} - var File_mail_mail_db_proto protoreflect.FileDescriptor var file_mail_mail_db_proto_rawDesc = []byte{ 0x0a, 0x12, 0x6d, 0x61, 0x69, 0x6c, 0x2f, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xff, 0x01, 0x0a, 0x0a, 0x44, 0x42, 0x4d, 0x61, 0x69, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x22, 0xed, 0x01, 0x0a, 0x0a, 0x44, 0x42, 0x4d, 0x61, 0x69, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x4f, 0x62, 0x6a, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x4f, 0x62, 0x6a, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x69, 0x74, 0x6c, 0x65, @@ -159,9 +151,7 @@ var file_mail_mail_db_proto_rawDesc = []byte{ 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x21, 0x0a, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, - 0x12, 0x10, 0x0a, 0x03, 0x43, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x43, - 0x69, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var (