mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-03-19 16:06:36 +08:00
上传T4模板
This commit is contained in:
@@ -7,7 +7,7 @@ using Yi.Framework.Model.Models;
|
||||
|
||||
namespace Yi.Framework.Interface
|
||||
{
|
||||
public interface IMenuService:IBaseService<menu>
|
||||
public partial interface IMenuService:IBaseService<menu>
|
||||
{
|
||||
Task<bool> DelListByUpdateAsync(List<int> _ids);
|
||||
/// <summary>
|
||||
@@ -59,6 +59,6 @@ namespace Yi.Framework.Interface
|
||||
/// 获取子菜单
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<menu>> GetChildrenMenu();
|
||||
Task<List<menu>> GetChildrenMenu(menu _menu);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ using Yi.Framework.Model.Models;
|
||||
|
||||
namespace Yi.Framework.Interface
|
||||
{
|
||||
public interface IMouldService : IBaseService<mould>
|
||||
public partial interface IMouldService : IBaseService<mould>
|
||||
{
|
||||
Task<bool> DelListByUpdateAsync(List<int> _ids);
|
||||
Task<IEnumerable<mould>> GetAllEntitiesTrueAsync();
|
||||
|
||||
@@ -7,7 +7,7 @@ using Yi.Framework.Model.Models;
|
||||
|
||||
namespace Yi.Framework.Interface
|
||||
{
|
||||
public interface IRoleService:IBaseService<role>
|
||||
public partial interface IRoleService:IBaseService<role>
|
||||
{
|
||||
Task<bool> DelListByUpdateAsync(List<int> _ids);
|
||||
Task<IEnumerable<role>> GetAllEntitiesTrueAsync();
|
||||
|
||||
@@ -7,7 +7,7 @@ using Yi.Framework.Model.Models;
|
||||
|
||||
namespace Yi.Framework.Interface
|
||||
{
|
||||
public interface IUserService:IBaseService<user>
|
||||
public partial interface IUserService:IBaseService<user>
|
||||
{
|
||||
Task<bool> DelListByUpdateAsync(List<int> _ids);
|
||||
Task<IEnumerable<user>> GetAllEntitiesTrueAsync();
|
||||
@@ -58,6 +58,13 @@ namespace Yi.Framework.Interface
|
||||
/// <param name="emailAddress"></param>
|
||||
/// <returns></returns>
|
||||
Task<bool> EmailIsExsit(string emailAddress);
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户的目录菜单,没有绑定接口
|
||||
/// </summary>
|
||||
/// <param name="_user"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<List<menu>>> GetMenuByUser(user _user);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
30
Yi.Framework/Yi.Framework.Interface/T4Iservice.cs
Normal file
30
Yi.Framework/Yi.Framework.Interface/T4Iservice.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Model.Models;
|
||||
|
||||
namespace Yi.Framework.Interface
|
||||
{
|
||||
|
||||
public partial interface IMenuService:IBaseService<menu>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public partial interface IMouldService:IBaseService<mould>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public partial interface IRoleService:IBaseService<role>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public partial interface IUserService:IBaseService<user>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
41
Yi.Framework/Yi.Framework.Interface/T4Iservice.tt
Normal file
41
Yi.Framework/Yi.Framework.Interface/T4Iservice.tt
Normal file
@@ -0,0 +1,41 @@
|
||||
<#@ template debug="false" hostspecific="true" language="C#" #>
|
||||
<#@ assembly name="System.Core" #>
|
||||
<#@ import namespace="System.Linq" #>
|
||||
<#@ import namespace="System.Text" #>
|
||||
<#@ import namespace="System.IO" #>
|
||||
<#@ import namespace="System.Collections.Generic" #>
|
||||
<#@ output extension=".cs" #>
|
||||
<#
|
||||
|
||||
DirectoryInfo dir = new DirectoryInfo(@"D:\YiFramework\Yi\Yi.Framework\Yi.Framework.Model\Models\");
|
||||
FileInfo[] finfo = dir.GetFiles();
|
||||
string filenames = string.Empty;
|
||||
List<string> filenameList = new List<string>();
|
||||
for (int i = 0; i < finfo.Length; i++)
|
||||
{
|
||||
filenames = finfo[i].Name ;
|
||||
string[] fname=filenames.Split('.');
|
||||
filenameList.Add(fname[0]);
|
||||
}
|
||||
|
||||
|
||||
#>
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Model.Models;
|
||||
|
||||
namespace Yi.Framework.Interface
|
||||
{
|
||||
<# foreach(string k in filenameList){
|
||||
string fn= k.Substring(0,1).ToUpper()+k.Substring(1);
|
||||
#>
|
||||
|
||||
public partial interface I<#= fn #>Service:IBaseService<<#= k #>>
|
||||
{
|
||||
|
||||
}
|
||||
<# } #>
|
||||
}
|
||||
@@ -8,13 +8,21 @@
|
||||
<Compile Remove="T4Service.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="T4Iservice.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>T4Iservice.tt</DependentUpon>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Yi.Framework.Model\Yi.Framework.Model.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="T4IService.tt">
|
||||
<LastGenOutput>T4IService.cs</LastGenOutput>
|
||||
<LastGenOutput>T4Iservice.cs</LastGenOutput>
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user