fix
This commit is contained in:
@@ -174,14 +174,13 @@ func (s *ApiApplicationServiceImpl) CallApi(ctx context.Context, cmd *commands.A
|
||||
}
|
||||
// apiCall.ResponseData = &encryptedResponse
|
||||
|
||||
// 8. 更新订阅使用次数
|
||||
subscription.IncrementAPIUsage(1)
|
||||
err = s.productSubscriptionService.SaveSubscription(txCtx, subscription)
|
||||
if err != nil {
|
||||
s.logger.Error("保存订阅失败", zap.Error(err))
|
||||
businessError = ErrSystem
|
||||
return ErrSystem
|
||||
}
|
||||
// 8. 更新订阅使用次数(使用乐观锁)
|
||||
// err = s.productSubscriptionService.IncrementSubscriptionAPIUsage(txCtx, subscription.ID, 1)
|
||||
// if err != nil {
|
||||
// s.logger.Error("更新订阅使用次数失败", zap.Error(err))
|
||||
// businessError = ErrSystem
|
||||
// return ErrSystem
|
||||
// }
|
||||
|
||||
// 9. 扣钱
|
||||
err = s.walletService.Deduct(txCtx, apiUser.UserId, subscription.Price, apiCall.ID, transactionId, product.ID)
|
||||
|
||||
Reference in New Issue
Block a user