// Mybatis-plus下的Sequence.java类, 采用5位workerId和5位datacenterId 作为雪花算法的workerId 及机器码IDpublicSequence(long workerId,long datacenterId){if(workerId > maxWorkerId || workerId <0){thrownewMybatisPlusException(String.format("worker Id can't be greater than %d or less than 0", maxWorkerId));}if(datacenterId > maxDatacenterId || datacenterId <0){thrownewMybatisPlusException(
String.format("datacenter Id can't be greater than %d or less than 0", maxDatacenterId));}this.workerId = workerId;this.datacenterId = datacenterId;}