Beispiel #1
0
        public Result <UpgradeInfo> CheckUpdateInfo(QueryUpdateParams info)
        {
            //获取版本信息

            Result <UpgradeInfo> result = Result <UpgradeInfo> .CreateInstance(ResultCode.Fail);

            if (info == null)
            {
                result.SetFail("请求参数不全");
                return(result);
            }
            AppOSType       type = (AppOSType)Enum.ToObject(typeof(AppOSType), info.os);
            TAppUpgradeInfo item = ServiceFactory.GetService <SystemService>().GetUpgradeInfo(type, info.version);

            if (item != null)
            {
                UpgradeInfo upgradeInfo = new UpgradeInfo();
                upgradeInfo.upgrade_info = item.VersionContent;
                upgradeInfo.version      = item.VersionCode;
                upgradeInfo.download_url = item.DownloadUrl;
                upgradeInfo.version_name = item.VersionName;
                result.result_data       = upgradeInfo;
                result.SetSuccess("您有新的版本升级");
                return(result);
            }
            else
            {
                result.SetFail("您当前为最新版本");
            }
            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// 获取更新升级
        /// </summary>
        /// <param name="type"></param>
        /// <param name="versionCode"></param>
        /// <returns></returns>
        public TAppUpgradeInfo GetUpgradeInfo(AppOSType type, float versionCode)
        {
            String   strSql = "select * from t_appupgradeinfo where ostype=@ostype  and ispublish=@ispublish and status=@status and versioncode>@versioncode order by versioncode  desc";
            ParamMap param  = ParamMap.newMap();

            param.setParameter("ostype", (int)type);
            param.setParameter("ispublish", (int)Status.Enable);
            param.setParameter("status", (int)Status.Enable);
            param.setParameter("versioncode", versionCode);
            return(DataBaseHelper.FindOne <TAppUpgradeInfo>(strSql, param));
        }