<?php

/** @var \Laravel\Lumen\Routing\Router $router */

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$router->get('/', function () use ($router) {
    return $router->app->version();
});

$router->group(['prefix' => 'api'], function () use ($router) {
    $router->post('login', 'CommonController@login');
    
    // Chat
    $router->group(['prefix' => 'chat'], function () use ($router) {
        $router->post('create', 'ConversationsController@create');
        $router->get('get/{id}', 'ConversationsController@getChatById');
    });

    $router->group(['prefix' => 'activities'], function () use ($router) {
        $router->post('create', 'ActivitiesController@create');
        $router->get('get/{id}', 'ActivitiesController@getActivities');
    });

    $router->get('lessons/{type}', 'StudyMeterialsController@lessons');
    $router->post('quiz-records', 'QuizRecordController@quiz_records');
    $router->get('user-info/{id}', 'QuizRecordController@get_user_info');
    $router->get('feedbacks/{id}', 'ConversationsController@feedbacks');
    $router->get('get-avg-time', 'QuizRecordController@get_avg_time');

    $router->get('/students/getmarks/{id}', 'ActivitiesController@getMarks');
    
});
