From e9dc22fde9c300ec9afba3fe064ea65759e8ea85 Mon Sep 17 00:00:00 2001 From: IlhamTahir Date: Thu, 21 Nov 2024 16:10:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8E=A5=E5=8F=A3=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/article/controller/carousal.controller.ts | 14 +++++++++----- src/core/controller/file.controller.ts | 9 +++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/article/controller/carousal.controller.ts b/src/article/controller/carousal.controller.ts index 01ad6b3..9f56a62 100644 --- a/src/article/controller/carousal.controller.ts +++ b/src/article/controller/carousal.controller.ts @@ -3,6 +3,7 @@ import { Controller, Delete, Get, + Param, Post, Put, Query, @@ -78,7 +79,7 @@ export class CarousalController { @ApiOkResponse({ type: CarousalVo, }) - async get(id: string) { + async get(@Param('id') id: string) { return CarousalMapper.toVo(await this.carousalService.get(id)); } @@ -87,7 +88,10 @@ export class CarousalController { @ApiOkResponse({ type: CarousalVo, }) - async update(id: string, updateCarousalRequest: UpdateCarousalRequest) { + async update( + @Param('id') id: string, + @Body() updateCarousalRequest: UpdateCarousalRequest, + ) { return CarousalMapper.toVo( await this.carousalService.update(id, updateCarousalRequest), ); @@ -98,7 +102,7 @@ export class CarousalController { @ApiOkResponse({ type: CarousalVo, }) - async active(id: string) { + async active(@Param('id') id: string) { return CarousalMapper.toVo(await this.carousalService.active(id)); } @@ -107,13 +111,13 @@ export class CarousalController { @ApiOkResponse({ type: CarousalVo, }) - async inactive(id: string) { + async inactive(@Param('id') id: string) { return CarousalMapper.toVo(await this.carousalService.inactive(id)); } @Delete(':id') @ApiBearerAuth() - async delete(id: string) { + async delete(@Param('id') id: string) { await this.carousalService.delete(id); } } diff --git a/src/core/controller/file.controller.ts b/src/core/controller/file.controller.ts index f0a25ed..34d002c 100644 --- a/src/core/controller/file.controller.ts +++ b/src/core/controller/file.controller.ts @@ -5,9 +5,13 @@ import { UseInterceptors, } from '@nestjs/common'; import { FileInterceptor } from '@nestjs/platform-express'; -import { ApiBody, ApiConsumes, ApiOkResponse } from '@nestjs/swagger'; +import { + ApiBearerAuth, + ApiBody, + ApiConsumes, + ApiOkResponse, +} from '@nestjs/swagger'; import { FileService } from '../service/file.service'; -import { NoAuth } from '../decorators/no-auth.decorator'; import { FileVo } from '../vo/file.vo'; @Controller('files') @@ -24,6 +28,7 @@ export class FileController { }, }, }) + @ApiBearerAuth() @ApiOkResponse({ type: FileVo, })