"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TestQueueController = void 0;
const openapi = require("@nestjs/swagger");
const common_1 = require("@nestjs/common");
const swagger_1 = require("@nestjs/swagger");
const auth_decorator_1 = require("../decorators/auth.decorator");
const public_decorator_1 = require("../decorators/public.decorator");
const auth_type_enum_1 = require("../enums/auth-type.enum");
const publisher_factory_service_1 = require("../services/queues/publisher-factory.service");
let TestQueueController = class TestQueueController {
    constructor(publisherFactory) {
        this.publisherFactory = publisherFactory;
    }
    async getHello(messageBroker, timeoutSeconds) {
        const pubsubMessage = 'A hopping-good time!';
        const m = {
            payload: {
                firstName: 'Harish',
                lastName: 'Patel',
                age: 40,
                timeoutSeconds: timeoutSeconds
            },
            parentEntity: 'feeType',
            parentEntityId: 23,
        };
        await this.publisherFactory.publish(m, 'TestQueuePublisher', messageBroker);
        return {};
    }
};
exports.TestQueueController = TestQueueController;
__decorate([
    (0, public_decorator_1.Public)(),
    (0, common_1.Get)(':messageBroker/:timeoutSeconds'),
    openapi.ApiResponse({ status: 200 }),
    __param(0, (0, common_1.Param)('messageBroker')),
    __param(1, (0, common_1.Param)('timeoutSeconds')),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String, Number]),
    __metadata("design:returntype", Promise)
], TestQueueController.prototype, "getHello", null);
exports.TestQueueController = TestQueueController = __decorate([
    (0, auth_decorator_1.Auth)(auth_type_enum_1.AuthType.None),
    (0, common_1.Controller)('queues'),
    (0, swagger_1.ApiTags)("Solid Core"),
    __metadata("design:paramtypes", [publisher_factory_service_1.PublisherFactory])
], TestQueueController);
//# sourceMappingURL=test-queue.controller.js.map