Initial commit
This commit is contained in:
8
sources/com/ubt/jimu/base/db/diy/Diy2Type.java
Normal file
8
sources/com/ubt/jimu/base/db/diy/Diy2Type.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package com.ubt.jimu.base.db.diy;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum Diy2Type {
|
||||
TEXT,
|
||||
LIST,
|
||||
PICTURE
|
||||
}
|
369
sources/com/ubt/jimu/base/db/diy/DiyDBModel.java
Normal file
369
sources/com/ubt/jimu/base/db/diy/DiyDBModel.java
Normal file
@@ -0,0 +1,369 @@
|
||||
package com.ubt.jimu.base.db.diy;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import com.ubt.jimu.base.entities.RobotLite;
|
||||
import java.io.Serializable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DiyDBModel implements Serializable, Comparable<DiyDBModel> {
|
||||
private static final int CONTROLLER_COMPLETE = 1;
|
||||
private static final long serialVersionUID = 12840;
|
||||
private String actionPath;
|
||||
private int completeState;
|
||||
private String compressImagePath;
|
||||
private int customModelCategory;
|
||||
private long customModelCreatetime;
|
||||
private String customModelId;
|
||||
private String description;
|
||||
private String filePath;
|
||||
private Long id;
|
||||
private boolean isDelete;
|
||||
private Boolean isModify;
|
||||
private long lastUploadTime;
|
||||
private String modelCreatedId;
|
||||
private Integer modelId;
|
||||
private String modelName;
|
||||
private long modifyTime;
|
||||
private Integer mystep;
|
||||
private String step1Desc;
|
||||
private Integer step1state;
|
||||
private Integer step2state;
|
||||
private Integer step3state;
|
||||
private Integer step4state;
|
||||
private String step5PathDesc;
|
||||
private String step5desc;
|
||||
private Integer step5state;
|
||||
private Integer uploadState;
|
||||
private boolean useable;
|
||||
private String version;
|
||||
|
||||
public DiyDBModel(Long l, String str, String str2, int i, long j, long j2, Boolean bool, Integer num, boolean z, String str3, boolean z2, String str4, String str5, String str6, long j3, String str7, Integer num2, Integer num3, String str8, Integer num4, Integer num5, Integer num6, Integer num7, String str9, String str10, Integer num8, String str11, int i2) {
|
||||
this.isModify = false;
|
||||
this.modelId = 0;
|
||||
this.useable = true;
|
||||
this.isDelete = false;
|
||||
this.uploadState = 0;
|
||||
this.step1state = 0;
|
||||
this.step2state = 0;
|
||||
this.step3state = 0;
|
||||
this.step4state = 0;
|
||||
this.step5state = 0;
|
||||
this.mystep = 0;
|
||||
this.actionPath = "";
|
||||
this.id = l;
|
||||
this.customModelId = str;
|
||||
this.modelName = str2;
|
||||
this.customModelCategory = i;
|
||||
this.customModelCreatetime = j;
|
||||
this.modifyTime = j2;
|
||||
this.isModify = bool;
|
||||
this.modelId = num;
|
||||
this.useable = z;
|
||||
this.version = str3;
|
||||
this.isDelete = z2;
|
||||
this.description = str4;
|
||||
this.modelCreatedId = str5;
|
||||
this.compressImagePath = str6;
|
||||
this.lastUploadTime = j3;
|
||||
this.filePath = str7;
|
||||
this.uploadState = num2;
|
||||
this.step1state = num3;
|
||||
this.step1Desc = str8;
|
||||
this.step2state = num4;
|
||||
this.step3state = num5;
|
||||
this.step4state = num6;
|
||||
this.step5state = num7;
|
||||
this.step5desc = str9;
|
||||
this.step5PathDesc = str10;
|
||||
this.mystep = num8;
|
||||
this.actionPath = str11;
|
||||
this.completeState = i2;
|
||||
}
|
||||
|
||||
public String getActionPath() {
|
||||
return this.actionPath;
|
||||
}
|
||||
|
||||
public int getCompleteState() {
|
||||
return this.completeState;
|
||||
}
|
||||
|
||||
public String getCompressImagePath() {
|
||||
return this.compressImagePath;
|
||||
}
|
||||
|
||||
public int getCustomModelCategory() {
|
||||
return this.customModelCategory;
|
||||
}
|
||||
|
||||
public long getCustomModelCreatetime() {
|
||||
return this.customModelCreatetime;
|
||||
}
|
||||
|
||||
public String getCustomModelId() {
|
||||
return this.customModelId;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
public String getFilePath() {
|
||||
return this.filePath;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public boolean getIsDelete() {
|
||||
return this.isDelete;
|
||||
}
|
||||
|
||||
public Boolean getIsModify() {
|
||||
return this.isModify;
|
||||
}
|
||||
|
||||
public long getLastUploadTime() {
|
||||
return this.lastUploadTime;
|
||||
}
|
||||
|
||||
public String getModelCreatedId() {
|
||||
return this.modelCreatedId;
|
||||
}
|
||||
|
||||
public Integer getModelId() {
|
||||
return this.modelId;
|
||||
}
|
||||
|
||||
public String getModelName() {
|
||||
return this.modelName;
|
||||
}
|
||||
|
||||
public Boolean getModify() {
|
||||
return this.isModify;
|
||||
}
|
||||
|
||||
public long getModifyTime() {
|
||||
return this.modifyTime;
|
||||
}
|
||||
|
||||
public Integer getMyStep() {
|
||||
return this.mystep;
|
||||
}
|
||||
|
||||
public Integer getMystep() {
|
||||
return this.mystep;
|
||||
}
|
||||
|
||||
public RobotLite getRobotLite() {
|
||||
return new RobotLite(this.modelId.intValue(), this.customModelId, this.modelName, this.filePath, true, true);
|
||||
}
|
||||
|
||||
public String getStep1Desc() {
|
||||
return this.step1Desc;
|
||||
}
|
||||
|
||||
public Integer getStep1state() {
|
||||
return this.step1state;
|
||||
}
|
||||
|
||||
public Integer getStep2state() {
|
||||
return this.step2state;
|
||||
}
|
||||
|
||||
public Integer getStep3state() {
|
||||
return this.step3state;
|
||||
}
|
||||
|
||||
public Integer getStep4state() {
|
||||
return this.step4state;
|
||||
}
|
||||
|
||||
public String getStep5PathDesc() {
|
||||
return this.step5PathDesc;
|
||||
}
|
||||
|
||||
public String getStep5desc() {
|
||||
return this.step5desc;
|
||||
}
|
||||
|
||||
public Integer getStep5state() {
|
||||
return this.step5state;
|
||||
}
|
||||
|
||||
public Integer getUploadState() {
|
||||
return this.uploadState;
|
||||
}
|
||||
|
||||
public boolean getUseable() {
|
||||
return this.useable;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return this.version;
|
||||
}
|
||||
|
||||
public boolean isControllerComplete() {
|
||||
return (this.completeState & 1) > 0;
|
||||
}
|
||||
|
||||
public boolean isDelete() {
|
||||
return this.isDelete;
|
||||
}
|
||||
|
||||
public boolean isUseable() {
|
||||
return this.useable;
|
||||
}
|
||||
|
||||
public void setActionPath(String str) {
|
||||
this.actionPath = str;
|
||||
}
|
||||
|
||||
public void setCompleteState(int i) {
|
||||
this.completeState = i;
|
||||
}
|
||||
|
||||
public void setCompressImagePath(String str) {
|
||||
this.compressImagePath = str;
|
||||
}
|
||||
|
||||
public void setControllerComplete() {
|
||||
this.completeState |= 1;
|
||||
}
|
||||
|
||||
public void setCustomModelCategory(int i) {
|
||||
this.customModelCategory = i;
|
||||
}
|
||||
|
||||
public void setCustomModelCreatetime(long j) {
|
||||
this.customModelCreatetime = j;
|
||||
}
|
||||
|
||||
public void setCustomModelId(String str) {
|
||||
this.customModelId = str;
|
||||
}
|
||||
|
||||
public void setDelete(boolean z) {
|
||||
this.isDelete = z;
|
||||
}
|
||||
|
||||
public void setDescription(String str) {
|
||||
this.description = str;
|
||||
}
|
||||
|
||||
public void setFilePath(String str) {
|
||||
this.filePath = str;
|
||||
}
|
||||
|
||||
public void setId(Long l) {
|
||||
this.id = l;
|
||||
}
|
||||
|
||||
public void setIsDelete(boolean z) {
|
||||
this.isDelete = z;
|
||||
}
|
||||
|
||||
public void setIsModify(Boolean bool) {
|
||||
this.isModify = bool;
|
||||
}
|
||||
|
||||
public void setLastUploadTime(long j) {
|
||||
this.lastUploadTime = j;
|
||||
}
|
||||
|
||||
public void setModelCreatedId(String str) {
|
||||
this.modelCreatedId = str;
|
||||
}
|
||||
|
||||
public void setModelId(Integer num) {
|
||||
this.modelId = num;
|
||||
}
|
||||
|
||||
public void setModelName(String str) {
|
||||
this.modelName = str;
|
||||
}
|
||||
|
||||
public void setModify(Boolean bool) {
|
||||
this.isModify = bool;
|
||||
}
|
||||
|
||||
public void setModifyTime(long j) {
|
||||
this.modifyTime = j;
|
||||
}
|
||||
|
||||
public void setMyStep(Integer num) {
|
||||
this.mystep = num;
|
||||
}
|
||||
|
||||
public void setMystep(Integer num) {
|
||||
this.mystep = num;
|
||||
}
|
||||
|
||||
public void setStep1Desc(String str) {
|
||||
this.step1Desc = str;
|
||||
}
|
||||
|
||||
public void setStep1state(Integer num) {
|
||||
this.step1state = num;
|
||||
}
|
||||
|
||||
public void setStep2state(Integer num) {
|
||||
this.step2state = num;
|
||||
}
|
||||
|
||||
public void setStep3state(Integer num) {
|
||||
this.step3state = num;
|
||||
}
|
||||
|
||||
public void setStep4state(Integer num) {
|
||||
this.step4state = num;
|
||||
}
|
||||
|
||||
public void setStep5PathDesc(String str) {
|
||||
this.step5PathDesc = str;
|
||||
}
|
||||
|
||||
public void setStep5desc(String str) {
|
||||
this.step5desc = str;
|
||||
}
|
||||
|
||||
public void setStep5state(Integer num) {
|
||||
this.step5state = num;
|
||||
}
|
||||
|
||||
public void setUploadState(Integer num) {
|
||||
this.uploadState = num;
|
||||
}
|
||||
|
||||
public void setUseable(boolean z) {
|
||||
this.useable = z;
|
||||
}
|
||||
|
||||
public void setVersion(String str) {
|
||||
this.version = str;
|
||||
}
|
||||
|
||||
@Override // java.lang.Comparable
|
||||
public int compareTo(DiyDBModel diyDBModel) {
|
||||
if (TextUtils.isEmpty(diyDBModel.getCustomModelId()) || TextUtils.isEmpty(this.customModelId)) {
|
||||
return 1;
|
||||
}
|
||||
return Long.parseLong(this.customModelId) > Long.parseLong(diyDBModel.getCustomModelId()) ? -1 : 0;
|
||||
}
|
||||
|
||||
public DiyDBModel() {
|
||||
this.isModify = false;
|
||||
this.modelId = 0;
|
||||
this.useable = true;
|
||||
this.isDelete = false;
|
||||
this.uploadState = 0;
|
||||
this.step1state = 0;
|
||||
this.step2state = 0;
|
||||
this.step3state = 0;
|
||||
this.step4state = 0;
|
||||
this.step5state = 0;
|
||||
this.mystep = 0;
|
||||
this.actionPath = "";
|
||||
}
|
||||
}
|
321
sources/com/ubt/jimu/base/db/diy/DiyDBModelCopy.java
Normal file
321
sources/com/ubt/jimu/base/db/diy/DiyDBModelCopy.java
Normal file
@@ -0,0 +1,321 @@
|
||||
package com.ubt.jimu.base.db.diy;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DiyDBModelCopy {
|
||||
private String actionPath;
|
||||
private String compressImagePath;
|
||||
private int customModelCategory;
|
||||
private long customModelCreatetime;
|
||||
private String customModelId;
|
||||
private String description;
|
||||
private String filePath;
|
||||
private Long id;
|
||||
private boolean isDelete;
|
||||
private Boolean isModify;
|
||||
private String modelCreatedId;
|
||||
private Integer modelId;
|
||||
private String modelName;
|
||||
private long modifyTime;
|
||||
private Integer mystep;
|
||||
private String step1Desc;
|
||||
private Integer step1state;
|
||||
private Integer step2state;
|
||||
private Integer step3state;
|
||||
private Integer step4state;
|
||||
private String step5PathDesc;
|
||||
private String step5desc;
|
||||
private Integer step5state;
|
||||
private Integer uploadState;
|
||||
private boolean useable;
|
||||
private String version;
|
||||
|
||||
public DiyDBModelCopy() {
|
||||
this.isModify = false;
|
||||
this.useable = true;
|
||||
this.isDelete = false;
|
||||
this.uploadState = 0;
|
||||
this.step1state = 0;
|
||||
this.step2state = 0;
|
||||
this.step3state = 0;
|
||||
this.step4state = 0;
|
||||
this.step5state = 0;
|
||||
this.mystep = 0;
|
||||
this.actionPath = "";
|
||||
}
|
||||
|
||||
public String getActionPath() {
|
||||
return this.actionPath;
|
||||
}
|
||||
|
||||
public String getCompressImagePath() {
|
||||
return this.compressImagePath;
|
||||
}
|
||||
|
||||
public int getCustomModelCategory() {
|
||||
return this.customModelCategory;
|
||||
}
|
||||
|
||||
public long getCustomModelCreatetime() {
|
||||
return this.customModelCreatetime;
|
||||
}
|
||||
|
||||
public String getCustomModelId() {
|
||||
return this.customModelId;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
public String getFilePath() {
|
||||
return this.filePath;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public boolean getIsDelete() {
|
||||
return this.isDelete;
|
||||
}
|
||||
|
||||
public Boolean getIsModify() {
|
||||
return this.isModify;
|
||||
}
|
||||
|
||||
public String getModelCreatedId() {
|
||||
return this.modelCreatedId;
|
||||
}
|
||||
|
||||
public Integer getModelId() {
|
||||
return this.modelId;
|
||||
}
|
||||
|
||||
public String getModelName() {
|
||||
return this.modelName;
|
||||
}
|
||||
|
||||
public Boolean getModify() {
|
||||
return this.isModify;
|
||||
}
|
||||
|
||||
public long getModifyTime() {
|
||||
return this.modifyTime;
|
||||
}
|
||||
|
||||
public Integer getMyStep() {
|
||||
return this.mystep;
|
||||
}
|
||||
|
||||
public Integer getMystep() {
|
||||
return this.mystep;
|
||||
}
|
||||
|
||||
public String getStep1Desc() {
|
||||
return this.step1Desc;
|
||||
}
|
||||
|
||||
public Integer getStep1state() {
|
||||
return this.step1state;
|
||||
}
|
||||
|
||||
public Integer getStep2state() {
|
||||
return this.step2state;
|
||||
}
|
||||
|
||||
public Integer getStep3state() {
|
||||
return this.step3state;
|
||||
}
|
||||
|
||||
public Integer getStep4state() {
|
||||
return this.step4state;
|
||||
}
|
||||
|
||||
public String getStep5PathDesc() {
|
||||
return this.step5PathDesc;
|
||||
}
|
||||
|
||||
public String getStep5desc() {
|
||||
return this.step5desc;
|
||||
}
|
||||
|
||||
public Integer getStep5state() {
|
||||
return this.step5state;
|
||||
}
|
||||
|
||||
public Integer getUploadState() {
|
||||
return this.uploadState;
|
||||
}
|
||||
|
||||
public boolean getUseable() {
|
||||
return this.useable;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return this.version;
|
||||
}
|
||||
|
||||
public boolean isDelete() {
|
||||
return this.isDelete;
|
||||
}
|
||||
|
||||
public boolean isUseable() {
|
||||
return this.useable;
|
||||
}
|
||||
|
||||
public void setActionPath(String str) {
|
||||
this.actionPath = str;
|
||||
}
|
||||
|
||||
public void setCompressImagePath(String str) {
|
||||
this.compressImagePath = str;
|
||||
}
|
||||
|
||||
public void setCustomModelCategory(int i) {
|
||||
this.customModelCategory = i;
|
||||
}
|
||||
|
||||
public void setCustomModelCreatetime(long j) {
|
||||
this.customModelCreatetime = j;
|
||||
}
|
||||
|
||||
public void setCustomModelId(String str) {
|
||||
this.customModelId = str;
|
||||
}
|
||||
|
||||
public void setDelete(boolean z) {
|
||||
this.isDelete = z;
|
||||
}
|
||||
|
||||
public void setDescription(String str) {
|
||||
this.description = str;
|
||||
}
|
||||
|
||||
public void setFilePath(String str) {
|
||||
this.filePath = str;
|
||||
}
|
||||
|
||||
public void setId(Long l) {
|
||||
this.id = l;
|
||||
}
|
||||
|
||||
public void setIsDelete(boolean z) {
|
||||
this.isDelete = z;
|
||||
}
|
||||
|
||||
public void setIsModify(Boolean bool) {
|
||||
this.isModify = bool;
|
||||
}
|
||||
|
||||
public void setModelCreatedId(String str) {
|
||||
this.modelCreatedId = str;
|
||||
}
|
||||
|
||||
public void setModelId(Integer num) {
|
||||
this.modelId = num;
|
||||
}
|
||||
|
||||
public void setModelName(String str) {
|
||||
this.modelName = str;
|
||||
}
|
||||
|
||||
public void setModify(Boolean bool) {
|
||||
this.isModify = bool;
|
||||
}
|
||||
|
||||
public void setModifyTime(long j) {
|
||||
this.modifyTime = j;
|
||||
}
|
||||
|
||||
public void setMyStep(Integer num) {
|
||||
this.mystep = num;
|
||||
}
|
||||
|
||||
public void setMystep(Integer num) {
|
||||
this.mystep = num;
|
||||
}
|
||||
|
||||
public void setStep1Desc(String str) {
|
||||
this.step1Desc = str;
|
||||
}
|
||||
|
||||
public void setStep1state(Integer num) {
|
||||
this.step1state = num;
|
||||
}
|
||||
|
||||
public void setStep2state(Integer num) {
|
||||
this.step2state = num;
|
||||
}
|
||||
|
||||
public void setStep3state(Integer num) {
|
||||
this.step3state = num;
|
||||
}
|
||||
|
||||
public void setStep4state(Integer num) {
|
||||
this.step4state = num;
|
||||
}
|
||||
|
||||
public void setStep5PathDesc(String str) {
|
||||
this.step5PathDesc = str;
|
||||
}
|
||||
|
||||
public void setStep5desc(String str) {
|
||||
this.step5desc = str;
|
||||
}
|
||||
|
||||
public void setStep5state(Integer num) {
|
||||
this.step5state = num;
|
||||
}
|
||||
|
||||
public void setUploadState(Integer num) {
|
||||
this.uploadState = num;
|
||||
}
|
||||
|
||||
public void setUseable(boolean z) {
|
||||
this.useable = z;
|
||||
}
|
||||
|
||||
public void setVersion(String str) {
|
||||
this.version = str;
|
||||
}
|
||||
|
||||
public DiyDBModelCopy(Long l, String str, String str2, int i, long j, long j2, Boolean bool, Integer num, boolean z, String str3, boolean z2, String str4, String str5, String str6, String str7, Integer num2, Integer num3, String str8, Integer num4, Integer num5, Integer num6, Integer num7, String str9, String str10, Integer num8, String str11) {
|
||||
this.isModify = false;
|
||||
this.useable = true;
|
||||
this.isDelete = false;
|
||||
this.uploadState = 0;
|
||||
this.step1state = 0;
|
||||
this.step2state = 0;
|
||||
this.step3state = 0;
|
||||
this.step4state = 0;
|
||||
this.step5state = 0;
|
||||
this.mystep = 0;
|
||||
this.actionPath = "";
|
||||
this.id = l;
|
||||
this.customModelId = str;
|
||||
this.modelName = str2;
|
||||
this.customModelCategory = i;
|
||||
this.customModelCreatetime = j;
|
||||
this.modifyTime = j2;
|
||||
this.isModify = bool;
|
||||
this.modelId = num;
|
||||
this.useable = z;
|
||||
this.version = str3;
|
||||
this.isDelete = z2;
|
||||
this.description = str4;
|
||||
this.modelCreatedId = str5;
|
||||
this.compressImagePath = str6;
|
||||
this.filePath = str7;
|
||||
this.uploadState = num2;
|
||||
this.step1state = num3;
|
||||
this.step1Desc = str8;
|
||||
this.step2state = num4;
|
||||
this.step3state = num5;
|
||||
this.step4state = num6;
|
||||
this.step5state = num7;
|
||||
this.step5desc = str9;
|
||||
this.step5PathDesc = str10;
|
||||
this.mystep = num8;
|
||||
this.actionPath = str11;
|
||||
}
|
||||
}
|
22
sources/com/ubt/jimu/base/db/diy/DiyDetailsDbHandler.java
Normal file
22
sources/com/ubt/jimu/base/db/diy/DiyDetailsDbHandler.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package com.ubt.jimu.base.db.diy;
|
||||
|
||||
import com.ubt.jimu.base.db.AbstractDaoHandler;
|
||||
import com.ubt.jimu.diy.model.DiyDetailsModel;
|
||||
import org.greenrobot.greendao.AbstractDao;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DiyDetailsDbHandler extends AbstractDaoHandler<DiyDetailsModel> {
|
||||
public DiyDetailsDbHandler(AbstractDao<DiyDetailsModel, Long> abstractDao) {
|
||||
super(abstractDao);
|
||||
}
|
||||
|
||||
public boolean checkDownload(DiyDetailsModel diyDetailsModel) {
|
||||
DiyDetailsModel selectById = selectById(diyDetailsModel.getId());
|
||||
return selectById != null && selectById.getDownload();
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.db.AbstractDaoHandler, com.ubt.jimu.base.db.IDaoHandler
|
||||
public DiyDetailsModel selectUnique(DiyDetailsModel diyDetailsModel) {
|
||||
return null;
|
||||
}
|
||||
}
|
89
sources/com/ubt/jimu/base/db/diy/DiyHelper.java
Normal file
89
sources/com/ubt/jimu/base/db/diy/DiyHelper.java
Normal file
@@ -0,0 +1,89 @@
|
||||
package com.ubt.jimu.base.db.diy;
|
||||
|
||||
import android.content.Context;
|
||||
import com.ubt.jimu.base.cache.Cache;
|
||||
import com.ubt.jimu.base.db.DatabaseUtils;
|
||||
import com.ubt.jimu.gen.DaoMaster;
|
||||
import com.ubt.jimu.gen.DaoSession;
|
||||
import com.ubt.jimu.gen.DiyDBModelDao;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.greenrobot.greendao.query.QueryBuilder;
|
||||
import org.greenrobot.greendao.query.WhereCondition;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DiyHelper {
|
||||
public static final boolean ENCRYPTED = true;
|
||||
private static final DiyHelper ourInstance = new DiyHelper();
|
||||
private DaoSession daoSession;
|
||||
|
||||
private DiyHelper() {
|
||||
}
|
||||
|
||||
public static DiyHelper getInstance() {
|
||||
return ourInstance;
|
||||
}
|
||||
|
||||
public void deleteItem(DiyDBModel diyDBModel) {
|
||||
DatabaseUtils.getDaoSession(true).a((DaoSession) diyDBModel);
|
||||
}
|
||||
|
||||
public DaoSession getDaoSession() {
|
||||
return this.daoSession;
|
||||
}
|
||||
|
||||
public List<DiyDBModel> getDiyList() {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
try {
|
||||
QueryBuilder<DiyDBModel> k = DatabaseUtils.getDaoSession(true).d().k();
|
||||
k.a(DiyDBModelDao.Properties.ModelCreatedId.a((Object) Cache.getInstance().getUserId()), new WhereCondition[0]);
|
||||
List<DiyDBModel> b = k.b();
|
||||
for (int size = b.size(); size > 0; size--) {
|
||||
arrayList.add(b.get(size - 1));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public void insertData(DiyDBModel diyDBModel) {
|
||||
try {
|
||||
DatabaseUtils.getDaoSession(true).b((DaoSession) diyDBModel);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean nameRepeat(String str) {
|
||||
QueryBuilder b = DatabaseUtils.getDaoSession(false).b(DiyDBModel.class);
|
||||
b.a(DiyDBModelDao.Properties.ModelName.a((Object) str), new WhereCondition[0]);
|
||||
return ((DiyDBModel) b.c()) != null;
|
||||
}
|
||||
|
||||
public boolean queryForName(String str) {
|
||||
try {
|
||||
QueryBuilder<DiyDBModel> k = DatabaseUtils.getDaoSession(true).d().k();
|
||||
k.a(DiyDBModelDao.Properties.ModelName.a((Object) str), new WhereCondition[0]);
|
||||
return k.c() != null;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public DiyDBModel queryForUUid(String str) {
|
||||
try {
|
||||
QueryBuilder<DiyDBModel> k = DatabaseUtils.getDaoSession(true).d().k();
|
||||
k.a(DiyDBModelDao.Properties.CustomModelId.a((Object) str), new WhereCondition[0]);
|
||||
return k.c();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return new DiyDBModel();
|
||||
}
|
||||
}
|
||||
|
||||
public void rigisterDb(Context context) {
|
||||
this.daoSession = new DaoMaster(new DaoMaster.DevOpenHelper(context, "diy-db-encrypted").getEncryptedWritableDb("super-secret")).newSession();
|
||||
}
|
||||
}
|
@@ -0,0 +1,59 @@
|
||||
package com.ubt.jimu.base.db.diy;
|
||||
|
||||
import com.ubt.jimu.base.db.AbstractDaoHandler;
|
||||
import com.ubt.jimu.base.db.DatabaseUtils;
|
||||
import com.ubt.jimu.blockly.Utils;
|
||||
import com.ubt.jimu.blockly.bean.BlocklyProject;
|
||||
import com.ubt.jimu.diy.DiyRobotDbHandler;
|
||||
import com.ubt.jimu.diy.model.DiyProgramFile;
|
||||
import com.ubt.jimu.gen.DiyProgramFileDao;
|
||||
import com.ubt.jimu.unity.ModelType;
|
||||
import com.ubt.jimu.utils.LocaleUtils;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.greenrobot.greendao.AbstractDao;
|
||||
import org.greenrobot.greendao.query.QueryBuilder;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DiyProgramFileDbHandler extends AbstractDaoHandler<DiyProgramFile> {
|
||||
public DiyProgramFileDbHandler(AbstractDao<DiyProgramFile, Long> abstractDao) {
|
||||
super(abstractDao);
|
||||
}
|
||||
|
||||
public static List<BlocklyProject> getDiyBlocklyProject(String str) {
|
||||
DiyProgramFileDbHandler diyProgramFileDbHandler = new DiyProgramFileDbHandler(DatabaseUtils.getDaoSession(true).g());
|
||||
ArrayList arrayList = new ArrayList();
|
||||
List<DiyProgramFile> diyProgramFile = diyProgramFileDbHandler.getDiyProgramFile(str);
|
||||
if (diyProgramFile.size() == 0) {
|
||||
return arrayList;
|
||||
}
|
||||
for (DiyProgramFile diyProgramFile2 : diyProgramFile) {
|
||||
File file = new File(DiyRobotDbHandler.getModelPath(str, ModelType.PLAYER_DATA) + str + Utils.BLOCKLY_ADD_PATH + File.separator + diyProgramFile2.getBlocklyProjectXmlName());
|
||||
if (file.exists() && !file.isDirectory()) {
|
||||
BlocklyProject blocklyProject = new BlocklyProject();
|
||||
blocklyProject.setBlocklyType(diyProgramFile2.getType());
|
||||
blocklyProject.setBlocklyVersion(diyProgramFile2.getBlocklyVersion());
|
||||
blocklyProject.setCustomModelId(diyProgramFile2.getCustomModelId());
|
||||
blocklyProject.setXmlId(diyProgramFile2.getBlocklyProjectXmlId());
|
||||
blocklyProject.setXmlName(diyProgramFile2.getName());
|
||||
blocklyProject.setIsDeleted("0");
|
||||
blocklyProject.setModelType(String.valueOf(ModelType.PLAYER_DATA.getType()));
|
||||
arrayList.add(blocklyProject);
|
||||
}
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public List<DiyProgramFile> getDiyProgramFile(String str) {
|
||||
QueryBuilder k = this.dao.k();
|
||||
k.a(DiyProgramFileDao.Properties.CustomModelId.a((Object) str), DiyProgramFileDao.Properties.Language.a((Object) LocaleUtils.b()));
|
||||
List<DiyProgramFile> b = k.b();
|
||||
return b == null ? new ArrayList() : b;
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.db.AbstractDaoHandler, com.ubt.jimu.base.db.IDaoHandler
|
||||
public DiyProgramFile selectUnique(DiyProgramFile diyProgramFile) {
|
||||
return null;
|
||||
}
|
||||
}
|
59
sources/com/ubt/jimu/base/db/diy/DiyRobotFileDbDandler.java
Normal file
59
sources/com/ubt/jimu/base/db/diy/DiyRobotFileDbDandler.java
Normal file
@@ -0,0 +1,59 @@
|
||||
package com.ubt.jimu.base.db.diy;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import com.ubt.jimu.base.db.AbstractDaoHandler;
|
||||
import com.ubt.jimu.base.db.DatabaseUtils;
|
||||
import com.ubt.jimu.diy.DiyRobotFile;
|
||||
import com.ubt.jimu.gen.DiyRobotFileDao;
|
||||
import java.util.List;
|
||||
import org.greenrobot.greendao.AbstractDao;
|
||||
import org.greenrobot.greendao.query.QueryBuilder;
|
||||
import org.greenrobot.greendao.query.WhereCondition;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DiyRobotFileDbDandler extends AbstractDaoHandler<DiyRobotFile> {
|
||||
public DiyRobotFileDbDandler(AbstractDao<DiyRobotFile, Long> abstractDao) {
|
||||
super(abstractDao);
|
||||
}
|
||||
|
||||
public static DiyRobotFile query(DiyRobotFile diyRobotFile) {
|
||||
if (diyRobotFile == null) {
|
||||
return null;
|
||||
}
|
||||
QueryBuilder<DiyRobotFile> k = DatabaseUtils.getDaoSession(false).h().k();
|
||||
k.a(DiyRobotFileDao.Properties.CustomModelId.a(TextUtils.isEmpty(diyRobotFile.getCustomModelId()) ? Integer.valueOf(diyRobotFile.getServerModelId()) : diyRobotFile.getCustomModelId()), DiyRobotFileDao.Properties.FileType.a(Integer.valueOf(diyRobotFile.getFileType())), DiyRobotFileDao.Properties.FileName.a((Object) diyRobotFile.getFileName()), DiyRobotFileDao.Properties.ServerModelId.a(Integer.valueOf(diyRobotFile.getServerModelId())));
|
||||
return k.c();
|
||||
}
|
||||
|
||||
public static List<DiyRobotFile> queryDiyRobotFile(String str) {
|
||||
QueryBuilder<DiyRobotFile> k = DatabaseUtils.getDaoSession(false).h().k();
|
||||
k.a(DiyRobotFileDao.Properties.CustomModelId.a((Object) str), new WhereCondition[0]);
|
||||
return k.b();
|
||||
}
|
||||
|
||||
public static void saveOrUpdate(DiyRobotFile diyRobotFile) {
|
||||
if (diyRobotFile == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
DiyRobotFileDao h = DatabaseUtils.getDaoSession(false).h();
|
||||
QueryBuilder<DiyRobotFile> k = h.k();
|
||||
k.a(DiyRobotFileDao.Properties.CustomModelId.a(TextUtils.isEmpty(diyRobotFile.getCustomModelId()) ? Integer.valueOf(diyRobotFile.getServerModelId()) : diyRobotFile.getCustomModelId()), DiyRobotFileDao.Properties.FileType.a(Integer.valueOf(diyRobotFile.getFileType())), DiyRobotFileDao.Properties.FileName.a((Object) diyRobotFile.getFileName()), DiyRobotFileDao.Properties.ServerModelId.a(Integer.valueOf(diyRobotFile.getServerModelId())));
|
||||
DiyRobotFile c = k.c();
|
||||
if (c == null) {
|
||||
h.f(diyRobotFile);
|
||||
} else {
|
||||
diyRobotFile.setId(c.getId());
|
||||
h.g(diyRobotFile);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.ubt.jimu.base.db.AbstractDaoHandler, com.ubt.jimu.base.db.IDaoHandler
|
||||
public DiyRobotFile selectUnique(DiyRobotFile diyRobotFile) {
|
||||
return null;
|
||||
}
|
||||
}
|
37
sources/com/ubt/jimu/base/db/diy/DiyStep2Helper.java
Normal file
37
sources/com/ubt/jimu/base/db/diy/DiyStep2Helper.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.ubt.jimu.base.db.diy;
|
||||
|
||||
import com.ubt.jimu.base.db.DatabaseUtils;
|
||||
import com.ubt.jimu.gen.DiyStep2ModelDao;
|
||||
import org.greenrobot.greendao.query.QueryBuilder;
|
||||
import org.greenrobot.greendao.query.WhereCondition;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DiyStep2Helper {
|
||||
private static final DiyStep2Helper ourInstance = new DiyStep2Helper();
|
||||
|
||||
private DiyStep2Helper() {
|
||||
}
|
||||
|
||||
public static DiyStep2Helper getInstance() {
|
||||
return ourInstance;
|
||||
}
|
||||
|
||||
public void insertData(DiyStep2Model diyStep2Model) {
|
||||
try {
|
||||
DatabaseUtils.getDaoSession(true).i().g(diyStep2Model);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public DiyStep2Model queryForUUid(String str) {
|
||||
try {
|
||||
QueryBuilder<DiyStep2Model> k = DatabaseUtils.getDaoSession(true).i().k();
|
||||
k.a(DiyStep2ModelDao.Properties.CustomModelId.a((Object) str), new WhereCondition[0]);
|
||||
return k.c();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return new DiyStep2Model();
|
||||
}
|
||||
}
|
||||
}
|
169
sources/com/ubt/jimu/base/db/diy/DiyStep2Model.java
Normal file
169
sources/com/ubt/jimu/base/db/diy/DiyStep2Model.java
Normal file
@@ -0,0 +1,169 @@
|
||||
package com.ubt.jimu.base.db.diy;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DiyStep2Model {
|
||||
private String customModelId;
|
||||
private Integer direction;
|
||||
private String directionPath;
|
||||
private String modelName;
|
||||
private String picJson;
|
||||
private Integer step1lock;
|
||||
private Integer step1state;
|
||||
private Integer step2lock;
|
||||
private Integer step2state;
|
||||
private Integer step3lock;
|
||||
private Integer step3state;
|
||||
private Integer step4lock;
|
||||
private Integer step4state;
|
||||
private String stepDesc;
|
||||
|
||||
public DiyStep2Model(String str, String str2, Integer num, Integer num2, String str3, String str4, Integer num3, Integer num4, Integer num5, String str5, Integer num6, Integer num7, Integer num8, Integer num9) {
|
||||
this.step1state = 0;
|
||||
this.step1lock = 0;
|
||||
this.step2state = 0;
|
||||
this.step2lock = 0;
|
||||
this.direction = 1;
|
||||
this.step3state = 0;
|
||||
this.step3lock = 0;
|
||||
this.step4state = 0;
|
||||
this.step4lock = 0;
|
||||
this.customModelId = str;
|
||||
this.modelName = str2;
|
||||
this.step1state = num;
|
||||
this.step1lock = num2;
|
||||
this.stepDesc = str3;
|
||||
this.picJson = str4;
|
||||
this.step2state = num3;
|
||||
this.step2lock = num4;
|
||||
this.direction = num5;
|
||||
this.directionPath = str5;
|
||||
this.step3state = num6;
|
||||
this.step3lock = num7;
|
||||
this.step4state = num8;
|
||||
this.step4lock = num9;
|
||||
}
|
||||
|
||||
public String getCustomModelId() {
|
||||
return this.customModelId;
|
||||
}
|
||||
|
||||
public Integer getDirection() {
|
||||
return this.direction;
|
||||
}
|
||||
|
||||
public String getDirectionPath() {
|
||||
return this.directionPath;
|
||||
}
|
||||
|
||||
public String getModelName() {
|
||||
return this.modelName;
|
||||
}
|
||||
|
||||
public String getPicJson() {
|
||||
return this.picJson;
|
||||
}
|
||||
|
||||
public Integer getStep1lock() {
|
||||
return this.step1lock;
|
||||
}
|
||||
|
||||
public Integer getStep1state() {
|
||||
return this.step1state;
|
||||
}
|
||||
|
||||
public Integer getStep2lock() {
|
||||
return this.step2lock;
|
||||
}
|
||||
|
||||
public Integer getStep2state() {
|
||||
return this.step2state;
|
||||
}
|
||||
|
||||
public Integer getStep3lock() {
|
||||
return this.step3lock;
|
||||
}
|
||||
|
||||
public Integer getStep3state() {
|
||||
return this.step3state;
|
||||
}
|
||||
|
||||
public Integer getStep4lock() {
|
||||
return this.step4lock;
|
||||
}
|
||||
|
||||
public Integer getStep4state() {
|
||||
return this.step4state;
|
||||
}
|
||||
|
||||
public String getStepDesc() {
|
||||
return this.stepDesc;
|
||||
}
|
||||
|
||||
public void setCustomModelId(String str) {
|
||||
this.customModelId = str;
|
||||
}
|
||||
|
||||
public void setDirection(Integer num) {
|
||||
this.direction = num;
|
||||
}
|
||||
|
||||
public void setDirectionPath(String str) {
|
||||
this.directionPath = str;
|
||||
}
|
||||
|
||||
public void setModelName(String str) {
|
||||
this.modelName = str;
|
||||
}
|
||||
|
||||
public void setPicJson(String str) {
|
||||
this.picJson = str;
|
||||
}
|
||||
|
||||
public void setStep1lock(Integer num) {
|
||||
this.step1lock = num;
|
||||
}
|
||||
|
||||
public void setStep1state(Integer num) {
|
||||
this.step1state = num;
|
||||
}
|
||||
|
||||
public void setStep2lock(Integer num) {
|
||||
this.step2lock = num;
|
||||
}
|
||||
|
||||
public void setStep2state(Integer num) {
|
||||
this.step2state = num;
|
||||
}
|
||||
|
||||
public void setStep3lock(Integer num) {
|
||||
this.step3lock = num;
|
||||
}
|
||||
|
||||
public void setStep3state(Integer num) {
|
||||
this.step3state = num;
|
||||
}
|
||||
|
||||
public void setStep4lock(Integer num) {
|
||||
this.step4lock = num;
|
||||
}
|
||||
|
||||
public void setStep4state(Integer num) {
|
||||
this.step4state = num;
|
||||
}
|
||||
|
||||
public void setStepDesc(String str) {
|
||||
this.stepDesc = str;
|
||||
}
|
||||
|
||||
public DiyStep2Model() {
|
||||
this.step1state = 0;
|
||||
this.step1lock = 0;
|
||||
this.step2state = 0;
|
||||
this.step2lock = 0;
|
||||
this.direction = 1;
|
||||
this.step3state = 0;
|
||||
this.step3lock = 0;
|
||||
this.step4state = 0;
|
||||
this.step4lock = 0;
|
||||
}
|
||||
}
|
14
sources/com/ubt/jimu/base/db/diy/DiyStep2TypeConverter.java
Normal file
14
sources/com/ubt/jimu/base/db/diy/DiyStep2TypeConverter.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package com.ubt.jimu.base.db.diy;
|
||||
|
||||
import org.greenrobot.greendao.converter.PropertyConverter;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DiyStep2TypeConverter implements PropertyConverter<Diy2Type, String> {
|
||||
public String convertToDatabaseValue(Diy2Type diy2Type) {
|
||||
return diy2Type.name();
|
||||
}
|
||||
|
||||
public Diy2Type convertToEntityProperty(String str) {
|
||||
return Diy2Type.valueOf(str);
|
||||
}
|
||||
}
|
8
sources/com/ubt/jimu/base/db/diy/DiyType.java
Normal file
8
sources/com/ubt/jimu/base/db/diy/DiyType.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package com.ubt.jimu.base.db.diy;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum DiyType {
|
||||
TEXT,
|
||||
LIST,
|
||||
PICTURE
|
||||
}
|
14
sources/com/ubt/jimu/base/db/diy/DiyTypeConverter.java
Normal file
14
sources/com/ubt/jimu/base/db/diy/DiyTypeConverter.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package com.ubt.jimu.base.db.diy;
|
||||
|
||||
import org.greenrobot.greendao.converter.PropertyConverter;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class DiyTypeConverter implements PropertyConverter<DiyType, String> {
|
||||
public String convertToDatabaseValue(DiyType diyType) {
|
||||
return diyType.name();
|
||||
}
|
||||
|
||||
public DiyType convertToEntityProperty(String str) {
|
||||
return DiyType.valueOf(str);
|
||||
}
|
||||
}
|
14
sources/com/ubt/jimu/base/db/diy/SyncDbModel.java
Normal file
14
sources/com/ubt/jimu/base/db/diy/SyncDbModel.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package com.ubt.jimu.base.db.diy;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class SyncDbModel extends DiyDBModel {
|
||||
private String modelDescription;
|
||||
|
||||
public String getModelDescription() {
|
||||
return this.modelDescription;
|
||||
}
|
||||
|
||||
public void setModelDescription(String str) {
|
||||
this.modelDescription = str;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user