Include AliasId in service API calls ( this is not needed for interacting with the MasterDB repository however it is needed for tenant-based logging )
This commit is contained in:
		| @ -5,16 +5,21 @@ using System.Linq; | ||||
| using System.Collections.Generic; | ||||
| using System.Net; | ||||
| using System; | ||||
|  | ||||
| using Oqtane.Shared; | ||||
|  | ||||
| namespace Oqtane.Services | ||||
| { | ||||
|     public class AliasService : ServiceBase, IAliasService | ||||
|     { | ||||
|          | ||||
|         public AliasService(HttpClient http) :base(http) { } | ||||
|  | ||||
|         private string Apiurl => CreateApiUrl("Alias"); | ||||
|         private readonly SiteState _siteState; | ||||
|  | ||||
|         public AliasService(HttpClient http, SiteState siteState) : base(http) | ||||
|         { | ||||
|             _siteState = siteState; | ||||
|         } | ||||
|  | ||||
|         private string Apiurl => CreateApiUrl(_siteState.Alias, "Alias"); | ||||
|  | ||||
|         public async Task<List<Alias>> GetAliasesAsync() | ||||
|         { | ||||
|  | ||||
| @ -3,14 +3,20 @@ using System.Threading.Tasks; | ||||
| using System.Net.Http; | ||||
| using System.Linq; | ||||
| using System.Collections.Generic; | ||||
| using Oqtane.Shared; | ||||
|  | ||||
| namespace Oqtane.Services | ||||
| { | ||||
|     public class JobLogService : ServiceBase, IJobLogService | ||||
|     { | ||||
|         public JobLogService(HttpClient http) :base(http) { } | ||||
|         private readonly SiteState _siteState; | ||||
|  | ||||
|         private string Apiurl => CreateApiUrl("JobLog"); | ||||
|         public JobLogService(HttpClient http, SiteState siteState) : base(http) | ||||
|         { | ||||
|             _siteState = siteState; | ||||
|         } | ||||
|  | ||||
|         private string Apiurl => CreateApiUrl(_siteState.Alias, "JobLog"); | ||||
|  | ||||
|         public async Task<List<JobLog>> GetJobLogsAsync() | ||||
|         { | ||||
|  | ||||
| @ -3,15 +3,21 @@ using System.Threading.Tasks; | ||||
| using System.Net.Http; | ||||
| using System.Linq; | ||||
| using System.Collections.Generic; | ||||
| using Oqtane.Shared; | ||||
|  | ||||
| namespace Oqtane.Services | ||||
| { | ||||
|     public class JobService : ServiceBase, IJobService | ||||
|     { | ||||
|         public JobService(HttpClient http) : base(http) { } | ||||
|         private readonly SiteState _siteState; | ||||
|  | ||||
|         private string Apiurl => CreateApiUrl("Job"); | ||||
|         public JobService(HttpClient http, SiteState siteState) : base(http) | ||||
|         { | ||||
|             _siteState = siteState; | ||||
|         } | ||||
|  | ||||
|         private string Apiurl => CreateApiUrl(_siteState.Alias, "Job"); | ||||
|          | ||||
|         public async Task<List<Job>> GetJobsAsync() | ||||
|         { | ||||
|             List<Job> jobs = await GetJsonAsync<List<Job>>(Apiurl); | ||||
|  | ||||
| @ -135,13 +135,13 @@ namespace Oqtane.Services | ||||
|             //TODO Missing content JSON validation  | ||||
|         } | ||||
|  | ||||
|         // create an API Url which is tenant agnostic ( for use with entities in the MasterDB ) | ||||
|         // create an API Url which is tenant agnostic ( for use during installation ) | ||||
|         public string CreateApiUrl(string serviceName) | ||||
|         { | ||||
|             return CreateApiUrl(null, serviceName); | ||||
|         } | ||||
|  | ||||
|         // create an API Url which is tenant aware ( for use with entities in the TenantDB ) | ||||
|         // create an API Url which is tenant aware ( for use with repositories ) | ||||
|         public string CreateApiUrl(Alias alias, string serviceName) | ||||
|         { | ||||
|             string apiurl = "/"; | ||||
|  | ||||
| @ -1,4 +1,5 @@ | ||||
| using Oqtane.Models; | ||||
| using Oqtane.Shared; | ||||
| using System.Net.Http; | ||||
| using System.Threading.Tasks; | ||||
|  | ||||
| @ -6,9 +7,14 @@ namespace Oqtane.Services | ||||
| { | ||||
|     public class SqlService : ServiceBase, ISqlService | ||||
|     { | ||||
|         public SqlService(HttpClient http) : base(http) { } | ||||
|         private readonly SiteState _siteState; | ||||
|  | ||||
|         private string Apiurl => CreateApiUrl("Sql"); | ||||
|         public SqlService(HttpClient http, SiteState siteState) : base(http) | ||||
|         { | ||||
|             _siteState = siteState; | ||||
|         } | ||||
|  | ||||
|         private string Apiurl => CreateApiUrl(_siteState.Alias, "Sql"); | ||||
|  | ||||
|         public async Task<SqlQuery> ExecuteQueryAsync(SqlQuery sqlquery) | ||||
|         { | ||||
|  | ||||
| @ -3,14 +3,20 @@ using System.Net.Http; | ||||
| using System.Threading.Tasks; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using Oqtane.Shared; | ||||
|  | ||||
| namespace Oqtane.Services | ||||
| { | ||||
|     public class TenantService : ServiceBase, ITenantService | ||||
|     { | ||||
|         public TenantService(HttpClient http) : base(http) { } | ||||
|         private readonly SiteState _siteState; | ||||
|  | ||||
|         private string Apiurl => CreateApiUrl("Tenant"); | ||||
|         public TenantService(HttpClient http, SiteState siteState) : base(http) | ||||
|         { | ||||
|             _siteState = siteState; | ||||
|         } | ||||
|  | ||||
|         private string Apiurl => CreateApiUrl(_siteState.Alias, "Tenant"); | ||||
|  | ||||
|         public async Task<List<Tenant>> GetTenantsAsync() | ||||
|         { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Shaun Walker
					Shaun Walker