76 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			76 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
<#@ template debug="false" hostspecific="true" language="C#" #>
 | 
						|
<#@ output extension=".cs" #>
 | 
						|
<#@ assembly name="System.Core.dll" #>
 | 
						|
<#@ assembly name="System.Data.dll" #>
 | 
						|
<#@ assembly name="System.Data.DataSetExtensions.dll" #>
 | 
						|
<#@ assembly name="System.Xml.dll" #>
 | 
						|
<#@ import namespace="System" #>
 | 
						|
<#@ import namespace="System.Xml" #>
 | 
						|
<#@ import namespace="System.Linq" #>
 | 
						|
<#@ import namespace="System.Data" #>
 | 
						|
<#@ import namespace="System.Data.SqlClient" #>
 | 
						|
<#@ import namespace="System.Collections.Generic" #>
 | 
						|
<#@ import namespace="System.IO" #>
 | 
						|
<#@ include file="$(ProjectDir)DbHelper.ttinclude"  #>
 | 
						|
<#@ include file="$(ProjectDir)ModelAuto.ttinclude"	#>
 | 
						|
<# var manager = new Manager(Host, GenerationEnvironment, true); #>
 | 
						|
 | 
						|
//在这里设置 isPage 是否生成分页的还是不分页
 | 
						|
 | 
						|
<# 
 | 
						|
	var isPage=false;
 | 
						|
 #>
 | 
						|
 | 
						|
<# 
 | 
						|
	var OutputPath1 =Path.GetDirectoryName(Host.TemplateFile+"..");
 | 
						|
	OutputPath1=Path.Combine(OutputPath1,"IServices_New");
 | 
						|
	if (!Directory.Exists(OutputPath1))
 | 
						|
	{
 | 
						|
	    Directory.CreateDirectory(OutputPath1);
 | 
						|
	}
 | 
						|
#>
 | 
						|
 | 
						|
 | 
						|
<# foreach (var item in DbHelper.GetDbTablesNew(config.ConnectionString, config.DbDatabase,config.TableName))
 | 
						|
   {
 | 
						|
		 var tableName=item.ToString();
 | 
						|
		manager.StartBlock("I"+tableName+"Service"+".cs",OutputPath1);//文件名
 | 
						|
#>
 | 
						|
//--------------------------------------------------------------------
 | 
						|
//     此代码由T4模板自动生成  byzhouhang 20210918
 | 
						|
//	   生成时间 <#=DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")#> 
 | 
						|
//     对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
 | 
						|
//--------------------------------------------------------------------
 | 
						|
 | 
						|
using IRaCIS.Core.Application.ViewModel;
 | 
						|
namespace IRaCIS.Core.Application.Interfaces
 | 
						|
{	
 | 
						|
	/// <summary>
 | 
						|
	/// I<#=tableName#>Service
 | 
						|
	/// </summary>	
 | 
						|
	public interface I<#=tableName#>Service
 | 
						|
    {
 | 
						|
 | 
						|
	   <# if(isPage){#>
 | 
						|
	    Task<PageOutput<<#=tableName#>View>>  Get<#=tableName#>List(<#=tableName#>Query query<#=tableName#>);
 | 
						|
	    <# }  else {#>
 | 
						|
 | 
						|
		 Task<List<<#=tableName#>View>>  Get<#=tableName#>List(<#=tableName#>Query query<#=tableName#>);
 | 
						|
	    <# }#>
 | 
						|
 | 
						|
         Task<IResponseOutput> AddOrUpdate<#=tableName#>(<#=tableName#>AddOrEdit addOrEdit<#=tableName#>);
 | 
						|
 | 
						|
         Task<IResponseOutput> Delete<#=tableName#>(Guid <#=char.ToLower(tableName[0]) + tableName.Substring(1)#>Id);
 | 
						|
 | 
						|
       
 | 
						|
    }
 | 
						|
} 
 | 
						|
<#
 | 
						|
   manager.EndBlock(); 
 | 
						|
   }
 | 
						|
  manager.Process(true);
 | 
						|
 #>
 | 
						|
 | 
						|
 | 
						|
 |