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.

OverCostActionArg.cs 1.9 kB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * 版权属于:yitter(yitter@126.com)
  3. * 开源地址:https://github.com/yitter/idgenerator
  4. * 版权协议:MIT
  5. * 版权说明:只要保留本版权,你可以免费使用、修改、分发本代码。
  6. * 免责条款:任何因为本代码产生的系统、法律、政治、宗教问题,均与版权所有者无关。
  7. *
  8. */
  9. using System;
  10. using System.Collections.Generic;
  11. using System.Text;
  12. namespace Yitter.IdGenerator
  13. {
  14. /// <summary>
  15. /// Id生成时回调参数
  16. /// </summary>
  17. public class OverCostActionArg
  18. {
  19. /// <summary>
  20. /// 事件类型
  21. /// 1-开始,2-结束,8-漂移
  22. /// </summary>
  23. public virtual int ActionType { get; set; }
  24. /// <summary>
  25. /// 时间戳
  26. /// </summary>
  27. public virtual long TimeTick { get; set; }
  28. /// <summary>
  29. /// 机器码
  30. /// </summary>
  31. public virtual ushort WorkerId { get; set; }
  32. /// <summary>
  33. /// 漂移计算次数
  34. /// </summary>
  35. public virtual int OverCostCountInOneTerm { get; set; }
  36. /// <summary>
  37. /// 漂移期间生产ID个数
  38. /// </summary>
  39. public virtual int GenCountInOneTerm { get; set; }
  40. /// <summary>
  41. /// 漂移周期
  42. /// </summary>
  43. public virtual int TermIndex { get; set; }
  44. public OverCostActionArg(ushort workerId, long timeTick, int actionType = 0, int overCostCountInOneTerm = 0, int genCountWhenOverCost = 0, int index = 0)
  45. {
  46. ActionType = actionType;
  47. TimeTick = timeTick;
  48. WorkerId = workerId;
  49. OverCostCountInOneTerm = overCostCountInOneTerm;
  50. GenCountInOneTerm = genCountWhenOverCost;
  51. TermIndex = index;
  52. }
  53. }
  54. }