123456789101112131415161718192021222324252627282930313233343536 |
- 'use strict';
- const _ = require('lodash');
- const Controller = require('egg').Controller;
- const meta = require('./.teacher.js');
- const { CrudController } = require('naf-framework-mongoose/lib/controller');
- // 老师管理
- class TeacherController extends Controller {
- constructor(ctx) {
- super(ctx);
- this.service = this.ctx.service.teacher;
- }
- // GET
- // 查询教师详情
- async show() {
- const res = await this.service.fetchTeacher(this.ctx.params);
- this.ctx.ok({ data: res });
- }
- async status() {
- const res = await this.service.status(this.ctx.request.body);
- this.ctx.ok({ data: res });
- }
- // 教师评分上报
- async teaimport() {
- const res = await this.service.teaimport(this.ctx.request.body);
- this.ctx.ok({ msg: 'created', data: res });
- }
- }
- module.exports = CrudController(TeacherController, meta);
|