34 lines
808 B
Go
34 lines
808 B
Go
package guidance
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
)
|
|
|
|
// 参数校验
|
|
func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.GuidanceInfoReq) (errdata *pb.ErrorData) {
|
|
|
|
return
|
|
}
|
|
|
|
// 获取引导信息
|
|
func (this *apiComp) Info(session comm.IUserSession, req *pb.GuidanceInfoReq) (errdata *pb.ErrorData) {
|
|
if errdata = this.InfoCheck(session, req); errdata != nil {
|
|
return
|
|
}
|
|
var (
|
|
gourmet *pb.DBGuidance
|
|
err error
|
|
)
|
|
if gourmet, err = this.module.modelGuidance.getUserGourmet(session.GetUserId()); err != nil {
|
|
errdata = &pb.ErrorData{
|
|
Code: pb.ErrorCode_DBError,
|
|
Title: pb.ErrorCode_DBError.ToString(),
|
|
Message: err.Error(),
|
|
}
|
|
return
|
|
}
|
|
session.SendMsg(string(this.module.GetType()), "info", &pb.GuidanceInfoResp{Info: gourmet})
|
|
return
|
|
}
|