This commit is contained in:
zhaocy 2022-08-01 15:21:40 +08:00
parent fe90ea1ec4
commit 739d2324f3
5 changed files with 23 additions and 17 deletions

View File

@ -33,10 +33,10 @@ var (
mainType: string(comm.ModuleHero), mainType: string(comm.ModuleHero),
subType: hero.StrengthenUplv, subType: hero.StrengthenUplv,
req: &pb.HeroStrengthenUplvReq{ req: &pb.HeroStrengthenUplvReq{
HeroObjID: "62de35b92f462b70c1105aa8", HeroObjID: "62e778117cc92ac48c4b2464",
ExpCards: []*pb.MapStringInt32{ ExpCards: []*pb.MapStringInt32{
{ {
Key: "62de35b92f462b70c1105ab8", Key: "62e778117cc92ac48c4b2479",
Value: 1, Value: 1,
}, },
}, },
@ -135,7 +135,7 @@ var (
Cmod: "bingo:attr,gold,100", Cmod: "bingo:attr,gold,100",
}, },
rsp: &pb.GMCmdResp{}, rsp: &pb.GMCmdResp{},
enabled: true, // enabled: true,
}, },
} }
) )

View File

@ -17,9 +17,9 @@ var (
subType: task.TaskSubTypeList, subType: task.TaskSubTypeList,
req: &pb.TaskListReq{ req: &pb.TaskListReq{
//设置任务类型 //设置任务类型
// TaskTag: int32(comm.TASK_DAILY), //每天任务 TaskTag: int32(comm.TASK_DAILY), //每天任务
// TaskTag: int32(comm.TASK_WEEKLY), //周任务 // TaskTag: int32(comm.TASK_WEEKLY), //周任务
TaskTag: int32(comm.TASK_ACHIEVE), // TaskTag: int32(comm.TASK_ACHIEVE),
// TaskTag: int32(comm.TASK_STRATEGY), // TaskTag: int32(comm.TASK_STRATEGY),
}, },
rsp: &pb.TaskListResp{}, rsp: &pb.TaskListResp{},
@ -40,10 +40,10 @@ var (
subType: task.TaskSubTypeReceive, subType: task.TaskSubTypeReceive,
req: &pb.TaskReceiveReq{ req: &pb.TaskReceiveReq{
TaskTag: int32(comm.TASK_ACHIEVE), TaskTag: int32(comm.TASK_ACHIEVE),
Id: "62e0d79d7eefc9f4ef5803e3", Id: "62e778167cc92ac48c4b249b",
}, },
rsp: &pb.TaskReceiveResp{}, rsp: &pb.TaskReceiveResp{},
// enabled: true, enabled: true,
} }
tcs = append(tcs, tc) tcs = append(tcs, tc)
// } // }

View File

@ -39,7 +39,7 @@ var user_builders = []*TestCase{
subType: "gettujian", subType: "gettujian",
req: &pb.UserGetTujianReq{}, req: &pb.UserGetTujianReq{},
rsp: &pb.UserGetTujianResp{}, rsp: &pb.UserGetTujianResp{},
enabled: true, // enabled: true,
}, },
{ {
desc: "添加资源", desc: "添加资源",

View File

@ -3,6 +3,7 @@ package task
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/utils"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
@ -55,13 +56,18 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.TaskReceiveReq)
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
return return
} }
if ue != nil {
update := make(map[string]interface{}) update := make(map[string]interface{})
if ue != nil {
ue.Activeday = ue.Activeday + conf.Active
ue.Activeweek = ue.Activeweek + conf.Active
update = utils.StructToMap(ue)
} else {
if comm.TaskTag(req.TaskTag) == comm.TASK_DAILY { if comm.TaskTag(req.TaskTag) == comm.TASK_DAILY {
update["activeday"] = ue.Activeday + conf.Active update["activeday"] = ue.Activeday + conf.Active
} else if comm.TaskTag(req.TaskTag) == comm.TASK_WEEKLY { } else if comm.TaskTag(req.TaskTag) == comm.TASK_WEEKLY {
update["activeweek"] = ue.Activeweek + conf.Active update["activeweek"] = ue.Activeweek + conf.Active
} }
}
if len(update) > 0 { if len(update) > 0 {
if err = this.moduleTask.ModuleUser.ChanageUserExpand(session.GetUserId(), update); err != nil { if err = this.moduleTask.ModuleUser.ChanageUserExpand(session.GetUserId(), update); err != nil {
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
@ -69,7 +75,6 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.TaskReceiveReq)
} }
} }
} }
}
//奖励 //奖励
if code = this.moduleTask.DispenseRes(session, conf.Reword, true); code != pb.ErrorCode_Success { if code = this.moduleTask.DispenseRes(session, conf.Reword, true); code != pb.ErrorCode_Success {

View File

@ -73,6 +73,7 @@ func (this *User) CleanSession(session comm.IUserSession) {
this.modelSession.Del(session.GetUserId(), modules.SetDBMgoLog(false)) this.modelSession.Del(session.GetUserId(), modules.SetDBMgoLog(false))
this.modelUser.Del(session.GetUserId(), modules.SetDBMgoLog(false)) this.modelUser.Del(session.GetUserId(), modules.SetDBMgoLog(false))
//this.modelExpand.Del(session.GetUserId(), modules.SetDBMgoLog(false)) // 暂时不清 //this.modelExpand.Del(session.GetUserId(), modules.SetDBMgoLog(false)) // 暂时不清
this.modelSetting.Del(session.GetUserId(), modules.SetDBMgoLog(false))
} }
//查询用户属性值 例如 金币 经验 //查询用户属性值 例如 金币 经验