You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
493 B
22 lines
493 B
using Microsoft.Extensions.Options;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using Yitter.IdGenerator;
|
|
|
|
namespace Shentun.Utilities
|
|
{
|
|
public static class IdGeneratorHelper
|
|
{
|
|
|
|
static IdGeneratorHelper()
|
|
{
|
|
var options = new IdGeneratorOptions(1);
|
|
YitIdHelper.SetIdGenerator(options);
|
|
}
|
|
public static long CreateSnowflakeId()
|
|
{
|
|
return YitIdHelper.NextId();
|
|
}
|
|
}
|
|
}
|