jimu-decompiled/sources/com/ubt/jimu/transport/request/UploadFileParam.java
2025-05-13 19:24:51 +02:00

69 lines
2.3 KiB
Java

package com.ubt.jimu.transport.request;
import android.util.Base64;
import com.ubt.jimu.JimuApplication;
import com.ubt.jimu.transport.dao.TransportFileDbHandler;
import com.ubt.jimu.transport.model.TransportFile;
import com.ubt.jimu.unity.bluetooth.UnityActivity;
import com.ubt.jimu.utils.DeviceUtils;
import com.ubtech.utils.FileHelper;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/* loaded from: classes2.dex */
public class UploadFileParam extends BaseParam {
private String accountName;
private String opType;
private String userId;
private String sequenceNo = DeviceUtils.a(JimuApplication.l());
private List<HashMap<String, Object>> batchFileList = new ArrayList();
public UploadFileParam(String str, String str2, String str3, List<TransportFile> list) throws IOException {
this.userId = str;
this.accountName = str2;
this.opType = str3;
for (TransportFile transportFile : list) {
File file = TransportFileDbHandler.getFile(transportFile);
HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("modelId", Long.valueOf(transportFile.getModelId()));
hashMap.put(UnityActivity.pModelType, transportFile.getModelType());
hashMap.put("filePath", transportFile.getFilePath());
hashMap.put("fileName", transportFile.getFileName());
hashMap.put("lastUploadTime", Long.valueOf(transportFile.getLastUploadTime()));
if ("delete".equals(str3)) {
hashMap.put("fileContent", "");
} else {
hashMap.put("fileContent", file2Base64Str(file));
}
this.batchFileList.add(hashMap);
}
}
private String file2Base64Str(File file) throws IOException {
return Base64.encodeToString(FileHelper.b(file), 0);
}
public String getAccountName() {
return this.accountName;
}
public List<HashMap<String, Object>> getBatchFileList() {
return this.batchFileList;
}
public String getOpType() {
return this.opType;
}
public String getSequenceNo() {
return this.sequenceNo;
}
public String getUserId() {
return this.userId;
}
}