Commit 254189ca authored by Grzegorz Pietrusza's avatar Grzegorz Pietrusza

stub of registration resource

parent e849a617
......@@ -44,9 +44,10 @@ public class RegistrationResource
@GET
@Path("/user")
public void register(@QueryParam("userName") final String userName,
public String register(@QueryParam("userName") final String userName,
@QueryParam("teamId") final String teamId)
{
//todo: check if exists
if (!teamsRepository.contains(teamId))
{
throw new RuntimeException("Team does not exist");
......@@ -58,5 +59,8 @@ public class RegistrationResource
user.setPassword("password");
user.setAdmin(false);
user.setTeamId(teamId);
userRepository.add(user);
return user.getId();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment