refractoring

This commit is contained in:
QkoSad
2024-12-05 12:09:30 +02:00
parent 926436860c
commit 80040638a6
37 changed files with 814 additions and 682 deletions
Binary file not shown.
Binary file not shown.
@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("backendCs.Test")] [assembly: System.Reflection.AssemblyCompanyAttribute("backendCs.Test")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+cb7b3ad94c91aad561fa90871a3e078e741f566c")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+926436860cd34dec9ccf3feac66e4c63bae7ba8f")]
[assembly: System.Reflection.AssemblyProductAttribute("backendCs.Test")] [assembly: System.Reflection.AssemblyProductAttribute("backendCs.Test")]
[assembly: System.Reflection.AssemblyTitleAttribute("backendCs.Test")] [assembly: System.Reflection.AssemblyTitleAttribute("backendCs.Test")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
@@ -1 +1 @@
d5818043832e259ded45b9771c78c909a325898a23799ca0c691beda0cd33197 52cff86724d2fd2424e9f1d9a690fe3422a59e7c4c8fd9c4b99335b5ce7acb7f
@@ -8,6 +8,6 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules = build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = backendCs.Test build_property.RootNamespace = backendCs.Test
build_property.ProjectDir = /home/arch/projects/wip/timelog-interview-login/backendCs.Tests/ build_property.ProjectDir = /home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/
build_property.EnableComHosting = build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop = build_property.EnableGeneratedComInterfaceComImportInterop =
@@ -218,3 +218,113 @@
/home/arch/projects/wip/timelog-interview-login/backendCs.Tests/obj/Debug/net8.0/backendCs.Test.pdb /home/arch/projects/wip/timelog-interview-login/backendCs.Tests/obj/Debug/net8.0/backendCs.Test.pdb
/home/arch/projects/wip/timelog-interview-login/backendCs.Tests/obj/Debug/net8.0/backendCs.Test.genruntimeconfig.cache /home/arch/projects/wip/timelog-interview-login/backendCs.Tests/obj/Debug/net8.0/backendCs.Test.genruntimeconfig.cache
/home/arch/projects/wip/timelog-interview-login/backendCs.Tests/obj/Debug/net8.0/ref/backendCs.Test.dll /home/arch/projects/wip/timelog-interview-login/backendCs.Tests/obj/Debug/net8.0/ref/backendCs.Test.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/Microsoft.TestPlatform.AdapterUtilities.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/backendCs.Test.deps.json
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/backendCs.Test.runtimeconfig.json
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/backendCs.Test.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/backendCs.Test.pdb
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/Microsoft.VisualStudio.CodeCoverage.Shim.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/Microsoft.TestPlatform.CoreUtilities.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/Microsoft.TestPlatform.PlatformAbstractions.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/Microsoft.VisualStudio.TestPlatform.ObjectModel.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/Microsoft.TestPlatform.CommunicationUtilities.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/Microsoft.TestPlatform.CrossPlatEngine.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/Microsoft.TestPlatform.Utilities.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/Microsoft.VisualStudio.TestPlatform.Common.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/testhost.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/Microsoft.VisualStudio.TestPlatform.TestFramework.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/Newtonsoft.Json.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/NuGet.Frameworks.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/cs/Microsoft.TestPlatform.CoreUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/cs/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/de/Microsoft.TestPlatform.CoreUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/de/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/es/Microsoft.TestPlatform.CoreUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/es/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/fr/Microsoft.TestPlatform.CoreUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/fr/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/it/Microsoft.TestPlatform.CoreUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/it/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/ja/Microsoft.TestPlatform.CoreUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/ja/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/ko/Microsoft.TestPlatform.CoreUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/ko/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/pl/Microsoft.TestPlatform.CoreUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/pl/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/pt-BR/Microsoft.TestPlatform.CoreUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/pt-BR/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/ru/Microsoft.TestPlatform.CoreUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/ru/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/tr/Microsoft.TestPlatform.CoreUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/tr/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/zh-Hans/Microsoft.TestPlatform.CoreUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/zh-Hans/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/zh-Hant/Microsoft.TestPlatform.CoreUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/zh-Hant/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/cs/Microsoft.TestPlatform.CommunicationUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/cs/Microsoft.TestPlatform.CrossPlatEngine.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/cs/Microsoft.VisualStudio.TestPlatform.Common.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/de/Microsoft.TestPlatform.CommunicationUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/de/Microsoft.TestPlatform.CrossPlatEngine.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/de/Microsoft.VisualStudio.TestPlatform.Common.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/es/Microsoft.TestPlatform.CommunicationUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/es/Microsoft.TestPlatform.CrossPlatEngine.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/es/Microsoft.VisualStudio.TestPlatform.Common.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/fr/Microsoft.TestPlatform.CommunicationUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/fr/Microsoft.TestPlatform.CrossPlatEngine.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/fr/Microsoft.VisualStudio.TestPlatform.Common.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/it/Microsoft.TestPlatform.CommunicationUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/it/Microsoft.TestPlatform.CrossPlatEngine.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/it/Microsoft.VisualStudio.TestPlatform.Common.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/ja/Microsoft.TestPlatform.CommunicationUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/ja/Microsoft.TestPlatform.CrossPlatEngine.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/ja/Microsoft.VisualStudio.TestPlatform.Common.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/ko/Microsoft.TestPlatform.CommunicationUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/ko/Microsoft.TestPlatform.CrossPlatEngine.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/ko/Microsoft.VisualStudio.TestPlatform.Common.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/pl/Microsoft.TestPlatform.CommunicationUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/pl/Microsoft.TestPlatform.CrossPlatEngine.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/pl/Microsoft.VisualStudio.TestPlatform.Common.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/pt-BR/Microsoft.TestPlatform.CommunicationUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/pt-BR/Microsoft.TestPlatform.CrossPlatEngine.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/pt-BR/Microsoft.VisualStudio.TestPlatform.Common.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/ru/Microsoft.TestPlatform.CommunicationUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/ru/Microsoft.TestPlatform.CrossPlatEngine.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/ru/Microsoft.VisualStudio.TestPlatform.Common.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/tr/Microsoft.TestPlatform.CommunicationUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/tr/Microsoft.TestPlatform.CrossPlatEngine.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/tr/Microsoft.VisualStudio.TestPlatform.Common.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/zh-Hans/Microsoft.TestPlatform.CommunicationUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/zh-Hans/Microsoft.TestPlatform.CrossPlatEngine.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/zh-Hans/Microsoft.VisualStudio.TestPlatform.Common.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/zh-Hant/Microsoft.TestPlatform.CommunicationUtilities.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/zh-Hant/Microsoft.TestPlatform.CrossPlatEngine.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/zh-Hant/Microsoft.VisualStudio.TestPlatform.Common.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/cs/Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/de/Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/es/Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/fr/Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/it/Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/ja/Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/ko/Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/pl/Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/pt-BR/Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/ru/Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/tr/Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/zh-Hans/Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/zh-Hant/Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/bin/Debug/net8.0/Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.xml
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/obj/Debug/net8.0/backendCs.Test.csproj.AssemblyReference.cache
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/obj/Debug/net8.0/backendCs.Test.GeneratedMSBuildEditorConfig.editorconfig
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/obj/Debug/net8.0/backendCs.Test.AssemblyInfoInputs.cache
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/obj/Debug/net8.0/backendCs.Test.AssemblyInfo.cs
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/obj/Debug/net8.0/backendCs.Test.csproj.CoreCompileInputs.cache
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/obj/Debug/net8.0/backendCs.Test.csproj.CopyComplete
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/obj/Debug/net8.0/backendCs.Test.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/obj/Debug/net8.0/refint/backendCs.Test.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/obj/Debug/net8.0/backendCs.Test.pdb
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/obj/Debug/net8.0/backendCs.Test.genruntimeconfig.cache
/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/obj/Debug/net8.0/ref/backendCs.Test.dll
Binary file not shown.
@@ -1 +1 @@
d00baeaa72366c300b98f70a63e07318bcfbf2aac3aa8140adbf3514d041b139 44ffb3de93f5803a95865b1f18602ffa1a9e69b6b29642e60dde4719a8b98d5a
Binary file not shown.
@@ -1,17 +1,17 @@
{ {
"format": 1, "format": 1,
"restore": { "restore": {
"/home/arch/projects/wip/timelog-interview-login/backendCs.Tests/backendCs.Test.csproj": {} "/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/backendCs.Test.csproj": {}
}, },
"projects": { "projects": {
"/home/arch/projects/wip/timelog-interview-login/backendCs.Tests/backendCs.Test.csproj": { "/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/backendCs.Test.csproj": {
"version": "1.0.0", "version": "1.0.0",
"restore": { "restore": {
"projectUniqueName": "/home/arch/projects/wip/timelog-interview-login/backendCs.Tests/backendCs.Test.csproj", "projectUniqueName": "/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/backendCs.Test.csproj",
"projectName": "backendCs.Test", "projectName": "backendCs.Test",
"projectPath": "/home/arch/projects/wip/timelog-interview-login/backendCs.Tests/backendCs.Test.csproj", "projectPath": "/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/backendCs.Test.csproj",
"packagesPath": "/home/arch/.nuget/packages/", "packagesPath": "/home/arch/.nuget/packages/",
"outputPath": "/home/arch/projects/wip/timelog-interview-login/backendCs.Tests/obj/", "outputPath": "/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/obj/",
"projectStyle": "PackageReference", "projectStyle": "PackageReference",
"configFilePaths": [ "configFilePaths": [
"/home/arch/.nuget/NuGet/NuGet.Config" "/home/arch/.nuget/NuGet/NuGet.Config"
+3 -3
View File
@@ -1074,11 +1074,11 @@
"project": { "project": {
"version": "1.0.0", "version": "1.0.0",
"restore": { "restore": {
"projectUniqueName": "/home/arch/projects/wip/timelog-interview-login/backendCs.Tests/backendCs.Test.csproj", "projectUniqueName": "/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/backendCs.Test.csproj",
"projectName": "backendCs.Test", "projectName": "backendCs.Test",
"projectPath": "/home/arch/projects/wip/timelog-interview-login/backendCs.Tests/backendCs.Test.csproj", "projectPath": "/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/backendCs.Test.csproj",
"packagesPath": "/home/arch/.nuget/packages/", "packagesPath": "/home/arch/.nuget/packages/",
"outputPath": "/home/arch/projects/wip/timelog-interview-login/backendCs.Tests/obj/", "outputPath": "/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/obj/",
"projectStyle": "PackageReference", "projectStyle": "PackageReference",
"configFilePaths": [ "configFilePaths": [
"/home/arch/.nuget/NuGet/NuGet.Config" "/home/arch/.nuget/NuGet/NuGet.Config"
+2 -2
View File
@@ -1,8 +1,8 @@
{ {
"version": 2, "version": 2,
"dgSpecHash": "MZ1XesT3wmy51PIeGVUHDrPKvcZQbJPK8azHwfm2TlnGmdOSh+BLO5idLCALy5ldv/F004Vk+wySJwTZrnTuCw==", "dgSpecHash": "Vow09WffKk6/6DguUqZNKmUYQdDCPGVBuip3M7OhLkceXUGI4wJgx+a7soIu/yv29h91cY3hReluc8rAg5j2ug==",
"success": true, "success": true,
"projectFilePath": "/home/arch/projects/wip/timelog-interview-login/backendCs.Tests/backendCs.Test.csproj", "projectFilePath": "/home/arch/projects/unfinished/timelog-interview-login/backendCs.Tests/backendCs.Test.csproj",
"expectedPackageFiles": [ "expectedPackageFiles": [
"/home/arch/.nuget/packages/coverlet.collector/6.0.0/coverlet.collector.6.0.0.nupkg.sha512", "/home/arch/.nuget/packages/coverlet.collector/6.0.0/coverlet.collector.6.0.0.nupkg.sha512",
"/home/arch/.nuget/packages/microsoft.codecoverage/17.6.0/microsoft.codecoverage.17.6.0.nupkg.sha512", "/home/arch/.nuget/packages/microsoft.codecoverage/17.6.0/microsoft.codecoverage.17.6.0.nupkg.sha512",
+6 -7
View File
@@ -1,10 +1,10 @@
using System.Net; using System.Net;
using System.Text; using System.Text;
namespace Server namespace Server;
class Program
{ {
class Program
{
static void HandleMissingPath(HttpListenerResponse response) static void HandleMissingPath(HttpListenerResponse response)
{ {
response.StatusCode = 404; response.StatusCode = 404;
@@ -19,7 +19,7 @@ namespace Server
static void Main() static void Main()
{ {
// create server // create server
HttpListener listener = new HttpListener(); HttpListener listener = new();
// routes need to be added first // routes need to be added first
listener.Prefixes.Add("http://localhost:5000/api/getall/"); listener.Prefixes.Add("http://localhost:5000/api/getall/");
listener.Prefixes.Add("http://localhost:5000/api/gettopten/"); listener.Prefixes.Add("http://localhost:5000/api/gettopten/");
@@ -50,7 +50,7 @@ namespace Server
switch (uri) switch (uri)
{ {
case "/api/reset": case "/api/reset":
Reset.HandleRequest(request, response); Reset.HandleRequest(response);
break; break;
case "/api/getall": case "/api/getall":
/* Thread clientThread = new Thread(() => Getall.HandleRequest(request, response)); */ /* Thread clientThread = new Thread(() => Getall.HandleRequest(request, response)); */
@@ -64,7 +64,7 @@ namespace Server
Getuser.HandleRequest(request, response); Getuser.HandleRequest(request, response);
break; break;
case "/api/createp": case "/api/createp":
CreateProcedure.HandleRequest(request, response); CreateProcedure.HandleRequest(response);
break; break;
default: default:
HandleMissingPath(response); HandleMissingPath(response);
@@ -99,5 +99,4 @@ namespace Server
} }
} }
} }
}
} }
Binary file not shown.
Binary file not shown.
@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("TimelogBackend")] [assembly: System.Reflection.AssemblyCompanyAttribute("TimelogBackend")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+cb7b3ad94c91aad561fa90871a3e078e741f566c")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+926436860cd34dec9ccf3feac66e4c63bae7ba8f")]
[assembly: System.Reflection.AssemblyProductAttribute("TimelogBackend")] [assembly: System.Reflection.AssemblyProductAttribute("TimelogBackend")]
[assembly: System.Reflection.AssemblyTitleAttribute("TimelogBackend")] [assembly: System.Reflection.AssemblyTitleAttribute("TimelogBackend")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
@@ -1 +1 @@
21ebdfea2f4ecbc0e48a6b53f27fa496a20e08b7ed0ace43e5500d5093c8a245 4d078ebec60178a78b052888e79c6e658ccc73953d1f8ba236008a06ecc632b9
@@ -117,3 +117,46 @@
/home/arch/projects/wip/timelog-interview-login/backendCs/bin/Debug/net8.0/Microsoft.IdentityModel.Logging.dll /home/arch/projects/wip/timelog-interview-login/backendCs/bin/Debug/net8.0/Microsoft.IdentityModel.Logging.dll
/home/arch/projects/wip/timelog-interview-login/backendCs/bin/Debug/net8.0/Microsoft.IdentityModel.Tokens.dll /home/arch/projects/wip/timelog-interview-login/backendCs/bin/Debug/net8.0/Microsoft.IdentityModel.Tokens.dll
/home/arch/projects/wip/timelog-interview-login/backendCs/bin/Debug/net8.0/System.IdentityModel.Tokens.Jwt.dll /home/arch/projects/wip/timelog-interview-login/backendCs/bin/Debug/net8.0/System.IdentityModel.Tokens.Jwt.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/obj/Debug/net8.0/TimelogBackend.csproj.AssemblyReference.cache
/home/arch/projects/unfinished/timelog-interview-login/backendCs/obj/Debug/net8.0/TimelogBackend.GeneratedMSBuildEditorConfig.editorconfig
/home/arch/projects/unfinished/timelog-interview-login/backendCs/obj/Debug/net8.0/TimelogBackend.AssemblyInfoInputs.cache
/home/arch/projects/unfinished/timelog-interview-login/backendCs/obj/Debug/net8.0/TimelogBackend.AssemblyInfo.cs
/home/arch/projects/unfinished/timelog-interview-login/backendCs/obj/Debug/net8.0/TimelogBackend.csproj.CoreCompileInputs.cache
/home/arch/projects/unfinished/timelog-interview-login/backendCs/obj/Debug/net8.0/TimelogBackend.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/obj/Debug/net8.0/refint/TimelogBackend.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/obj/Debug/net8.0/TimelogBackend.pdb
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/TimelogBackend
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/TimelogBackend.deps.json
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/TimelogBackend.runtimeconfig.json
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/TimelogBackend.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/TimelogBackend.pdb
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/BouncyCastle.Cryptography.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/Google.Protobuf.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/K4os.Compression.LZ4.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/K4os.Compression.LZ4.Streams.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/K4os.Hash.xxHash.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/Microsoft.IdentityModel.Abstractions.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/Microsoft.IdentityModel.JsonWebTokens.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/Microsoft.IdentityModel.Logging.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/Microsoft.IdentityModel.Tokens.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/MySql.Data.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/Newtonsoft.Json.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/System.Configuration.ConfigurationManager.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/System.Diagnostics.EventLog.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/System.IdentityModel.Tokens.Jwt.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/System.IO.Pipelines.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/System.Security.Cryptography.ProtectedData.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/System.Security.Permissions.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/System.Windows.Extensions.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/ZstdSharp.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/runtimes/win-x64/native/comerr64.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/runtimes/win-x64/native/gssapi64.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/runtimes/win-x64/native/k5sprt64.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/runtimes/win-x64/native/krb5_64.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/runtimes/win-x64/native/krbcc64.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/runtimes/win/lib/net8.0/System.Diagnostics.EventLog.Messages.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/runtimes/win/lib/net8.0/System.Diagnostics.EventLog.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/bin/Debug/net8.0/runtimes/win/lib/net8.0/System.Windows.Extensions.dll
/home/arch/projects/unfinished/timelog-interview-login/backendCs/obj/Debug/net8.0/TimelogBackend.csproj.CopyComplete
/home/arch/projects/unfinished/timelog-interview-login/backendCs/obj/Debug/net8.0/TimelogBackend.genruntimeconfig.cache
/home/arch/projects/unfinished/timelog-interview-login/backendCs/obj/Debug/net8.0/ref/TimelogBackend.dll
Binary file not shown.
@@ -1 +1 @@
cabec8eef32bfb7a5e67f2b4ed57839edd7c13e8479c77f87a2d35ec66b02abb 6ce12d87876379d820297a17b33b1f57ff3987d74bed581fb7ebcc8c73660966
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,17 +1,17 @@
{ {
"format": 1, "format": 1,
"restore": { "restore": {
"/home/arch/projects/wip/timelog-interview-login/backendCs/TimelogBackend.csproj": {} "/home/arch/projects/unfinished/timelog-interview-login/backendCs/TimelogBackend.csproj": {}
}, },
"projects": { "projects": {
"/home/arch/projects/wip/timelog-interview-login/backendCs/TimelogBackend.csproj": { "/home/arch/projects/unfinished/timelog-interview-login/backendCs/TimelogBackend.csproj": {
"version": "1.0.0", "version": "1.0.0",
"restore": { "restore": {
"projectUniqueName": "/home/arch/projects/wip/timelog-interview-login/backendCs/TimelogBackend.csproj", "projectUniqueName": "/home/arch/projects/unfinished/timelog-interview-login/backendCs/TimelogBackend.csproj",
"projectName": "TimelogBackend", "projectName": "TimelogBackend",
"projectPath": "/home/arch/projects/wip/timelog-interview-login/backendCs/TimelogBackend.csproj", "projectPath": "/home/arch/projects/unfinished/timelog-interview-login/backendCs/TimelogBackend.csproj",
"packagesPath": "/home/arch/.nuget/packages/", "packagesPath": "/home/arch/.nuget/packages/",
"outputPath": "/home/arch/projects/wip/timelog-interview-login/backendCs/obj/", "outputPath": "/home/arch/projects/unfinished/timelog-interview-login/backendCs/obj/",
"projectStyle": "PackageReference", "projectStyle": "PackageReference",
"configFilePaths": [ "configFilePaths": [
"/home/arch/.nuget/NuGet/NuGet.Config" "/home/arch/.nuget/NuGet/NuGet.Config"
+3 -3
View File
@@ -1857,11 +1857,11 @@
"project": { "project": {
"version": "1.0.0", "version": "1.0.0",
"restore": { "restore": {
"projectUniqueName": "/home/arch/projects/wip/timelog-interview-login/backendCs/TimelogBackend.csproj", "projectUniqueName": "/home/arch/projects/unfinished/timelog-interview-login/backendCs/TimelogBackend.csproj",
"projectName": "TimelogBackend", "projectName": "TimelogBackend",
"projectPath": "/home/arch/projects/wip/timelog-interview-login/backendCs/TimelogBackend.csproj", "projectPath": "/home/arch/projects/unfinished/timelog-interview-login/backendCs/TimelogBackend.csproj",
"packagesPath": "/home/arch/.nuget/packages/", "packagesPath": "/home/arch/.nuget/packages/",
"outputPath": "/home/arch/projects/wip/timelog-interview-login/backendCs/obj/", "outputPath": "/home/arch/projects/unfinished/timelog-interview-login/backendCs/obj/",
"projectStyle": "PackageReference", "projectStyle": "PackageReference",
"configFilePaths": [ "configFilePaths": [
"/home/arch/.nuget/NuGet/NuGet.Config" "/home/arch/.nuget/NuGet/NuGet.Config"
+2 -2
View File
@@ -1,8 +1,8 @@
{ {
"version": 2, "version": 2,
"dgSpecHash": "lhoNhBuhv5pZb43QtTahPtHclYQU5heHEQPyTVS7gTLS0zI+oKRmmyzvVbe56/iHd4Yw20shJvPbIdrCOp+Qug==", "dgSpecHash": "Kw1QiagALZErTv+cX8IjNVaHlG1vVsZ8jbQdO6NwgQJYGShK1fNvP3A258Ci81RECrzVlyi53zgZ5YHVjUaNOw==",
"success": true, "success": true,
"projectFilePath": "/home/arch/projects/wip/timelog-interview-login/backendCs/TimelogBackend.csproj", "projectFilePath": "/home/arch/projects/unfinished/timelog-interview-login/backendCs/TimelogBackend.csproj",
"expectedPackageFiles": [ "expectedPackageFiles": [
"/home/arch/.nuget/packages/bouncycastle.cryptography/2.3.1/bouncycastle.cryptography.2.3.1.nupkg.sha512", "/home/arch/.nuget/packages/bouncycastle.cryptography/2.3.1/bouncycastle.cryptography.2.3.1.nupkg.sha512",
"/home/arch/.nuget/packages/google.protobuf/3.26.1/google.protobuf.3.26.1.nupkg.sha512", "/home/arch/.nuget/packages/google.protobuf/3.26.1/google.protobuf.3.26.1.nupkg.sha512",
+3 -4
View File
@@ -6,10 +6,10 @@ using Microsoft.IdentityModel.Tokens;
using MySql.Data.MySqlClient; using MySql.Data.MySqlClient;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
namespace Server namespace Server;
public class CreateLog : Route
{ {
public class CreateLog : Route
{
private static string secretKey = private static string secretKey =
"stronk-key-much-sercret-much-more-stronk-stronk-key-much-sercret-much-more-stronk"; "stronk-key-much-sercret-much-more-stronk-stronk-key-much-sercret-much-more-stronk";
@@ -126,5 +126,4 @@ namespace Server
SendError(response, ex); SendError(response, ex);
} }
} }
}
} }
+6 -7
View File
@@ -1,17 +1,17 @@
using System.Net; using System.Net;
using MySql.Data.MySqlClient; using MySql.Data.MySqlClient;
namespace Server namespace Server;
public class CreateProcedure : Route
{ {
public class CreateProcedure : Route public static void HandleRequest(HttpListenerResponse response)
{
public static void HandleRequest(HttpListenerRequest request, HttpListenerResponse response)
{ {
try try
{ {
MySqlCommand cmd = new MySqlCommand(); MySqlCommand cmd = new();
using (MySqlConnection conn = new MySqlConnection(connectionString)) using (MySqlConnection conn = new(connectionString))
{ {
conn.Open(); conn.Open();
cmd.Connection = conn; cmd.Connection = conn;
@@ -126,5 +126,4 @@ BEGIN
SendError(response, ex); SendError(response, ex);
} }
} }
}
} }
+13 -14
View File
@@ -3,11 +3,11 @@ using System.Text.RegularExpressions;
using MySql.Data.MySqlClient; using MySql.Data.MySqlClient;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Server namespace Server;
// there should be a better way to deal with data comming from sql
public class Log
{ {
// there should be a better way to deal with data comming from sql
public class Log
{
public object? f_name { get; set; } public object? f_name { get; set; }
public object? l_name { get; set; } public object? l_name { get; set; }
public object? mail { get; set; } public object? mail { get; set; }
@@ -15,16 +15,16 @@ namespace Server
public object? time { get; set; } public object? time { get; set; }
public object? date { get; set; } public object? date { get; set; }
public object? user { get; set; } public object? user { get; set; }
} }
public class Getall : Route public class Getall : Route
{ {
public static void HandleRequest(HttpListenerRequest request, HttpListenerResponse response) public static void HandleRequest(HttpListenerRequest request, HttpListenerResponse response)
{ {
try try
{ {
// prepare SQL query // prepare SQL query
MySqlCommand cmd = new MySqlCommand(); MySqlCommand cmd = new();
// get url params // get url params
var queryString = request.QueryString; var queryString = request.QueryString;
string? from = queryString["from"]; string? from = queryString["from"];
@@ -53,8 +53,8 @@ namespace Server
} }
if (!string.IsNullOrEmpty(sortby)) if (!string.IsNullOrEmpty(sortby))
{ {
List<string> validSorting = new List<string> List<string> validSorting =
{ [
"f_name", "f_name",
"l_name", "l_name",
"mail", "mail",
@@ -62,7 +62,7 @@ namespace Server
"date", "date",
"user", "user",
"project", "project",
}; ];
if (!validSorting.Contains(sortby)) if (!validSorting.Contains(sortby))
{ {
throw new Exception("Incorrect sorting value"); throw new Exception("Incorrect sorting value");
@@ -78,14 +78,14 @@ namespace Server
cmd.Parameters.AddWithValue("@from", from); cmd.Parameters.AddWithValue("@from", from);
cmd.Parameters.AddWithValue("@to", to); cmd.Parameters.AddWithValue("@to", to);
using (MySqlConnection conn = new MySqlConnection(connectionString)) using (MySqlConnection conn = new(connectionString))
{ {
conn.Open(); conn.Open();
cmd.Connection = conn; cmd.Connection = conn;
// execute query and read results // execute query and read results
MySqlDataReader reader = cmd.ExecuteReader(); MySqlDataReader reader = cmd.ExecuteReader();
List<Log> entries = new List<Log>(); List<Log> entries = [];
while (reader.Read()) while (reader.Read())
{ {
entries.Add( entries.Add(
@@ -111,5 +111,4 @@ namespace Server
SendError(response, ex); SendError(response, ex);
} }
} }
}
} }
+9 -10
View File
@@ -3,10 +3,10 @@ using System.Text.RegularExpressions;
using MySql.Data.MySqlClient; using MySql.Data.MySqlClient;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Server namespace Server;
public class TopTen
{ {
public class TopTen
{
public object? user { get; set; } public object? user { get; set; }
public object? date { get; set; } public object? date { get; set; }
public object? project { get; set; } public object? project { get; set; }
@@ -14,16 +14,16 @@ namespace Server
public object? l_name { get; set; } public object? l_name { get; set; }
public object? name { get; set; } public object? name { get; set; }
public object? total_time { get; set; } public object? total_time { get; set; }
} }
public class Gettopten : Route public class Gettopten : Route
{ {
public static void HandleRequest(HttpListenerRequest request, HttpListenerResponse response) public static void HandleRequest(HttpListenerRequest request, HttpListenerResponse response)
{ {
try try
{ {
// prepare SQL query // prepare SQL query
MySqlCommand cmd = new MySqlCommand(); MySqlCommand cmd = new();
var queryString = request.QueryString; var queryString = request.QueryString;
string? from = queryString["from"]; string? from = queryString["from"];
string? to = queryString["to"]; string? to = queryString["to"];
@@ -66,13 +66,13 @@ namespace Server
cmd.Parameters.AddWithValue("@from", from); cmd.Parameters.AddWithValue("@from", from);
cmd.Parameters.AddWithValue("@to", to); cmd.Parameters.AddWithValue("@to", to);
using (MySqlConnection conn = new MySqlConnection(connectionString)) using (MySqlConnection conn = new(connectionString))
{ {
cmd.Connection = conn; cmd.Connection = conn;
conn.Open(); conn.Open();
// Execute the query and read the results // Execute the query and read the results
MySqlDataReader reader = cmd.ExecuteReader(); MySqlDataReader reader = cmd.ExecuteReader();
List<TopTen> entries = new List<TopTen>(); List<TopTen> entries = [];
while (reader.Read()) while (reader.Read())
{ {
entries.Add( entries.Add(
@@ -99,5 +99,4 @@ namespace Server
SendError(response, ex); SendError(response, ex);
} }
} }
}
} }
+9 -8
View File
@@ -3,10 +3,10 @@ using System.Net;
using MySql.Data.MySqlClient; using MySql.Data.MySqlClient;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace Server namespace Server;
public class Getuser : Route
{ {
public class Getuser : Route
{
public static void HandleRequest(HttpListenerRequest request, HttpListenerResponse response) public static void HandleRequest(HttpListenerRequest request, HttpListenerResponse response)
{ {
try try
@@ -18,17 +18,19 @@ namespace Server
throw new Exception("Missing userid"); throw new Exception("Missing userid");
} }
// prepare SQL query // prepare SQL query
MySqlCommand cmd = new MySqlCommand(); MySqlCommand cmd = new()
cmd.CommandText = {
CommandText =
@"SELECT p.name, SUM(t.time) @"SELECT p.name, SUM(t.time)
FROM Timelog t FROM Timelog t
INNER JOIN Project p ON p.id=t.project INNER JOIN Project p ON p.id=t.project
INNER JOIN User u ON u.id=t.user INNER JOIN User u ON u.id=t.user
WHERE User = @userid WHERE User = @userid
GROUP BY name;"; GROUP BY name;",
};
cmd.Parameters.AddWithValue("@userid", userid); cmd.Parameters.AddWithValue("@userid", userid);
using (MySqlConnection conn = new MySqlConnection(connectionString)) using (MySqlConnection conn = new(connectionString))
{ {
conn.Open(); conn.Open();
cmd.Connection = conn; cmd.Connection = conn;
@@ -52,5 +54,4 @@ namespace Server
SendError(response, ex); SendError(response, ex);
} }
} }
}
} }
+10 -14
View File
@@ -8,10 +8,10 @@ using MySql.Data.MySqlClient;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
namespace Server namespace Server;
public class Login : Route
{ {
public class Login : Route
{
private static string secretKey = private static string secretKey =
"stronk-key-much-sercret-much-more-stronk-stronk-key-much-sercret-much-more-stronk"; "stronk-key-much-sercret-much-more-stronk-stronk-key-much-sercret-much-more-stronk";
@@ -67,12 +67,7 @@ namespace Server
{ {
// extract data from body // extract data from body
string body; string body;
using ( using (StreamReader bodyReader = new(request.InputStream, request.ContentEncoding))
StreamReader bodyReader = new StreamReader(
request.InputStream,
request.ContentEncoding
)
)
{ {
body = bodyReader.ReadToEnd(); body = bodyReader.ReadToEnd();
} }
@@ -81,14 +76,16 @@ namespace Server
string password = jsonObject["password"]?.ToString() ?? ""; string password = jsonObject["password"]?.ToString() ?? "";
// prepare SQL query // prepare SQL query
MySqlCommand cmd = new MySqlCommand(); MySqlCommand cmd = new()
cmd.CommandText = {
CommandText =
@"SELECT u.id, password FROM User u @"SELECT u.id, password FROM User u
INNER JOIN Password p ON p.user=u.id INNER JOIN Password p ON p.user=u.id
WHERE mail=@mail;"; WHERE mail=@mail;",
};
cmd.Parameters.AddWithValue("@mail", mail); cmd.Parameters.AddWithValue("@mail", mail);
using (MySqlConnection conn = new MySqlConnection(connectionString)) using (MySqlConnection conn = new(connectionString))
{ {
cmd.Connection = conn; cmd.Connection = conn;
conn.Open(); conn.Open();
@@ -129,5 +126,4 @@ namespace Server
SendError(response, ex); SendError(response, ex);
} }
} }
}
} }
+11 -22
View File
@@ -3,20 +3,17 @@ using System.Security.Cryptography;
using MySql.Data.MySqlClient; using MySql.Data.MySqlClient;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
namespace Server namespace Server;
public class Register : Route
{ {
public class Register : Route
{
private static string HashPassword(string password) private static string HashPassword(string password)
{ {
// Generate a salt // Generate a salt
byte[] salt = new byte[16]; byte[] salt = new byte[16];
RandomNumberGenerator.Fill(salt); RandomNumberGenerator.Fill(salt);
// Create a PBKDF2 instance to hash the password // Create a PBKDF2 instance to hash the password
using ( using var pbkdf2 = new Rfc2898DeriveBytes(password, salt, 10000, HashAlgorithmName.SHA256);
var pbkdf2 = new Rfc2898DeriveBytes(password, salt, 10000, HashAlgorithmName.SHA256)
)
{
byte[] hash = pbkdf2.GetBytes(32); byte[] hash = pbkdf2.GetBytes(32);
// Combine the salt and the hash together // Combine the salt and the hash together
@@ -27,7 +24,6 @@ namespace Server
// Return the final hash as a Base64 encoded string // Return the final hash as a Base64 encoded string
return Convert.ToBase64String(hashBytes); return Convert.ToBase64String(hashBytes);
} }
}
public static void HandleRequest(HttpListenerRequest request, HttpListenerResponse response) public static void HandleRequest(HttpListenerRequest request, HttpListenerResponse response)
{ {
@@ -36,12 +32,7 @@ namespace Server
{ {
// extract parameters from req body // extract parameters from req body
string body; string body;
using ( using (StreamReader bodyReader = new(request.InputStream, request.ContentEncoding))
StreamReader bodyReader = new StreamReader(
request.InputStream,
request.ContentEncoding
)
)
{ {
body = bodyReader.ReadToEnd(); body = bodyReader.ReadToEnd();
} }
@@ -71,16 +62,16 @@ namespace Server
} }
// open connection // open connection
// prepare SQL query // prepare SQL query
MySqlCommand cmd = new MySqlCommand(); MySqlCommand cmd = new()
{
// Insert into User // Insert into User
cmd.CommandText = CommandText = "INSERT INTO User(f_name,l_name,mail) VALUES(@f_name,@l_name,@mail)",
"INSERT INTO User(f_name,l_name,mail) VALUES(@f_name,@l_name,@mail)"; };
cmd.Parameters.AddWithValue("@f_name", f_name); cmd.Parameters.AddWithValue("@f_name", f_name);
cmd.Parameters.AddWithValue("@l_name", l_name); cmd.Parameters.AddWithValue("@l_name", l_name);
cmd.Parameters.AddWithValue("@mail", mail); cmd.Parameters.AddWithValue("@mail", mail);
using (MySqlConnection conn = new MySqlConnection(connectionString)) using (MySqlConnection conn = new(connectionString))
{ {
conn.Open(); conn.Open();
transaction = conn.BeginTransaction(); transaction = conn.BeginTransaction();
@@ -106,10 +97,8 @@ namespace Server
} }
catch (Exception ex) catch (Exception ex)
{ {
if (transaction != null) transaction?.Rollback();
transaction.Rollback();
SendError(response, ex); SendError(response, ex);
} }
} }
}
} }
+5 -7
View File
@@ -1,17 +1,16 @@
using System.Net; using System.Net;
using MySql.Data.MySqlClient; using MySql.Data.MySqlClient;
namespace Server namespace Server;
public class Reset : Route
{ {
public class Reset : Route public static void HandleRequest(HttpListenerResponse response)
{
public static void HandleRequest(HttpListenerRequest request, HttpListenerResponse response)
{ {
try try
{ {
// prepare SQL query // prepare SQL query
MySqlCommand cmd = new MySqlCommand(); MySqlCommand cmd = new() { CommandText = "CALL InitDB" };
cmd.CommandText = "CALL InitDB";
using (MySqlConnection conn = new MySqlConnection(connectionString)) using (MySqlConnection conn = new MySqlConnection(connectionString))
{ {
cmd.Connection = conn; cmd.Connection = conn;
@@ -28,5 +27,4 @@ namespace Server
SendError(response, ex); SendError(response, ex);
} }
} }
}
} }