35 lines
829 B
Go
35 lines
829 B
Go
package hero
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
"go_dreamfactory/utils"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.HeroListReq) (result map[string]interface{}, code comm.ErrorCode) {
|
|
return
|
|
}
|
|
|
|
func (this *apiComp) List(session comm.IUserSession, result map[string]interface{}, req *pb.HeroListReq) (code pb.ErrorCode) {
|
|
rsp := &pb.HeroListRsp{}
|
|
|
|
defer func() {
|
|
err := session.SendMsg(string(this.moduleHero.GetType()), HeroSubTypeList, rsp)
|
|
if err != nil {
|
|
code = pb.ErrorCode_SystemError
|
|
}
|
|
utils.TraceFunc(session.GetUserId(), string(this.moduleHero.GetType()), HeroSubTypeList, req, rsp)
|
|
}()
|
|
|
|
list, err := this.moduleHero.hero.getHeroList(session.GetUserId())
|
|
if err != nil {
|
|
code = pb.ErrorCode_DBError
|
|
return
|
|
}
|
|
|
|
rsp.List = list
|
|
|
|
return
|
|
}
|