예제 #1
0
        public async Task <ResponseViewModel <AppVersionDto> > VersionDtorenewal([FromBody] RequestViewModel obj)
        {
            obj = JsonHelper.DeserializeJsonToObject <RequestViewModel>(Content(User.Identity.Name).Content);
            ResponseViewModel <AppVersionDto> response = null;
            var           code        = SysCode.Ok;
            AppVersionDto appVersion  = new AppVersionDto();
            int           platform    = obj.Client.Platform == "Android" ? 1 : 0;
            long          versionCode = long.Parse(obj.Client.VersionCode);

            appVersion = await _routine.VersionRenewalAsync(versionCode, platform);

            if (appVersion != null)
            {
                appVersion.Download_url = $"{appVersion.Download_url}{obj.Client.Channel}-release.apk";
            }
            response = new ResponseViewModel <AppVersionDto>(code, appVersion ?? null, obj.Encrypt, _sys, obj.Secret);
            return(response);
        }