using System.Collections.Generic;
using System.Threading.Tasks;
using GxPress.Entity;
using GxPress.Repository.Interface;
using GxPress.Request.Thesaurus;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace GxPress.Api.AppControllers
{
    /// <summary>
    /// 冷热词库
    /// </summary>
    [Route("api/app/thesaurus")]
    [ApiController]
    [Authorize]
    public class ThesaurusController : ControllerBase
    {
        private readonly IThesaurusRepository _thesaurusRepository;

        public ThesaurusController( IThesaurusRepository thesaurusRepository)
        {
          
            _thesaurusRepository = thesaurusRepository;
        }

        /// <summary>
        /// app获取热词冷词
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("get-thesaurus")]
        public async Task<IEnumerable<Thesaurus>> GetAppVersion(ThesaurusSearchRequest request)
        {
            return await _thesaurusRepository.GetTopListAsync(request);
        }

    }
}