From 25b62c6aa8d427dc665bc80acd3a71a21a4c76f2 Mon Sep 17 00:00:00 2001 From: liwei <2211068034@qq.com> Date: Thu, 20 Jul 2023 17:43:32 +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=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 4 + modules/dailytask/api_Info.go | 69 ++++++++++ modules/dailytask/modelDailytask.go | 9 +- modules/dailytask/module.go | 63 +++++++-- modules/wtask/module.go | 146 ++++++++++++++++++++ pb/dailytask_db.pb.go | 204 +++++++++++++++++++++++----- pb/dailytask_msg.pb.go | 51 ++++--- 7 files changed, 479 insertions(+), 67 deletions(-) create mode 100644 modules/dailytask/api_Info.go diff --git a/comm/imodule.go b/comm/imodule.go index 839185093..de5b0ce43 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -569,6 +569,10 @@ type ( ClearCaravanTask(session IUserSession, task int32) // bingo任务 BingoJumpTask(session IUserSession, rtaskId int32) (errdata *pb.ErrorData) + //重置日常任务 + ResetDailytaskTask(session IUserSession, groupId ...int32) (task map[int32][]int32, errdata *pb.ErrorData) + //查询任务进度 + InquireTaskProgress(session IUserSession, tasks ...int32) (progress []*pb.DBWTaskItem, errdata *pb.ErrorData) } //战令 IWarorder interface { diff --git a/modules/dailytask/api_Info.go b/modules/dailytask/api_Info.go new file mode 100644 index 000000000..bdcbd0c37 --- /dev/null +++ b/modules/dailytask/api_Info.go @@ -0,0 +1,69 @@ +package dailytask + +import ( + "fmt" + "go_dreamfactory/comm" + "go_dreamfactory/pb" +) + +// 参数校验 +func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.DailytaskInfoReq) (errdata *pb.ErrorData) { + + return +} + +// /获取自己的排行榜信息 +func (this *apiComp) Info(session comm.IUserSession, req *pb.DailytaskInfoReq) (errdata *pb.ErrorData) { + var ( + dtask *pb.DBDailytask + tasks []int32 + progress []*pb.DBWTaskItem + progressMap map[int32]*pb.DBWTaskItem = make(map[int32]*pb.DBWTaskItem) + TaskProgress []*pb.DBDailytaskGroupProgress + ok bool + err error + ) + if errdata = this.InfoCheck(session, req); errdata != nil { + return + } + + if dtask, err = this.module.modelDailytask.getUserDTasks(session.GetUserId()); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + Message: err.Error(), + } + return + } + + for _, v := range dtask.Groups { + tasks = append(tasks, v.Tasks...) + } + + if progress, errdata = this.module.wtask.InquireTaskProgress(session, tasks...); err != nil { + return + } + for _, v := range progress { + progressMap[v.Tid] = v + } + + TaskProgress = make([]*pb.DBDailytaskGroupProgress, 0) + for _, v := range dtask.Groups { + pg := &pb.DBDailytaskGroupProgress{Group: v.Group, Tasks: make([]*pb.DBWTaskItem, 0)} + for _, v := range v.Tasks { + if _, ok = progressMap[v]; ok { + pg.Tasks = append(pg.Tasks, progressMap[v]) + } else { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + Message: fmt.Sprintf("on found task:%d", v), + } + return + } + } + TaskProgress = append(TaskProgress, pg) + } + session.SendMsg(string(this.module.GetType()), "info", &pb.DailytaskInfoResp{Task: TaskProgress}) + return +} diff --git a/modules/dailytask/modelDailytask.go b/modules/dailytask/modelDailytask.go index fad5a72f8..6eeb0babf 100644 --- a/modules/dailytask/modelDailytask.go +++ b/modules/dailytask/modelDailytask.go @@ -36,12 +36,11 @@ func (this *ModelDailytask) getUserDTasks(uid string) (results *pb.DBDailytask, return } if err == mgo.MongodbNil { - err = nil results = &pb.DBDailytask{ - Id: primitive.NewObjectID().Hex(), - Uid: uid, - Groups: make([]int32, 0), - Complete: make([]int32, 0), + Id: primitive.NewObjectID().Hex(), + Uid: uid, + Groups: make([]*pb.DBDailytaskGroup, 0), + Rtime: 0, } err = this.Add(uid, results) } diff --git a/modules/dailytask/module.go b/modules/dailytask/module.go index cdb6fc33a..36c6d563f 100644 --- a/modules/dailytask/module.go +++ b/modules/dailytask/module.go @@ -4,15 +4,17 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/lego/core" "go_dreamfactory/lego/sys/event" + "go_dreamfactory/lego/sys/log" "go_dreamfactory/modules" + "go_dreamfactory/pb" + "go_dreamfactory/sys/configure" + "go_dreamfactory/utils" ) type Dailytask struct { modules.ModuleBase service core.IService - caravan comm.ICaravan - battle comm.IBattle - sys comm.ISys + wtask comm.IWtask api *apiComp configure *configureComp modelDailytask *ModelDailytask @@ -35,19 +37,10 @@ func (this *Dailytask) Init(service core.IService, module core.IModule, options func (this *Dailytask) Start() (err error) { err = this.ModuleBase.Start() var module core.IModule - if module, err = this.service.GetModule(comm.ModuleBattle); err != nil { + if module, err = this.service.GetModule(comm.ModuleWtask); err != nil { return } - this.battle = module.(comm.IBattle) - if module, err = this.service.GetModule(comm.ModuleSys); err != nil { - return - } - this.sys = module.(comm.ISys) - if module, err = this.service.GetModule(comm.ModuleCaravan); err != nil { - return - } - this.caravan = module.(comm.ICaravan) - + this.wtask = module.(comm.IWtask) event.RegisterGO(comm.EventUserLogin, this.EventUserLogin) return } @@ -62,5 +55,47 @@ func (this *Dailytask) OnInstallComp() { // 用户登录 func (this *Dailytask) EventUserLogin(session comm.IUserSession) { + var ( + dtask *pb.DBDailytask + user *pb.DBUser + errdata *pb.ErrorData + group []int32 + tasks map[int32][]int32 + err error + ) + if dtask, err = this.modelDailytask.getUserDTasks(session.GetUserId()); err != nil { + this.Errorln(err) + return + } + + if !utils.IsToday(dtask.Rtime) { //不是同一天 重置 + if user = this.ModuleUser.GetUser(session.GetUserId()); user == nil { + this.Error("no found user", log.Field{Key: "uid", Value: session.GetUserId()}) + return + } + if group, err = this.modelDailytask.resetUserDTasks(user.Lv); err != nil { + this.Errorln(err) + return + } + if tasks, errdata = this.wtask.ResetDailytaskTask(session.Clone(), group...); errdata != nil { + this.Errorln(errdata) + return + } + dtask.Groups = make([]*pb.DBDailytaskGroup, 0) + for k, v := range tasks { + dtask.Groups = append(dtask.Groups, &pb.DBDailytaskGroup{ + Group: k, + Tasks: v, + }) + } + dtask.Rtime = configure.Now().Unix() + if err = this.modelDailytask.Change(session.GetUserId(), map[string]interface{}{ + "groups": dtask.Groups, + "rtime": dtask.Rtime, + }); err != nil { + this.Errorln(err) + return + } + } } diff --git a/modules/wtask/module.go b/modules/wtask/module.go index ba6ded846..06dd7a819 100644 --- a/modules/wtask/module.go +++ b/modules/wtask/module.go @@ -252,6 +252,152 @@ func (this *WTask) AcceptCaravanTask(session comm.IUserSession, groupId int32) ( return } +// 重置日常任务 +func (this *WTask) ResetDailytaskTask(session comm.IUserSession, groupId ...int32) (results map[int32][]int32, errdata *pb.ErrorData) { + var ( + alltasks map[int32]*cfg.GameWorldTaskData = make(map[int32]*cfg.GameWorldTaskData) + groupTasks map[int32][]*cfg.GameWorldTaskData + tasks []*cfg.GameWorldTaskData + wtask *pb.DBWTask + activations []int32 = make([]int32, 0) + accepts []int32 = make([]int32, 0) + completes []int32 = make([]int32, 0) + err error + ok bool + ) + results = make(map[int32][]int32) + for _, v := range this.configure.getdesTask(1) { + alltasks[v.Key] = v + } + + if wtask, err = this.modelwtask.getUserWTasks(session.GetUserId()); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + Message: err.Error(), + } + return + } + //移除之前的日常任务 + for _, v := range wtask.Activations { + if _, ok = alltasks[v]; !ok { + activations = append(activations, v) + } + } + for _, v := range wtask.Accepts { + if _, ok = alltasks[v]; !ok { + accepts = append(accepts, v) + } + } + for _, v := range wtask.Completes { + if _, ok = alltasks[v]; !ok { + completes = append(completes, v) + } + } + + //添加新的日常任务 + groupTasks = this.configure.getgroupTask() + for _, v := range groupId { + if tasks, ok = groupTasks[v]; !ok { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ConfigNoFound, + Title: pb.ErrorCode_ConfigNoFound.String(), + Message: fmt.Sprintf("no found group:%d", v), + } + return + } + for _, task := range tasks { + if task.Ontxe == 0 { + accepts = append(accepts, task.Key) + if _, ok = results[v]; !ok { + results[v] = make([]int32, 0) + } + results[v] = append(results[v], task.Key) + } + } + + } + wtask.Activations = activations + wtask.Accepts = accepts + wtask.Completes = completes + //有新任务接取 + this.pushtaskprogress(session, wtask, true) + if err = this.modelwtask.updateUserWTasks(session.GetUserId(), wtask); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + Message: err.Error(), + } + return + } + return +} + +// 查询日常任务进度 +func (this *WTask) InquireTaskProgress(session comm.IUserSession, tasks ...int32) (progress []*pb.DBWTaskItem, errdata *pb.ErrorData) { + var ( + checkcondlsMap map[int32]struct{} = make(map[int32]struct{}) + checkcondls []int32 = make([]int32, 0) + conf *cfg.GameWorldTaskData + condis []*pb.ConIProgress = make([]*pb.ConIProgress, 0) + condisMap map[int32]*pb.ConIProgress = make(map[int32]*pb.ConIProgress) + err error + ok bool + ) + + for _, v := range tasks { + if conf, err = this.configure.gettaskconfconfigure(v); err != nil { + this.Errorln(err) + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ConfigNoFound, + Title: pb.ErrorCode_ConfigNoFound.ToString(), + Message: err.Error(), + } + return + } + for _, v := range conf.Completetask { + if _, ok = checkcondlsMap[v]; !ok { + checkcondlsMap[v] = struct{}{} + checkcondls = append(checkcondls, v) + } + } + } + if len(checkcondls) > 0 { + if condis, err = this.ModuleBuried.CheckCondition(session.GetUserId(), checkcondls...); err != nil { + this.Error("校验玩家子任务进度数据 失败", log.Field{Key: "err", Value: err.Error()}) + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ExternalModule, + Title: pb.ErrorCode_ExternalModule.ToString(), + Message: fmt.Sprintf("ModuleBuried.CheckCondition Error:%s", err.Error()), + } + return + } + for _, v := range condis { + condisMap[v.Conid] = v + } + } + + for _, v := range tasks { + if conf, err = this.configure.gettaskconfconfigure(v); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ConfigNoFound, + Title: pb.ErrorCode_ConfigNoFound.ToString(), + Message: err.Error(), + } + return + } + task := &pb.DBWTaskItem{ + Tid: v, + Conlds: make([]*pb.ConIProgress, len(conf.Completetask)), + } + for i, v := range conf.Completetask { + task.Conlds[i] = condisMap[v] + } + progress = append(progress, task) + } + return +} + // 清除商队任务 func (this *WTask) ClearCaravanTask(session comm.IUserSession, task int32) { var ( diff --git a/pb/dailytask_db.pb.go b/pb/dailytask_db.pb.go index b3b549f24..5e3687764 100644 --- a/pb/dailytask_db.pb.go +++ b/pb/dailytask_db.pb.go @@ -26,11 +26,10 @@ type DBDailytask struct { 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"` - Groups []int32 `protobuf:"varint,3,rep,packed,name=groups,proto3" json:"groups"` - Complete []int32 `protobuf:"varint,4,rep,packed,name=complete,proto3" json:"complete"` - Rtime int64 `protobuf:"varint,5,opt,name=rtime,proto3" json:"rtime"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"` + Groups []*DBDailytaskGroup `protobuf:"bytes,3,rep,name=groups,proto3" json:"groups"` + Rtime int64 `protobuf:"varint,4,opt,name=rtime,proto3" json:"rtime"` } func (x *DBDailytask) Reset() { @@ -79,20 +78,13 @@ func (x *DBDailytask) GetUid() string { return "" } -func (x *DBDailytask) GetGroups() []int32 { +func (x *DBDailytask) GetGroups() []*DBDailytaskGroup { if x != nil { return x.Groups } return nil } -func (x *DBDailytask) GetComplete() []int32 { - if x != nil { - return x.Complete - } - return nil -} - func (x *DBDailytask) GetRtime() int64 { if x != nil { return x.Rtime @@ -100,20 +92,140 @@ func (x *DBDailytask) GetRtime() int64 { return 0 } +type DBDailytaskGroup struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Group int32 `protobuf:"varint,3,opt,name=group,proto3" json:"group"` + Tasks []int32 `protobuf:"varint,2,rep,packed,name=tasks,proto3" json:"tasks"` +} + +func (x *DBDailytaskGroup) Reset() { + *x = DBDailytaskGroup{} + if protoimpl.UnsafeEnabled { + mi := &file_dailytask_dailytask_db_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DBDailytaskGroup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DBDailytaskGroup) ProtoMessage() {} + +func (x *DBDailytaskGroup) ProtoReflect() protoreflect.Message { + mi := &file_dailytask_dailytask_db_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 DBDailytaskGroup.ProtoReflect.Descriptor instead. +func (*DBDailytaskGroup) Descriptor() ([]byte, []int) { + return file_dailytask_dailytask_db_proto_rawDescGZIP(), []int{1} +} + +func (x *DBDailytaskGroup) GetGroup() int32 { + if x != nil { + return x.Group + } + return 0 +} + +func (x *DBDailytaskGroup) GetTasks() []int32 { + if x != nil { + return x.Tasks + } + return nil +} + +type DBDailytaskGroupProgress struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Group int32 `protobuf:"varint,3,opt,name=group,proto3" json:"group"` + Tasks []*DBWTaskItem `protobuf:"bytes,2,rep,name=tasks,proto3" json:"tasks"` +} + +func (x *DBDailytaskGroupProgress) Reset() { + *x = DBDailytaskGroupProgress{} + if protoimpl.UnsafeEnabled { + mi := &file_dailytask_dailytask_db_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DBDailytaskGroupProgress) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DBDailytaskGroupProgress) ProtoMessage() {} + +func (x *DBDailytaskGroupProgress) ProtoReflect() protoreflect.Message { + mi := &file_dailytask_dailytask_db_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 DBDailytaskGroupProgress.ProtoReflect.Descriptor instead. +func (*DBDailytaskGroupProgress) Descriptor() ([]byte, []int) { + return file_dailytask_dailytask_db_proto_rawDescGZIP(), []int{2} +} + +func (x *DBDailytaskGroupProgress) GetGroup() int32 { + if x != nil { + return x.Group + } + return 0 +} + +func (x *DBDailytaskGroupProgress) GetTasks() []*DBWTaskItem { + if x != nil { + return x.Tasks + } + return nil +} + var File_dailytask_dailytask_db_proto protoreflect.FileDescriptor var file_dailytask_dailytask_db_proto_rawDesc = []byte{ 0x0a, 0x1c, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x64, 0x61, 0x69, 0x6c, - 0x79, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x79, - 0x0a, 0x0b, 0x44, 0x42, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x74, 0x61, 0x73, 0x6b, 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, - 0x16, 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, - 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6c, - 0x65, 0x74, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6c, - 0x65, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, + 0x77, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x64, 0x62, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x70, 0x0a, 0x0b, 0x44, 0x42, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x74, + 0x61, 0x73, 0x6b, 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, 0x29, 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x44, 0x42, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x74, + 0x61, 0x73, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, + 0x12, 0x14, 0x0a, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x3e, 0x0a, 0x10, 0x44, 0x42, 0x44, 0x61, 0x69, 0x6c, + 0x79, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, + 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x22, 0x54, 0x0a, 0x18, 0x44, 0x42, 0x44, 0x61, 0x69, 0x6c, + 0x79, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x22, 0x0a, 0x05, 0x74, 0x61, 0x73, 0x6b, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x44, 0x42, 0x57, 0x54, 0x61, 0x73, + 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x42, 0x06, 0x5a, 0x04, + 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -128,16 +240,21 @@ func file_dailytask_dailytask_db_proto_rawDescGZIP() []byte { return file_dailytask_dailytask_db_proto_rawDescData } -var file_dailytask_dailytask_db_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_dailytask_dailytask_db_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_dailytask_dailytask_db_proto_goTypes = []interface{}{ - (*DBDailytask)(nil), // 0: DBDailytask + (*DBDailytask)(nil), // 0: DBDailytask + (*DBDailytaskGroup)(nil), // 1: DBDailytaskGroup + (*DBDailytaskGroupProgress)(nil), // 2: DBDailytaskGroupProgress + (*DBWTaskItem)(nil), // 3: DBWTaskItem } var file_dailytask_dailytask_db_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 1, // 0: DBDailytask.groups:type_name -> DBDailytaskGroup + 3, // 1: DBDailytaskGroupProgress.tasks:type_name -> DBWTaskItem + 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_dailytask_dailytask_db_proto_init() } @@ -145,6 +262,7 @@ func file_dailytask_dailytask_db_proto_init() { if File_dailytask_dailytask_db_proto != nil { return } + file_wtask_wtask_db_proto_init() if !protoimpl.UnsafeEnabled { file_dailytask_dailytask_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DBDailytask); i { @@ -158,6 +276,30 @@ func file_dailytask_dailytask_db_proto_init() { return nil } } + file_dailytask_dailytask_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DBDailytaskGroup); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_dailytask_dailytask_db_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DBDailytaskGroupProgress); 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{ @@ -165,7 +307,7 @@ func file_dailytask_dailytask_db_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_dailytask_dailytask_db_proto_rawDesc, NumEnums: 0, - NumMessages: 1, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/dailytask_msg.pb.go b/pb/dailytask_msg.pb.go index f795dea45..9f3bb3824 100644 --- a/pb/dailytask_msg.pb.go +++ b/pb/dailytask_msg.pb.go @@ -64,6 +64,8 @@ type DailytaskInfoResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Task []*DBDailytaskGroupProgress `protobuf:"bytes,1,rep,name=task,proto3" json:"task"` } func (x *DailytaskInfoResp) Reset() { @@ -98,6 +100,13 @@ func (*DailytaskInfoResp) Descriptor() ([]byte, []int) { return file_dailytask_dailytask_msg_proto_rawDescGZIP(), []int{1} } +func (x *DailytaskInfoResp) GetTask() []*DBDailytaskGroupProgress { + if x != nil { + return x.Task + } + return nil +} + //日常任务 领奖请求 type DailytaskReceiveReq struct { state protoimpl.MessageState @@ -180,14 +189,19 @@ var File_dailytask_dailytask_msg_proto protoreflect.FileDescriptor var file_dailytask_dailytask_msg_proto_rawDesc = []byte{ 0x0a, 0x1d, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x64, 0x61, 0x69, 0x6c, - 0x79, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x12, 0x0a, 0x10, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x65, 0x71, 0x22, 0x13, 0x0a, 0x11, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x74, 0x61, 0x73, 0x6b, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x22, 0x15, 0x0a, 0x13, 0x44, 0x61, 0x69, 0x6c, - 0x79, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x22, - 0x16, 0x0a, 0x14, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x65, - 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1c, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x64, 0x61, 0x69, 0x6c, 0x79, + 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x12, 0x0a, + 0x10, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x71, 0x22, 0x42, 0x0a, 0x11, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x74, 0x61, + 0x73, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, + 0x04, 0x74, 0x61, 0x73, 0x6b, 0x22, 0x15, 0x0a, 0x13, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x74, 0x61, + 0x73, 0x6b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x22, 0x16, 0x0a, 0x14, + 0x44, 0x61, 0x69, 0x6c, 0x79, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -204,17 +218,19 @@ func file_dailytask_dailytask_msg_proto_rawDescGZIP() []byte { var file_dailytask_dailytask_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_dailytask_dailytask_msg_proto_goTypes = []interface{}{ - (*DailytaskInfoReq)(nil), // 0: DailytaskInfoReq - (*DailytaskInfoResp)(nil), // 1: DailytaskInfoResp - (*DailytaskReceiveReq)(nil), // 2: DailytaskReceiveReq - (*DailytaskReceiveResp)(nil), // 3: DailytaskReceiveResp + (*DailytaskInfoReq)(nil), // 0: DailytaskInfoReq + (*DailytaskInfoResp)(nil), // 1: DailytaskInfoResp + (*DailytaskReceiveReq)(nil), // 2: DailytaskReceiveReq + (*DailytaskReceiveResp)(nil), // 3: DailytaskReceiveResp + (*DBDailytaskGroupProgress)(nil), // 4: DBDailytaskGroupProgress } var file_dailytask_dailytask_msg_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 4, // 0: DailytaskInfoResp.task:type_name -> DBDailytaskGroupProgress + 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_dailytask_dailytask_msg_proto_init() } @@ -222,6 +238,7 @@ func file_dailytask_dailytask_msg_proto_init() { if File_dailytask_dailytask_msg_proto != nil { return } + file_dailytask_dailytask_db_proto_init() if !protoimpl.UnsafeEnabled { file_dailytask_dailytask_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DailytaskInfoReq); i {