From a66d962b18081d490fe3f16bb3d65cf801bc2442 Mon Sep 17 00:00:00 2001 From: liwei <2211068034@qq.com> Date: Thu, 3 Aug 2023 16:19:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=97=A5=E5=B8=B8=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 19 +- modules/addrecharge/api.go | 20 ++ modules/addrecharge/api_Info.go | 47 ++++ modules/addrecharge/api_receive.go | 107 +++++++++ modules/addrecharge/configure.go | 84 +++++++ modules/addrecharge/modelRecharge.go | 47 ++++ modules/addrecharge/module.go | 65 +++++ modules/kftask/module.go | 7 +- modules/wtask/api_finish.go | 26 +- modules/wtask/module.go | 2 +- pb/addrecharge_db.pb.go | 179 ++++++++++++++ pb/addrecharge_msg.pb.go | 346 +++++++++++++++++++++++++++ 12 files changed, 916 insertions(+), 33 deletions(-) create mode 100644 modules/addrecharge/api.go create mode 100644 modules/addrecharge/api_Info.go create mode 100644 modules/addrecharge/api_receive.go create mode 100644 modules/addrecharge/configure.go create mode 100644 modules/addrecharge/modelRecharge.go create mode 100644 modules/addrecharge/module.go create mode 100644 pb/addrecharge_db.pb.go create mode 100644 pb/addrecharge_msg.pb.go diff --git a/comm/const.go b/comm/const.go index 522da4dcc..71319bb59 100644 --- a/comm/const.go +++ b/comm/const.go @@ -985,13 +985,14 @@ const ( ) const ( - HdTypeWarorder = 1 // 圣桃战令类型 - HdTypePay = 2 // 圣桃充值礼包 - KFSevenTask = 3 //开服任务 - XSFundPhysical = 4 //现时活动 体力基金 - XSFundRecruit = 5 //现时活动 招募基金 - XSFundExp = 6 //现时活动 经验基金 - HdLevel = 7 //开服等级活动 - HdTypeSign = 8 // 七日签到 - HdTypeTurntable = 9 // 大转盘 + HdTypeWarorder = 1 //圣桃战令类型 + HdTypePay = 2 //圣桃充值礼包 + KFSevenTask = 3 //开服任务 + XSFundPhysical = 4 //现时活动 体力基金 + XSFundRecruit = 5 //现时活动 招募基金 + XSFundExp = 6 //现时活动 经验基金 + HdLevel = 7 //开服等级活动 + HdTypeSign = 8 //七日签到 + HdTypeTurntable = 9 //大转盘 + AddUpRecharge = 10 //累计充值 ) diff --git a/modules/addrecharge/api.go b/modules/addrecharge/api.go new file mode 100644 index 000000000..2bd7ad563 --- /dev/null +++ b/modules/addrecharge/api.go @@ -0,0 +1,20 @@ +package addrecharge + +import ( + "go_dreamfactory/lego/base" + "go_dreamfactory/lego/core" + "go_dreamfactory/modules" +) + +type apiComp struct { + modules.MCompGate + service base.IRPCXService + module *AddRecharge +} + +func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + _ = this.MCompGate.Init(service, module, comp, options) + this.service = service.(base.IRPCXService) + this.module = module.(*AddRecharge) + return +} diff --git a/modules/addrecharge/api_Info.go b/modules/addrecharge/api_Info.go new file mode 100644 index 000000000..658741784 --- /dev/null +++ b/modules/addrecharge/api_Info.go @@ -0,0 +1,47 @@ +package addrecharge + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" +) + +// 参数校验 +func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.KFTaskInfoReq) (errdata *pb.ErrorData) { + + return +} + +// /获取自己的排行榜信息 +func (this *apiComp) Info(session comm.IUserSession, req *pb.KFTaskInfoReq) (errdata *pb.ErrorData) { + var ( + dtask *pb.DBKFTask + tasks map[int32]struct{} + condiIds []int32 + progress []*pb.ConIProgress + err error + ) + if errdata = this.InfoCheck(session, req); errdata != nil { + return + } + + if dtask, err = this.module.modelRecharge.getUserDTasks(session.GetUserId()); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + Message: err.Error(), + } + return + } + tasks = this.module.configure.gettasks() + condiIds = make([]int32, 0, len(tasks)) + for k, _ := range tasks { + condiIds = append(condiIds, k) + } + + if progress, err = this.module.ModuleBuried.CheckCondition(session.GetUserId(), condiIds...); err != nil { + return + } + + session.SendMsg(string(this.module.GetType()), "info", &pb.KFTaskInfoResp{Conlds: progress, Tasks: dtask.Tasks}) + return +} diff --git a/modules/addrecharge/api_receive.go b/modules/addrecharge/api_receive.go new file mode 100644 index 000000000..234f0582e --- /dev/null +++ b/modules/addrecharge/api_receive.go @@ -0,0 +1,107 @@ +package addrecharge + +import ( + "fmt" + "go_dreamfactory/comm" + "go_dreamfactory/pb" + "go_dreamfactory/sys/configure" + cfg "go_dreamfactory/sys/configure/structs" + "go_dreamfactory/utils" +) + +// 参数校验 +func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.KFTaskReceiveReq) (errdata *pb.ErrorData) { + + return +} + +// /获取自己的排行榜信息 +func (this *apiComp) Receive(session comm.IUserSession, req *pb.KFTaskReceiveReq) (errdata *pb.ErrorData) { + var ( + dtask *pb.DBKFTask + conf *cfg.GameVenturegiftsTaskData + user *pb.DBUser + progress []*pb.ConIProgress + award []*pb.UserAssets + err error + ) + if errdata = this.ReceiveCheck(session, req); errdata != nil { + return + } + + if conf, err = this.module.configure.getGameVenturegiftsTask(req.Id); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + Message: err.Error(), + } + return + } + if dtask, err = this.module.modelRecharge.getUserDTasks(session.GetUserId()); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + Message: err.Error(), + } + return + } + + if dtask.Tasks[req.Id] == 1 { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + Message: fmt.Sprintf("%d received", req.Id), + } + return + } + if user = this.module.ModuleUser.GetUser(session.GetUserId()); user == nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + Message: "no found user!", + } + return + } + days := utils.DiffDays(user.Ctime, configure.Now().Unix()) + if days < int(conf.Openday) { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + Message: "no open", + } + return + } + + if progress, err = this.module.ModuleBuried.CheckCondition(session.GetUserId(), conf.Venturetask); err != nil { + return + } + + for _, v := range progress { + if v.State == pb.BuriedItemFinishState_buried_unfinish { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + Message: "task no finish", + } + return + } + } + + if errdata = this.module.DispenseRes(session, conf.Venturereward, true); errdata != nil { + return + } + award = make([]*pb.UserAssets, 0) + for _, v := range conf.Venturereward { + award = append(award, &pb.UserAssets{ + A: v.A, + T: v.T, + N: v.N, + }) + } + dtask.Tasks[req.Id] = 1 + this.module.modelRecharge.Change(session.GetUserId(), map[string]interface{}{ + "tasks": dtask.Tasks, + }) + session.SendMsg(string(this.module.GetType()), "receive", &pb.KFTaskReceiveResp{Id: req.Id, Award: award}) + return +} diff --git a/modules/addrecharge/configure.go b/modules/addrecharge/configure.go new file mode 100644 index 000000000..8b8393171 --- /dev/null +++ b/modules/addrecharge/configure.go @@ -0,0 +1,84 @@ +package addrecharge + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/lego/core" + "go_dreamfactory/modules" + "go_dreamfactory/sys/configure" + cfg "go_dreamfactory/sys/configure/structs" + "sync" +) + +const ( + game_venturegiftstask = "game_venturegiftstask.json" +) + +type configureComp struct { + modules.MCompConfigure + module *AddRecharge + lock sync.RWMutex + tasks map[int32]struct{} + groupTasks map[int32][]*cfg.GameVenturegiftsTaskData //key 条件ID +} + +func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + err = this.MCompConfigure.Init(service, module, comp, options) + this.module = module.(*AddRecharge) + configure.RegisterConfigure(game_venturegiftstask, cfg.NewGameVenturegiftsTask, this.updateconfigure) + return +} + +func (this *configureComp) gettasks() map[int32]struct{} { + this.lock.RLock() + defer this.lock.RUnlock() + return this.tasks +} + +// 更新任务配置表 +func (this *configureComp) updateconfigure() { + var ( + v interface{} + conf *cfg.GameVenturegiftsTask + ok bool + err error + ) + if v, err = this.GetConfigure(game_venturegiftstask); err != nil { + return + } + if conf, ok = v.(*cfg.GameVenturegiftsTask); !ok { + this.module.Error("日常任务配置异常!") + return + } + tasks := make(map[int32]struct{}) + groupTasksConf := make(map[int32][]*cfg.GameVenturegiftsTaskData) + + for _, v := range conf.GetDataList() { + + if _, ok := groupTasksConf[v.Openday]; !ok { + groupTasksConf[v.Openday] = make([]*cfg.GameVenturegiftsTaskData, 0) + } + groupTasksConf[v.Openday] = append(groupTasksConf[v.Openday], v) + tasks[v.Venturetask] = struct{}{} + } + + this.lock.Lock() + this.groupTasks = groupTasksConf + this.tasks = tasks + this.lock.Unlock() +} + +func (this *configureComp) getGameVenturegiftsTask(id int32) (conf *cfg.GameVenturegiftsTaskData, err error) { + var ( + v interface{} + ok bool + ) + if v, err = this.GetConfigure(game_venturegiftstask); err != nil { + return + } + if conf, ok = v.(*cfg.GameVenturegiftsTask).GetDataMap()[id]; !ok { + err = comm.NewNotFoundConfErr(string(this.module.GetType()), game_venturegiftstask, id) + this.module.Errorln(err) + return + } + return +} diff --git a/modules/addrecharge/modelRecharge.go b/modules/addrecharge/modelRecharge.go new file mode 100644 index 000000000..b764f6f9d --- /dev/null +++ b/modules/addrecharge/modelRecharge.go @@ -0,0 +1,47 @@ +package addrecharge + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/mgo" + "go_dreamfactory/modules" + "go_dreamfactory/pb" + + "go.mongodb.org/mongo-driver/bson/primitive" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/x/bsonx" +) + +type ModelRecharge struct { + modules.MCompModel + module *AddRecharge + open bool +} + +func (this *ModelRecharge) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + err = this.MCompModel.Init(service, module, comp, options) + this.TableName = comm.Tablekftask + this.module = module.(*AddRecharge) + this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ + Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}}, + }) + return +} + +// 获取用户全部的埋点数据 +func (this *ModelRecharge) getUserDTasks(uid string) (results *pb.DBKFTask, err error) { + results = &pb.DBKFTask{} + if err = this.Get(uid, results); err != nil && err != mgo.MongodbNil { + this.module.Errorln(err) + return + } + if err == mgo.MongodbNil { + results = &pb.DBKFTask{ + Id: primitive.NewObjectID().Hex(), + Uid: uid, + Tasks: make(map[int32]int32), + } + err = this.Add(uid, results) + } + return +} diff --git a/modules/addrecharge/module.go b/modules/addrecharge/module.go new file mode 100644 index 000000000..9a6e06144 --- /dev/null +++ b/modules/addrecharge/module.go @@ -0,0 +1,65 @@ +package addrecharge + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/lego/core" + "go_dreamfactory/modules" + "go_dreamfactory/pb" +) + +/* +累计充值 +*/ +type AddRecharge struct { + modules.ModuleBase + service core.IService + api *apiComp + configure *configureComp + modelRecharge *ModelRecharge +} + +func NewModule() core.IModule { + return &AddRecharge{} +} + +func (this *AddRecharge) GetType() core.M_Modules { + return comm.ModuleKFTask +} + +func (this *AddRecharge) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { + err = this.ModuleBase.Init(service, module, options) + this.service = service + return +} + +func (this *AddRecharge) Start() (err error) { + err = this.ModuleBase.Start() + + return +} + +func (this *AddRecharge) OnInstallComp() { + this.ModuleBase.OnInstallComp() + this.api = this.RegisterComp(new(apiComp)).(*apiComp) + this.modelRecharge = this.RegisterComp(new(ModelRecharge)).(*ModelRecharge) + this.configure = this.RegisterComp(new(configureComp)).(*configureComp) +} + +// 活动开启 +func (this *AddRecharge) ActivityOpenNotice(hdlist *pb.DBHuodong) { + switch hdlist.Itype { + case comm.AddUpRecharge: + + break + } +} + +// 活动关闭 +func (this *AddRecharge) ActivityCloseNotice(hdlist *pb.DBHuodong) { + +} + +// 充值金额 +func (this *AddRecharge) Recharge(session comm.IUserSession, amount int32) { + +} diff --git a/modules/kftask/module.go b/modules/kftask/module.go index 9e246e249..ba7544b05 100644 --- a/modules/kftask/module.go +++ b/modules/kftask/module.go @@ -44,10 +44,15 @@ func (this *KFTask) OnInstallComp() { } // 活动开启 -func (this *KFTask) ActivityNotice(hdlist *pb.DBHuodong) { +func (this *KFTask) ActivityOpenNotice(hdlist *pb.DBHuodong) { switch hdlist.Itype { case comm.KFSevenTask: this.open = true break } } + +// 活动关闭 +func (this *KFTask) ActivityCloseNotice(hdlist *pb.DBHuodong) { + +} diff --git a/modules/wtask/api_finish.go b/modules/wtask/api_finish.go index 603f83a74..ca8cedc3d 100644 --- a/modules/wtask/api_finish.go +++ b/modules/wtask/api_finish.go @@ -132,28 +132,10 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WTaskFinishReq) ( wtask.Completes = append(wtask.Completes, req.Tid) } - // if conf.Des == 1 && conf.IdAfter != 0 { //日常任务 自动接取下一个 - // if afterconf, err = this.module.configure.gettaskconfconfigure(conf.IdAfter); err != nil { - // errdata = &pb.ErrorData{ - // Code: pb.ErrorCode_ConfigNoFound, - // Title: pb.ErrorCode_ConfigNoFound.ToString(), - // Message: err.Error(), - // } - // return - // } - // if err = this.module.ModuleBuried.ActiveCondition(session.GetUserId(), afterconf.Completetask...); err != nil { - // errdata = &pb.ErrorData{ - // Code: pb.ErrorCode_ExternalModule, - // Title: pb.ErrorCode_ExternalModule.ToString(), - // Message: fmt.Sprintf("ModuleBuried.ActiveCondition uid:%s condiIds:%v", session.GetUserId(), conf.Completetask), - // } - // return - // } - // wtask.Activations = append(wtask.Activations, afterconf.Key) - // if _, errdata = this.module.pushtaskprogress(session, wtask, true); errdata != nil { - // return - // } - // } + if conf.Des == 1 && conf.IdAfter != 0 { //日常任务 自动接取下一个 + wtask.Activations = append(wtask.Activations, conf.IdAfter) + session.SendMsg(string(this.module.GetType()), "activationschange", &pb.WTaskActivationsChangePush{Activations: wtask.Activations}) + } this.module.checkgroupState(session, wtask, conf.Group) session.SendMsg(string(this.module.GetType()), "finish", &pb.WTaskFinishResp{Tid: req.Tid, Award: award, Completes: wtask.Completes, Groups: wtask.Groups}) diff --git a/modules/wtask/module.go b/modules/wtask/module.go index c6b2788cb..fd2c71632 100644 --- a/modules/wtask/module.go +++ b/modules/wtask/module.go @@ -749,7 +749,7 @@ func (this *WTask) inquireActivations(session comm.IUserSession, wtask *pb.DBWTa if _, ok = completeMap[v.Ontxe]; v.Ontxe != 0 && !ok { //前置任务判断 continue } - if v.Des == 5 { //商队任务不主动触发 日常任务直接接取不进入可接取列表中 + if v.Des == 5 || v.Des == 1 { //商队任务不主动触发 日常任务直接接取不进入可接取列表中 continue } wtask.Activations = append(wtask.Activations, v.Key) diff --git a/pb/addrecharge_db.pb.go b/pb/addrecharge_db.pb.go new file mode 100644 index 000000000..7bae7a457 --- /dev/null +++ b/pb/addrecharge_db.pb.go @@ -0,0 +1,179 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.20.0 +// source: addrecharge/addrecharge_db.proto + +package pb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +//累计充值 +type DBAddRecharge struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"` + Activityid string `protobuf:"bytes,3,opt,name=activityid,proto3" json:"activityid"` + Record map[int32]bool `protobuf:"bytes,4,rep,name=record,proto3" json:"record" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` +} + +func (x *DBAddRecharge) Reset() { + *x = DBAddRecharge{} + if protoimpl.UnsafeEnabled { + mi := &file_addrecharge_addrecharge_db_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DBAddRecharge) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DBAddRecharge) ProtoMessage() {} + +func (x *DBAddRecharge) ProtoReflect() protoreflect.Message { + mi := &file_addrecharge_addrecharge_db_proto_msgTypes[0] + 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 DBAddRecharge.ProtoReflect.Descriptor instead. +func (*DBAddRecharge) Descriptor() ([]byte, []int) { + return file_addrecharge_addrecharge_db_proto_rawDescGZIP(), []int{0} +} + +func (x *DBAddRecharge) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *DBAddRecharge) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *DBAddRecharge) GetActivityid() string { + if x != nil { + return x.Activityid + } + return "" +} + +func (x *DBAddRecharge) GetRecord() map[int32]bool { + if x != nil { + return x.Record + } + return nil +} + +var File_addrecharge_addrecharge_db_proto protoreflect.FileDescriptor + +var file_addrecharge_addrecharge_db_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x2f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0xc0, 0x01, 0x0a, 0x0d, 0x44, 0x42, 0x41, 0x64, 0x64, 0x52, 0x65, 0x63, 0x68, + 0x61, 0x72, 0x67, 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, 0x1e, 0x0a, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, + 0x74, 0x79, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x69, 0x74, 0x79, 0x69, 0x64, 0x12, 0x32, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x44, 0x42, 0x41, 0x64, 0x64, 0x52, 0x65, + 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x39, 0x0a, 0x0b, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 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, +} + +var ( + file_addrecharge_addrecharge_db_proto_rawDescOnce sync.Once + file_addrecharge_addrecharge_db_proto_rawDescData = file_addrecharge_addrecharge_db_proto_rawDesc +) + +func file_addrecharge_addrecharge_db_proto_rawDescGZIP() []byte { + file_addrecharge_addrecharge_db_proto_rawDescOnce.Do(func() { + file_addrecharge_addrecharge_db_proto_rawDescData = protoimpl.X.CompressGZIP(file_addrecharge_addrecharge_db_proto_rawDescData) + }) + return file_addrecharge_addrecharge_db_proto_rawDescData +} + +var file_addrecharge_addrecharge_db_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_addrecharge_addrecharge_db_proto_goTypes = []interface{}{ + (*DBAddRecharge)(nil), // 0: DBAddRecharge + nil, // 1: DBAddRecharge.RecordEntry +} +var file_addrecharge_addrecharge_db_proto_depIdxs = []int32{ + 1, // 0: DBAddRecharge.record:type_name -> DBAddRecharge.RecordEntry + 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 + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_addrecharge_addrecharge_db_proto_init() } +func file_addrecharge_addrecharge_db_proto_init() { + if File_addrecharge_addrecharge_db_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_addrecharge_addrecharge_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DBAddRecharge); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_addrecharge_addrecharge_db_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_addrecharge_addrecharge_db_proto_goTypes, + DependencyIndexes: file_addrecharge_addrecharge_db_proto_depIdxs, + MessageInfos: file_addrecharge_addrecharge_db_proto_msgTypes, + }.Build() + File_addrecharge_addrecharge_db_proto = out.File + file_addrecharge_addrecharge_db_proto_rawDesc = nil + file_addrecharge_addrecharge_db_proto_goTypes = nil + file_addrecharge_addrecharge_db_proto_depIdxs = nil +} diff --git a/pb/addrecharge_msg.pb.go b/pb/addrecharge_msg.pb.go new file mode 100644 index 000000000..1cb6b52c1 --- /dev/null +++ b/pb/addrecharge_msg.pb.go @@ -0,0 +1,346 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.20.0 +// source: addrecharge/addrecharge_msg.proto + +package pb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +//开服任务数据 +type AddRechargeInfoReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *AddRechargeInfoReq) Reset() { + *x = AddRechargeInfoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_addrecharge_addrecharge_msg_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddRechargeInfoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddRechargeInfoReq) ProtoMessage() {} + +func (x *AddRechargeInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_addrecharge_addrecharge_msg_proto_msgTypes[0] + 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 AddRechargeInfoReq.ProtoReflect.Descriptor instead. +func (*AddRechargeInfoReq) Descriptor() ([]byte, []int) { + return file_addrecharge_addrecharge_msg_proto_rawDescGZIP(), []int{0} +} + +//开服任务数据 +type AddRechargeInfoResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Record map[int32]bool `protobuf:"bytes,1,rep,name=record,proto3" json:"record" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` +} + +func (x *AddRechargeInfoResp) Reset() { + *x = AddRechargeInfoResp{} + if protoimpl.UnsafeEnabled { + mi := &file_addrecharge_addrecharge_msg_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddRechargeInfoResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddRechargeInfoResp) ProtoMessage() {} + +func (x *AddRechargeInfoResp) ProtoReflect() protoreflect.Message { + mi := &file_addrecharge_addrecharge_msg_proto_msgTypes[1] + 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 AddRechargeInfoResp.ProtoReflect.Descriptor instead. +func (*AddRechargeInfoResp) Descriptor() ([]byte, []int) { + return file_addrecharge_addrecharge_msg_proto_rawDescGZIP(), []int{1} +} + +func (x *AddRechargeInfoResp) GetRecord() map[int32]bool { + if x != nil { + return x.Record + } + return nil +} + +//领奖 请求 +type AddRechargeReceiveReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` +} + +func (x *AddRechargeReceiveReq) Reset() { + *x = AddRechargeReceiveReq{} + if protoimpl.UnsafeEnabled { + mi := &file_addrecharge_addrecharge_msg_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddRechargeReceiveReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddRechargeReceiveReq) ProtoMessage() {} + +func (x *AddRechargeReceiveReq) ProtoReflect() protoreflect.Message { + mi := &file_addrecharge_addrecharge_msg_proto_msgTypes[2] + 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 AddRechargeReceiveReq.ProtoReflect.Descriptor instead. +func (*AddRechargeReceiveReq) Descriptor() ([]byte, []int) { + return file_addrecharge_addrecharge_msg_proto_rawDescGZIP(), []int{2} +} + +func (x *AddRechargeReceiveReq) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +//领奖 请求回应 +type AddRechargeReceiveResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` + Award []*UserAssets `protobuf:"bytes,2,rep,name=award,proto3" json:"award"` //奖励 +} + +func (x *AddRechargeReceiveResp) Reset() { + *x = AddRechargeReceiveResp{} + if protoimpl.UnsafeEnabled { + mi := &file_addrecharge_addrecharge_msg_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddRechargeReceiveResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddRechargeReceiveResp) ProtoMessage() {} + +func (x *AddRechargeReceiveResp) ProtoReflect() protoreflect.Message { + mi := &file_addrecharge_addrecharge_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 AddRechargeReceiveResp.ProtoReflect.Descriptor instead. +func (*AddRechargeReceiveResp) Descriptor() ([]byte, []int) { + return file_addrecharge_addrecharge_msg_proto_rawDescGZIP(), []int{3} +} + +func (x *AddRechargeReceiveResp) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *AddRechargeReceiveResp) GetAward() []*UserAssets { + if x != nil { + return x.Award + } + return nil +} + +var File_addrecharge_addrecharge_msg_proto protoreflect.FileDescriptor + +var file_addrecharge_addrecharge_msg_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x61, 0x64, 0x64, 0x72, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x2f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x14, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x71, 0x22, 0x8a, 0x01, 0x0a, 0x13, 0x41, 0x64, 0x64, 0x52, 0x65, 0x63, + 0x68, 0x61, 0x72, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x38, 0x0a, + 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, + 0x41, 0x64, 0x64, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x73, 0x70, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x39, 0x0a, 0x0b, 0x52, 0x65, 0x63, 0x6f, 0x72, + 0x64, 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, 0x22, 0x27, 0x0a, 0x15, 0x41, 0x64, 0x64, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, + 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x4b, 0x0a, 0x16, 0x41, + 0x64, 0x64, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, + 0x73, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_addrecharge_addrecharge_msg_proto_rawDescOnce sync.Once + file_addrecharge_addrecharge_msg_proto_rawDescData = file_addrecharge_addrecharge_msg_proto_rawDesc +) + +func file_addrecharge_addrecharge_msg_proto_rawDescGZIP() []byte { + file_addrecharge_addrecharge_msg_proto_rawDescOnce.Do(func() { + file_addrecharge_addrecharge_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_addrecharge_addrecharge_msg_proto_rawDescData) + }) + return file_addrecharge_addrecharge_msg_proto_rawDescData +} + +var file_addrecharge_addrecharge_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_addrecharge_addrecharge_msg_proto_goTypes = []interface{}{ + (*AddRechargeInfoReq)(nil), // 0: AddRechargeInfoReq + (*AddRechargeInfoResp)(nil), // 1: AddRechargeInfoResp + (*AddRechargeReceiveReq)(nil), // 2: AddRechargeReceiveReq + (*AddRechargeReceiveResp)(nil), // 3: AddRechargeReceiveResp + nil, // 4: AddRechargeInfoResp.RecordEntry + (*UserAssets)(nil), // 5: UserAssets +} +var file_addrecharge_addrecharge_msg_proto_depIdxs = []int32{ + 4, // 0: AddRechargeInfoResp.record:type_name -> AddRechargeInfoResp.RecordEntry + 5, // 1: AddRechargeReceiveResp.award:type_name -> UserAssets + 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 + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_addrecharge_addrecharge_msg_proto_init() } +func file_addrecharge_addrecharge_msg_proto_init() { + if File_addrecharge_addrecharge_msg_proto != nil { + return + } + file_comm_proto_init() + if !protoimpl.UnsafeEnabled { + file_addrecharge_addrecharge_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddRechargeInfoReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_addrecharge_addrecharge_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddRechargeInfoResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_addrecharge_addrecharge_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddRechargeReceiveReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_addrecharge_addrecharge_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddRechargeReceiveResp); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_addrecharge_addrecharge_msg_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_addrecharge_addrecharge_msg_proto_goTypes, + DependencyIndexes: file_addrecharge_addrecharge_msg_proto_depIdxs, + MessageInfos: file_addrecharge_addrecharge_msg_proto_msgTypes, + }.Build() + File_addrecharge_addrecharge_msg_proto = out.File + file_addrecharge_addrecharge_msg_proto_rawDesc = nil + file_addrecharge_addrecharge_msg_proto_goTypes = nil + file_addrecharge_addrecharge_msg_proto_depIdxs = nil +}