diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 691fcea..7273594 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -24,11 +24,11 @@ android:name=".ShopCreateActivity" android:exported="true" android:label="@string/title_activity_shop_create"> - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + getAccountLiveData() { return accountLiveData; } public MutableLiveData> getAccountPostsLiveData() { return accountPostsLiveData; } - //AccountJsonからAccountを作成し,対象のライブデータに設定する - private void setAccountLiveDataFromJson(AccountJson accountJson) { - Account account = new Account(accountJson); - accountLiveData.setValue(account); - } - - //PostJsonからPostを作成し,対象のライブデータに設定する - private void setAccountPostLiveDataFromJson(Collection postJson) { - ArrayList posts = new ArrayList<>(); - for(PostJson i: postJson) { - Post post = new Post(i); - posts.add(post); - } - accountPostsLiveData.setValue(posts); - } - // 対象のアカウント情報の取得 public void getAccount(String uid) { Call call = accountsRest.getAccount(uid); @@ -69,16 +53,22 @@ AccountJson accountJson = response.body(); setAccountLiveDataFromJson(accountJson); } else { - System.out.println("response error"); + System.out.println("GetAccount ResponseError"); } } @Override public void onFailure(Call call, Throwable t) { - System.out.println("correspondence error"); + System.out.println("GetAccount NetworkError" + t); } }); } + //AccountJsonからAccountを作成し,対象のライブデータに設定する + private void setAccountLiveDataFromJson(AccountJson aj) { + Account account = new Account(aj); + accountLiveData.setValue(account); + } + // 対象のアカウント情報の削除 public void deleteAccount(String uid) { Call call = accountsRest.deleteAccount(uid); @@ -87,14 +77,14 @@ @Override public void onResponse(Call call, Response response) { if (response.isSuccessful()) { - System.out.println("successful"); + System.out.println("DeleteAccount Successful"); } else { - System.out.println("response error"); + System.out.println("DeleteAccount ResponseError"); } } @Override public void onFailure(Call call, Throwable t) { - System.out.println("correspondence error"); + System.out.println("DeleteAccount NetworkError" + t); } }); } @@ -115,7 +105,7 @@ } @Override public void onFailure(Call call, Throwable t) { - System.out.println("correspondence error"); + System.out.println("correspondence error" + t); } }); } @@ -136,7 +126,7 @@ } @Override public void onFailure(Call call, Throwable t) { - System.out.println("correspondence error"); + System.out.println("correspondence error" + t); } }); } @@ -151,17 +141,28 @@ if (response.isSuccessful()) { Collection postJson = response.body(); setAccountPostLiveDataFromJson(postJson); + System.out.println("Success" + accountPostsLiveData.getValue().toString()); } else { System.out.println("response error"); } } @Override public void onFailure(Call> call, Throwable t) { - System.out.println("correspondence error"); + System.out.println("correspondence error" + t); } }); } + //PostJsonからPostを作成し,対象のライブデータに設定する + private void setAccountPostLiveDataFromJson(Collection postJson) { + ArrayList posts = new ArrayList<>(); + for(PostJson pj: postJson) { + Post post = new Post(pj); + posts.add(post); + } + accountPostsLiveData.setValue(posts); + } + // 対象のアカウントがした投稿の削除 public void deleteAccountPost(String sid, String uid, String pid, String token) { Call call = accountsRest.deletePost(sid, uid, pid, token); @@ -177,7 +178,7 @@ } @Override public void onFailure(Call call, Throwable t) { - System.out.println("correspondence error"); + System.out.println("correspondence error" + t); } }); }