From 89019fe3532777fa084ed79bd34a6690196879e5 Mon Sep 17 00:00:00 2001 From: Samuli Virtapohja <l4721@student.jamk.fi> Date: Wed, 24 Jul 2019 13:20:29 +0300 Subject: [PATCH] draw folder audited --- src/draw/coordinate.entity.ts | 8 +++++--- src/draw/draw.controller.ts | 6 +++++- src/draw/draw.module.ts | 3 ++- src/draw/draw.service.ts | 4 ++++ src/faction/faction.controller.ts | 2 +- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/draw/coordinate.entity.ts b/src/draw/coordinate.entity.ts index 1448b99..01c5d67 100644 --- a/src/draw/coordinate.entity.ts +++ b/src/draw/coordinate.entity.ts @@ -3,9 +3,11 @@ import { Entity, Column, PrimaryGeneratedColumn, ManyToOne } from 'typeorm'; import { GameEntity } from '../game/game.entity'; import { FactionEntity } from '../faction/faction.entity'; -////////////////////////////////////////////////////////////////////// -/// Entities for different drawings in game and their histories /// -////////////////////////////////////////////////////////////////////// +/* +MapDrawingEntity & MapDrawingHistoryEntity reflect database tables. + +MapDrawing ownershipCheck checks users rights to MapDrawing +*/ @Entity('MapDrawing') export class MapDrawingEntity { diff --git a/src/draw/draw.controller.ts b/src/draw/draw.controller.ts index 9831871..efc4e1b 100644 --- a/src/draw/draw.controller.ts +++ b/src/draw/draw.controller.ts @@ -13,7 +13,9 @@ import { import { DrawService } from './draw.service'; import { Roles, GameStates } from '../shared/guard.decorator'; import { MapDrawingDTO } from './mapdrawing.dto'; -import { GamePerson } from 'src/game/gameperson.decorator'; +import { GamePerson } from '../game/gameperson.decorator'; + +/* ////////////////////////////////////////////////////////////////////////// /// DrawController /// @@ -25,6 +27,8 @@ import { GamePerson } from 'src/game/gameperson.decorator'; /// Data return functions require atleast spectator role. /// ////////////////////////////////////////////////////////////////////////// +*/ + @Controller('draw') export class DrawController { constructor(private drawService: DrawService) {} diff --git a/src/draw/draw.module.ts b/src/draw/draw.module.ts index bea1b66..5bc079e 100644 --- a/src/draw/draw.module.ts +++ b/src/draw/draw.module.ts @@ -10,11 +10,12 @@ import { import { FactionEntity } from '../faction/faction.entity'; import { Game_PersonEntity } from '../game/game.entity'; import { NotificationModule } from 'src/notifications/notifications.module'; - +/* ///////////////////////////////////////////////////////////////////// /// Draw /// /// - contains everything to do with mapdrawing data. /// ///////////////////////////////////////////////////////////////////// +*/ @Module({ imports: [ TypeOrmModule.forFeature([ diff --git a/src/draw/draw.service.ts b/src/draw/draw.service.ts index e1c416c..fabc3a4 100644 --- a/src/draw/draw.service.ts +++ b/src/draw/draw.service.ts @@ -9,6 +9,10 @@ import { import { MapDrawingDTO } from './mapdrawing.dto'; import { NotificationGateway } from '../notifications/notifications.gateway'; +/* +DrawService contains handling of MapDrawings and MapDrawinghistory +*/ + @Injectable() export class DrawService { constructor( diff --git a/src/faction/faction.controller.ts b/src/faction/faction.controller.ts index cbbd3ec..e18add7 100644 --- a/src/faction/faction.controller.ts +++ b/src/faction/faction.controller.ts @@ -22,7 +22,7 @@ import { } from './faction.dto'; import { FactionService } from './faction.service'; import { Roles, GameStates } from '../shared/guard.decorator'; -import { GamePerson } from 'src/game/gameperson.decorator'; +import { GamePerson } from '../game/gameperson.decorator'; /* FactionController is being used for routing: -- GitLab