Skip to content
Snippets Groups Projects
Commit 1217a1d7 authored by L4168's avatar L4168
Browse files

formatting

parent 533d5bf4
No related branches found
No related tags found
2 merge requests!59Development to master,!20Lippuboksi
import { import { Entity, Column, PrimaryGeneratedColumn, ManyToOne } from 'typeorm';
Entity, import { GameEntity } from './game.entity';
Column, import { FactionEntity } from './faction.entity';
PrimaryGeneratedColumn,
OneToMany, @Entity('MapDrawing')
ManyToOne, export class MapDrawingEntity {
PrimaryColumn, @PrimaryGeneratedColumn('uuid') mapDrawingId: string;
Timestamp, @Column({ type: 'bool' }) drawingIsActive: boolean;
} from 'typeorm'; @Column({ type: 'time' }) drawingValidTill: string;
import {
Game_PersonEntity, @Column({ type: 'json', nullable: true }) data: JSON;
ObjectivePointEntity,
GameEntity, @ManyToOne(type => FactionEntity, faction => faction.mapDrawings)
} from './game.entity'; faction: FactionEntity;
import { FactionEntity } from './faction.entity'; @ManyToOne(type => GameEntity, gameEntity => gameEntity.id)
gameId: GameEntity;
@Entity('MapDrawing') }
export class MapDrawingEntity {
@PrimaryGeneratedColumn('uuid') mapDrawingId: string;
@Column({ type: 'bool' }) drawingIsActive: boolean;
@Column({ type: 'time' }) drawingValidTill: string;
@Column({ type: 'json', nullable: true }) data: JSON;
@ManyToOne(type => FactionEntity, faction => faction.mapDrawings)
faction: FactionEntity;
@ManyToOne(type => GameEntity, gameEntity => gameEntity.id)
gameId: GameEntity;
}
\ No newline at end of file
...@@ -37,7 +37,11 @@ export class GameController { ...@@ -37,7 +37,11 @@ export class GameController {
@Post(':id') @Post(':id')
@UseGuards(new AuthGuard()) @UseGuards(new AuthGuard())
@UsePipes(new ValidationPipe()) @UsePipes(new ValidationPipe())
async createGroup(@User('id') person, @Param('id') id: string, @Body() data: GameGroupDTO) { async createGroup(
@User('id') person,
@Param('id') id: string,
@Body() data: GameGroupDTO,
) {
try { try {
return this.gameservice.createGroup(person, id, data); return this.gameservice.createGroup(person, id, data);
} catch (error) {} } catch (error) {}
...@@ -51,7 +55,7 @@ export class GameController { ...@@ -51,7 +55,7 @@ export class GameController {
@Put('groups/:id') @Put('groups/:id')
@UseGuards(new AuthGuard()) @UseGuards(new AuthGuard())
async joinGroup(@User('id') person, @Param('id') id) { async joinGroup(@User('id') person, @Param('id') id) {
return this.gameservice.joinGroup(person, id) return this.gameservice.joinGroup(person, id);
} }
@Put('joinfaction') @Put('joinfaction')
...@@ -81,11 +85,11 @@ export class GameController { ...@@ -81,11 +85,11 @@ export class GameController {
@Get('flag/:id') @Get('flag/:id')
async flagboxQuery(@Param('id') id: string) { async flagboxQuery(@Param('id') id: string) {
return this.gameservice.flagboxQuery(id) return this.gameservice.flagboxQuery(id);
} }
@Post('flag/:id') @Post('flag/:id')
async flagboxEvent(@Param('id') id: string, @Body () data: FlagboxEventDTO) { async flagboxEvent(@Param('id') id: string, @Body() data: FlagboxEventDTO) {
return this.gameservice.flagboxEvent(id, data) return this.gameservice.flagboxEvent(id, data);
} }
} }
...@@ -66,12 +66,12 @@ export class FlagboxEventDTO { ...@@ -66,12 +66,12 @@ export class FlagboxEventDTO {
owner: number; owner: number;
action: number; action: number;
capture: number; capture: number;
oP_HistoryTimestamp?: string oP_HistoryTimestamp?: string;
objective_point?: ObjectivePointEntity objective_point?: ObjectivePointEntity;
} }
export class GameGroupDTO { export class GameGroupDTO {
@IsString() @IsString()
@Length(3, 31) @Length(3, 31)
name: string; name: string;
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment