diff --git a/internal/service/iot_card/stop_resume_service.go b/internal/service/iot_card/stop_resume_service.go index 342cdd9..aaea325 100644 --- a/internal/service/iot_card/stop_resume_service.go +++ b/internal/service/iot_card/stop_resume_service.go @@ -176,9 +176,7 @@ func (s *StopResumeService) hasAvailablePackage(ctx context.Context, cardID uint // stopCardWithRetry 任务 24.5: 调用运营商停机接口(带重试机制) func (s *StopResumeService) stopCardWithRetry(ctx context.Context, card *model.IotCard) error { if s.gatewayClient == nil { - s.logger.Warn("Gateway 客户端未配置,跳过调用运营商接口", - zap.Uint("card_id", card.ID)) - return nil + return errors.New(errors.CodeInternalError, "Gateway 未配置,停复机操作不可用") } var lastErr error @@ -209,9 +207,7 @@ func (s *StopResumeService) stopCardWithRetry(ctx context.Context, card *model.I // resumeCardWithRetry 任务 24.5: 调用运营商复机接口(带重试机制) func (s *StopResumeService) resumeCardWithRetry(ctx context.Context, card *model.IotCard) error { if s.gatewayClient == nil { - s.logger.Warn("Gateway 客户端未配置,跳过调用运营商接口", - zap.Uint("card_id", card.ID)) - return nil + return errors.New(errors.CodeInternalError, "Gateway 未配置,停复机操作不可用") } var lastErr error