123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337 |
- <?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\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::group(['namespace' => 'Base'], function () {
- //登录
- Route::post('/auth/login', 'AuthController@login');
- //上传文件
- Route::post('/common/upload', 'ResourceController@upload');
- //枚举
- Route::get('/common/enums', 'CommonController@enums');
- Route::group([
- 'middleware' => 'auth:admins'
- ], function () {
- Route::get('/auth/me', 'AuthController@me');
- Route::put('/auth/me', 'AuthController@update');
- Route::get('/auth/logout', 'AuthController@logout');
- Route::group(['prefix' => 'base'], function () {
- //部门管理
- Route::get('department', 'DepartmentController@index');
- Route::get('department/{id}', 'DepartmentController@show');
- Route::post('department', 'DepartmentController@store');
- Route::post('department/delete', 'DepartmentController@delete');
- Route::put('department/{id}', 'DepartmentController@update');
- Route::delete('department/{id}', 'DepartmentController@destroy');
- Route::get('department-tree', 'DepartmentController@tree');
- //管理员
- Route::get('/admin', 'AdminController@index');
- Route::get('admin/{id}', 'AdminController@show');
- Route::post('admin', 'AdminController@store');
- Route::put('admin/{id}', 'AdminController@update');
- Route::delete('admin/{id}', 'AdminController@destroy');
- //角色
- Route::get('/role', 'RoleController@index');
- Route::get('role/{id}', 'RoleController@show');
- Route::post('role', 'RoleController@store');
- Route::put('role/{id}', 'RoleController@update');
- Route::delete('role/{id}', 'RoleController@destroy');
- Route::get('role-lists', 'RoleController@lists');
- //菜单
- Route::get('/menu', 'MenuController@index');
- Route::get('/menu-icons', 'MenuController@icons');
- Route::get('menu/{id}', 'MenuController@show');
- Route::post('menu', 'MenuController@store');
- Route::put('menu/{id}', 'MenuController@update');
- Route::delete('menu/{id}', 'MenuController@destroy');
- Route::get('menu-tree', 'MenuController@tree');
- Route::get('menu-user', 'MenuController@menus');
- //轮播图管理
- Route::get('banner', 'BannersController@index');
- Route::get('banner/{id}', 'BannersController@show');
- Route::post('banner', 'BannersController@store');
- Route::post('banner/delete', 'BannersController@delete');
- Route::put('banner/{id}', 'BannersController@update');
- Route::delete('banner/{id}', 'BannersController@destroy');
- });
- });
- });
- Route::group([
- 'middleware' => 'auth:admins'
- ], function () {
- // 首页
- Route::get('/home', 'HomeController@index');
- //课程
- Route::group(['prefix' => 'course', 'namespace' => 'Course'], 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('info', 'CourseController@index');
- Route::post('info', 'CourseController@store');
- Route::get('info/{id}', 'CourseController@show');
- Route::put('info/{id}', 'CourseController@update');
- Route::delete('info/{id}', 'CourseController@destroy');
- //章节
- Route::get('{course_id}/chapter', 'ChapterController@index');
- Route::post('{course_id}/chapter', 'ChapterController@store');
- Route::put('chapter/{id}', 'ChapterController@update');
- Route::delete('chapter/{id}', 'ChapterController@destroy');
- //视频
- Route::get('{course_id}/video', 'VideoController@index');
- Route::post('{course_id}/video', 'VideoController@store');
- Route::get('{course_id}/video/{id}', 'VideoController@show');
- Route::put('video/{id}', 'VideoController@update');
- Route::delete('video/{id}', 'VideoController@destroy');
- //附件
- Route::get('video/{course_video_id}/attach', 'AttachController@index');
- Route::post('video/{course_video_id}/attach', 'AttachController@store');
- Route::put('attach/{id}', 'AttachController@update');
- Route::delete('attach/{id}', 'AttachController@destroy');
- });
- /**
- * 观看视频接口
- */
- Route::group(['prefix' => 'view', 'namespace' => 'Course'], function () {
- //分类
- Route::get('categories', 'CategoryController@lists');
- //视频列表
- Route::get('/courses', 'CourseController@lists');
- //视频详情
- Route::get('/course/{id}', 'CourseController@viewShow');
- //订阅
- 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::group(['prefix' => 'user', 'namespace' => 'User'], function () {
- //分类
- Route::get('student', 'StudentController@index');
- Route::post('student', 'StudentController@store');
- Route::get('student/{id}', 'StudentController@show');
- Route::put('student/{id}', 'StudentController@update');
- Route::delete('student/{id}', 'StudentController@destroy');
- Route::post('student/delete', 'StudentController@delete');
- Route::post('student-import', 'StudentController@import');
- Route::post('student-export', 'StudentController@export');
- });
- /**
- * 中医处方分析
- */
- Route::group(['prefix' => 'tcm', 'namespace' => 'TCM'], function () {
- //患者管理
- Route::get('/patient', 'PatientController@index');
- Route::get('/patient-lists', 'PatientController@lists');
- Route::post('/patient', 'PatientController@store');
- Route::get('/patient/{id}', 'PatientController@show');
- Route::put('/patient/{id}', 'PatientController@update');
- Route::delete('/patient/{id}', 'PatientController@destroy');
- Route::post('/patient-export', 'PatientController@export');
- //分类
- Route::get('/category', 'CategoryController@index');
- Route::get('category-tree', 'CategoryController@tree');
- Route::post('category', 'CategoryController@store');
- Route::put('category/{id}', 'CategoryController@update');
- Route::delete('category/{id}', 'CategoryController@destroy');
- //病历
- Route::get('/medical-record', 'MedicalRecordController@index');
- Route::post('/medical-record', 'MedicalRecordController@store');
- Route::get('/medical-record/{id}', 'MedicalRecordController@show');
- Route::put('/medical-record/{id}', 'MedicalRecordController@update');
- Route::delete('/medical-record/{id}', 'MedicalRecordController@destroy');
- //处方
- Route::get('/prescription', 'PrescriptionController@index');
- Route::post('/prescription', 'PrescriptionController@store');
- Route::get('/prescription/{id}', 'PrescriptionController@show');
- Route::put('/prescription/{id}', 'PrescriptionController@update');
- Route::delete('/prescription/{id}', 'PrescriptionController@destroy');
- Route::get('/prescription-options', 'PrescriptionController@options');
- Route::post('/prescription-import', 'PrescriptionController@import');
- //药物
- Route::get('/drug', 'DrugController@index');
- Route::post('/drug', 'DrugController@store');
- Route::get('/drug/{id}', 'DrugController@show');
- Route::put('/drug/{id}', 'DrugController@update');
- Route::delete('/drug/{id}', 'DrugController@destroy');
- Route::get('/drug-lists', 'DrugController@lists');
- Route::post('/drug/delete', 'DrugController@delete');
- Route::post('/drug-import', 'DrugController@import');
- //快速创建
- Route::post('/quick-store', 'PrescriptionController@quickStore');
- //分析
- Route::get('/analyse', 'AnalyseController@index');
- Route::get('/analyse-drug', 'AnalyseController@drug');
- });
- Route::group(['prefix' => 'cms', 'namespace' => 'CMS'], function () {
- //轮播图管理
- Route::get('banner', 'BannersController@index');
- Route::get('banner/{id}', 'BannersController@show');
- Route::post('banner', 'BannersController@store');
- Route::post('banner/delete', 'BannersController@delete');
- Route::put('banner/{id}', 'BannersController@update');
- Route::delete('banner/{id}', 'BannersController@destroy');
- //分类
- Route::get('category', 'CategoriesController@index');
- Route::post('category', 'CategoriesController@store');
- Route::get('category/{id}', 'CategoriesController@show');
- Route::put('category/{id}', 'CategoriesController@update');
- Route::delete('category/{id}', 'CategoriesController@destroy');
- Route::post('category/delete', 'CategoriesController@delete');
- Route::get('category-tree', 'CategoriesController@tree');
- Route::get('category-type', 'CategoriesController@type');
- //信息
- Route::get('article', 'ArticlesController@index');
- Route::post('article', 'ArticlesController@store');
- Route::get('article/{id}', 'ArticlesController@show');
- Route::put('article/{id}', 'ArticlesController@update');
- Route::delete('article/{id}', 'ArticlesController@destroy');
- Route::post('article/delete', 'ArticlesController@delete');
- //配置
- Route::get('setting', 'SettingsController@index');
- Route::post('setting', 'SettingsController@store');
- Route::get('setting/{id}', 'SettingsController@show');
- Route::put('setting/{id}', 'SettingsController@update');
- Route::delete('setting/{id}', 'SettingsController@destroy');
- Route::post('setting/delete', 'SettingsController@delete');
- });
- });
- //附件下载
- //Route::get('/view/attach-download/{id}', 'Course\AttachController@download');
- Route::get('/', function () {
- return app()->version();
- });
- //开发环境接口
- Route::group(['prefix' => 'develop'], function () {
- //响应状态
- // Route::get('/http-status', 'DevelopController@httpStatus');
- Route::post('/t', 'ExampleController@test');
- Route::get('/init', 'ExampleController@init');
- });
- //
- //Route::get('author', function () {
- // $response = Http::withOptions(['timeout' => 3])->get('https://api.github.com/users/Jiannei');
- // $response->throw();
- //
- // return Response::success($response->json());
- //});
- //
- //// 测试路由
- //Route::group(['prefix' => 'test'], function () {
- // Route::get('configurations', 'ExampleController@configurations');
- // Route::get('logs', ['uses' => 'ExampleController@logs', 'middleware' => 'throttle:5,1']);
- // Route::put('roles', 'ExampleController@syncRoles');
- // Route::put('permissions', 'ExampleController@syncPermissions');
- //
- // Route::get('posts', 'PostsController@index');
- //});
- //
- //// 用户管理
- //Route::post('users', 'UsersController@store');
- //Route::get('users/{id}', 'UsersController@show');
- //Route::get('users', 'UsersController@index');
- //Route::get('users/pagination/simple', 'UsersController@simple');
- //Route::get('users/pagination/cursor', 'UsersController@cursor');
- //
- //// 授权管理
- //Route::post('authorization', 'AuthorizationController@store');
- //Route::delete('authorization', 'AuthorizationController@destroy');
- //Route::put('authorization', 'AuthorizationController@update');
- //Route::get('authorization', 'AuthorizationController@show');
|