Newer
Older
CactusServer / src / main / java / cactusServer / resources / AccountsRest.java
package cactusServer.resources;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;

import cactusServer.entities.Account;
import cactusServer.models.Accounts;

@Path("/AccountsRest")
public class AccountsRest {
	@POST
	@Path("/login")
	@Produces(MediaType.APPLICATION_JSON)
	public String loginAccount(@QueryParam("userID") String userID, @QueryParam("userPass") String userPass) {
		return "";
	}

	@POST
	@Path("/logout")
	@Produces(MediaType.APPLICATION_JSON)
	public String logoutAccount(@QueryParam("userID") String userID) {
		return "";
	}

	@POST
	@Path("/createAccount")
	@Produces(MediaType.APPLICATION_JSON)
	public Account create(@QueryParam("userID") String userID, @QueryParam("userName") String userName,
			@QueryParam("userPass") String userPass) {
		Accounts.createAcount(userID, userName, userPass);
		return Accounts.getAccount(userID);
	}

	@GET
	@Path("/getAccount")
	@Produces(MediaType.APPLICATION_JSON)
	public Account getAccount(@QueryParam("userID") String userID) {
		return Accounts.getAccount(userID);
	}
}