| | package org.ntlab.acanthus_client.views.main_menu_ui.edit; |
---|
| | |
---|
| | import android.widget.EditText; |
---|
| | |
---|
| | import org.ntlab.acanthus_client.Acanthus; |
---|
| | import org.ntlab.acanthus_client.entities.AidJson; |
---|
| | import org.ntlab.acanthus_client.resources.accounts.WorkRest; |
---|
| |
---|
| | return this.acanthusMutableLiveData; |
---|
| | } |
---|
| | |
---|
| | //新規作品作成APIの呼び出し |
---|
| | public void startWorkEdit(Integer uid, String animationName, String token) { |
---|
| | public Integer startWorkEdit(Integer uid, String animationName, String token) { |
---|
| | Retrofit retrofit = new Retrofit.Builder() |
---|
| | .baseUrl("http://nitta-lab-www.is.konan-u.ac.jp/acanthus/") |
---|
| | .addConverterFactory(JacksonConverterFactory.create()) |
---|
| | .build(); |
---|
| | final WorkRest workRest = retrofit.create(WorkRest.class); |
---|
| | |
---|
| | final Integer[] aid = new Integer[1]; |
---|
| | |
---|
| | //作品の新規作成 |
---|
| | Call<AidJson> call = workRest.createWork(uid, animationName, token); |
---|
| | call.enqueue(new Callback<AidJson>() { |
---|
| | @Override |
---|
| | public void onResponse(Call<AidJson> call, Response<AidJson> response) { |
---|
| | |
---|
| | if (response.isSuccessful()){ |
---|
| | if (response.body()!=null){ |
---|
| | aid[0] = response.body().getAid(); |
---|
| | } |
---|
| | } |
---|
| | } |
---|
| | |
---|
| | @Override |
---|
| | public void onFailure(Call<AidJson> call, Throwable t) { |
---|
| | |
---|
| | } |
---|
| | }); |
---|
| | |
---|
| | return aid[0]; |
---|
| | } |
---|
| | |
---|
| | |
---|
| | |
---|
| | } |
---|
| | |