20 Commits

Author SHA1 Message Date
3cc6eba28e New: Construct Parameter List
All checks were successful
release-nuget-package / Release NuGet Package (push) Successful in 42s
2026-02-19 17:49:19 +01:00
831e9fd8eb Add UserName to IReportable.cs
All checks were successful
release-nuget-package / Release NuGet Package (push) Successful in 38s
2026-02-15 22:22:17 +01:00
af03d37760 Remove Debug output 2026-02-15 22:20:08 +01:00
0738a230a3 CI: dynamic versions
All checks were successful
release-nuget-package / Release NuGet Package (push) Successful in 27s
2026-02-14 00:03:24 +01:00
c1370b1f71 CI: Possible naming collition
Some checks failed
release-nuget-package / Release NuGet Package (push) Failing after 26s
2026-02-13 23:55:05 +01:00
613b1e1843 CI: Fix: Use correct name
Some checks failed
release-nuget-package / Release NuGet Package (push) Failing after 25s
2026-02-13 23:48:44 +01:00
df9bf69405 CI: Debugging
Some checks failed
release-nuget-package / Release NuGet Package (push) Failing after 31s
2026-02-13 23:44:04 +01:00
38aedff5c2 CI: Go back to valid bash
Some checks failed
release-nuget-package / Release NuGet Package (push) Failing after 35s
2026-02-13 20:33:15 +01:00
a798ee544e CI: Variablen testen
Some checks failed
release-nuget-package / Release NuGet Package (push) Failing after 25s
2026-02-13 20:30:47 +01:00
aece91aff0 CI: Print Vars and add source
Some checks failed
release-nuget-package / Release NuGet Package (push) Failing after 27s
2026-02-13 20:13:48 +01:00
b1786eb578 CI: fix dotnet nuget list source
Some checks failed
release-nuget-package / Release NuGet Package (push) Failing after 28s
2026-02-13 20:00:44 +01:00
79d7058e66 Fix: release.sh - okay, dass war peinlich
Some checks failed
release-nuget-package / Release NuGet Package (push) Failing after 29s
2026-02-13 19:54:54 +01:00
81fc40cca9 Fix: expectations of .nuspec
Some checks failed
release-nuget-package / Release NuGet Package (push) Failing after 28s
2026-02-13 19:52:28 +01:00
a8f46089c4 CI: Package Interfaces as nuget package
Some checks failed
release-nuget-package / Release NuGet Package (push) Failing after 27s
2026-02-13 19:41:57 +01:00
491838491a Add shellscripts referenced in c469ba486f 2026-02-13 19:06:03 +01:00
908fc0df1b DOKU: Kommentare für IReportable.cs, IReportingHandler.cs und IReportUI.cs 2026-02-13 19:04:37 +01:00
88b676ab80 New: IReportUI zum Bereitstellen einer Razor Komponente über Microsoft.DI, welche dann von anderen Modulen importiert werden können. 2026-02-13 18:50:41 +01:00
c469ba486f New: run debug and release scripts, on dotnet build 2026-02-13 18:48:57 +01:00
839b044fc6 New: README.md 2026-02-13 18:48:10 +01:00
fb0506e6b7 Report: Add note saving Support 2026-02-12 22:02:20 +01:00
11 changed files with 187 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
name: release-nuget-package
on:
push:
tags:
- '*'
jobs:
build:
name: Release NuGet Package
runs-on: ubuntu-latest
steps:
- name: "Git clone"
run: git clone ${{ gitea.server_url }}/${{ gitea.repository }}.git .
- name: "Git checkout"
run: git checkout "${{ gitea.sha }}"
- name: "Dotnet SDK einrichten"
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
- name: "Configure nuget source"
run: dotnet nuget add source --name DAV --username kocoder --password ${{ secrets.REGISTRY_TOKEN_KOCODER }} https://git.kocoder.xyz/api/packages/Diplomarbeit-Absolventenverein/nuget/index.json --store-password-in-clear-text
- name: "Build Interfaces Project"
run: dotnet build -c PublishNuget ./Interfaces/Interfaces.csproj
- name: "Release to Package Registry"
run: dotnet nuget push --source DAV --api-key ${{ secrets.REGISTRY_TOKEN_KOCODER }} ./Interfaces/Interfaces.*.nupkg
- name: "Create release"
uses: akkuman/gitea-release-action@v1
with:
files: |-
./alumnihub.deb
./alumnihub/opt/alumnihub/Packages/*.nupkg

28
Interfaces/IReportUI.cs Normal file
View File

@@ -0,0 +1,28 @@
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; }
/// <summary>
/// Constructs a list of parameters to be passed to the component.
/// </summary>
/// <param name="reportableEntity">The entity to be reported.</param>
/// <param name="RenderModeBoundary">The render mode boundary.</param>
/// <returns>A dictionary of parameters. For </returns>
Dictionary<string, object> ConstructParameterList(IReportable reportableEntity, object RenderModeBoundary);
}

View File

@@ -1,8 +1,32 @@
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
{
/// <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; }
/// <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; }
/// <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; }
/// <summary>
/// The UserName of the user who published the Entity (and who should be held accountible for that Entity).
/// </summary>
public string UserName { get; }
}

View File

@@ -1,6 +1,19 @@
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 void Report(IReportable reportable);
/// <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);
}

View File

@@ -6,4 +6,10 @@
<Nullable>enable</Nullable>
</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' OR '$(Configuration)' == 'PublishNuget')" Command="release.cmd $(TargetFramework) $([System.String]::Copy('$(MSBuildProjectName)').Replace('.Package','')) '$(Configuration)'" />
<Exec Condition="'$(OS)' != 'Windows_NT' And ('$(Configuration)' == 'Release' OR '$(Configuration)' == 'PublishNuget')" Command="bash $(ProjectDir)release.sh $(TargetFramework) $([System.String]::Copy('$(MSBuildProjectName)').Replace('.Package','')) '$(Configuration)'" />
</Target>
</Project>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>$projectname$</id>
<version>$version$</version>
<authors>SZUAbsolventenverein</authors>
<owners>SZUAbsolventenverein</owners>
<title>Interfaces</title>
<description>Interfaces</description>
<copyright>SZUAbsolventenverein</copyright>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<releaseNotes></releaseNotes>
<summary></summary>
<packageTypes>
<packageType name="Dependency" />
</packageTypes>
</metadata>
<files>
<file src="./bin\$Config$\$targetframework$\$ProjectName$.dll" target="lib\$targetframework$" />
<file src="./bin\$Config$\$targetframework$\$ProjectName$.pdb" target="lib\$targetframework$" />
</files>
</package>

6
Interfaces/debug.cmd Normal file
View File

@@ -0,0 +1,6 @@
@echo off
set TargetFramework=%1
set ProjectName=%2
XCOPY "\bin\Debug\%TargetFramework%\%ProjectName%.dll" "..\..\oqtane.framework\Oqtane.Server\bin\Debug\%TargetFramework%\" /Y
XCOPY "\bin\Debug\%TargetFramework%\%ProjectName%.pdb" "..\..\oqtane.framework\Oqtane.Server\bin\Debug\%TargetFramework%\" /Y

7
Interfaces/debug.sh Normal file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
TargetFramework=$1
ProjectName=$2
cp -f "./bin/Debug/$TargetFramework/$ProjectName.dll" "../../oqtane.framework/Oqtane.Server/bin/Debug/$TargetFramework/"
cp -f "./bin/Debug/$TargetFramework/$ProjectName.pdb" "../../oqtane.framework/Oqtane.Server/bin/Debug/$TargetFramework/"

7
Interfaces/release.cmd Normal file
View File

@@ -0,0 +1,7 @@
@echo off
set TargetFramework=%1
set ProjectName=%2
del "*.nupkg"
"..\..\oqtane.framework\oqtane.package\nuget.exe" pack %ProjectName%.nuspec -Properties targetframework=%TargetFramework%;projectname=%ProjectName%
XCOPY "*.nupkg" "..\..\oqtane.framework\Oqtane.Server\Packages\" /Y

16
Interfaces/release.sh Normal file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
TargetFramework=$1
ProjectName=$2
Configuration=$3
echo "ENV: ${TargetFramework} ${ProjectName} ${Configuration} RN: ${GITHUB_REF_NAME}"
find . -name *.nupkg -delete
dotnet pack $ProjectName.nuspec "/p:targetframework=${TargetFramework};ProjectName=${ProjectName};Config=${Configuration};version=${GITHUB_REF_NAME}"
if [ $Configuration == 'PublishNuget' ]; then
echo "Skipping copy to Oqtane.Server/Packages"
else
echo "Copy to Oqtane.Server/Packages"
cp -f *.nupkg ../../oqtane.framework/Oqtane.Server/Packages/
fi

25
README.md Normal file
View 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
```