2024-04-16 23:36:57 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\API;
|
|
|
|
|
|
|
|
use App\Http\Controllers\Controller;
|
|
|
|
use Illuminate\Http\Request;
|
2024-06-03 04:52:01 +02:00
|
|
|
use App\Services\UpKeep\InitService;
|
2024-04-16 23:36:57 +02:00
|
|
|
|
|
|
|
class InitAPIController extends Controller
|
|
|
|
{
|
|
|
|
protected $init;
|
|
|
|
|
|
|
|
public function __construct(InitService $initService)
|
|
|
|
{
|
|
|
|
$this->init = $initService;
|
|
|
|
}
|
|
|
|
|
|
|
|
//init stuff
|
|
|
|
public function setupFresh(Request $request)
|
|
|
|
{
|
|
|
|
$result = $this->init->fresh(json_decode($request->getContent()));
|
|
|
|
return response()->json($result)->header('Content-Type', 'application/json');
|
|
|
|
}
|
2024-04-18 22:36:05 +02:00
|
|
|
|
|
|
|
public function setupRestore(Request $request)
|
|
|
|
{
|
|
|
|
$result = $this->init->restore($request);
|
|
|
|
return response()->json($result)->header('Content-Type', 'application/json');
|
|
|
|
}
|
2024-04-16 23:36:57 +02:00
|
|
|
}
|