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,15 +33,15 @@ var (
mainType: string(comm.ModuleHero),
subType: hero.StrengthenUplv,
req: &pb.HeroStrengthenUplvReq{
HeroObjID: "62de35b92f462b70c1105aa8",
HeroObjID: "62e778117cc92ac48c4b2464",
ExpCards: []*pb.MapStringInt32{
{
Key: "62de35b92f462b70c1105ab8",
Key: "62e778117cc92ac48c4b2479",
Value: 1,
},
},
},
rsp: &pb.HeroStrengthenUplvResp{},
rsp: &pb.HeroStrengthenUplvResp{},
// enabled: true,
}
tcs = append(tcs, tc)
@ -134,8 +134,8 @@ var (
req: &pb.GMCmdReq{
Cmod: "bingo:attr,gold,100",
},
rsp: &pb.GMCmdResp{},
enabled: true,
rsp: &pb.GMCmdResp{},
// enabled: true,
},
}
)

View File

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

View File

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

View File

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

View File

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