Adds first interface definitions for files and tags
This commit is contained in:
parent
00b30b2349
commit
150f4d7ebe
|
@ -7,11 +7,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tagashi File Hub", "src\Tag
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TagashiFileHub.Core", "src\TagashiFileHub.Core\TagashiFileHub.Core.csproj", "{39536C05-9C87-44CA-A753-6A317F252666}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TagashiFileHub.Core", "src\TagashiFileHub.Core\TagashiFileHub.Core.csproj", "{39536C05-9C87-44CA-A753-6A317F252666}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TagashiFIleHub.Service", "src\TagashiFIleHub.Service\TagashiFIleHub.Service.csproj", "{368C0084-EBB4-4A9A-9E01-84C48CF184D9}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TagashiFIleHub.Service", "src\TagashiFIleHub.Service\TagashiFIleHub.Service.csproj", "{368C0084-EBB4-4A9A-9E01-84C48CF184D9}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TagashiFileHub.Communication.Abstractions", "src\TagashiFileHub.Communication.Abstractions\TagashiFileHub.Communication.Abstractions.csproj", "{587B3D46-1114-4A84-8F33-4EEA501AE613}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TagashiFileHub.Communication.Abstractions", "src\TagashiFileHub.Communication.Abstractions\TagashiFileHub.Communication.Abstractions.csproj", "{587B3D46-1114-4A84-8F33-4EEA501AE613}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TagashiFileHub.Communication.IPC", "src\TagashiFileHub.Communication.IPC\TagashiFileHub.Communication.IPC.csproj", "{64A274BB-678E-42C5-BD69-6BF7F04AD026}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TagashiFileHub.Communication.IPC", "src\TagashiFileHub.Communication.IPC\TagashiFileHub.Communication.IPC.csproj", "{64A274BB-678E-42C5-BD69-6BF7F04AD026}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TagashiFileHub.Core.Abstractions", "src\TagashiFileHub.Core.Abstractions\TagashiFileHub.Core.Abstractions.csproj", "{ADF7B751-178A-4ED7-8DEC-CF3FE723A708}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
@ -39,6 +41,10 @@ Global
|
||||||
{64A274BB-678E-42C5-BD69-6BF7F04AD026}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{64A274BB-678E-42C5-BD69-6BF7F04AD026}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{64A274BB-678E-42C5-BD69-6BF7F04AD026}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{64A274BB-678E-42C5-BD69-6BF7F04AD026}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{64A274BB-678E-42C5-BD69-6BF7F04AD026}.Release|Any CPU.Build.0 = Release|Any CPU
|
{64A274BB-678E-42C5-BD69-6BF7F04AD026}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{ADF7B751-178A-4ED7-8DEC-CF3FE723A708}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{ADF7B751-178A-4ED7-8DEC-CF3FE723A708}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{ADF7B751-178A-4ED7-8DEC-CF3FE723A708}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{ADF7B751-178A-4ED7-8DEC-CF3FE723A708}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
|
@ -15,5 +15,6 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\TagashiFileHub.Communication.IPC\TagashiFileHub.Communication.IPC.csproj" />
|
<ProjectReference Include="..\TagashiFileHub.Communication.IPC\TagashiFileHub.Communication.IPC.csproj" />
|
||||||
|
<ProjectReference Include="..\TagashiFileHub.Core\TagashiFileHub.Core.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
9
src/TagashiFileHub.Core.Abstractions/Files/IFile.cs
Normal file
9
src/TagashiFileHub.Core.Abstractions/Files/IFile.cs
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
namespace TagashiFileHub.Core.Abstractions.Files;
|
||||||
|
|
||||||
|
public interface IFile : IUnique<string>
|
||||||
|
{
|
||||||
|
public FileInfo TrueFile();
|
||||||
|
public IAsyncEnumerable<ITag> GetTagsAsync();
|
||||||
|
public ITag? AddTag(ITag tag);
|
||||||
|
public ITag? AddTag(string tagName);
|
||||||
|
}
|
6
src/TagashiFileHub.Core.Abstractions/Files/ITag.cs
Normal file
6
src/TagashiFileHub.Core.Abstractions/Files/ITag.cs
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
namespace TagashiFileHub.Core.Abstractions.Files;
|
||||||
|
|
||||||
|
public interface ITag : IUnique<string>
|
||||||
|
{
|
||||||
|
string Name { get; set; }
|
||||||
|
}
|
6
src/TagashiFileHub.Core.Abstractions/IUnique.cs
Normal file
6
src/TagashiFileHub.Core.Abstractions/IUnique.cs
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
namespace TagashiFileHub.Core.Abstractions;
|
||||||
|
|
||||||
|
public interface IUnique<T>
|
||||||
|
{
|
||||||
|
T Id { get; set; }
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
|
@ -1,7 +0,0 @@
|
||||||
namespace TagashiFileHub.Core
|
|
||||||
{
|
|
||||||
public class Class1
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -6,4 +6,9 @@
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\TagashiFileHub.Communication.Abstractions\TagashiFileHub.Communication.Abstractions.csproj" />
|
||||||
|
<ProjectReference Include="..\TagashiFileHub.Core.Abstractions\TagashiFileHub.Core.Abstractions.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
13
src/TagashiFileHub.Core/UniqueObject.cs
Normal file
13
src/TagashiFileHub.Core/UniqueObject.cs
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
using TagashiFileHub.Core.Abstractions;
|
||||||
|
|
||||||
|
namespace TagashiFileHub.Core;
|
||||||
|
|
||||||
|
public class UniqueObject : IUnique<string>
|
||||||
|
{
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
protected string CreateNewId()
|
||||||
|
{
|
||||||
|
return new Guid().ToString();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue