Initial commit
This commit is contained in:
316
sources/com/ubt/jimu/transport/model/ConfigItem.java
Normal file
316
sources/com/ubt/jimu/transport/model/ConfigItem.java
Normal file
@@ -0,0 +1,316 @@
|
||||
package com.ubt.jimu.transport.model;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.ubt.jimu.blockly.Utils;
|
||||
import com.ubt.jimu.blockly.bean.BlocklyProject;
|
||||
import com.ubt.jimu.blockly.bean.JimuMotion;
|
||||
import com.ubt.jimu.blockly.bean.JimuSound;
|
||||
import com.ubt.jimu.utils.JsonHelper;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class ConfigItem {
|
||||
public static final String STATE_UPLOADED = "0000";
|
||||
public static final String TAG = "ConfigItem";
|
||||
public static final String TYPE_AUDIO = "audio";
|
||||
public static final String TYPE_BLOCKLY = "blockly";
|
||||
public static final String TYPE_MOTION = "motion";
|
||||
public static final String TYPE_NEW_BLOCKLY = "newBlockly";
|
||||
public String blocklyVersion;
|
||||
private String content;
|
||||
private String customModelId;
|
||||
private String description;
|
||||
private long fileCreateTime;
|
||||
private long fileModifyTime;
|
||||
private String fileName;
|
||||
private String icon;
|
||||
private long id;
|
||||
private String isDefault;
|
||||
private String isDeleted;
|
||||
private boolean isModify;
|
||||
private Long localId;
|
||||
private String modelType;
|
||||
private String serverID;
|
||||
private String type;
|
||||
private int uploadState;
|
||||
private String userId;
|
||||
|
||||
public ConfigItem(Long l, long j, String str, String str2, String str3, long j2, long j3, String str4, String str5, String str6, String str7, String str8, String str9, String str10, boolean z, String str11, int i, String str12) {
|
||||
this.isDefault = "0";
|
||||
this.localId = l;
|
||||
this.id = j;
|
||||
this.type = str;
|
||||
this.fileName = str2;
|
||||
this.description = str3;
|
||||
this.fileCreateTime = j2;
|
||||
this.fileModifyTime = j3;
|
||||
this.serverID = str4;
|
||||
this.isDeleted = str5;
|
||||
this.icon = str6;
|
||||
this.blocklyVersion = str7;
|
||||
this.modelType = str8;
|
||||
this.customModelId = str9;
|
||||
this.isDefault = str10;
|
||||
this.isModify = z;
|
||||
this.userId = str11;
|
||||
this.uploadState = i;
|
||||
this.content = str12;
|
||||
}
|
||||
|
||||
public static ConfigItem fromBlocklyProject(BlocklyProject blocklyProject) {
|
||||
if (blocklyProject == null) {
|
||||
return null;
|
||||
}
|
||||
ConfigItem configItem = new ConfigItem();
|
||||
configItem.userId = blocklyProject.getUserId();
|
||||
configItem.modelType = blocklyProject.getModelType();
|
||||
configItem.customModelId = blocklyProject.getCustomModelId();
|
||||
configItem.type = TextUtils.isEmpty(blocklyProject.getBlocklyType()) ? "blockly" : blocklyProject.getBlocklyType();
|
||||
configItem.fileName = blocklyProject.getXmlId();
|
||||
configItem.description = blocklyProject.getXmlName();
|
||||
configItem.blocklyVersion = blocklyProject.getBlocklyVersion();
|
||||
configItem.fileCreateTime = Utils.formatFileCreateTime(blocklyProject.getXmlId());
|
||||
configItem.isDeleted = blocklyProject.getIsDeleted();
|
||||
return configItem;
|
||||
}
|
||||
|
||||
public static ConfigItem fromJimuMotion(JimuMotion jimuMotion) {
|
||||
if (jimuMotion == null) {
|
||||
return null;
|
||||
}
|
||||
ConfigItem configItem = new ConfigItem();
|
||||
configItem.type = TYPE_MOTION;
|
||||
configItem.userId = jimuMotion.getUserId();
|
||||
configItem.modelType = jimuMotion.getModelType();
|
||||
configItem.customModelId = jimuMotion.getCustomModelId();
|
||||
configItem.fileName = jimuMotion.getActionID();
|
||||
configItem.description = jimuMotion.getActionName();
|
||||
configItem.content = JsonHelper.a(jimuMotion.actionData);
|
||||
configItem.fileCreateTime = Utils.formatFileCreateTime(jimuMotion.getActionID());
|
||||
configItem.fileModifyTime = configItem.fileCreateTime;
|
||||
return configItem;
|
||||
}
|
||||
|
||||
public static ConfigItem fromJimuSound(JimuSound jimuSound) {
|
||||
if (jimuSound == null) {
|
||||
return null;
|
||||
}
|
||||
ConfigItem configItem = new ConfigItem();
|
||||
configItem.userId = jimuSound.getUserId();
|
||||
configItem.type = "audio";
|
||||
configItem.fileName = jimuSound.getKey();
|
||||
configItem.description = jimuSound.getDescription();
|
||||
configItem.icon = jimuSound.getIcon();
|
||||
configItem.setCustomModelId("0");
|
||||
configItem.setModelType("0");
|
||||
configItem.fileCreateTime = Utils.formatFileCreateTime(jimuSound.getKey());
|
||||
configItem.content = jimuSound.getDuration();
|
||||
return configItem;
|
||||
}
|
||||
|
||||
public static BlocklyProject toBlocklyProject(ConfigItem configItem) {
|
||||
BlocklyProject blocklyProject = new BlocklyProject();
|
||||
blocklyProject.setUserId(configItem.userId);
|
||||
blocklyProject.setModelType(configItem.getModelType());
|
||||
blocklyProject.setCustomModelId(configItem.getCustomModelId());
|
||||
blocklyProject.setBlocklyVersion(configItem.blocklyVersion);
|
||||
blocklyProject.setIsDefault(false);
|
||||
blocklyProject.setXmlId(configItem.fileName);
|
||||
blocklyProject.setXmlName(configItem.description);
|
||||
blocklyProject.setBlocklyType(configItem.getType());
|
||||
blocklyProject.setIsDeleted(configItem.getIsDeleted());
|
||||
return blocklyProject;
|
||||
}
|
||||
|
||||
public static JimuMotion toJimuMotion(ConfigItem configItem) {
|
||||
JimuMotion jimuMotion = new JimuMotion();
|
||||
jimuMotion.setUserId(configItem.userId);
|
||||
jimuMotion.setModelType(configItem.modelType);
|
||||
jimuMotion.setCustomModelId(configItem.customModelId);
|
||||
jimuMotion.setActionID(configItem.fileName);
|
||||
jimuMotion.setActionName(configItem.description);
|
||||
jimuMotion.setIsDeleted(configItem.isDeleted);
|
||||
jimuMotion.actionData = (ArrayList) JsonHelper.a(configItem.content, new TypeToken<List<JimuMotion.JimuServo>>() { // from class: com.ubt.jimu.transport.model.ConfigItem.1
|
||||
}.getType());
|
||||
return jimuMotion;
|
||||
}
|
||||
|
||||
public static JimuSound toJimuSound(ConfigItem configItem) {
|
||||
JimuSound jimuSound = new JimuSound();
|
||||
jimuSound.setUserId(configItem.getUserId());
|
||||
jimuSound.setKey(configItem.fileName);
|
||||
jimuSound.setDescription(configItem.description);
|
||||
jimuSound.setType(JimuSound.TYPE_RECORDING);
|
||||
jimuSound.setIcon(configItem.icon);
|
||||
jimuSound.setDuration(configItem.content);
|
||||
jimuSound.setIsDeleted(configItem.isDeleted);
|
||||
return jimuSound;
|
||||
}
|
||||
|
||||
public String getBlocklyVersion() {
|
||||
return this.blocklyVersion;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return this.content;
|
||||
}
|
||||
|
||||
public String getCustomModelId() {
|
||||
return this.customModelId;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
public long getFileCreateTime() {
|
||||
return this.fileCreateTime;
|
||||
}
|
||||
|
||||
public long getFileModifyTime() {
|
||||
return this.fileModifyTime;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return this.fileName;
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return this.icon;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public String getIsDefault() {
|
||||
return this.isDefault;
|
||||
}
|
||||
|
||||
public String getIsDeleted() {
|
||||
return this.isDeleted;
|
||||
}
|
||||
|
||||
public boolean getIsModify() {
|
||||
return this.isModify;
|
||||
}
|
||||
|
||||
public Long getLocalId() {
|
||||
return this.localId;
|
||||
}
|
||||
|
||||
public String getModelType() {
|
||||
return this.modelType;
|
||||
}
|
||||
|
||||
public String getServerID() {
|
||||
return this.serverID;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public int getUploadState() {
|
||||
return this.uploadState;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return this.userId;
|
||||
}
|
||||
|
||||
public void setBlocklyVersion(String str) {
|
||||
this.blocklyVersion = str;
|
||||
}
|
||||
|
||||
public void setContent(String str) {
|
||||
this.content = str;
|
||||
}
|
||||
|
||||
public void setCustomModelId(String str) {
|
||||
this.customModelId = str;
|
||||
}
|
||||
|
||||
public void setDescription(String str) {
|
||||
this.description = str;
|
||||
}
|
||||
|
||||
public void setFileCreateTime(long j) {
|
||||
this.fileCreateTime = j;
|
||||
}
|
||||
|
||||
public void setFileModifyTime(long j) {
|
||||
this.fileModifyTime = j;
|
||||
}
|
||||
|
||||
public void setFileName(String str) {
|
||||
this.fileName = str;
|
||||
}
|
||||
|
||||
public void setIcon(String str) {
|
||||
this.icon = str;
|
||||
}
|
||||
|
||||
public void setId(long j) {
|
||||
this.id = j;
|
||||
}
|
||||
|
||||
public void setIsDefault(String str) {
|
||||
this.isDefault = str;
|
||||
}
|
||||
|
||||
public void setIsDeleted(String str) {
|
||||
this.isDeleted = str;
|
||||
}
|
||||
|
||||
public void setIsModify(boolean z) {
|
||||
this.isModify = z;
|
||||
}
|
||||
|
||||
public void setLocalId(Long l) {
|
||||
this.localId = l;
|
||||
}
|
||||
|
||||
public void setModelType(String str) {
|
||||
this.modelType = str;
|
||||
}
|
||||
|
||||
public void setServerID(String str) {
|
||||
this.serverID = str;
|
||||
}
|
||||
|
||||
public void setType(String str) {
|
||||
this.type = str;
|
||||
}
|
||||
|
||||
public void setUploadState(int i) {
|
||||
this.uploadState = i;
|
||||
}
|
||||
|
||||
public void setUserId(String str) {
|
||||
this.userId = str;
|
||||
}
|
||||
|
||||
public static ConfigItem fromBlocklyProject(String str, String str2, String str3, BlocklyProject blocklyProject) {
|
||||
if (blocklyProject == null) {
|
||||
return null;
|
||||
}
|
||||
ConfigItem configItem = new ConfigItem();
|
||||
configItem.userId = str;
|
||||
configItem.type = TextUtils.isEmpty(blocklyProject.getBlocklyType()) ? "blockly" : blocklyProject.getBlocklyType();
|
||||
configItem.fileName = blocklyProject.getXmlId();
|
||||
configItem.description = blocklyProject.getXmlName();
|
||||
configItem.blocklyVersion = blocklyProject.getBlocklyVersion();
|
||||
configItem.customModelId = str2;
|
||||
configItem.modelType = str3;
|
||||
configItem.fileCreateTime = Utils.formatFileCreateTime(blocklyProject.getXmlId());
|
||||
configItem.fileModifyTime = configItem.fileCreateTime;
|
||||
return configItem;
|
||||
}
|
||||
|
||||
public ConfigItem() {
|
||||
this.isDefault = "0";
|
||||
}
|
||||
}
|
261
sources/com/ubt/jimu/transport/model/TransportFile.java
Normal file
261
sources/com/ubt/jimu/transport/model/TransportFile.java
Normal file
@@ -0,0 +1,261 @@
|
||||
package com.ubt.jimu.transport.model;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class TransportFile {
|
||||
public static final String MODEL_ACTION_DIR = "actions";
|
||||
public static final String MODEL_CONTROLLER_CONFIG_DIR = "widgetConfig";
|
||||
public static final String MODEL_CONTROLLER_DIR = "ControllerData";
|
||||
public static final String MODEL_SERVO_DIR = "servos";
|
||||
public static final String MODEL_SHOW_DIR = "Exhibition";
|
||||
public static final String TYPE_ACTION = "action";
|
||||
public static final String TYPE_AUDIO = "audio";
|
||||
public static final String TYPE_AUDIO_SHOW = "showImage";
|
||||
public static final String TYPE_BG = "bg";
|
||||
public static final String TYPE_CONN = "conn";
|
||||
public static final String TYPE_CONTROLLER = "controller";
|
||||
public static final String TYPE_CONTROLLER_CONFIG = "widgetConfig";
|
||||
public static final String TYPE_DESC = "desc";
|
||||
public static final String TYPE_DIY_SHOW = "show";
|
||||
public static final String TYPE_NONE = "none";
|
||||
public static final String TYPE_PROGRAM = "program";
|
||||
public static final long UPLOADED_FILE_ID = 1;
|
||||
private long createTime;
|
||||
private Long customFileId;
|
||||
private String customModelCategory;
|
||||
private String customModelId;
|
||||
private String fileContent;
|
||||
private String fileId;
|
||||
private String fileName;
|
||||
private String filePath;
|
||||
private String fileType;
|
||||
private String fileUrl;
|
||||
private String fileVersion;
|
||||
private long id;
|
||||
private boolean isDeleted;
|
||||
private boolean isModify;
|
||||
private boolean isReleased;
|
||||
private long lastUploadTime;
|
||||
private long modelId;
|
||||
private String modelType;
|
||||
private long modifyTime;
|
||||
private boolean uploaded;
|
||||
private String userId;
|
||||
|
||||
public TransportFile(String str, long j, String str2, String str3, String str4, String str5, String str6) {
|
||||
this.userId = str;
|
||||
this.modelType = str3;
|
||||
this.modelId = j;
|
||||
this.customModelId = str2;
|
||||
this.fileType = str4;
|
||||
this.filePath = str5;
|
||||
this.fileName = str6;
|
||||
this.isModify = true;
|
||||
this.isDeleted = false;
|
||||
this.uploaded = false;
|
||||
this.createTime = System.currentTimeMillis();
|
||||
long j2 = this.createTime;
|
||||
this.modifyTime = j2;
|
||||
this.lastUploadTime = j2;
|
||||
}
|
||||
|
||||
public long getCreateTime() {
|
||||
return this.createTime;
|
||||
}
|
||||
|
||||
public Long getCustomFileId() {
|
||||
return this.customFileId;
|
||||
}
|
||||
|
||||
public String getCustomModelCategory() {
|
||||
return this.customModelCategory;
|
||||
}
|
||||
|
||||
public String getCustomModelId() {
|
||||
return this.customModelId;
|
||||
}
|
||||
|
||||
public String getFileContent() {
|
||||
return this.fileContent;
|
||||
}
|
||||
|
||||
public String getFileId() {
|
||||
return this.fileId;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return this.fileName;
|
||||
}
|
||||
|
||||
public String getFilePath() {
|
||||
return this.filePath;
|
||||
}
|
||||
|
||||
public String getFileType() {
|
||||
return this.fileType;
|
||||
}
|
||||
|
||||
public String getFileUrl() {
|
||||
return this.fileUrl;
|
||||
}
|
||||
|
||||
public String getFileVersion() {
|
||||
return this.fileVersion;
|
||||
}
|
||||
|
||||
public String getFullPath() {
|
||||
return this.filePath + File.separator + this.fileName;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public boolean getIsDeleted() {
|
||||
return this.isDeleted;
|
||||
}
|
||||
|
||||
public boolean getIsModify() {
|
||||
return this.isModify;
|
||||
}
|
||||
|
||||
public boolean getIsReleased() {
|
||||
return this.isReleased;
|
||||
}
|
||||
|
||||
public long getLastUploadTime() {
|
||||
return this.lastUploadTime;
|
||||
}
|
||||
|
||||
public long getModelId() {
|
||||
return this.modelId;
|
||||
}
|
||||
|
||||
public String getModelType() {
|
||||
return this.modelType;
|
||||
}
|
||||
|
||||
public long getModifyTime() {
|
||||
return this.modifyTime;
|
||||
}
|
||||
|
||||
public boolean getUploaded() {
|
||||
return this.uploaded;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return this.userId;
|
||||
}
|
||||
|
||||
public void setCreateTime(long j) {
|
||||
this.createTime = j;
|
||||
}
|
||||
|
||||
public void setCustomFileId(Long l) {
|
||||
this.customFileId = l;
|
||||
}
|
||||
|
||||
public void setCustomModelCategory(String str) {
|
||||
this.customModelCategory = str;
|
||||
}
|
||||
|
||||
public void setCustomModelId(String str) {
|
||||
this.customModelId = str;
|
||||
}
|
||||
|
||||
public void setFileContent(String str) {
|
||||
this.fileContent = str;
|
||||
}
|
||||
|
||||
public void setFileId(String str) {
|
||||
this.fileId = str;
|
||||
}
|
||||
|
||||
public void setFileName(String str) {
|
||||
this.fileName = str;
|
||||
}
|
||||
|
||||
public void setFilePath(String str) {
|
||||
this.filePath = str;
|
||||
}
|
||||
|
||||
public void setFileType(String str) {
|
||||
this.fileType = str;
|
||||
}
|
||||
|
||||
public void setFileUrl(String str) {
|
||||
this.fileUrl = str;
|
||||
}
|
||||
|
||||
public void setFileVersion(String str) {
|
||||
this.fileVersion = str;
|
||||
}
|
||||
|
||||
public void setId(long j) {
|
||||
this.id = j;
|
||||
}
|
||||
|
||||
public void setIsDeleted(boolean z) {
|
||||
this.isDeleted = z;
|
||||
}
|
||||
|
||||
public void setIsModify(boolean z) {
|
||||
this.isModify = z;
|
||||
}
|
||||
|
||||
public void setIsReleased(boolean z) {
|
||||
this.isReleased = z;
|
||||
}
|
||||
|
||||
public void setLastUploadTime(long j) {
|
||||
this.lastUploadTime = j;
|
||||
}
|
||||
|
||||
public void setModelId(long j) {
|
||||
this.modelId = j;
|
||||
}
|
||||
|
||||
public void setModelType(String str) {
|
||||
this.modelType = str;
|
||||
}
|
||||
|
||||
public void setModifyTime(long j) {
|
||||
this.modifyTime = j;
|
||||
}
|
||||
|
||||
public void setUploaded(boolean z) {
|
||||
this.uploaded = z;
|
||||
}
|
||||
|
||||
public void setUserId(String str) {
|
||||
this.userId = str;
|
||||
}
|
||||
|
||||
public TransportFile(Long l, String str, String str2, boolean z, String str3, String str4, String str5, String str6, String str7, long j, long j2, String str8, long j3, long j4, boolean z2, boolean z3, String str9, String str10, long j5, String str11, boolean z4) {
|
||||
this.customFileId = l;
|
||||
this.customModelId = str;
|
||||
this.customModelCategory = str2;
|
||||
this.isReleased = z;
|
||||
this.userId = str3;
|
||||
this.fileName = str4;
|
||||
this.filePath = str5;
|
||||
this.fileUrl = str6;
|
||||
this.fileVersion = str7;
|
||||
this.lastUploadTime = j;
|
||||
this.modelId = j2;
|
||||
this.modelType = str8;
|
||||
this.createTime = j3;
|
||||
this.modifyTime = j4;
|
||||
this.isDeleted = z2;
|
||||
this.isModify = z3;
|
||||
this.fileId = str9;
|
||||
this.fileContent = str10;
|
||||
this.id = j5;
|
||||
this.fileType = str11;
|
||||
this.uploaded = z4;
|
||||
}
|
||||
|
||||
public TransportFile() {
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user