* * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ 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' => 'CMS'], function () { //上传文件 Route::post('/common/upload', 'ResourceController@upload'); //banner Route::get('/banner', 'BannersController@index'); //导航 Route::get('/category', 'CategoriesController@index'); //文章 Route::get('/articles', 'ArticlesController@index'); Route::get('/article', 'ArticlesController@article'); Route::get('/article-lists', 'ArticlesController@lists'); Route::get('/article/{id}', 'ArticlesController@show'); //配置 Route::get('/settings', 'SettingController@index'); //登录 // Route::post('/auth/login', 'AuthController@login'); // Route::post('/auth/register', 'AuthController@store'); // 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('/course/categories', 'CategoryController@index'); //视频列表 Route::get('/courses', 'CourseController@index'); //视频详情 Route::get('/course', 'CourseController@show'); Route::group([ 'prefix' => 'course', // 'middleware' => 'auth:api' ], function () { //订阅 Route::post('/course-subscribe', 'CourseController@subscribe'); //观看记录 Route::get('/course-look', 'CourseController@lookCourses'); //评价 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(['namespace' => 'Note', 'prefix' => 'note'], function () { Route::get('index', 'NotesController@index'); Route::get('show/{id}', 'NotesController@show'); Route::get('comment', 'CommentsController@index'); Route::group([ 'middleware' => 'auth:api' ], function () { Route::post('store', 'NotesController@store'); Route::put('update/{id}', 'NotesController@update'); Route::delete('delete/{id}', 'NotesController@destroy'); Route::post('good', 'NotesController@good'); Route::post('comment', 'CommentsController@store'); Route::delete('comment/{id}', 'CommentsController@destroy'); Route::post('comment/good', 'CommentsController@good'); Route::post('comment/answer', 'CommentsController@answer'); }); }); //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'); });