go_dreamfactory/modules/entertainment/api_getlist.go

38 lines
942 B
Go

package entertainment
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
)
//参数校验
func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.EntertainGetListReq) (errdata *pb.ErrorData) {
return
}
func (this *apiComp) GetList(session comm.IUserSession, req *pb.EntertainGetListReq) (errdata *pb.ErrorData) {
var (
list *pb.DBXXLData
err error
)
list, err = this.module.model.getEntertainmList(session.GetUserId())
if err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
for _, v := range this.module.configure.GetGameConsumeIntegral() {
list.Playtype = append(list.Playtype, v.Key) // 配置读取一个玩法
}
list.Rtime = configure.Now().Unix()
session.SendMsg(string(this.module.GetType()), "getlist", &pb.EntertainGetListResp{
Data: list,
})
return
}