Initial Montech monorepo: Nuxt landing, Vue admin, Nest API.
Scaffold SSR site with CMS/blog/gallery/SEO admin and deploy configs for montech.ir. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { Body, Controller, Get, Param, Put, UseGuards } from "@nestjs/common";
|
||||
import { IsBoolean, IsOptional, IsString } from "class-validator";
|
||||
import { SeoService } from "./seo.service";
|
||||
import { JwtAuthGuard } from "../auth/jwt-auth.guard";
|
||||
|
||||
class SeoDto {
|
||||
@IsOptional() @IsString() title?: string;
|
||||
@IsOptional() @IsString() description?: string;
|
||||
@IsOptional() @IsString() ogImage?: string;
|
||||
@IsOptional() @IsString() canonical?: string;
|
||||
@IsOptional() @IsBoolean() noIndex?: boolean;
|
||||
}
|
||||
|
||||
@Controller()
|
||||
export class SeoController {
|
||||
constructor(private seo: SeoService) {}
|
||||
|
||||
@Get("public/pages/:key")
|
||||
getPublic(@Param("key") key: string) {
|
||||
return this.seo.getByKey(key);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get("admin/pages")
|
||||
list() {
|
||||
return this.seo.listPages();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Put("admin/pages/:key/seo")
|
||||
update(@Param("key") key: string, @Body() dto: SeoDto) {
|
||||
return this.seo.updateSeo(key, dto);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user