Skip to content

Commit

Permalink
Cleanup ServerResponse interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
noboomu committed Apr 11, 2017
1 parent a0c5cd5 commit 9e6a02d
Show file tree
Hide file tree
Showing 4 changed files with 171 additions and 193 deletions.
2 changes: 2 additions & 0 deletions conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ application {
# date format
dateFormat = dd-MMM-yyyy

defaultResponseListener = "com.wurrly.server.listeners.ServerDefaultResponseListener"

# number format, system default. set it at runtime
# numberFormat = DecimalFormat.getInstance(${application.lang})).toPattern()

Expand Down
14 changes: 6 additions & 8 deletions src/main/java/com/wurrly/controllers/Users.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ public ServerResponse userType(
return response()
.ok()
.entity(new User(232343L))
.header(HttpString.tryFromString("TestHeader"), "57475475")
.build();
.header(HttpString.tryFromString("TestHeader"), "57475475");

}

Expand All @@ -125,7 +124,7 @@ public ServerResponse userForm(@ApiParam(hidden=true) final ServerRequest server
log.debug("testFile: " + testFile);
//
//
return response().ok().entity(Any.wrap(new User(userId,type))).build();
return response().ok().entity(Any.wrap(new User(userId,type)));

}

Expand All @@ -148,8 +147,7 @@ public ServerResponse user(@ApiParam(hidden=true)final ServerRequest serverReque
return response()
.ok()
.applicationJson()
.body(JsonStream.serialize(new User(userId)))
.build();
.body(JsonStream.serialize(new User(userId)));


}
Expand All @@ -171,11 +169,11 @@ public ServerResponse createUser(@ApiParam(hidden=true)final ServerRequest serve

if( user != null )
{
return response().ok().entity(user).build();
return response().ok().entity(user);
}
else
{
return response().exception(new Exception("No user found")).build();
return response().exception(new Exception("No user found"));
}


Expand All @@ -196,7 +194,7 @@ public ServerResponse updateUsername(@ApiParam(hidden=true)final ServerRequest s
log.debug("file: " + user);


return response().entity(Any.wrap(user)).build();
return response().entity(Any.wrap(user));

}

Expand Down
Loading

0 comments on commit 9e6a02d

Please sign in to comment.