router.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. 'use strict';
  2. /**
  3. * @param {Egg.Application} app - egg application
  4. */
  5. module.exports = app => {
  6. const { router, controller } = app;
  7. router.get('/', controller.home.index);
  8. // 科目表设置路由
  9. router.resources('subject', '/api/train/subject', controller.subject); // index、create、show、destroy
  10. router.post('subject', '/api/train/subject/update/:id', controller.subject.update);
  11. // 教师表设置路由
  12. router.get('teacher', '/api/train/teacher/show/:id', controller.teacher.show);
  13. router.resources('teacher', '/api/train/teacher', controller.teacher); // index、create、show、destroy
  14. router.post('teacher', '/api/train/teacher/update/:id', controller.teacher.update);
  15. router.post('teacher', '/api/train/teacher/status', controller.teacher.status);
  16. // 作业表配置路由
  17. router.resources('task', '/api/train/task', controller.task); // index、create、show、destroy
  18. router.post('task', '/api/train/task/update/:id', controller.task.update);
  19. // 问卷题库表配置路由
  20. router.resources('question', '/api/train/question', controller.question); // index、create、show、destroy
  21. router.post('question', '/api/train/question/update/:id', controller.question.update);
  22. // 问卷表配置路由
  23. router.post('questionnaire', '/api/train/questionnaire', controller.questionnaire.create);
  24. router.delete('questionnaire', '/api/train/questionnaire/:id', controller.questionnaire.delete);
  25. router.post('questionnaire', '/api/train/questionnaire/update/:id', controller.questionnaire.update);
  26. router.get('questionnaire', '/api/train/questionnaire', controller.questionnaire.query);
  27. router.get('questionnaire', '/api/train/questionnaire/show/:id', controller.questionnaire.show);
  28. // 学生表设置路由
  29. router.get('sutdent', '/api/train/student/findbedroom', controller.student.findbedroom);
  30. router.get('sutdent', '/api/train/student/seek', controller.student.seek);
  31. router.resources('student', '/api/train/student', controller.student); // index、create、show、destroy
  32. router.post('student', '/api/train/student/update/:id', controller.student.update);
  33. // 班主任表设置路由
  34. router.resources('headteacher', '/api/train/headteacher', controller.headteacher); // index、create、show、destroy
  35. router.post('headteacher', '/api/train/headteacher/update/:id', controller.headteacher.update);
  36. // 寝室表设置路由
  37. router.resources('bedroom', '/api/train/bedroom', controller.bedroom); // index、create、show、destroy
  38. router.post('bedroom', '/api/train/bedroom/update/:id', controller.bedroom.update);
  39. router.post('bedroom', '/api/train/bedroom/apart', controller.bedroom.apart);
  40. // 班级表设置路由
  41. router.post('class', '/api/train/class/notice', controller.class.notice);
  42. router.resources('class', '/api/train/class', controller.class); // index、create、show、destroy
  43. router.post('class', '/api/train/class/update/:id', controller.class.update);
  44. router.post('class', '/api/train/class/divide', controller.class.divide);
  45. // 部门表设置路由
  46. router.resources('department', '/api/train/department', controller.department); // index、create、show、destroy
  47. router.post('department', '/api/train/department/update/:id', controller.department.update);
  48. // 位置表设置路由
  49. router.resources('location', '/api/train/location', controller.location); // index、create、show、destroy
  50. router.post('location', '/api/train/location/update/:id', controller.location.update);
  51. // 培训计划表设置路由
  52. router.resources('trainplan', '/api/train/trainplan', controller.trainplan); // index、create、show、destroy
  53. router.post('trainplan', '/api/train/trainplan/update/:id', controller.trainplan.update);
  54. // 节假日表设置路由
  55. router.resources('festival', '/api/train/festival', controller.festival); // index、create、show、destroy
  56. router.post('festival', '/api/train/festival/update/:id', controller.festival.update);
  57. // 课程表设置路由
  58. router.resources('lesson', '/api/train/lesson', controller.lesson); // index、create、show、destroy
  59. router.post('lesson', '/api/train/lesson/update/:id', controller.lesson.update);
  60. // 培训计划学校上报时间表设置路由
  61. router.resources('schtime', '/api/train/schtime', controller.schtime); // index、create、show、destroy
  62. router.post('schtime', '/api/train/schtime/update/:id', controller.schtime.update);
  63. // 班主任全年计划表设置路由
  64. router.get('teaplan', '/api/train/teaplan/findteacher', controller.teaplan.findteacher);
  65. router.resources('teaplan', '/api/train/teaplan', controller.teaplan); // index、create、show、destroy
  66. router.post('teaplan', '/api/train/teaplan/update/:id', controller.teaplan.update);
  67. // 教师申请讲课表设置路由
  68. router.get('apply', '/api/train/apply/queryteacher', controller.apply.queryteacher);
  69. router.resources('apply', '/api/train/apply', controller.apply); // index、create、show、destroy
  70. router.post('apply', '/api/train/apply/update/:id', controller.apply.update);
  71. // 请假表设置路由
  72. router.resources('leave', '/api/train/leave', controller.leave); // index、create、show、destroy
  73. router.post('leave', '/api/train/leave/update/:id', controller.leave.update);
  74. // 分组表设置路由
  75. router.resources('group', '/api/train/group', controller.group); // index、create、show、destroy
  76. router.post('group', '/api/train/group/update/:id', controller.group.update);
  77. router.post('group', '/api/train/group/insert', controller.group.insert);
  78. router.post('group', '/api/train/group/exit', controller.group.exit);
  79. // 职责说明表设置路由
  80. router.resources('duty', '/api/train/duty', controller.duty); // index、create、show、destroy
  81. router.post('duty', '/api/train/duty/update/:id', controller.duty.update);
  82. // 学生上传作业表设置路由
  83. router.resources('uploadtask', '/api/train/uploadtask', controller.uploadtask); // index、create、show、destroy
  84. router.post('uploadtask', '/api/train/uploadtask/update/:id', controller.uploadtask.update);
  85. // 学生上传问卷表设置路由
  86. router.get('/api/train/uploadquestion/completion', controller.uploadquestion.completion); // 统计完成度
  87. router.resources('uploadquestion', '/api/train/uploadquestion', controller.uploadquestion); // index、create、show、destroy
  88. router.post('uploadquestion', '/api/train/uploadquestion/update/:id', controller.uploadquestion.update);
  89. // 考勤表设置路由
  90. router.get('/api/train/attendance/wxauth', controller.attendance.wxauth); // 统计完成度
  91. router.resources('attendance', '/api/train/attendance', controller.attendance); // index、create、show、destroy
  92. router.post('attendance', '/api/train/attendance/update/:id', controller.attendance.update);
  93. // 学校上传学生名单
  94. router.resources('school', '/api/train/school', controller.school); // index、create、show、destroy
  95. router.post('school', '/api/train/school/update/:id', controller.school.update);
  96. router.post('/api/train/school/import', controller.school.stuimport); // 名单上传
  97. // 民族表设置路由
  98. router.resources('nation', '/api/train/nation', controller.nation); // index、create、show、destroy
  99. router.post('nation', '/api/train/nation/update/:id', controller.nation.update);
  100. // 行政区划表设置路由
  101. router.resources('region', '/api/train/region', controller.region); // index、create、show、destroy
  102. router.post('region', '/api/train/region/update/:id', controller.region.update);
  103. // 用户表设置路由
  104. router.get('/api/train/user/schoolregister', controller.user.schoolregister);// 学校账号一键生成
  105. router.resources('user', '/api/train/user', controller.user); // index、create、show、destroy
  106. router.post('user', '/api/train/user/update/:id', controller.user.update);
  107. router.post('user', '/api/train/user/register', controller.user.register);// 学校注册
  108. router.post('user', '/api/train/user/bind', controller.user.bind);// 学生微信绑定
  109. router.post('user', '/api/train/user/userbind', controller.user.userbind);// 其他用户微信绑定
  110. // 行政区划表设置路由
  111. router.resources('termquest', '/api/train/termquest', controller.termquest); // index、create、show、destroy
  112. router.post('termquest', '/api/train/termquest/update/:id', controller.termquest.update);
  113. // 微信端访问地址
  114. router.get('/api/train/auth', controller.weixin.auth); // 微信登录
  115. router.get('/api/train/authBack', controller.weixin.authBack); // 微信登录
  116. // 微信端访问地址
  117. router.get('/api/train/authtest', controller.weixin.authTest); // 微信登录测试
  118. // pc端登录
  119. router.post('/api/train/login', controller.login.login);// 登录
  120. // 微信端登录
  121. router.get('/api/train/qrcode', controller.login.qrcode);// 登录
  122. router.post('/api/train/wxcheck', controller.login.wxcheck);// 微信检查登录
  123. router.post('/api/train/wxlogin', controller.login.wxlogin);// 登录
  124. // 评分表设置路由
  125. router.resources('score', '/api/train/score', controller.score); // index、create、show、destroy
  126. router.post('score', '/api/train/score/update/:id', controller.score.update);
  127. // 上传资料表设置路由
  128. router.resources('material', '/api/train/material', controller.material); // index、create、show、destroy
  129. router.post('material', '/api/train/material/update/:id', controller.material.update);
  130. // 资料评分表设置路由
  131. router.resources('materialscore', '/api/train/materialscore', controller.materialscore); // index、create、show、destroy
  132. router.post('materialscore', '/api/train/materialscore/update/:id', controller.materialscore.update);
  133. // 教师在线表设置路由
  134. router.resources('online', '/api/train/online', controller.online); // index、create、show、destroy
  135. router.post('online', '/api/train/online/update/:id', controller.online.update);
  136. // 聊天房间表设置路由
  137. router.resources('room', '/api/train/room', controller.room); // index、create、show、destroy
  138. router.post('room', '/api/train/room/update/:id', controller.room.update);
  139. // 聊天记录表设置路由
  140. router.resources('record', '/api/train/record', controller.record); // index、create、show、destroy
  141. router.post('record', '/api/train/record/update/:id', controller.record.update);
  142. };