Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
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 229aedbd
authored
May 30, 2015
by
Juho Juopperi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user rest apis
1 parent
a84b600b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
10 deletions
code/moya-restpojo/src/main/java/fi/codecrew/moya/rest/pojo/userinfo/v1/EventUserRestPojo.java
code/moya-web/src/main/java/fi/codecrew/moya/rest/UserRestView.java
code/moya-restpojo/src/main/java/fi/codecrew/moya/rest/pojo/userinfo/v1/EventUserRestPojo.java
View file @
229aedb
...
@@ -35,11 +35,19 @@ public class EventUserRestPojo {
...
@@ -35,11 +35,19 @@ public class EventUserRestPojo {
private
String
firstname
=
""
;
private
String
firstname
=
""
;
private
String
lastname
=
""
;
private
String
lastname
=
""
;
// foo..
private
String
birthday
;
private
String
gender
;
private
String
phoneNumber
;
// address info
private
String
streetAddress
;
private
String
zipCode
;
private
String
postOffice
;
public
EventUserRestPojo
()
{
public
EventUserRestPojo
()
{
}
}
@XmlElement
()
@XmlElement
()
@ApiModelProperty
(
"Nickname"
)
@ApiModelProperty
(
"Nickname"
)
public
String
getNick
()
{
public
String
getNick
()
{
...
...
code/moya-web/src/main/java/fi/codecrew/moya/rest/UserRestView.java
View file @
229aedb
...
@@ -37,6 +37,7 @@ import javax.ws.rs.core.Response;
...
@@ -37,6 +37,7 @@ import javax.ws.rs.core.Response;
import
javax.ws.rs.core.Response.ResponseBuilder
;
import
javax.ws.rs.core.Response.ResponseBuilder
;
import
javax.ws.rs.core.Response.Status
;
import
javax.ws.rs.core.Response.Status
;
import
fi.codecrew.moya.beans.*
;
import
fi.codecrew.moya.enums.apps.UserPermission
;
import
fi.codecrew.moya.enums.apps.UserPermission
;
import
fi.codecrew.moya.model.*
;
import
fi.codecrew.moya.model.*
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -46,14 +47,6 @@ import com.wordnik.swagger.annotations.Api;
...
@@ -46,14 +47,6 @@ import com.wordnik.swagger.annotations.Api;
import
com.wordnik.swagger.annotations.ApiOperation
;
import
com.wordnik.swagger.annotations.ApiOperation
;
import
com.wordnik.swagger.annotations.ApiParam
;
import
com.wordnik.swagger.annotations.ApiParam
;
import
fi.codecrew.moya.beans.CardTemplateBeanLocal
;
import
fi.codecrew.moya.beans.EventBeanLocal
;
import
fi.codecrew.moya.beans.PermissionBeanLocal
;
import
fi.codecrew.moya.beans.PlaceBeanLocal
;
import
fi.codecrew.moya.beans.PlaceGroupBeanLocal
;
import
fi.codecrew.moya.beans.ReaderBeanLocal
;
import
fi.codecrew.moya.beans.TicketBeanLocal
;
import
fi.codecrew.moya.beans.UserBeanLocal
;
import
fi.codecrew.moya.rest.pojo.userinfo.v1.EventUserRestPojo
;
import
fi.codecrew.moya.rest.pojo.userinfo.v1.EventUserRestPojo
;
import
fi.codecrew.moya.rest.pojo.userinfo.v1.PrintedCardRestPojo
;
import
fi.codecrew.moya.rest.pojo.userinfo.v1.PrintedCardRestPojo
;
import
fi.codecrew.moya.rest.pojo.userinfo.v1.SimpleEventuserRoot
;
import
fi.codecrew.moya.rest.pojo.userinfo.v1.SimpleEventuserRoot
;
...
@@ -96,6 +89,9 @@ public class UserRestView {
...
@@ -96,6 +89,9 @@ public class UserRestView {
@EJB
@EJB
private
PlaceBeanLocal
placebean
;
private
PlaceBeanLocal
placebean
;
@EJB
private
RoleBeanLocal
roleBean
;
@POST
@POST
@Path
(
"/giveplace/{placeId}"
)
@Path
(
"/giveplace/{placeId}"
)
@Consumes
(
MediaType
.
APPLICATION_FORM_URLENCODED
)
@Consumes
(
MediaType
.
APPLICATION_FORM_URLENCODED
)
...
@@ -277,6 +273,8 @@ public class UserRestView {
...
@@ -277,6 +273,8 @@ public class UserRestView {
@ApiOperation
(
value
=
"Create user"
,
response
=
EventUserRestPojo
.
class
)
@ApiOperation
(
value
=
"Create user"
,
response
=
EventUserRestPojo
.
class
)
public
Response
createEventUser
()
{
public
Response
createEventUser
()
{
// XXX
if
(
permbean
.
hasPermission
(
UserPermission
.
CREATE_NEW
)
==
false
)
{
if
(
permbean
.
hasPermission
(
UserPermission
.
CREATE_NEW
)
==
false
)
{
return
Response
.
status
(
Status
.
FORBIDDEN
).
build
();
return
Response
.
status
(
Status
.
FORBIDDEN
).
build
();
}
}
...
@@ -396,4 +394,12 @@ public class UserRestView {
...
@@ -396,4 +394,12 @@ public class UserRestView {
}
}
}
}
@GET
@Path
(
"/{userid}/image"
)
@ApiOperation
(
value
=
"Download user image"
)
@Consumes
(
MediaType
.
MULTIPART_FORM_DATA
)
public
Response
downloadUserImage
(
@PathParam
(
"userid"
)
@ApiParam
(
"User ID"
)
Integer
userId
)
{
return
Response
.
ok
().
build
();
}
}
}
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