31 lines
763 B
Go
31 lines
763 B
Go
package user
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
func (this *apiComp) GetTujianCheck(session comm.IUserSession, req *pb.UserGetTujianReq) (code pb.ErrorCode) {
|
|
return
|
|
}
|
|
|
|
func (this *apiComp) GetTujian(session comm.IUserSession, req *pb.UserGetTujianReq) (code pb.ErrorCode, data proto.Message) {
|
|
if code = this.GetTujianCheck(session, req); code != pb.ErrorCode_Success {
|
|
return
|
|
}
|
|
|
|
rsp := &pb.UserGetTujianResp{}
|
|
list := this.module.ModuleHero.GetHeroList(session.GetUserId())
|
|
for _, v := range list {
|
|
rsp.Heroids = append(rsp.Heroids, v.HeroID)
|
|
}
|
|
|
|
err := session.SendMsg(string(this.module.GetType()), UserGetTujianResp, rsp)
|
|
if err != nil {
|
|
code = pb.ErrorCode_SystemError
|
|
}
|
|
return
|
|
}
|