32 lines
819 B
Go
32 lines
819 B
Go
package equipment
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) GetlistCheck(session comm.IUserSession, req *pb.EquipmentGetListReq) (code pb.ErrorCode) {
|
|
|
|
return
|
|
}
|
|
|
|
///获取用户装备列表
|
|
func (this *apiComp) Getlist(session comm.IUserSession, req *pb.EquipmentGetListReq) (code pb.ErrorCode, data *pb.ErrorData) {
|
|
var (
|
|
err error
|
|
items []*pb.DB_Equipment
|
|
)
|
|
if items, err = this.module.modelEquipment.QueryUserEquipments(session.GetUserId()); err != nil {
|
|
this.module.Errorf("QueryUserPackReq err:%v", err)
|
|
code = pb.ErrorCode_CacheReadError
|
|
data = &pb.ErrorData{
|
|
Title: code.ToString(),
|
|
Message: err.Error(),
|
|
}
|
|
return
|
|
}
|
|
session.SendMsg(string(this.module.GetType()), "getlist", &pb.EquipmentGetListResp{Equipments: items})
|
|
return
|
|
}
|