扩展数据初始调整
This commit is contained in:
parent
eb9f2bb1ec
commit
7b79fd7d78
@ -81,22 +81,6 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (c
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//初始化用户扩展
|
|
||||||
initUpdate := map[string]interface{}{
|
|
||||||
"modifynameCount": 1, //修改名称1次
|
|
||||||
"sociatyTicket": globalConf.GuildBossInitialNum, //公会BOSS挑战券
|
|
||||||
"expitem": make(map[string]int32, 0), // 初始化
|
|
||||||
"mline": make(map[string]int32, 0),
|
|
||||||
}
|
|
||||||
if err := this.module.modelExpand.ChangeUserExpand(session.GetUserId(), initUpdate); err != nil {
|
|
||||||
code = pb.ErrorCode_DBError
|
|
||||||
this.module.Error("创建初始修改名称次数",
|
|
||||||
log.Field{Key: "uid", Value: uid},
|
|
||||||
log.Field{Key: "params", Value: initUpdate},
|
|
||||||
log.Field{Key: "err", Value: err.Error()},
|
|
||||||
)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var (
|
var (
|
||||||
res []*cfg.Gameatn
|
res []*cfg.Gameatn
|
||||||
)
|
)
|
||||||
|
@ -43,7 +43,25 @@ func (this *ModelExpand) GetUserExpand(uid string) (result *pb.DBUserExpand, err
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if err = this.Get(uid, result); err != nil && mongo.ErrNoDocuments != err {
|
if err = this.Get(uid, result); err != nil && mongo.ErrNoDocuments == err {
|
||||||
|
globalConf := this.module.configure.GetGlobalConf()
|
||||||
|
initUpdate := map[string]interface{}{
|
||||||
|
"uid": uid,
|
||||||
|
"modifynameCount": 1, //修改名称1次
|
||||||
|
"sociatyTicket": globalConf.GuildBossInitialNum, //公会BOSS挑战券
|
||||||
|
"expitem": make(map[string]int32, 0), // 初始化
|
||||||
|
"mline": make(map[string]int32, 0),
|
||||||
|
}
|
||||||
|
result.SociatyTicket = globalConf.GuildBossInitialNum
|
||||||
|
if err = this.module.modelExpand.ChangeUserExpand(uid, initUpdate); err != nil {
|
||||||
|
|
||||||
|
this.module.Error("创建初始修改名称次数",
|
||||||
|
log.Field{Key: "uid", Value: uid},
|
||||||
|
log.Field{Key: "params", Value: initUpdate},
|
||||||
|
log.Field{Key: "err", Value: err.Error()},
|
||||||
|
)
|
||||||
|
return
|
||||||
|
}
|
||||||
this.module.Error("Get", log.Field{Key: "uid", Value: uid})
|
this.module.Error("Get", log.Field{Key: "uid", Value: uid})
|
||||||
return result, err
|
return result, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user