Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
bc662e1986
@ -1,6 +1,7 @@
|
||||
package smithy
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
)
|
||||
@ -28,11 +29,21 @@ func (this *apiComp) Sell(session comm.IUserSession, req *pb.SmithySellReq) (err
|
||||
|
||||
cus, err := this.module.modelTrade.updateCustomer(session.GetUserId(), req.CustomerId)
|
||||
if err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
Message: err.Error(),
|
||||
var customErr = new(comm.CustomError)
|
||||
if errors.As(err, &customErr) {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: customErr.Code,
|
||||
Title: customErr.Code.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
} else {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Title: pb.ErrorCode_DBError.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -147,7 +147,7 @@ func (s *modelTrade) updateCustomer(uid string, customerId int32) (*pb.DBCustome
|
||||
})
|
||||
cus.LastRefreshTime = configure.Now().Unix()
|
||||
update := map[string]interface{}{
|
||||
"customerIds": cus.Customers,
|
||||
"customers": cus.Customers,
|
||||
"total": cus.Total,
|
||||
"lastRefreshTime": cus.LastRefreshTime,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user