Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: request body 형식 변경 #210

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/external/where42/dto/where42.response.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ export class Where42ResponseDto {
})
cluster: Cluster;
}

export class Where42RequestDto {
@ApiProperty({
description: '42 로그인 ID',
example: 'yeju',
})
login: string;
}
12 changes: 9 additions & 3 deletions src/external/where42/where42.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ import {
ApiTags,
} from '@nestjs/swagger';
import { ExtAuthGuard } from 'src/auth/guard/ext-auth.guard';
import { Where42ResponseDto } from './dto/where42.response.dto';
import {
Where42RequestDto,
Where42ResponseDto,
} from './dto/where42.response.dto';
import { Where42Service } from './where42.service';

@ApiTags('Where42 전용 API')
Expand Down Expand Up @@ -60,8 +63,11 @@ export class Where42Controller {
}

@Post('where42/where42All')
async where42All(@Body() logins: string[]): Promise<Where42ResponseDto[]> {
async where42All(
@Body() logins: Where42RequestDto[],
): Promise<Where42ResponseDto[]> {
this.logger.debug(`@where42All) where42All`);
return this.where42Service.where42All(logins);
const loginList = logins.map((loginDto) => loginDto.login);
return this.where42Service.where42All(loginList);
}
}
Loading