filestore.js 518 B

12345678910111213141516171819
  1. 'use strict';
  2. const Controller = require('egg').Controller;
  3. class FilestoreController extends Controller {
  4. async upload() {
  5. const res = await this.ctx.service.filestore.upload(this.ctx.params);
  6. this.ctx.body = res;
  7. }
  8. async delete() {
  9. const res = await this.ctx.service.filestore.delete(this.ctx.request.body);
  10. this.ctx.body = res;
  11. }
  12. async query() {
  13. const res = await this.ctx.service.filestore.query(this.ctx.query);
  14. this.ctx.body = res;
  15. }
  16. }
  17. module.exports = FilestoreController;