using LJProxy.Services; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; namespace LJProxy.Controllers { [Route("api/[controller]")] [ApiController] public class VersionController: Controller { private VersionService _service; public VersionController(VersionService vService) { _service = vService; } [Route("GetUpdateJson")] [HttpGet] [HttpPost] public IActionResult GetUpdateJson() { string updateJson = _service.GetUpdateJson(); var result = new ContentResult(); result.Content = updateJson; result.ContentType = "application/json"; return result; } [Route("GetAppUpdate/{apkName}")] [HttpGet] [HttpPost] public IActionResult GetAppUpdate(string apkName) { var fs = _service.GetAPK(apkName); if (fs == null) { return NotFound(); } else { return new FileContentResult(fs, "application/vnd.android.package-archive"); } } } }