重新推送
This commit is contained in:
@@ -360,4 +360,35 @@ class UsedCarDetailController extends BaseController
|
||||
return $this->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新推送失败的车辆到WordPress
|
||||
*
|
||||
* @param Request $request
|
||||
* @return \support\Response
|
||||
*/
|
||||
public function retryPush(Request $request)
|
||||
{
|
||||
try {
|
||||
$carId = $request->post('id');
|
||||
|
||||
if (empty($carId)) {
|
||||
throw new BusinessException('车辆ID不能为空');
|
||||
}
|
||||
|
||||
$count = $this->service->retryPush($carId);
|
||||
|
||||
if ($count === 0) {
|
||||
return $this->error('车辆不存在或状态不是推送失败');
|
||||
}
|
||||
|
||||
return $this->success(['count' => $count], 'WordPress推送任务已重新加入队列');
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('重新推送失败', [
|
||||
'car_id' => $request->post('id'),
|
||||
'error' => $e->getMessage(),
|
||||
]);
|
||||
return $this->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user