consolidate interface and implementation classes
This commit is contained in:
@ -8,6 +8,17 @@ using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IAliasRepository
|
||||
{
|
||||
IEnumerable<Alias> GetAliases();
|
||||
Alias AddAlias(Alias alias);
|
||||
Alias UpdateAlias(Alias alias);
|
||||
Alias GetAlias(int aliasId);
|
||||
Alias GetAlias(int aliasId, bool tracking);
|
||||
Alias GetAlias(string url);
|
||||
void DeleteAlias(int aliasId);
|
||||
}
|
||||
|
||||
public class AliasRepository : IAliasRepository
|
||||
{
|
||||
private MasterDBContext _db;
|
||||
|
@ -2,7 +2,6 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Oqtane.Extensions;
|
||||
using Oqtane.Infrastructure;
|
||||
using Oqtane.Models;
|
||||
using Oqtane.Shared;
|
||||
@ -10,6 +9,21 @@ using File = Oqtane.Models.File;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IFileRepository
|
||||
{
|
||||
IEnumerable<File> GetFiles(int folderId);
|
||||
IEnumerable<File> GetFiles(int folderId, bool tracking);
|
||||
File AddFile(File file);
|
||||
File UpdateFile(File file);
|
||||
File GetFile(int fileId);
|
||||
File GetFile(int fileId, bool tracking);
|
||||
File GetFile(int folderId, string fileName);
|
||||
File GetFile(int siteId, string folderPath, string fileName);
|
||||
void DeleteFile(int fileId);
|
||||
string GetFilePath(int fileId);
|
||||
string GetFilePath(File file);
|
||||
}
|
||||
|
||||
public class FileRepository : IFileRepository
|
||||
{
|
||||
private readonly IDbContextFactory<TenantDBContext> _dbContextFactory;
|
||||
|
@ -2,13 +2,25 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Oqtane.Extensions;
|
||||
using Oqtane.Infrastructure;
|
||||
using Oqtane.Models;
|
||||
using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IFolderRepository
|
||||
{
|
||||
IEnumerable<Folder> GetFolders(int siteId);
|
||||
Folder AddFolder(Folder folder);
|
||||
Folder UpdateFolder(Folder folder);
|
||||
Folder GetFolder(int folderId);
|
||||
Folder GetFolder(int folderId, bool tracking);
|
||||
Folder GetFolder(int siteId, string path);
|
||||
void DeleteFolder(int folderId);
|
||||
string GetFolderPath(int folderId);
|
||||
string GetFolderPath(Folder folder);
|
||||
}
|
||||
|
||||
public class FolderRepository : IFolderRepository
|
||||
{
|
||||
private readonly IDbContextFactory<TenantDBContext> _dbContextFactory;
|
||||
|
@ -1,16 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IAliasRepository
|
||||
{
|
||||
IEnumerable<Alias> GetAliases();
|
||||
Alias AddAlias(Alias alias);
|
||||
Alias UpdateAlias(Alias alias);
|
||||
Alias GetAlias(int aliasId);
|
||||
Alias GetAlias(int aliasId, bool tracking);
|
||||
Alias GetAlias(string url);
|
||||
void DeleteAlias(int aliasId);
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IFileRepository
|
||||
{
|
||||
IEnumerable<File> GetFiles(int folderId);
|
||||
IEnumerable<File> GetFiles(int folderId, bool tracking);
|
||||
File AddFile(File file);
|
||||
File UpdateFile(File file);
|
||||
File GetFile(int fileId);
|
||||
File GetFile(int fileId, bool tracking);
|
||||
File GetFile(int folderId, string fileName);
|
||||
File GetFile(int siteId, string folderPath, string fileName);
|
||||
void DeleteFile(int fileId);
|
||||
string GetFilePath(int fileId);
|
||||
string GetFilePath(File file);
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IFolderRepository
|
||||
{
|
||||
IEnumerable<Folder> GetFolders(int siteId);
|
||||
Folder AddFolder(Folder folder);
|
||||
Folder UpdateFolder(Folder folder);
|
||||
Folder GetFolder(int folderId);
|
||||
Folder GetFolder(int folderId, bool tracking);
|
||||
Folder GetFolder(int siteId, string path);
|
||||
void DeleteFolder(int folderId);
|
||||
string GetFolderPath(int folderId);
|
||||
string GetFolderPath(Folder folder);
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IJobLogRepository
|
||||
{
|
||||
IEnumerable<JobLog> GetJobLogs();
|
||||
IEnumerable<JobLog> GetJobLogs(int jobId);
|
||||
JobLog AddJobLog(JobLog jobLog);
|
||||
JobLog UpdateJobLog(JobLog jobLog);
|
||||
JobLog GetJobLog(int jobLogId);
|
||||
void DeleteJobLog(int jobLogId);
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IJobRepository
|
||||
{
|
||||
IEnumerable<Job> GetJobs();
|
||||
Job AddJob(Job job);
|
||||
Job UpdateJob(Job job);
|
||||
Job GetJob(int jobId);
|
||||
Job GetJob(int jobId, bool tracking);
|
||||
void DeleteJob(int jobId);
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface ILanguageRepository
|
||||
{
|
||||
IEnumerable<Language> GetLanguages(int siteId);
|
||||
|
||||
Language AddLanguage(Language language);
|
||||
|
||||
void UpdateLanguage(Language language);
|
||||
|
||||
Language GetLanguage(int languageId);
|
||||
|
||||
void DeleteLanguage(int languageId);
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface ILogRepository
|
||||
{
|
||||
IEnumerable<Log> GetLogs(int siteId, string level, string function, int rows);
|
||||
Log GetLog(int logId);
|
||||
void AddLog(Log log);
|
||||
int DeleteLogs(int siteId, int age);
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IModuleDefinitionRepository
|
||||
{
|
||||
IEnumerable<ModuleDefinition> GetModuleDefinitions();
|
||||
IEnumerable<ModuleDefinition> GetModuleDefinitions(int siteId);
|
||||
ModuleDefinition GetModuleDefinition(int moduleDefinitionId, int siteId);
|
||||
void UpdateModuleDefinition(ModuleDefinition moduleDefinition);
|
||||
void DeleteModuleDefinition(int moduleDefinitionId);
|
||||
ModuleDefinition FilterModuleDefinition(ModuleDefinition moduleDefinition);
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IModuleRepository
|
||||
{
|
||||
IEnumerable<Module> GetModules(int siteId);
|
||||
Module AddModule(Module module);
|
||||
Module UpdateModule(Module module);
|
||||
Module GetModule(int moduleId);
|
||||
Module GetModule(int moduleId, bool tracking);
|
||||
void DeleteModule(int moduleId);
|
||||
string ExportModule(int moduleId);
|
||||
bool ImportModule(int moduleId, string content);
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface INotificationRepository
|
||||
{
|
||||
IEnumerable<Notification> GetNotifications(int siteId, int fromUserId, int toUserId);
|
||||
IEnumerable<Notification> GetNotifications(int siteId, int fromUserId, int toUserId, int count, bool isRead);
|
||||
int GetNotificationCount(int siteId, int fromUserId, int toUserId, bool isRead);
|
||||
Notification AddNotification(Notification notification);
|
||||
Notification UpdateNotification(Notification notification);
|
||||
Notification GetNotification(int notificationId);
|
||||
Notification GetNotification(int notificationId, bool tracking);
|
||||
void DeleteNotification(int notificationId);
|
||||
int DeleteNotifications(int siteId, int age);
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IPageModuleRepository
|
||||
{
|
||||
IEnumerable<PageModule> GetPageModules(int siteId);
|
||||
PageModule AddPageModule(PageModule pageModule);
|
||||
PageModule UpdatePageModule(PageModule pageModule);
|
||||
PageModule GetPageModule(int pageModuleId);
|
||||
PageModule GetPageModule(int pageModuleId, bool tracking);
|
||||
PageModule GetPageModule(int pageId, int moduleId);
|
||||
void DeletePageModule(int pageModuleId);
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IPageRepository
|
||||
{
|
||||
IEnumerable<Page> GetPages(int siteId);
|
||||
Page AddPage(Page page);
|
||||
Page UpdatePage(Page page);
|
||||
Page GetPage(int pageId);
|
||||
Page GetPage(int pageId, bool tracking);
|
||||
Page GetPage(string path, int siteId);
|
||||
void DeletePage(int pageId);
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Policy;
|
||||
using Oqtane.Models;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IPermissionRepository
|
||||
{
|
||||
IEnumerable<Permission> GetPermissions(int siteId, string entityName);
|
||||
IEnumerable<Permission> GetPermissions(int siteId, string entityName, string permissionName);
|
||||
IEnumerable<Permission> GetPermissions(int siteId, string entityName, int entityId);
|
||||
IEnumerable<Permission> GetPermissions(int siteId, string entityName, int entityId, string permissionName);
|
||||
Permission AddPermission(Permission permission);
|
||||
Permission UpdatePermission(Permission permission);
|
||||
void UpdatePermissions(int siteId, string entityName, int entityId, List<Permission> permissions);
|
||||
Permission GetPermission(int permissionId);
|
||||
void DeletePermission(int permissionId);
|
||||
void DeletePermissions(int siteId, string entityName, int entityId);
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IProfileRepository
|
||||
{
|
||||
IEnumerable<Profile> GetProfiles(int siteId);
|
||||
Profile AddProfile(Profile profile);
|
||||
Profile UpdateProfile(Profile profile);
|
||||
Profile GetProfile(int profileId);
|
||||
Profile GetProfile(int profileId, bool tracking);
|
||||
void DeleteProfile(int profileId);
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IRoleRepository
|
||||
{
|
||||
IEnumerable<Role> GetRoles(int siteId);
|
||||
IEnumerable<Role> GetRoles(int siteId, bool includeGlobalRoles);
|
||||
Role AddRole(Role role);
|
||||
Role UpdateRole(Role role);
|
||||
Role GetRole(int roleId);
|
||||
Role GetRole(int roleId, bool tracking);
|
||||
void DeleteRole(int roleId);
|
||||
}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface ISearchContentRepository
|
||||
{
|
||||
Task<IEnumerable<SearchContent>> GetSearchContentsAsync(SearchQuery searchQuery);
|
||||
SearchContent AddSearchContent(SearchContent searchContent);
|
||||
void DeleteSearchContent(int searchContentId);
|
||||
void DeleteSearchContent(string entityName, string entryId);
|
||||
void DeleteSearchContent(string uniqueKey);
|
||||
void DeleteAllSearchContent(int siteId);
|
||||
|
||||
SearchWord GetSearchWord(string word);
|
||||
SearchWord AddSearchWord(SearchWord searchWord);
|
||||
|
||||
IEnumerable<SearchContentWord> GetSearchContentWords(int searchContentId);
|
||||
SearchContentWord AddSearchContentWord(SearchContentWord searchContentWord);
|
||||
SearchContentWord UpdateSearchContentWord(SearchContentWord searchContentWord);
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface ISettingRepository
|
||||
{
|
||||
IEnumerable<Setting> GetSettings(string entityName);
|
||||
IEnumerable<Setting> GetSettings(string entityName, int entityId);
|
||||
IEnumerable<Setting> GetSettings(string entityName1, int entityId1, string entityName2, int entityId2);
|
||||
Setting AddSetting(Setting setting);
|
||||
Setting UpdateSetting(Setting setting);
|
||||
Setting GetSetting(string entityName, int settingId);
|
||||
Setting GetSetting(string entityName, int entityId, string settingName);
|
||||
void DeleteSetting(string entityName, int settingId);
|
||||
void DeleteSettings(string entityName, int entityId);
|
||||
string GetSettingValue(IEnumerable<Setting> settings, string settingName, string defaultValue);
|
||||
string GetSettingValue(string entityName, int entityId, string settingName, string defaultValue);
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface ISiteRepository
|
||||
{
|
||||
IEnumerable<Site> GetSites();
|
||||
Site AddSite(Site site);
|
||||
Site UpdateSite(Site site);
|
||||
Site GetSite(int siteId);
|
||||
Site GetSite(int siteId, bool tracking);
|
||||
void DeleteSite(int siteId);
|
||||
|
||||
void InitializeSite(Alias alias);
|
||||
void CreatePages(Site site, List<PageTemplate> pageTemplates, Alias alias);
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface ISiteTemplateRepository
|
||||
{
|
||||
IEnumerable<SiteTemplate> GetSiteTemplates();
|
||||
}
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
using System.Data;
|
||||
using System.Reflection;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface ISqlRepository
|
||||
{
|
||||
void ExecuteScript(Tenant tenant, string script);
|
||||
|
||||
bool ExecuteScript(string connectionString, string databaseType, Assembly assembly, string filename);
|
||||
|
||||
bool ExecuteScript(Tenant tenant, Assembly assembly, string filename);
|
||||
|
||||
int ExecuteNonQuery(Tenant tenant, string query);
|
||||
|
||||
int ExecuteNonQuery(string connectionString, string databaseType, string query);
|
||||
|
||||
IDataReader ExecuteReader(Tenant tenant, string query);
|
||||
|
||||
IDataReader ExecuteReader(string DBType, string DBConnectionString, string query);
|
||||
|
||||
string GetScriptFromAssembly(Assembly assembly, string fileName);
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface ITenantRepository
|
||||
{
|
||||
IEnumerable<Tenant> GetTenants();
|
||||
Tenant AddTenant(Tenant tenant);
|
||||
Tenant UpdateTenant(Tenant tenant);
|
||||
Tenant GetTenant(int tenantId);
|
||||
void DeleteTenant(int tenantId);
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
// class deprecated and replaced by ITenantManager
|
||||
public interface ITenantResolver
|
||||
{
|
||||
Alias GetAlias();
|
||||
Tenant GetTenant();
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IThemeRepository
|
||||
{
|
||||
IEnumerable<Theme> GetThemes();
|
||||
Theme GetTheme(int themeId, int siteId);
|
||||
void UpdateTheme(Theme theme);
|
||||
void DeleteTheme(int themeId);
|
||||
List<Theme> FilterThemes(List<Theme> themes);
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IUrlMappingRepository
|
||||
{
|
||||
IEnumerable<UrlMapping> GetUrlMappings(int siteId, bool isMapped);
|
||||
UrlMapping AddUrlMapping(UrlMapping urlMapping);
|
||||
UrlMapping UpdateUrlMapping(UrlMapping urlMapping);
|
||||
UrlMapping GetUrlMapping(int urlMappingId);
|
||||
UrlMapping GetUrlMapping(int urlMappingId, bool tracking);
|
||||
UrlMapping GetUrlMapping(int siteId, string url);
|
||||
void DeleteUrlMapping(int urlMappingId);
|
||||
int DeleteUrlMappings(int siteId, int age);
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IUserRepository
|
||||
{
|
||||
IEnumerable<User> GetUsers();
|
||||
User AddUser(User user);
|
||||
User UpdateUser(User user);
|
||||
User GetUser(int userId);
|
||||
User GetUser(int userId, bool tracking);
|
||||
User GetUser(string username);
|
||||
User GetUser(string username, string email);
|
||||
void DeleteUser(int userId);
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IUserRoleRepository
|
||||
{
|
||||
IEnumerable<UserRole> GetUserRoles(int siteId);
|
||||
IEnumerable<UserRole> GetUserRoles(int userId, int siteId);
|
||||
IEnumerable<UserRole> GetUserRoles(string roleName, int siteId);
|
||||
UserRole AddUserRole(UserRole userRole);
|
||||
UserRole UpdateUserRole(UserRole userRole);
|
||||
UserRole GetUserRole(int userRoleId);
|
||||
UserRole GetUserRole(int userRoleId, bool tracking);
|
||||
UserRole GetUserRole(int userId, int roleId);
|
||||
UserRole GetUserRole(int userId, int roleId, bool tracking);
|
||||
void DeleteUserRole(int userRoleId);
|
||||
void DeleteUserRoles(int userId);
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IVisitorRepository
|
||||
{
|
||||
IEnumerable<Visitor> GetVisitors(int siteId, DateTime fromDate);
|
||||
Visitor AddVisitor(Visitor visitor);
|
||||
Visitor UpdateVisitor(Visitor visitor);
|
||||
Visitor GetVisitor(int visitorId);
|
||||
Visitor GetVisitor(int siteId, string IPAddress);
|
||||
void DeleteVisitor(int visitorId);
|
||||
int DeleteVisitors(int siteId, int age);
|
||||
}
|
||||
}
|
@ -5,6 +5,16 @@ using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IJobLogRepository
|
||||
{
|
||||
IEnumerable<JobLog> GetJobLogs();
|
||||
IEnumerable<JobLog> GetJobLogs(int jobId);
|
||||
JobLog AddJobLog(JobLog jobLog);
|
||||
JobLog UpdateJobLog(JobLog jobLog);
|
||||
JobLog GetJobLog(int jobLogId);
|
||||
void DeleteJobLog(int jobLogId);
|
||||
}
|
||||
|
||||
public class JobLogRepository : IJobLogRepository
|
||||
{
|
||||
private MasterDBContext _db;
|
||||
|
@ -7,6 +7,16 @@ using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IJobRepository
|
||||
{
|
||||
IEnumerable<Job> GetJobs();
|
||||
Job AddJob(Job job);
|
||||
Job UpdateJob(Job job);
|
||||
Job GetJob(int jobId);
|
||||
Job GetJob(int jobId, bool tracking);
|
||||
void DeleteJob(int jobId);
|
||||
}
|
||||
|
||||
public class JobRepository : IJobRepository
|
||||
{
|
||||
private MasterDBContext _db;
|
||||
|
@ -5,6 +5,15 @@ using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface ILanguageRepository
|
||||
{
|
||||
IEnumerable<Language> GetLanguages(int siteId);
|
||||
Language AddLanguage(Language language);
|
||||
void UpdateLanguage(Language language);
|
||||
Language GetLanguage(int languageId);
|
||||
void DeleteLanguage(int languageId);
|
||||
}
|
||||
|
||||
public class LanguageRepository : ILanguageRepository
|
||||
{
|
||||
private readonly IDbContextFactory<TenantDBContext> _dbContextFactory;
|
||||
|
@ -6,6 +6,14 @@ using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface ILogRepository
|
||||
{
|
||||
IEnumerable<Log> GetLogs(int siteId, string level, string function, int rows);
|
||||
Log GetLog(int logId);
|
||||
void AddLog(Log log);
|
||||
int DeleteLogs(int siteId, int age);
|
||||
}
|
||||
|
||||
public class LogRepository : ILogRepository
|
||||
{
|
||||
private readonly IDbContextFactory<TenantDBContext> _dbContextFactory;
|
||||
|
@ -13,6 +13,16 @@ using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IModuleDefinitionRepository
|
||||
{
|
||||
IEnumerable<ModuleDefinition> GetModuleDefinitions();
|
||||
IEnumerable<ModuleDefinition> GetModuleDefinitions(int siteId);
|
||||
ModuleDefinition GetModuleDefinition(int moduleDefinitionId, int siteId);
|
||||
void UpdateModuleDefinition(ModuleDefinition moduleDefinition);
|
||||
void DeleteModuleDefinition(int moduleDefinitionId);
|
||||
ModuleDefinition FilterModuleDefinition(ModuleDefinition moduleDefinition);
|
||||
}
|
||||
|
||||
public class ModuleDefinitionRepository : IModuleDefinitionRepository
|
||||
{
|
||||
private MasterDBContext _db;
|
||||
|
@ -4,7 +4,6 @@ using System.Linq;
|
||||
using System.Text.Json;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Oqtane.Extensions;
|
||||
using Oqtane.Models;
|
||||
using Oqtane.Modules;
|
||||
using Oqtane.Shared;
|
||||
@ -12,6 +11,18 @@ using Module = Oqtane.Models.Module;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IModuleRepository
|
||||
{
|
||||
IEnumerable<Module> GetModules(int siteId);
|
||||
Module AddModule(Module module);
|
||||
Module UpdateModule(Module module);
|
||||
Module GetModule(int moduleId);
|
||||
Module GetModule(int moduleId, bool tracking);
|
||||
void DeleteModule(int moduleId);
|
||||
string ExportModule(int moduleId);
|
||||
bool ImportModule(int moduleId, string content);
|
||||
}
|
||||
|
||||
public class ModuleRepository : IModuleRepository
|
||||
{
|
||||
private readonly IDbContextFactory<TenantDBContext> _dbContextFactory;
|
||||
|
@ -6,6 +6,19 @@ using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface INotificationRepository
|
||||
{
|
||||
IEnumerable<Notification> GetNotifications(int siteId, int fromUserId, int toUserId);
|
||||
IEnumerable<Notification> GetNotifications(int siteId, int fromUserId, int toUserId, int count, bool isRead);
|
||||
int GetNotificationCount(int siteId, int fromUserId, int toUserId, bool isRead);
|
||||
Notification AddNotification(Notification notification);
|
||||
Notification UpdateNotification(Notification notification);
|
||||
Notification GetNotification(int notificationId);
|
||||
Notification GetNotification(int notificationId, bool tracking);
|
||||
void DeleteNotification(int notificationId);
|
||||
int DeleteNotifications(int siteId, int age);
|
||||
}
|
||||
|
||||
public class NotificationRepository : INotificationRepository
|
||||
{
|
||||
private readonly IDbContextFactory<TenantDBContext> _dbContextFactory;
|
||||
|
@ -1,13 +1,22 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Oqtane.Extensions;
|
||||
using Oqtane.Models;
|
||||
using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IPageModuleRepository
|
||||
{
|
||||
IEnumerable<PageModule> GetPageModules(int siteId);
|
||||
PageModule AddPageModule(PageModule pageModule);
|
||||
PageModule UpdatePageModule(PageModule pageModule);
|
||||
PageModule GetPageModule(int pageModuleId);
|
||||
PageModule GetPageModule(int pageModuleId, bool tracking);
|
||||
PageModule GetPageModule(int pageId, int moduleId);
|
||||
void DeletePageModule(int pageModuleId);
|
||||
}
|
||||
|
||||
public class PageModuleRepository : IPageModuleRepository
|
||||
{
|
||||
private readonly IDbContextFactory<TenantDBContext> _dbContextFactory;
|
||||
|
@ -2,12 +2,22 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Oqtane.Extensions;
|
||||
using Oqtane.Models;
|
||||
using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IPageRepository
|
||||
{
|
||||
IEnumerable<Page> GetPages(int siteId);
|
||||
Page AddPage(Page page);
|
||||
Page UpdatePage(Page page);
|
||||
Page GetPage(int pageId);
|
||||
Page GetPage(int pageId, bool tracking);
|
||||
Page GetPage(string path, int siteId);
|
||||
void DeletePage(int pageId);
|
||||
}
|
||||
|
||||
public class PageRepository : IPageRepository
|
||||
{
|
||||
private readonly IDbContextFactory<TenantDBContext> _dbContextFactory;
|
||||
|
@ -8,6 +8,20 @@ using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IPermissionRepository
|
||||
{
|
||||
IEnumerable<Permission> GetPermissions(int siteId, string entityName);
|
||||
IEnumerable<Permission> GetPermissions(int siteId, string entityName, string permissionName);
|
||||
IEnumerable<Permission> GetPermissions(int siteId, string entityName, int entityId);
|
||||
IEnumerable<Permission> GetPermissions(int siteId, string entityName, int entityId, string permissionName);
|
||||
Permission AddPermission(Permission permission);
|
||||
Permission UpdatePermission(Permission permission);
|
||||
void UpdatePermissions(int siteId, string entityName, int entityId, List<Permission> permissions);
|
||||
Permission GetPermission(int permissionId);
|
||||
void DeletePermission(int permissionId);
|
||||
void DeletePermissions(int siteId, string entityName, int entityId);
|
||||
}
|
||||
|
||||
public class PermissionRepository : IPermissionRepository
|
||||
{
|
||||
private readonly IDbContextFactory<TenantDBContext> _dbContextFactory;
|
||||
|
@ -5,6 +5,15 @@ using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IProfileRepository
|
||||
{
|
||||
IEnumerable<Profile> GetProfiles(int siteId);
|
||||
Profile AddProfile(Profile profile);
|
||||
Profile UpdateProfile(Profile profile);
|
||||
Profile GetProfile(int profileId);
|
||||
Profile GetProfile(int profileId, bool tracking);
|
||||
void DeleteProfile(int profileId);
|
||||
}
|
||||
public class ProfileRepository : IProfileRepository
|
||||
{
|
||||
private readonly IDbContextFactory<TenantDBContext> _dbContextFactory;
|
||||
|
@ -2,11 +2,20 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Oqtane.Models;
|
||||
using Oqtane.Modules.Admin.Users;
|
||||
using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IRoleRepository
|
||||
{
|
||||
IEnumerable<Role> GetRoles(int siteId);
|
||||
IEnumerable<Role> GetRoles(int siteId, bool includeGlobalRoles);
|
||||
Role AddRole(Role role);
|
||||
Role UpdateRole(Role role);
|
||||
Role GetRole(int roleId);
|
||||
Role GetRole(int roleId, bool tracking);
|
||||
void DeleteRole(int roleId);
|
||||
}
|
||||
|
||||
public class RoleRepository : IRoleRepository
|
||||
{
|
||||
private readonly IDbContextFactory<TenantDBContext> _dbContextFactory;
|
||||
|
@ -1,17 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Internal;
|
||||
using Oqtane.Extensions;
|
||||
using Oqtane.Infrastructure;
|
||||
using Oqtane.Models;
|
||||
using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface ISearchContentRepository
|
||||
{
|
||||
Task<IEnumerable<SearchContent>> GetSearchContentsAsync(SearchQuery searchQuery);
|
||||
SearchContent AddSearchContent(SearchContent searchContent);
|
||||
void DeleteSearchContent(int searchContentId);
|
||||
void DeleteSearchContent(string entityName, string entryId);
|
||||
void DeleteSearchContent(string uniqueKey);
|
||||
void DeleteAllSearchContent(int siteId);
|
||||
|
||||
SearchWord GetSearchWord(string word);
|
||||
SearchWord AddSearchWord(SearchWord searchWord);
|
||||
|
||||
IEnumerable<SearchContentWord> GetSearchContentWords(int searchContentId);
|
||||
SearchContentWord AddSearchContentWord(SearchContentWord searchContentWord);
|
||||
SearchContentWord UpdateSearchContentWord(SearchContentWord searchContentWord);
|
||||
}
|
||||
|
||||
public class SearchContentRepository : ISearchContentRepository
|
||||
{
|
||||
private readonly IDbContextFactory<TenantDBContext> _dbContextFactory;
|
||||
|
@ -8,6 +8,21 @@ using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface ISettingRepository
|
||||
{
|
||||
IEnumerable<Setting> GetSettings(string entityName);
|
||||
IEnumerable<Setting> GetSettings(string entityName, int entityId);
|
||||
IEnumerable<Setting> GetSettings(string entityName1, int entityId1, string entityName2, int entityId2);
|
||||
Setting AddSetting(Setting setting);
|
||||
Setting UpdateSetting(Setting setting);
|
||||
Setting GetSetting(string entityName, int settingId);
|
||||
Setting GetSetting(string entityName, int entityId, string settingName);
|
||||
void DeleteSetting(string entityName, int settingId);
|
||||
void DeleteSettings(string entityName, int entityId);
|
||||
string GetSettingValue(IEnumerable<Setting> settings, string settingName, string defaultValue);
|
||||
string GetSettingValue(string entityName, int entityId, string settingName, string defaultValue);
|
||||
}
|
||||
|
||||
public class SettingRepository : ISettingRepository
|
||||
{
|
||||
private readonly IDbContextFactory<TenantDBContext> _tenantContextFactory;
|
||||
|
@ -9,12 +9,24 @@ using Oqtane.Enums;
|
||||
using Oqtane.Infrastructure;
|
||||
using Oqtane.Models;
|
||||
using Oqtane.Modules;
|
||||
using Oqtane.Modules.Admin.Modules;
|
||||
using Oqtane.Shared;
|
||||
using Module = Oqtane.Models.Module;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface ISiteRepository
|
||||
{
|
||||
IEnumerable<Site> GetSites();
|
||||
Site AddSite(Site site);
|
||||
Site UpdateSite(Site site);
|
||||
Site GetSite(int siteId);
|
||||
Site GetSite(int siteId, bool tracking);
|
||||
void DeleteSite(int siteId);
|
||||
|
||||
void InitializeSite(Alias alias);
|
||||
void CreatePages(Site site, List<PageTemplate> pageTemplates, Alias alias);
|
||||
}
|
||||
|
||||
public class SiteRepository : ISiteRepository
|
||||
{
|
||||
private readonly IDbContextFactory<TenantDBContext> _factory;
|
||||
|
@ -9,6 +9,11 @@ using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface ISiteTemplateRepository
|
||||
{
|
||||
IEnumerable<SiteTemplate> GetSiteTemplates();
|
||||
}
|
||||
|
||||
public class SiteTemplateRepository : ISiteTemplateRepository
|
||||
{
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
|
@ -12,6 +12,25 @@ using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface ISqlRepository
|
||||
{
|
||||
void ExecuteScript(Tenant tenant, string script);
|
||||
|
||||
bool ExecuteScript(string connectionString, string databaseType, Assembly assembly, string filename);
|
||||
|
||||
bool ExecuteScript(Tenant tenant, Assembly assembly, string filename);
|
||||
|
||||
int ExecuteNonQuery(Tenant tenant, string query);
|
||||
|
||||
int ExecuteNonQuery(string connectionString, string databaseType, string query);
|
||||
|
||||
IDataReader ExecuteReader(Tenant tenant, string query);
|
||||
|
||||
IDataReader ExecuteReader(string DBType, string DBConnectionString, string query);
|
||||
|
||||
string GetScriptFromAssembly(Assembly assembly, string fileName);
|
||||
}
|
||||
|
||||
public class SqlRepository : ISqlRepository
|
||||
{
|
||||
private IConfigurationRoot _config;
|
||||
|
@ -8,6 +8,14 @@ using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface ITenantRepository
|
||||
{
|
||||
IEnumerable<Tenant> GetTenants();
|
||||
Tenant AddTenant(Tenant tenant);
|
||||
Tenant UpdateTenant(Tenant tenant);
|
||||
Tenant GetTenant(int tenantId);
|
||||
void DeleteTenant(int tenantId);
|
||||
}
|
||||
public class TenantRepository : ITenantRepository
|
||||
{
|
||||
private MasterDBContext _db;
|
||||
|
@ -4,6 +4,12 @@ using Oqtane.Models;
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
// class deprecated and replaced by ITenantManager
|
||||
public interface ITenantResolver
|
||||
{
|
||||
Alias GetAlias();
|
||||
Tenant GetTenant();
|
||||
}
|
||||
|
||||
public class TenantResolver : ITenantResolver
|
||||
{
|
||||
private readonly ITenantManager _tenantManager;
|
||||
|
@ -4,7 +4,6 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Metadata;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Oqtane.Infrastructure;
|
||||
@ -14,6 +13,15 @@ using Oqtane.Themes;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IThemeRepository
|
||||
{
|
||||
IEnumerable<Theme> GetThemes();
|
||||
Theme GetTheme(int themeId, int siteId);
|
||||
void UpdateTheme(Theme theme);
|
||||
void DeleteTheme(int themeId);
|
||||
List<Theme> FilterThemes(List<Theme> themes);
|
||||
}
|
||||
|
||||
public class ThemeRepository : IThemeRepository
|
||||
{
|
||||
private MasterDBContext _db;
|
||||
|
@ -6,6 +6,18 @@ using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IUrlMappingRepository
|
||||
{
|
||||
IEnumerable<UrlMapping> GetUrlMappings(int siteId, bool isMapped);
|
||||
UrlMapping AddUrlMapping(UrlMapping urlMapping);
|
||||
UrlMapping UpdateUrlMapping(UrlMapping urlMapping);
|
||||
UrlMapping GetUrlMapping(int urlMappingId);
|
||||
UrlMapping GetUrlMapping(int urlMappingId, bool tracking);
|
||||
UrlMapping GetUrlMapping(int siteId, string url);
|
||||
void DeleteUrlMapping(int urlMappingId);
|
||||
int DeleteUrlMappings(int siteId, int age);
|
||||
}
|
||||
|
||||
public class UrlMappingRepository : IUrlMappingRepository
|
||||
{
|
||||
private readonly IDbContextFactory<TenantDBContext> _dbContextFactory;
|
||||
|
@ -2,11 +2,22 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Oqtane.Models;
|
||||
using Oqtane.Modules.Admin.Users;
|
||||
using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IUserRepository
|
||||
{
|
||||
IEnumerable<User> GetUsers();
|
||||
User AddUser(User user);
|
||||
User UpdateUser(User user);
|
||||
User GetUser(int userId);
|
||||
User GetUser(int userId, bool tracking);
|
||||
User GetUser(string username);
|
||||
User GetUser(string username, string email);
|
||||
void DeleteUser(int userId);
|
||||
}
|
||||
|
||||
public class UserRepository : IUserRepository
|
||||
{
|
||||
private readonly IDbContextFactory<TenantDBContext> _dbContextFactory;
|
||||
|
@ -10,6 +10,21 @@ using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IUserRoleRepository
|
||||
{
|
||||
IEnumerable<UserRole> GetUserRoles(int siteId);
|
||||
IEnumerable<UserRole> GetUserRoles(int userId, int siteId);
|
||||
IEnumerable<UserRole> GetUserRoles(string roleName, int siteId);
|
||||
UserRole AddUserRole(UserRole userRole);
|
||||
UserRole UpdateUserRole(UserRole userRole);
|
||||
UserRole GetUserRole(int userRoleId);
|
||||
UserRole GetUserRole(int userRoleId, bool tracking);
|
||||
UserRole GetUserRole(int userId, int roleId);
|
||||
UserRole GetUserRole(int userId, int roleId, bool tracking);
|
||||
void DeleteUserRole(int userRoleId);
|
||||
void DeleteUserRoles(int userId);
|
||||
}
|
||||
|
||||
public class UserRoleRepository : IUserRoleRepository
|
||||
{
|
||||
private readonly IDbContextFactory<TenantDBContext> _dbContextFactory;
|
||||
|
@ -6,6 +6,17 @@ using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Repository
|
||||
{
|
||||
public interface IVisitorRepository
|
||||
{
|
||||
IEnumerable<Visitor> GetVisitors(int siteId, DateTime fromDate);
|
||||
Visitor AddVisitor(Visitor visitor);
|
||||
Visitor UpdateVisitor(Visitor visitor);
|
||||
Visitor GetVisitor(int visitorId);
|
||||
Visitor GetVisitor(int siteId, string IPAddress);
|
||||
void DeleteVisitor(int visitorId);
|
||||
int DeleteVisitors(int siteId, int age);
|
||||
}
|
||||
|
||||
public class VisitorRepository : IVisitorRepository
|
||||
{
|
||||
private readonly IDbContextFactory<TenantDBContext> _dbContextFactory;
|
||||
|
Reference in New Issue
Block a user