From 4b35a667a10bac8da6e3039a0b6c63c4a1c5057e Mon Sep 17 00:00:00 2001 From: Juster Zhu Date: Fri, 19 Jan 2024 22:34:12 +0800 Subject: [PATCH] add gitkeep --- .../WillMessage/.gitkeep | 0 .../FileProvider-Serialization.cs | 29 +++++++++++++++++++ .../ContentProvider/.gitkeep | 0 .../ContentProvider/.gitkeep | 0 .../Domain/DTO/Assembler/.gitkeep | 0 .../Domain/Entity/Assembler/.gitkeep | 0 .../Exceptions/CustomArgs/.gitkeep | 0 .../Exceptions/CustomException/.gitkeep | 0 .../HashAlgorithms/.gitkeep | 0 .../Utrils/.gitkeep | 0 10 files changed, 29 insertions(+) create mode 100644 src/c#/GeneralUpdate.ClientCore/WillMessage/.gitkeep create mode 100644 src/c#/GeneralUpdate.Core/ContentProvider/FileProvider-Serialization.cs create mode 100644 src/c#/GeneralUpdate.Maui.OSS/ContentProvider/.gitkeep create mode 100644 src/c#/GeneralUpdate.SystemService/ContentProvider/.gitkeep create mode 100644 src/c#/GeneralUpdate.SystemService/Domain/DTO/Assembler/.gitkeep create mode 100644 src/c#/GeneralUpdate.SystemService/Domain/Entity/Assembler/.gitkeep create mode 100644 src/c#/GeneralUpdate.SystemService/Exceptions/CustomArgs/.gitkeep create mode 100644 src/c#/GeneralUpdate.SystemService/Exceptions/CustomException/.gitkeep create mode 100644 src/c#/GeneralUpdate.SystemService/HashAlgorithms/.gitkeep create mode 100644 src/c#/GeneralUpdate.SystemService/Utrils/.gitkeep diff --git a/src/c#/GeneralUpdate.ClientCore/WillMessage/.gitkeep b/src/c#/GeneralUpdate.ClientCore/WillMessage/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/c#/GeneralUpdate.Core/ContentProvider/FileProvider-Serialization.cs b/src/c#/GeneralUpdate.Core/ContentProvider/FileProvider-Serialization.cs new file mode 100644 index 00000000..4a03e465 --- /dev/null +++ b/src/c#/GeneralUpdate.Core/ContentProvider/FileProvider-Serialization.cs @@ -0,0 +1,29 @@ +using Newtonsoft.Json; +using System.IO; + +namespace GeneralUpdate.Core.ContentProvider +{ + public partial class FileProvider + { + public static void CreateJson(string targetPath, T obj) + { + if (!Directory.Exists(targetPath)) Directory.CreateDirectory(targetPath); + if (File.Exists(targetPath)) File.Delete(targetPath); + var jsonString = JsonConvert.SerializeObject(obj); + File.WriteAllText(targetPath, jsonString); + } + + public static T GetJson(string path) + { + if (File.Exists(path)) + { + var json = File.ReadAllText(path); + if (json != null) + { + return JsonConvert.DeserializeObject(json); + } + } + return default(T); + } + } +} \ No newline at end of file diff --git a/src/c#/GeneralUpdate.Maui.OSS/ContentProvider/.gitkeep b/src/c#/GeneralUpdate.Maui.OSS/ContentProvider/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/c#/GeneralUpdate.SystemService/ContentProvider/.gitkeep b/src/c#/GeneralUpdate.SystemService/ContentProvider/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/c#/GeneralUpdate.SystemService/Domain/DTO/Assembler/.gitkeep b/src/c#/GeneralUpdate.SystemService/Domain/DTO/Assembler/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/c#/GeneralUpdate.SystemService/Domain/Entity/Assembler/.gitkeep b/src/c#/GeneralUpdate.SystemService/Domain/Entity/Assembler/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/c#/GeneralUpdate.SystemService/Exceptions/CustomArgs/.gitkeep b/src/c#/GeneralUpdate.SystemService/Exceptions/CustomArgs/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/c#/GeneralUpdate.SystemService/Exceptions/CustomException/.gitkeep b/src/c#/GeneralUpdate.SystemService/Exceptions/CustomException/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/c#/GeneralUpdate.SystemService/HashAlgorithms/.gitkeep b/src/c#/GeneralUpdate.SystemService/HashAlgorithms/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/c#/GeneralUpdate.SystemService/Utrils/.gitkeep b/src/c#/GeneralUpdate.SystemService/Utrils/.gitkeep new file mode 100644 index 00000000..e69de29b