123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- 'use strict';
- const _ = require('lodash');
- const meta = require('./.student.js');
- const Controller = require('egg').Controller;
- const { CrudController } = require('naf-framework-mongoose/lib/controller');
- // 学生管理
- class StudentController extends Controller {
- constructor(ctx) {
- super(ctx);
- this.service = this.ctx.service.student;
- }
- async index() {
- const data = await this.service.query(this.ctx.query);
- this.ctx.ok({ ...data });
- }
- // GET
- // 查询
- async seek() {
- const res = await this.service.seek(this.ctx.query);
- this.ctx.ok({ ...res });
- }
- // GET
- // 查询
- async findbedroom() {
- const data = await this.service.findbedroom(this.ctx.query);
- this.ctx.ok({ data });
- }
- async upjob() {
- const data = await this.service.upjob(this.ctx.request.body);
- this.ctx.ok({ data });
- }
- // 删除学生班级
- async deleteclass() {
- const data = await this.service.deleteclass(this.ctx.request.body);
- this.ctx.ok({ data });
- }
- async findscore() {
- const data = await this.service.findscore(this.ctx.query);
- this.ctx.ok({ ...data });
- }
- async findbystuids() {
- const data = await this.service.findbystuids(this.ctx.request.body);
- this.ctx.ok({ data });
- }
- async deletestus() {
- const data = await this.service.deletestus(this.ctx.request.body);
- this.ctx.ok({ data });
- }
- async updatabedroom() {
- const data = await this.service.updatabedroom(this.ctx.request.body);
- this.ctx.ok({ data });
- }
- }
- module.exports = CrudController(StudentController, meta);
|