* * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Route; use Jiannei\Response\Laravel\Support\Facades\Response; /* |-------------------------------------------------------------------------- | 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. | */ /** * 基础业务模块 */ Route::get('/home', 'HomeController@index'); Route::group(['namespace' => 'Base'], function () { //登录 Route::post('/auth/login', 'AuthController@login'); Route::post('/auth/register', 'AuthController@store'); //上传文件 Route::post('/common/upload', 'ResourceController@upload'); Route::group([ 'middleware' => 'auth:api' ], function () { Route::get('/auth/me', 'AuthController@me'); Route::put('/auth/me', 'AuthController@update'); Route::get('/auth/logout', 'AuthController@logout'); }); }); /** * 观看视频接口 */ //Route::group(['namespace' => 'Course'], function () { // // Route::get('/home', 'HomeController@index'); // // //分类 // Route::get('/course/categories', 'CategoryController@index'); // //视频列表 // Route::get('/courses', 'CourseController@index'); // //视频详情 // Route::get('/course/{slug}', 'CourseController@show'); // // Route::group([ // 'prefix' => 'course', // 'middleware' => 'auth:api' // ], function () { // //订阅 // Route::post('/course-subscribe', 'CourseController@subscribe'); // //评价 // Route::post('/comment', 'CommentController@store'); // //视频 // Route::get('/video/{id}', 'VideoController@viewShow'); // Route::post('/video-look-record', 'VideoController@lookRecord'); // // Route::get('/attach-download/{id}', 'AttachController@download'); // // Route::get('/video/{video_id}/comments', 'CommentController@videoComments'); // Route::get('/course/{course_id}/comments', 'CommentController@courseComments'); // }); //}); //Route::group(['prefix' => 'inform', 'namespace' => 'Inform'], function () { // //分类 // Route::get('category', 'CategoryController@index'); // Route::post('category', 'CategoryController@store'); // Route::get('category/{id}', 'CategoryController@show'); // Route::put('category/{id}', 'CategoryController@update'); // Route::delete('category/{id}', 'CategoryController@destroy'); // Route::post('category/delete', 'CategoryController@delete'); // Route::get('category-tree', 'CategoryController@tree'); // Route::get('category-user-tree', 'CategoryController@lists'); // // //信息 // Route::get('information', 'InformationController@index'); // Route::post('information', 'InformationController@store'); // Route::get('information/{id}', 'InformationController@show'); // Route::put('information/{id}', 'InformationController@update'); // Route::delete('information/{id}', 'InformationController@destroy'); // Route::post('information/delete', 'InformationController@delete'); // Route::get('information-user-messages', 'InformationController@userMessages'); // Route::post('information-read-messages', 'InformationController@readMessages'); // Route::post('information-good', 'InformationController@good'); //}); Route::get('/', function () { return Response::success(app()->version()); }); //开发环境接口 Route::group(['prefix' => 'develop'], function () { //响应状态 // Route::get('/http-status', 'DevelopController@httpStatus'); Route::post('/t', 'ExampleController@test'); Route::get('/init', 'ExampleController@init'); });