go_dreamfactory/modules/hero/api_list.go
2022-06-27 19:08:54 +08:00

33 lines
721 B
Go

package hero
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
)
//参数校验
func (this *Api_Comp) List_Check(session comm.IUserSession, req *pb.Hero_List_Req) (result map[string]interface{}, code comm.ErrorCode) {
return
}
func (this *Api_Comp) List(session comm.IUserSession, result map[string]interface{}, req *pb.Hero_List_Req) (code pb.ErrorCode) {
rsp := &pb.Hero_List_Rsp{}
defer func() {
err := session.SendMsg(this.module.api_comp.service.GetType(), Hero_SubType_List, rsp)
if err != nil {
code = pb.ErrorCode_SystemError
}
}()
list, err := this.module.model_hero.getHeroList(session.GetUserId())
if err != nil {
code = pb.ErrorCode_DBError
return
}
rsp.List = list
return
}