Ajout structure de jeu
This commit is contained in:
19
server/src/game/game.controller.ts
Normal file
19
server/src/game/game.controller.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { Controller, Get, UseGuards } from '@nestjs/common'
|
||||
import { GameService } from './game.service'
|
||||
import { JwtAuthGuard } from 'src/auth/jwt-auth.guard'
|
||||
import { ApiBearerAuth, ApiOkResponse, ApiUnauthorizedResponse } from '@nestjs/swagger'
|
||||
import { GameEntity } from './entities/game.entity'
|
||||
|
||||
@Controller('game')
|
||||
export class GameController {
|
||||
constructor(private readonly gameService: GameService) {}
|
||||
|
||||
@Get()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@ApiBearerAuth()
|
||||
@ApiOkResponse({ type: GameEntity })
|
||||
@ApiUnauthorizedResponse({ description: "Non authentifié⋅e" })
|
||||
async find() {
|
||||
return new GameEntity(await this.gameService.find())
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user