зеркало из https://github.com/nextcloud/cookbook.git
Create a basic structure to fetch the api version
Signed-off-by: Christian Wolf <github@christianwolf.email>
This commit is contained in:
Родитель
50dcd5edac
Коммит
8c5f42bd2b
|
@ -9,6 +9,7 @@
|
||||||
*/
|
*/
|
||||||
return [
|
return [
|
||||||
'routes' => [
|
'routes' => [
|
||||||
|
['name' => 'main#getApiVersion', 'url' => '/api/version', 'verb' => 'GET'],
|
||||||
['name' => 'main#index', 'url' => '/', 'verb' => 'GET'],
|
['name' => 'main#index', 'url' => '/', 'verb' => 'GET'],
|
||||||
['name' => 'main#home', 'url' => '/home', 'verb' => 'GET'],
|
['name' => 'main#home', 'url' => '/home', 'verb' => 'GET'],
|
||||||
['name' => 'main#keywords', 'url' => '/keywords', 'verb' => 'GET'],
|
['name' => 'main#keywords', 'url' => '/keywords', 'verb' => 'GET'],
|
||||||
|
|
|
@ -55,6 +55,22 @@ class MainController extends Controller {
|
||||||
|
|
||||||
return new TemplateResponse($this->appName, 'index', $view_data); // templates/index.php
|
return new TemplateResponse($this->appName, 'index', $view_data); // templates/index.php
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @NoAdminRequired
|
||||||
|
* @NoCSRFRequired
|
||||||
|
* @return DataResponse
|
||||||
|
*/
|
||||||
|
public function getApiVersion(): DataResponse {
|
||||||
|
$response = [
|
||||||
|
'cookbook_version' => [0,7,7], /* VERSION_TAG */
|
||||||
|
'api_version' => [
|
||||||
|
'major' => 0,
|
||||||
|
'minor' => 1
|
||||||
|
]
|
||||||
|
];
|
||||||
|
return new DataResponse($response, 200, ['Content-Type' => 'application/json']);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @NoAdminRequired
|
* @NoAdminRequired
|
||||||
|
|
Загрузка…
Ссылка в новой задаче