using System.Collections.Generic;
using System.Threading.Tasks;
using GxPress.Entity;
using GxPress.Repository.Interface;
using GxPress.Request.AppVersion;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
namespace GxPress.Api.AppControllers
{
///
/// APP版本管理
///
[Route("api/app/app-version")]
[ApiController]
[Authorize]
public class AppVersionController : ControllerBase
{
private readonly ILogger _logger;
private readonly IAppVersionRepository _appVersionRepository;
public AppVersionController(ILogger logger, IAppVersionRepository appVersionRepository)
{
_logger = logger;
_appVersionRepository = appVersionRepository;
}
///
/// app检查是否更新
///
///
///
[HttpPost("get-version")]
[AllowAnonymous]
public async Task GetAppVersion(AppVersionSearchRequest request)
{
return await _appVersionRepository.GetAppVersionAsync(request);
}
///
/// 查询
///
///
[HttpPost("app-list")]
[AllowAnonymous]
public async Task> GetAppVersionsAll()
{
return await _appVersionRepository.GetAppVersionsAsync();
}
}
}