Revision 61526
Added by Konstantinos Triantafyllou over 2 years ago
JsonUtils.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.openaire.usermanagement.utils; |
2 | 2 |
|
3 |
import com.google.gson.Gson; |
|
3 | 4 |
import com.google.gson.JsonArray; |
4 | 5 |
import com.google.gson.JsonElement; |
5 | 6 |
import com.google.gson.JsonObject; |
... | ... | |
87 | 88 |
return verification; |
88 | 89 |
} |
89 | 90 |
|
91 |
public static JsonArray mergeUserInfo(JsonArray users, JsonArray emails, JsonArray names) { |
|
92 |
for (int i = 0; i < users.size(); i++) { |
|
93 |
users.get(i).getAsJsonObject().addProperty("email", emails.get(i).getAsJsonObject().get("email").getAsString()); |
|
94 |
users.get(i).getAsJsonObject().addProperty("name", names.get(i).getAsJsonObject().get("name").getAsString()); |
|
95 |
} |
|
96 |
return users; |
|
97 |
} |
|
98 |
|
|
90 | 99 |
public JsonObject createResponse(JsonElement response) { |
91 | 100 |
JsonObject json = new JsonObject(); |
92 | 101 |
json.add("response", response); |
Also available in: Unified diff
[Users | Trunk]: Merge user info method of members and managers (Keep old paths). Add create member role for a type.id.