Ajout structure de jeu

This commit is contained in:
2024-12-08 16:34:06 +01:00
parent 0d96b78c33
commit b93b8b4c04
12 changed files with 124 additions and 8 deletions

View 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())
}
}