????
Current Path : C:/inetpub/vhost/binhdinhinvest.gdtvietnam.com/api/dist/xtdt/controller/ |
Current File : C:/inetpub/vhost/binhdinhinvest.gdtvietnam.com/api/dist/xtdt/controller/export.controller.js |
"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.ExportController = void 0; const openapi = require("@nestjs/swagger"); const common_1 = require("@nestjs/common"); const swagger_1 = require("@nestjs/swagger"); const express = require("express"); const service_1 = require("../service"); let ExportController = class ExportController { constructor(service) { this.service = service; } async exportDiemDauTu(tinhTrang, loai, res) { const buffer = await this.service.exportDiemDauTu(tinhTrang, loai); res.type('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') .send(buffer); } async exportRanhGioiKhu(loaiKhu, res) { const buffer = await this.service.exportRanhGioiKhu(loaiKhu); res.type('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') .send(buffer); } async exportDoanhNghiep(loaiDn, res) { const buffer = await this.service.exportDoanhNghiep(loaiDn); res.type('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') .send(buffer); } }; __decorate([ (0, common_1.Get)('DiemDauTu'), (0, swagger_1.ApiResponse)({ status: 200, content: { 'application/*': { schema: { type: 'string', format: 'binary', } } } }), (0, common_1.Header)('Content-Disposition', 'attachment; filename="bao-cao.xlsx"'), (0, common_1.Header)('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'), (0, swagger_1.ApiQuery)({ name: 'tinhTrang', enum: ['DKG', 'DDT'], required: false }), (0, swagger_1.ApiQuery)({ name: 'loai', enum: ['TN', 'NN'], required: false }), openapi.ApiResponse({ status: 200 }), __param(0, (0, common_1.Query)('tinhTrang')), __param(1, (0, common_1.Query)('loai')), __param(2, (0, common_1.Response)()), __metadata("design:type", Function), __metadata("design:paramtypes", [Object, Object, Object]), __metadata("design:returntype", Promise) ], ExportController.prototype, "exportDiemDauTu", null); __decorate([ (0, common_1.Get)('RanhGioiKhu'), (0, swagger_1.ApiResponse)({ status: 200, content: { 'application/*': { schema: { type: 'string', format: 'binary', } } } }), (0, common_1.Header)('Content-Disposition', 'attachment; filename="bao-cao.xlsx"'), (0, common_1.Header)('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'), (0, swagger_1.ApiQuery)({ name: 'loaiKhu', enum: ['KKT', 'KCN', 'CCN'] }), openapi.ApiResponse({ status: 200 }), __param(0, (0, common_1.Query)('loaiKhu')), __param(1, (0, common_1.Response)()), __metadata("design:type", Function), __metadata("design:paramtypes", [String, Object]), __metadata("design:returntype", Promise) ], ExportController.prototype, "exportRanhGioiKhu", null); __decorate([ (0, common_1.Get)('DoanhNghiep'), (0, swagger_1.ApiResponse)({ status: 200, content: { 'application/*': { schema: { type: 'string', format: 'binary', } } } }), (0, common_1.Header)('Content-Disposition', 'attachment; filename="bao-cao.xlsx"'), (0, common_1.Header)('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'), (0, swagger_1.ApiQuery)({ name: 'loaiDn', enum: ['TN', 'NN'], required: false }), openapi.ApiResponse({ status: 200 }), __param(0, (0, common_1.Query)('loaiDn')), __param(1, (0, common_1.Response)()), __metadata("design:type", Function), __metadata("design:paramtypes", [String, Object]), __metadata("design:returntype", Promise) ], ExportController.prototype, "exportDoanhNghiep", null); ExportController = __decorate([ (0, swagger_1.ApiTags)('Kết xuất báo cáo'), (0, common_1.Controller)('export'), __metadata("design:paramtypes", [service_1.ExportService]) ], ExportController); exports.ExportController = ExportController;