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
10bf5295
Commit
10bf5295
authored
5 years ago
by
Samuli Virtapohja
Browse files
Options
Downloads
Patches
Plain Diff
returns info from mapmarkers
parent
8c2205b2
No related branches found
No related tags found
1 merge request
!2
Geo json
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/mapmarkers/mapmarker.entity.ts
+3
-3
3 additions, 3 deletions
src/mapmarkers/mapmarker.entity.ts
src/mapmarkers/mapmarker.service.ts
+10
-7
10 additions, 7 deletions
src/mapmarkers/mapmarker.service.ts
src/mapmarkers/mapmarkers.controller.ts
+11
-5
11 additions, 5 deletions
src/mapmarkers/mapmarkers.controller.ts
with
24 additions
and
15 deletions
src/mapmarkers/mapmarker.entity.ts
+
3
−
3
View file @
10bf5295
...
...
@@ -3,11 +3,11 @@ import { Entity, Column, PrimaryGeneratedColumn, BeforeInsert, PrimaryColumn } f
import
*
as
jwt
from
'
jsonwebtoken
'
;
import
{
identifier
}
from
'
@babel/types
'
;
@
Entity
(
'
Powerup
'
)
@
Entity
(
'
MapMarker
'
)
export
class
MapMarkerEntity
{
@
PrimaryGeneratedColumn
(
'
uuid
'
)
id
:
string
;
@
Column
({
type
:
'
text
'
})
nam
e
:
string
;
@
Column
({
type
:
'
text
'
})
cooldown
:
string
;
@
Column
({
type
:
'
text
'
})
latitud
e
:
string
;
@
Column
({
type
:
'
text
'
})
longitude
:
string
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/mapmarkers/mapmarker.service.ts
+
10
−
7
View file @
10bf5295
...
...
@@ -12,15 +12,18 @@ export class MapMarkerService {
// insert markers
async
insertLocation
(
data
:
MapMarkerDTO
){
// check for token return if not set
// check for token return if not set
return null or something
const
{
latitude
,
longitude
}
=
data
;
//
let location = await this.mapmarkerRepository.create(data);
//
await this.mapmarkerRepository.save(location);
}
let
location
=
await
this
.
mapmarkerRepository
.
create
(
data
);
await
this
.
mapmarkerRepository
.
save
(
location
);
}
// get all markers
async
getAllMarkers
():
Promise
<
string
>
{
//this.mapmarkerRepository.findByIds();
return
'
all markers
'
;
async
getAllMarkers
():
Promise
<
MapMarkerEntity
[]
>
{
// const users= this.mapmarkerRepository.find();
// users.map
// user.
return
this
.
mapmarkerRepository
.
find
();
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/mapmarkers/mapmarkers.controller.ts
+
11
−
5
View file @
10bf5295
...
...
@@ -7,18 +7,24 @@ import { MapMarkerDTO } from './mapmarker.dto';
export
class
MapMarkersController
{
constructor
(
private
mapmarkerservice
:
MapMarkerService
){}
// update user location
@
Post
(
'
location
'
)
getLoctaion
(@
Body
()
data
:
MapMarkerDTO
){
async
getLoctaion
(@
Body
()
data
:
MapMarkerDTO
){
// get user location && id
// update location to database
return
this
.
mapmarkerservice
.
insertLocation
(
data
);
}
// Insert figure location
@
Put
(
'
insertLocation
'
)
insertLocation
(@
Body
()
data
:
MapMarkerDTO
){
async
insertLocation
(@
Body
()
data
:
MapMarkerDTO
){
this
.
mapmarkerservice
.
insertLocation
(
data
);
}
@
Get
(
'
getall
'
)
getAll
(){
async
getAll
(){
// hakee kaikki
// palauttaa vain halutut
return
this
.
mapmarkerservice
.
getAllMarkers
();
}
}
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