app.js 497 B

1234567891011121314151617181920
  1. 'use strict';
  2. class AppBootHook {
  3. constructor(app) {
  4. this.app = app;
  5. }
  6. async didReady() {
  7. // 应用已经启动完毕
  8. const ctx = await this.app.createAnonymousContext();
  9. // 企业入驻申请消息接收事件
  10. // await ctx.service.rabbitmq.receiveQueueMsg('user_bind');
  11. await ctx.service.rabbitmq.mission();
  12. }
  13. async serverDidReady() {
  14. // 应用已经启动完毕
  15. const ctx = await this.app.createAnonymousContext();
  16. }
  17. }
  18. module.exports = AppBootHook;