Added support for MySQL and ProgreSQL and AddSite/Tenant

This commit is contained in:
Charles Nurse
2021-04-02 10:55:00 -07:00
parent 2fb63e8117
commit e6530ee127
57 changed files with 708 additions and 581 deletions

View File

@ -19,18 +19,18 @@ namespace Oqtane.Modules.HtmlText.Services
private string ApiUrl => CreateApiUrl(_siteState.Alias, "HtmlText");
public async Task<HtmlTextInfo> GetHtmlTextAsync(int moduleId)
public async Task<Models.HtmlText> GetHtmlTextAsync(int moduleId)
{
var htmltext = await GetJsonAsync<List<HtmlTextInfo>>(CreateAuthorizationPolicyUrl($"{ApiUrl}/{moduleId}", moduleId));
var htmltext = await GetJsonAsync<List<Models.HtmlText>>(CreateAuthorizationPolicyUrl($"{ApiUrl}/{moduleId}", moduleId));
return htmltext.FirstOrDefault();
}
public async Task AddHtmlTextAsync(HtmlTextInfo htmlText)
public async Task AddHtmlTextAsync(Models.HtmlText htmlText)
{
await PostJsonAsync(CreateAuthorizationPolicyUrl($"{ApiUrl}", htmlText.ModuleId), htmlText);
}
public async Task UpdateHtmlTextAsync(HtmlTextInfo htmlText)
public async Task UpdateHtmlTextAsync(Models.HtmlText htmlText)
{
await PutJsonAsync(CreateAuthorizationPolicyUrl($"{ApiUrl}/{htmlText.HtmlTextId}", htmlText.ModuleId), htmlText);
}

View File

@ -6,11 +6,11 @@ namespace Oqtane.Modules.HtmlText.Services
{
public interface IHtmlTextService
{
Task<HtmlTextInfo> GetHtmlTextAsync(int ModuleId);
Task<Models.HtmlText> GetHtmlTextAsync(int ModuleId);
Task AddHtmlTextAsync(HtmlTextInfo htmltext);
Task AddHtmlTextAsync(Models.HtmlText htmltext);
Task UpdateHtmlTextAsync(HtmlTextInfo htmltext);
Task UpdateHtmlTextAsync(Models.HtmlText htmltext);
Task DeleteHtmlTextAsync(int ModuleId);
}