protect the airport endpoints
这个提交包含在:
@@ -8,6 +8,7 @@ import {
|
|||||||
Query,
|
Query,
|
||||||
HttpException,
|
HttpException,
|
||||||
HttpStatus,
|
HttpStatus,
|
||||||
|
UseGuards,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { ApiBody, ApiQuery, ApiResponse } from '@nestjs/swagger';
|
import { ApiBody, ApiQuery, ApiResponse } from '@nestjs/swagger';
|
||||||
import { AirportService } from './airport.service';
|
import { AirportService } from './airport.service';
|
||||||
@@ -32,6 +33,7 @@ import { ActiveRunwaysDto } from './dto/activerunways.dto';
|
|||||||
import { Runway } from './models/runway.model';
|
import { Runway } from './models/runway.model';
|
||||||
import { RunwayDto } from './dto/runway.dto';
|
import { RunwayDto } from './dto/runway.dto';
|
||||||
import { AirportOverviewDto } from './dto/airportoverview.dto';
|
import { AirportOverviewDto } from './dto/airportoverview.dto';
|
||||||
|
import { JwtGuard } from 'src/auth/guards/jwt.guard';
|
||||||
|
|
||||||
@Controller('airport')
|
@Controller('airport')
|
||||||
export class AirportController {
|
export class AirportController {
|
||||||
@@ -246,6 +248,7 @@ export class AirportController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UseGuards(JwtGuard)
|
||||||
@Get('/all')
|
@Get('/all')
|
||||||
@ApiResponse({
|
@ApiResponse({
|
||||||
status: 200,
|
status: 200,
|
||||||
@@ -256,6 +259,7 @@ export class AirportController {
|
|||||||
return this.airportService.allAirports();
|
return this.airportService.allAirports();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UseGuards(JwtGuard)
|
||||||
@Get('/get')
|
@Get('/get')
|
||||||
@ApiQuery({
|
@ApiQuery({
|
||||||
name: 'icao',
|
name: 'icao',
|
||||||
@@ -280,6 +284,7 @@ export class AirportController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UseGuards(JwtGuard)
|
||||||
@Post('/register')
|
@Post('/register')
|
||||||
@ApiBody({
|
@ApiBody({
|
||||||
description: 'The airport definition',
|
description: 'The airport definition',
|
||||||
@@ -317,6 +322,7 @@ export class AirportController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UseGuards(JwtGuard)
|
||||||
@Delete('/remove')
|
@Delete('/remove')
|
||||||
@ApiQuery({
|
@ApiQuery({
|
||||||
name: 'icao',
|
name: 'icao',
|
||||||
@@ -340,6 +346,7 @@ export class AirportController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UseGuards(JwtGuard)
|
||||||
@Patch('/activateRunways')
|
@Patch('/activateRunways')
|
||||||
@ApiBody({
|
@ApiBody({
|
||||||
description: 'The airport definition',
|
description: 'The airport definition',
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户