go_dreamfactory/modules/enchant/api_getlist.go
2024-01-25 15:55:25 +08:00

35 lines
789 B
Go

package enchant
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
)
//参数校验
func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.EnchantGetListReq) (errdata *pb.ErrorData) {
return
}
func (this *apiComp) GetList(session comm.IUserSession, req *pb.EnchantGetListReq) (errdata *pb.ErrorData) {
var (
info *pb.DBEnchant
err error
)
// 刷新挑战卷
if errdata = this.module.ModuleItems.RecoverTicket(session); errdata != nil {
return
}
if info, err = this.module.modelEnchant.getEnchantList(session.GetUserId()); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Message: err.Error(),
}
return
}
session.SendMsg(string(this.module.GetType()), EnchantGetListResp, &pb.EnchantGetListResp{Data: info})
return
}