Commit 229aedbd by Juho Juopperi

user rest apis

1 parent a84b600b
...@@ -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() {
......
...@@ -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();
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!