Skip to content

Commit

Permalink
Merge pull request #172 from boostcampwm-2024/refactor/api/docs
Browse files Browse the repository at this point in the history
♻️ refactor: api 명세 추가
  • Loading branch information
sieunie authored Nov 21, 2024
2 parents 8850d2a + 0ff18f9 commit bb1c047
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions BE/src/asset/asset.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class AssetController {
@ApiResponse({
status: 200,
description: '매도 가능 주식 개수 조회 성공',
example: { quantity: 0 },
})
async getUserStockByCode(
@Req() request: Request,
Expand All @@ -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));
Expand Down
7 changes: 6 additions & 1 deletion BE/src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 };
}
Expand Down
5 changes: 5 additions & 0 deletions BE/src/auth/dto/profile-response.dto.ts
Original file line number Diff line number Diff line change
@@ -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;
}
5 changes: 5 additions & 0 deletions BE/src/stock/list/stock-list.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ export class StockListController {
description: '모든 주식 종목 리스트를 조회한다.',
})
@Get()
@ApiResponse({
status: 200,
description: '주식 종목 리스트 조회 성공',
type: [StockListResponseDto],
})
async findAll(): Promise<StockListResponseDto[]> {
return this.stockListService.findAll();
}
Expand Down

0 comments on commit bb1c047

Please sign in to comment.