using GenerateCode_WeiBen_WMS.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace GenerateCode_GEBrilliantFactory
{
///
/// 生成查询实体类
///
public class AppService_Generate : BaseGenerate
{
public static string CreateText(GenerateCodeParam param)
{
var str = TextHelper.ReadText(@"Templete\AppService\AppService模板.txt");
CommonReplace(ref str);
CommonHelper.CommonReplaceStr(param, ref str);
string attrString = "";
List newColumnNameList = ListHelper.RemoveAttrForUpdateMode(param.ColumnNameList);
//优化,这个地方不用了
//for (int i = 0; i < newColumnNameList.Count; ++i)
//{
// attrString += StructStrHelper.GenerateAttributeForUpdateModel(newColumnNameList[i], param);
//}
//str = str.Replace("$UpdateAttributes$", attrString);
attrString = "";
for (int i = 0; i < newColumnNameList.Count; ++i)
{
attrString += StructStrHelper.GenerateAttributeForUpdateModelByImport(newColumnNameList[i], param);
}
str = str.Replace("$UpdateAttributesForImport$", attrString);
attrString = "";
for (int i = 0; i < newColumnNameList.Count; ++i)
{
attrString += StructStrHelper.GenerateAttributeForCheckCreateOrUpdateDtoAsync(newColumnNameList[i], param);
}
str = str.Replace("$UpdateAttributesForCheckCreateOrUpdateDtoAsync$", attrString);
//优化,这代码不用了
//attrString = "";
//for (int i = 0; i < newColumnNameList.Count; ++i)
//{
// attrString += StructStrHelper.GenerateAttribute_AppService_ImportAsync(newColumnNameList[i], param);
//}
//str = str.Replace("$AppService_ImportAsync$", attrString);
return str;
}
}
}