mirror of
https://github.com/Wessel/Roommapper.git
synced 2026-07-21 07:23:56 +02:00
feat: Update UML diagram
This commit is contained in:
@@ -330,6 +330,20 @@ version: 3.1.0
|
||||
robot nogmaals herschrijven maar nu met de nieuwe libraries. Ook zullen alle
|
||||
benodigde routes geimplementeert worden om de Server set af te maken.
|
||||
|
||||
* [XVII 06-06-2024] UML diagrammen bijgewerkt
|
||||
Nu de broncode van de Server en WebUI compleet zijn heb ik de UML diagrammen
|
||||
bijgewerkt om overeen te komen met de broncode.
|
||||
|
||||
* [XVII 11-06-2024] Route planning toegevoegd
|
||||
Nu er met Tom afgepsroken is om de routes net zoals de objecten op te slaan,
|
||||
heb ik een endpoint gemaakt die het zelfde werkt als de mapping, maar dan voor
|
||||
de routes. Ook heb ik een endpoint gemaakt die de route op de kaart tekent
|
||||
voor de webUI.
|
||||
|
||||
** Map identificatie
|
||||
In eerste instantie gebruikte ik steeds de `Id` van een map om hem te
|
||||
identificeren. In de praktijk is dit helemaal niet handig, dus daarom ben ik
|
||||
overgestapt op het gebruik van gebruiker invulbare namen. Dit maakt het veel
|
||||
makkelijker om een bepaalde map te laten zien.
|
||||
|
||||
* [XVII 15-06-2024] UML diagrammen bijgewerkt
|
||||
Nu de broncode van de Server compleet zijn heb ik de UML diagrammen
|
||||
bijgewerkt om overeen te komen met de broncode. Ook heb ik de desbetreffende
|
||||
modules bij elkaar gegroepeerd en de correcte lijntjes getrokken.
|
||||
|
||||
BIN
media/Server/UML/class-diagram-v3.vpp
Normal file
BIN
media/Server/UML/class-diagram-v3.vpp
Normal file
Binary file not shown.
@@ -1,10 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="dataSourceStorageLocal" created-in="RD-241.15989.179">
|
||||
<component name="dataSourceStorageLocal" created-in="RD-241.14494.307">
|
||||
<data-source name="roommapper@localhost" uuid="469f6bec-f113-4467-9d39-7ac38558045a">
|
||||
<database-info product="Cassandra" version="3.0.8" jdbc-version="4.2" driver-name="Cassandra JDBC Driver" driver-version="1.4" dbms="CASSANDRA" exact-version="3.0.8" exact-driver-version="1.4">
|
||||
<identifier-quote-string>"</identifier-quote-string>
|
||||
<jdbc-catalog-is-schema>true</jdbc-catalog-is-schema>
|
||||
</database-info>
|
||||
<case-sensitivity plain-identifiers="lower" quoted-identifiers="exact" />
|
||||
<secret-storage>master_key</secret-storage>
|
||||
|
||||
72
src/Server/.idea/.idea.REST API/.idea/workspace.xml
generated
72
src/Server/.idea/.idea.REST API/.idea/workspace.xml
generated
@@ -8,15 +8,26 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="79f184c3-e88e-45be-9116-5fa813562754" name="Changes" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.REST API/.idea/dataSources.local.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.REST API/.idea/dataSources.local.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.REST API/.idea/dataSources/469f6bec-f113-4467-9d39-7ac38558045a.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.REST API/.idea/dataSources/469f6bec-f113-4467-9d39-7ac38558045a.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.REST API/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.REST API/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Console/JsonClasses/Database.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Console/JsonClasses/Database.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Console/Program.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Console/Program.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Console/Routes/RouteDatabase.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Console/Routes/RouteDatabase.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Console/Routes/RoutePath.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Console/Routes/RoutePath.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Console/Routes/RouteControl.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Console/Routes/RouteControl.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Console/bin/Debug/net8.0/Console.dll" beforeDir="false" afterPath="$PROJECT_DIR$/Console/bin/Debug/net8.0/Console.dll" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Console/bin/Debug/net8.0/Console.exe" beforeDir="false" afterPath="$PROJECT_DIR$/Console/bin/Debug/net8.0/Console.exe" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Console/bin/Debug/net8.0/Console.pdb" beforeDir="false" afterPath="$PROJECT_DIR$/Console/bin/Debug/net8.0/Console.pdb" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/../Web/src/components/mapCanvas.jsx" beforeDir="false" afterPath="$PROJECT_DIR$/../Web/src/components/mapCanvas.jsx" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Console/bin/Debug/net8.0/LibParse.dll" beforeDir="false" afterPath="$PROJECT_DIR$/Console/bin/Debug/net8.0/LibParse.dll" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Console/bin/Debug/net8.0/LibParse.pdb" beforeDir="false" afterPath="$PROJECT_DIR$/Console/bin/Debug/net8.0/LibParse.pdb" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Console/bin/Debug/net8.0/LibServer.dll" beforeDir="false" afterPath="$PROJECT_DIR$/Console/bin/Debug/net8.0/LibServer.dll" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Console/bin/Debug/net8.0/LibServer.pdb" beforeDir="false" afterPath="$PROJECT_DIR$/Console/bin/Debug/net8.0/LibServer.pdb" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/LibParse/bin/Debug/net8.0/LibParse.dll" beforeDir="false" afterPath="$PROJECT_DIR$/LibParse/bin/Debug/net8.0/LibParse.dll" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/LibParse/bin/Debug/net8.0/LibParse.pdb" beforeDir="false" afterPath="$PROJECT_DIR$/LibParse/bin/Debug/net8.0/LibParse.pdb" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/LibServer/Http/Request.cs" beforeDir="false" afterPath="$PROJECT_DIR$/LibServer/Http/Request.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/LibServer/Router/Route.cs" beforeDir="false" afterPath="$PROJECT_DIR$/LibServer/Router/Route.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/LibServer/bin/Debug/net8.0/LibServer.dll" beforeDir="false" afterPath="$PROJECT_DIR$/LibServer/bin/Debug/net8.0/LibServer.dll" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/LibServer/bin/Debug/net8.0/LibServer.pdb" beforeDir="false" afterPath="$PROJECT_DIR$/LibServer/bin/Debug/net8.0/LibServer.pdb" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/REST API.sln.DotSettings.user" beforeDir="false" afterPath="$PROJECT_DIR$/REST API.sln.DotSettings.user" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Tests/bin/Debug/net8.0/CoverletSourceRootsMapping_Tests" beforeDir="false" afterPath="$PROJECT_DIR$/Tests/bin/Debug/net8.0/CoverletSourceRootsMapping_Tests" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@@ -30,6 +41,8 @@
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/../.." />
|
||||
</component>
|
||||
<component name="HighlightingSettingsPerFile">
|
||||
<setting file="file://$USER_HOME$/AppData/Local/Symbols/src/dotnet/runtime/3b8b000a0e115700b18265d8ec8c6307056dc94d/src/coreclr/System.Private.CoreLib/src/System/Object.CoreCLR.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$USER_HOME$/AppData/Local/Symbols/src/dotnet/runtime/3b8b000a0e115700b18265d8ec8c6307056dc94d/src/libraries/System.Private.CoreLib/src/System/Object.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/Console/Program.cs" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/LibCassandra/Class1.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/LibServer/LibServer.cs" root0="FORCE_HIGHLIGHTING" />
|
||||
@@ -44,35 +57,35 @@
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
".NET Project.Console.executor": "Run",
|
||||
"ASKED_ADD_EXTERNAL_FILES": "true",
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"d452b4e4-aa15-4fa9-847f-33d4d7fab23d.executor": "Run",
|
||||
"git-widget-placeholder": "master",
|
||||
"ignore.virus.scanning.warn.message": "true",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"settings.editor.selected.configurable": "HotReloadSettingsPage",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
".NET Project.Console.executor": "Run",
|
||||
"ASKED_ADD_EXTERNAL_FILES": "true",
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"d452b4e4-aa15-4fa9-847f-33d4d7fab23d.executor": "Run",
|
||||
"git-widget-placeholder": "master",
|
||||
"ignore.virus.scanning.warn.message": "true",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"settings.editor.selected.configurable": "HotReloadSettingsPage",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
},
|
||||
"keyToStringList": {
|
||||
"DatabaseDriversLRU": [
|
||||
"cassandra"
|
||||
"keyToStringList": {
|
||||
"DatabaseDriversLRU": [
|
||||
"cassandra"
|
||||
],
|
||||
"rider.external.source.directories": [
|
||||
"/home/wessel/.config/JetBrains/Rider2024.1/resharper-host/DecompilerCache",
|
||||
"/home/wessel/.config/JetBrains/Rider2024.1/resharper-host/SourcesCache",
|
||||
"/home/wessel/.local/share/Symbols/src"
|
||||
"rider.external.source.directories": [
|
||||
"C:\\Users\\wesse\\AppData\\Roaming\\JetBrains\\Rider2024.1\\resharper-host\\DecompilerCache",
|
||||
"C:\\Users\\wesse\\AppData\\Roaming\\JetBrains\\Rider2024.1\\resharper-host\\SourcesCache",
|
||||
"C:\\Users\\wesse\\AppData\\Local\\Symbols\\src"
|
||||
]
|
||||
}
|
||||
}</component>
|
||||
<component name="RunManager">
|
||||
}]]></component>
|
||||
<component name="RunManager" selected=".NET Project.Console">
|
||||
<configuration name="Console" type="DotNetProject" factoryName=".NET Project">
|
||||
<option name="EXE_PATH" value="$PROJECT_DIR$/Console/bin/Debug/net8.0/Console.exe" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
@@ -124,6 +137,7 @@
|
||||
<workItem from="1717670832494" duration="901000" />
|
||||
<workItem from="1717673464254" duration="1428000" />
|
||||
<workItem from="1718093417281" duration="4387000" />
|
||||
<workItem from="1718443610193" duration="8065000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
|
||||
@@ -7,13 +7,7 @@ using Cassandra;
|
||||
|
||||
internal static class Program {
|
||||
public static void Main() {
|
||||
var cluster = Cluster.Builder()
|
||||
.AddContactPoints("127.0.0.1")
|
||||
.WithPort(9042)
|
||||
.Build();
|
||||
var cassandraSession = cluster.Connect();
|
||||
|
||||
InitializeDatabase(cassandraSession);
|
||||
var cassandraSession = InitializeDatabase();
|
||||
|
||||
Dictionary<string, IRoute> routes = new() {
|
||||
{ "", new Root() },
|
||||
@@ -34,7 +28,13 @@ internal static class Program {
|
||||
}
|
||||
}
|
||||
|
||||
private static void InitializeDatabase(ISession session) {
|
||||
private static ISession InitializeDatabase() {
|
||||
var cluster = Cluster.Builder()
|
||||
.AddContactPoints("127.0.0.1")
|
||||
.WithPort(9042)
|
||||
.Build();
|
||||
var session = cluster.Connect();
|
||||
|
||||
session.Execute(@"CREATE KEYSPACE IF NOT EXISTS roommapper
|
||||
WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'datacenter1' : 1 };");
|
||||
session.Execute(@"
|
||||
@@ -53,5 +53,7 @@ internal static class Program {
|
||||
Path text,
|
||||
PRIMARY KEY (Id)
|
||||
)");
|
||||
|
||||
return session;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,14 +56,14 @@ public class RouteControl: IRoute {
|
||||
}
|
||||
|
||||
// @todo(wessel): Rewrite, move to other class
|
||||
public void SendHttpRequest(string Host, string body, string method, string route) {
|
||||
private void SendHttpRequest(string target, string body, string method, string route) {
|
||||
using (TcpClient client = new TcpClient()) {
|
||||
string[] host = Host.Split(":");
|
||||
string[] host = target.Split(":");
|
||||
client.Connect(host[0], int.Parse(host[1].Split("/")[0]));
|
||||
|
||||
using (NetworkStream stream = client.GetStream()) {
|
||||
string httpRequestMessage = $"{method} {route} HTTP/1.1\r\n" +
|
||||
$"Host: {Host}\r\n" +
|
||||
$"Host: {target}\r\n" +
|
||||
$"Content-Length: {body.Length}\r\n" +
|
||||
"\r\n" +
|
||||
$"{body}";
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -4,17 +4,16 @@ public class HttpRequest {
|
||||
private const string LogPrefix = "\u001b[47m[ WWW ]\u001b[0m";
|
||||
|
||||
public string? Route;
|
||||
public string? _httpVersion, _host, _body, _header;
|
||||
public Method? _method;
|
||||
public Dictionary<string, string> QueryString = new();
|
||||
private string? _httpVersion, _host, _header;
|
||||
public readonly Dictionary<string, string> QueryString = new();
|
||||
|
||||
public Method? Method => _method;
|
||||
public string? Body => _body;
|
||||
public Method? Method { get; private set; }
|
||||
public string? Body { get; private set; }
|
||||
|
||||
public int Parse(string raw) {
|
||||
// _body starts after 2 new lines, cast to `_body`
|
||||
var body = raw.Split("\r\n\r\n");
|
||||
_body = body.Length > 1 ? string.Join("\r\n\r\n", body.Skip(1).ToArray()) : "";
|
||||
Body = body.Length > 1 ? string.Join("\r\n\r\n", body.Skip(1).ToArray()) : "";
|
||||
|
||||
// Split the raw request into parts (one line per part)
|
||||
var parts = raw.Split("\r\n");
|
||||
@@ -27,7 +26,7 @@ public class HttpRequest {
|
||||
if (i == 0) {
|
||||
if (!parts[0].Contains("HTTP")) return -1;
|
||||
var first = parts[0].Split(" ");
|
||||
_method = MethodClass.StringToMethod(first[0].ToUpper());
|
||||
Method = MethodClass.StringToMethod(first[0].ToUpper());
|
||||
Route = first[1];
|
||||
_httpVersion = first[2].Split("/")[1];
|
||||
} else {
|
||||
@@ -67,8 +66,8 @@ public class HttpRequest {
|
||||
Console.WriteLine("{0} _httpVersion:\t{1}", LogPrefix, _httpVersion);
|
||||
Console.WriteLine("{0} _host:\t\t{1}", LogPrefix, _host);
|
||||
Console.WriteLine("{0} Route:\t\t{1}", LogPrefix, Route);
|
||||
Console.WriteLine("{0} _method:\t\t{1}", LogPrefix, _method);
|
||||
Console.WriteLine("{0} _method:\t\t{1}", LogPrefix, Method);
|
||||
Console.WriteLine("{0} _headers:\n{1}", LogPrefix, _header);
|
||||
Console.WriteLine("{0} _body:\n{1}", LogPrefix, _body);
|
||||
Console.WriteLine("{0} _body:\n{1}", LogPrefix, Body);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace LibServer.Router;
|
||||
|
||||
using LibServer.Http;
|
||||
using Http;
|
||||
|
||||
public interface IRoute {
|
||||
public HttpResponse Get(HttpRequest _) { return MethodNotAllowed(); }
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:String x:Key="/Default/CodeInspection/PencilsConfiguration/ActualSeverity/@EntryValue">INFO</s:String>
|
||||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=d452b4e4_002Daa15_002D4fa9_002D847f_002D33d4d7fab23d/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" IsActive="True" Name="ParseJsonToAnonymousObject" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
||||
<Project Location="C:\Users\wesse\OneDrive - Hogeschool Inholland\roommapper\src\Server\Tests" Presentation="&lt;Tests&gt;" />
|
||||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=d452b4e4_002Daa15_002D4fa9_002D847f_002D33d4d7fab23d/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" IsActive="True" Name="ParseJsonToAnonymousObject" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
||||
<Project Location="C:\Users\wesse\OneDrive - Hogeschool Inholland\roommapper\src\Server\Tests" Presentation="&lt;Tests&gt;" />
|
||||
</SessionState></s:String></wpf:ResourceDictionary>
|
||||
Binary file not shown.
Reference in New Issue
Block a user