* * 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(['prefix' => 'area', 'namespace' => 'Area'], function () { //项目 Route::get('/', 'AreasController@index'); Route::get('/info/{id}', 'AreasController@show'); Route::group(['prefix' => 'project'], function () { Route::get('/', 'ProjectsController@index'); Route::post('/', 'ProjectsController@store'); Route::get('/info/{id}', 'ProjectsController@show'); Route::put('/{id}', 'ProjectsController@update'); Route::delete('/{id}', 'ProjectsController@destroy'); Route::get('/select-options', 'ProjectsController@SelectOptions'); Route::get('/areas', 'ProjectsController@project'); Route::get('/areas-tree', 'ProjectsController@projectTree'); }); }); Route::group(['namespace' => 'Base', 'prefix' => 'base'], function () { //登录 Route::post('/auth/login', 'AuthController@login'); Route::post('/auth/login-mobile', 'AuthController@mobileLogin'); Route::post('/auth/mobile-verification-code', 'AuthController@verificationCode'); Route::post('/auth/weapp/login', 'AuthController@weappLogin'); // Route::post('/auth/register', 'AuthController@store'); //上传文件 Route::post('/common/upload', 'ResourceController@upload'); //枚举 Route::get('/common/enums', 'CommonController@enums'); Route::post('/settings', 'SettingsController@settings'); Route::get('/setting', 'SettingsController@setting'); Route::group([ 'middleware' => ['auth:api', 'auth.role:user'] ], function () { Route::get('/auth/me', 'AuthController@me'); Route::put('/auth/me', 'AuthController@update'); Route::put('/auth/password', 'AuthController@changePassword'); Route::get('/auth/logout', 'AuthController@logout'); //微信小程序 Route::post('/auth/weapp/user-info-sync', 'AuthController@weappUserInfoSync'); Route::post('/auth/weapp/bind-mobile', 'AuthController@weappBindMobile'); }); }); //Route::get('/page/home', 'PageController@home'); //Route::get('/page/navigations', 'PageController@navigations'); //Route::get('/page/articles', 'PageController@articles'); //Route::get('/page/article/{id}', 'PageController@article'); //Route::get('/page/navigation-article/{id}', 'PageController@navigationArticle'); //Route::post('/page/settings', 'PageController@settings'); Route::group(['namespace' => 'CMS', 'prefix' => '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::get('/setting', 'SettingController@show'); // 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' => 'User', 'prefix' => 'user'], function () { Route::get('/', 'UserController@index'); // Route::post('/', 'UserController@store'); // Route::get('/{id}', 'UserController@show'); // Route::put('/{id}', 'UserController@update'); // Route::delete('/{id}', 'UserController@destroy'); // Route::post('/delete', 'UserController@delete'); // Route::post('/import', 'UserController@import'); // Route::post('/export', 'UserController@export'); }); ///** // * 视频接口 // */ Route::group(['namespace' => 'Course', 'prefix' => 'course'], function () { //分类 Route::get('/categories', 'CategoryController@index'); //视频列表 Route::get('/', 'CourseController@index'); Route::get('/random', 'CourseController@random'); Route::get('/select-options', 'CourseController@selectOptions'); //视频详情 Route::get('/info/{id}', 'CourseController@show'); Route::group([ // 'middleware' => 'auth:api' ], function () { // Route::group([ //// 'middleware' => 'auth.role:teacher' // ], function () { // //老师路由 // Route::post('/', 'CourseController@store'); // Route::put('/{id}', 'CourseController@update'); // Route::delete('/{id}', 'CourseController@destroy'); // // //章节 // Route::post('/chapter', 'ChapterController@store'); // Route::put('/chapter/{id}', 'ChapterController@update'); // Route::delete('/chapter/{id}', 'ChapterController@destroy'); // // //视频 // Route::post('/video', 'VideoController@store'); // Route::put('video/{id}', 'VideoController@update'); // Route::delete('video/{id}', 'VideoController@destroy'); // // //附件 // Route::post('/attach', 'AttachController@store'); // Route::put('/attach/{id}', 'AttachController@update'); // Route::delete('/attach/{id}', 'AttachController@destroy'); // // //班级 // Route::post('/organization', 'OrganizationsController@store'); // Route::put('/organization/{id}', 'OrganizationsController@update'); // Route::delete('/organization/{id}', 'OrganizationsController@destroy'); // Route::post('/organization/courses', 'OrganizationsController@syncCourses'); // // // Route::post('/organization/student/update', 'OrganizationsController@updateStudent'); // Route::post('/organization/students/delete', 'OrganizationsController@destroyStudents'); // Route::get('/organization/statistical', 'OrganizationsController@statistical'); // }); //班级 Route::get('/organization', 'OrganizationsController@index'); Route::get('/organization/info/{slug}', 'OrganizationsController@show'); Route::get('/organization/teacher', 'OrganizationsController@teacher'); Route::get('/organization/students', 'OrganizationsController@students'); Route::post('/organization/student', 'OrganizationsController@storeStudent'); //课程详情【学生】 Route::get('/detail/{slug}', 'CourseController@detail'); //订阅 Route::post('/subscribe', 'CourseController@subscribe'); //章节列表 Route::get('/chapter', 'ChapterController@index'); //视频 Route::get('/video', 'VideoController@index'); Route::get('/video/select-options', 'VideoController@selectOptions'); // Route::get('/video/info/{slug}', 'VideoController@show'); Route::get('/video/info/{id}', 'VideoController@viewShow'); Route::post('/video/look-record', 'VideoController@lookRecord'); // 学生 Route::get('/video/detail/{slug}', 'VideoController@detail'); //附件 Route::get('/attach', 'AttachController@index'); Route::get('/attach/download/{slug}', 'AttachController@download'); //观看记录 Route::get('/course-look', 'CourseController@lookCourses'); //评价 Route::post('/comment', 'CommentController@store'); Route::get('/comments', 'CommentController@index'); //收藏 Route::post('/collection', 'CourseController@collection'); }); }); // ///** // * 试卷 // */ //Route::group(['namespace' => 'Exam', 'prefix' => 'exam', 'middleware' => 'auth:api'], function () { // Route::get('/', 'PapersController@index'); // Route::get('/info/{slug}', 'PapersController@show'); // Route::get('/topic-select-options', 'TopicsController@selectOptions'); // //提交考试结果 // Route::post('/examination', 'PapersController@examination'); //// Route::get('/', 'TopicsController@index'); // Route::group([ // 'middleware' => 'auth.role:teacher' // ], function () { // Route::post('/', 'PapersController@store'); // Route::put('/{id}', 'PapersController@update'); // Route::delete('/{id}', 'PapersController@destroy'); // //批阅 // Route::post('/examines', 'PapersController@examines'); // // //试题 // Route::get('/topic', 'TopicsController@index'); // Route::get('/topic/{id}', 'TopicsController@show'); // Route::post('/topic', 'TopicsController@store'); // Route::put('/topic/{id}', 'TopicsController@update'); // Route::delete('/topic/{id}', 'TopicsController@destroy'); // // //学生考试记录 // Route::delete('/result/{id}', 'PaperResultsController@destroy'); // }); // // Route::get('/result', 'PaperResultsController@index'); // Route::get('/result/{id}', 'PaperResultsController@show'); //}); // ////笔记 //Route::group(['namespace' => 'Note', 'prefix' => 'note'], function () { // Route::get('/', 'NotesController@index'); // Route::get('info/{slug}', 'NotesController@show'); // // Route::get('comment', 'CommentsController@index'); // Route::group([ // 'middleware' => 'auth:api' // ], function () { // //笔记、问答 // Route::post('/', 'NotesController@store'); // Route::put('/{id}', 'NotesController@update'); // Route::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::group([ // 'middleware' => 'auth.role:teacher' // ], function () { // Route::post('/', 'InformationController@store'); // Route::delete('/{id}', 'InformationController@destroy'); // }); // Route::get('/', 'InformationController@index'); // Route::get('/info/{slug}', 'InformationController@show'); // Route::post('/good', 'InformationController@good'); // // // Route::put('information/{id}', 'InformationController@update'); //// Route::post('information/delete', 'InformationController@delete'); //// Route::get('information-user-messages', 'InformationController@userMessages'); //// Route::post('information-read-messages', 'InformationController@readMessages'); //}); /** * 网址导航 */ //Route::group(['prefix' => 'navigation', 'namespace' => 'Navigation'], function () { // Route::get('/', 'HomeController@index'); // Route::post('/search', 'HomeController@search'); // Route::post('/click', 'HomeController@click'); // // Route::group([ // 'middleware' => ['auth:api', 'auth.role:user'] // ], function () { // Route::post('/top', 'HomeController@top'); // Route::delete('/top', 'HomeController@deleteTop'); // // Route::post('/collection', 'HomeController@collection'); // Route::post('/sort', 'HomeController@sortCategory'); // Route::post('/sort-more', 'HomeController@sortMore'); // Route::post('/sort-management', 'HomeController@sortManagement'); // // Route::get('/category', 'CategoriesController@index'); // Route::post('/category', 'CategoriesController@store'); // Route::put('/category/{id}', 'CategoriesController@update'); // Route::delete('/category/{id}', 'CategoriesController@destroy'); // Route::get('/category/select-options', 'CategoriesController@selectOptions'); // // Route::get('/website', 'WebsitesController@index'); // Route::post('/website', 'WebsitesController@store'); // Route::put('/website/{id}', 'WebsitesController@update'); // Route::delete('/website/{id}', 'WebsitesController@destroy'); // Route::get('/website/select-options', 'WebsitesController@selectOptions'); // }); // // Route::get('/organization', 'OrganizationsController@index'); // Route::get('/organization/select-options', 'OrganizationsController@selectOptions'); // //}); /** * 去那里 */ Route::group(['prefix' => 'qunali', 'namespace' => 'Qunali', 'middleware' => ['auth:api']], function () { Route::get('/', 'HomeController@index'); Route::get('/info', 'HomeController@show'); Route::get('/good', 'HomeController@good'); Route::get('/bad', 'HomeController@bad'); Route::post('/report', 'HomeController@report'); Route::post('/version', 'HomeController@version'); Route::post('/point', 'HomeController@storePoint'); Route::post('/check', 'HomeController@check'); Route::get('/history', 'HomeController@history'); Route::get('/back-history', 'HomeController@backHistory'); Route::get('/record', 'HomeController@record'); Route::get('/geocoder', 'HomeController@geocoder'); }); Route::get('/', function () { return Response::success(app()->version()); }); //开发环境接口 Route::group(['prefix' => 'develop'], function () { //响应状态 // Route::get('/http-status', 'DevelopController@httpStatus'); Route::get('/t', 'ExampleController@test'); Route::get('/init', 'ExampleController@init'); });