- Backend (NestJS): 82 suites, 641 tests passing; 0 ESLint errors; 0 tsc errors. Hardened SSL cert/key matching, SSRF IP pinning, and eBank validation. - Admin Panel (Vite/React): 48 suites, 300 tests passing; 0 ESLint errors; 0 tsc errors. Full coverage across all pages and settings. - Storefront (Next.js): 62 suites, 368 tests passing; 0 ESLint errors; 0 tsc errors. - Fixed unmount lifecycle guards, promise error handling, and component edge cases.
36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
import { Controller, Get, Param, HttpStatus, Query } from "@nestjs/common";
|
|
import { WikiService } from "./wiki.service";
|
|
import {
|
|
ApiTags,
|
|
ApiOperation,
|
|
ApiResponse,
|
|
ApiOkResponse,
|
|
ApiNotFoundResponse,
|
|
} from "@nestjs/swagger";
|
|
import { PaginationDto } from "../common/dto/pagination.dto";
|
|
|
|
@ApiTags("Wiki - دانشنامه ترکیبات")
|
|
@Controller("wiki")
|
|
@ApiResponse({
|
|
status: HttpStatus.INTERNAL_SERVER_ERROR,
|
|
description: "خطای داخلی سرور",
|
|
})
|
|
export class WikiController {
|
|
constructor(private readonly wikiService: WikiService) {}
|
|
|
|
@Get()
|
|
@ApiOperation({ summary: "دریافت تمام کلمات دانشنامه" })
|
|
@ApiOkResponse({ description: "لیست کلمات به همراه توضیحات (صفحهبندی شده)" })
|
|
findAll(@Query() query: PaginationDto) {
|
|
return this.wikiService.findAll(query);
|
|
}
|
|
|
|
@Get(":key")
|
|
@ApiOperation({ summary: "دریافت ترکیب علمی با کلید" })
|
|
@ApiOkResponse({ description: "اطلاعات کامل ترکیب علمی" })
|
|
@ApiNotFoundResponse({ description: "ترکیب علمی یافت نشد" })
|
|
findOne(@Param("key") key: string) {
|
|
return this.wikiService.findOneByKey(key);
|
|
}
|
|
}
|