任务优化提交
This commit is contained in:
parent
96cd327d87
commit
9acb59b119
@ -57,7 +57,7 @@ func (this *TaskActiveListView) CreateView(t *model.TestCase) fyne.CanvasObject
|
||||
}
|
||||
if err := service.GetPttService().SendToClient(
|
||||
t.MainType, "activereceive",
|
||||
&pb.TaskActiveReceiveReq{Id: selItemId, TaskTag: cast.ToInt32(tagSelect.Selected)}); err != nil {
|
||||
&pb.TaskActiveReceiveReq{Id: cast.ToInt32(selItemId), TaskTag: cast.ToInt32(tagSelect.Selected)}); err != nil {
|
||||
logrus.Error(err)
|
||||
return
|
||||
}
|
||||
@ -94,8 +94,8 @@ func (this *TaskActiveListView) dataListener() {
|
||||
|
||||
for _, v := range rsp.List {
|
||||
item := common.Item{
|
||||
Id: cast.ToString(v.Id),
|
||||
Text: fmt.Sprintf("任务ID:%s 领取状态:%d", cast.ToString(v.RId), v.Received),
|
||||
Id: cast.ToString(v.TaskId),
|
||||
Text: fmt.Sprintf("任务ID:%s 领取状态:%d", cast.ToString(v.TaskId), v.Received),
|
||||
}
|
||||
this.itemList.AddItem(item)
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ func (this *TaskActiveReceiveView) CreateView(t *model.TestCase) fyne.CanvasObje
|
||||
|
||||
this.form.OnSubmit = func() {
|
||||
if err := service.GetPttService().SendToClient(t.MainType, t.SubType, &pb.TaskActiveReceiveReq{
|
||||
Id: id.Text,
|
||||
Id: cast.ToInt32(id.Text),
|
||||
TaskTag: cast.ToInt32(tagSelect.Selected),
|
||||
}); err != nil {
|
||||
logrus.Error(err)
|
||||
|
@ -54,7 +54,7 @@ func (this *TaskListView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
}
|
||||
if err := service.GetPttService().SendToClient(
|
||||
t.MainType, "receive",
|
||||
&pb.TaskReceiveReq{Id: selId, TaskTag: cast.ToInt32(tagSelect.Selected)}); err != nil {
|
||||
&pb.TaskReceiveReq{Id: cast.ToInt32(selId), TaskTag: cast.ToInt32(tagSelect.Selected)}); err != nil {
|
||||
logrus.Error(err)
|
||||
return
|
||||
}
|
||||
@ -90,7 +90,7 @@ func (this *TaskListView) dataListener() {
|
||||
|
||||
for _, v := range rsp.List {
|
||||
item := common.Item{
|
||||
Id: cast.ToString(v.Id),
|
||||
Id: cast.ToString(v.TaskId),
|
||||
Text: fmt.Sprintf("%s 是否完成:%d 是否领奖:%d 进度:%d", cast.ToString(v.TaskId), v.Status, v.Received, v.Progress),
|
||||
}
|
||||
this.itemList.AddItem(item)
|
||||
|
@ -153,9 +153,9 @@ type (
|
||||
// 清理玩家任务数据
|
||||
CleanData(uid string)
|
||||
// 获取当前任务
|
||||
GetTaskById(uid string, taskId int32) *pb.DBTask
|
||||
// 获取已完成的任务列表
|
||||
GetTaskFinished(uid string, taskType TaskTag) []*pb.DBTask
|
||||
GetTaskById(uid string, taskTag, taskId int32) *pb.TaskData
|
||||
// 获取已完成的日任务列表
|
||||
GetTaskDayFinished(uid string) []*pb.TaskData
|
||||
///红点
|
||||
IReddot
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ func hasUpdateData(len int, data *pb.RtaskData, vals ...int32) map[int32]int32 {
|
||||
}
|
||||
|
||||
func printCondiLog(uid string, cfg *cfg.GameRdtaskCondiData) {
|
||||
log.Infof("uid:%v condiId:%v rtype:%v", uid, cfg.Id, cfg.Type)
|
||||
log.Debugf("uid:%v condiId:%v rtype:%v", uid, cfg.Id, cfg.Type)
|
||||
}
|
||||
|
||||
type Num interface {
|
||||
|
@ -142,7 +142,7 @@ func (this *ModelRtask) verifyRtype3(uid string, cfg *cfg.GameRdtaskCondiData) (
|
||||
}
|
||||
|
||||
if ml, y := m.(comm.ITask); y {
|
||||
for _, task := range ml.GetTaskFinished(uid, comm.TASK_DAILY) {
|
||||
for _, task := range ml.GetTaskDayFinished(uid) {
|
||||
if task.TaskId >= cfg.Data1 {
|
||||
ok = true
|
||||
break
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
|
||||
//活跃度领取
|
||||
func (this *apiComp) ActiveReceiveCheck(session comm.IUserSession, req *pb.TaskActiveReceiveReq) (code pb.ErrorCode) {
|
||||
if req.Id == "" {
|
||||
if req.Id == 0 {
|
||||
code = pb.ErrorCode_TaskIdEmpty
|
||||
} else if req.TaskTag <= 0 || req.TaskTag > 2 {
|
||||
code = pb.ErrorCode_TaskTagEmpty
|
||||
@ -25,17 +25,6 @@ func (this *apiComp) ActiveReceive(session comm.IUserSession, req *pb.TaskActive
|
||||
}
|
||||
uid := session.GetUserId()
|
||||
|
||||
// ua := this.moduleTask.modelTaskActive.getUserActive(uid, req.Id, comm.TaskTag(req.TaskTag))
|
||||
// if ua == nil {
|
||||
// code = pb.ErrorCode_TaskActiveNofound
|
||||
// return
|
||||
// }
|
||||
|
||||
//判断是否已领取
|
||||
// if ua.Received == 1 {
|
||||
// code = pb.ErrorCode_TaskReceived
|
||||
// return
|
||||
// }
|
||||
ue, err := this.moduleTask.ModuleUser.GetUserExpand(uid)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
@ -49,39 +38,47 @@ func (this *apiComp) ActiveReceive(session comm.IUserSession, req *pb.TaskActive
|
||||
var rewards []*cfg.Gameatn
|
||||
// 玩家的
|
||||
activeList := this.moduleTask.modelTaskActive.getActiveListByTag(uid, comm.TaskTag(req.TaskTag))
|
||||
var activityData *pb.ActivityData
|
||||
for _, v := range activeList {
|
||||
if v.Received != 1 { //未领取
|
||||
conf := this.moduleTask.configure.getTaskActiveById(v.RId)
|
||||
if conf == nil {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
if v.TaskId == req.Id {
|
||||
activityData = v
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if activityData == nil {
|
||||
code = pb.ErrorCode_TaskNotFound
|
||||
return
|
||||
}
|
||||
|
||||
if activityData.Received != 1 { //未领取
|
||||
conf := this.moduleTask.configure.getTaskActiveById(activityData.TaskId)
|
||||
if conf == nil {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
|
||||
update := make(map[string]interface{})
|
||||
if req.TaskTag == int32(comm.TASK_DAILY) {
|
||||
if ue.Activeday < conf.Active {
|
||||
code = pb.ErrorCode_TaskActiveNoenough
|
||||
return
|
||||
}
|
||||
|
||||
// get user expand
|
||||
|
||||
update := make(map[string]interface{})
|
||||
if req.TaskTag == int32(comm.TASK_DAILY) {
|
||||
if ue.Activeday < conf.Active {
|
||||
continue
|
||||
}
|
||||
} else if req.TaskTag == int32(comm.TASK_WEEKLY) {
|
||||
if ue.Activeweek < conf.Active {
|
||||
continue
|
||||
}
|
||||
} else if req.TaskTag == int32(comm.TASK_WEEKLY) {
|
||||
if ue.Activeweek < conf.Active {
|
||||
code = pb.ErrorCode_TaskActiveNoenough
|
||||
return
|
||||
}
|
||||
update["received"] = 1
|
||||
if len(update) > 0 {
|
||||
if err := this.moduleTask.modelTaskActive.updateReceive(session.GetUserId(),
|
||||
v.Id,
|
||||
comm.TaskTag(req.TaskTag),
|
||||
update); err != nil {
|
||||
this.moduleTask.Errorf("updateReceive err %v", err)
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
}
|
||||
rewards = append(rewards, conf.Reword...)
|
||||
}
|
||||
update["received"] = 1
|
||||
if len(update) > 0 {
|
||||
if err := this.moduleTask.modelTaskActive.updateReceive(session.GetUserId(), update); err != nil {
|
||||
this.moduleTask.Errorf("updateReceive err %v", err)
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
}
|
||||
rewards = append(rewards, conf.Reword...)
|
||||
}
|
||||
|
||||
if len(rewards) > 0 {
|
||||
|
@ -30,7 +30,19 @@ func (this *apiComp) List(session comm.IUserSession, req *pb.TaskListReq) (code
|
||||
}
|
||||
}()
|
||||
|
||||
rsp.List = this.moduleTask.modelTask.getTaskListByTag(session.GetUserId(), comm.TaskTag(req.TaskTag))
|
||||
task := this.moduleTask.modelTask.getTaskListByTag(session.GetUserId(), comm.TaskTag(req.TaskTag))
|
||||
if task == nil {
|
||||
code = pb.ErrorCode_TaskNotFound
|
||||
return
|
||||
}
|
||||
|
||||
switch req.TaskTag {
|
||||
case int32(comm.TASK_DAILY):
|
||||
rsp.List = task.DayList
|
||||
case int32(comm.TASK_WEEKLY):
|
||||
rsp.List = task.WeekList
|
||||
case int32(comm.TASK_ACHIEVE):
|
||||
rsp.List = task.AchieveList
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
//任务奖励领取
|
||||
|
||||
func (this *apiComp) ReceiveCheck(session comm.IUserSession, req *pb.TaskReceiveReq) (code pb.ErrorCode) {
|
||||
if req.Id == "" {
|
||||
if req.Id == 0 {
|
||||
code = pb.ErrorCode_TaskIdEmpty
|
||||
} else if req.TaskTag == 0 {
|
||||
code = pb.ErrorCode_TaskTagEmpty
|
||||
@ -32,19 +32,38 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.TaskReceiveReq)
|
||||
return
|
||||
}
|
||||
|
||||
var taskDataList []*pb.TaskData
|
||||
|
||||
switch req.TaskTag {
|
||||
case int32(comm.TASK_DAILY):
|
||||
taskDataList = userTask.DayList
|
||||
case int32(comm.TASK_WEEKLY):
|
||||
taskDataList = userTask.WeekList
|
||||
case int32(comm.TASK_ACHIEVE):
|
||||
taskDataList = userTask.AchieveList
|
||||
}
|
||||
|
||||
resp := &pb.TaskReceiveResp{}
|
||||
var taskData *pb.TaskData
|
||||
for _, v := range taskDataList {
|
||||
if v.TaskId == req.Id {
|
||||
taskData = v
|
||||
}
|
||||
}
|
||||
|
||||
//判断是否完成
|
||||
if userTask.Status == 0 {
|
||||
if taskData.Status == 0 {
|
||||
code = pb.ErrorCode_TaskNoFinished
|
||||
return
|
||||
}
|
||||
//判断任务是否领取
|
||||
if userTask.Received == 1 {
|
||||
if taskData.Received == 1 {
|
||||
code = pb.ErrorCode_TaskReceived
|
||||
return
|
||||
}
|
||||
|
||||
// 待领取的任务配置
|
||||
conf := this.moduleTask.configure.getTaskById(userTask.TaskId)
|
||||
conf := this.moduleTask.configure.getTaskById(taskData.TaskId)
|
||||
if conf == nil {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
@ -88,14 +107,11 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.TaskReceiveReq)
|
||||
update := map[string]interface{}{
|
||||
"received": 1,
|
||||
}
|
||||
if err := this.moduleTask.modelTask.modifyUserTask(session.GetUserId(), userTask.Id, update); err != nil {
|
||||
if err := this.moduleTask.modelTask.modifyUserTask(session.GetUserId(), taskData.TaskId, update); err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
|
||||
resp := &pb.TaskReceiveResp{
|
||||
TaskId: userTask.TaskId,
|
||||
}
|
||||
resp.TaskId = taskData.TaskId
|
||||
|
||||
err := session.SendMsg(string(this.moduleTask.GetType()), TaskSubTypeReceive, resp)
|
||||
if err != nil {
|
||||
|
@ -1,39 +0,0 @@
|
||||
package task
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
//卡牌攻略
|
||||
func (this *apiComp) StrategyCheck(session comm.IUserSession, req *pb.TaskDoStrategyReq) (code pb.ErrorCode) {
|
||||
if req.HeroCfgId == 0 {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
//进入卡牌攻略
|
||||
func (this *apiComp) Strategy(session comm.IUserSession, req *pb.TaskDoStrategyReq) (code pb.ErrorCode, data proto.Message) {
|
||||
if code = this.StrategyCheck(session, req); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
|
||||
resp := &pb.TaskDoStrategyResp{}
|
||||
|
||||
taskIds, err := this.moduleTask.modelTask.inStrategy(session.GetUserId(), req.HeroCfgId)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
return
|
||||
}
|
||||
|
||||
resp.TaskIds = taskIds
|
||||
|
||||
err = session.SendMsg(string(this.moduleTask.GetType()), TaskSubTypeStrategy, resp)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
}
|
||||
return
|
||||
}
|
@ -29,32 +29,48 @@ func (this *ModelTaskActive) Init(service core.IService, module core.IModule, co
|
||||
|
||||
//初始化活跃度
|
||||
func (this *ModelTaskActive) initActiveReward(uid string, taskTag comm.TaskTag) {
|
||||
task := &pb.DBActivity{}
|
||||
if err := this.Get(uid, task); err != nil {
|
||||
if err == mongo.ErrNoDocuments {
|
||||
objId := primitive.NewObjectID().Hex()
|
||||
task = &pb.DBActivity{
|
||||
Uid: uid,
|
||||
Id: objId,
|
||||
}
|
||||
this.moduleTask.modelTaskActive.Add(uid, task)
|
||||
} else {
|
||||
this.moduleTask.Errorf("getTaskList err %v", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
data := this.moduleTask.configure.getTaskActiveByTag(int32(taskTag))
|
||||
|
||||
for _, conf := range data {
|
||||
objId := primitive.NewObjectID().Hex()
|
||||
ta := &pb.DBTaskActive{
|
||||
Id: objId,
|
||||
Uid: uid,
|
||||
Tag: int32(taskTag),
|
||||
RId: conf.Key,
|
||||
}
|
||||
if err := this.moduleTask.modelTaskActive.AddList(uid, ta.Id, ta); err != nil {
|
||||
this.moduleTask.Errorf("uid:%v tag:%v initActiv add err %v", uid, err)
|
||||
return
|
||||
ta := &pb.ActivityData{
|
||||
Tag: int32(taskTag),
|
||||
TaskId: conf.Key,
|
||||
}
|
||||
task.ActivityList = append(task.ActivityList, ta)
|
||||
}
|
||||
update := map[string]interface{}{
|
||||
"activityList": task.ActivityList,
|
||||
}
|
||||
if err := this.moduleTask.modelTaskActive.Change(uid, update); err != nil {
|
||||
this.moduleTask.Errorf("uid:%v tag:%v initActivity err %v", uid, err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
//获取玩家活跃度列表
|
||||
func (this *ModelTaskActive) getActiveListByTag(uid string, taskTag comm.TaskTag) (list []*pb.DBTaskActive) {
|
||||
al := []*pb.DBTaskActive{}
|
||||
if err := this.GetList(uid, &al); err != nil {
|
||||
this.moduleTask.Errorf("getUserActiveList err:%v", err)
|
||||
return al
|
||||
func (this *ModelTaskActive) getActiveListByTag(uid string, taskTag comm.TaskTag) (list []*pb.ActivityData) {
|
||||
task := &pb.DBActivity{}
|
||||
if err := this.Get(uid, task); err != nil {
|
||||
this.moduleTask.Errorf("getTaskList err %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
for _, v := range al {
|
||||
for _, v := range task.ActivityList {
|
||||
if v.Tag == int32(taskTag) {
|
||||
list = append(list, v)
|
||||
}
|
||||
@ -65,12 +81,13 @@ func (this *ModelTaskActive) getActiveListByTag(uid string, taskTag comm.TaskTag
|
||||
|
||||
// 查询完成的且未领取的任务 发现未领取返回true
|
||||
func (this *ModelTaskActive) noReceiveTaskActive(uid string, taskTag comm.TaskTag) (bool, error) {
|
||||
list := []*pb.DBTaskActive{}
|
||||
if err := this.GetList(uid, &list); err != nil {
|
||||
this.moduleTask.Errorf("getUserActiveList err:%v", err)
|
||||
task := &pb.DBActivity{}
|
||||
if err := this.Get(uid, task); err != nil {
|
||||
this.moduleTask.Errorf("getTaskActivityList err %v", err)
|
||||
return false, err
|
||||
}
|
||||
for _, v := range list {
|
||||
|
||||
for _, v := range task.ActivityList {
|
||||
if v.Tag == int32(taskTag) && v.Received == 0 {
|
||||
return true, nil
|
||||
}
|
||||
@ -79,21 +96,21 @@ func (this *ModelTaskActive) noReceiveTaskActive(uid string, taskTag comm.TaskTa
|
||||
}
|
||||
|
||||
//获取玩家活跃记录 id 唯一ID
|
||||
func (this *ModelTaskActive) getUserActive(uid, id string, taskTag comm.TaskTag) *pb.DBTaskActive {
|
||||
func (this *ModelTaskActive) getUserActive(uid string, taskId int32, taskTag comm.TaskTag) *pb.ActivityData {
|
||||
record := this.getActiveListByTag(uid, taskTag)
|
||||
for _, v := range record {
|
||||
if v.Id == id {
|
||||
if v.TaskId == taskId {
|
||||
return v
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (this *ModelTaskActive) updateReceive(uid, id string, taskTag comm.TaskTag, data map[string]interface{}) (err error) {
|
||||
func (this *ModelTaskActive) updateReceive(uid string, data map[string]interface{}) (err error) {
|
||||
if len(data) == 0 {
|
||||
return
|
||||
}
|
||||
return this.moduleTask.modelTaskActive.ChangeList(uid, id, data)
|
||||
return this.moduleTask.modelTaskActive.Change(uid, data)
|
||||
}
|
||||
|
||||
//清空活跃度任务
|
||||
@ -103,10 +120,17 @@ func (this *ModelTaskActive) clearTask(uid string, taskTag ...comm.TaskTag) {
|
||||
return
|
||||
}
|
||||
data := this.getActiveListByTag(uid, taskTag[0])
|
||||
for _, v := range data {
|
||||
if err := this.moduleTask.modelTaskActive.DelListlds(uid, v.Id); err != nil {
|
||||
this.moduleTask.Errorf("uid: %v err:%v", uid, err)
|
||||
return
|
||||
for i, v := range data {
|
||||
if v.Tag == int32(taskTag[0]) {
|
||||
data = append(data[:i], data[i+1:]...)
|
||||
}
|
||||
}
|
||||
update := map[string]interface{}{
|
||||
"activityList": data,
|
||||
}
|
||||
if err := this.moduleTask.modelTaskActive.Change(uid, update); err != nil {
|
||||
this.moduleTask.Errorf("uid: %v err:%v", uid, err)
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -36,53 +36,74 @@ func (this *ModelTask) Init(service core.IService, module core.IModule, comp cor
|
||||
|
||||
// 查询完成的且未领取的任务 发现未领取返回true
|
||||
func (this *ModelTask) noReceiveTask(uid string, taskTag comm.TaskTag) (bool, error) {
|
||||
var task *pb.DBTask
|
||||
if err := this.GetList(uid, &task); err != nil {
|
||||
task := &pb.DBTask{}
|
||||
if err := this.Get(uid, task); err != nil {
|
||||
this.moduleTask.Errorf("getTaskList err %v", err)
|
||||
return false, err
|
||||
}
|
||||
for _, v := range task.List {
|
||||
if v.Tag == int32(taskTag) && v.Status == 1 && v.Received == 0 {
|
||||
return true, nil
|
||||
if taskTag == comm.TASK_DAILY {
|
||||
for _, v := range task.DayList {
|
||||
if v.Status == 1 && v.Received == 0 {
|
||||
return true, nil
|
||||
}
|
||||
}
|
||||
} else if taskTag == comm.TASK_WEEKLY {
|
||||
for _, v := range task.WeekList {
|
||||
if v.Status == 1 && v.Received == 0 {
|
||||
return true, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
|
||||
//获取玩家任务列表
|
||||
func (this *ModelTask) getTaskListByTag(uid string, taskTag comm.TaskTag) (newlist []*pb.DBTask) {
|
||||
var task *pb.DBTask
|
||||
if err := this.GetList(uid, &task); err != nil {
|
||||
func (this *ModelTask) getTaskListByTag(uid string, taskTag comm.TaskTag) *pb.DBTask {
|
||||
task := &pb.DBTask{}
|
||||
if err := this.Get(uid, task); err != nil {
|
||||
this.moduleTask.Errorf("getTaskList err %v", err)
|
||||
return
|
||||
return nil
|
||||
}
|
||||
|
||||
if task == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
// 排序
|
||||
sort.SliceStable(task.List, func(i, j int) bool {
|
||||
return task.List[i].Sort < task.List[j].Sort
|
||||
sort.SliceStable(task.DayList, func(i, j int) bool {
|
||||
return task.DayList[i].Sort < task.DayList[j].Sort
|
||||
})
|
||||
sort.SliceStable(task.WeekList, func(i, j int) bool {
|
||||
return task.WeekList[i].Sort < task.WeekList[j].Sort
|
||||
})
|
||||
|
||||
dr := this.moduleTask.ModuleRtask.GetCondiData(uid)
|
||||
if dr == nil {
|
||||
return
|
||||
return nil
|
||||
}
|
||||
|
||||
// 筛选出指定tag的任务
|
||||
var taskList []*pb.TaskData
|
||||
for _, v := range task.List {
|
||||
if task.Tag == int32(taskTag) {
|
||||
if taskTag == comm.TASK_DAILY {
|
||||
for _, v := range task.DayList {
|
||||
if p, ok := dr.Vals[v.TypeId]; ok {
|
||||
if len(p.Data) > 0 {
|
||||
v.Progress = p.Data[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if taskTag == comm.TASK_WEEKLY {
|
||||
for _, v := range task.WeekList {
|
||||
if p, ok := dr.Vals[v.TypeId]; ok {
|
||||
if len(p.Data) > 0 {
|
||||
v.Progress = p.Data[0]
|
||||
}
|
||||
}
|
||||
taskList = append(taskList, v)
|
||||
}
|
||||
}
|
||||
|
||||
// 当前玩家任务
|
||||
getCurTask := func(taskId int32) *pb.DBTask {
|
||||
for _, v := range list {
|
||||
// 当前玩家成就任务
|
||||
getCurTask := func(taskId int32) *pb.TaskData {
|
||||
for _, v := range task.AchieveList {
|
||||
if v.TaskId == taskId {
|
||||
return v
|
||||
}
|
||||
@ -103,117 +124,183 @@ func (this *ModelTask) getTaskListByTag(uid string, taskTag comm.TaskTag) (newli
|
||||
}
|
||||
|
||||
// 成就列表
|
||||
var achieveList []*pb.TaskData
|
||||
if taskTag == comm.TASK_ACHIEVE {
|
||||
for _, v := range taskList {
|
||||
for _, v := range task.AchieveList {
|
||||
if curTask := this.moduleTask.configure.getTaskById(v.TaskId); curTask != nil {
|
||||
if v.Received == 0 {
|
||||
isFirst := this.moduleTask.configure.isFirstTask(curTask.Key)
|
||||
if curTask.IdAfter == 0 && isFirst { //未领取和没有下个连续任务的
|
||||
newlist = append(newlist, v)
|
||||
achieveList = append(achieveList, v)
|
||||
continue
|
||||
}
|
||||
|
||||
if isFirst && curTask.IdAfter != 0 { //连续任务的第一个任务
|
||||
next := this.moduleTask.configure.getTaskById(curTask.IdAfter)
|
||||
if next != nil && v.Received == 0 {
|
||||
newlist = append(newlist, v)
|
||||
achieveList = append(achieveList, v)
|
||||
}
|
||||
} else {
|
||||
if isReceived(curTask.Key) {
|
||||
newlist = append(newlist, v)
|
||||
achieveList = append(achieveList, v)
|
||||
}
|
||||
// else {
|
||||
// break
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
newlist = taskList
|
||||
task.AchieveList = achieveList
|
||||
}
|
||||
return
|
||||
|
||||
return task
|
||||
}
|
||||
|
||||
// 获取用户任务
|
||||
func (this *ModelTask) getTaskById(uid string, taskId int32) (newlist []*pb.DBTask) {
|
||||
list := []*pb.DBTask{}
|
||||
if err := this.GetList(uid, &list); err != nil {
|
||||
func (this *ModelTask) getTaskById(uid string, taskTag comm.TaskTag, taskId int32) *pb.DBTask {
|
||||
task := &pb.DBTask{}
|
||||
if err := this.Get(uid, task); err != nil {
|
||||
this.moduleTask.Errorf("getTaskById err %v", err)
|
||||
return
|
||||
return nil
|
||||
}
|
||||
|
||||
for _, v := range list {
|
||||
if v.TaskId == taskId {
|
||||
newlist = append(newlist, v)
|
||||
if task != nil {
|
||||
if taskTag == comm.TASK_DAILY {
|
||||
for _, v := range task.DayList {
|
||||
if v.TaskId == taskId {
|
||||
task.DayList = append(task.DayList, v)
|
||||
}
|
||||
}
|
||||
} else if taskTag == comm.TASK_WEEKLY {
|
||||
for _, v := range task.WeekList {
|
||||
if v.TaskId == taskId {
|
||||
task.WeekList = append(task.WeekList, v)
|
||||
}
|
||||
}
|
||||
} else if taskTag == comm.TASK_ACHIEVE {
|
||||
for _, v := range task.AchieveList {
|
||||
if v.TaskId == taskId {
|
||||
task.AchieveList = append(task.AchieveList, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
|
||||
return task
|
||||
}
|
||||
|
||||
//初始化任务
|
||||
func (this *ModelTask) initTask(uid string, taskTag comm.TaskTag) error {
|
||||
data := this.moduleTask.configure.getTaskByTag(int32(taskTag))
|
||||
objId := primitive.NewObjectID().Hex()
|
||||
task := &pb.DBTask{
|
||||
Uid: uid,
|
||||
Id: objId,
|
||||
task := &pb.DBTask{}
|
||||
if err := this.Get(uid, task); err != nil {
|
||||
if err == mongo.ErrNoDocuments {
|
||||
objId := primitive.NewObjectID().Hex()
|
||||
task = &pb.DBTask{
|
||||
Uid: uid,
|
||||
Id: objId,
|
||||
}
|
||||
if err := this.Add(uid, task); err != nil {
|
||||
this.moduleTask.Errorf("initTask addlists err %v", err)
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
this.moduleTask.Errorf("getTaskList err %v", err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
data := this.moduleTask.configure.getTaskByTag(int32(taskTag))
|
||||
update := map[string]interface{}{}
|
||||
for _, cnf := range data {
|
||||
task.List = append(task.List, &pb.TaskData{
|
||||
Tag: cnf.IdTag,
|
||||
t := &pb.TaskData{
|
||||
Tag: cnf.IdTag,
|
||||
TypeId: cnf.TypeId,
|
||||
TaskId: cnf.Key,
|
||||
Active: cnf.Active,
|
||||
Sort: cnf.IdList,
|
||||
})
|
||||
}
|
||||
if taskTag == comm.TASK_DAILY {
|
||||
task.DayList = append(task.DayList, t)
|
||||
update["dayList"] = task.DayList
|
||||
} else if taskTag == comm.TASK_WEEKLY {
|
||||
task.WeekList = append(task.WeekList, t)
|
||||
update["weekList"] = task.WeekList
|
||||
} else if taskTag == comm.TASK_ACHIEVE {
|
||||
task.AchieveList = append(task.AchieveList, t)
|
||||
update["achieveList"] = task.AchieveList
|
||||
}
|
||||
}
|
||||
|
||||
if err := this.AddList(uid, task.Id, task); err != nil {
|
||||
this.moduleTask.Errorf("initTask addlists err %v", err)
|
||||
if err := this.Change(uid, update); err != nil {
|
||||
this.moduleTask.Errorf("initTask err %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
//查询用户任务
|
||||
func (this *ModelTask) getUserTask(uid string, taskId string) *pb.DBTask {
|
||||
userTask := &pb.DBTask{}
|
||||
if err := this.moduleTask.modelTask.GetListObj(uid, taskId, userTask); err != nil {
|
||||
this.moduleTask.Errorf("getUserTask err:%v", err)
|
||||
func (this *ModelTask) getUserTask(uid string, taskId int32) *pb.DBTask {
|
||||
task := &pb.DBTask{}
|
||||
if err := this.Get(uid, task); err != nil {
|
||||
this.moduleTask.Errorf("getTaskList err %v", err)
|
||||
return nil
|
||||
}
|
||||
return userTask
|
||||
return task
|
||||
}
|
||||
|
||||
// 获取已完成的任务
|
||||
func (this *ModelTask) getFinishTasks(uid string, taskTag comm.TaskTag) (list []*pb.DBTask) {
|
||||
taskList := this.getTaskListByTag(uid, taskTag)
|
||||
for _, v := range taskList {
|
||||
if v.Status == 1 {
|
||||
list = append(list, v)
|
||||
// 获取已完成的(日、周)任务
|
||||
func (this *ModelTask) getFinishTasks(uid string, taskTag comm.TaskTag) (list []*pb.TaskData) {
|
||||
task := this.getTaskListByTag(uid, taskTag)
|
||||
if taskTag == comm.TASK_DAILY {
|
||||
for _, v := range task.DayList {
|
||||
if v.Status == 1 {
|
||||
list = append(list, v)
|
||||
}
|
||||
}
|
||||
} else if taskTag == comm.TASK_WEEKLY {
|
||||
for _, v := range task.WeekList {
|
||||
if v.Status == 1 {
|
||||
list = append(list, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// 获取待处理的任务
|
||||
func (this *ModelTask) getUnFinishTasks(uid string, taskId int32) (list []*pb.DBTask) {
|
||||
taskList := this.getTaskById(uid, taskId)
|
||||
for _, v := range taskList {
|
||||
if v.Status == 0 {
|
||||
list = append(list, v)
|
||||
// 获取待处理的(日、周)任务
|
||||
func (this *ModelTask) getUnFinishTasks(uid string, taskId int32) (list []*pb.TaskData) {
|
||||
task := &pb.DBTask{}
|
||||
if err := this.Get(uid, task); err != nil {
|
||||
this.moduleTask.Errorf("getTaskById err %v", err)
|
||||
return nil
|
||||
}
|
||||
|
||||
if task != nil {
|
||||
for _, v := range task.DayList {
|
||||
if v.TaskId == taskId && v.Status == 0 {
|
||||
list = append(list, v)
|
||||
}
|
||||
}
|
||||
|
||||
for _, v := range task.WeekList {
|
||||
if v.TaskId == taskId && v.Status == 0 {
|
||||
list = append(list, v)
|
||||
}
|
||||
}
|
||||
|
||||
for _, v := range task.AchieveList {
|
||||
if v.TaskId == taskId && v.Status == 0 {
|
||||
list = append(list, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
//检查任务状态 返回等待处理的任务
|
||||
func (this *ModelTask) checkTask(uid string, taskId int32) (*pb.DBTask, bool) {
|
||||
func (this *ModelTask) checkTask(uid string, taskId int32) (*pb.TaskData, bool) {
|
||||
taskList := this.getUnFinishTasks(uid, taskId)
|
||||
for _, v := range taskList {
|
||||
if taskId == v.TaskId && v.Status == 0 {
|
||||
if taskId == v.TaskId {
|
||||
return v, true
|
||||
}
|
||||
}
|
||||
@ -221,12 +308,47 @@ func (this *ModelTask) checkTask(uid string, taskId int32) (*pb.DBTask, bool) {
|
||||
}
|
||||
|
||||
//更改用户任务
|
||||
func (this *ModelTask) modifyUserTask(uid string, taskId string, data map[string]interface{}) error {
|
||||
if err := this.ChangeList(uid, taskId, data); err != nil {
|
||||
this.moduleTask.Errorf("err %v", err)
|
||||
return err
|
||||
func (this *ModelTask) modifyUserTask(uid string, taskId int32, data map[string]interface{}) error {
|
||||
var task *pb.DBTask
|
||||
if err := this.GetList(uid, &task); err != nil {
|
||||
this.moduleTask.Errorf("getTaskById err %v", err)
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
var err error
|
||||
for _, v := range task.DayList {
|
||||
if v.TaskId == taskId {
|
||||
v.Progress = data["progress"].(int32)
|
||||
v.Status = data["status"].(int32)
|
||||
}
|
||||
}
|
||||
day_update := map[string]interface{}{
|
||||
"dayList": task.DayList,
|
||||
}
|
||||
err = this.Change(uid, day_update)
|
||||
|
||||
for _, v := range task.WeekList {
|
||||
if v.TaskId == taskId {
|
||||
v.Progress = data["progress"].(int32)
|
||||
v.Status = data["status"].(int32)
|
||||
}
|
||||
}
|
||||
week_update := map[string]interface{}{
|
||||
"weekList": task.WeekList,
|
||||
}
|
||||
err = this.Change(uid, week_update)
|
||||
|
||||
for _, v := range task.AchieveList {
|
||||
if v.TaskId == taskId {
|
||||
v.Progress = data["progress"].(int32)
|
||||
v.Status = data["status"].(int32)
|
||||
}
|
||||
}
|
||||
achieve_update := map[string]interface{}{
|
||||
"achieveList": task.AchieveList,
|
||||
}
|
||||
err = this.Change(uid, achieve_update)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
//清空任务
|
||||
@ -235,56 +357,59 @@ func (this *ModelTask) clearTask(uid string, taskTag ...comm.TaskTag) {
|
||||
this.moduleTask.Error("TaskTag参数缺失", log.Fields{"uid": uid, "params": taskTag})
|
||||
return
|
||||
}
|
||||
taskList := this.getTaskListByTag(uid, taskTag[0])
|
||||
var task *pb.DBTask
|
||||
if err := this.GetList(uid, &task); err != nil {
|
||||
this.moduleTask.Errorf("getTaskById err %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
if task == nil {
|
||||
this.moduleTask.Error("任务数据空", log.Fields{"uid": uid, "taskTag": taskTag})
|
||||
return
|
||||
}
|
||||
|
||||
dr := this.moduleTask.ModuleRtask.GetCondiData(uid)
|
||||
for _, v := range taskList {
|
||||
if err := this.moduleTask.modelTask.DelListlds(uid, v.Id); err != nil {
|
||||
this.moduleTask.Error("清除任务", log.Fields{"uid": uid, "taskId": v.Id})
|
||||
return
|
||||
}
|
||||
//删除任务条件数据
|
||||
if dr != nil && dr.Vals != nil {
|
||||
delete(dr.Vals, v.TypeId)
|
||||
}
|
||||
}
|
||||
if err := this.moduleTask.ModuleRtask.ChangeCondi(uid, dr.Vals); err != nil {
|
||||
this.moduleTask.Error("更新任务条件数据", log.Fields{"uid": uid})
|
||||
}
|
||||
}
|
||||
|
||||
//进入卡牌攻略
|
||||
// Deprecated
|
||||
func (this *ModelTask) inStrategy(uid string, heroCfgId int32) (taskIds []int32, err error) {
|
||||
//检查此英雄攻略是否完成
|
||||
taskList := this.getTaskListByTag(uid, comm.TASK_STRATEGY)
|
||||
allFinished := true
|
||||
for _, v := range taskList {
|
||||
conf := this.moduleTask.configure.getTaskById(v.TaskId)
|
||||
if conf != nil {
|
||||
// if conf.RestrictiveCondition == heroCfgId && v.Status != 1 {
|
||||
// allFinished = false
|
||||
// break
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
if !allFinished {
|
||||
//重置状态
|
||||
for _, v := range taskList {
|
||||
if v.Status != 0 {
|
||||
update := map[string]interface{}{
|
||||
"status": 0,
|
||||
}
|
||||
if err = this.modifyUserTask(uid, v.Id, update); err != nil {
|
||||
this.moduleTask.Errorf("doStrategy err %v", err)
|
||||
break
|
||||
}
|
||||
update := map[string]interface{}{}
|
||||
if taskTag[0] == comm.TASK_DAILY {
|
||||
for _, v := range task.DayList {
|
||||
//删除任务条件数据
|
||||
if dr != nil && dr.Vals != nil {
|
||||
delete(dr.Vals, v.TypeId)
|
||||
}
|
||||
taskIds = append(taskIds, v.TaskId)
|
||||
}
|
||||
if err := this.moduleTask.ModuleRtask.ChangeCondi(uid, dr.Vals); err != nil {
|
||||
this.moduleTask.Error("更新任务条件数据", log.Fields{"uid": uid})
|
||||
}
|
||||
update["dayList"] = make([]*pb.TaskData, 0)
|
||||
} else if taskTag[0] == comm.TASK_WEEKLY {
|
||||
for _, v := range task.WeekList {
|
||||
//删除任务条件数据
|
||||
if dr != nil && dr.Vals != nil {
|
||||
delete(dr.Vals, v.TypeId)
|
||||
}
|
||||
}
|
||||
if err := this.moduleTask.ModuleRtask.ChangeCondi(uid, dr.Vals); err != nil {
|
||||
this.moduleTask.Error("更新任务条件数据", log.Fields{"uid": uid})
|
||||
}
|
||||
update["weekList"] = make([]*pb.TaskData, 0)
|
||||
} else if taskTag[0] == comm.TASK_ACHIEVE {
|
||||
for _, v := range task.AchieveList {
|
||||
//删除任务条件数据
|
||||
if dr != nil && dr.Vals != nil {
|
||||
delete(dr.Vals, v.TypeId)
|
||||
}
|
||||
}
|
||||
if err := this.moduleTask.ModuleRtask.ChangeCondi(uid, dr.Vals); err != nil {
|
||||
this.moduleTask.Error("更新任务条件数据", log.Fields{"uid": uid})
|
||||
}
|
||||
update["weekList"] = make([]*pb.TaskData, 0)
|
||||
}
|
||||
|
||||
if err := this.moduleTask.modelTask.Change(uid, update); err != nil {
|
||||
this.moduleTask.Error("清空任务数据", log.Fields{"uid": uid})
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// 任务处理
|
||||
@ -321,6 +446,7 @@ func (this *ModelTask) doTaskHandle(event interface{}, next func(event interface
|
||||
progress int32
|
||||
update map[string]interface{}
|
||||
)
|
||||
|
||||
if code := this.moduleTask.ModuleRtask.CheckCondi(tl.Uid, conf.TypeId); code == pb.ErrorCode_Success {
|
||||
// update data
|
||||
if ret != nil && len(ret.Data) > 0 {
|
||||
@ -330,7 +456,6 @@ func (this *ModelTask) doTaskHandle(event interface{}, next func(event interface
|
||||
"progress": progress,
|
||||
"status": 1,
|
||||
}
|
||||
// err = this.updateActive(tl.Uid, conf.Key)
|
||||
} else {
|
||||
if ret != nil && len(ret.Data) > 0 {
|
||||
progress = ret.Data[0]
|
||||
@ -339,7 +464,7 @@ func (this *ModelTask) doTaskHandle(event interface{}, next func(event interface
|
||||
"progress": progress,
|
||||
}
|
||||
}
|
||||
if err = this.modifyUserTask(tl.Uid, task.Id, update); err != nil {
|
||||
if err = this.modifyUserTask(tl.Uid, task.TaskId, update); err != nil {
|
||||
return
|
||||
}
|
||||
this.moduleTask.Debug("更新任务",
|
||||
|
@ -104,17 +104,21 @@ func (this *ModuleTask) resetActive(uid string, taskTag comm.TaskTag) {
|
||||
}
|
||||
|
||||
// 获取玩家指定任务
|
||||
func (this *ModuleTask) GetTaskById(uid string, taskId int32) *pb.DBTask {
|
||||
list := []*pb.DBTask{}
|
||||
if err := this.modelTask.GetList(uid, &list); err != nil {
|
||||
func (this *ModuleTask) GetTaskById(uid string, taskTag, taskId int32) *pb.TaskData {
|
||||
var task *pb.DBTask
|
||||
if err := this.modelTask.GetList(uid, &task); err != nil {
|
||||
log.Errorf("GetTaskById err %v", err)
|
||||
return nil
|
||||
}
|
||||
for _, v := range list {
|
||||
if v.TaskId == taskId {
|
||||
return v
|
||||
|
||||
if taskTag == int32(comm.TASK_DAILY) {
|
||||
for _, v := range task.DayList {
|
||||
if v.TaskId == taskId {
|
||||
return v
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -134,8 +138,9 @@ func (this *ModuleTask) CleanData(uid string) {
|
||||
//任务处理器注册
|
||||
type taskHandle func(uid string, taskId int32, tp *pb.TaskParam) *pb.DBTask
|
||||
|
||||
func (this *ModuleTask) GetTaskFinished(uid string, taskTage comm.TaskTag) []*pb.DBTask {
|
||||
return this.modelTask.getFinishTasks(uid, taskTage)
|
||||
// 获取每日任务列表
|
||||
func (this *ModuleTask) GetTaskDayFinished(uid string) []*pb.TaskData {
|
||||
return this.modelTask.getFinishTasks(uid, comm.TASK_DAILY)
|
||||
}
|
||||
|
||||
func (this *ModuleTask) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) {
|
||||
|
@ -146,7 +146,7 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (cod
|
||||
// 初始化随机任务数据
|
||||
// this.module.ModuleRtask.InitCondiData(user.Uid)
|
||||
// 日常登录任务
|
||||
this.module.ModuleRtask.SendToRtask(session, comm.Rtype7, 1)
|
||||
this.module.ModuleRtask.SendToRtask(session, comm.Rtype8, 1)
|
||||
|
||||
this.module.ModulePrivilege.CheckDailyPrivilegeMail(session)
|
||||
//推送登录公告
|
||||
|
176
pb/task_db.pb.go
176
pb/task_db.pb.go
@ -25,11 +25,11 @@ type DBTask struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
|
||||
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID
|
||||
DayList []*TaskData `protobuf:"bytes,4,rep,name=dayList,proto3" json:"dayList" bson:"dayList"` //日常任务列表
|
||||
WeekList []*TaskData `protobuf:"bytes,5,rep,name=weekList,proto3" json:"weekList" bson:"weekList"` //周常任务列表
|
||||
ActivityList []*ActivityData `protobuf:"bytes,6,rep,name=activityList,proto3" json:"activityList" bson:"activityList"` //活跃度列表
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
|
||||
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID
|
||||
DayList []*TaskData `protobuf:"bytes,4,rep,name=dayList,proto3" json:"dayList" bson:"dayList"` //日常任务列表
|
||||
WeekList []*TaskData `protobuf:"bytes,5,rep,name=weekList,proto3" json:"weekList" bson:"weekList"` //周常任务列表
|
||||
AchieveList []*TaskData `protobuf:"bytes,6,rep,name=achieveList,proto3" json:"achieveList" bson:"achieveList"` //成就任务列表
|
||||
}
|
||||
|
||||
func (x *DBTask) Reset() {
|
||||
@ -92,9 +92,9 @@ func (x *DBTask) GetWeekList() []*TaskData {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DBTask) GetActivityList() []*ActivityData {
|
||||
func (x *DBTask) GetAchieveList() []*TaskData {
|
||||
if x != nil {
|
||||
return x.ActivityList
|
||||
return x.AchieveList
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -202,20 +202,83 @@ func (x *TaskData) GetSort() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
type DBActivity struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
|
||||
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID
|
||||
ActivityList []*ActivityData `protobuf:"bytes,3,rep,name=activityList,proto3" json:"activityList" bson:"activityList"` //活跃度列表
|
||||
}
|
||||
|
||||
func (x *DBActivity) Reset() {
|
||||
*x = DBActivity{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_task_task_db_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DBActivity) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DBActivity) ProtoMessage() {}
|
||||
|
||||
func (x *DBActivity) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_task_task_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 DBActivity.ProtoReflect.Descriptor instead.
|
||||
func (*DBActivity) Descriptor() ([]byte, []int) {
|
||||
return file_task_task_db_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *DBActivity) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DBActivity) GetUid() string {
|
||||
if x != nil {
|
||||
return x.Uid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DBActivity) GetActivityList() []*ActivityData {
|
||||
if x != nil {
|
||||
return x.ActivityList
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ActivityData struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
TaskId int32 `protobuf:"varint,3,opt,name=taskId,proto3" json:"taskId" bson:"taskId"` //taskId
|
||||
Tag int32 `protobuf:"varint,4,opt,name=tag,proto3" json:"tag" bson:"tag"` //标签
|
||||
Received int32 `protobuf:"varint,5,opt,name=received,proto3" json:"received" bson:"received"` //领取状态 默认0未领取 1已领取
|
||||
TaskId int32 `protobuf:"varint,1,opt,name=taskId,proto3" json:"taskId" bson:"taskId"` //taskId
|
||||
Tag int32 `protobuf:"varint,2,opt,name=tag,proto3" json:"tag" bson:"tag"` //标签
|
||||
Received int32 `protobuf:"varint,3,opt,name=received,proto3" json:"received" bson:"received"` //领取状态 默认0未领取 1已领取
|
||||
}
|
||||
|
||||
func (x *ActivityData) Reset() {
|
||||
*x = ActivityData{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_task_task_db_proto_msgTypes[2]
|
||||
mi := &file_task_task_db_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -228,7 +291,7 @@ func (x *ActivityData) String() string {
|
||||
func (*ActivityData) ProtoMessage() {}
|
||||
|
||||
func (x *ActivityData) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_task_task_db_proto_msgTypes[2]
|
||||
mi := &file_task_task_db_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -241,7 +304,7 @@ func (x *ActivityData) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use ActivityData.ProtoReflect.Descriptor instead.
|
||||
func (*ActivityData) Descriptor() ([]byte, []int) {
|
||||
return file_task_task_db_proto_rawDescGZIP(), []int{2}
|
||||
return file_task_task_db_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *ActivityData) GetTaskId() int32 {
|
||||
@ -269,37 +332,42 @@ var File_task_task_db_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_task_task_db_proto_rawDesc = []byte{
|
||||
0x0a, 0x12, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x64, 0x62, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa9, 0x01, 0x0a, 0x06, 0x44, 0x42, 0x54, 0x61, 0x73, 0x6b, 0x12,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa3, 0x01, 0x0a, 0x06, 0x44, 0x42, 0x54, 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, 0x23, 0x0a, 0x07, 0x64, 0x61, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03,
|
||||
0x28, 0x0b, 0x32, 0x09, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x64,
|
||||
0x61, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x08, 0x77, 0x65, 0x65, 0x6b, 0x4c, 0x69,
|
||||
0x73, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x44,
|
||||
0x61, 0x74, 0x61, 0x52, 0x08, 0x77, 0x65, 0x65, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x31, 0x0a,
|
||||
0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x06, 0x20,
|
||||
0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x61,
|
||||
0x74, 0x61, 0x52, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4c, 0x69, 0x73, 0x74,
|
||||
0x22, 0xc8, 0x01, 0x0a, 0x08, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a,
|
||||
0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74,
|
||||
0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x04, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72,
|
||||
0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72,
|
||||
0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x06, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73,
|
||||
0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61,
|
||||
0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18,
|
||||
0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x12,
|
||||
0x16, 0x0a, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x06, 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18,
|
||||
0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x54, 0x0a, 0x0c, 0x41,
|
||||
0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x74,
|
||||
0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73,
|
||||
0x6b, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65,
|
||||
0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65,
|
||||
0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
0x61, 0x74, 0x61, 0x52, 0x08, 0x77, 0x65, 0x65, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2b, 0x0a,
|
||||
0x0b, 0x61, 0x63, 0x68, 0x69, 0x65, 0x76, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x06, 0x20, 0x03,
|
||||
0x28, 0x0b, 0x32, 0x09, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0b, 0x61,
|
||||
0x63, 0x68, 0x69, 0x65, 0x76, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x22, 0xc8, 0x01, 0x0a, 0x08, 0x54,
|
||||
0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49,
|
||||
0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12,
|
||||
0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x74, 0x61,
|
||||
0x67, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a,
|
||||
0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61,
|
||||
0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18,
|
||||
0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a,
|
||||
0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x79, 0x70,
|
||||
0x65, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49,
|
||||
0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0x61, 0x0a, 0x0a, 0x44, 0x42, 0x41, 0x63, 0x74, 0x69, 0x76,
|
||||
0x69, 0x74, 0x79, 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, 0x31, 0x0a, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74,
|
||||
0x79, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x63,
|
||||
0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0c, 0x61, 0x63, 0x74, 0x69,
|
||||
0x76, 0x69, 0x74, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x54, 0x0a, 0x0c, 0x41, 0x63, 0x74, 0x69,
|
||||
0x76, 0x69, 0x74, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b,
|
||||
0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64,
|
||||
0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x74,
|
||||
0x61, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x03,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x06,
|
||||
0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -314,21 +382,23 @@ func file_task_task_db_proto_rawDescGZIP() []byte {
|
||||
return file_task_task_db_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_task_task_db_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_task_task_db_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_task_task_db_proto_goTypes = []interface{}{
|
||||
(*DBTask)(nil), // 0: DBTask
|
||||
(*TaskData)(nil), // 1: TaskData
|
||||
(*ActivityData)(nil), // 2: ActivityData
|
||||
(*DBActivity)(nil), // 2: DBActivity
|
||||
(*ActivityData)(nil), // 3: ActivityData
|
||||
}
|
||||
var file_task_task_db_proto_depIdxs = []int32{
|
||||
1, // 0: DBTask.dayList:type_name -> TaskData
|
||||
1, // 1: DBTask.weekList:type_name -> TaskData
|
||||
2, // 2: DBTask.activityList:type_name -> ActivityData
|
||||
3, // [3:3] is the sub-list for method output_type
|
||||
3, // [3:3] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
1, // 2: DBTask.achieveList:type_name -> TaskData
|
||||
3, // 3: DBActivity.activityList:type_name -> ActivityData
|
||||
4, // [4:4] is the sub-list for method output_type
|
||||
4, // [4:4] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_task_task_db_proto_init() }
|
||||
@ -362,6 +432,18 @@ func file_task_task_db_proto_init() {
|
||||
}
|
||||
}
|
||||
file_task_task_db_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DBActivity); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_task_task_db_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ActivityData); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -380,7 +462,7 @@ func file_task_task_db_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_task_task_db_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
@ -26,8 +26,8 @@ type TaskReceiveReq struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
TaskTag int32 `protobuf:"varint,1,opt,name=taskTag,proto3" json:"taskTag"` // 1日常/2周常/3成就
|
||||
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id"` //任务唯一ID
|
||||
TaskTag int32 `protobuf:"varint,1,opt,name=taskTag,proto3" json:"taskTag"` // 1日常/2周常/3成就
|
||||
Id int32 `protobuf:"varint,2,opt,name=id,proto3" json:"id"` //任务唯一ID
|
||||
}
|
||||
|
||||
func (x *TaskReceiveReq) Reset() {
|
||||
@ -69,11 +69,11 @@ func (x *TaskReceiveReq) GetTaskTag() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *TaskReceiveReq) GetId() string {
|
||||
func (x *TaskReceiveReq) GetId() int32 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
return 0
|
||||
}
|
||||
|
||||
type TaskReceiveResp struct {
|
||||
@ -176,7 +176,7 @@ type TaskListResp struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
List []*DBTask `protobuf:"bytes,1,rep,name=list,proto3" json:"list"`
|
||||
List []*TaskData `protobuf:"bytes,1,rep,name=list,proto3" json:"list"`
|
||||
}
|
||||
|
||||
func (x *TaskListResp) Reset() {
|
||||
@ -211,7 +211,7 @@ func (*TaskListResp) Descriptor() ([]byte, []int) {
|
||||
return file_task_task_msg_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *TaskListResp) GetList() []*DBTask {
|
||||
func (x *TaskListResp) GetList() []*TaskData {
|
||||
if x != nil {
|
||||
return x.List
|
||||
}
|
||||
@ -327,8 +327,8 @@ type TaskActiveReceiveReq struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
TaskTag int32 `protobuf:"varint,1,opt,name=taskTag,proto3" json:"taskTag"` // 1日常/2周常
|
||||
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id"` //唯一id
|
||||
TaskTag int32 `protobuf:"varint,1,opt,name=taskTag,proto3" json:"taskTag"` // 1日常/2周常
|
||||
Id int32 `protobuf:"varint,2,opt,name=id,proto3" json:"id"` //唯一id
|
||||
}
|
||||
|
||||
func (x *TaskActiveReceiveReq) Reset() {
|
||||
@ -370,11 +370,11 @@ func (x *TaskActiveReceiveReq) GetTaskTag() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *TaskActiveReceiveReq) GetId() string {
|
||||
func (x *TaskActiveReceiveReq) GetId() int32 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
return 0
|
||||
}
|
||||
|
||||
type TaskActiveReceiveResp struct {
|
||||
@ -382,8 +382,8 @@ type TaskActiveReceiveResp struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
TaskTag int32 `protobuf:"varint,1,opt,name=taskTag,proto3" json:"taskTag"`
|
||||
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id"`
|
||||
TaskTag int32 `protobuf:"varint,1,opt,name=taskTag,proto3" json:"taskTag"`
|
||||
Id int32 `protobuf:"varint,2,opt,name=id,proto3" json:"id"`
|
||||
}
|
||||
|
||||
func (x *TaskActiveReceiveResp) Reset() {
|
||||
@ -425,108 +425,13 @@ func (x *TaskActiveReceiveResp) GetTaskTag() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *TaskActiveReceiveResp) GetId() string {
|
||||
func (x *TaskActiveReceiveResp) GetId() int32 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
//攻略
|
||||
type TaskDoStrategyReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
HeroCfgId int32 `protobuf:"varint,1,opt,name=heroCfgId,proto3" json:"heroCfgId"` //英雄ID
|
||||
}
|
||||
|
||||
func (x *TaskDoStrategyReq) Reset() {
|
||||
*x = TaskDoStrategyReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_task_task_msg_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *TaskDoStrategyReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TaskDoStrategyReq) ProtoMessage() {}
|
||||
|
||||
func (x *TaskDoStrategyReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_task_task_msg_proto_msgTypes[8]
|
||||
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 TaskDoStrategyReq.ProtoReflect.Descriptor instead.
|
||||
func (*TaskDoStrategyReq) Descriptor() ([]byte, []int) {
|
||||
return file_task_task_msg_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
func (x *TaskDoStrategyReq) GetHeroCfgId() int32 {
|
||||
if x != nil {
|
||||
return x.HeroCfgId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type TaskDoStrategyResp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
TaskIds []int32 `protobuf:"varint,1,rep,packed,name=taskIds,proto3" json:"taskIds"` //任务ID
|
||||
}
|
||||
|
||||
func (x *TaskDoStrategyResp) Reset() {
|
||||
*x = TaskDoStrategyResp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_task_task_msg_proto_msgTypes[9]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *TaskDoStrategyResp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*TaskDoStrategyResp) ProtoMessage() {}
|
||||
|
||||
func (x *TaskDoStrategyResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_task_task_msg_proto_msgTypes[9]
|
||||
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 TaskDoStrategyResp.ProtoReflect.Descriptor instead.
|
||||
func (*TaskDoStrategyResp) Descriptor() ([]byte, []int) {
|
||||
return file_task_task_msg_proto_rawDescGZIP(), []int{9}
|
||||
}
|
||||
|
||||
func (x *TaskDoStrategyResp) GetTaskIds() []int32 {
|
||||
if x != nil {
|
||||
return x.TaskIds
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
//任务完成推送
|
||||
type TaskFinishedPush struct {
|
||||
state protoimpl.MessageState
|
||||
@ -539,7 +444,7 @@ type TaskFinishedPush struct {
|
||||
func (x *TaskFinishedPush) Reset() {
|
||||
*x = TaskFinishedPush{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_task_task_msg_proto_msgTypes[10]
|
||||
mi := &file_task_task_msg_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -552,7 +457,7 @@ func (x *TaskFinishedPush) String() string {
|
||||
func (*TaskFinishedPush) ProtoMessage() {}
|
||||
|
||||
func (x *TaskFinishedPush) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_task_task_msg_proto_msgTypes[10]
|
||||
mi := &file_task_task_msg_proto_msgTypes[8]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -565,7 +470,7 @@ func (x *TaskFinishedPush) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use TaskFinishedPush.ProtoReflect.Descriptor instead.
|
||||
func (*TaskFinishedPush) Descriptor() ([]byte, []int) {
|
||||
return file_task_task_msg_proto_rawDescGZIP(), []int{10}
|
||||
return file_task_task_msg_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
func (x *TaskFinishedPush) GetTaskId() int32 {
|
||||
@ -584,41 +489,35 @@ var file_task_task_msg_proto_rawDesc = []byte{
|
||||
0x6b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x74,
|
||||
0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x61,
|
||||
0x73, 0x6b, 0x54, 0x61, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x29, 0x0a, 0x0f, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63,
|
||||
0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x29, 0x0a, 0x0f, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63,
|
||||
0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b,
|
||||
0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64,
|
||||
0x22, 0x27, 0x0a, 0x0b, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12,
|
||||
0x18, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x22, 0x2b, 0x0a, 0x0c, 0x54, 0x61, 0x73,
|
||||
0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x04, 0x6c, 0x69, 0x73,
|
||||
0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x54, 0x61, 0x73, 0x6b,
|
||||
0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x2d, 0x0a, 0x11, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63,
|
||||
0x74, 0x69, 0x76, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x74,
|
||||
0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x61,
|
||||
0x73, 0x6b, 0x54, 0x61, 0x67, 0x22, 0x4f, 0x0a, 0x12, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74,
|
||||
0x69, 0x76, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x21, 0x0a, 0x04, 0x6c,
|
||||
0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x63, 0x74, 0x69,
|
||||
0x76, 0x69, 0x74, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x16,
|
||||
0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06,
|
||||
0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0x40, 0x0a, 0x14, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63,
|
||||
0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x18,
|
||||
0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x07, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x41, 0x0a, 0x15, 0x54, 0x61, 0x73, 0x6b,
|
||||
0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73,
|
||||
0x70, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69,
|
||||
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x31, 0x0a, 0x11, 0x54,
|
||||
0x61, 0x73, 0x6b, 0x44, 0x6f, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x52, 0x65, 0x71,
|
||||
0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x43, 0x66, 0x67, 0x49, 0x64, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x09, 0x68, 0x65, 0x72, 0x6f, 0x43, 0x66, 0x67, 0x49, 0x64, 0x22, 0x2e,
|
||||
0x0a, 0x12, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x6f, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79,
|
||||
0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x18,
|
||||
0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x22, 0x2a,
|
||||
0x0a, 0x10, 0x54, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x50, 0x75,
|
||||
0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b,
|
||||
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x52, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x22, 0x2d, 0x0a, 0x0c, 0x54, 0x61, 0x73,
|
||||
0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x6c, 0x69, 0x73,
|
||||
0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x61,
|
||||
0x74, 0x61, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x2d, 0x0a, 0x11, 0x54, 0x61, 0x73, 0x6b,
|
||||
0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a,
|
||||
0x07, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07,
|
||||
0x74, 0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x22, 0x4f, 0x0a, 0x12, 0x54, 0x61, 0x73, 0x6b, 0x41,
|
||||
0x63, 0x74, 0x69, 0x76, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x21, 0x0a,
|
||||
0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x63,
|
||||
0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74,
|
||||
0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0x40, 0x0a, 0x14, 0x54, 0x61, 0x73, 0x6b,
|
||||
0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71,
|
||||
0x12, 0x18, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x41, 0x0a, 0x15, 0x54, 0x61,
|
||||
0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52,
|
||||
0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x12, 0x0e, 0x0a,
|
||||
0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2a, 0x0a,
|
||||
0x10, 0x54, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x50, 0x75, 0x73,
|
||||
0x68, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70,
|
||||
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -633,7 +532,7 @@ func file_task_task_msg_proto_rawDescGZIP() []byte {
|
||||
return file_task_task_msg_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_task_task_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
|
||||
var file_task_task_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
|
||||
var file_task_task_msg_proto_goTypes = []interface{}{
|
||||
(*TaskReceiveReq)(nil), // 0: TaskReceiveReq
|
||||
(*TaskReceiveResp)(nil), // 1: TaskReceiveResp
|
||||
@ -643,15 +542,13 @@ var file_task_task_msg_proto_goTypes = []interface{}{
|
||||
(*TaskActiveListResp)(nil), // 5: TaskActiveListResp
|
||||
(*TaskActiveReceiveReq)(nil), // 6: TaskActiveReceiveReq
|
||||
(*TaskActiveReceiveResp)(nil), // 7: TaskActiveReceiveResp
|
||||
(*TaskDoStrategyReq)(nil), // 8: TaskDoStrategyReq
|
||||
(*TaskDoStrategyResp)(nil), // 9: TaskDoStrategyResp
|
||||
(*TaskFinishedPush)(nil), // 10: TaskFinishedPush
|
||||
(*DBTask)(nil), // 11: DBTask
|
||||
(*ActivityData)(nil), // 12: ActivityData
|
||||
(*TaskFinishedPush)(nil), // 8: TaskFinishedPush
|
||||
(*TaskData)(nil), // 9: TaskData
|
||||
(*ActivityData)(nil), // 10: ActivityData
|
||||
}
|
||||
var file_task_task_msg_proto_depIdxs = []int32{
|
||||
11, // 0: TaskListResp.list:type_name -> DBTask
|
||||
12, // 1: TaskActiveListResp.list:type_name -> ActivityData
|
||||
9, // 0: TaskListResp.list:type_name -> TaskData
|
||||
10, // 1: TaskActiveListResp.list:type_name -> ActivityData
|
||||
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
|
||||
@ -763,30 +660,6 @@ func file_task_task_msg_proto_init() {
|
||||
}
|
||||
}
|
||||
file_task_task_msg_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*TaskDoStrategyReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_task_task_msg_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*TaskDoStrategyResp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_task_task_msg_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*TaskFinishedPush); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -805,7 +678,7 @@ func file_task_task_msg_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_task_task_msg_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 11,
|
||||
NumMessages: 9,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user