1234567891011121314151617181920212223242526272829 |
- 'use strict';
- const Controller = require('egg').Controller;
- const { v4: uuidv4 } = require('uuid');
- class HandleController extends Controller {
- async import() {
- const taskId = uuidv4();
- await this.ctx.service.handle.import({ ...this.ctx.params, taskId });
- this.ctx.body = { errcode: 0, errmsg: '', data: [], taskId };
- }
- async export() {
- const taskId = uuidv4();
- this.ctx.service.handle.export({ ...this.ctx.request.body, taskId });
- this.ctx.body = { errcode: 0, errmsg: '', data: [], taskId };
- }
- async progressed() {
- const res = await this.ctx.service.progress.progressed(this.ctx.query);
- this.ctx.body = res;
- }
- async template() {
- const res = await this.ctx.service.handle.template(this.ctx.query);
- this.ctx.body = res;
- }
- async exportsDownload() {
- const res = await this.ctx.service.handle.exportsDownload(this.ctx.query);
- this.ctx.body = res;
- }
- }
- module.exports = HandleController;
|