Browse Source

增加YidHelper快速使用方法

tags/v1.0.0
zhouzj 4 years ago
parent
commit
13cdd1cea3
3 changed files with 5 additions and 5 deletions
  1. +2
    -2
      src/Yitter.IdGenTest/Program.cs
  2. +0
    -0
      src/Yitter.IdGenerator/YidGenerator.cs
  3. +3
    -3
      src/Yitter.IdGenerator/YidHelper.cs

+ 2
- 2
src/Yitter.IdGenTest/Program.cs View File

@@ -53,7 +53,7 @@ namespace Yitter.OrgSystem.TestA
IdGeneratorOptions options1 = (newConfig);
if (IdGen == null)
{
IdGen = new YitIdGenerator(options1);
IdGen = new YidGenerator(options1);
}
if (outputLog)
@@ -99,7 +99,7 @@ namespace Yitter.OrgSystem.TestA
};
Console.WriteLine("Gen:" + i);
var idGen2 = new YitIdGenerator(options);
var idGen2 = new YidGenerator(options);
var test = new GenTest(idGen2, genIdCount, i);
if (outputLog)


src/Yitter.IdGenerator/YitIdGenerator.cs → src/Yitter.IdGenerator/YidGenerator.cs View File


+ 3
- 3
src/Yitter.IdGenerator/YidHelper.cs View File

@@ -14,7 +14,7 @@ using System.Text;
namespace Yitter.IdGenerator
{
/// <summary>
/// 这是一个调用的例子,默认情况下,集成者可以直接使用 NewId()。
/// 这是一个调用的例子,默认情况下,单机集成者可以直接使用 NewId()。
/// </summary>
public class YidHelper
{
@@ -30,7 +30,7 @@ namespace Yitter.IdGenerator
public static void SetIdGenerator(IdGeneratorOptions options)
{
_IdGenInstance = new YitIdGenerator(options);
_IdGenInstance = new YidGenerator(options);
}
/// <summary>
@@ -43,7 +43,7 @@ namespace Yitter.IdGenerator
{
if (_IdGenInstance == null)
{
_IdGenInstance = new YitIdGenerator(new IdGeneratorOptions() { WorkerId = 1 });
_IdGenInstance = new YidGenerator(new IdGeneratorOptions() { WorkerId = 1 });
}
return _IdGenInstance.NewLong();


Loading…
Cancel
Save