mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-14 19:40:53 +08:00
feat: add one-click update feature to admin panel
This commit is contained in:
28
app/Http/Controllers/V2/Admin/UpdateController.php
Normal file
28
app/Http/Controllers/V2/Admin/UpdateController.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\V2\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\UpdateService;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class UpdateController extends Controller
|
||||
{
|
||||
protected $updateService;
|
||||
|
||||
public function __construct(UpdateService $updateService)
|
||||
{
|
||||
$this->updateService = $updateService;
|
||||
}
|
||||
|
||||
public function checkUpdate()
|
||||
{
|
||||
return $this->success($this->updateService->checkForUpdates());
|
||||
}
|
||||
|
||||
public function executeUpdate()
|
||||
{
|
||||
$result = $this->updateService->executeUpdate();
|
||||
return $result['success'] ? $this->success($result) : $this->fail([500, $result['message']]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user