run(fn () => $service->listing()); } public function save(RechargeBonusAdminService $service) { return $this->run(fn () => $service->save(request()->all())); } public function status(RechargeBonusAdminService $service) { return $this->run(fn () => $service->status(request()->all())); } private function run(callable $callback) { try { return $this->success($callback()); } catch (ValidationException $e) { return $this->error(-3, $e->validator->errors()->first()); } catch (\Throwable $e) { Log::error('recharge_bonus_failed', ['exception' => $e]); return $this->error(-3, '充值赠送操作失败,请稍后重试'); } } }