diff --git a/BE/src/asset/asset.controller.ts b/BE/src/asset/asset.controller.ts index 9596027c..360b85f4 100644 --- a/BE/src/asset/asset.controller.ts +++ b/BE/src/asset/asset.controller.ts @@ -26,6 +26,7 @@ export class AssetController { @ApiResponse({ status: 200, description: '매도 가능 주식 개수 조회 성공', + example: { quantity: 0 }, }) async getUserStockByCode( @Req() request: Request, @@ -48,6 +49,7 @@ export class AssetController { @ApiResponse({ status: 200, description: '매수 가능 금액 조회 성공', + example: { cash_balance: 0 }, }) async getCashBalance(@Req() request: Request) { return this.assetService.getCashBalance(parseInt(request.user.userId, 10)); diff --git a/BE/src/auth/auth.controller.ts b/BE/src/auth/auth.controller.ts index bf462d29..7e58a4bb 100644 --- a/BE/src/auth/auth.controller.ts +++ b/BE/src/auth/auth.controller.ts @@ -10,7 +10,7 @@ import { UnauthorizedException, } from '@nestjs/common'; import { AuthGuard } from '@nestjs/passport'; -import { ApiOperation } from '@nestjs/swagger'; +import { ApiOperation, ApiResponse } from '@nestjs/swagger'; import { Request, Response } from 'express'; import { ConfigService } from '@nestjs/config'; import { AuthService } from './auth.service'; @@ -84,6 +84,11 @@ export class AuthController { @ApiOperation({ summary: '로그인 상태 확인 API' }) @Get('/check') @UseGuards(AuthGuard('jwt')) + @ApiResponse({ + status: 200, + description: '로그인 상태 조회 성공', + example: { isLogin: true }, + }) check() { return { isLogin: true }; } diff --git a/BE/src/auth/dto/profile-response.dto.ts b/BE/src/auth/dto/profile-response.dto.ts index e134876d..5363aaa8 100644 --- a/BE/src/auth/dto/profile-response.dto.ts +++ b/BE/src/auth/dto/profile-response.dto.ts @@ -1,9 +1,14 @@ +import { ApiProperty } from '@nestjs/swagger'; + export class ProfileResponseDto { constructor(name, email) { this.name = name; this.email = email; } + @ApiProperty({ description: '사용자 이름' }) name: string; + + @ApiProperty({ description: '사용자 이메일' }) email: string; } diff --git a/BE/src/stock/list/stock-list.controller.ts b/BE/src/stock/list/stock-list.controller.ts index 4db69192..e0ebb13c 100644 --- a/BE/src/stock/list/stock-list.controller.ts +++ b/BE/src/stock/list/stock-list.controller.ts @@ -22,6 +22,11 @@ export class StockListController { description: '모든 주식 종목 리스트를 조회한다.', }) @Get() + @ApiResponse({ + status: 200, + description: '주식 종목 리스트 조회 성공', + type: [StockListResponseDto], + }) async findAll(): Promise { return this.stockListService.findAll(); }