| 1 | import { Controller, Get, Query } from '@nestjs/common'; |
| 2 | import { |
| 3 | ApiBearerAuth, |
| 4 | ApiOkResponse, |
| 5 | ApiOperation, |
| 6 | ApiQuery, |
| 7 | ApiTags, |
| 8 | } from '@nestjs/swagger'; |
| 9 | |
| 10 | import { AirlinesService } |
| 11 | import { AirlineEntity } |
| 12 | |
| 13 | @Controller('airlines') |
| 14 | @ApiTags('Airlines') |
| 15 | @ApiBearerAuth() |
| 16 | export class AirlinesController |
| 17 | constructor(private readonly |
| 18 | |
| 19 | @Get() |
| 20 | @ApiOperation({ |
| 21 | description: |
| 22 | 'Get airlines. Has over 800 records, only has commerical airlines.', |
| 23 | summary: 'Get airlines', |
| 24 | }) |
| 25 | @ApiOkResponse({ |
| 26 | type: [AirlineEntity], |
| 27 | }) |
| 28 | @ApiQuery({ |
| 29 | name: 'search', |
| 30 | description: |
| 31 | 'The full(or a part of) name, ident or icao. Case Insensitive.', |
| 32 | required: false, |
| 33 | }) |
| 34 | getAirlines(@Query( |
| 35 | return this.airlinesService |
| 36 | } |
| 37 | } |