id设为string
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using JNPF.Common.Security;
|
||||
using SqlSugar;
|
||||
using Yitter.IdGenerator;
|
||||
|
||||
namespace Tnb.BasicData.Entities
|
||||
{
|
||||
@@ -22,7 +23,7 @@ namespace Tnb.BasicData.Entities
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey=true)]
|
||||
public long id {get;set;} = SnowflakeIdHelper.NextId();
|
||||
public long id {get;set;} = YitIdHelper.NextId();
|
||||
|
||||
/// <summary>
|
||||
/// Desc:TODO
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Tnb.EquipMgr.Entities
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey=true)]
|
||||
public long id {get;set;} = SnowflakeIdHelper.NextId();
|
||||
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
||||
|
||||
/// <summary>
|
||||
/// Desc:TODO
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Tnb.EquipMgr.Entities
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey=true)]
|
||||
public long id {get;set;} = SnowflakeIdHelper.NextId();
|
||||
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
||||
|
||||
/// <summary>
|
||||
/// Desc:TODO
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Tnb.EquipMgr.Entities
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey=true)]
|
||||
public char id {get;set;} = SnowflakeIdHelper.NextId();
|
||||
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
||||
|
||||
/// <summary>
|
||||
/// Desc:TODO
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Tnb.EquipMgr.Entities
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey=true)]
|
||||
public char id {get;set;} = SnowflakeIdHelper.NextId();
|
||||
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
||||
|
||||
/// <summary>
|
||||
/// Desc:TODO
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Tnb.EquipMgr.Entities
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey=true)]
|
||||
public long id {get;set;} = SnowflakeIdHelper.NextId();
|
||||
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
||||
|
||||
/// <summary>
|
||||
/// Desc:TODO
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Tnb.EquipMgr.Entities
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey=true)]
|
||||
public long id {get;set;} = SnowflakeIdHelper.NextId();
|
||||
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
||||
|
||||
/// <summary>
|
||||
/// Desc:TODO
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Tnb.EquipMgr.Entities
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey=true)]
|
||||
public long id {get;set;} = SnowflakeIdHelper.NextId();
|
||||
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
||||
|
||||
/// <summary>
|
||||
/// Desc:TODO
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Tnb.EquipMgr.Entities
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey=true)]
|
||||
public long id {get;set;} = SnowflakeIdHelper.NextId();
|
||||
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
||||
|
||||
/// <summary>
|
||||
/// Desc:TODO
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Tnb.EquipMgr.Entities
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey=true)]
|
||||
public long id {get;set;} = SnowflakeIdHelper.NextId();
|
||||
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
||||
|
||||
/// <summary>
|
||||
/// Desc:TODO
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Tnb.ProductionMgr.Entities
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey=true)]
|
||||
public char id {get;set;} = SnowflakeIdHelper.NextId();
|
||||
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
||||
|
||||
/// <summary>
|
||||
/// Desc:TODO
|
||||
|
||||
@@ -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