group(function() { Route::post('login', [AuthController::class, 'login']); Route::any('unauthorized', [AuthController::class, 'unauthorized'])->name('login'); // 支付回调 Route::any('notify', [NotifyController::class, 'notify']); Route::middleware(['auth:sanctum'])->group(function() { // 患者模块 Route::prefix('Patient')->group(function () { Route::get('/', [PatientController::class, 'lists']); Route::get('/{patient_id}', [PatientController::class, 'details']); Route::post('/create', [PatientController::class, 'create']); Route::post('/bind', [PatientController::class, 'bind']); Route::post('/{patient_id}/default', [PatientController::class, 'setDefault']); Route::delete('/{patient_id}/delete', [PatientController::class, 'delete']); }); // 挂号模块 Route::prefix('Registration')->group(function () { Route::get('/dept', [ScheduleController::class, 'dept']); Route::get('/doctor', [ScheduleController::class, 'doctor']); Route::post('/{patient_id}/register', [RegisterController::class, 'register']); Route::get('/{patient_id}/record', [RegistrationRecordController::class, 'lists']); Route::post('/{patient_id}/record/{serial_no}/refund', [RegistrationRecordController::class, 'refund']); }); // 缴费模块 Route::prefix('Outpatient')->group(function () { Route::get('/{patient_id}/pending', [PendingController::class, 'lists']); Route::get('/{patient_id}/pending/{serial_no}/', [PendingController::class, 'details']); Route::post('/{patient_id}/pending/{serial_no}/payment', [PaymentController::class, 'payment']); Route::get('/{patient_id}/record', [OutpatientRecordController::class, 'lists']); Route::get('/{patient_id}/record/{serial_no}/', [OutpatientRecordController::class, 'details']); }); // 缴费详情项目 Route::prefix('Dictionary')->group(function () { Route::get('/', [ItemController::class, 'lists']); Route::get('/{type_id}', [ItemController::class, 'details'])->where('type_id', '[0-9]+');; }); }); });