接口补充

This commit is contained in:
meixiongfeng 2023-05-08 20:06:06 +08:00
parent 4a2971f08e
commit 4b5ebf9268

View File

@ -6,7 +6,7 @@ import (
) )
//参数校验 //参数校验
func (this *apiComp) SellItemCheck(session comm.IUserSession, req *pb.UserSellResReq) (code pb.ErrorCode) { func (this *apiComp) SellResCheck(session comm.IUserSession, req *pb.UserSellResReq) (code pb.ErrorCode) {
if len(req.Atno) == 0 { if len(req.Atno) == 0 {
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
} }
@ -14,14 +14,14 @@ func (this *apiComp) SellItemCheck(session comm.IUserSession, req *pb.UserSellRe
} }
//分解道具 //分解道具
func (this *apiComp) SellItem(session comm.IUserSession, req *pb.UserSellResReq) (code pb.ErrorCode, data *pb.ErrorData) { func (this *apiComp) SellRes(session comm.IUserSession, req *pb.UserSellResReq) (code pb.ErrorCode, data *pb.ErrorData) {
var ( var (
equip []string // 出售的装备 equip []string // 出售的装备
sale []*pb.UserAssets sale []*pb.UserAssets
mapitem map[string]int32 mapitem map[string]int32
) )
mapitem = map[string]int32{} mapitem = map[string]int32{}
if code = this.SellItemCheck(session, req); code != pb.ErrorCode_Success { if code = this.SellResCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
for _, v := range req.Atno { for _, v := range req.Atno {
@ -32,7 +32,7 @@ func (this *apiComp) SellItem(session comm.IUserSession, req *pb.UserSellResReq)
} }
} }
if len(mapitem) > 0 { if len(mapitem) > 0 {
if c, d := this.module.ModuleItems.SellItem(session, mapitem); c != pb.ErrorCode_Success { if c, d := this.module.ModuleItems.SellItem(session, mapitem, true); c != pb.ErrorCode_Success {
for _, v := range d { for _, v := range d {
sale = append(sale, &pb.UserAssets{ sale = append(sale, &pb.UserAssets{
A: v.A, A: v.A,