Skip to content

Commit

Permalink
Adicionando novas key ao ConfigHelper e ao appsettings do PrepareEmai…
Browse files Browse the repository at this point in the history
…l e novos tipos ao ServiceType #24
  • Loading branch information
jos3s committed Nov 23, 2023
1 parent 746e217 commit c6d32b1
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
43 changes: 43 additions & 0 deletions MSEmail.Common/Utils/ConfigHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,48 @@ public static string GetTokenSecret()
throw;
}
}

public static bool GetRunWorkerCreatedEmail()
{
try
{
bool value = false;
bool.TryParse(GetConfiguration("RunWorkerCreatedEmail"), out value);
return value;
}
catch (Exception)
{
throw;
}
}

public static bool GetRunWorkerDraftEmail()
{
try
{
bool value = false;
bool.TryParse(GetConfiguration("RunWorkerDraftEmail"), out value);
return value;
}
catch (Exception)
{
throw;
}
}

public static double GetRunExecutionTime()
{
try
{
double value = 5000;
double.TryParse(GetConfiguration("RunExecutionTime"), out value);
return value;
}
catch (Exception)
{

throw;
}
}
}
}
3 changes: 2 additions & 1 deletion MSEmail.Domain/Enums/ServiceType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ public enum ServiceType
{
API,
WebUI,
Microservice
MSSender,
MSPrepareEmail
}
}
3 changes: 2 additions & 1 deletion MSEmail.PrepareEmail/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"AppSettings": {
"DefaultUserId": 1,
"RunWorkerCreatedEmail": true,
"RunWorkerDraftEmail": false
"RunWorkerDraftEmail": true,
"RunExecutionTime": 5000
}
}

0 comments on commit c6d32b1

Please sign in to comment.