<?php
/**
 * This file is part of webman.
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the MIT-LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @author    walkor<walkor@workerman.net>
 * @copyright walkor<walkor@workerman.net>
 * @link      http://www.workerman.net/
 * @license   http://www.opensource.org/licenses/mit-license.php MIT License
 */

use Webman\Route;

Route::get('/', [app\controller\AdminController::class, 'landing']);
Route::get('/admin/login', [app\controller\AdminController::class, 'login']);
Route::get('/admin', [app\controller\AdminController::class, 'dashboard']);

Route::post('/api/articles/import', [app\controller\Api\ArticleImportController::class, 'import']);
Route::post('/api/admin/login', [app\controller\Api\AdminAuthController::class, 'login']);
Route::post('/api/admin/logout', [app\controller\Api\AdminAuthController::class, 'logout']);
Route::get('/api/admin/me', [app\controller\Api\AdminAuthController::class, 'me']);
Route::get('/api/admin/archives', [app\controller\Api\AdminConsoleController::class, 'archives']);
Route::get('/api/admin/archives/{archiveUid}', [app\controller\Api\AdminConsoleController::class, 'archive']);
Route::patch('/api/admin/archives/{archiveUid}', [app\controller\Api\AdminConsoleController::class, 'updateArchive']);
Route::delete('/api/admin/archives/{archiveUid}', [app\controller\Api\AdminConsoleController::class, 'deleteArchive']);
Route::get('/api/admin/opensearch/status', [app\controller\Api\AdminConsoleController::class, 'openSearchStatus']);
Route::get('/api/admin/opensearch/documents', [app\controller\Api\AdminConsoleController::class, 'openSearchDocuments']);
Route::get('/api/admin/users', [app\controller\Api\AdminConsoleController::class, 'users']);
Route::post('/api/admin/users', [app\controller\Api\AdminConsoleController::class, 'createUser']);
Route::patch('/api/admin/users/{id}', [app\controller\Api\AdminConsoleController::class, 'updateUser']);
Route::get('/api/admin/docs', [app\controller\Api\AdminConsoleController::class, 'docs']);
Route::get('/api/admin/docs/{name}', [app\controller\Api\AdminConsoleController::class, 'doc']);
Route::get('/api/admin/scripts', [app\controller\Api\AdminConsoleController::class, 'scripts']);
Route::get('/api/admin/scripts/{name}', [app\controller\Api\AdminConsoleController::class, 'script']);
Route::post('/api/admin/scripts/run', [app\controller\Api\AdminConsoleController::class, 'runScript']);
Route::post('/api/search/fulltext', [app\controller\Api\SearchController::class, 'fulltext']);
Route::post('/api/search/vector', [app\controller\Api\SearchController::class, 'vector']);
Route::post('/api/search/hybrid', [app\controller\Api\SearchController::class, 'hybrid']);
Route::get('/api/archives/{archive_uid}', [app\controller\Api\EvidenceController::class, 'archive']);
Route::get('/api/archives/{archive_uid}/chunks', [app\controller\Api\EvidenceController::class, 'archiveChunks']);
Route::get('/api/archives/{archive_uid}/evidence', [app\controller\Api\EvidenceController::class, 'archiveEvidence']);
Route::get('/api/chunks/{chunk_uid}', [app\controller\Api\EvidenceController::class, 'chunk']);
Route::get('/api/evidence/{chunk_uid}', [app\controller\Api\EvidenceController::class, 'evidence']);
