46 lines
1.1 KiB
Go
46 lines
1.1 KiB
Go
package entertainment
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
"go_dreamfactory/sys/configure"
|
|
"go_dreamfactory/utils"
|
|
)
|
|
|
|
//参数校验
|
|
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
|
|
}
|
|
|
|
if !utils.IsToday(list.Rtime) {
|
|
list.Rtime = configure.Now().Unix()
|
|
for _, v := range this.module.configure.GetGameConsumeIntegral() {
|
|
list.Playtype = append(list.Playtype, v.Key) // 配置读取一个玩法
|
|
}
|
|
this.module.model.modifyEntertainmList(session.GetUserId(), map[string]interface{}{
|
|
"rtime": list.Rtime,
|
|
"playtype": list.Playtype,
|
|
})
|
|
}
|
|
session.SendMsg(string(this.module.GetType()), "getlist", &pb.EntertainGetListResp{
|
|
Data: list,
|
|
})
|
|
return
|
|
}
|