update
This commit is contained in:
parent
fe90ea1ec4
commit
739d2324f3
@ -33,15 +33,15 @@ 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,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
rsp: &pb.HeroStrengthenUplvResp{},
|
rsp: &pb.HeroStrengthenUplvResp{},
|
||||||
// enabled: true,
|
// enabled: true,
|
||||||
}
|
}
|
||||||
tcs = append(tcs, tc)
|
tcs = append(tcs, tc)
|
||||||
@ -134,8 +134,8 @@ var (
|
|||||||
req: &pb.GMCmdReq{
|
req: &pb.GMCmdReq{
|
||||||
Cmod: "bingo:attr,gold,100",
|
Cmod: "bingo:attr,gold,100",
|
||||||
},
|
},
|
||||||
rsp: &pb.GMCmdResp{},
|
rsp: &pb.GMCmdResp{},
|
||||||
enabled: true,
|
// enabled: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -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)
|
||||||
// }
|
// }
|
||||||
|
@ -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: "添加资源",
|
||||||
|
@ -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,18 +56,22 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.TaskReceiveReq)
|
|||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
update := make(map[string]interface{})
|
||||||
if ue != nil {
|
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 {
|
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 err = this.moduleTask.ModuleUser.ChanageUserExpand(session.GetUserId(), update); err != nil {
|
if len(update) > 0 {
|
||||||
code = pb.ErrorCode_DBError
|
if err = this.moduleTask.ModuleUser.ChanageUserExpand(session.GetUserId(), update); err != nil {
|
||||||
return
|
code = pb.ErrorCode_DBError
|
||||||
}
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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))
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询用户属性值 例如 金币 经验
|
//查询用户属性值 例如 金币 经验
|
||||||
|
Loading…
Reference in New Issue
Block a user