From fccd30a22394128f06195031ca5805a9dc4366dc Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Mon, 29 May 2023 21:16:50 -0600 Subject: [PATCH] Removed more unnecessary files from cache - Updated `.gitignore` - Added `README.md` file --- .gitignore | 3 + README.md | 9 + client/Program.cs | 6 +- obj/project.assets.json | 606 +++++++++++++++++++++++++- obj/project.nuget.cache | 100 ----- qrreader.csproj | 3 + server/Properties/launchSettings.json | 6 +- server/QrScannerController.cs | 34 +- server/QrScannerModel.cs | 5 +- server/server.csproj | 3 + 10 files changed, 656 insertions(+), 119 deletions(-) create mode 100644 README.md delete mode 100644 obj/project.nuget.cache diff --git a/.gitignore b/.gitignore index 0d3116b..a546281 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ client/bin/* client/obj/* server/bin/* server/obj/* +*.editorconfig +project.nuget.cache +qrread.csproj.nuget.dgspec.json diff --git a/README.md b/README.md new file mode 100644 index 0000000..60d47ad --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# Remote QR Scanner in .NET and Python + +Scan QR codes and send them back to a server. Uses .NET 6 to build the server and client and python. + +Run the server or client: +```bash +dotnet run --project server +dotnet run --project client +``` \ No newline at end of file diff --git a/client/Program.cs b/client/Program.cs index 5b61400..6c7f07c 100644 --- a/client/Program.cs +++ b/client/Program.cs @@ -2,15 +2,15 @@ using System.IO; using System.Diagnostics; using System.Net.Http.Headers; - - +using System.Reflection; namespace QrScanner{ class Program{ static async Task run_scan(){ + string path = Path.Combine(Environment.CurrentDirectory, "client/qr_scan2.py"); Process p = new Process(); - p.StartInfo = new ProcessStartInfo("/usr/bin/bpython", "client/qr_scan2.py") + p.StartInfo = new ProcessStartInfo("/usr/bin/bpython", path) { RedirectStandardOutput = true, UseShellExecute = false, diff --git a/obj/project.assets.json b/obj/project.assets.json index ceb61ea..9d9daca 100644 --- a/obj/project.assets.json +++ b/obj/project.assets.json @@ -60,6 +60,22 @@ "lib/AForge.Video.DirectShow.dll": {} } }, + "DnsClient/1.6.1": { + "type": "package", + "dependencies": { + "Microsoft.Win32.Registry": "5.0.0" + }, + "compile": { + "lib/net5.0/DnsClient.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net5.0/DnsClient.dll": { + "related": ".xml" + } + } + }, "Emgu.CV/4.6.0.5131": { "type": "package", "dependencies": { @@ -262,6 +278,19 @@ } } }, + "Microsoft.Extensions.Logging.Abstractions/2.0.0": { + "type": "package", + "compile": { + "lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.dll": { + "related": ".xml" + } + } + }, "Microsoft.NETCore.Platforms/5.0.0": { "type": "package", "compile": { @@ -280,6 +309,29 @@ "lib/netstandard1.0/_._": {} } }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "ref/netstandard2.0/Microsoft.Win32.Registry.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Win32.Registry.dll": { + "related": ".xml" + } + }, + "runtimeTargets": { + "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, "Microsoft.Win32.SystemEvents/6.0.0": { "type": "package", "compile": { @@ -302,6 +354,97 @@ } } }, + "MongoDB.Bson/2.18.0": { + "type": "package", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "compile": { + "lib/netstandard2.1/MongoDB.Bson.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.1/MongoDB.Bson.dll": { + "related": ".xml" + } + } + }, + "MongoDB.Driver/2.18.0": { + "type": "package", + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "2.0.0", + "MongoDB.Bson": "2.18.0", + "MongoDB.Driver.Core": "2.18.0", + "MongoDB.Libmongocrypt": "1.6.0" + }, + "compile": { + "lib/netstandard2.1/MongoDB.Driver.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.1/MongoDB.Driver.dll": { + "related": ".xml" + } + } + }, + "MongoDB.Driver.Core/2.18.0": { + "type": "package", + "dependencies": { + "DnsClient": "1.6.1", + "Microsoft.Extensions.Logging.Abstractions": "2.0.0", + "MongoDB.Bson": "2.18.0", + "MongoDB.Libmongocrypt": "1.6.0", + "SharpCompress": "0.30.1", + "Snappier": "1.0.0", + "System.Buffers": "4.5.1", + "ZstdSharp.Port": "0.6.2" + }, + "compile": { + "lib/netstandard2.1/MongoDB.Driver.Core.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.1/MongoDB.Driver.Core.dll": { + "related": ".xml" + } + } + }, + "MongoDB.Libmongocrypt/1.6.0": { + "type": "package", + "compile": { + "lib/netstandard2.1/MongoDB.Libmongocrypt.dll": {} + }, + "runtime": { + "lib/netstandard2.1/MongoDB.Libmongocrypt.dll": {} + }, + "contentFiles": { + "contentFiles/any/any/_._": { + "buildAction": "None", + "codeLanguage": "any", + "copyToOutput": false + } + }, + "build": { + "build/_._": {} + }, + "runtimeTargets": { + "runtimes/linux/native/libmongocrypt.so": { + "assetType": "native", + "rid": "linux" + }, + "runtimes/osx/native/libmongocrypt.dylib": { + "assetType": "native", + "rid": "osx" + }, + "runtimes/win/native/mongocrypt.dll": { + "assetType": "native", + "rid": "win" + } + } + }, "runtime.native.System/4.3.0": { "type": "package", "dependencies": { @@ -315,6 +458,15 @@ "lib/netstandard1.0/_._": {} } }, + "SharpCompress/0.30.1": { + "type": "package", + "compile": { + "lib/net5.0/SharpCompress.dll": {} + }, + "runtime": { + "lib/net5.0/SharpCompress.dll": {} + } + }, "SixLabors.ImageSharp/2.1.3": { "type": "package", "dependencies": { @@ -332,6 +484,28 @@ } } }, + "Snappier/1.0.0": { + "type": "package", + "compile": { + "lib/net5.0/Snappier.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net5.0/Snappier.dll": { + "related": ".xml" + } + } + }, + "System.Buffers/4.5.1": { + "type": "package", + "compile": { + "ref/netcoreapp2.0/_._": {} + }, + "runtime": { + "lib/netcoreapp2.0/_._": {} + } + }, "System.Drawing.Common/6.0.0": { "type": "package", "dependencies": { @@ -568,6 +742,52 @@ } } }, + "System.Security.AccessControl/5.0.0": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "ref/netstandard2.0/System.Security.AccessControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Security.AccessControl.dll": { + "related": ".xml" + } + }, + "runtimeTargets": { + "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "compile": { + "ref/netcoreapp3.0/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + }, + "runtimeTargets": { + "runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.dll": { + "assetType": "runtime", + "rid": "unix" + }, + "runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.dll": { + "assetType": "runtime", + "rid": "win" + } + } + }, "System.Text.Encoding/4.3.0": { "type": "package", "dependencies": { @@ -631,6 +851,15 @@ } } }, + "ZstdSharp.Port/0.6.2": { + "type": "package", + "compile": { + "lib/net6.0/ZstdSharp.dll": {} + }, + "runtime": { + "lib/net6.0/ZstdSharp.dll": {} + } + }, "ZXing.Net/0.16.8": { "type": "package", "compile": { @@ -729,6 +958,30 @@ "lib/AForge.Video.DirectShow.xml" ] }, + "DnsClient/1.6.1": { + "sha512": "4H/f2uYJOZ+YObZjpY9ABrKZI+JNw3uizp6oMzTXwDw6F+2qIPhpRl/1t68O/6e98+vqNiYGu+lswmwdYUy3gg==", + "type": "package", + "path": "dnsclient/1.6.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "dnsclient.1.6.1.nupkg.sha512", + "dnsclient.nuspec", + "icon.png", + "lib/net45/DnsClient.dll", + "lib/net45/DnsClient.xml", + "lib/net471/DnsClient.dll", + "lib/net471/DnsClient.xml", + "lib/net5.0/DnsClient.dll", + "lib/net5.0/DnsClient.xml", + "lib/netstandard1.3/DnsClient.dll", + "lib/netstandard1.3/DnsClient.xml", + "lib/netstandard2.0/DnsClient.dll", + "lib/netstandard2.0/DnsClient.xml", + "lib/netstandard2.1/DnsClient.dll", + "lib/netstandard2.1/DnsClient.xml" + ] + }, "Emgu.CV/4.6.0.5131": { "sha512": "pRtYFTe+IZBoxm79cfkAS2QHnmLiz6upyKJNUnxUyVrOlw+QoLL7lx1siXCruvOVU5wkxCqOCBYDHnDNBSURsQ==", "type": "package", @@ -939,6 +1192,19 @@ "lib/netstandard2.1/FlashCap.Core.xml" ] }, + "Microsoft.Extensions.Logging.Abstractions/2.0.0": { + "sha512": "6ZCllUYGFukkymSTx3Yr0G/ajRxoNJp7/FqSxSB4fGISST54ifBhgu4Nc0ItGi3i6DqwuNd8SUyObmiC++AO2Q==", + "type": "package", + "path": "microsoft.extensions.logging.abstractions/2.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.dll", + "lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.xml", + "microsoft.extensions.logging.abstractions.2.0.0.nupkg.sha512", + "microsoft.extensions.logging.abstractions.nuspec" + ] + }, "Microsoft.NETCore.Platforms/5.0.0": { "sha512": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==", "type": "package", @@ -972,6 +1238,50 @@ "runtime.json" ] }, + "Microsoft.Win32.Registry/5.0.0": { + "sha512": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "type": "package", + "path": "microsoft.win32.registry/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net46/Microsoft.Win32.Registry.dll", + "lib/net461/Microsoft.Win32.Registry.dll", + "lib/net461/Microsoft.Win32.Registry.xml", + "lib/netstandard1.3/Microsoft.Win32.Registry.dll", + "lib/netstandard2.0/Microsoft.Win32.Registry.dll", + "lib/netstandard2.0/Microsoft.Win32.Registry.xml", + "microsoft.win32.registry.5.0.0.nupkg.sha512", + "microsoft.win32.registry.nuspec", + "ref/net46/Microsoft.Win32.Registry.dll", + "ref/net461/Microsoft.Win32.Registry.dll", + "ref/net461/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/Microsoft.Win32.Registry.dll", + "ref/netstandard1.3/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/de/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/es/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/fr/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/it/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/ja/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/ko/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/ru/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/zh-hans/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/zh-hant/Microsoft.Win32.Registry.xml", + "ref/netstandard2.0/Microsoft.Win32.Registry.dll", + "ref/netstandard2.0/Microsoft.Win32.Registry.xml", + "runtimes/win/lib/net46/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/net461/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/net461/Microsoft.Win32.Registry.xml", + "runtimes/win/lib/netstandard1.3/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.xml", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, "Microsoft.Win32.SystemEvents/6.0.0": { "sha512": "hqTM5628jSsQiv+HGpiq3WKBl2c8v1KZfby2J6Pr7pEPlK9waPdgEO6b8A/+/xn/yZ9ulv8HuqK71ONy2tg67A==", "type": "package", @@ -1001,6 +1311,95 @@ "useSharedDesignerContext.txt" ] }, + "MongoDB.Bson/2.18.0": { + "sha512": "iyiVjkCAZIUiyYDZXXUqISeW7n3O/qcM90PUeJybryg7g4rXhSMRY0oLpAg+NdoXD/Qm9LlmVIePAluHQB91tQ==", + "type": "package", + "path": "mongodb.bson/2.18.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "License.txt", + "lib/net472/MongoDB.Bson.dll", + "lib/net472/MongoDB.Bson.xml", + "lib/netstandard2.0/MongoDB.Bson.dll", + "lib/netstandard2.0/MongoDB.Bson.xml", + "lib/netstandard2.1/MongoDB.Bson.dll", + "lib/netstandard2.1/MongoDB.Bson.xml", + "mongodb.bson.2.18.0.nupkg.sha512", + "mongodb.bson.nuspec", + "packageIcon.png" + ] + }, + "MongoDB.Driver/2.18.0": { + "sha512": "nq7wRMeNoqUe+bndHFMDGX8IY3iSmzLoyLzzf8DRos137O+5R4NCsd9qtw/n+DoGFas0gzzyD546Cpz+5AkmLg==", + "type": "package", + "path": "mongodb.driver/2.18.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "License.txt", + "lib/net472/MongoDB.Driver.dll", + "lib/net472/MongoDB.Driver.xml", + "lib/netstandard2.0/MongoDB.Driver.dll", + "lib/netstandard2.0/MongoDB.Driver.xml", + "lib/netstandard2.1/MongoDB.Driver.dll", + "lib/netstandard2.1/MongoDB.Driver.xml", + "mongodb.driver.2.18.0.nupkg.sha512", + "mongodb.driver.nuspec", + "packageIcon.png" + ] + }, + "MongoDB.Driver.Core/2.18.0": { + "sha512": "/X5Ty32gyDyzs/fWFwKGS0QUhfQT3V9Sc/F8yhILBu8bjCjBscOFKQsKieAha8xxBnYS7dZvTvhvEJWT7HgJ1g==", + "type": "package", + "path": "mongodb.driver.core/2.18.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "License.txt", + "THIRD-PARTY-NOTICES", + "lib/net472/MongoDB.Driver.Core.dll", + "lib/net472/MongoDB.Driver.Core.xml", + "lib/netstandard2.0/MongoDB.Driver.Core.dll", + "lib/netstandard2.0/MongoDB.Driver.Core.xml", + "lib/netstandard2.1/MongoDB.Driver.Core.dll", + "lib/netstandard2.1/MongoDB.Driver.Core.xml", + "mongodb.driver.core.2.18.0.nupkg.sha512", + "mongodb.driver.core.nuspec", + "packageIcon.png" + ] + }, + "MongoDB.Libmongocrypt/1.6.0": { + "sha512": "kh+MMf+ECIf5sQDIqOdKBd75ktD5aD1EuzCX3R4HOUGPlAbeAm8harf4zwlbvFe2BLfCXZO7HajSABLf4P0GNg==", + "type": "package", + "path": "mongodb.libmongocrypt/1.6.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "License.txt", + "build/MongoDB.Libmongocrypt.targets", + "content/libmongocrypt.dylib", + "content/libmongocrypt.so", + "content/mongocrypt.dll", + "contentFiles/any/net472/libmongocrypt.dylib", + "contentFiles/any/net472/libmongocrypt.so", + "contentFiles/any/net472/mongocrypt.dll", + "contentFiles/any/netstandard2.0/libmongocrypt.dylib", + "contentFiles/any/netstandard2.0/libmongocrypt.so", + "contentFiles/any/netstandard2.0/mongocrypt.dll", + "contentFiles/any/netstandard2.1/libmongocrypt.dylib", + "contentFiles/any/netstandard2.1/libmongocrypt.so", + "contentFiles/any/netstandard2.1/mongocrypt.dll", + "lib/net472/MongoDB.Libmongocrypt.dll", + "lib/netstandard2.0/MongoDB.Libmongocrypt.dll", + "lib/netstandard2.1/MongoDB.Libmongocrypt.dll", + "mongodb.libmongocrypt.1.6.0.nupkg.sha512", + "mongodb.libmongocrypt.nuspec", + "runtimes/linux/native/libmongocrypt.so", + "runtimes/osx/native/libmongocrypt.dylib", + "runtimes/win/native/mongocrypt.dll" + ] + }, "runtime.native.System/4.3.0": { "sha512": "c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", "type": "package", @@ -1015,6 +1414,22 @@ "runtime.native.system.nuspec" ] }, + "SharpCompress/0.30.1": { + "sha512": "XqD4TpfyYGa7QTPzaGlMVbcecKnXy4YmYLDWrU+JIj7IuRNl7DH2END+Ll7ekWIY8o3dAMWLFDE1xdhfIWD1nw==", + "type": "package", + "path": "sharpcompress/0.30.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/SharpCompress.dll", + "lib/net5.0/SharpCompress.dll", + "lib/netcoreapp3.1/SharpCompress.dll", + "lib/netstandard2.0/SharpCompress.dll", + "lib/netstandard2.1/SharpCompress.dll", + "sharpcompress.0.30.1.nupkg.sha512", + "sharpcompress.nuspec" + ] + }, "SixLabors.ImageSharp/2.1.3": { "sha512": "8yonNRWX3vUE9k29ta0Hbfa0AEc0hbDjSH/nZ3vOTJEXmY6hLnGsjDKoz96Z+AgOsrdkAu6PdL/Ebaf70aitzw==", "type": "package", @@ -1037,6 +1452,57 @@ "sixlabors.imagesharp.nuspec" ] }, + "Snappier/1.0.0": { + "sha512": "rFtK2KEI9hIe8gtx3a0YDXdHOpedIf9wYCEYtBEmtlyiWVX3XlCNV03JrmmAi/Cdfn7dxK+k0sjjcLv4fpHnqA==", + "type": "package", + "path": "snappier/1.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "COPYING.txt", + "lib/net5.0/Snappier.dll", + "lib/net5.0/Snappier.xml", + "lib/netcoreapp3.0/Snappier.dll", + "lib/netcoreapp3.0/Snappier.xml", + "lib/netstandard2.0/Snappier.dll", + "lib/netstandard2.0/Snappier.xml", + "lib/netstandard2.1/Snappier.dll", + "lib/netstandard2.1/Snappier.xml", + "snappier.1.0.0.nupkg.sha512", + "snappier.nuspec" + ] + }, + "System.Buffers/4.5.1": { + "sha512": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "type": "package", + "path": "system.buffers/4.5.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/System.Buffers.dll", + "lib/net461/System.Buffers.xml", + "lib/netcoreapp2.0/_._", + "lib/netstandard1.1/System.Buffers.dll", + "lib/netstandard1.1/System.Buffers.xml", + "lib/netstandard2.0/System.Buffers.dll", + "lib/netstandard2.0/System.Buffers.xml", + "lib/uap10.0.16299/_._", + "ref/net45/System.Buffers.dll", + "ref/net45/System.Buffers.xml", + "ref/netcoreapp2.0/_._", + "ref/netstandard1.1/System.Buffers.dll", + "ref/netstandard1.1/System.Buffers.xml", + "ref/netstandard2.0/System.Buffers.dll", + "ref/netstandard2.0/System.Buffers.xml", + "ref/uap10.0.16299/_._", + "system.buffers.4.5.1.nupkg.sha512", + "system.buffers.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, "System.Drawing.Common/6.0.0": { "sha512": "NfuoKUiP2nUWwKZN6twGqXioIe1zVD0RIj2t976A+czLHr2nY454RwwXs6JU9Htc6mwqL6Dn/nEL3dpVf2jOhg==", "type": "package", @@ -1906,6 +2372,108 @@ "system.runtime.interopservices.runtimeinformation.nuspec" ] }, + "System.Security.AccessControl/5.0.0": { + "sha512": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "type": "package", + "path": "system.security.accesscontrol/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net46/System.Security.AccessControl.dll", + "lib/net461/System.Security.AccessControl.dll", + "lib/net461/System.Security.AccessControl.xml", + "lib/netstandard1.3/System.Security.AccessControl.dll", + "lib/netstandard2.0/System.Security.AccessControl.dll", + "lib/netstandard2.0/System.Security.AccessControl.xml", + "lib/uap10.0.16299/_._", + "ref/net46/System.Security.AccessControl.dll", + "ref/net461/System.Security.AccessControl.dll", + "ref/net461/System.Security.AccessControl.xml", + "ref/netstandard1.3/System.Security.AccessControl.dll", + "ref/netstandard1.3/System.Security.AccessControl.xml", + "ref/netstandard1.3/de/System.Security.AccessControl.xml", + "ref/netstandard1.3/es/System.Security.AccessControl.xml", + "ref/netstandard1.3/fr/System.Security.AccessControl.xml", + "ref/netstandard1.3/it/System.Security.AccessControl.xml", + "ref/netstandard1.3/ja/System.Security.AccessControl.xml", + "ref/netstandard1.3/ko/System.Security.AccessControl.xml", + "ref/netstandard1.3/ru/System.Security.AccessControl.xml", + "ref/netstandard1.3/zh-hans/System.Security.AccessControl.xml", + "ref/netstandard1.3/zh-hant/System.Security.AccessControl.xml", + "ref/netstandard2.0/System.Security.AccessControl.dll", + "ref/netstandard2.0/System.Security.AccessControl.xml", + "ref/uap10.0.16299/_._", + "runtimes/win/lib/net46/System.Security.AccessControl.dll", + "runtimes/win/lib/net461/System.Security.AccessControl.dll", + "runtimes/win/lib/net461/System.Security.AccessControl.xml", + "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll", + "runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.xml", + "runtimes/win/lib/netstandard1.3/System.Security.AccessControl.dll", + "runtimes/win/lib/uap10.0.16299/_._", + "system.security.accesscontrol.5.0.0.nupkg.sha512", + "system.security.accesscontrol.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Security.Principal.Windows/5.0.0": { + "sha512": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==", + "type": "package", + "path": "system.security.principal.windows/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net46/System.Security.Principal.Windows.dll", + "lib/net461/System.Security.Principal.Windows.dll", + "lib/net461/System.Security.Principal.Windows.xml", + "lib/netstandard1.3/System.Security.Principal.Windows.dll", + "lib/netstandard2.0/System.Security.Principal.Windows.dll", + "lib/netstandard2.0/System.Security.Principal.Windows.xml", + "lib/uap10.0.16299/_._", + "ref/net46/System.Security.Principal.Windows.dll", + "ref/net461/System.Security.Principal.Windows.dll", + "ref/net461/System.Security.Principal.Windows.xml", + "ref/netcoreapp3.0/System.Security.Principal.Windows.dll", + "ref/netcoreapp3.0/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/System.Security.Principal.Windows.dll", + "ref/netstandard1.3/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/de/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/es/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/fr/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/it/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ja/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ko/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ru/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/zh-hans/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/zh-hant/System.Security.Principal.Windows.xml", + "ref/netstandard2.0/System.Security.Principal.Windows.dll", + "ref/netstandard2.0/System.Security.Principal.Windows.xml", + "ref/uap10.0.16299/_._", + "runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.dll", + "runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.xml", + "runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.dll", + "runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.xml", + "runtimes/win/lib/net46/System.Security.Principal.Windows.dll", + "runtimes/win/lib/net461/System.Security.Principal.Windows.dll", + "runtimes/win/lib/net461/System.Security.Principal.Windows.xml", + "runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.dll", + "runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.xml", + "runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.dll", + "runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.xml", + "runtimes/win/lib/netstandard1.3/System.Security.Principal.Windows.dll", + "runtimes/win/lib/uap10.0.16299/_._", + "system.security.principal.windows.5.0.0.nupkg.sha512", + "system.security.principal.windows.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, "System.Text.Encoding/4.3.0": { "sha512": "BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", "type": "package", @@ -2154,6 +2722,23 @@ "system.threading.tasks.nuspec" ] }, + "ZstdSharp.Port/0.6.2": { + "sha512": "jPao/LdUNLUz8rn3H1D8W7wQbZsRZM0iayvWI4xGejJg3XJHT56gcmYdgmCGPdJF1UEBqUjucCRrFB+4HbJsbw==", + "type": "package", + "path": "zstdsharp.port/0.6.2", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net461/ZstdSharp.dll", + "lib/net5.0/ZstdSharp.dll", + "lib/net6.0/ZstdSharp.dll", + "lib/netcoreapp3.1/ZstdSharp.dll", + "lib/netstandard2.0/ZstdSharp.dll", + "lib/netstandard2.1/ZstdSharp.dll", + "zstdsharp.port.0.6.2.nupkg.sha512", + "zstdsharp.port.nuspec" + ] + }, "ZXing.Net/0.16.8": { "sha512": "Cbbe+x7I7E+VJ0VxU1fPc7AktIw/9xea/ZY/fh38sXqTQ75LJp9ooGUjpzFqfpPfIKozAoXgJ4yvY4GzKpPBzQ==", "type": "package", @@ -2277,6 +2862,9 @@ "Emgu.CV.Bitmap >= 4.6.0.5131", "Emgu.CV.runtime.windows >= 4.6.0.5131", "FlashCap >= 1.4.0", + "MongoDB.Bson >= 2.18.0", + "MongoDB.Driver >= 2.18.0", + "MongoDB.Driver.Core >= 2.18.0", "SixLabors.ImageSharp >= 2.1.3", "System.Reactive >= 5.0.0", "ZXing.Net >= 0.16.8", @@ -2290,11 +2878,11 @@ "project": { "version": "1.0.0", "restore": { - "projectUniqueName": "/home/david/Projects/qrreader/qrreader.csproj", + "projectUniqueName": "/home/david/Projects/qr_scanner/qrreader.csproj", "projectName": "qrreader", - "projectPath": "/home/david/Projects/qrreader/qrreader.csproj", + "projectPath": "/home/david/Projects/qr_scanner/qrreader.csproj", "packagesPath": "/home/david/.nuget/packages/", - "outputPath": "/home/david/Projects/qrreader/obj/", + "outputPath": "/home/david/Projects/qr_scanner/obj/", "projectStyle": "PackageReference", "fallbackFolders": [ "/home/david/.local/share/godot/mono/GodotNuGetFallbackFolder" @@ -2361,6 +2949,18 @@ "target": "Package", "version": "[1.4.0, )" }, + "MongoDB.Bson": { + "target": "Package", + "version": "[2.18.0, )" + }, + "MongoDB.Driver": { + "target": "Package", + "version": "[2.18.0, )" + }, + "MongoDB.Driver.Core": { + "target": "Package", + "version": "[2.18.0, )" + }, "SixLabors.ImageSharp": { "target": "Package", "version": "[2.1.3, )" diff --git a/obj/project.nuget.cache b/obj/project.nuget.cache deleted file mode 100644 index f860241..0000000 --- a/obj/project.nuget.cache +++ /dev/null @@ -1,100 +0,0 @@ -{ - "version": 2, - "dgSpecHash": "nFSLV0NHH8CPR1cNOhQWG75UORYL/Pn1kzUBNPsUYxhqaUrMbmXlwfDHoOysrTE8Hs/HxJpfw/q0iwNWv92O/A==", - "success": true, - "projectFilePath": "/home/david/Projects/qrreader/qrreader.csproj", - "expectedPackageFiles": [ - "/home/david/.nuget/packages/aforge/2.2.5/aforge.2.2.5.nupkg.sha512", - "/home/david/.nuget/packages/aforge.imaging/2.2.5/aforge.imaging.2.2.5.nupkg.sha512", - "/home/david/.nuget/packages/aforge.math/2.2.5/aforge.math.2.2.5.nupkg.sha512", - "/home/david/.nuget/packages/aforge.video/2.2.5/aforge.video.2.2.5.nupkg.sha512", - "/home/david/.nuget/packages/aforge.video.directshow/2.2.5/aforge.video.directshow.2.2.5.nupkg.sha512", - "/home/david/.nuget/packages/emgu.cv/4.6.0.5131/emgu.cv.4.6.0.5131.nupkg.sha512", - "/home/david/.nuget/packages/emgu.cv.bitmap/4.6.0.5131/emgu.cv.bitmap.4.6.0.5131.nupkg.sha512", - "/home/david/.nuget/packages/emgu.cv.runtime.windows/4.6.0.5131/emgu.cv.runtime.windows.4.6.0.5131.nupkg.sha512", - "/home/david/.nuget/packages/emgu.runtime.windows.msvc.rt.arm64/19.33.31630/emgu.runtime.windows.msvc.rt.arm64.19.33.31630.nupkg.sha512", - "/home/david/.nuget/packages/emgu.runtime.windows.msvc.rt.x64/19.33.31630/emgu.runtime.windows.msvc.rt.x64.19.33.31630.nupkg.sha512", - "/home/david/.nuget/packages/emgu.runtime.windows.msvc.rt.x86/19.33.31630/emgu.runtime.windows.msvc.rt.x86.19.33.31630.nupkg.sha512", - "/home/david/.nuget/packages/flashcap/1.4.0/flashcap.1.4.0.nupkg.sha512", - "/home/david/.nuget/packages/flashcap.core/1.4.0/flashcap.core.1.4.0.nupkg.sha512", - "/home/david/.nuget/packages/microsoft.netcore.platforms/5.0.0/microsoft.netcore.platforms.5.0.0.nupkg.sha512", - "/home/david/.nuget/packages/microsoft.netcore.targets/1.1.3/microsoft.netcore.targets.1.1.3.nupkg.sha512", - "/home/david/.nuget/packages/microsoft.win32.systemevents/6.0.0/microsoft.win32.systemevents.6.0.0.nupkg.sha512", - "/home/david/.nuget/packages/runtime.native.system/4.3.0/runtime.native.system.4.3.0.nupkg.sha512", - "/home/david/.nuget/packages/sixlabors.imagesharp/2.1.3/sixlabors.imagesharp.2.1.3.nupkg.sha512", - "/home/david/.nuget/packages/system.drawing.common/6.0.0/system.drawing.common.6.0.0.nupkg.sha512", - "/home/david/.nuget/packages/system.drawing.primitives/4.3.0/system.drawing.primitives.4.3.0.nupkg.sha512", - "/home/david/.nuget/packages/system.globalization/4.3.0/system.globalization.4.3.0.nupkg.sha512", - "/home/david/.nuget/packages/system.io/4.3.0/system.io.4.3.0.nupkg.sha512", - "/home/david/.nuget/packages/system.reactive/5.0.0/system.reactive.5.0.0.nupkg.sha512", - "/home/david/.nuget/packages/system.reflection/4.3.0/system.reflection.4.3.0.nupkg.sha512", - "/home/david/.nuget/packages/system.reflection.extensions/4.3.0/system.reflection.extensions.4.3.0.nupkg.sha512", - "/home/david/.nuget/packages/system.reflection.primitives/4.3.0/system.reflection.primitives.4.3.0.nupkg.sha512", - "/home/david/.nuget/packages/system.resources.resourcemanager/4.3.0/system.resources.resourcemanager.4.3.0.nupkg.sha512", - "/home/david/.nuget/packages/system.runtime/4.3.1/system.runtime.4.3.1.nupkg.sha512", - "/home/david/.nuget/packages/system.runtime.compilerservices.unsafe/5.0.0/system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512", - "/home/david/.nuget/packages/system.runtime.extensions/4.3.0/system.runtime.extensions.4.3.0.nupkg.sha512", - "/home/david/.nuget/packages/system.runtime.handles/4.3.0/system.runtime.handles.4.3.0.nupkg.sha512", - "/home/david/.nuget/packages/system.runtime.interopservices/4.3.0/system.runtime.interopservices.4.3.0.nupkg.sha512", - "/home/david/.nuget/packages/system.runtime.interopservices.runtimeinformation/4.3.0/system.runtime.interopservices.runtimeinformation.4.3.0.nupkg.sha512", - "/home/david/.nuget/packages/system.text.encoding/4.3.0/system.text.encoding.4.3.0.nupkg.sha512", - "/home/david/.nuget/packages/system.text.encoding.codepages/5.0.0/system.text.encoding.codepages.5.0.0.nupkg.sha512", - "/home/david/.nuget/packages/system.threading/4.3.0/system.threading.4.3.0.nupkg.sha512", - "/home/david/.nuget/packages/system.threading.tasks/4.3.0/system.threading.tasks.4.3.0.nupkg.sha512", - "/home/david/.nuget/packages/zxing.net/0.16.8/zxing.net.0.16.8.nupkg.sha512", - "/home/david/.nuget/packages/zxing.net.bindings.windows.compatibility/0.16.10/zxing.net.bindings.windows.compatibility.0.16.10.nupkg.sha512", - "/home/david/.nuget/packages/microsoft.aspnetcore.app.ref/7.0.0/microsoft.aspnetcore.app.ref.7.0.0.nupkg.sha512" - ], - "logs": [ - { - "code": "NU1701", - "level": "Warning", - "warningLevel": 1, - "message": "Package 'AForge 2.2.5' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net7.0'. This package may not be fully compatible with your project.", - "libraryId": "AForge", - "targetGraphs": [ - "net7.0" - ] - }, - { - "code": "NU1701", - "level": "Warning", - "warningLevel": 1, - "message": "Package 'AForge.Imaging 2.2.5' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net7.0'. This package may not be fully compatible with your project.", - "libraryId": "AForge.Imaging", - "targetGraphs": [ - "net7.0" - ] - }, - { - "code": "NU1701", - "level": "Warning", - "warningLevel": 1, - "message": "Package 'AForge.Math 2.2.5' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net7.0'. This package may not be fully compatible with your project.", - "libraryId": "AForge.Math", - "targetGraphs": [ - "net7.0" - ] - }, - { - "code": "NU1701", - "level": "Warning", - "warningLevel": 1, - "message": "Package 'AForge.Video 2.2.5' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net7.0'. This package may not be fully compatible with your project.", - "libraryId": "AForge.Video", - "targetGraphs": [ - "net7.0" - ] - }, - { - "code": "NU1701", - "level": "Warning", - "warningLevel": 1, - "message": "Package 'AForge.Video.DirectShow 2.2.5' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net7.0'. This package may not be fully compatible with your project.", - "libraryId": "AForge.Video.DirectShow", - "targetGraphs": [ - "net7.0" - ] - } - ] -} \ No newline at end of file diff --git a/qrreader.csproj b/qrreader.csproj index 92321cd..1809112 100644 --- a/qrreader.csproj +++ b/qrreader.csproj @@ -17,6 +17,9 @@ + + + diff --git a/server/Properties/launchSettings.json b/server/Properties/launchSettings.json index 887a286..cec4fbc 100644 --- a/server/Properties/launchSettings.json +++ b/server/Properties/launchSettings.json @@ -12,7 +12,7 @@ "http": { "commandName": "Project", "dotnetRunMessages": true, - "launchBrowser": true, + "launchBrowser": false, "launchUrl": "swagger", "applicationUrl": "https://localhost:7001;http://localhost:5257", "environmentVariables": { @@ -22,7 +22,7 @@ "https": { "commandName": "Project", "dotnetRunMessages": true, - "launchBrowser": true, + "launchBrowser": false, "launchUrl": "swagger", "applicationUrl": "https://localhost:7118;http://localhost:5257", "environmentVariables": { @@ -31,7 +31,7 @@ }, "IIS Express": { "commandName": "IISExpress", - "launchBrowser": true, + "launchBrowser": false, "launchUrl": "swagger", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" diff --git a/server/QrScannerController.cs b/server/QrScannerController.cs index b2c3465..61010a4 100644 --- a/server/QrScannerController.cs +++ b/server/QrScannerController.cs @@ -1,4 +1,6 @@ using Microsoft.AspNetCore.Mvc; +using MongoDB.Bson; +using MongoDB.Driver; using QrScanner.Models; namespace server.Controllers; @@ -9,8 +11,10 @@ public class QrScannerController : ControllerBase { const string db_connection_url = @"mongodb://localhost:27017"; const string db_name = @"qr_scanner"; - const string col_codes = @"codes"; + const string col_codes = @"scans"; const string col_info = @"info"; + MongoClient client; + IMongoDatabase db; public QrScannerController(){ client = new MongoClient(db_connection_url); @@ -32,15 +36,27 @@ public class QrScannerController : ControllerBase return Ok(); } + [HttpGet("scan")] public async Task scan(string code){ - Console.WriteLine(code); - return Ok(); + return await _store_code(code); + } + + [HttpGet("codes")] + public async Task>> get_codes(){ + return await _fetch_all_codes(); } - public async Task _store_cost(string code){ - + public async Task _store_code(string code){ + Console.WriteLine(code); + QrCode qr_code = new(); + qr_code.id = Guid.NewGuid().ToString(); + // qr_code.timestamp = DateTime.Now; + qr_code.data = code; + var col = db.GetCollection(col_codes); + await col.InsertOneAsync(qr_code); + return Ok(code); } @@ -55,12 +71,12 @@ public class QrScannerController : ControllerBase Console.WriteLine($"_fetch_code(): Fetching QR code from '{db_name}.{col_codes}'"); var col = db.GetCollection(col_codes); var filter = Builders.Filter.Eq(field, value); - return await Ok(col.Find(filter).FirstOrDefaultAsync()); + return Ok(await col.Find(filter).FirstOrDefaultAsync()); } - public async Task>> _fetch_all_codes(){ - var col = db.GetCollection(col_info); - return await col.Find(new BsonDocument{}).ToListAsync(); + public async Task>> _fetch_all_codes(){ + var col = db.GetCollection(col_codes); + return await col.Find(f => true).ToListAsync(); } } diff --git a/server/QrScannerModel.cs b/server/QrScannerModel.cs index 86b72af..0b76df8 100644 --- a/server/QrScannerModel.cs +++ b/server/QrScannerModel.cs @@ -7,6 +7,9 @@ namespace QrScanner.Models; [BsonIgnoreExtraElements] public class QrCode { + [BsonId] public ObjectId _id { get; set; } - public string data { get; set; } + public string? id { get; set; } + // public DateTime timestamp { get; set; } + public string? data { get; set; } } diff --git a/server/server.csproj b/server/server.csproj index ce90fce..397b05d 100644 --- a/server/server.csproj +++ b/server/server.csproj @@ -8,6 +8,9 @@ + + +