This commit is contained in:
devender.kumar
2019-10-30 23:16:56 +01:00
parent db85c8f275
commit fb34b40870
20538 changed files with 1642819 additions and 0 deletions
@@ -0,0 +1,17 @@
package utils;
import com.fasterxml.jackson.databind.node.ObjectNode;
import play.libs.Json;
public class Util {
public static ObjectNode createResponse(Object response, boolean ok) {
ObjectNode result = Json.newObject();
result.put("isSuccessful", ok);
if (response instanceof String) {
result.put("body", (String) response);
} else {
result.putPOJO("body", response);
}
return result;
}
}