31 lines
798 B
Go
31 lines
798 B
Go
package equipment
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/sys/log"
|
|
"go_dreamfactory/pb"
|
|
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
//参数校验
|
|
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 proto.Message) {
|
|
var (
|
|
err error
|
|
items []*pb.DB_Equipment
|
|
)
|
|
if items, err = this.module.modelEquipment.QueryUserEquipments(session.GetUserId()); err != nil {
|
|
log.Errorf("QueryUserPackReq err:%v", err)
|
|
code = pb.ErrorCode_CacheReadError
|
|
return
|
|
}
|
|
session.SendMsg(string(this.module.GetType()), "getlist", &pb.EquipmentGetListResp{Equipments: items})
|
|
return
|
|
}
|