You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Generator.py 383 B

1234567891011121314151617
  1. from .Options import IdGeneratorOptions
  2. from .SnowFlakeM1 import SnowFlakeM1
  3. class DefaultIdGenerator():
  4. def SetIdGernerator(self, options:IdGeneratorOptions) :
  5. if options.BaseTime < 100000 :
  6. raise ValueError ("BaseTime error.")
  7. self.SnowFlake= SnowFlakeM1(options)
  8. def NextId(self) -> int:
  9. """
  10. 获取新的UUID
  11. """
  12. return self.SnowFlake.NextId()