BaseController.ts 500 B

1234567891011121314151617181920
  1. import { Application, Context } from '@midwayjs/koa';
  2. import { App, Inject } from '@midwayjs/decorator';
  3. /**
  4. * controller基类,有一些基础函数需要实现
  5. */
  6. export abstract class BaseController {
  7. @App()
  8. app: Application;
  9. @Inject()
  10. ctx: Context;
  11. abstract query(...args);
  12. abstract fetch(...args);
  13. abstract update(...args);
  14. abstract updateMany(...args);
  15. abstract delete(...args);
  16. abstract deleteMany(...args);
  17. abstract create(...args);
  18. abstract createMany(...args);
  19. }