123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496 |
- 'use strict';
- /**
- * @param {Egg.Application} app - egg application
- */
- module.exports = app => {
- const { router, controller } = app;
- router.get('/', controller.home.index);
- // 共通查询单条记录方法
- router.get('/api/train/common/findone/:modelname', controller.common.findone);
- // 共通批量查询方法
- router.post(
- '/api/train/common/findbyids/:modelname',
- controller.common.findbyids
- );
- // 共通查询表
- router.get('/api/train/common/findbymodel', controller.common.findbymodel);
- router.get('/api/train/common/findyear', controller.common.findyear);
- // 基础设置表路由
- router.get('/api/train/setting/findone', controller.setting.findone);
- router.resources('setting', '/api/train/setting', controller.setting); // index、create、show、destroy
- router.post(
- 'setting',
- '/api/train/setting/update/:id',
- controller.setting.update
- );
- // 科目表设置路由
- router.resources('subject', '/api/train/subject', controller.subject); // index、create、show、destroy
- router.post(
- 'subject',
- '/api/train/subject/update/:id',
- controller.subject.update
- );
- // 教师表设置路由
- router.get('teacher', '/api/train/teacher/show/:id', controller.teacher.show);
- router.resources('teacher', '/api/train/teacher', controller.teacher); // index、create、show、destroy
- router.post(
- 'teacher',
- '/api/train/teacher/update/:id',
- controller.teacher.update
- );
- router.post(
- 'teacher',
- '/api/train/teacher/status',
- controller.teacher.status
- );
- router.post('/api/train/teacher/teaimport', controller.teacher.teaimport);
- // 作业表配置路由
- router.resources('task', '/api/train/task', controller.task); // index、create、show、destroy
- router.post('task', '/api/train/task/update/:id', controller.task.update);
- // 问卷题库表配置路由
- router.resources('question', '/api/train/question', controller.question); // index、create、show、destroy
- router.post(
- 'question',
- '/api/train/question/update/:id',
- controller.question.update
- );
- // 问卷表配置路由
- router.post(
- 'questionnaire',
- '/api/train/questionnaire',
- controller.questionnaire.create
- );
- router.delete(
- 'questionnaire',
- '/api/train/questionnaire/:id',
- controller.questionnaire.delete
- );
- router.post(
- 'questionnaire',
- '/api/train/questionnaire/update/:id',
- controller.questionnaire.update
- );
- router.get(
- 'questionnaire',
- '/api/train/questionnaire',
- controller.questionnaire.query
- );
- router.get(
- 'questionnaire',
- '/api/train/questionnaire/show/:id',
- controller.questionnaire.show
- );
- // 学生表设置路由
- router.get(
- 'sutdent',
- '/api/train/student/findscore',
- controller.student.findscore
- );
- router.get(
- 'sutdent',
- '/api/train/student/findbedroom',
- controller.student.findbedroom
- );
- router.get('sutdent', '/api/train/student/seek', controller.student.seek);
- router.resources('student', '/api/train/student', controller.student); // index、create、show、destroy
- router.post(
- 'student',
- '/api/train/student/update/:id',
- controller.student.update
- );
- router.post('student', '/api/train/student/upjob', controller.student.upjob);
- router.post(
- 'student',
- '/api/train/student/deleteclass',
- controller.student.deleteclass
- ); // 删除学生班级
- router.post(
- 'student',
- '/api/train/student/findbystuids',
- controller.student.findbystuids
- );
- router.post(
- 'student',
- '/api/train/student/deletestus',
- controller.student.deletestus
- ); // 删除学生多条
- router.post(
- 'student',
- '/api/train/student/updatabedroom',
- controller.student.updatabedroom
- ); // 批量学生寝室号
- // 班主任表设置路由
- router.resources(
- 'headteacher',
- '/api/train/headteacher',
- controller.headteacher
- ); // index、create、show、destroy
- router.post(
- 'headteacher',
- '/api/train/headteacher/update/:id',
- controller.headteacher.update
- );
- // 寝室表设置路由
- router.get('/api/train/bedroom/student/:id', controller.bedroom.roomstu); // 根据班级id查询寝室信息
- router.resources('bedroom', '/api/train/bedroom', controller.bedroom); // index、create、show、destroy
- router.post(
- 'bedroom',
- '/api/train/bedroom/update/:id',
- controller.bedroom.update
- );
- router.post('bedroom', '/api/train/bedroom/apart', controller.bedroom.apart);
- router.post(
- 'bedroom',
- '/api/train/bedroom/ibeacon',
- controller.bedroom.ibeacon
- );
- // 班级表设置路由
- router.get(
- 'class',
- '/api/train/class/classinfo/:id',
- controller.class.classinfo
- );
- router.post(
- 'class',
- '/api/train/class/upclasses',
- controller.class.upclasses
- );
- router.post('class', '/api/train/class/notice', controller.class.notice);
- router.resources('class', '/api/train/class', controller.class); // index、create、show、destroy
- router.post('class', '/api/train/class/update/:id', controller.class.update);
- router.post('class', '/api/train/class/divide', controller.class.divide);
- router.post('class', '/api/train/class/uptea', controller.class.uptea);
- router.post(
- 'class',
- '/api/train/class/upstuclass/:id',
- controller.class.studentupclass
- ); // 学生修改班级
- // 部门表设置路由
- router.resources(
- 'department',
- '/api/train/department',
- controller.department
- ); // index、create、show、destroy
- router.post(
- 'department',
- '/api/train/department/update/:id',
- controller.department.update
- );
- // 位置表设置路由
- router.resources('location', '/api/train/location', controller.location); // index、create、show、destroy
- router.post(
- 'location',
- '/api/train/location/update/:id',
- controller.location.update
- );
- // 培训计划表设置路由
- router.resources('trainplan', '/api/train/trainplan', controller.trainplan); // index、create、show、destroy
- router.post('trainplan','/api/train/trainplan/update/:id',controller.trainplan.update);
- router.post('/api/train/trainplan/exportExcel', controller.trainplan.exportExcel); // 导出
- router.post('/api/train/trainplan/exportSchool', controller.trainplan.exportSchool); // 导出计划学校
- router.post('/api/train/trainplan/exportPlan', controller.trainplan.exportPlan); // 导出计划日历
- router.post('/api/train/trainplan/updateclass', controller.trainplan.updateclass);
- router.post('/api/train/trainplan/updatereteacher', controller.trainplan.updatereteacher);
- // 培训计划年度批次表设置路由
- router.resources('trainplanyear', '/api/train/trainplanyear', controller.trainplanyear); // index、create、show、destroy
- router.post('trainplanyear', '/api/train/trainplanyear/update/:id', controller.trainplanyear.update);
- // 节假日表设置路由
- router.resources('festival', '/api/train/festival', controller.festival); // index、create、show、destroy
- router.post(
- 'festival',
- '/api/train/festival/update/:id',
- controller.festival.update
- );
- // 课程表设置路由
- router.get('/api/train/lesson/teaclass', controller.lesson.teaclass);
- router.post(
- 'lesson',
- '/api/train/lesson/uplessones',
- controller.lesson.uplessones
- );
- router.get('/api/train/lesson/classbyteaid', controller.lesson.classbyteaid); // 根据计划id与教师id查询班级信息
- router.resources('lesson', '/api/train/lesson', controller.lesson); // index、create、show、destroy
- router.post(
- 'lesson',
- '/api/train/lesson/update/:id',
- controller.lesson.update
- );
- router.post(
- 'lesson',
- '/api/train/lesson/autolesson/:id',
- controller.lesson.autolesson
- ); // 自动排课
- // 培训计划学校上报时间表设置路由
- router.resources('schtime', '/api/train/schtime', controller.schtime); // index、create、show、destroy
- router.post(
- 'schtime',
- '/api/train/schtime/update/:id',
- controller.schtime.update
- );
- router.post(
- 'schtime',
- '/api/train/schtime/updateschtimes',
- controller.schtime.updateschtimes
- );
- // 班主任全年计划表设置路由
- router.get('teaplan', '/api/train/teaplan/divide', controller.teaplan.divide);
- router.get(
- 'teaplan',
- '/api/train/teaplan/findteacher',
- controller.teaplan.findteacher
- );
- router.resources('teaplan', '/api/train/teaplan', controller.teaplan); // index、create、show、destroy
- router.post(
- 'teaplan',
- '/api/train/teaplan/update/:id',
- controller.teaplan.update
- );
- // 教师申请讲课表设置路由
- router.get(
- 'apply',
- '/api/train/apply/queryteacher',
- controller.apply.queryteacher
- );
- router.resources('apply', '/api/train/apply', controller.apply); // index、create、show、destroy
- router.post('apply', '/api/train/apply/update/:id', controller.apply.update);
- // 请假表设置路由
- router.resources('leave', '/api/train/leave', controller.leave); // index、create、show、destroy
- router.post('leave', '/api/train/leave/update/:id', controller.leave.update);
- // 分组表设置路由
- router.resources('group', '/api/train/group', controller.group); // index、create、show、destroy
- router.post('group', '/api/train/group/update/:id', controller.group.update);
- router.post('group', '/api/train/group/insert', controller.group.insert);
- router.post('group', '/api/train/group/exit', controller.group.exit);
- router.post('group', '/api/train/group/sethead', controller.group.sethead);
- router.post(
- 'group',
- '/api/train/group/findbystuid',
- controller.group.findbystuid
- );
- // 职责说明表设置路由
- router.resources('duty', '/api/train/duty', controller.duty); // index、create、show、destroy
- router.post('duty', '/api/train/duty/update/:id', controller.duty.update);
- // 学生上传作业表设置路由
- router.resources(
- 'uploadtask',
- '/api/train/uploadtask',
- controller.uploadtask
- ); // index、create、show、destroy
- router.post(
- 'uploadtask',
- '/api/train/uploadtask/update/:id',
- controller.uploadtask.update
- );
- // 学生上传问卷表设置路由
- router.get(
- '/api/train/uploadquestion/completion',
- controller.uploadquestion.completion
- ); // 统计完成度
- router.resources(
- 'uploadquestion',
- '/api/train/uploadquestion',
- controller.uploadquestion
- ); // index、create、show、destroy
- router.post(
- 'uploadquestion',
- '/api/train/uploadquestion/update/:id',
- controller.uploadquestion.update
- );
- // 考勤表设置路由
- router.get('/api/train/attendance/wxauth', controller.attendance.wxauth); // 统计完成度
- router.resources(
- 'attendance',
- '/api/train/attendance',
- controller.attendance
- ); // index、create、show、destroy
- router.post(
- 'attendance',
- '/api/train/attendance/update/:id',
- controller.attendance.update
- );
- router.post(
- 'attendance',
- '/api/train/attendance/attendancecreate',
- controller.attendance.attendancecreate
- );
- router.post(
- 'attendance',
- '/api/train/attendance/attendancecreateList',
- controller.attendance.attendancecreateList
- );
- // 学校上传学生名单
- router.resources('school', '/api/train/school', controller.school); // index、create、show、destroy
- router.post(
- 'school',
- '/api/train/school/update/:id',
- controller.school.update
- );
- router.post('/api/train/school/import', controller.school.stuimport); // 名单上传
- // 民族表设置路由
- router.resources('nation', '/api/train/nation', controller.nation); // index、create、show、destroy
- router.post(
- 'nation',
- '/api/train/nation/update/:id',
- controller.nation.update
- );
- // 行政区划表设置路由
- router.resources('region', '/api/train/region', controller.region); // index、create、show、destroy
- router.post(
- 'region',
- '/api/train/region/update/:id',
- controller.region.update
- );
- // 用户表设置路由
- router.get('/api/train/user/schoolregister', controller.user.schoolregister); // 学校账号一键生成
- router.resources('user', '/api/train/user', controller.user); // index、create、show、destroy
- router.post('user', '/api/train/user/update/:id', controller.user.update);
- router.post('user', '/api/train/user/register', controller.user.register); // 学校注册
- router.post('user', '/api/train/user/bind', controller.user.bind); // 学生微信绑定
- router.post('user', '/api/train/user/userbind', controller.user.userbind); // 其他用户微信绑定
- // 行政区划表设置路由
- router.resources('termquest', '/api/train/termquest', controller.termquest); // index、create、show、destroy
- router.post(
- 'termquest',
- '/api/train/termquest/update/:id',
- controller.termquest.update
- );
- // 微信端访问地址
- router.get('/api/train/auth', controller.weixin.auth); // 微信登录
- // 微信端访问地址
- router.get('/api/train/authtest', controller.weixin.authTest); // 微信登录测试
- // pc端登录
- router.post('/api/train/login', controller.login.login); // 登录
- // 微信端登录
- router.get('/api/train/qrcode', controller.login.qrcode); // 登录
- router.post('/api/train/wxcheck', controller.login.wxcheck); // 微信检查登录
- router.post('/api/train/wxlogin', controller.login.wxlogin); // 登录
- // 评分表设置路由
- router.resources('score', '/api/train/score', controller.score); // index、create、show、destroy
- router.post('score', '/api/train/score/update/:id', controller.score.update);
- // 上传资料表设置路由
- router.resources('material', '/api/train/material', controller.material); // index、create、show、destroy
- router.post(
- 'material',
- '/api/train/material/update/:id',
- controller.material.update
- );
- // 资料评分表设置路由
- router.resources(
- 'materialscore',
- '/api/train/materialscore',
- controller.materialscore
- ); // index、create、show、destroy
- router.post(
- 'materialscore',
- '/api/train/materialscore/update/:id',
- controller.materialscore.update
- );
- // 教师在线表设置路由
- router.resources('online', '/api/train/online', controller.online); // index、create、show、destroy
- router.post(
- 'online',
- '/api/train/online/update/:id',
- controller.online.update
- );
- // 聊天房间表设置路由
- router.resources('room', '/api/train/room', controller.room); // index、create、show、destroy
- router.post('room', '/api/train/room/update/:id', controller.room.update);
- // 聊天记录表设置路由
- router.resources('record', '/api/train/record', controller.record); // index、create、show、destroy
- router.post(
- 'record',
- '/api/train/record/update/:id',
- controller.record.update
- );
- // 通知表设置路由
- router.resources('notice', '/api/train/notice', controller.notice); // index、create、show、destroy
- router.post(
- 'notice',
- '/api/train/notice/update/:id',
- controller.notice.update
- );
- router.post('notice', '/api/train/notice/look', controller.notice.look);
- // 课程模板表设置路由
- router.resources(
- 'lessonmode',
- '/api/train/lessonmode',
- controller.lessonmode
- ); // index、create、show、destroy
- router.post(
- 'lessonmode',
- '/api/train/lessonmode/update/:id',
- controller.lessonmode.update
- );
- // 全年计划模板表设置路由
- router.resources(
- 'trainmodel',
- '/api/train/trainmodel',
- controller.trainmodel
- ); // index、create、show、destroy
- router.post(
- 'trainmodel',
- '/api/train/trainmodel/update/:id',
- controller.trainmodel.update
- );
- // 统计查询设置路由
- router.get('/api/train/count/countstudent', controller.count.countstudent);
- // 按学校统计查询设置路由
- router.get('/api/train/count/countschstu/:id', controller.count.countschstu);
- // 班级类型表配置路由
- router.resources('classtype', '/api/train/classtype', controller.classtype); // index、create、show、destroy
- router.post(
- 'classtype',
- '/api/train/classtype/update/:id',
- controller.classtype.update
- );
- // 学校上传任务表设置路由
- router.resources('job', '/api/train/job', controller.job); // index、create、show、destroy
- router.post('job', '/api/train/job/update/:id', controller.job.update);
- // 消息表设置路由
- router.resources('message', '/api/train/message', controller.message); // index、create、show、destroy
- router.post('message', '/api/train/message/update/:id', controller.message.update);
- };
|