Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Linnea Samila
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4b82b017
authored
May 20, 2015
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix imports
1 parent
7c62cc6c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
code/moya-database/src/main/java/fi/codecrew/moya/model/GenericEntity.java
code/moya-web/src/main/java/fi/codecrew/moya/rest/placemap/v1/PlacemapRestViewV1.java
code/moya-database/src/main/java/fi/codecrew/moya/model/GenericEntity.java
View file @
4b82b01
...
@@ -34,7 +34,6 @@ import fi.codecrew.moya.utilities.jpa.ModelInterface;
...
@@ -34,7 +34,6 @@ import fi.codecrew.moya.utilities.jpa.ModelInterface;
public
class
GenericEntity
extends
EntityEquals
implements
ModelInterface
,
EntityMeta
{
public
class
GenericEntity
extends
EntityEquals
implements
ModelInterface
,
EntityMeta
{
private
static
final
long
serialVersionUID
=
-
9041737052951021560L
;
private
static
final
long
serialVersionUID
=
-
9041737052951021560L
;
public
static
final
String
ID_COLUMN
=
"id"
;
@Id
@Id
@Column
(
name
=
ID_COLUMN
,
nullable
=
false
,
updatable
=
false
)
@Column
(
name
=
ID_COLUMN
,
nullable
=
false
,
updatable
=
false
)
...
...
code/moya-web/src/main/java/fi/codecrew/moya/rest/placemap/v1/PlacemapRestViewV1.java
View file @
4b82b01
...
@@ -96,28 +96,25 @@ public class PlacemapRestViewV1 {
...
@@ -96,28 +96,25 @@ public class PlacemapRestViewV1 {
}
}
@GET
@GET
@Path
(
"{id}/hilightedPlaces/{userid}"
)
@Path
(
"{id}/hilightedPlaces/{userid}"
)
public
Response
getHilightedPlaces
(
@PathParam
(
"id"
)
Integer
mapId
,
@PathParam
(
"userid"
)
Integer
userId
)
public
Response
getHilightedPlaces
(
@PathParam
(
"id"
)
Integer
mapId
,
@PathParam
(
"userid"
)
Integer
userId
)
{
{
EventMap
map
=
placebean
.
findMap
(
mapId
);
EventMap
map
=
placebean
.
findMap
(
mapId
);
if
(!
permbean
.
hasPermission
(
UserPermission
.
VIEW_ALL
))
{
if
(!
permbean
.
hasPermission
(
UserPermission
.
VIEW_ALL
))
{
return
Response
.
status
(
Response
.
Status
.
FORBIDDEN
).
entity
(
"Try to login first!"
).
build
();
return
Response
.
status
(
Response
.
Status
.
FORBIDDEN
).
entity
(
"Try to login first!"
).
build
();
}
}
EventUser
user
=
userbean
.
findByUserId
(
userId
,
false
);
EventUser
user
=
userbean
.
findByUserId
(
userId
,
false
);
if
(
user
==
null
)
{
if
(
user
==
null
)
{
return
Response
.
status
(
Response
.
Status
.
BAD_REQUEST
).
entity
(
"No User found for id: "
+
userId
).
build
();
return
Response
.
status
(
Response
.
Status
.
BAD_REQUEST
).
entity
(
"No User found for id: "
+
userId
).
build
();
}
}
return
Response
.
ok
(
PojoUtils
.
parseSimplePlaces
(
map
.
getPlaces
(),
user
,
permbean
.
hasPermission
(
UserPermission
.
VIEW_ALL
),
true
)).
build
();
return
Response
.
ok
(
PojoUtils
.
parseSimplePlaces
(
map
.
getPlaces
(),
user
,
permbean
.
hasPermission
(
UserPermission
.
VIEW_ALL
),
true
)).
build
();
}
}
@GET
@GET
@Path
(
"{id}/places"
)
@Path
(
"{id}/places"
)
public
SimplePlacelistRoot
getPlaces
(
@PathParam
(
"id"
)
Integer
mapId
)
public
SimplePlacelistRoot
getPlaces
(
@PathParam
(
"id"
)
Integer
mapId
)
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment