'use strict'; const Controller = require('egg').Controller; const os = require('os'); class HomeController extends Controller { async index() { const { ctx } = this; ctx.body = 'hi'; await this.ctx.service.disk.sendWarningEmail(); } async diskInfo() { const res = await this.ctx.service.disk.diskInfo(); this.ctx.ok({ data: res }); } async toDir() { const res = await this.ctx.service.disk.toDir(this.ctx.request.body); this.ctx.ok({ data: res }); } async delFile() { const res = await this.ctx.service.disk.delFile(this.ctx.request.body); this.ctx.ok({ data: res }); } } module.exports = HomeController;