Add project files.

This commit is contained in:
Sergio Matias Urquin
2025-04-29 18:42:29 -06:00
parent 9c1958d351
commit 83fc1878c4
67 changed files with 4586 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
namespace Core.Blueprint.Storage
{
public class BlobAddDto
{
public string? FileName { get; set; }
public byte[] FileContent { get; set; } = null!;
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Core.Blueprint.Storage.Adapters
{
class BlobDownloadAdapter
{
}
}

View File

@@ -0,0 +1,9 @@
namespace Core.Blueprint.Storage.Adapters
{
public class BlobDownloadUriAdapter
{
public Uri Uri { get; set; } = null!;
public string Name { get; set; } = null!;
public string? Status { get; set; }
}
}

View File

@@ -0,0 +1,13 @@
namespace Core.Blueprint.Storage
{
public class BlobFileAdapter
{
public string? Uri { get; set; }
public string Name { get; set; } = null!;
public string? DateUpload { get; set; }
public string? ContentType { get; set; }
public long? Size { get; set; }
public string? Status { get; set; }
public string? ShortDate { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Core.Blueprint.Storage
{
public class BlobStorageAdapter
{
public string FileName { get; set; } = string.Empty;
public string Content { get; set; } = string.Empty;
public string DownloadUrl { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Core.Blueprint.Storage.Adapters
{
public record BlobStorageFolder
{
public string Name { get; set; }
public List<BlobStorageFolder> SubFolders { get; set; } = [];
public List<BlobStorageFilesAdapter> Files { get; set; } = [];
}
public record BlobStorageFilesAdapter(string Content, string Name, string ContentType, string DownloadUrl);
}

View File

@@ -0,0 +1,66 @@

namespace Core.Blueprint.Storage
{
public class TrieNode
{
public Dictionary<char, TrieNode> Children { get; private set; }
public bool IsEndOfWord { get; set; }
public TrieNode()
{
Children = [];
IsEndOfWord = false;
}
}
public class Trie
{
private readonly TrieNode _root;
public Trie()
{
_root = new TrieNode();
}
public void Insert(string word)
{
var node = _root;
foreach (var ch in word)
{
if (!node.Children.ContainsKey(ch))
{
node.Children[ch] = new TrieNode();
}
node = node.Children[ch];
}
node.IsEndOfWord = true;
}
public List<string> SearchByPrefix(string? prefix)
{
var results = new List<string>();
var node = _root;
foreach (var ch in prefix)
{
if (!node.Children.ContainsKey(ch))
{
return results;
}
node = node.Children[ch];
}
SearchByPrefixHelper(node, prefix, results);
return results;
}
private void SearchByPrefixHelper(TrieNode node, string currentPrefix, List<string> results)
{
if (node.IsEndOfWord)
{
results.Add(currentPrefix);
}
foreach (var kvp in node.Children)
{
SearchByPrefixHelper(kvp.Value, currentPrefix + kvp.Key, results);
}
}
}
}