admin.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. <?php
  2. /*
  3. * This file is part of the Jiannei/lumen-api-starter.
  4. *
  5. * (c) Jiannei <longjian.huang@foxmail.com>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. use Illuminate\Support\Facades\Route;
  11. /*
  12. |--------------------------------------------------------------------------
  13. | Application Routes
  14. |--------------------------------------------------------------------------
  15. |
  16. | Here is where you can register all of the routes for an application.
  17. | It is a breeze. Simply tell Lumen the URIs it should respond to
  18. | and give it the Closure to call when that URI is requested.
  19. |
  20. */
  21. /**
  22. * 基础业务模块
  23. */
  24. Route::group(['namespace' => 'Base'], function () {
  25. //登录
  26. Route::post('/auth/login', 'AuthController@login');
  27. Route::post('/auth/send-validation-code', 'AuthController@sendValidationCode');
  28. Route::post('/auth/retrieve-password', 'AuthController@retrievePassword');
  29. Route::post('/auth/find-email', 'AuthController@findEmail');
  30. //上传文件
  31. Route::post('/common/upload', 'ResourceController@upload');
  32. //枚举
  33. Route::get('/common/enums', 'CommonController@enums');
  34. Route::get('/common/clear', 'CommonController@clear');
  35. Route::group([
  36. 'middleware' => ['auth:admins', 'auth.role:admin']
  37. ], function () {
  38. Route::get('/auth/me', 'AuthController@me');
  39. Route::put('/auth/me', 'AuthController@update');
  40. Route::get('/auth/logout', 'AuthController@logout');
  41. Route::post('/auth/reset-password', 'AuthController@resetPassword');
  42. Route::group(['prefix' => 'base'], function () {
  43. //部门管理
  44. Route::get('department', 'DepartmentController@index');
  45. Route::get('department/{id}', 'DepartmentController@show');
  46. Route::post('department', 'DepartmentController@store');
  47. Route::post('department/delete', 'DepartmentController@delete');
  48. Route::put('department/{id}', 'DepartmentController@update');
  49. Route::delete('department/{id}', 'DepartmentController@destroy');
  50. Route::get('department-tree', 'DepartmentController@tree');
  51. //管理员
  52. Route::get('/admin', 'AdminController@index');
  53. Route::get('admin/{id}', 'AdminController@show');
  54. Route::post('admin', 'AdminController@store');
  55. Route::put('admin/{id}', 'AdminController@update');
  56. Route::delete('admin/{id}', 'AdminController@destroy');
  57. Route::post('admin-authorization', 'AdminController@authorization');
  58. Route::get('admin-select-options', 'AdminController@selectOptions');
  59. Route::post('admin-change-password', 'AdminController@changePassword');
  60. Route::post('admin-import', 'AdminController@import');
  61. //角色
  62. Route::get('/role', 'RoleController@index');
  63. Route::get('role/{id}', 'RoleController@show');
  64. Route::post('role', 'RoleController@store');
  65. Route::put('role/{id}', 'RoleController@update');
  66. Route::delete('role/{id}', 'RoleController@destroy');
  67. Route::get('role-lists', 'RoleController@lists');
  68. //菜单
  69. Route::get('/menu', 'MenuController@index');
  70. Route::get('/menu-icons', 'MenuController@icons');
  71. Route::get('menu/{id}', 'MenuController@show');
  72. Route::post('menu', 'MenuController@store');
  73. Route::put('menu/{id}', 'MenuController@update');
  74. Route::delete('menu/{id}', 'MenuController@destroy');
  75. Route::get('menu-tree', 'MenuController@tree');
  76. Route::get('menu-user', 'MenuController@menus');
  77. //轮播图管理
  78. Route::get('banner', 'BannersController@index');
  79. Route::get('banner/{id}', 'BannersController@show');
  80. Route::post('banner', 'BannersController@store');
  81. Route::post('banner/delete', 'BannersController@delete');
  82. Route::put('banner/{id}', 'BannersController@update');
  83. Route::delete('banner/{id}', 'BannersController@destroy');
  84. //商户
  85. Route::get('/shop', 'ShopsController@index');
  86. Route::post('/shop', 'ShopsController@store');
  87. Route::get('/shop/{id}', 'ShopsController@show');
  88. Route::put('/shop/{id}', 'ShopsController@update');
  89. Route::delete('/shop/{id}', 'ShopsController@destroy');
  90. Route::get('/shop-select-options', 'ShopsController@SelectOptions');
  91. //分类管理
  92. Route::get('category', 'CategoriesController@index');
  93. Route::post('category', 'CategoriesController@storeCategory');
  94. Route::post('category-option', 'CategoriesController@store');
  95. Route::get('category/{id}', 'CategoriesController@show');
  96. Route::put('category/{id}', 'CategoriesController@update');
  97. Route::delete('category/{id}', 'CategoriesController@destroy');
  98. Route::post('category-delete', 'CategoriesController@delete');
  99. Route::get('category-select-options', 'CategoriesController@selectOptions');
  100. //参数配置
  101. Route::get('setting', 'SettingsController@index');
  102. Route::get('setting-tree', 'SettingsController@tree');
  103. Route::post('setting', 'SettingsController@store');
  104. Route::put('setting/{id}', 'SettingsController@update');
  105. Route::delete('setting/{id}', 'SettingsController@destroy');
  106. Route::get('setting-key', 'SettingsController@setting');
  107. });
  108. });
  109. });
  110. //高校公用模块
  111. //Route::group([
  112. // 'middleware' => ['auth:admins', 'auth.role:admin'],
  113. // 'prefix' => 'school',
  114. // 'namespace' => 'School'
  115. //], function () {
  116. // //学期管理
  117. // Route::get('term', 'TermsController@index');
  118. // Route::post('term', 'TermsController@store');
  119. // Route::get('term/info/{id}', 'TermsController@show');
  120. // Route::get('term/pause', 'TermsController@pause');
  121. // Route::put('term/{id}', 'TermsController@update');
  122. // Route::delete('term/{id}', 'TermsController@destroy');
  123. // Route::post('term-delete', 'TermsController@delete');
  124. // Route::get('term-select-options', 'TermsController@selectOptions');
  125. //
  126. // //时间段管理
  127. // Route::get('time', 'TimesController@index');
  128. // Route::post('time', 'TimesController@store');
  129. // Route::get('time/info/{id}', 'TimesController@show');
  130. // Route::get('time/pause', 'TimesController@pause');
  131. // Route::put('time/{id}', 'TimesController@update');
  132. // Route::delete('time/{id}', 'TimesController@destroy');
  133. // Route::post('time-delete', 'TimesController@delete');
  134. // Route::get('time-select-options', 'TimesController@selectOptions');
  135. //
  136. // //班级管理
  137. // Route::get('grade', 'GradesController@index');
  138. // Route::post('grade', 'GradesController@store');
  139. // Route::get('grade/info/{id}', 'GradesController@show');
  140. // Route::get('grade/pause', 'GradesController@pause');
  141. // Route::put('grade/{id}', 'GradesController@update');
  142. // Route::delete('grade/{id}', 'GradesController@destroy');
  143. // Route::post('grade-delete', 'GradesController@delete');
  144. // Route::get('grade-select-options', 'GradesController@selectOptions');
  145. //
  146. // //老师管理
  147. // Route::get('teacher', 'TeachersController@index');
  148. // Route::post('teacher', 'TeachersController@store');
  149. // Route::get('teacher/info/{id}', 'TeachersController@show');
  150. // Route::get('teacher/pause', 'TeachersController@pause');
  151. // Route::put('teacher/{id}', 'TeachersController@update');
  152. // Route::delete('teacher/{id}', 'TeachersController@destroy');
  153. // Route::post('teacher-delete', 'TeachersController@delete');
  154. // Route::post('teacher-import', 'TeachersController@import');
  155. // Route::post('teacher-export', 'TeachersController@export');
  156. // Route::get('teacher-select-options', 'TeachersController@selectOptions');
  157. //
  158. // //学生管理
  159. // Route::get('student', 'StudentsController@index');
  160. // Route::post('student', 'StudentsController@store');
  161. // Route::get('student/info/{id}', 'StudentsController@show');
  162. // Route::get('student/pause', 'StudentsController@pause');
  163. // Route::put('student/{id}', 'StudentsController@update');
  164. // Route::delete('student/{id}', 'StudentsController@destroy');
  165. // Route::post('student-delete', 'StudentsController@delete');
  166. // Route::post('student-import', 'StudentsController@import');
  167. // Route::post('student-export', 'StudentsController@export');
  168. // Route::get('student-select-options', 'StudentsController@selectOptions');
  169. //
  170. // //教室管理
  171. // Route::get('room', 'RoomsController@index');
  172. // Route::post('room', 'RoomsController@store');
  173. // Route::get('room/info/{id}', 'RoomsController@show');
  174. // Route::get('room/pause', 'RoomsController@pause');
  175. // Route::put('room/{id}', 'RoomsController@update');
  176. // Route::delete('room/{id}', 'RoomsController@destroy');
  177. // Route::post('room-delete', 'RoomsController@delete');
  178. // Route::get('room-select-options', 'RoomsController@selectOptions');
  179. //
  180. // //课程管理
  181. // Route::get('lesson', 'LessonsController@index');
  182. // Route::post('lesson', 'LessonsController@store');
  183. // Route::get('lesson/info/{id}', 'LessonsController@show');
  184. // Route::put('lesson/{id}', 'LessonsController@update');
  185. // Route::delete('lesson/{id}', 'LessonsController@destroy');
  186. // Route::post('lesson-delete', 'LessonsController@delete');
  187. // Route::get('lesson-select-options', 'LessonsController@selectOptions');
  188. // Route::get('lesson/pause', 'LessonsController@pause');
  189. //
  190. // //老师课程管理
  191. // Route::get('lesson-teacher', 'LessonTeachersController@index');
  192. // Route::post('lesson-teacher', 'LessonTeachersController@store');
  193. // Route::get('lesson-teacher/pause', 'LessonTeachersController@pause');
  194. //// Route::get('lesson/{id}', 'LessonTeachersController@show');
  195. // Route::put('lesson-teacher/info/{id}', 'LessonTeachersController@update');
  196. // Route::delete('lesson-teacher/info/{id}', 'LessonTeachersController@destroy');
  197. // Route::post('lesson-teacher-delete', 'LessonTeachersController@delete');
  198. // Route::get('lesson-teacher-select-options', 'LessonTeachersController@selectOptions');
  199. //
  200. // //上课记录
  201. // Route::post('schedule/calendar', 'ScheduleController@calendar');
  202. // Route::post('schedule/calendar-simple', 'ScheduleController@calendarSimple');
  203. // Route::get('schedule', 'ScheduleController@index');
  204. // Route::get('schedule-lists', 'ScheduleController@lists');
  205. // Route::get('schedule/info/{id}', 'ScheduleController@show');
  206. // Route::get('schedule/pause', 'ScheduleController@pause');
  207. // Route::post('schedule/change', 'ScheduleController@changeLesson');
  208. // Route::post('schedule/history', 'ScheduleController@byTimeGetScheduleLogs');
  209. // Route::put('schedule', 'ScheduleController@store');
  210. // Route::delete('schedule/{id}', 'ScheduleController@destroy');
  211. // Route::post('schedule/batch-stop-lesson', 'ScheduleController@batchStopLesson');
  212. // Route::get('schedule/export', 'ScheduleController@scheduleExport');
  213. //
  214. // //停调课管理
  215. // Route::get('schedule/record', 'ScheduleApproveRecordsController@index');
  216. // Route::get('schedule/record/info/{id}', 'ScheduleApproveRecordsController@show');
  217. // Route::get('schedule/record/pause', 'ScheduleApproveRecordsController@pause');
  218. // Route::delete('schedule/record/{id}', 'ScheduleApproveRecordsController@destroy');
  219. // Route::post('schedule/check', 'ScheduleApproveRecordsController@check');
  220. // Route::post('schedule/approve-check', 'ScheduleApproveRecordsController@approveCheck');
  221. // Route::get('schedule/check-progress', 'ScheduleApproveRecordsController@checkProgress');
  222. // Route::get('schedule/approve-record-export', 'ScheduleApproveRecordsController@approveRecordExport');
  223. //
  224. //});
  225. //实验中心
  226. //Route::group([
  227. // 'middleware' => ['auth:admins', 'auth.role:admin'],
  228. // 'prefix' => 'lab',
  229. // 'namespace' => 'Lab'
  230. //], function () {
  231. // Route::get('home', 'HomeController@index');
  232. // //导入管理
  233. //
  234. // Route::get('import/record', 'ImportRecordsController@index');
  235. // Route::post('import/record', 'ImportRecordsController@store');
  236. // Route::get('import/record/{id}', 'ImportRecordsController@show');
  237. // Route::put('import/record/{id}', 'ImportRecordsController@update');
  238. // Route::delete('import/record/{id}', 'ImportRecordsController@destroy');
  239. // Route::post('import/record-delete', 'ImportRecordsController@delete');
  240. // Route::get('import/record-select-options', 'ImportRecordsController@selectOptions');
  241. // Route::get('import/record-statistical', 'ImportRecordsController@statistical');
  242. // Route::get('import/record-change-status', 'ImportRecordsController@changeStatus');
  243. // Route::get('import/retry-import', 'ImportRecordsController@retryImport');
  244. // Route::get('import/check-is-clash', 'ImportRecordsController@checkIsClash');
  245. //
  246. //
  247. // Route::get('schedule', 'SchedulesController@index');
  248. // Route::get('schedule/lists', 'SchedulesController@lists');
  249. // Route::post('schedule/calendar', 'SchedulesController@calendar');
  250. // Route::post('schedule/calendar-simple', 'SchedulesController@calendarSimple');
  251. // Route::post('schedule/store', 'SchedulesController@storeSchedule');
  252. // Route::post('schedule/update', 'SchedulesController@updateSchedule');
  253. // Route::delete('schedule/delete/{id}', 'SchedulesController@delSchedule');
  254. // Route::get('schedule/info/{id}', 'SchedulesController@show');
  255. //
  256. // //维护记录
  257. // Route::get('maintain', 'MaintainsController@index');
  258. // Route::get('maintain-lists', 'MaintainsController@lists');
  259. // Route::post('maintain/', 'MaintainsController@store');
  260. // Route::post('maintain/batch', 'MaintainsController@batchStore');
  261. // Route::get('maintain/info/{id}', 'MaintainsController@show');
  262. // Route::put('maintain/{id}', 'MaintainsController@update');
  263. // Route::delete('maintain/{id}', 'MaintainsController@destroy');
  264. // Route::post('maintain-delete', 'MaintainsController@delete');
  265. // Route::get('maintain-time', 'MaintainsController@byTime');
  266. // Route::get('maintain/pause', 'MaintainsController@pause');
  267. //
  268. // //开放预约
  269. // Route::get('open-appointment', 'OpenAppointmentsController@index');
  270. // Route::post('open-appointment', 'OpenAppointmentsController@store');
  271. // Route::get('open-appointment/info/{id}', 'OpenAppointmentsController@show');
  272. // Route::put('open-appointment/info/{id}', 'OpenAppointmentsController@update');
  273. // Route::delete('open-appointment/info/{id}', 'OpenAppointmentsController@destroy');
  274. // Route::post('open-appointment-delete', 'OpenAppointmentsController@delete');
  275. // Route::get('open-appointment/check-progress', 'OpenAppointmentsController@checkProgress');
  276. // Route::post('open-appointment/check', 'OpenAppointmentsController@check');
  277. // Route::post('open-appointment/approve-check', 'OpenAppointmentsController@approveCheck');
  278. // Route::post('open-appointment/upload-print', 'OpenAppointmentsController@uploadPrint');
  279. // Route::get('open-appointment/pause', 'OpenAppointmentsController@pause');
  280. // Route::get('open-appointment/down-print', 'OpenAppointmentsController@downPrint');
  281. //
  282. // //账号审批
  283. // Route::get('account', 'AccountAppliesController@index');
  284. // Route::get('account/info/{id}', 'AccountAppliesController@show');
  285. // Route::put('account/info/{id}', 'AccountAppliesController@update');
  286. // Route::post('account/check', 'AccountAppliesController@check');
  287. // Route::post('account/approve-check', 'AccountAppliesController@approveCheck');
  288. // Route::delete('account/info/{id}', 'AccountAppliesController@destroy');
  289. // Route::post('account-delete', 'AccountAppliesController@delete');
  290. //
  291. //});
  292. //Route::group([
  293. // 'prefix' => 'lab',
  294. // 'namespace' => 'Lab'
  295. //], function () {
  296. // Route::post('account', 'AccountAppliesController@store');
  297. //});
  298. /**
  299. * 电力
  300. */
  301. Route::group([
  302. 'middleware' => ['auth:admins', 'auth.role:admin'],
  303. 'prefix' => 'dianli',
  304. 'namespace' => 'Dianli'
  305. ], function () {
  306. Route::get('home', 'HomeController@index');
  307. Route::get('statistical', 'HomeController@statistical');
  308. //任务管理
  309. Route::get('/task', 'TasksController@index');
  310. Route::post('/task', 'TasksController@store');
  311. Route::get('/task/info/{id}', 'TasksController@show');
  312. Route::put('/task/info/{id}', 'TasksController@update');
  313. Route::delete('/task/info/{id}', 'TasksController@destroy');
  314. Route::post('/task-delete', 'TasksController@delete');
  315. Route::get('/task/select-options', 'TasksController@selectOptions');
  316. Route::get('/task/pause', 'TasksController@pause');
  317. Route::post('/task/related-papers', 'TasksController@relatedPapers');
  318. });
  319. /**
  320. * 试卷
  321. */
  322. Route::group([
  323. 'middleware' => ['auth:admins', 'auth.role:admin'],
  324. 'prefix' => 'exam',
  325. 'namespace' => 'Exam'
  326. ], function () {
  327. Route::get('home', 'HomeController@index');
  328. //任务管理
  329. Route::get('/paper', 'PapersController@index');
  330. Route::post('/paper', 'PapersController@store');
  331. Route::get('/paper/info/{id}', 'PapersController@show');
  332. Route::put('/paper/info/{id}', 'PapersController@update');
  333. Route::delete('/paper/info/{id}', 'PapersController@destroy');
  334. Route::post('/paper/delete', 'PapersController@delete');
  335. Route::get('/paper/select-options', 'PapersController@selectOptions');
  336. Route::get('/paper/pause', 'PapersController@pause');
  337. //试题
  338. Route::get('/topic', 'TopicsController@index');
  339. Route::post('/topic', 'TopicsController@store');
  340. Route::get('/topic/info/{id}', 'TopicsController@show');
  341. Route::put('/topic/info/{id}', 'TopicsController@update');
  342. Route::delete('/topic/info/{id}', 'TopicsController@destroy');
  343. Route::post('/topic/delete', 'TopicsController@delete');
  344. Route::get('/topic/select-options', 'TopicsController@selectOptions');
  345. Route::get('/topic/pause', 'TopicsController@pause');
  346. //考试
  347. Route::get('/paper-result', 'PaperResultsController@index');
  348. Route::post('/paper-result/allot', 'PaperResultsController@allot');
  349. Route::post('/paper-result/answer', 'PaperResultsController@answer');
  350. Route::post('/paper-result', 'PaperResultsController@store');
  351. Route::get('/paper-result/info/{id}', 'PaperResultsController@show');
  352. Route::put('/paper-result/info/{id}', 'PaperResultsController@update');
  353. Route::delete('/paper-result/info/{id}', 'PaperResultsController@destroy');
  354. Route::post('/paper-result/delete', 'PaperResultsController@delete');
  355. Route::get('/paper-result/select-options', 'PaperResultsController@selectOptions');
  356. Route::get('/paper-result/pause', 'PaperResultsController@pause');
  357. });
  358. /**
  359. * 通知公告
  360. */
  361. Route::group([
  362. 'middleware' => ['auth:admins', 'auth.role:admin'],
  363. 'prefix' => 'news',
  364. 'namespace' => 'News'
  365. ], function () {
  366. //公告
  367. Route::get('notice', 'NoticesController@index');
  368. Route::post('notice', 'NoticesController@store');
  369. Route::put('notice/info/{id}', 'NoticesController@update');
  370. Route::get('notice/info/{id}', 'NoticesController@show');
  371. Route::delete('notice/{id}', 'NoticesController@destroy');
  372. Route::get('notice/pause', 'NoticesController@pause');
  373. //消息列表
  374. Route::get('message', 'MessagesController@index');
  375. Route::post('message', 'MessagesController@store');
  376. Route::put('message/info/{id}', 'MessagesController@update');
  377. Route::get('message/info/{id}', 'MessagesController@show');
  378. Route::delete('message/{id}', 'MessagesController@destroy');
  379. Route::get('message/pause', 'MessagesController@pause');
  380. Route::get('message/users', 'MessagesController@users');
  381. Route::get('message/user-message', 'MessagesController@userMessages');
  382. Route::get('message/read-user-message', 'MessagesController@readMessage');
  383. Route::get('message/read-user-messages', 'MessagesController@readMessages');
  384. });
  385. //课程
  386. Route::group([
  387. 'middleware' => ['auth:admins', 'auth.role:admin'],
  388. 'prefix' => 'course',
  389. 'namespace' => 'Course'
  390. ], function () {
  391. // 首页
  392. Route::get('/home', 'HomeController@index');
  393. //课程
  394. //分类
  395. Route::get('category', 'CategoryController@index');
  396. Route::post('category', 'CategoryController@store');
  397. Route::get('category/{id}', 'CategoryController@show');
  398. Route::put('category/{id}', 'CategoryController@update');
  399. Route::delete('category/{id}', 'CategoryController@destroy');
  400. Route::post('category/delete', 'CategoryController@delete');
  401. Route::get('category-tree', 'CategoryController@tree');
  402. //课程
  403. Route::get('info', 'CourseController@index');
  404. Route::post('info', 'CourseController@store');
  405. Route::get('info/{id}', 'CourseController@show');
  406. Route::put('info/{id}', 'CourseController@update');
  407. Route::delete('info/{id}', 'CourseController@destroy');
  408. //章节
  409. Route::get('{course_id}/chapter', 'ChapterController@index');
  410. Route::post('{course_id}/chapter', 'ChapterController@store');
  411. Route::put('chapter/{id}', 'ChapterController@update');
  412. Route::delete('chapter/{id}', 'ChapterController@destroy');
  413. //视频
  414. Route::get('{course_id}/video', 'VideoController@index');
  415. Route::post('{course_id}/video', 'VideoController@store');
  416. Route::get('{course_id}/video/{id}', 'VideoController@show');
  417. Route::put('video/{id}', 'VideoController@update');
  418. Route::delete('video/{id}', 'VideoController@destroy');
  419. //附件
  420. Route::get('video/{course_video_id}/attach', 'AttachController@index');
  421. Route::post('video/{course_video_id}/attach', 'AttachController@store');
  422. Route::put('attach/{id}', 'AttachController@update');
  423. Route::delete('attach/{id}', 'AttachController@destroy');
  424. });
  425. //附件下载
  426. //Route::get('/view/attach-download/{id}', 'Course\AttachController@download');
  427. Route::get('/', function () {
  428. return app()->version();
  429. });
  430. //开发环境接口
  431. Route::group(['prefix' => 'develop'], function () {
  432. //响应状态
  433. // Route::get('/http-status', 'DevelopController@httpStatus');
  434. Route::get('/t', 'ExampleController@test');
  435. Route::get('/init', 'ExampleController@init');
  436. });