Support for third party modules, improved error handling, standardardized enum naming, reorganized interface definitions, support for DB script upgrades, added Settings entity
This commit is contained in:
19
Oqtane.Client/Services/Interfaces/IAliasService.cs
Normal file
19
Oqtane.Client/Services/Interfaces/IAliasService.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using Oqtane.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
public interface IAliasService
|
||||
{
|
||||
Task<List<Alias>> GetAliasesAsync();
|
||||
|
||||
Task<Alias> GetAliasAsync(int AliasId);
|
||||
|
||||
Task<Alias> AddAliasAsync(Alias Alias);
|
||||
|
||||
Task<Alias> UpdateAliasAsync(Alias Alias);
|
||||
|
||||
Task DeleteAliasAsync(int AliasId);
|
||||
}
|
||||
}
|
12
Oqtane.Client/Services/Interfaces/IInstallationService.cs
Normal file
12
Oqtane.Client/Services/Interfaces/IInstallationService.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using Oqtane.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
public interface IInstallationService
|
||||
{
|
||||
Task<GenericResponse> IsInstalled();
|
||||
Task<GenericResponse> Install(string connectionstring);
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
using Oqtane.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
public interface IModuleDefinitionService
|
||||
{
|
||||
Task<List<ModuleDefinition>> GetModuleDefinitionsAsync();
|
||||
}
|
||||
}
|
16
Oqtane.Client/Services/Interfaces/IModuleService.cs
Normal file
16
Oqtane.Client/Services/Interfaces/IModuleService.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using Oqtane.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
public interface IModuleService
|
||||
{
|
||||
Task<List<Module>> GetModulesAsync(int PageId);
|
||||
Task<List<Module>> GetModulesAsync(int SiteId, string ModuleDefinitionName);
|
||||
Task<Module> GetModuleAsync(int ModuleId);
|
||||
Task<Module> AddModuleAsync(Module Module);
|
||||
Task<Module> UpdateModuleAsync(Module Module);
|
||||
Task DeleteModuleAsync(int ModuleId);
|
||||
}
|
||||
}
|
15
Oqtane.Client/Services/Interfaces/IPageModuleService.cs
Normal file
15
Oqtane.Client/Services/Interfaces/IPageModuleService.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using Oqtane.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
public interface IPageModuleService
|
||||
{
|
||||
Task<List<PageModule>> GetPageModulesAsync();
|
||||
Task<PageModule> GetPageModuleAsync(int PageModuleId);
|
||||
Task<PageModule> AddPageModuleAsync(PageModule PageModule);
|
||||
Task<PageModule> UpdatePageModuleAsync(PageModule PageModule);
|
||||
Task DeletePageModuleAsync(int PageModuleId);
|
||||
}
|
||||
}
|
15
Oqtane.Client/Services/Interfaces/IPageService.cs
Normal file
15
Oqtane.Client/Services/Interfaces/IPageService.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using Oqtane.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
public interface IPageService
|
||||
{
|
||||
Task<List<Page>> GetPagesAsync(int SiteId);
|
||||
Task<Page> GetPageAsync(int PageId);
|
||||
Task<Page> AddPageAsync(Page Page);
|
||||
Task<Page> UpdatePageAsync(Page Page);
|
||||
Task DeletePageAsync(int PageId);
|
||||
}
|
||||
}
|
27
Oqtane.Client/Services/Interfaces/ISettingService.cs
Normal file
27
Oqtane.Client/Services/Interfaces/ISettingService.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using Oqtane.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
public interface ISettingService
|
||||
{
|
||||
Task<List<Setting>> GetModuleSettingsAsync(int ModuleId);
|
||||
|
||||
Task<Setting> UpdateModuleSettingsAsync(List<Setting> ModuleSettings, int ModuleId, string SettingName, string SettingValue);
|
||||
|
||||
|
||||
Task<List<Setting>> GetSettingsAsync(string EntityName, int EntityId);
|
||||
|
||||
Task<Setting> GetSettingAsync(int SettingId);
|
||||
|
||||
Task<Setting> AddSettingAsync(Setting Setting);
|
||||
|
||||
Task<Setting> UpdateSettingAsync(Setting Setting);
|
||||
|
||||
Task DeleteSettingAsync(int SettingId);
|
||||
|
||||
|
||||
string GetSetting(List<Setting> Settings, string SettingName, string DefaultValue);
|
||||
}
|
||||
}
|
19
Oqtane.Client/Services/Interfaces/ISiteService.cs
Normal file
19
Oqtane.Client/Services/Interfaces/ISiteService.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using Oqtane.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
public interface ISiteService
|
||||
{
|
||||
Task<List<Site>> GetSitesAsync();
|
||||
|
||||
Task<Site> GetSiteAsync(int SiteId);
|
||||
|
||||
Task<Site> AddSiteAsync(Site Site);
|
||||
|
||||
Task<Site> UpdateSiteAsync(Site Site);
|
||||
|
||||
Task DeleteSiteAsync(int SiteId);
|
||||
}
|
||||
}
|
13
Oqtane.Client/Services/Interfaces/ITenantService.cs
Normal file
13
Oqtane.Client/Services/Interfaces/ITenantService.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using Oqtane.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
public interface ITenantService
|
||||
{
|
||||
Task<List<Tenant>> GetTenantsAsync();
|
||||
|
||||
Task<Tenant> GetTenantAsync();
|
||||
}
|
||||
}
|
14
Oqtane.Client/Services/Interfaces/IThemeService.cs
Normal file
14
Oqtane.Client/Services/Interfaces/IThemeService.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using Oqtane.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
public interface IThemeService
|
||||
{
|
||||
Task<List<Theme>> GetThemesAsync();
|
||||
Dictionary<string, string> GetThemeTypes(List<Theme> themes);
|
||||
Dictionary<string, string> GetPaneLayoutTypes(List<Theme> themes);
|
||||
Dictionary<string, string> GetContainerTypes(List<Theme> themes);
|
||||
}
|
||||
}
|
29
Oqtane.Client/Services/Interfaces/IUserService.cs
Normal file
29
Oqtane.Client/Services/Interfaces/IUserService.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using Oqtane.Models;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
public interface IUserService
|
||||
{
|
||||
Task<List<User>> GetUsersAsync();
|
||||
|
||||
Task<User> GetUserAsync(int UserId);
|
||||
|
||||
Task<User> GetUserAsync(string Username);
|
||||
|
||||
Task<User> AddUserAsync(User User);
|
||||
|
||||
Task<User> UpdateUserAsync(User User);
|
||||
|
||||
Task DeleteUserAsync(int UserId);
|
||||
|
||||
Task<User> GetCurrentUserAsync();
|
||||
|
||||
Task<User> LoginUserAsync(User User);
|
||||
|
||||
Task LogoutUserAsync();
|
||||
|
||||
bool IsAuthorized(User User, string AccessControlList);
|
||||
}
|
||||
}
|
39
Oqtane.Client/Services/Interfaces/InstallationService.cs
Normal file
39
Oqtane.Client/Services/Interfaces/InstallationService.cs
Normal file
@ -0,0 +1,39 @@
|
||||
using Oqtane.Models;
|
||||
using System.Threading.Tasks;
|
||||
using System.Net.Http;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
public class InstallationService : ServiceBase, IInstallationService
|
||||
{
|
||||
private readonly HttpClient http;
|
||||
private readonly SiteState sitestate;
|
||||
private readonly IUriHelper urihelper;
|
||||
|
||||
public InstallationService(HttpClient http, SiteState sitestate, IUriHelper urihelper)
|
||||
{
|
||||
this.http = http;
|
||||
this.sitestate = sitestate;
|
||||
this.urihelper = urihelper;
|
||||
}
|
||||
|
||||
private string apiurl
|
||||
{
|
||||
get { return CreateApiUrl(sitestate.Alias, urihelper.GetAbsoluteUri(), "Installation"); }
|
||||
}
|
||||
|
||||
public async Task<GenericResponse> IsInstalled()
|
||||
{
|
||||
return await http.GetJsonAsync<GenericResponse>(apiurl + "/installed");
|
||||
}
|
||||
|
||||
public async Task<GenericResponse> Install(string connectionstring)
|
||||
{
|
||||
return await http.PostJsonAsync<GenericResponse>(apiurl, connectionstring);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user