This commit is contained in:
lixiaopeng
2021-01-27 15:47:00 +08:00
parent 9cdee742dd
commit 9c1f40f9ad
5 changed files with 14 additions and 15 deletions

View File

@@ -65,7 +65,6 @@ public class CosUpload implements CosStatusCallback {
public void uploadInfo(UploadInfo info, ITanluUploadCallback callback) {
mCallback = callback;
mUploadInfo = info;
Log.d(HttpConstant.TANLU, "videoPath = " + info.getFilePath());
if (!TextUtils.isEmpty(info.getFilePath())) { //不传路径
if (isVideo(info.getFilePath())) {
@@ -100,10 +99,8 @@ public class CosUpload implements CosStatusCallback {
Log.d(HttpConstant.TANLU, "uploadCosCompleted ----> downloadUrl =" + downloadUrl + "--localPath =" + localPath);
if (filePath.size() == 2) {
if (isVideo(localPath)) { //如果是视频 localPath
Log.e(HttpConstant.TANLU, "1111111-------");
mCosVideoUrl = downloadUrl;
} else {
Log.e(HttpConstant.TANLU, "22222222------");
mCosPicUrl = downloadUrl;
}
@@ -112,7 +109,6 @@ public class CosUpload implements CosStatusCallback {
sendInformation();
}
} else {
Log.e(HttpConstant.TANLU, "333333------");
mCosPicUrl = downloadUrl;
sendInformation();
}
@@ -137,7 +133,7 @@ public class CosUpload implements CosStatusCallback {
//删除本地生成的图片封面
if (videoCoverImage != null) {
boolean isDeleteSuccess = deletePicFile(videoCoverImage);
deletePicFile(videoCoverImage);
}
UploadManager.getInstance(mContext.getApplicationContext()).loadUpload(getInformation(), new ITanluUploadCallback() {

View File

@@ -47,8 +47,8 @@ public class MogoRoadSearchManager {
return sInstance;
}
public void init () { //TODO
apiService = RetrofitFactory.INSTANCE.getInstance("http://dzt-test.zhidaozhixing.com")
public void init () {
apiService = RetrofitFactory.INSTANCE.getInstance(HttpConstant.DEV_HOTS)
.create(TanluApiService.class);
}

View File

@@ -45,8 +45,8 @@ public class UploadManager {
return sInstance;
}
public void init () { //TODO
apiService = RetrofitFactory.INSTANCE.getInstance("http://dzt-test.zhidaozhixing.com")
public void init () {
apiService = RetrofitFactory.INSTANCE.getInstance(HttpConstant.DEV_HOTS)
.create(TanluApiService.class);
}
@@ -60,11 +60,10 @@ public class UploadManager {
public void loadUpload(InformationBody informationBody, ITanluUploadCallback callback) {
Gson gson = new Gson();
Map<String, String> map = new HashMap<>();
// map.put("sn", MoGoAiCloudClient.getInstance().getAiCloudClientConfig().getSn()); //TODO
map.put("sn", "F803EB2046PZD00228");
map.put("sn", MoGoAiCloudClient.getInstance().getAiCloudClientConfig().getSn());
map.put("data", gson.toJson(informationBody));
Log.d(HttpConstant.TANLU, "info = " + gson.toJson(informationBody));
// map.put("sn", "ZD802C1938L10797");
// map.put("sn", "F803EB2046PZD00228");
// map.put("data", "{\"addr\":\"北京市东城区小黄庄北街2号靠近中国银行(北京安贞桥支行)\",\"areaCode\":\"110101\",\"areaName\":\"东城区\",\"cityCode\":\"010\",\"cityName\":\"北京市\",\"data\":\"[{\\\"thumbnail\\\":\\\"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/CarPad/com.zhidao.roadcondition/F803EB2046PZD00228/F803EB2046PZD00228_20210121165329/Thumbnail1611219200669.jpg\\\",\\\"url\\\":\\\"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/CarPad/com.zhidao.roadcondition/F803EB2046PZD00228/F803EB2046PZD00228_20210121165329/compress_video_20210121165307.mp4\\\"}]\",\"direction\":0.0,\"fromType\":\"2\",\"generateTime\":1611219213616,\"infoTimeout\":240,\"infoType\":1,\"isShare\":false,\"lat\":39.968317,\"lon\":116.410892,\"mainInfoId\":0,\"poiType\":\"10008\",\"provinceName\":\"北京市\",\"sn\":\"F803EB2046PZD00228\",\"speed\":0.0,\"street\":\"小黄庄北街\",\"trafficInfoType\":\"\",\"type\":1,\"uid\":0}");
Log.d(HttpConstant.TANLU, "sn = " + MoGoAiCloudClient.getInstance().getAiCloudClientConfig().getSn());
@@ -74,11 +73,11 @@ public class UploadManager {
.subscribe(new Observer<BaseData<UploadResult>>() {
@Override
public void onSubscribe(Disposable d) {
Log.d(HttpConstant.TANLU, "onSubscribe -----> ");
}
@Override
public void onNext(BaseData<UploadResult> result) {
Log.d(HttpConstant.TANLU, "onNext -----> ");
callback.onSuccess(result);
}
@@ -90,7 +89,6 @@ public class UploadManager {
@Override
public void onComplete() {
Log.d(HttpConstant.TANLU, "onComplete -----> ");
}
});
}

View File

@@ -10,6 +10,11 @@ public class HttpConstant {
public static final String DZT_HOTS = "http://dzt-deva.zhidaozhixing.com";
public static final String LAUNCHER_HOTS = "http://dzt-launcherSnapshot.zhidaozhixing.com";
public static final String DEV_HOTS = "http://dzt-test.zhidaozhixing.com";
public static final String RELEASE_HOTS = "http://dzt.zhidaozhixing.com";
public static final String TANLU = "TANLU_MODULE";
}

View File

@@ -100,7 +100,7 @@ fun bitmapToFile(bitmap: Bitmap?, filePath: String): Boolean {
return true
}
//
fun getVideoPicPath(): String {
val moviesDir = Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_PICTURES