ApiJ/routes/api.php

191 lines
13 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php
use App\Http\Controllers\AdminController;
use App\Http\Controllers\DoctorController;
use App\Http\Controllers\PatientController;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "api" middleware group. Make something great!
|
*/
Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
return $request->user();
});
//Route::middleware('auth:api')->get('/user', function (Request $request) {
// return $request->user();
//});
//
//
//Route::group(['namespace' => 'Api'], function () {
// Route::group(['namespace' => 'Auth'], function () {
// Route::POST('/register', [RegisterController::class,'__invoke']);
// Route::POST('/login', [LoginController::class,'__invoke']);
// Route::POST('/logout', [LogoutController::class,'__invoke'])->middleware('auth:api');
// });
//});
//
//Запросы врача
//Админ
Route::post('/AddSportCourses', [AdminController::class,'AddSportCourses']);//Добавление курса(название)
Route::post('/falseVisivilitySportCourses', [AdminController::class,'falseVisivilitySportCourses']);//Отключение курса(название)
Route::put('/VisivilitySportCourses', [AdminController::class,'VisivilitySportCourses']);//Включение/отключение курса
Route::post('/AddSportTasks', [AdminController::class,'AddSportTasks']);//Добавление упражнения
Route::post('/AddImage', [AdminController::class,'AddImage']);//Добавление фотографии
Route::post('/CreateAccountDoctor', [AdminController::class,'CreateAccountDoctor']);//Регистрация врача
Route::post('/CreateSetsOfSportsActivities', [AdminController::class,'CreateSetsOfSportsActivities']);//Добавление записи в набор курсов
Route::post('/CreateSetsOfSportsExercises', [AdminController::class,'CreateSetsOfSportsExercises']);//Создание связи между набором для курса и упражнения
Route::get('/GetCours', [AdminController::class,'GetCours']);//ВЫвод курса по названию(1 курс)
//Запросы для пациента
//Route::get('/asdasdas', [PatientController::class,'asdasdas']);//Авторизация пациента
Route::post('/LoginPatient', [PatientController::class,'LoginPatient']);//Авторизация пациента
Route::middleware(['auth:patient_token'],)->group(function(){
Route::get('/CheckTokenPatient', [PatientController::class,'CheckTokenPatient']);//Проверка токена, если при запуске приложения данный запрос вернет "300" значит токен действителен, иначе выбросит пользователя на страницу авторизации, данный запрос вызовется в том случае если в приложение пресутсвуют данные в переменной Token
Route::post('/LogoutPatient', [PatientController::class,'LogoutPatient']);//Авторизация
Route::post('/AddBeforeQuestionnaire', [PatientController::class,'AddBeforeQuestionnaire']);//Заполнение анкеты ДО
Route::post('/AddAfterQuestionnaire', [PatientController::class,'AddAfterQuestionnaire']);//Заполнение анкеты ПОСЛЕ
Route::post('/AddCourses', [PatientController::class,'AddCourses']);//Добавление курса на сегодня
Route::post('/AddCourses2', [PatientController::class,'AddCourses2']);//Добавление курса на сегодня
Route::get('/CoutSportCourses', [PatientController::class,'CoutSportCourses']);//Вывод списка спортивных задания на 1 день
Route::get('/VisibleView', [PatientController::class,'VisibleView']);//Вывод нужного экрана
Route::get('/VisibleView2', [PatientController::class,'VisibleView2']);//Вывод нужного экрана
Route::get('/VisibleView3', [PatientController::class,'VisibleView3']);//Вывод нужного экрана
//Для тестов
Route::post('/AddBeforeQuestionnaire2', [PatientController::class,'AddBeforeQuestionnaire2']);
Route::post('/AddAfterQuestionnaire2', [PatientController::class,'AddAfterQuestionnaire2']);//Заполнение анкеты ПОСЛЕ
//Проверка токена
Route::get('/PatientCalendareDay', [PatientController::class,'PatientCalendareDay']);//Вывод календаря
Route::get('/GetSportDay',[PatientController::class,'GetSportDay']);//Вывод списка упражнений
Route::get('/GetSportDayOne',[PatientController::class,'GetSportDayOne']);//Вывод определенного упражнения
// Route::get('/asddsasdasad',[PatientController::class,'asddsasdasad']);//Вывод определенного упражнения
Route::put('/AddSportCheck',[PatientController::class,'AddSportCheck']);//Подтверждение выполненности упражнения
Route::get('/ProgressPatientCourses',[PatientController::class,'ProgressPatientCourses']);//Вывод прогресса пациента
//Сообщения
Route::get('/GetAppealsPatientNew',[PatientController::class,'GetAppealsPatientNew']); //Получение необработанных заявлений
Route::get('/GetAppealsPatientOld',[PatientController::class,'GetAppealsPatientOld']); //Получение обработанных заявлений
Route::post('/AddMessagePatient',[PatientController::class,'AddMessagePatient']); //Создание сообщение от врача
Route::put('/UpdateMessagePatient',[PatientController::class,'UpdateMessagePatient']); //Обработано сообщение от пациента
//День окончания блока и паузы
Route::get('/getDatePause',[PatientController::class,'getDatePause']); //день окончания паузы
Route::get('/getDateBlock',[PatientController::class,'getDateBlock']); //День окончания блока
Route::get('/LookBefore',[PatientController::class,'LookBefore']); //Проверка на то есть ли анкета ДО
Route::get('/LookAfter',[PatientController::class,'LookAfter']); //Проверка на то есть ли анкета ПОСЛЕ
Route::get('/GetCalendare',[PatientController::class,'GetCalendare']); //Вывод списка дней календаря
Route::get('/dkkofskfkk',[PatientController::class,'dkkofskfkk']); //dkkofskfkk
//Route::get('/AddDayCalendare', [PatientController::class,'AddDayCalendare']);//Вывод данных для первой страницы врача
Route::get('/AddandClearDayPatient',[PatientController::class,'AddandClearDayPatient']); //Вывод списка дней календаря
});
//Запросы для врача
Route::post('/LoginDoctor', [DoctorController::class,'LoginDoctor']);//Авторизация врача
Route::middleware(['auth:doctor_token'],)->group(function(){
Route::get('/CheckTokenDoctor', [DoctorController::class,'CheckTokenDoctor']);
Route::post('/LogoutDoctor', [DoctorController::class,'LogoutDoctor']);//Авторизация
Route::get('/GetPatientAll', [DoctorController::class,'GetPatientAll']);//Вывод всех пациентов
Route::get('/GetPatientAllActive', [DoctorController::class,'GetPatientAllActive']);//Вывод всех пациентов определенного врача с активными курсами
Route::get('/GetPatientAllNotActive', [DoctorController::class,'GetPatientAllNotActive']);//Вывод всех пациентов определенного врача с не активными курсами
Route::get('/GetPatientID', [DoctorController::class,'GetPatientID']);//Вывод пациента по if
Route::get('/GetPatientSearch', [DoctorController::class,'GetPatientSearch']);//Вывод пациентов
Route::post('/CreateAccountPatient', [DoctorController::class,'CreateAccountPatient']);//Создание аккаунта
Route::put('/UpdateAccountPatient', [DoctorController::class,'UpdateAccountPatient']);//Обновление данных пользователя
//Route::post('/AddCoursesAccountPatient', [DoctorController::class,'AddCoursesAccountPatient']);//Добавление курса пациенту
Route::put('/UpdateBlockAccountPatient', [DoctorController::class,'UpdateBlockAccountPatient']);//Добавление блокировки
Route::put('/UpdatePauseAccountPatient', [DoctorController::class,'UpdatePauseAccountPatient']);//Добавление паузы
// Route::post('/Addreport7dayAccountPatient', [DoctorController::class,'Addreport7dayAccountPatient']);//Добавление паузы
// Route::post('/Addreport15dayAccountPatient', [DoctorController::class,'Addreport15dayAccountPatient']);//Добавление паузы
Route::get('/GetCours', [DoctorController::class,'GetCours']);//Получения курса пациента в зависимости от того сколько дней пройдено
Route::post('/AddSportPatient', [DoctorController::class,'AddSportPatient']);//Добавление курса пациенту
Route::put('/ClearPatientSport', [DoctorController::class,'ClearPatientSport']);//Очистка курса у пациента
Route::get('/GetPatientBAQiestionar', [DoctorController::class,'GetPatientBAQiestionar']);//Вывод отчетов
Route::get('/GetCoursAll', [DoctorController::class,'GetCoursAll']);//Вывод всех курсов
Route::get('/GetCoursAllPatient', [DoctorController::class,'GetCoursAllPatient']);//Вывод курссов стандартных
Route::get('/GetCoursesDoctorPatient', [DoctorController::class,'GetCoursesDoctorPatient']);//Вывод курса кастомных от врача
Route::get('/GetCoursesSport', [DoctorController::class,'GetCoursesSport']);//Вывод список упражнений курса
Route::get('/GetCoursesSportYes', [DoctorController::class,'GetCoursesSportYes']);//Вывод список включенных упражнений курса
Route::get('/GetCoursesSportNo', [DoctorController::class,'GetCoursesSportNo']);//Вывод список отключенных упражнений курса
Route::put('/UpdateBlockSportTasksYes', [DoctorController::class,'UpdateBlockSportTasksYes']);//Включение упражнения
Route::put('/UpdateBlockSportTasksNo', [DoctorController::class,'UpdateBlockSportTasksNo']);//Отключение упражнения
Route::put('/UpdatePatientLogin', [DoctorController::class,'UpdatePatientLogin']);//Обновление логина пациента
Route::put('/UpdatePatientPassword', [DoctorController::class,'UpdatePatientPassword']);//Обновление пароля пациента
//Сообщения
Route::get('/GetAppealsDoctorNew',[DoctorController::class,'GetAppealsDoctorNew']); //Получение необработанных заявлений
Route::get('/GetAppealsDoctorOld',[DoctorController::class,'GetAppealsDoctorOld']); //Получение обработанных заявлений
Route::post('/AddMessageDoctor',[DoctorController::class,'AddMessageDoctor']); //Создание сообщение от врача
Route::put('/UpdateMessageDoctor',[DoctorController::class,'UpdateMessageDoctor']); //Обработано сообщение от пациента
Route::post('/AddCoursesName', [DoctorController::class,'AddCoursesName']);//Создание основы для собственного курса от врача
Route::get('/GetCoursesDoctor', [DoctorController::class,'GetCoursesDoctor']);//Вывод созданных курсов врача
Route::post('/AddCoursesCreatingDoctor',[DoctorController::class,'AddCoursesCreatingDoctor']); //Добавление упражнения в курс врача
Route::delete('/ClearCoursesCreatingDoctor',[DoctorController::class,'ClearCoursesCreatingDoctor']); //Удаление упражнения в курс врача
Route::get('/GetEditCourseDoctorAll', [DoctorController::class,'GetEditCourseDoctorAll']);//Вывод всех упражнений не входящих в курс
Route::get('/GetEditCourseDoctorYour', [DoctorController::class,'GetEditCourseDoctorYour']);//Вывод всех упражнений входящих в курс
Route::get('/CountPatientAndAppeals', [DoctorController::class,'CountPatientAndAppeals']);//Вывод данных для первой страницы врача
});
Route::get('/GetCoursAll', [DoctorController::class,'GetCoursAll']);//Вывод всех курсов
//Очистка
Route::get('/clear', function() {
Artisan::call('cache:clear');
Artisan::call('config:clear');
Artisan::call('config:cache');
Artisan::call('view:clear');
Artisan::call('route:clear');
return "Cleared!";
});