using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;

namespace server.Controllers;

/// <summary>
/// [TODO:description]
/// </summary>
[ApiController]
[Route("api/[controller]")]
public class BsdlParserController : ControllerBase
{
    private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();

    /// <summary>
    /// [TODO:description]
    /// </summary>
    /// <returns>[TODO:return]</returns>
    [EnableCors("Development")]
    [HttpGet("GetBoundaryLogicalPorts")]
    public IResult GetBoundaryLogicalPorts()
    {
        var parser = new BsdlParser.Parser();
        var ret = parser.GetBoundaryLogicalPorts();
        if (ret.IsNull) return TypedResults.InternalServerError("Get Null");
        return TypedResults.Ok(ret.Value);
    }
}


