using Infrastructure;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using OpenAuth.App.ServiceApp.FireManagement;
using OpenAuth.App.ServiceApp.FireManagement.Request;
using OpenAuth.App.ServiceApp.GoView;
using System.Data;

namespace OpenAuth.WebApi.Controllers.ServiceControllers.FireManagement
{
    /// <summary>
    /// 自然资源管理
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class FireResourcesController : ControllerBase
    {
        private readonly FireResourcesApp _app;

        public FireResourcesController(FireResourcesApp app)
        {
            _app = app;
        }
        /// <summary>
        /// 根据sql获取数据
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        [HttpPost]
        [AllowAnonymous]
        public async Task<Response<DataTable>> GetDataBySql(SqlReq sql)
        {
            return await _app.GetDataBySql(sql);
        }
    }
}
