Compare commits
4 Commits
fb0506e6b7
...
908fc0df1b
| Author | SHA1 | Date | |
|---|---|---|---|
| 908fc0df1b | |||
| 88b676ab80 | |||
| c469ba486f | |||
| 839b044fc6 |
20
Interfaces/IReportUI.cs
Normal file
20
Interfaces/IReportUI.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
namespace Interfaces;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Interface for the UI component that allows users to report entities.
|
||||||
|
/// This interface defines the properties that a reporting UI should have.
|
||||||
|
/// </summary>
|
||||||
|
public interface IReportUI
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The type of the UI Component that should be used to display the reporting interface.
|
||||||
|
/// This should be passed to DynamicComponent to render the UI Component.
|
||||||
|
/// Component that implement this interface should return typeof(this) in this property.
|
||||||
|
/// </summary>
|
||||||
|
Type ReportType { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The reportable Entity that is being reported.
|
||||||
|
/// </summary>
|
||||||
|
IReportable ReportableEntity { get; set; }
|
||||||
|
}
|
||||||
@@ -1,8 +1,27 @@
|
|||||||
namespace Interfaces;
|
namespace Interfaces;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Interface for entities that can be reported by users. This includes things like posts, comments, and user profiles.
|
||||||
|
/// The IReportUI interface will use this interface to determine what information to display when a user reports an
|
||||||
|
/// entity, and the IReportingHandler interface will use this interface to determine how to handle the report when it is
|
||||||
|
/// submitted.
|
||||||
|
/// </summary>
|
||||||
public interface IReportable
|
public interface IReportable
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Module Name is no longer required. Use ModuleID and EntityID instead to uniquely identify the type of entity being reported.
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete]
|
||||||
public string ModuleName { get; }
|
public string ModuleName { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The ID of the Module from an Entity that is beeing reported.
|
||||||
|
/// This is used to determine the type of entity being reported.
|
||||||
|
/// </summary>
|
||||||
public int ModuleID { get; }
|
public int ModuleID { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The ID of an Entity that is beeing reported. This is used to determine the exact entity being reported.
|
||||||
|
/// </summary>
|
||||||
public int EntityID { get; }
|
public int EntityID { get; }
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,19 @@
|
|||||||
namespace Interfaces;
|
namespace Interfaces;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handler for processing user reports. This interface defines a method for handling reports submitted by users,
|
||||||
|
/// which includes the reportable entity and any additional notes provided by the user. Implementations of this
|
||||||
|
/// interface will determine how to process the report, such as logging it, notifying moderators,
|
||||||
|
/// or taking action against the reported entity.
|
||||||
|
/// </summary>
|
||||||
public interface IReportingHandler
|
public interface IReportingHandler
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Report an IReportable entity with a note. Implementations of this method should handle the report appropriately,
|
||||||
|
/// such as logging it, saving it, notifying moderators and taking action against the owner of the reported entity
|
||||||
|
/// if necessary.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="reportable">The Entity - as in the Message, Note, Posting, ... - that should be reported</param>
|
||||||
|
/// <param name="note">A note from the reporting user which is only visible to the admins.</param>
|
||||||
public void Report(IReportable reportable, string note);
|
public void Report(IReportable reportable, string note);
|
||||||
}
|
}
|
||||||
@@ -6,4 +6,10 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
<Exec Condition="'$(OS)' == 'Windows_NT' And '$(Configuration)' == 'Debug'" Command="debug.cmd $(TargetFramework) $([System.String]::Copy('$(MSBuildProjectName)').Replace('.Package',''))" />
|
||||||
|
<Exec Condition="'$(OS)' != 'Windows_NT' And '$(Configuration)' == 'Debug'" Command="bash $(ProjectDir)debug.sh $(TargetFramework) $([System.String]::Copy('$(MSBuildProjectName)').Replace('.Package',''))" />
|
||||||
|
<Exec Condition="'$(OS)' == 'Windows_NT' And '$(Configuration)' == 'Release'" Command="release.cmd $(TargetFramework) $([System.String]::Copy('$(MSBuildProjectName)').Replace('.Package',''))" />
|
||||||
|
<Exec Condition="'$(OS)' != 'Windows_NT' And '$(Configuration)' == 'Release'" Command="bash $(ProjectDir)release.sh $(TargetFramework) $([System.String]::Copy('$(MSBuildProjectName)').Replace('.Package',''))" />
|
||||||
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
25
README.md
Normal file
25
README.md
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# Interfaces
|
||||||
|
Dieses Repository enthält die Schnittstellen für die verschiedenen Module unseres Systems. Die Architektur ist auf Modularität und Skalierbarkeit ausgelegt, wobei jedes Modul über definierte Schnittstellen kommuniziert.
|
||||||
|
|
||||||
|
Ausschlaggebender Grund für die Einführung der Schnittstellenschicht war die Entwicklung des Report Systems. Anbei eine Übersicht der Architektur:
|
||||||
|
```mermaid
|
||||||
|
architecture-beta
|
||||||
|
service hof(server)[Hall of Fame]
|
||||||
|
service er(server)[Event Registration]
|
||||||
|
service pa(server)[Premium Area]
|
||||||
|
service bb(server)[Black Board]
|
||||||
|
service i(database)[Interfaces]
|
||||||
|
|
||||||
|
service rs(server)[Report System]
|
||||||
|
|
||||||
|
rs:L --> R:i
|
||||||
|
|
||||||
|
junction i1
|
||||||
|
junction i2
|
||||||
|
i:T <-- B:i2
|
||||||
|
i1:L -- R:hof
|
||||||
|
i1:R -- L:er
|
||||||
|
i1:B -- T:i2
|
||||||
|
i2:L -- R:pa
|
||||||
|
i2:R -- L:bb
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user