Commit 229aedbd by Juho Juopperi

user rest apis

1 parent a84b600b
......@@ -35,10 +35,18 @@ public class EventUserRestPojo {
private String firstname = "";
private String lastname = "";
public EventUserRestPojo() {
}
// foo..
private String birthday;
private String gender;
private String phoneNumber;
// address info
private String streetAddress;
private String zipCode;
private String postOffice;
public EventUserRestPojo() {
}
@XmlElement()
@ApiModelProperty("Nickname")
......
......@@ -37,6 +37,7 @@ import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.ResponseBuilder;
import javax.ws.rs.core.Response.Status;
import fi.codecrew.moya.beans.*;
import fi.codecrew.moya.enums.apps.UserPermission;
import fi.codecrew.moya.model.*;
import org.slf4j.Logger;
......@@ -46,14 +47,6 @@ import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiOperation;
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.PrintedCardRestPojo;
import fi.codecrew.moya.rest.pojo.userinfo.v1.SimpleEventuserRoot;
......@@ -96,6 +89,9 @@ public class UserRestView {
@EJB
private PlaceBeanLocal placebean;
@EJB
private RoleBeanLocal roleBean;
@POST
@Path("/giveplace/{placeId}")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
......@@ -277,6 +273,8 @@ public class UserRestView {
@ApiOperation(value = "Create user", response = EventUserRestPojo.class)
public Response createEventUser() {
// XXX
if (permbean.hasPermission(UserPermission.CREATE_NEW) == false) {
return Response.status(Status.FORBIDDEN).build();
}
......@@ -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!