Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Riina Antikainen
/
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 ae1af53c
authored
Dec 04, 2014
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add map background rest-function
1 parent
318f78fb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletions
code/moya-web/src/main/java/fi/codecrew/moya/rest/placemap/v1/PlacemapRestViewV1.java
code/moya-web/src/main/java/fi/codecrew/moya/rest/placemap/v1/PlacemapRestViewV1.java
View file @
ae1af53
package
fi
.
codecrew
.
moya
.
rest
.
placemap
.
v1
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
javax.ejb.EJB
;
...
...
@@ -12,6 +13,8 @@ import javax.ws.rs.Path;
import
javax.ws.rs.PathParam
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.core.MediaType
;
import
javax.ws.rs.core.Response
;
import
javax.ws.rs.core.Response.ResponseBuilder
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -45,7 +48,7 @@ public class PlacemapRestViewV1 {
@POST
@Path
(
"/place/{id}/reserve"
)
public
void
reservePlace
()
{
logger
.
warn
(
"Reserving not yet implemented"
);
logger
.
warn
(
"Reserving not yet implemented"
);
}
@GET
...
...
@@ -59,6 +62,18 @@ public class PlacemapRestViewV1 {
}
@GET
@Path
(
"{id}/background"
)
public
Response
getBackground
(
@PathParam
(
"id"
)
Integer
id
)
{
EventMap
map
=
placebean
.
findMap
(
id
);
byte
[]
data
=
map
.
getMapData
();
ResponseBuilder
ret
=
Response
.
ok
(
data
,
"image/png"
);
ret
.
expires
(
new
Date
(
System
.
currentTimeMillis
()
+
6
*
60
*
60
*
1000
));
return
ret
.
build
();
}
@GET
@Path
(
"{id}/places"
)
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