33 lines
859 B
Go
33 lines
859 B
Go
package equipment
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/sys/log"
|
|
"go_dreamfactory/pb"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) GetlistCheck(session comm.IUserSession, req *pb.EquipmentGetListReq) (result map[string]interface{}, code comm.ErrorCode) {
|
|
|
|
return
|
|
}
|
|
|
|
///获取用户装备列表
|
|
func (this *apiComp) Getlist(session comm.IUserSession, agrs map[string]interface{}, req *pb.EquipmentGetListReq) (code pb.ErrorCode) {
|
|
var (
|
|
err error
|
|
items []*pb.DB_Equipment
|
|
)
|
|
defer func() {
|
|
if code == pb.ErrorCode_Success {
|
|
session.SendMsg(string(this.module.GetType()), "", &pb.EquipmentGetListResp{Equipments: items})
|
|
}
|
|
}()
|
|
if items, err = this.module.modelEquipment.QueryUserEquipments(session.GetUserId()); err != nil {
|
|
log.Errorf("QueryUserPackReq err:%v", err)
|
|
code = pb.ErrorCode_CacheReadError
|
|
return
|
|
}
|
|
return
|
|
}
|