using Hotline.Api.Filter;
using Hotline.Application.Enterprise;
using Hotline.Configurations;
using Hotline.Enterprise;
using Hotline.Orders;
using Hotline.Repository.SqlSugar.Extensions;
using Hotline.Share.Dtos;
using Hotline.Share.Dtos.Enterprise;
using Hotline.Share.Dtos.Order;
using Hotline.Share.Dtos.Users;
using Hotline.Share.Requests;
using Hotline.Tools;
using MapsterMapper;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using XF.Domain.Authentications;
using XF.Domain.Repository;

namespace Hotline.Api.Controllers
{
    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
    }
}