Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ehasa-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WIMMA Lab 2019
Overflow
ehasa-backend
Commits
1217a1d7
Commit
1217a1d7
authored
5 years ago
by
L4168
Browse files
Options
Downloads
Patches
Plain Diff
formatting
parent
533d5bf4
No related branches found
No related tags found
2 merge requests
!59
Development to master
,
!20
Lippuboksi
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/game/coordinate.entity.ts
+17
-30
17 additions, 30 deletions
src/game/coordinate.entity.ts
src/game/game.controller.ts
+9
-5
9 additions, 5 deletions
src/game/game.controller.ts
src/game/game.dto.ts
+3
-3
3 additions, 3 deletions
src/game/game.dto.ts
with
29 additions
and
38 deletions
src/game/coordinate.entity.ts
+
17
−
30
View file @
1217a1d7
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
This diff is collapsed.
Click to expand it.
src/game/game.controller.ts
+
9
−
5
View file @
1217a1d7
...
@@ -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
)
;
}
}
}
}
This diff is collapsed.
Click to expand it.
src/game/game.dto.ts
+
3
−
3
View file @
1217a1d7
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment