home.controller.ts 539 B

123456789101112131415161718192021
  1. import { App, Controller, Get, Inject } from '@midwayjs/decorator';
  2. import { WxPayService } from '../util/wxpay';
  3. import { Application } from '@midwayjs/koa';
  4. import { MqSender } from '../service/mq/mqSender.service';
  5. @Controller('/')
  6. export class HomeController {
  7. @Inject()
  8. wxpayService: WxPayService;
  9. @App()
  10. app: Application;
  11. @Inject()
  12. mqService: MqSender;
  13. @Get('/')
  14. async home(): Promise<string> {
  15. await this.mqService.groupMsg({ order_id: '638fec34a4ec0bad05bc2c54' }, 5000);
  16. return 'Hello Midwayjs!';
  17. }
  18. }