30 lines
773 B
Go
30 lines
773 B
Go
package viking
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.VikingGetListReq) (errdata *pb.ErrorData) {
|
|
|
|
return
|
|
}
|
|
|
|
func (this *apiComp) GetList(session comm.IUserSession, req *pb.VikingGetListReq) (errdata *pb.ErrorData) {
|
|
if errdata = this.GetListCheck(session, req); errdata != nil {
|
|
return // 参数校验失败直接返回
|
|
}
|
|
|
|
list, err := this.module.modelViking.getVikingList(session.GetUserId())
|
|
if err != nil {
|
|
errdata = &pb.ErrorData{
|
|
Code: pb.ErrorCode_DBError,
|
|
Title: pb.ErrorCode_DBError.ToString(),
|
|
Message: err.Error(),
|
|
}
|
|
}
|
|
session.SendMsg(string(this.module.GetType()), VikingGetListResp, &pb.VikingGetListResp{Data: list})
|
|
return
|
|
}
|