Browse Source
Merge pull request #12436 from dashevchenko/mobileApp/storeInfoFix
Fixed mobile app version/store null info
pull/12444/head
Viacheslav Klimov
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
12 additions and
2 deletions
-
common/data/src/main/java/org/thingsboard/server/common/data/mobile/app/StoreInfo.java
-
dao/src/main/java/org/thingsboard/server/dao/model/ModelConstants.java
-
dao/src/main/java/org/thingsboard/server/dao/model/sql/MobileAppEntity.java
|
|
|
@ -15,12 +15,16 @@ |
|
|
|
*/ |
|
|
|
package org.thingsboard.server.common.data.mobile.app; |
|
|
|
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.Builder; |
|
|
|
import lombok.Data; |
|
|
|
import lombok.NoArgsConstructor; |
|
|
|
import org.thingsboard.server.common.data.validation.NoXss; |
|
|
|
|
|
|
|
@Data |
|
|
|
@Builder |
|
|
|
@NoArgsConstructor |
|
|
|
@AllArgsConstructor |
|
|
|
public class StoreInfo { |
|
|
|
|
|
|
|
@NoXss |
|
|
|
|
|
|
|
@ -19,6 +19,8 @@ import com.datastax.oss.driver.api.core.uuid.Uuids; |
|
|
|
import org.apache.commons.lang3.ArrayUtils; |
|
|
|
import org.thingsboard.server.common.data.id.TenantId; |
|
|
|
import org.thingsboard.server.common.data.kv.Aggregation; |
|
|
|
import org.thingsboard.server.common.data.mobile.app.MobileAppVersionInfo; |
|
|
|
import org.thingsboard.server.common.data.mobile.app.StoreInfo; |
|
|
|
|
|
|
|
import java.util.UUID; |
|
|
|
|
|
|
|
@ -454,6 +456,8 @@ public class ModelConstants { |
|
|
|
public static final String MOBILE_APP_STATUS_PROPERTY = "status"; |
|
|
|
public static final String MOBILE_APP_VERSION_INFO_PROPERTY = "version_info"; |
|
|
|
public static final String MOBILE_APP_STORE_INFO_PROPERTY = "store_info"; |
|
|
|
public static final MobileAppVersionInfo MOBILE_APP_VERSION_INFO_EMPTY_OBJECT = new MobileAppVersionInfo(); |
|
|
|
public static final StoreInfo MOBILE_APP_STORE_INFO_EMPTY_OBJECT = new StoreInfo(); |
|
|
|
|
|
|
|
/** |
|
|
|
* Mobile application bundle constants. |
|
|
|
|
|
|
|
@ -37,6 +37,8 @@ import org.thingsboard.server.dao.util.mapping.JsonConverter; |
|
|
|
|
|
|
|
import java.util.UUID; |
|
|
|
|
|
|
|
import static org.thingsboard.server.dao.model.ModelConstants.MOBILE_APP_STORE_INFO_EMPTY_OBJECT; |
|
|
|
import static org.thingsboard.server.dao.model.ModelConstants.MOBILE_APP_VERSION_INFO_EMPTY_OBJECT; |
|
|
|
import static org.thingsboard.server.dao.model.ModelConstants.TENANT_ID_COLUMN; |
|
|
|
|
|
|
|
@Data |
|
|
|
@ -99,8 +101,8 @@ public class MobileAppEntity extends BaseSqlEntity<MobileApp> { |
|
|
|
mobile.setAppSecret(appSecret); |
|
|
|
mobile.setPlatformType(platformType); |
|
|
|
mobile.setStatus(status); |
|
|
|
mobile.setVersionInfo(fromJson(versionInfo, MobileAppVersionInfo.class)); |
|
|
|
mobile.setStoreInfo(fromJson(storeInfo, StoreInfo.class)); |
|
|
|
mobile.setVersionInfo(versionInfo != null ? fromJson(versionInfo, MobileAppVersionInfo.class) : MOBILE_APP_VERSION_INFO_EMPTY_OBJECT); |
|
|
|
mobile.setStoreInfo(storeInfo != null ? fromJson(storeInfo, StoreInfo.class) : MOBILE_APP_STORE_INFO_EMPTY_OBJECT); |
|
|
|
return mobile; |
|
|
|
} |
|
|
|
} |
|
|
|
|