Fix naming conventions for private fields
This commit is contained in:
@ -10,55 +10,55 @@ namespace Oqtane.Services
|
||||
{
|
||||
public class JobService : ServiceBase, IJobService
|
||||
{
|
||||
private readonly HttpClient http;
|
||||
private readonly SiteState sitestate;
|
||||
private readonly NavigationManager NavigationManager;
|
||||
private readonly HttpClient _http;
|
||||
private readonly SiteState _siteState;
|
||||
private readonly NavigationManager _navigationManager;
|
||||
|
||||
public JobService(HttpClient http, SiteState sitestate, NavigationManager NavigationManager)
|
||||
{
|
||||
this.http = http;
|
||||
this.sitestate = sitestate;
|
||||
this.NavigationManager = NavigationManager;
|
||||
this._http = http;
|
||||
this._siteState = sitestate;
|
||||
this._navigationManager = NavigationManager;
|
||||
}
|
||||
|
||||
private string apiurl
|
||||
{
|
||||
get { return CreateApiUrl(sitestate.Alias, NavigationManager.Uri, "Job"); }
|
||||
get { return CreateApiUrl(_siteState.Alias, _navigationManager.Uri, "Job"); }
|
||||
}
|
||||
|
||||
public async Task<List<Job>> GetJobsAsync()
|
||||
{
|
||||
List<Job> Jobs = await http.GetJsonAsync<List<Job>>(apiurl);
|
||||
List<Job> Jobs = await _http.GetJsonAsync<List<Job>>(apiurl);
|
||||
return Jobs.OrderBy(item => item.Name).ToList();
|
||||
}
|
||||
|
||||
public async Task<Job> GetJobAsync(int JobId)
|
||||
{
|
||||
return await http.GetJsonAsync<Job>(apiurl + "/" + JobId.ToString());
|
||||
return await _http.GetJsonAsync<Job>(apiurl + "/" + JobId.ToString());
|
||||
}
|
||||
|
||||
public async Task<Job> AddJobAsync(Job Job)
|
||||
{
|
||||
return await http.PostJsonAsync<Job>(apiurl, Job);
|
||||
return await _http.PostJsonAsync<Job>(apiurl, Job);
|
||||
}
|
||||
|
||||
public async Task<Job> UpdateJobAsync(Job Job)
|
||||
{
|
||||
return await http.PutJsonAsync<Job>(apiurl + "/" + Job.JobId.ToString(), Job);
|
||||
return await _http.PutJsonAsync<Job>(apiurl + "/" + Job.JobId.ToString(), Job);
|
||||
}
|
||||
public async Task DeleteJobAsync(int JobId)
|
||||
{
|
||||
await http.DeleteAsync(apiurl + "/" + JobId.ToString());
|
||||
await _http.DeleteAsync(apiurl + "/" + JobId.ToString());
|
||||
}
|
||||
|
||||
public async Task StartJobAsync(int JobId)
|
||||
{
|
||||
await http.GetAsync(apiurl + "/start/" + JobId.ToString());
|
||||
await _http.GetAsync(apiurl + "/start/" + JobId.ToString());
|
||||
}
|
||||
|
||||
public async Task StopJobAsync(int JobId)
|
||||
{
|
||||
await http.GetAsync(apiurl + "/stop/" + JobId.ToString());
|
||||
await _http.GetAsync(apiurl + "/stop/" + JobId.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user