This commit is contained in:
2025-12-26 16:40:32 +03:00
commit 4f1be2c3db
37 changed files with 2222 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
using Microsoft.AspNetCore.Mvc;
using public_valetax.DTOs;
using public_valetax.Repositories;
namespace public_valetax.Controllers
{
[ApiController]
[Route("api.[controller]")]
public class TreeController(ITreeRepository _treeRepository) : ControllerBase
{
[HttpPost("get")]
public async Task<ActionResult<MNode>> Get([FromQuery] string treeName)
{
var tree = await _treeRepository.GetTreeStructureAsync(treeName);
// If tree doesn't exist, create it
if (tree == null)
{
// Create the tree (implementation would depend on your requirements)
// For now, we'll just return an empty structure
tree = new MNode
{
Id = 0,
Name = treeName,
Children = []
};
}
return Ok(tree);
}
}
}