|
|
|
@ -9,6 +9,7 @@ namespace Volo.Abp.TenantManagement
|
|
|
|
|
[Controller]
|
|
|
|
|
[RemoteService]
|
|
|
|
|
[Area("multi-tenancy")]
|
|
|
|
|
[Route("api/multi-tenancy/tenants")]
|
|
|
|
|
public class TenantController : AbpController, ITenantAppService //TODO: Throws exception on validation if we inherit from Controller
|
|
|
|
|
{
|
|
|
|
|
private readonly ITenantAppService _service;
|
|
|
|
@ -18,41 +19,55 @@ namespace Volo.Abp.TenantManagement
|
|
|
|
|
_service = service;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[Route("{id}")]
|
|
|
|
|
public virtual Task<TenantDto> GetAsync(Guid id)
|
|
|
|
|
{
|
|
|
|
|
return _service.GetAsync(id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
public virtual Task<PagedResultDto<TenantDto>> GetListAsync(GetTenantsInput input)
|
|
|
|
|
{
|
|
|
|
|
return _service.GetListAsync(input);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public virtual Task<TenantDto> CreateAsync(TenantCreateDto input)
|
|
|
|
|
{
|
|
|
|
|
return _service.CreateAsync(input);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPut]
|
|
|
|
|
[Route("{id}")]
|
|
|
|
|
public virtual Task<TenantDto> UpdateAsync(Guid id, TenantUpdateDto input)
|
|
|
|
|
{
|
|
|
|
|
return _service.UpdateAsync(id, input);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpDelete]
|
|
|
|
|
[Route("{id}")]
|
|
|
|
|
public virtual Task DeleteAsync(Guid id)
|
|
|
|
|
{
|
|
|
|
|
return _service.DeleteAsync(id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[Route("{id}/DefaultConnectionString")]
|
|
|
|
|
public Task<string> GetDefaultConnectionStringAsync(Guid id)
|
|
|
|
|
{
|
|
|
|
|
return _service.GetDefaultConnectionStringAsync(id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPut]
|
|
|
|
|
[Route("{id}/DefaultConnectionString")]
|
|
|
|
|
public Task UpdateDefaultConnectionStringAsync(Guid id, string defaultConnectionString)
|
|
|
|
|
{
|
|
|
|
|
return _service.UpdateDefaultConnectionStringAsync(id, defaultConnectionString);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpDelete]
|
|
|
|
|
[Route("{id}/DefaultConnectionString")]
|
|
|
|
|
public Task DeleteDefaultConnectionStringAsync(Guid id)
|
|
|
|
|
{
|
|
|
|
|
return _service.DeleteDefaultConnectionStringAsync(id);
|
|
|
|
|