Browse Source
Merge pull request #12414 from dashevchenko/mobileApp/storeInfoFix
Fixed mobile app store info validation
pull/12444/head
Viacheslav Klimov
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
6 additions and
10 deletions
-
dao/src/main/java/org/thingsboard/server/dao/service/validator/MobileAppDataValidator.java
|
|
|
@ -30,21 +30,17 @@ public class MobileAppDataValidator extends DataValidator<MobileApp> { |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void validateDataImpl(TenantId tenantId, MobileApp mobileApp) { |
|
|
|
if (mobileApp.getPlatformType() == PlatformType.ANDROID) { |
|
|
|
if (mobileApp.getStoreInfo() != null && |
|
|
|
if (mobileApp.getStatus() == MobileAppStatus.PUBLISHED) { |
|
|
|
if (mobileApp.getStoreInfo() == null) { |
|
|
|
throw new DataValidationException("Store info is required for published apps"); |
|
|
|
} |
|
|
|
if (mobileApp.getPlatformType() == PlatformType.ANDROID && |
|
|
|
(mobileApp.getStoreInfo().getSha256CertFingerprints() == null || mobileApp.getStoreInfo().getStoreLink() == null)) { |
|
|
|
throw new DataValidationException("Sha256CertFingerprints and store link are required"); |
|
|
|
} |
|
|
|
} else if (mobileApp.getPlatformType() == PlatformType.IOS) { |
|
|
|
if (mobileApp.getStoreInfo() != null && |
|
|
|
} else if (mobileApp.getPlatformType() == PlatformType.IOS && |
|
|
|
(mobileApp.getStoreInfo().getAppId() == null || mobileApp.getStoreInfo().getStoreLink() == null)) { |
|
|
|
throw new DataValidationException("AppId and store link are required"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
throw new DataValidationException("Wrong application platform type"); |
|
|
|
} |
|
|
|
if (mobileApp.getStatus() == MobileAppStatus.PUBLISHED && mobileApp.getStoreInfo() == null) { |
|
|
|
throw new DataValidationException("Store info is required for published apps"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|