123456789101112131415161718192021222324 |
- import { Controller, Get, Post, Body, Patch, Param, Delete, Headers } from '@nestjs/common';
- import { WebService } from './web.service';
- import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
- @ApiTags('website(展示端)')
- @Controller('web')
- export class WebController {
- constructor(private readonly webService: WebService) {}
- @Get('menu')
- getMenus(@Headers('locale') locale?: string) {
- return this.webService.findMenuTree(locale);
- }
- @Get('article/:id')
- getArticleDetail(@Param('id') id: string, @Headers('locale') locale?: string) {
- return this.webService.findArticleDetail(+id, locale);
- }
- @Get('article/count/:id')
- getArticleCount(@Param('id') id: string) {
- return this.webService.setArticleCount(+id);
- }
- }
|