Add Application configuration #11

Merged
Wesser merged 128 commits from feat/add-setup into release/v1.0.0 2024-06-01 07:35:30 +03:00
Showing only changes of commit 1fd6c8657a - Show all commits

View File

@ -114,11 +114,11 @@ public class SetupController(ISetupToken setupToken, IMaintenanceModeNotConfigur
[BadRequestResponse] [BadRequestResponse]
public ActionResult<bool> SetMysql([FromBody] DatabaseRequest request) public ActionResult<bool> SetMysql([FromBody] DatabaseRequest request)
{ {
string connectionString = $"Server={request.Server}:{request.Port};Uid={request.User};Database={request.Database}"; string connectionString = $"Server={request.Server}:{request.Port};Uid={request.User};Database={request.Database};";
if (request.Password != null) if (request.Password != null)
connectionString += $";Pwd={request.Password}"; connectionString += $"Pwd={request.Password};";
if (request.Ssl) if (request.Ssl)
connectionString += ";SslMode=Require;"; connectionString += "SslMode=Require;";
return SetDatabase<MySqlConnection, MySqlException>(connectionString, DbSettings.DatabaseEnum.Mysql); return SetDatabase<MySqlConnection, MySqlException>(connectionString, DbSettings.DatabaseEnum.Mysql);
} }