Files
maps-saas/apps/api/dist/weather/weather.controller.js
T

65 lines
3.2 KiB
JavaScript

"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.WeatherController = void 0;
const common_1 = require("@nestjs/common");
const swagger_1 = require("@nestjs/swagger");
const weather_service_1 = require("./weather.service");
let WeatherController = class WeatherController {
weatherService;
constructor(weatherService) {
this.weatherService = weatherService;
}
async getWeatherGrid() {
return this.weatherService.getWeatherGrid();
}
async getCitiesWeather(region) {
return this.weatherService.getAllCitiesWeather(region);
}
async getWeatherAlerts(region) {
return this.weatherService.getAlerts(region);
}
};
exports.WeatherController = WeatherController;
__decorate([
(0, common_1.Get)('grid'),
(0, swagger_1.ApiOperation)({ summary: 'Get weather temperature grid (Jordan, Syria, Egypt)' }),
__metadata("design:type", Function),
__metadata("design:paramtypes", []),
__metadata("design:returntype", Promise)
], WeatherController.prototype, "getWeatherGrid", null);
__decorate([
(0, common_1.Get)('cities'),
(0, swagger_1.ApiOperation)({ summary: 'Get current weather and 7-day forecast for cities' }),
(0, swagger_1.ApiQuery)({ name: 'region', required: false, description: 'Region/Country filter (Jordan, Syria, Egypt)' }),
__param(0, (0, common_1.Query)('region')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:returntype", Promise)
], WeatherController.prototype, "getCitiesWeather", null);
__decorate([
(0, common_1.Get)('alerts'),
(0, swagger_1.ApiOperation)({ summary: 'Get weather alerts and warnings' }),
(0, swagger_1.ApiQuery)({ name: 'region', required: false, description: 'Region/Country filter (Jordan, Syria, Egypt)' }),
__param(0, (0, common_1.Query)('region')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:returntype", Promise)
], WeatherController.prototype, "getWeatherAlerts", null);
exports.WeatherController = WeatherController = __decorate([
(0, swagger_1.ApiTags)('weather'),
(0, common_1.Controller)('weather'),
__metadata("design:paramtypes", [weather_service_1.WeatherService])
], WeatherController);
//# sourceMappingURL=weather.controller.js.map