123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296 |
- <?php
- /*
- * This file is part of the Jiannei/lumen-api-starter.
- *
- * (c) Jiannei <longjian.huang@foxmail.com>
- *
- * 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::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' => 'Course', 'prefix' => 'course'], function () {
- Route::get('/home', 'HomeController@index');
- //分类
- Route::get('/category/tree', 'CategoryController@tree');
- Route::get('/category/select-options', 'CategoryController@selectOptions');
- //视频列表
- Route::get('courses', 'CourseController@index');
- Route::get('course', 'CourseController@show');
- Route::group([
- 'middleware' => 'auth:api'
- ], function () {
- //订阅
- Route::post('course/subscribe', 'CourseController@subscribe');
- Route::get('/video', 'VideoController@show');
- Route::post('/video/look-record', 'VideoController@lookRecord');
- //附件
- Route::get('/attachs', 'AttachController@index');
- Route::get('/attach/download', 'AttachController@download');
- //观看记录
- Route::get('/course-look', 'CourseController@lookCourses');
- //评价
- Route::post('/comment', 'CommentController@store');
- Route::get('/comments', 'CommentController@index');
- Route::delete('/comment', 'CommentController@destroy');
- //订阅
- Route::get('/subscribes', 'SubscribeController@index');
- //收藏
- Route::get('/collects', 'CollectController@index');
- Route::post('/collect', 'CollectController@store');
- Route::delete('/collect', 'CollectController@destroy');
- //笔记
- Route::post('/node', 'NodeController@store');
- Route::get('/nodes', 'NodeController@index');
- Route::get('/node', 'NodeController@show');
- Route::delete('/node', 'NodeController@destroy');
- });
- });
- /**
- * 通知公告
- */
- Route::group([
- 'prefix' => 'info',
- 'namespace' => 'Info'
- ], function () {
- //新闻管理
- Route::get('/news', 'NewsController@index');
- Route::post('/new', 'NewsController@store');
- //通知公告
- Route::get('/notices', 'NoticeController@index');
- Route::post('/notice', 'NoticeController@store');
- //资讯类型
- Route::get('/info_types', 'InformationTypeController@index');
- //资讯内容
- Route::get('/infos', 'InformationController@index');
- Route::get('/info', 'InformationController@show');
- });
- //
- ///**
- // * 试卷
- // */
- //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(['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::get('/', function () {
- if (config('app.debug')) {
- return Response::success([
- 'name' => config('app.name'),
- 'version' => app()->version(),
- 'ip' => getClientIp()
- ]);
- }
- return 'hello word!';
- });
- //开发环境接口
- Route::group(['prefix' => 'develop'], function () {
- //响应状态
- // Route::get('/http-status', 'DevelopController@httpStatus');
- Route::get('/t', 'ExampleController@test');
- Route::get('/init', 'ExampleController@init');
- });
|