出售装备 返回err 对象
This commit is contained in:
parent
c6b0c430de
commit
5d9afc817a
@ -1,7 +1,6 @@
|
||||
package smithy
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
)
|
||||
@ -28,13 +27,13 @@ func (this *apiComp) Sell(session comm.IUserSession, req *pb.SmithySellReq) (err
|
||||
this.module.ModuleEquipment.RecycleEquipments(session, req.EquipIds, this.module.modelStove.StoveToolsSellUp(session.GetUserId()))
|
||||
|
||||
cus, err := this.module.modelTrade.updateCustomer(session.GetUserId(), req.CustomerId)
|
||||
var customErr = new(comm.CustomError)
|
||||
if errors.As(err, &customErr) {
|
||||
code := customErr.Code
|
||||
if err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: code,
|
||||
Title: code.ToString(),
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
conf, err := this.module.configure.GetSmithyCustomerConf(req.CustomerId)
|
||||
|
Loading…
Reference in New Issue
Block a user