成长任务

This commit is contained in:
wh_zcy 2022-11-07 16:41:11 +08:00
parent 0a384e53c8
commit 0354363b1e
6 changed files with 326 additions and 103 deletions

View File

@ -20,7 +20,7 @@ import (
type GrowtaskListView struct { type GrowtaskListView struct {
BaseformView BaseformView
taskList func() taskList func(taskType int32)
itemList *common.ItemList itemList *common.ItemList
flag bool flag bool
} }
@ -29,21 +29,67 @@ func (this *GrowtaskListView) CreateView(t *model.TestCase) fyne.CanvasObject {
this.itemList = common.NewItemList() this.itemList = common.NewItemList()
this.itemList.ItemList = this.itemList.CreateList() this.itemList.ItemList = this.itemList.CreateList()
this.taskList = func() { this.taskList = func(taskType int32) {
if err := service.GetPttService().SendToClient( if err := service.GetPttService().SendToClient(
string(comm.ModuleGrowtask), string(comm.ModuleGrowtask),
growtask.GrowtaskSubTypeList, growtask.GrowtaskSubTypeList,
&pb.GrowtaskListReq{}); err != nil { &pb.GrowtaskListReq{
TaskType: taskType,
}); err != nil {
logrus.Error(err) logrus.Error(err)
} }
} }
defer this.taskList() defer this.taskList(1)
refreshBtn := widget.NewButtonWithIcon("", theme.ViewRefreshIcon(), func() { refreshBtn := widget.NewButtonWithIcon("", theme.ViewRefreshIcon(), func() {
this.itemList.Reset() this.itemList.Reset()
this.taskList() this.taskList(1)
}) })
buttonBar := container.NewHBox(refreshBtn) selTaskType := widget.NewSelect([]string{"初级", "中级", "高级"}, func(s string) {
switch s {
case "初级":
this.itemList.Reset()
this.taskList(1)
case "中级":
this.itemList.Reset()
this.taskList(2)
case "高级":
this.itemList.Reset()
this.taskList(3)
}
})
selTaskType.Selected = "初级"
//领取
receiveBtn := widget.NewButton("领取", func() {
sel := this.itemList.SelItemId
if this.itemList.SelItemId == "" {
common.ShowTip("请选择项目")
return
}
if err := service.GetPttService().SendToClient(
string(comm.ModuleGrowtask),
growtask.GrowtaskSubTypeReceive,
&pb.GrowtaskReceiveReq{
TaskId: cast.ToInt32(sel),
}); err != nil {
logrus.Error(err)
}
})
// 进阶领取
advReceiveBtn := widget.NewButton("进阶领奖", func() {
if err := service.GetPttService().SendToClient(
string(comm.ModuleGrowtask),
growtask.GrowtaskSubTypeAdvreceive,
&pb.GrowtaskAdvReceiveReq{
TaskType: 1,
}); err != nil {
logrus.Error(err)
}
})
buttonBar := container.NewHBox(refreshBtn, selTaskType, receiveBtn, advReceiveBtn)
c := container.NewBorder(buttonBar, nil, nil, nil, this.itemList.ItemList) c := container.NewBorder(buttonBar, nil, nil, nil, this.itemList.ItemList)

View File

@ -22,23 +22,53 @@ func (this *apiComp) Advreceive(session comm.IUserSession, req *pb.GrowtaskAdvRe
} }
uid := session.GetUserId() uid := session.GetUserId()
if err := this.module.modelGrowtask.advReceive(uid, req.TaskType); err != nil { gt, err := this.module.modelGrowtask.getUserGrowtask(uid)
if err != nil {
code = pb.ErrorCode_DBError
return
}
if gt.Uid == "" {
return
}
// 当前进阶奖励是否已领取
if gt.AdvReceive == req.TaskType {
code = pb.ErrorCode_GrowtaskAdvReceive code = pb.ErrorCode_GrowtaskAdvReceive
return return
} }
// 当前进阶任务是否都完成
ok := this.module.modelGrowtask.isAllFinish(gt, req.TaskType)
if !ok {
code = pb.ErrorCode_GrowtaskAdvReceive
return
}
// 初始下一级任务数据
lv := gt.CurTaskType + 1
this.module.modelGrowtask.initGrowtask(uid, lv)
//发奖 //发奖
ggt, err := this.module.configure.getGrowrewardCfg() rewardCnf, err := this.module.configure.getGrowrewardCfg()
if err != nil { if err != nil {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
return return
} }
if ggt == nil { if rewardCnf == nil {
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
return return
} }
if conf, ok := ggt.GetDataMap()[req.TaskType]; ok { //更新领奖状态
update := map[string]interface{}{
"advReceive": req.TaskType,
}
if err := this.module.modelGrowtask.Change(uid, update); err != nil {
code = pb.ErrorCode_DBError
return
}
if conf, ok := rewardCnf.GetDataMap()[req.TaskType]; ok {
if code := this.module.DispenseRes(session, conf.Allreward, true); code != pb.ErrorCode_Success { if code := this.module.DispenseRes(session, conf.Allreward, true); code != pb.ErrorCode_Success {
this.module.Errorf("进阶奖励发放失败 taskType:%v uid:%v", req.TaskType, uid) this.module.Errorf("进阶奖励发放失败 taskType:%v uid:%v", req.TaskType, uid)
} }

View File

@ -10,13 +10,16 @@ import (
// 成长任务列表 // 成长任务列表
func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.GrowtaskListReq) (code pb.ErrorCode) { func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.GrowtaskListReq) (code pb.ErrorCode) {
if req.TaskType == 0 {
code = pb.ErrorCode_ReqParameterError
}
return return
} }
func (this *apiComp) List(session comm.IUserSession, req *pb.GrowtaskListReq) (code pb.ErrorCode, data proto.Message) { func (this *apiComp) List(session comm.IUserSession, req *pb.GrowtaskListReq) (code pb.ErrorCode, data proto.Message) {
uid := session.GetUserId() uid := session.GetUserId()
g := this.module.modelGrowtask.list(uid) g := this.module.modelGrowtask.list(uid, req.TaskType)
rsp := &pb.GrowtaskListResp{ rsp := &pb.GrowtaskListResp{
TaskList: g, TaskList: g,
} }

View File

@ -24,7 +24,7 @@ func (this *ModelGrowtask) Init(service core.IService, module core.IModule, comp
} }
// 初始化成长任务 // 初始化成长任务
func (this *ModelGrowtask) initGrowtask(uid string) (*pb.DBGrowtask, error) { func (this *ModelGrowtask) initGrowtask(uid string, taskType int32) (*pb.DBGrowtask, error) {
ggt, err := this.moduleGrowtask.configure.getGrowtaskCfg() ggt, err := this.moduleGrowtask.configure.getGrowtaskCfg()
if err != nil { if err != nil {
return nil, err return nil, err
@ -36,18 +36,31 @@ func (this *ModelGrowtask) initGrowtask(uid string) (*pb.DBGrowtask, error) {
data := &pb.DBGrowtask{ data := &pb.DBGrowtask{
Uid: uid, Uid: uid,
} }
update := map[string]interface{}{}
for _, v := range ggt.GetDataList() { for _, v := range ggt.GetDataList() {
if v.Type == 1 { //初级任务 默认状态:锁定 if taskType == v.Type {
task := &pb.Growtask{ task := &pb.Growtask{
Id: v.Id, Id: v.Id,
TaskType: v.Type, TaskType: v.Type,
Fstask: v.Fstask, Fstask: v.Fstask,
PreTask: v.Onetask, PreTask: v.Onetask,
} }
data.TaskList = append(data.TaskList, task) if v.Type == taskType && taskType == 1 { //默认状态:锁定
data.InitTaskList = append(data.InitTaskList, task)
} else if v.Type == taskType && taskType == 2 {
data.MidTaskList = append(data.MidTaskList, task)
} else if v.Type == taskType && taskType == 3 {
data.HighTaskList = append(data.HighTaskList, task)
}
} }
} }
if err = this.Add(uid, data); err != nil {
update["curTaskType"] = taskType
update["initTaskList"] = data.InitTaskList
update["midTaskList"] = data.MidTaskList
update["highTaskList"] = data.HighTaskList
if err = this.Change(uid, update); err != nil {
return nil, err return nil, err
} }
return data, nil return data, nil
@ -58,7 +71,7 @@ func (this *ModelGrowtask) getUserGrowtask(uid string) (*pb.DBGrowtask, error) {
gt := &pb.DBGrowtask{} gt := &pb.DBGrowtask{}
if err := this.Get(uid, gt); err != nil { if err := this.Get(uid, gt); err != nil {
if err == mongo.ErrNoDocuments { if err == mongo.ErrNoDocuments {
return this.initGrowtask(uid) return this.initGrowtask(uid, 1) //从初级任务开始初始
} }
return nil, err return nil, err
} }
@ -66,16 +79,19 @@ func (this *ModelGrowtask) getUserGrowtask(uid string) (*pb.DBGrowtask, error) {
} }
// 任务列表 // 任务列表
func (this *ModelGrowtask) list(uid string) []*pb.Growtask { func (this *ModelGrowtask) list(uid string, taskType int32) []*pb.Growtask {
gt, err := this.getUserGrowtask(uid) gt, err := this.getUserGrowtask(uid)
if err != nil { if err != nil {
return nil return nil
} }
if gt.Uid != "" { var curList []*pb.Growtask
getList := func(list []*pb.Growtask) []*pb.Growtask {
taskStatusMap := make(map[int32]pb.GrowtaskStatus) //任务状态 taskStatusMap := make(map[int32]pb.GrowtaskStatus) //任务状态
for _, v := range gt.TaskList { for _, v := range list {
//已完成 //已完成
if v.Status == pb.GrowtaskStatus_Finish { if v.Status == pb.GrowtaskStatus_Finish {
taskStatusMap[v.Id] = pb.GrowtaskStatus_Finish
continue continue
} }
taskStatusMap[v.Id] = v.Status taskStatusMap[v.Id] = v.Status
@ -88,6 +104,8 @@ func (this *ModelGrowtask) list(uid string) []*pb.Growtask {
// 上个任务是领取状态 // 上个任务是领取状态
if s == pb.GrowtaskStatus_Wait { if s == pb.GrowtaskStatus_Wait {
continue continue
} else if s == pb.GrowtaskStatus_Finish {
v.Status = pb.GrowtaskStatus_Wait //待领状态
} }
} }
} }
@ -105,17 +123,33 @@ func (this *ModelGrowtask) list(uid string) []*pb.Growtask {
} }
} }
} }
return list
} }
//更新 if gt.Uid != "" {
update := map[string]interface{}{ update := map[string]interface{}{}
"taskList": gt.TaskList, switch taskType {
case 1:
curList = getList(gt.InitTaskList)
update["initTaskList"] = curList
case 2:
curList = getList(gt.MidTaskList)
update["midTaskList"] = curList
case 3:
curList = getList(gt.HighTaskList)
update["highTaskList"] = curList
}
//更新
if len(update) > 0 {
if err := this.Change(uid, update); err != nil {
log.Errorf("更新任务列表 err:%v", err)
return nil
}
}
} }
if err := this.Change(uid, update); err != nil {
log.Errorf("更新任务列表 err:%v", err) return curList
return nil
}
return gt.TaskList
} }
// 领取子任务奖励 // 领取子任务奖励
@ -124,39 +158,94 @@ func (this *ModelGrowtask) receive(uid string, taskId int32) error {
if err != nil { if err != nil {
return err return err
} }
for _, v := range gt.TaskList {
if v.Id == taskId { switch gt.CurTaskType {
if v.Status == pb.GrowtaskStatus_Wait { case 1:
v.Status = pb.GrowtaskStatus_Finish for _, v := range gt.InitTaskList {
} else { if v.Id == taskId {
return errors.New("不能领取") if v.Status == pb.GrowtaskStatus_Wait {
v.Status = pb.GrowtaskStatus_Finish
} else {
return errors.New("不能领取")
}
break
} }
break }
//更新
update := map[string]interface{}{
"initTaskList": gt.InitTaskList,
}
if err := this.Change(uid, update); err != nil {
log.Errorf("更新任务列表 err:%v", err)
return err
}
case 2:
for _, v := range gt.MidTaskList {
if v.Id == taskId {
if v.Status == pb.GrowtaskStatus_Wait {
v.Status = pb.GrowtaskStatus_Finish
} else {
return errors.New("不能领取")
}
break
}
}
//更新
update := map[string]interface{}{
"midTaskList": gt.MidTaskList,
}
if err := this.Change(uid, update); err != nil {
log.Errorf("更新任务列表 err:%v", err)
return err
}
case 3:
for _, v := range gt.HighTaskList {
if v.Id == taskId {
if v.Status == pb.GrowtaskStatus_Wait {
v.Status = pb.GrowtaskStatus_Finish
} else {
return errors.New("不能领取")
}
break
}
}
//更新
update := map[string]interface{}{
"highTaskList": gt.HighTaskList,
}
if err := this.Change(uid, update); err != nil {
log.Errorf("更新任务列表 err:%v", err)
return err
} }
} }
//更新
update := map[string]interface{}{
"taskList": gt.TaskList,
}
if err := this.Change(uid, update); err != nil {
log.Errorf("更新任务列表 err:%v", err)
return err
}
return nil return nil
} }
// 进阶奖励领取 // 当前进阶是否全部完成
func (this *ModelGrowtask) advReceive(uid string, taskType int32) error { func (this *ModelGrowtask) isAllFinish(gt *pb.DBGrowtask, taskType int32) bool {
gt, err := this.getUserGrowtask(uid) switch taskType {
if err != nil { case 1:
return err for _, v := range gt.InitTaskList {
} if v.Status != pb.GrowtaskStatus_Finish {
//判断当前等级的任务是否都完成 return false
for _, v := range gt.TaskList { }
if v.Status != pb.GrowtaskStatus_Finish {
return errors.New("任务未全部完成")
} }
case 2:
for _, v := range gt.MidTaskList {
if v.Status != pb.GrowtaskStatus_Finish {
return false
}
}
case 3:
for _, v := range gt.HighTaskList {
if v.Status != pb.GrowtaskStatus_Finish {
return false
}
}
default:
return false
} }
return nil
return true
} }

View File

@ -78,8 +78,12 @@ type DBGrowtask struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID
TaskList []*Growtask `protobuf:"bytes,2,rep,name=taskList,proto3" json:"taskList" bson:"taskList"` //任务列表 InitTaskList []*Growtask `protobuf:"bytes,2,rep,name=initTaskList,proto3" json:"initTaskList" bson:"initTaskList"` //初级任务列表
MidTaskList []*Growtask `protobuf:"bytes,3,rep,name=midTaskList,proto3" json:"midTaskList" bson:"midTaskList"` //中级任务列表
HighTaskList []*Growtask `protobuf:"bytes,4,rep,name=highTaskList,proto3" json:"highTaskList" bson:"highTaskList"` //高级任务列表
CurTaskType int32 `protobuf:"varint,5,opt,name=curTaskType,proto3" json:"curTaskType" bson:"curTaskType"` //进行中的任务类型
AdvReceive int32 `protobuf:"varint,6,opt,name=advReceive,proto3" json:"advReceive" bson:"advReceive"` //已领取的进阶奖励ID
} }
func (x *DBGrowtask) Reset() { func (x *DBGrowtask) Reset() {
@ -121,13 +125,41 @@ func (x *DBGrowtask) GetUid() string {
return "" return ""
} }
func (x *DBGrowtask) GetTaskList() []*Growtask { func (x *DBGrowtask) GetInitTaskList() []*Growtask {
if x != nil { if x != nil {
return x.TaskList return x.InitTaskList
} }
return nil return nil
} }
func (x *DBGrowtask) GetMidTaskList() []*Growtask {
if x != nil {
return x.MidTaskList
}
return nil
}
func (x *DBGrowtask) GetHighTaskList() []*Growtask {
if x != nil {
return x.HighTaskList
}
return nil
}
func (x *DBGrowtask) GetCurTaskType() int32 {
if x != nil {
return x.CurTaskType
}
return 0
}
func (x *DBGrowtask) GetAdvReceive() int32 {
if x != nil {
return x.AdvReceive
}
return 0
}
type Growtask struct { type Growtask struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -211,26 +243,36 @@ var File_growtask_growtask_db_proto protoreflect.FileDescriptor
var file_growtask_growtask_db_proto_rawDesc = []byte{ var file_growtask_growtask_db_proto_rawDesc = []byte{
0x0a, 0x1a, 0x67, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x67, 0x72, 0x6f, 0x77, 0x74, 0x0a, 0x1a, 0x67, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x67, 0x72, 0x6f, 0x77, 0x74,
0x61, 0x73, 0x6b, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x45, 0x0a, 0x0a, 0x61, 0x73, 0x6b, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xeb, 0x01, 0x0a,
0x44, 0x42, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x0a, 0x44, 0x42, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x75,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x08, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x2d, 0x0a,
0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20,
0x2e, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x0c,
0x69, 0x73, 0x74, 0x22, 0x91, 0x01, 0x0a, 0x08, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x69, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x0b,
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x6d, 0x69, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28,
0x12, 0x1a, 0x0a, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x0b, 0x32, 0x09, 0x2e, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x0b, 0x6d, 0x69,
0x28, 0x05, 0x52, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x27, 0x0a, 0x06, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x0c, 0x68, 0x69, 0x67,
0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x47, 0x68, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x09, 0x2e, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x0c, 0x68, 0x69, 0x67, 0x68,
0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x73, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x75, 0x72, 0x54,
0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x73, 0x74, 0x61, 0x73, 0x6b, 0x12, 0x18, 0x0a, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63,
0x07, 0x70, 0x72, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x75, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x64,
0x70, 0x72, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x2a, 0x3d, 0x0a, 0x0e, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x76, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a,
0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x6f, 0x63, 0x61, 0x64, 0x76, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x22, 0x91, 0x01, 0x0a, 0x08, 0x47,
0x6b, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x4f, 0x6e, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x10, 0x01, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
0x12, 0x08, 0x0a, 0x04, 0x57, 0x61, 0x69, 0x74, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x69, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x54,
0x6e, 0x69, 0x73, 0x68, 0x10, 0x03, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x54,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x79, 0x70, 0x65, 0x12, 0x27, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20,
0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x74,
0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06,
0x66, 0x73, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x73,
0x74, 0x61, 0x73, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x18,
0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x72, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x2a, 0x3d,
0x0a, 0x0e, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
0x12, 0x08, 0x0a, 0x04, 0x4c, 0x6f, 0x63, 0x6b, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x4f, 0x6e,
0x67, 0x6f, 0x69, 0x6e, 0x67, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x57, 0x61, 0x69, 0x74, 0x10,
0x02, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x10, 0x03, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -253,13 +295,15 @@ var file_growtask_growtask_db_proto_goTypes = []interface{}{
(*Growtask)(nil), // 2: Growtask (*Growtask)(nil), // 2: Growtask
} }
var file_growtask_growtask_db_proto_depIdxs = []int32{ var file_growtask_growtask_db_proto_depIdxs = []int32{
2, // 0: DBGrowtask.taskList:type_name -> Growtask 2, // 0: DBGrowtask.initTaskList:type_name -> Growtask
0, // 1: Growtask.status:type_name -> GrowtaskStatus 2, // 1: DBGrowtask.midTaskList:type_name -> Growtask
2, // [2:2] is the sub-list for method output_type 2, // 2: DBGrowtask.highTaskList:type_name -> Growtask
2, // [2:2] is the sub-list for method input_type 0, // 3: Growtask.status:type_name -> GrowtaskStatus
2, // [2:2] is the sub-list for extension type_name 4, // [4:4] is the sub-list for method output_type
2, // [2:2] is the sub-list for extension extendee 4, // [4:4] is the sub-list for method input_type
0, // [0:2] is the sub-list for field type_name 4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
} }
func init() { file_growtask_growtask_db_proto_init() } func init() { file_growtask_growtask_db_proto_init() }

View File

@ -25,6 +25,8 @@ type GrowtaskListReq struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
TaskType int32 `protobuf:"varint,1,opt,name=taskType,proto3" json:"taskType"` //任务类型1初级2中级3高级
} }
func (x *GrowtaskListReq) Reset() { func (x *GrowtaskListReq) Reset() {
@ -59,6 +61,13 @@ func (*GrowtaskListReq) Descriptor() ([]byte, []int) {
return file_growtask_growtask_msg_proto_rawDescGZIP(), []int{0} return file_growtask_growtask_msg_proto_rawDescGZIP(), []int{0}
} }
func (x *GrowtaskListReq) GetTaskType() int32 {
if x != nil {
return x.TaskType
}
return 0
}
type GrowtaskListResp struct { type GrowtaskListResp struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -302,25 +311,27 @@ var file_growtask_growtask_msg_proto_rawDesc = []byte{
0x0a, 0x1b, 0x67, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x67, 0x72, 0x6f, 0x77, 0x74, 0x0a, 0x1b, 0x67, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x67, 0x72, 0x6f, 0x77, 0x74,
0x61, 0x73, 0x6b, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x67, 0x61, 0x73, 0x6b, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x67,
0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x67, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x67, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b,
0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x11, 0x0a, 0x0f, 0x47, 0x72, 0x6f, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2d, 0x0a, 0x0f, 0x47, 0x72, 0x6f,
0x77, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x39, 0x0a, 0x10, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08,
0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08,
0x12, 0x25, 0x0a, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x22, 0x39, 0x0a, 0x10, 0x47, 0x72, 0x6f, 0x77,
0x28, 0x0b, 0x32, 0x09, 0x2e, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x08, 0x74, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x08,
0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x2c, 0x0a, 0x12, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x74, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09,
0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x2e, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x4c,
0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x69, 0x73, 0x74, 0x22, 0x2c, 0x0a, 0x12, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x52,
0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x2d, 0x0a, 0x13, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73,
0x6b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49,
0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x64, 0x22, 0x2d, 0x0a, 0x13, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63,
0x73, 0x6b, 0x49, 0x64, 0x22, 0x33, 0x0a, 0x15, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b,
0x41, 0x64, 0x76, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64,
0x08, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x22, 0x33, 0x0a, 0x15, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73, 0x6b, 0x41, 0x64, 0x76, 0x52,
0x08, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x22, 0x34, 0x0a, 0x16, 0x47, 0x72, 0x6f, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x61, 0x73,
0x77, 0x74, 0x61, 0x73, 0x6b, 0x41, 0x64, 0x76, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x74, 0x61, 0x73,
0x65, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x22, 0x34, 0x0a, 0x16, 0x47, 0x72, 0x6f, 0x77, 0x74, 0x61, 0x73,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x42, 0x6b, 0x41, 0x64, 0x76, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12,
0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x1a, 0x0a, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x05, 0x52, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e,
0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (