1234567891011121314151617181920212223242526272829303132 |
- 'use strict';
- const Controller = require('egg').Controller;
- class UtilController extends Controller {
- constructor(ctx) {
- super(ctx);
- this.service = this.ctx.service.util;
- }
- async utilMethod() {
- const res = await this.service.utilMethod(this.ctx.query, this.ctx.request.body);
- this.ctx.ok({ data: res });
- }
- // 导出学校计划人数
- async schoolDownload() {
- const data = await this.service.schoolDownload();
- this.ctx.ok({ data });
- }
- // 导入学校计划人数
- async schoolImport() {
- const res = await this.service.schoolImport(this.ctx.request.body);
- this.ctx.ok({ msg: 'created', data: res });
- }
- // 学生参培名单导入
- async stuImport() {
- const res = await this.service.stuimport(this.ctx.request.body);
- this.ctx.ok({ msg: 'created', data: res });
- }
- }
- module.exports = UtilController;
|