一次创建多个英雄接口
This commit is contained in:
parent
2d7ee15f07
commit
7bb39c45e2
@ -39,6 +39,8 @@ type (
|
||||
CreateHeroes(uid string, heroCfgId ...string) error
|
||||
//创建指定数量
|
||||
CreateRepeatHero(uid string, heroCfgId string, num int32) (*pb.DBHero, error)
|
||||
// 批量创建英雄
|
||||
CreateRepeatHeros(session IUserSession, items map[string]int32, bPush bool) (code pb.ErrorCode)
|
||||
// 获取英雄
|
||||
// heroId 英雄ID
|
||||
GetHeroByObjID(uid, heroId string) (*pb.DBHero, pb.ErrorCode)
|
||||
|
@ -157,3 +157,17 @@ func (this *Hero) EventUserOffline(session comm.IUserSession) {
|
||||
err := this.modelHero.RemoveUserHeroInfo(session)
|
||||
this.Debugf("EventUserOffline:%s err:%v", session, err)
|
||||
}
|
||||
|
||||
// 批量创建多个英雄
|
||||
func (this *Hero) CreateRepeatHeros(session comm.IUserSession, items map[string]int32, bPush bool) (code pb.ErrorCode) {
|
||||
|
||||
for heroCfgId, num := range items {
|
||||
_, err := this.modelHero.createHeroOverlying(session.GetUserId(), heroCfgId, num)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_HeroCreate
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ func (this *apiComp) GetUserMailAttachment(session comm.IUserSession, req *pb.Ma
|
||||
// 修改状态
|
||||
this.module.modelMail.MailUpdateMailAttachmentState(req.ObjID)
|
||||
mail.Reward = true
|
||||
return
|
||||
//return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user