@@ -0,0 +1,1822 @@
+package com.Schulprojekt.helloprojekt.GUILogik;%0D%0A%0D%0Aimport java.io.IOException;%0D%0Aimport java.io.InputStreamReader;%0D%0Aimport java.util.ArrayList;%0D%0Aimport java.util.List;%0D%0A%0D%0Aimport org.apache.http.HttpResponse;%0D%0A%0D%0Aimport com.google.gson.Gson;%0D%0Aimport com.google.gson.GsonBuilder;%0D%0Aimport com.google.gson.reflect.TypeToken;%0D%0Aimport com.google.gson.stream.JsonReader;%0D%0A%0D%0Apublic class RelationshipServices %7B%0D%0A%0D%0Aprivate static Gson gson = new GsonBuilder().create();%0D%0A%09%0D%0A%09/**%0D%0A%09 * @param args%0D%0A%09 */%0D%0A%09public static ArrayList%3CRelationship%3E getRelationship(int accountId) %7B%0D%0A%09%09ArrayList%3CRelationship%3E relationships = new ArrayList%3CRelationship%3E();%0D%0A%09%09String param = %22%7B%5C%22accountId%5C%22:%5C%22%22 + accountId + %22%5C%22%7D%22;%0D%0A%0D%0A%09%09HttpResponse response = WebServerUtils.post(%22/relationship/GetRelationship%22, param);%0D%0A%09%09%0D%0A%09%09JsonReader reader;%0D%0A%09%09try %7B%0D%0A%09%09%09reader = new JsonReader(new InputStreamReader(response.getEntity().getContent()));%0D%0A%09%09%09relationships = gson.fromJson(reader, new TypeToken%3CList%3CRelationship%3E%3E()%7B%7D.getType());%0D%0A%09%09%7D catch (IllegalStateException e) %7B%0D%0A%09%09%09// TODO Auto-generated catch block%0D%0A%09%09%09e.printStackTrace();%0D%0A%09%09%7D catch (IOException e) %7B%0D%0A%09%09%09// TODO Auto-generated catch block%0D%0A%09%09%09e.printStackTrace();%0D%0A%09%09%7D%0D%0A%09%09%0D%0A%09%09return relationships;%0D%0A%09%7D%0D%0A%09%0D%0A%09public static void createRelationship(Relationship relationship)%7B%0D%0A%09%09String param = %22%7B%5C%22friendsId%5C%22:%5C%22%22 + relationship.getFriendsId() + %22%5C%22, %5C%22userId%5C%22:%5C%22%22 + relationship.getUserId() + %22%5C%22%7D%22;%0D%0A%09%09HttpResponse response = WebServerUtils.post(%22/relationship/createRelationship%22, param);%0D%0A%09%7D%0D%0A%0D%0A%09public static void deleteRelationship(Relationship relationship)%7B%0D%0A%09%09String param = %22%7B%5C%22friendsId%5C%22:%5C%22%22 + relationship.getFriendsId() + %22%5C%22, %5C%22userId%5C%22:%5C%22%22 + relationship.getUserId() + %22%5C%22%7D%22;%0D%0A%09%09HttpResponse response = WebServerUtils.post(%22/relationship/DeleteRelationship%22, param);%0D%0A%09%7D%0D%0A%7D%0D%0A

create RelationshipServices