private static void AddAppUpdateListItem(List<AppUpdateListItemView> appUpdateListItems, AppProject appProject, App app, AppUpdateListItemView appView, AppVersion currentVersion) { appView.Id = app.Id; appView.AppNo = appProject.AppNo; appView.DownloadUrl = FILE_PREFIX + currentVersion.FileUrl; appView.Drive = app.Drive; appView.IsHide = app.IsHide; appView.StorageName = app.StorageName; appView.UpdateTip = currentVersion.Tip; appView.UpdateType = currentVersion.UpdateTypeId; appView.Version = currentVersion.Id; appView.VersionName = currentVersion.VersionName; appView.ApkName = appProject.PackageName; appView.FileSize = currentVersion.FileSize; appUpdateListItems.Add(appView); }
private void SetTestVersionToUpdateList(string appVer, List<AppUpdateListItemView> appUpdateListItems, AppProject appProject, App app, AppUpdateListItemView appView) { if (app.UseGreaterVersion) { if (HasGreaterVersion(app.CurrentTestVersion, appVer)) { var testVersion = AppStoreUIService.GetCurrentTestVersionForApp(app.Id); if (testVersion != null) { AddAppUpdateListItem(appUpdateListItems, appProject, app, appView, testVersion); } } } else { if (!app.CurrentTestVersion.EqualsOrdinalIgnoreCase(appVer)) { var testVersion = AppStoreUIService.GetCurrentTestVersionForApp(app.Id); if (testVersion != null) { AddAppUpdateListItem(appUpdateListItems, appProject, app, appView, testVersion); } } } }
private void UpdateListInternal(string appVer, List<AppUpdateListItemView> appUpdateListItems, MobileParam mobileParam, Func<AppProject> getAppProjectAction) { var appProject = getAppProjectAction(); if (appProject != null) { App app = AppStoreUIService.GetMatchedAppByRequest<AppProject>(appProject.Id, mobileParam); if (IsPublishableApp(app, mobileParam)) { AppUpdateListItemView appView = new AppUpdateListItemView(); if (HasTestableVersionForAppStore(app, mobileParam)) { SetTestVersionToUpdateList(appVer, appUpdateListItems, appProject, app, appView); } else if (HasPublishableVersion(app)) { SetPublishVersionToUpdateList(appVer, appUpdateListItems, appProject, app, appView); } } } }
public IList<AppUpdateListItemView> UpdateList(string data, MobileParam mobileParam) { var needUpdateList = new List<AppUpdateListItemView>(); var updateList = GetUpdateList(data); foreach (var item in updateList) { var app = AppView.Repo.Find(s => s.AppNo == item.AppNo); if (app.Version != item.Version) { var update = new AppUpdateListItemView(); update.DownloadUrl = AppDetail(app.AppNo, mobileParam).DownloadUrl; update.AppNo = item.AppNo; update.UpdateTip = "请更新应用"; update.UpdateType = 2; update.StorageName = app.StorageName; update.Drive = "C|Z|T|M"; update.IsHide = 0; update.Version = app.Version; needUpdateList.Add(update); } } return needUpdateList; }