using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Admin.Core.Common.Input;
using Admin.Core.Common.Output;
using Admin.Core.Model.Admin;
using Admin.Core.Service.Admin.Tenant;
using Admin.Core.Service.Admin.Tenant.Input;
namespace Admin.Core.Controllers.Admin
{
///
/// 租户管理
///
public class TenantController : AreaController
{
private readonly ITenantService _roleServices;
public TenantController(ITenantService roleServices)
{
_roleServices = roleServices;
}
///
/// 查询单条租户
///
///
///
[HttpGet]
public async Task Get(long id)
{
return await _roleServices.GetAsync(id);
}
///
/// 查询分页租户
///
///
///
[HttpPost]
public async Task GetPage(PageInput model)
{
return await _roleServices.PageAsync(model);
}
///
/// 新增租户
///
///
///
[HttpPost]
public async Task Add(TenantAddInput input)
{
return await _roleServices.AddAsync(input);
}
///
/// 修改租户
///
///
///
[HttpPut]
public async Task Update(TenantUpdateInput input)
{
return await _roleServices.UpdateAsync(input);
}
///
/// 删除租户
///
///
///
[HttpDelete]
public async Task SoftDelete(long id)
{
return await _roleServices.SoftDeleteAsync(id);
}
///
/// 批量删除租户
///
///
///
[HttpPut]
public async Task BatchSoftDelete(long[] ids)
{
return await _roleServices.BatchSoftDeleteAsync(ids);
}
}
}