diff --git a/app/src/main/java/org/ntlab/acanthus_client/views/main_menu_ui/mypage/InvitedConnectionModel.java b/app/src/main/java/org/ntlab/acanthus_client/views/main_menu_ui/mypage/InvitedConnectionModel.java deleted file mode 100644 index 3ceb9a0..0000000 --- a/app/src/main/java/org/ntlab/acanthus_client/views/main_menu_ui/mypage/InvitedConnectionModel.java +++ /dev/null @@ -1,113 +0,0 @@ -package org.ntlab.acanthus_client.views.main_menu_ui.mypage; - -import android.util.Log; - -import androidx.lifecycle.MutableLiveData; - -import org.ntlab.acanthus_client.Acanthus; -import org.ntlab.acanthus_client.R; -import org.ntlab.acanthus_client.entities.Editor; -import org.ntlab.acanthus_client.entities.Work; -import org.ntlab.acanthus_client.resources.accounts.InvitedRest; -import org.ntlab.acanthus_client.resources.accounts.WorkRest; -import org.ntlab.acanthus_client.resources.gallery.EditorsRest; - -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; -import retrofit2.Retrofit; -import retrofit2.converter.jackson.JacksonConverterFactory; -import retrofit2.converter.scalars.ScalarsConverterFactory; - -//----------------------------------------------------------------- -// 招待されているかの問い合わせAPI -public class InvitedConnectionModel { - - private Retrofit retrofit; - private Acanthus acanthus; - //----------------------------------------------------------------- - private Boolean isInvited; - - //----------------------------------------------------------------- - // setter - private void setIsInvited(Boolean isInvited) { - this.isInvited = isInvited; - } - - //----------------------------------------------------------------- - //----------------------------------------------------------------- - // - public InvitedConnectionModel(Acanthus acanthus) { - init(acanthus); - } - - //----------------------------------------------------------------- - // 招待確認 - public void checkInvited(MutableLiveData mIsInvited) { - final InvitedRest invitedRest = retrofit.create(InvitedRest.class); - int dummyId = 2; - - Call call = invitedRest.checkAccountInvited(dummyId, acanthus.getAid()); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - if (response.isSuccessful()) - mIsInvited.setValue(response.body()); - } - - @Override - public void onFailure(Call call, Throwable t) { - - } - }); - - } - - //----------------------------------------------------------------- - // 招待されているリストの取得API - public void getAccountInvitedList(){ - - } - - - //----------------------------------------------------------------- - // 招待承認 - public void acceptInvite() { - final WorkRest workRest = retrofit.create(WorkRest.class); - int dummy = 1111; - - - // 作品への参加 - // 自身のID, token, 該当作品ID - // ToDo: Aidを外部から取得する必要あり? -> AccountのInviteMapから任意の - // ToDo: getAidを招待一覧画面で更新してから取得すれば変更しなくてよさそう - - - - Call call = workRest.updateWork(acanthus.getPreferenceUid(), acanthus.getPreferenceToken(), dummy); - call.enqueue(new Callback() { - @Override - public void onResponse(Call call, Response response) { - } - - @Override - public void onFailure(Call call, Throwable t) { - - } - }); - } - - //----------------------------------------------------------------- - //----------------------------------------------------------------- - // init - private void init(Acanthus acanthus) { - this.acanthus = acanthus; - this.retrofit = new Retrofit.Builder() - .baseUrl("http://nitta-lab-www.is.konan-u.ac.jp/acanthus/") - .addConverterFactory(ScalarsConverterFactory.create()) - .addConverterFactory(JacksonConverterFactory.create()) - .build(); - } - - //----------------------------------------------------------------- -}