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 new file mode 100644 index 0000000..1aee07f --- /dev/null +++ b/app/src/main/java/org/ntlab/acanthus_client/views/main_menu_ui/mypage/InvitedConnectionModel.java @@ -0,0 +1,62 @@ +package org.ntlab.acanthus_client.views.main_menu_ui.mypage; + +import org.ntlab.acanthus_client.Acanthus; +import org.ntlab.acanthus_client.resources.accounts.InvitedRest; + +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +import retrofit2.Retrofit; +import retrofit2.converter.jackson.JacksonConverterFactory; +import retrofit2.converter.scalars.ScalarsConverterFactory; + +//----------------------------------------------------------------- +// +public class InvitedConnectionModel { + + private Retrofit retrofit; + private Acanthus acanthus; + + //----------------------------------------------------------------- + //----------------------------------------------------------------- + // + public InvitedConnectionModel(Acanthus acanthus) { + init(acanthus); + } + + //----------------------------------------------------------------- + //----------------------------------------------------------------- + // + public 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(); + } + + //----------------------------------------------------------------- + // + public void checkInvited() { + final InvitedRest invitedRest = retrofit.create(InvitedRest.class); + + Call call = invitedRest.checkAccountInvited( + acanthus.getPreferenceUid(), acanthus.getAid()); + + call.enqueue(new Callback() { + @Override + public void onResponse(Call call, Response response) { + + } + + @Override + public void onFailure(Call call, Throwable t) { + + } + }); + + } + //----------------------------------------------------------------- + +}