map 初始化

This commit is contained in:
meixiongfeng 2023-07-21 22:29:38 +08:00
parent b1b6df83a8
commit d8ca98f2e2
2 changed files with 8 additions and 0 deletions

View File

@ -52,6 +52,12 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
if heroRecord.Count == nil {
heroRecord.Count = make(map[int32]int32)
}
if heroRecord.Wish == nil {
heroRecord.Wish = make(map[string]int64)
}
if heroRecord.Limit == nil {
heroRecord.Limit = make(map[string]int64)
}
rsp := &pb.HeroDrawCardResp{
Data: []*pb.AtnoData{},
Wish: &pb.UserAtno{},

View File

@ -40,6 +40,8 @@ func (this *ModelRecord) GetHeroRecord(uid string) (result *pb.DBHeroRecord, err
result.Baodi5 = map[int32]int32{}
result.Count = map[int32]int32{}
result.Peach = map[int32]bool{}
result.Wish = map[string]int64{}
result.Limit = map[string]int64{}
result.Mtime = configure.Now().Unix()
this.Add(uid, result)
err = nil