This commit is contained in:
2025-07-04 09:50:02 +08:00
commit 3d800dbd11
2564 changed files with 1353015 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
using MyCode.Project.Infrastructure.Cache;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MyCode.Project.Infrastructure.Common
{
public sealed class IdHelper
{
private static long NextId = 0;
private static readonly object idLock = new object();
private static int IdLastNum = Convert.ToInt32(WebConfigUtils.GetAppSettingsInfo("IdLastNum"));
public static long GetNewId()
{
lock (idLock)
{
if (NextId == 0)
{
NextId = Convert.ToInt64(DateTime.Now.ToString("yyMMddHHmmssfff"));
}
NextId = NextId + 1;
return Convert.ToInt64(NextId.ToString() + IdLastNum);
}
}
}
}