diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
new file mode 100644
index 0000000..db4df7b
--- /dev/null
+++ b/.config/dotnet-tools.json
@@ -0,0 +1,12 @@
+{
+ "version": 1,
+ "isRoot": true,
+ "tools": {
+ "mapster.tool": {
+ "version": "8.4.0",
+ "commands": [
+ "dotnet-mapster"
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/HiVakil.Api/AppSettings/Production/appsettings.Production.json b/HiVakil.Api/AppSettings/Production/appsettings.Production.json
new file mode 100644
index 0000000..95d6f3a
--- /dev/null
+++ b/HiVakil.Api/AppSettings/Production/appsettings.Production.json
@@ -0,0 +1,68 @@
+{
+ "ConnectionStrings": {
+ "PostgresServer": "User ID=postgres;Password=root;Host=localhost;Port=5432;Database=iGarsonDB;",
+ "Postgres": "Host=pg-0;Username=vesmmehAgent;Password=g05CTjK358Vx3Eoc9satsWyVwo+15UmsA2dnCrZRUYh1pLTe;Database=NetinaShopDB;Application Name=NetinaShopApi",
+ "MartenDB": "Host=pg-0;Username=vesmmehAgent;Password=g05CTjK358Vx3Eoc9satsWyVwo+15UmsA2dnCrZRUYh1pLTe;Database=NetinaShopMartenDB;"
+ },
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft": "None",
+ "Microsoft.Hosting.Lifetime": "Information",
+ "Microsoft.AspNetCore.SignalR": "Debug",
+ "Microsoft.AspNetCore.Http.Connections": "Debug"
+ }
+ },
+ "SiteSettings": {
+ "BaseUrl": "http://192.168.88.251:32770",
+ "AdminPanelBaseUrl": "https://admin.vesmook.com",
+ "KaveNegarApiKey": "3735494B4143727A794346457461576A2B4B6668414973424E333561505A694B",
+ "UserSetting": {
+ "Username": "09214802813",
+ "Email": "avvampier@gmail.com",
+ "Password": "55k6bXxIWT5M487L",
+ "Phone": "09214802813",
+ "RoleName": "RootAdmin",
+ "FirstName": "همه کاره",
+ "LastName": "سیستم"
+ },
+ "ManagerUser": {
+ "Username": "hivakil",
+ "Email": "info@hivakil.io",
+ "Password": "tiyiH+TOMgV4jo+9",
+ "Phone": "09211111111",
+ "RoleName": "Manager",
+ "FirstName": "ادمین",
+ "LastName": "سایت"
+ },
+ "JwtSettings": {
+ "SecretKey": "YAEMAMZAMAN_KHODET_NEGAHDAR_IN_KEY_BASH_lF49ZpaQfER8Gx0A6q3uzC0QZ0jx9byNIV6z7nGoMBM2ewAUgsqM8eLSiRJM1+uA==_YA_HUSEIN_SEYED_SHOHADA_BE_OMID_KHODET_4xFN/ld8qJKNU8rrKfRdy4Fmni2KrWquTDBjtSR6T8fnUT+ii6crtL8pSO8KnRhC_YA_ALI_MADADI_kxT9SwJ1nVeTt8ejij2FOSpqkRNwJVV9nQ4zGsrvaYM=",
+ "Issuer": "HiVakil",
+ "Audience": "HiVakil",
+ "ExpireAddDay": "15"
+ }
+ },
+ "IpRateLimiting": {
+ "EnableEndpointRateLimiting": false,
+ "StackBlockedRequests": false,
+ "RealIpHeader": "X-Real-IP",
+ "ClientIdHeader": "X-ClientId",
+ "HttpStatusCode": 429,
+ "IpWhitelist": [ "127.0.0.1", "::1/10", "192.168.0.0/24" ],
+ "EndpointWhitelist": [ "get:/api/license", "*:/api/status" ],
+ "ClientWhitelist": [ "dev-id-1", "dev-id-2" ],
+ "GeneralRules": [
+ {
+ "Endpoint": "*",
+ "Period": "1m",
+ "Limit": 60
+ },
+ {
+ "Endpoint": "*",
+ "Period": "15m",
+ "Limit": 250
+ }
+ ]
+ },
+ "AllowedHosts": "*"
+}
\ No newline at end of file
diff --git a/HiVakil.Api/appsettings.json b/HiVakil.Api/AppSettings/Production/appsettings.json
similarity index 100%
rename from HiVakil.Api/appsettings.json
rename to HiVakil.Api/AppSettings/Production/appsettings.json
diff --git a/HiVakil.Api/AppSettings/appsettings.Development.json b/HiVakil.Api/AppSettings/appsettings.Development.json
new file mode 100644
index 0000000..fd97c48
--- /dev/null
+++ b/HiVakil.Api/AppSettings/appsettings.Development.json
@@ -0,0 +1,72 @@
+{
+ "ConnectionStrings": {
+ "PostgresServer": "User ID=postgres;Password=root;Host=localhost;Port=5432;Database=iGarsonDB;",
+ "Postgres": "Host=pg-0,pg-1;Username=igarsonAgent;Password=xHTpBf4wC+bBeNg2pL6Ga7VEWKFJx7VPEUpqxwPFfOc2YYTVwFQuHfsiqoVeT9+6;Database=NetinaShopDB;Load Balance Hosts=true;Target Session Attributes=primary;Application Name=iGLS",
+ "MartenDB": "Host=pg-0,pg-1;Username=igarsonAgent;Password=xHTpBf4wC+bBeNg2pL6Ga7VEWKFJx7VPEUpqxwPFfOc2YYTVwFQuHfsiqoVeT9+6;Database=NetinaShopMartenDB;"
+ },
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft": "None",
+ "Microsoft.Hosting.Lifetime": "Information",
+ "Microsoft.AspNetCore.SignalR": "Debug",
+ "Microsoft.AspNetCore.Http.Connections": "Debug"
+ }
+ },
+ "SiteSettings": {
+ "BaseUrl": "http://192.168.88.251:32770",
+ "AdminPanelBaseUrl": "https://admin.vesmook.com",
+ "KaveNegarApiKey": "3735494B4143727A794346457461576A2B4B6668414973424E333561505A694B",
+ "StorageSetting": {
+ "AccessKey": "",
+ "SecretKey": ""
+ },
+ "UserSetting": {
+ "Username": "09214802813",
+ "Email": "avvampier@gmail.com",
+ "Password": "55k6bXxIWT5M487L",
+ "Phone": "09214802813",
+ "RoleName": "RootAdmin",
+ "FirstName": "همه کاره",
+ "LastName": "سیستم"
+ },
+ "ManagerUser": {
+ "Username": "hivakil",
+ "Email": "info@hivakil.io",
+ "Password": "tiyiH+TOMgV4jo+9",
+ "Phone": "09211111111",
+ "RoleName": "Manager",
+ "FirstName": "ادمین",
+ "LastName": "سایت"
+ },
+ "JwtSettings": {
+ "SecretKey": "YAEMAMZAMAN_KHODET_NEGAHDAR_IN_KEY_BASH_lF49ZpaQfER8Gx0A6q3uzC0QZ0jx9byNIV6z7nGoMBM2ewAUgsqM8eLSiRJM1+uA==_YA_HUSEIN_SEYED_SHOHADA_BE_OMID_KHODET_4xFN/ld8qJKNU8rrKfRdy4Fmni2KrWquTDBjtSR6T8fnUT+ii6crtL8pSO8KnRhC_YA_ALI_MADADI_kxT9SwJ1nVeTt8ejij2FOSpqkRNwJVV9nQ4zGsrvaYM=",
+ "Issuer": "HiVakil",
+ "Audience": "HiVakil",
+ "ExpireAddDay": "15"
+ }
+ },
+ "IpRateLimiting": {
+ "EnableEndpointRateLimiting": false,
+ "StackBlockedRequests": false,
+ "RealIpHeader": "X-Real-IP",
+ "ClientIdHeader": "X-ClientId",
+ "HttpStatusCode": 429,
+ "IpWhitelist": [ "127.0.0.1", "::1/10", "192.168.0.0/24" ],
+ "EndpointWhitelist": [ "get:/api/license", "*:/api/status" ],
+ "ClientWhitelist": [ "dev-id-1", "dev-id-2" ],
+ "GeneralRules": [
+ {
+ "Endpoint": "*",
+ "Period": "1m",
+ "Limit": 60
+ },
+ {
+ "Endpoint": "*",
+ "Period": "15m",
+ "Limit": 250
+ }
+ ]
+ },
+ "AllowedHosts": "*"
+}
\ No newline at end of file
diff --git a/HiVakil.Api/appsettings.Development.json b/HiVakil.Api/AppSettings/appsettings.json
similarity index 80%
rename from HiVakil.Api/appsettings.Development.json
rename to HiVakil.Api/AppSettings/appsettings.json
index 0c208ae..10f68b8 100644
--- a/HiVakil.Api/appsettings.Development.json
+++ b/HiVakil.Api/AppSettings/appsettings.json
@@ -4,5 +4,6 @@
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
- }
+ },
+ "AllowedHosts": "*"
}
diff --git a/HiVakil.Api/HiVakil.Api.csproj b/HiVakil.Api/HiVakil.Api.csproj
index eaef27d..fa91777 100644
--- a/HiVakil.Api/HiVakil.Api.csproj
+++ b/HiVakil.Api/HiVakil.Api.csproj
@@ -9,9 +9,9 @@
-
-
-
+
+
+
diff --git a/HiVakil.Common/CommonConfig.cs b/HiVakil.Common/CommonConfig.cs
new file mode 100644
index 0000000..84700a3
--- /dev/null
+++ b/HiVakil.Common/CommonConfig.cs
@@ -0,0 +1,7 @@
+namespace HiVakil.Common
+{
+ public class CommonConfig
+ {
+
+ }
+}
diff --git a/HiVakil.Common/Extensions/AssertExtensions.cs b/HiVakil.Common/Extensions/AssertExtensions.cs
new file mode 100644
index 0000000..e530383
--- /dev/null
+++ b/HiVakil.Common/Extensions/AssertExtensions.cs
@@ -0,0 +1,30 @@
+using System.Collections;
+
+namespace HiVakil.Common.Extensions
+{
+ public static class AssertExtensions
+ {
+ public static void NotNull(T obj, string name, string message = null)
+ where T : class
+ {
+ if (obj is null)
+ throw new ArgumentNullException($"{name} : {typeof(T)}", message);
+ }
+
+ public static void NotNull(T? obj, string name, string message = null)
+ where T : struct
+ {
+ if (!obj.HasValue)
+ throw new ArgumentNullException($"{name} : {typeof(T)}", message);
+ }
+
+ public static void NotEmpty(T obj, string name, string message = null, T defaultValue = null)
+ where T : class
+ {
+ if (obj == defaultValue
+ || obj is string str && string.IsNullOrWhiteSpace(str)
+ || obj is IEnumerable list && !list.Cast