|
|
@@ -1,18 +1,12 @@
|
|
|
package com.atmob.voiceai.data.repositories;
|
|
|
|
|
|
|
|
|
-import android.net.Uri;
|
|
|
-import android.text.TextUtils;
|
|
|
-
|
|
|
import androidx.annotation.IntDef;
|
|
|
import androidx.lifecycle.LiveData;
|
|
|
import androidx.lifecycle.MutableLiveData;
|
|
|
|
|
|
import com.atmob.app.lib.handler.RxHttpHandler;
|
|
|
-import com.atmob.app.lib.livedata.SingleLiveEvent;
|
|
|
-import com.atmob.common.runtime.ContextUtil;
|
|
|
import com.atmob.voiceai.data.api.AtmobApi;
|
|
|
-import com.atmob.voiceai.data.api.GenerateApi;
|
|
|
import com.atmob.voiceai.data.api.bean.CloneVoiceListBean;
|
|
|
import com.atmob.voiceai.data.api.request.BaseRequest;
|
|
|
import com.atmob.voiceai.data.api.request.CloneDeleteRequest;
|
|
|
@@ -20,17 +14,13 @@ import com.atmob.voiceai.data.api.request.VoiceCloneRequest;
|
|
|
import com.atmob.voiceai.data.api.response.VoiceCloneListResponse;
|
|
|
import com.atmob.voiceai.data.api.response.VoiceCloneResponse;
|
|
|
import com.atmob.voiceai.helper.ErrorHelper;
|
|
|
-import com.atmob.voiceai.utils.FileUtils;
|
|
|
import com.atmob.voiceai.utils.ReflectionUtil;
|
|
|
import com.atmob.voiceai.utils.ToastUtil;
|
|
|
-import com.google.gson.Gson;
|
|
|
import com.google.gson.annotations.SerializedName;
|
|
|
|
|
|
import java.io.File;
|
|
|
import java.lang.reflect.Field;
|
|
|
-import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
import javax.inject.Inject;
|
|
|
@@ -51,7 +41,6 @@ public class CloneRepository {
|
|
|
|
|
|
private final AtmobApi atmobApi;
|
|
|
private final VoiceAIRepository voiceAIRepository;
|
|
|
- private final GenerateApi generateApi;
|
|
|
|
|
|
private final MutableLiveData<List<CloneVoiceListBean>> cloneVoiceList = new MutableLiveData<>();
|
|
|
private final MutableLiveData<Integer> cloneUploadState = new MutableLiveData<>();
|
|
|
@@ -67,9 +56,8 @@ public class CloneRepository {
|
|
|
}
|
|
|
|
|
|
@Inject
|
|
|
- public CloneRepository(AtmobApi atmobApi, GenerateApi generateApi, VoiceAIRepository voiceAIRepository) {
|
|
|
+ public CloneRepository(AtmobApi atmobApi, VoiceAIRepository voiceAIRepository) {
|
|
|
this.atmobApi = atmobApi;
|
|
|
- this.generateApi = generateApi;
|
|
|
this.voiceAIRepository = voiceAIRepository;
|
|
|
refreshCloneList();
|
|
|
}
|
|
|
@@ -176,7 +164,7 @@ public class CloneRepository {
|
|
|
builder.addFormDataPart("file", file.getName(), fileRQ);
|
|
|
builder.setType(MultipartBody.FORM);
|
|
|
RequestBody body = builder.build();
|
|
|
- return generateApi.voiceClone(body)
|
|
|
+ return atmobApi.voiceClone(body)
|
|
|
.compose(RxHttpHandler.handle(false))
|
|
|
.compose(RxJavaUtil.SingleSchedule.io2Main())
|
|
|
.doOnSuccess(response -> {
|