Merge pull request #208 from sbwalker/master
remove unnecessary API methods
This commit is contained in:
commit
ff6f67aba0
|
@ -6,7 +6,6 @@ namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
public interface IPageModuleService
|
public interface IPageModuleService
|
||||||
{
|
{
|
||||||
Task<List<PageModule>> GetPageModulesAsync();
|
|
||||||
Task<PageModule> GetPageModuleAsync(int PageModuleId);
|
Task<PageModule> GetPageModuleAsync(int PageModuleId);
|
||||||
Task<PageModule> GetPageModuleAsync(int PageId, int ModuleId);
|
Task<PageModule> GetPageModuleAsync(int PageId, int ModuleId);
|
||||||
Task<PageModule> AddPageModuleAsync(PageModule PageModule);
|
Task<PageModule> AddPageModuleAsync(PageModule PageModule);
|
||||||
|
|
|
@ -6,8 +6,6 @@ namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
public interface IProfileService
|
public interface IProfileService
|
||||||
{
|
{
|
||||||
Task<List<Profile>> GetProfilesAsync();
|
|
||||||
|
|
||||||
Task<List<Profile>> GetProfilesAsync(int SiteId);
|
Task<List<Profile>> GetProfilesAsync(int SiteId);
|
||||||
|
|
||||||
Task<Profile> GetProfileAsync(int ProfileId);
|
Task<Profile> GetProfileAsync(int ProfileId);
|
||||||
|
|
|
@ -6,8 +6,6 @@ namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
public interface IRoleService
|
public interface IRoleService
|
||||||
{
|
{
|
||||||
Task<List<Role>> GetRolesAsync();
|
|
||||||
|
|
||||||
Task<List<Role>> GetRolesAsync(int SiteId);
|
Task<List<Role>> GetRolesAsync(int SiteId);
|
||||||
|
|
||||||
Task<Role> GetRoleAsync(int RoleId);
|
Task<Role> GetRoleAsync(int RoleId);
|
||||||
|
|
|
@ -7,7 +7,6 @@ namespace Oqtane.Services
|
||||||
public interface ISiteService
|
public interface ISiteService
|
||||||
{
|
{
|
||||||
Task<List<Site>> GetSitesAsync();
|
Task<List<Site>> GetSitesAsync();
|
||||||
Task<List<Site>> GetSitesAsync(Alias Alias);
|
|
||||||
|
|
||||||
Task<Site> GetSiteAsync(int SiteId);
|
Task<Site> GetSiteAsync(int SiteId);
|
||||||
Task<Site> GetSiteAsync(int SiteId, Alias Alias);
|
Task<Site> GetSiteAsync(int SiteId, Alias Alias);
|
||||||
|
|
|
@ -6,7 +6,6 @@ namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
public interface IUserRoleService
|
public interface IUserRoleService
|
||||||
{
|
{
|
||||||
Task<List<UserRole>> GetUserRolesAsync();
|
|
||||||
Task<List<UserRole>> GetUserRolesAsync(int SiteId);
|
Task<List<UserRole>> GetUserRolesAsync(int SiteId);
|
||||||
Task<UserRole> GetUserRoleAsync(int UserRoleId);
|
Task<UserRole> GetUserRoleAsync(int UserRoleId);
|
||||||
Task<UserRole> AddUserRoleAsync(UserRole UserRole);
|
Task<UserRole> AddUserRoleAsync(UserRole UserRole);
|
||||||
|
|
|
@ -6,8 +6,6 @@ namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
public interface IUserService
|
public interface IUserService
|
||||||
{
|
{
|
||||||
Task<List<User>> GetUsersAsync();
|
|
||||||
|
|
||||||
Task<User> GetUserAsync(int UserId, int SiteId);
|
Task<User> GetUserAsync(int UserId, int SiteId);
|
||||||
|
|
||||||
Task<User> GetUserAsync(string Username, int SiteId);
|
Task<User> GetUserAsync(string Username, int SiteId);
|
||||||
|
|
|
@ -26,11 +26,6 @@ namespace Oqtane.Services
|
||||||
get { return CreateApiUrl(sitestate.Alias, NavigationManager.Uri, "PageModule"); }
|
get { return CreateApiUrl(sitestate.Alias, NavigationManager.Uri, "PageModule"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<PageModule>> GetPageModulesAsync()
|
|
||||||
{
|
|
||||||
return await http.GetJsonAsync<List<PageModule>>(apiurl);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<PageModule> GetPageModuleAsync(int PageModuleId)
|
public async Task<PageModule> GetPageModuleAsync(int PageModuleId)
|
||||||
{
|
{
|
||||||
return await http.GetJsonAsync<PageModule>(apiurl + "/" + PageModuleId.ToString());
|
return await http.GetJsonAsync<PageModule>(apiurl + "/" + PageModuleId.ToString());
|
||||||
|
|
|
@ -26,11 +26,6 @@ namespace Oqtane.Services
|
||||||
get { return CreateApiUrl(sitestate.Alias, NavigationManager.Uri, "Profile"); }
|
get { return CreateApiUrl(sitestate.Alias, NavigationManager.Uri, "Profile"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<Profile>> GetProfilesAsync()
|
|
||||||
{
|
|
||||||
return await http.GetJsonAsync<List<Profile>>(apiurl);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<List<Profile>> GetProfilesAsync(int SiteId)
|
public async Task<List<Profile>> GetProfilesAsync(int SiteId)
|
||||||
{
|
{
|
||||||
List<Profile> Profiles = await http.GetJsonAsync<List<Profile>>(apiurl + "?siteid=" + SiteId.ToString());
|
List<Profile> Profiles = await http.GetJsonAsync<List<Profile>>(apiurl + "?siteid=" + SiteId.ToString());
|
||||||
|
|
|
@ -26,12 +26,6 @@ namespace Oqtane.Services
|
||||||
get { return CreateApiUrl(sitestate.Alias, NavigationManager.Uri, "Role"); }
|
get { return CreateApiUrl(sitestate.Alias, NavigationManager.Uri, "Role"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<Role>> GetRolesAsync()
|
|
||||||
{
|
|
||||||
List<Role> Roles = await http.GetJsonAsync<List<Role>>(apiurl);
|
|
||||||
return Roles.OrderBy(item => item.Name).ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<List<Role>> GetRolesAsync(int SiteId)
|
public async Task<List<Role>> GetRolesAsync(int SiteId)
|
||||||
{
|
{
|
||||||
List<Role> Roles = await http.GetJsonAsync<List<Role>>(apiurl + "?siteid=" + SiteId.ToString());
|
List<Role> Roles = await http.GetJsonAsync<List<Role>>(apiurl + "?siteid=" + SiteId.ToString());
|
||||||
|
|
|
@ -31,11 +31,6 @@ namespace Oqtane.Services
|
||||||
List<Site> sites = await http.GetJsonAsync<List<Site>>(apiurl);
|
List<Site> sites = await http.GetJsonAsync<List<Site>>(apiurl);
|
||||||
return sites.OrderBy(item => item.Name).ToList();
|
return sites.OrderBy(item => item.Name).ToList();
|
||||||
}
|
}
|
||||||
public async Task<List<Site>> GetSitesAsync(Alias Alias)
|
|
||||||
{
|
|
||||||
List<Site> sites = await http.GetJsonAsync<List<Site>>(CreateApiUrl(Alias, NavigationManager.Uri, "Site"));
|
|
||||||
return sites.OrderBy(item => item.Name).ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<Site> GetSiteAsync(int SiteId)
|
public async Task<Site> GetSiteAsync(int SiteId)
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,11 +26,6 @@ namespace Oqtane.Services
|
||||||
get { return CreateApiUrl(sitestate.Alias, NavigationManager.Uri, "UserRole"); }
|
get { return CreateApiUrl(sitestate.Alias, NavigationManager.Uri, "UserRole"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<UserRole>> GetUserRolesAsync()
|
|
||||||
{
|
|
||||||
return await http.GetJsonAsync<List<UserRole>>(apiurl);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<List<UserRole>> GetUserRolesAsync(int SiteId)
|
public async Task<List<UserRole>> GetUserRolesAsync(int SiteId)
|
||||||
{
|
{
|
||||||
return await http.GetJsonAsync<List<UserRole>>(apiurl + "?siteid=" + SiteId.ToString());
|
return await http.GetJsonAsync<List<UserRole>>(apiurl + "?siteid=" + SiteId.ToString());
|
||||||
|
|
|
@ -27,12 +27,6 @@ namespace Oqtane.Services
|
||||||
get { return CreateApiUrl(sitestate.Alias, NavigationManager.Uri, "User"); }
|
get { return CreateApiUrl(sitestate.Alias, NavigationManager.Uri, "User"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<User>> GetUsersAsync()
|
|
||||||
{
|
|
||||||
List<User> users = await http.GetJsonAsync<List<User>>(apiurl);
|
|
||||||
return users.OrderBy(item => item.DisplayName).ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<User> GetUserAsync(int UserId, int SiteId)
|
public async Task<User> GetUserAsync(int UserId, int SiteId)
|
||||||
{
|
{
|
||||||
return await http.GetJsonAsync<User>(apiurl + "/" + UserId.ToString() + "?siteid=" + SiteId.ToString());
|
return await http.GetJsonAsync<User>(apiurl + "/" + UserId.ToString() + "?siteid=" + SiteId.ToString());
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
<label for="Title" class="control-label" style="font-weight: bold">Username: </label>
|
<label for="Title" class="control-label" style="font-weight: bold">Username: </label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" class="form-control" readonly @bind="@Username" />
|
<input type="text" class="form-control" @bind="@Username" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr style="@IntegratedSecurityDisplay">
|
<tr style="@IntegratedSecurityDisplay">
|
||||||
|
|
|
@ -24,13 +24,6 @@ namespace Oqtane.Controllers
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET: api/<controller>
|
|
||||||
[HttpGet]
|
|
||||||
public IEnumerable<PageModule> Get()
|
|
||||||
{
|
|
||||||
return PageModules.GetPageModules();
|
|
||||||
}
|
|
||||||
|
|
||||||
// GET api/<controller>/5
|
// GET api/<controller>/5
|
||||||
[HttpGet("{id}")]
|
[HttpGet("{id}")]
|
||||||
public PageModule Get(int id)
|
public PageModule Get(int id)
|
||||||
|
|
|
@ -24,14 +24,7 @@ namespace Oqtane.Controllers
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public IEnumerable<Profile> Get(string siteid)
|
public IEnumerable<Profile> Get(string siteid)
|
||||||
{
|
{
|
||||||
if (siteid == "")
|
return Profiles.GetProfiles(int.Parse(siteid));
|
||||||
{
|
|
||||||
return Profiles.GetProfiles();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Profiles.GetProfiles(int.Parse(siteid));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET api/<controller>/5
|
// GET api/<controller>/5
|
||||||
|
|
|
@ -24,14 +24,7 @@ namespace Oqtane.Controllers
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public IEnumerable<Role> Get(string siteid)
|
public IEnumerable<Role> Get(string siteid)
|
||||||
{
|
{
|
||||||
if (siteid == "")
|
return Roles.GetRoles(int.Parse(siteid));
|
||||||
{
|
|
||||||
return Roles.GetRoles();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Roles.GetRoles(int.Parse(siteid));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET api/<controller>/5
|
// GET api/<controller>/5
|
||||||
|
|
|
@ -42,14 +42,6 @@ namespace Oqtane.Controllers
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET: api/<controller>?siteid=x
|
|
||||||
[HttpGet]
|
|
||||||
[Authorize(Roles = Constants.AdminRole)]
|
|
||||||
public IEnumerable<User> Get()
|
|
||||||
{
|
|
||||||
return Users.GetUsers();
|
|
||||||
}
|
|
||||||
|
|
||||||
// GET api/<controller>/5?siteid=x
|
// GET api/<controller>/5?siteid=x
|
||||||
[HttpGet("{id}")]
|
[HttpGet("{id}")]
|
||||||
public User Get(int id, string siteid)
|
public User Get(int id, string siteid)
|
||||||
|
|
|
@ -24,14 +24,7 @@ namespace Oqtane.Controllers
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public IEnumerable<UserRole> Get(string siteid)
|
public IEnumerable<UserRole> Get(string siteid)
|
||||||
{
|
{
|
||||||
if (siteid == "")
|
return UserRoles.GetUserRoles(int.Parse(siteid));
|
||||||
{
|
|
||||||
return UserRoles.GetUserRoles();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return UserRoles.GetUserRoles(int.Parse(siteid));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET api/<controller>/5
|
// GET api/<controller>/5
|
||||||
|
|
Loading…
Reference in New Issue
Block a user