2024-03-19 22:34:01 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\API;
|
|
|
|
|
|
|
|
use App\Http\Controllers\Controller;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use App\Services\SettingsService;
|
|
|
|
use App\Services\RenderService;
|
|
|
|
|
|
|
|
class SettingsAPIController extends Controller
|
|
|
|
{
|
|
|
|
protected $settings;
|
|
|
|
protected $render;
|
|
|
|
|
|
|
|
public function __construct(SettingsService $settingsService, RenderService $renderService)
|
|
|
|
{
|
|
|
|
$this->settings = $settingsService;
|
|
|
|
$this->render = $renderService;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function publish(Request $request)
|
|
|
|
{
|
|
|
|
$result = $this->render->publishAll();
|
|
|
|
return response()->json($result)->header('Content-Type', 'application/json');
|
|
|
|
}
|
2024-03-19 23:35:02 +01:00
|
|
|
|
|
|
|
public function sync(Request $request)
|
|
|
|
{
|
|
|
|
$body = json_decode($request->getContent());
|
|
|
|
$result = $this->settings->sync($body);
|
|
|
|
return response()->json($result)->header('Content-Type', 'application/json');
|
|
|
|
}
|
2024-03-22 21:35:44 +01:00
|
|
|
|
|
|
|
public function navSync(Request $request)
|
|
|
|
{
|
|
|
|
$body = json_decode($request->getContent());
|
|
|
|
$result = $this->settings->navSync($body);
|
|
|
|
return response()->json($result)->header('Content-Type', 'application/json');
|
|
|
|
}
|
2024-03-19 22:34:01 +01:00
|
|
|
}
|