using Hotline.Api.Filter;
using Hotline.Enterprise;
using Hotline.Share.Dtos.Enterprise;
using Hotline.Share.Requests;
using Microsoft.AspNetCore.Mvc;

namespace Hotline.Api.Controllers.YiBin
{
    public class EnterprisesController : BaseController
    {
        private readonly IEnterpriseService _enterpriseService;

        public EnterprisesController(IEnterpriseService enterpriseService)
        {
            _enterpriseService = enterpriseService;
        }
        #region 获取企业信息

        /// <summary>
        /// 获取企业信息
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        [HttpGet("enterprise/list")]
        [LogFilter("查询企业列表")]
        public async Task<YbEnterprisePaged> QueryYbEnterprises([FromQuery] PagedKeywordRequest dto)
        {
            return await _enterpriseService.QueryYbEnterprisesAsync(dto.Keyword!, dto.PageIndex, dto.PageSize, HttpContext.RequestAborted);
        }

        #endregion
    }
}
