Skip to content
Snippets Groups Projects
Select Git revision
  • f46d4ee8f68cea99d163c58092416942f45c8b46
  • master default protected
  • build_artifacts
3 results

Tests.cs

Blame
  • Forked from mmcs / Compilers
    Source project has a limited visibility.
    v0.php 5.10 KiB
    <?php
    Route::set('apiv0:auth', 'api/v0/auth/<action>')
        ->filter(function($route, $params, $request)
        {
            // Prefix the method to the action name
            $params['action'] = strtolower($request->method()).'_'.$params['action'];
            return $params; // Returning an array will replace the parameters
        })
        ->defaults([
            'action'    => 'index',
            'directory' => 'Api/V0',
            'controller' => 'Auth',
        ]);
    
    Route::set('apiv0:teacher', 'api/v0/teacher(/(<action>(/(<id>))))', ['id' => '\d+'])
        ->filter(function($route, $params, $request)
        {
            // Prefix the method to the action name
            $params['action'] = strtolower($request->method()).'_'.$params['action'];
            return $params; // Returning an array will replace the parameters
        })
        ->defaults([
            'action'    => 'index',
            'directory' => 'Api/V0',
            'controller' => 'Teacher',
        ]);
    
    //Route::set('apiv0:department', 'api/v0/department')
    //    ->filter(function($route, $params, $request)
    //    {
    //        // Prefix the method to the action name
    //        $params['action'] = strtolower($request->method()).'_'.$params['action'];
    //        return $params; // Returning an array will replace the parameters
    //    })
    //    ->defaults([
    //        'action'    => 'index',
    //        'directory' => 'Api/V0',
    //        'controller' => 'Department',
    //    ]);
    
    //Route::set('apiv0:departments', 'api/v0/departments')
    //    ->filter(function($route, $params, $request)
    //    {
    //        // Prefix the method to the action name
    //        $params['action'] = strtolower($request->method()).'_'.$params['action'];
    //        return $params; // Returning an array will replace the parameters
    //    })
    //    ->defaults([
    //        'action'    => 'indexes',
    //        'directory' => 'Api/V0',
    //        'controller' => 'Department',
    //    ]);
    
    //Route::set('apiv0:department:another', 'api/v0/department(/<action>(/<id>))', ['id' => '\d+'])
    //    ->filter(function($route, $params, $request)
    //    {
    //        // Prefix the method to the action name
    //        $params['action'] = strtolower($request->method()).'_'.$params['action'];
    //        return $params; // Returning an array will replace the parameters
    //    })
    //    ->defaults([
    //        'action'    => 'index',
    //        'directory' => 'Api/V0',
    //        'controller' => 'Department',
    //    ]);
    
    Route::set('apiv0:student', 'api/v0/student')
        ->filter(function($route, $params, $request)
        {
            // Prefix the method to the action name
            $params['action'] = strtolower($request->method()).'_'.$params['action'];
            return $params; // Returning an array will replace the parameters
        })
        ->defaults([
            'action'    => 'index',
            'directory' => 'Api/V0',
            'controller' => 'Student',
        ]);
    
    //Route::set('apiv0:student:get', 'api/v0/student(/<id>)', ['id' => '\d+'])
    //    ->filter(function($route, $params, $request)
    //    {
    //        // Prefix the method to the action name
    //        $params['action'] = strtolower($request->method()).'_'.$params['action'];
    //        return $params; // Returning an array will replace the parameters
    //    })
    //    ->defaults([
    //        'action'    => 'index',
    //        'directory' => 'Api/V0',
    //        'controller' => 'Student',
    //    ]);
    
    //Route::set('apiv0:student:another', 'api/v0/student(/<action>(/<id>))', ['id' => '\d+'])
    //    ->filter(function($route, $params, $request)
    //    {
    //        // Prefix the method to the action name
    //        $params['action'] = strtolower($request->method()).'_'.$params['action'];
    //        return $params; // Returning an array will replace the parameters
    //    })
    //    ->defaults([
    //        'action'    => 'index',
    //        'directory' => 'Api/V0',
    //        'controller' => 'Student',
    //    ]);
    
    //Route::set('apiv0:subject', 'api/v0/subject')
    //    ->filter(function($route, $params, $request)
    //    {
    //        // Prefix the method to the action name
    //        $params['action'] = strtolower($request->method()).'_'.$params['action'];
    //        return $params; // Returning an array will replace the parameters
    //    })
    //    ->defaults([
    //        'action'    => 'index',
    //        'directory' => 'Api/V0',
    //        'controller' => 'Subject',
    //    ]);
    
    //Route::set('apiv0:subject:another', 'api/v0/subject/<action>(/<id>)', ['id' => '\d+'])
    //    ->filter(function($route, $params, $request)
    //    {
    //        // Prefix the method to the action name
    //        $params['action'] = strtolower($request->method()).'_'.$params['action'];
    //        return $params; // Returning an array will replace the parameters
    //    })
    //    ->defaults([
    //        'action'    => 'index',
    //        'directory' => 'Api/V0',
    //        'controller' => 'Subject',
    //    ]);
    
    Route::set('apiv0:studyPlan', 'api/v0/studyPlan')
        ->filter(function($route, $params, $request)
        {
            // Prefix the method to the action name
            $params['action'] = strtolower($request->method()).'_'.$params['action'];
            return $params; // Returning an array will replace the parameters
        })
        ->defaults([
            'action'    => 'index',
            'directory' => 'Api/V0',
            'controller' => 'StudyPlan',
        ]);