Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 0357803e
authored
Mar 01, 2014
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'restfix' into 'master'
Restfix Muutamia restijuttuja kattoi:
@tkfftk
2 parents
009690c8
3b7d50df
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
0 deletions
code/MoyaWeb/src/fi/codecrew/moya/rest/UserRestView.java
code/MoyaWeb/src/fi/codecrew/moya/rest/pojo/MapRoot.java
code/MoyaWeb/src/fi/codecrew/moya/rest/pojo/PrintedCardRestPojo.java
code/MoyaWeb/src/fi/codecrew/moya/rest/UserRestView.java
View file @
0357803
...
...
@@ -5,11 +5,14 @@ import javax.enterprise.context.RequestScoped;
import
javax.ws.rs.Consumes
;
import
javax.ws.rs.GET
;
import
javax.ws.rs.Path
;
import
javax.ws.rs.PathParam
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.core.MediaType
;
import
fi.codecrew.moya.beans.CardTemplateBeanLocal
;
import
fi.codecrew.moya.beans.UserBeanLocal
;
import
fi.codecrew.moya.model.EventUser
;
import
fi.codecrew.moya.rest.pojo.PrintedCardRestPojo
;
import
fi.codecrew.moya.rest.pojo.SimpleEventuserRoot
;
import
fi.codecrew.moya.util.UserSearchQuery
;
import
fi.codecrew.moya.utilities.SearchQuery.QuerySortOrder
;
...
...
@@ -24,6 +27,9 @@ public class UserRestView {
@EJB
private
UserBeanLocal
userbean
;
@EJB
private
CardTemplateBeanLocal
cardbean
;
@GET
@Path
(
"/eventusers"
)
public
SimpleEventuserRoot
getEventUsers
()
{
...
...
@@ -31,4 +37,12 @@ public class UserRestView {
SearchResult
<
EventUser
>
users
=
userbean
.
getThisEventsUsers
(
q
);
return
SimpleEventuserRoot
.
parse
(
users
.
getResults
());
}
@GET
@Path
(
"/card/{eventuserId}"
)
public
PrintedCardRestPojo
getUsersCard
(
@PathParam
(
"eventuserId"
)
Integer
eventuserid
)
{
EventUser
user
=
userbean
.
findByEventUserId
(
eventuserid
);
return
new
PrintedCardRestPojo
(
cardbean
.
checkPrintedCard
(
user
));
}
}
code/MoyaWeb/src/fi/codecrew/moya/rest/pojo/MapRoot.java
View file @
0357803
...
...
@@ -51,6 +51,11 @@ public class MapRoot {
return
map
.
getId
();
}
@XmlElement
(
name
=
"active"
)
public
boolean
isActive
()
{
return
map
.
isActive
();
}
}
public
static
MapRoot
parseMaps
(
List
<
EventMap
>
eventMaps
)
{
...
...
code/MoyaWeb/src/fi/codecrew/moya/rest/pojo/PrintedCardRestPojo.java
View file @
0357803
...
...
@@ -20,6 +20,11 @@ public class PrintedCardRestPojo {
this
.
card
=
card
;
}
@XmlElement
(
name
=
"eventuserId"
)
public
Integer
getEventuserId
()
{
return
card
.
getUser
().
getId
();
}
@XmlTransient
private
final
PrintedCard
card
;
...
...
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