Add project files.
This commit is contained in:
		
							
								
								
									
										8
									
								
								Core.Blueprint.Storage/Adapters/BlobAddDto.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								Core.Blueprint.Storage/Adapters/BlobAddDto.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| namespace Core.Blueprint.Storage | ||||
| { | ||||
|     public class BlobAddDto | ||||
|     { | ||||
|         public string? FileName { get; set; } | ||||
|         public byte[] FileContent { get; set; } = null!; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										12
									
								
								Core.Blueprint.Storage/Adapters/BlobDownloadAdapter.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								Core.Blueprint.Storage/Adapters/BlobDownloadAdapter.cs
									
									
									
									
									
										Normal 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 | ||||
|     { | ||||
|     } | ||||
| } | ||||
| @@ -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; } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										13
									
								
								Core.Blueprint.Storage/Adapters/BlobFileAdapter.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								Core.Blueprint.Storage/Adapters/BlobFileAdapter.cs
									
									
									
									
									
										Normal 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; } | ||||
|     } | ||||
| } | ||||
							
								
								
									
										15
									
								
								Core.Blueprint.Storage/Adapters/BlobStorageAdapter.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								Core.Blueprint.Storage/Adapters/BlobStorageAdapter.cs
									
									
									
									
									
										Normal 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; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										16
									
								
								Core.Blueprint.Storage/Adapters/BlobStorageFolder.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								Core.Blueprint.Storage/Adapters/BlobStorageFolder.cs
									
									
									
									
									
										Normal 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); | ||||
| } | ||||
							
								
								
									
										66
									
								
								Core.Blueprint.Storage/Adapters/Trie/TrieNode.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										66
									
								
								Core.Blueprint.Storage/Adapters/Trie/TrieNode.cs
									
									
									
									
									
										Normal 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); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 Sergio Matias Urquin
					Sergio Matias Urquin