using System.Text;
using DAL.PGModels;
using LinqToDB;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace BLW_Log.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ValuesController : ControllerBase
    {
        public readonly IConfiguration configuration;
        public ValuesController(IConfiguration _configuration)
        {
            configuration = _configuration;
        }

        public string Get()
        {
            var timer_es = configuration["ShengJi:JianGe"];
            var RoomTypeID_FirstVersion = configuration["ShengJi:RoomTypeID_FirstVersion"];
            return timer_es;
        }
        public string get_json(string data)
        {
            return data;
        }

        [HttpPost()]
        public string wireshark_json()
        {
            var readResult = Request.BodyReader.ReadAsync().Result;
            Request.BodyReader.AdvanceTo(readResult.Buffer.Start, readResult.Buffer.End);
            string body = Encoding.UTF8.GetString(readResult.Buffer.FirstSpan);
            return "";
        }
        [HttpPost()]
        public string HeartCallWake()
        {
            return "iam wake up";
        }
    }
}
