id设为string
This commit is contained in:
@@ -601,6 +601,7 @@ public class DataBaseService : IDynamicApiController, ITransient
|
||||
List<string> dirs = new List<string>();
|
||||
foreach (string key in nsMapper.Keys)
|
||||
{
|
||||
if (key != "eqp_") continue;
|
||||
var nsName = nsMapper[key];
|
||||
var dir = Path.Combine(FileVariable.GenerateCodePath, nsName);
|
||||
dirs.Add(dir);
|
||||
@@ -661,7 +662,11 @@ public class DataBaseService : IDynamicApiController, ITransient
|
||||
if (sugarAttrs.Count > 0)
|
||||
sugarColumnStr = $"\r\n [SugarColumn({string.Join(", ", sugarAttrs)})]";
|
||||
var txt = tpl.Replace("{PropertyType}", type).Replace("{PropertyName}", col.DbColumnName).Replace("{SugarColumn}", sugarColumnStr);
|
||||
if (col.DbColumnName == "id") txt = txt.TrimEnd('\n', '\r') + " = SnowflakeIdHelper.NextId();\r\n";
|
||||
if (col.DbColumnName == "id")
|
||||
{
|
||||
if(type == "string") txt = txt.TrimEnd('\n', '\r') + " = SnowflakeIdHelper.NextId();\r\n";
|
||||
else if(type == "long") txt = txt.TrimEnd('\n', '\r') + " = YitIdHelper.NextId();\r\n";
|
||||
}
|
||||
else if (type == "string") txt = txt.TrimEnd('\n', '\r') + " = string.Empty;\r\n";
|
||||
return txt;
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user