import { Controller, Get, Param, NotFoundException } from "@nestjs/common"; import { SeoService } from "./seo.service"; import { ApiTags, ApiOperation } from "@nestjs/swagger"; @ApiTags("SEO & Metadata") @Controller("seo") export class SeoController { constructor(private readonly seoService: SeoService) {} @Get("sitemap") @ApiOperation({ summary: "دریافت لیست لینک‌های نقشه سایت (Sitemap)" }) getSitemap() { return this.seoService.getSitemapUrls(); } @Get("product-schema/:idOrSlug") @ApiOperation({ summary: "دریافت متادیتای ساختاریافته Schema.org JSON-LD محصول", }) async getProductSchema(@Param("idOrSlug") idOrSlug: string) { const schema = await this.seoService.getProductSchema(idOrSlug); if (!schema) { throw new NotFoundException("Product for schema not found"); } return schema; } }