| | package cactusServer.resources; |
---|
| | |
---|
| | import java.io.IOException; |
---|
| | import java.util.ArrayList; |
---|
| | |
---|
| | import javax.servlet.http.HttpServletResponse; |
---|
| | import javax.ws.rs.*; |
---|
| |
---|
| | private HttpServletResponse response; |
---|
| | |
---|
| | @PUT |
---|
| | @Produces(MediaType.APPLICATION_JSON) |
---|
| | public URIAddressedEntity loginAccount(@FormParam("userID") String userID, @FormParam("userPass") String userPass) { |
---|
| | public URIAddressedEntity loginAccount(@FormParam("userID") String userID, @FormParam("userPass") String userPass){ |
---|
| | URIAddressedEntity session = Accounts.getInstance().loginAccount(userID, userPass); |
---|
| | if(session != null) { |
---|
| | return session; |
---|
| | } |
---|
| | else { |
---|
| | int status = 400; |
---|
| | //response.setStatus(400); |
---|
| | return null; |
---|
| | } |
---|
| | |
---|
| | } |
---|
| | |
---|
| | |
---|
| | |
---|
| | @POST |
---|
| | @Path("/logout") |
---|
| | @Produces(MediaType.APPLICATION_JSON) |
---|
| |
---|
| | |
---|
| | @DELETE |
---|
| | @Path("/{uniqueID}") |
---|
| | @Produces(MediaType.APPLICATION_JSON) |
---|
| | public Account deleteAccount(@FormParam("uniqueID") String uniqueID) { |
---|
| | public Account deleteAccount(@PathParam("uniqueID") String uniqueID) { |
---|
| | return Accounts.getInstance().deleteAccount(uniqueID); |
---|
| | } |
---|
| | |
---|
| | @GET |
---|
| |
---|
| | |