feat: 添加租户管理模块搭建

This commit is contained in:
橙子
2024-02-06 15:25:17 +08:00
parent 13ae0e33c1
commit 44b13acc61
19 changed files with 231 additions and 4 deletions

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.TenantManagement.Application.Contracts.Dtos
{
public class TenantCreateInput
{
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.TenantManagement.Application.Contracts.Dtos
{
public class TenantGetListInput
{
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace Yi.Framework.TenantManagement.Application.Contracts.Dtos
{
public class TenantGetListOutputDto:EntityDto<Guid>
{
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace Yi.Framework.TenantManagement.Application.Contracts.Dtos
{
public class TenantGetOutputDto:EntityDto<Guid>
{
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.TenantManagement.Application.Contracts.Dtos
{
public class TenantUpdateInput
{
}
}

View File

@@ -0,0 +1,9 @@
using Yi.Framework.Ddd.Application.Contracts;
using Yi.Framework.TenantManagement.Application.Contracts.Dtos;
namespace Yi.Framework.TenantManagement.Application.Contracts
{
public interface ITenantService:IYiCrudAppService< TenantGetOutputDto, TenantGetListOutputDto, Guid, TenantGetListInput, TenantCreateInput, TenantUpdateInput>
{
}
}

View File

@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.TenantManagement.Domain.Shared" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\framework\Yi.Framework.Ddd.Application.Contracts\Yi.Framework.Ddd.Application.Contracts.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,13 @@
using Volo.Abp.Modularity;
using Volo.Abp.TenantManagement;
using Yi.Framework.Ddd.Application.Contracts;
namespace Yi.Framework.TenantManagement.Application.Contracts
{
[DependsOn(typeof(AbpTenantManagementDomainSharedModule),
typeof(YiFrameworkDddApplicationContractsModule))]
public class YiFrameworkTenantManagementApplicationContractsModule:AbpModule
{
}
}

View File

@@ -0,0 +1,78 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Repositories;
using Yi.Framework.Ddd.Application;
using Yi.Framework.SqlSugarCore.Abstractions;
using Yi.Framework.TenantManagement.Application.Contracts;
using Yi.Framework.TenantManagement.Application.Contracts.Dtos;
using Yi.Framework.TenantManagement.Domain;
namespace Yi.Framework.TenantManagement.Application
{
/// <summary>
/// 租户管理
/// </summary>
public class TenantService : YiCrudAppService<TenantAggregateRoot, TenantGetOutputDto, TenantGetListOutputDto, Guid, TenantGetListInput, TenantCreateInput, TenantUpdateInput>, ITenantService
{
private ISqlSugarRepository<TenantAggregateRoot, Guid> _repository;
public TenantService(ISqlSugarRepository<TenantAggregateRoot, Guid> repository) : base(repository)
{
_repository = repository;
}
/// <summary>
/// 租户单查
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public override Task<TenantGetOutputDto> GetAsync(Guid id)
{
return base.GetAsync(id);
}
/// <summary>
/// 租户多查
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public override Task<PagedResultDto<TenantGetListOutputDto>> GetListAsync(TenantGetListInput input)
{
return base.GetListAsync(input);
}
/// <summary>
/// 创建租户
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public override Task<TenantGetOutputDto> CreateAsync(TenantCreateInput input)
{
return base.CreateAsync(input);
}
/// <summary>
/// 更新租户
/// </summary>
/// <param name="id"></param>
/// <param name="input"></param>
/// <returns></returns>
public override Task<TenantGetOutputDto> UpdateAsync(Guid id, TenantUpdateInput input)
{
return base.UpdateAsync(id, input);
}
/// <summary>
/// 租户删除
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public override Task DeleteAsync(IEnumerable<Guid> id)
{
return base.DeleteAsync(id);
}
}
}

View File

@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\framework\Yi.Framework.Ddd.Application\Yi.Framework.Ddd.Application.csproj" />
<ProjectReference Include="..\Yi.Framework.TenantManagement.Application.Contracts\Yi.Framework.TenantManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\Yi.Framework.TenantManagement.Domain\Yi.Framework.TenantManagement.Domain.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,12 @@
using Volo.Abp.Modularity;
using Yi.Framework.Ddd.Application;
using Yi.Framework.TenantManagement.Domain;
namespace Yi.Framework.TenantManagement.Application
{
[DependsOn(typeof(YiFrameworkTenantManagementDomainModule))]
public class YiFrameworkTenantManagementApplicationModule: AbpModule
{
}
}

View File

@@ -1,5 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>

View File

@@ -1,5 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>