IdGenerator是一个缩了位的雪花ID生成算法,生成的位数是16位,不会导致JS精度丢失 package com.yrt.framework.config; import java.util.Date; import java.util.UUID; /** * compressed id generator, result id not great than 53bits before 2318-06-04. */ public class IdGenerator { private static IdG...
IdGenerator是一个缩了位的雪花ID生成算法,生成的位数是16位,不会导致JS精度丢失 package com.yrt.framework.config; import java.util.Date; import java.util.UUID; /** * compressed id generator, result id not great than 53bits before 2318-06-04. */ public class IdGenerator { private static IdG...
我们采用自定义ID生成器提供一个ID生成策略 @ComponentpublicclassCustomerIdGeneratorimplementsIdentifierGenerator{@OverridepublicLongnextId(Object entity){// 填充自己的Id生成器,returnIdGenerator.generateId(); } }java @Component public class CustomerIdGenerator implements IdentifierGenerator { @Override public Lo...