matcher/src/modules/ad/adapters/primaries/ad-messager.controller.ts

20 lines
508 B
TypeScript
Raw Normal View History

2023-04-24 14:44:52 +00:00
import { RabbitSubscribe } from '@golevelup/nestjs-rabbitmq';
import { Controller } from '@nestjs/common';
// import { Ad } from '../../domain/entities/ad';
@Controller()
export class AdMessagerController {
@RabbitSubscribe({
name: 'adCreated',
})
public adCreatedHandler(message: string) {
console.log(JSON.parse(message));
// try {
// const createdAd: Ad = JSON.parse(message);
// console.log(createdAd);
// } catch (e) {
// console.log('error', e);
// }
}
}