| |
---|
| | import javax.ws.rs.*; |
---|
| | import javax.ws.rs.core.MediaType; |
---|
| | import javax.ws.rs.core.Response; |
---|
| | import java.util.Collection; |
---|
| | |
---|
| | import static java.lang.Boolean.TRUE; |
---|
| | |
---|
| | @Component |
---|
| | @Path("/gallery") |
---|
| | |
---|
| |
---|
| | |
---|
| | @Path("/{aid}/invites") |
---|
| | @PUT |
---|
| | @Produces(MediaType.APPLICATION_JSON) |
---|
| | public String addInvite(@PathParam("aid") Integer aid, @FormParam("ownerUid") String ownerUid, @FormParam("invitedUid") String invitedUid, @FormParam("ownerToken") String ownerToken) { |
---|
| | public Boolean addInvite(@PathParam("aid") Integer aid, @FormParam("ownerUid") String ownerUid, @FormParam("invitedUid") String invitedUid, @FormParam("ownerToken") String ownerToken) { |
---|
| | Animation animation = animations.getAnimationByAid(aid); |
---|
| | Account invitedAccount = accounts.getAccountByUid(Integer.parseInt(invitedUid)); |
---|
| | Account owner = animation.getOwner(); |
---|
| | |
---|
| |
---|
| | // workを追加して |
---|
| | invitedAccount.getWorkHashMap().put(aid, work); |
---|
| | invitedAccount.getWorkHashMap().get(aid).setInvites(animation); |
---|
| | |
---|
| | return "追加しました"; |
---|
| | return TRUE; |
---|
| | } else { |
---|
| | throw new WebApplicationException(404); |
---|
| | } |
---|
| | } |
---|
| |
---|
| | |