| | 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<Boolean> call = invitedRest.checkAccountInvited( |
---|
| | acanthus.getPreferenceUid(), acanthus.getAid()); |
---|
| | |
---|
| | call.enqueue(new Callback<Boolean>() { |
---|
| | @Override |
---|
| | public void onResponse(Call<Boolean> call, Response<Boolean> response) { |
---|
| | |
---|
| | } |
---|
| | |
---|
| | @Override |
---|
| | public void onFailure(Call<Boolean> call, Throwable t) { |
---|
| | |
---|
| | } |
---|
| | }); |
---|
| | |
---|
| | } |
---|
| | //----------------------------------------------------------------- |
---|
| | |
---|
| | } |
---|
| | |
---|
| | |