public class RedisId extends Object
| 构造器和说明 |
|---|
RedisId() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
next()
获取自增的唯一标识(yyyyMMdd + 指定位数流水号)
每天重置流水号
|
static String |
next(int serialLength)
获取自增的唯一标识(yyyyMMdd + 指定位数流水号)
每天重置流水号
|
static String |
next(String prefix)
根据前缀生成唯一标识(prefix + yyyyMMdd + 指定位数流水号)
每天重置流水号
|
static String |
next(String prefix,
int serialLength)
根据前缀生成唯一标识(prefix + yyyyMMdd + 指定位数流水号)
每天重置流水号
|
static String |
redisNext(String key,
int serialLength)
在redis中获取指定key的自增数值, 并使用0补齐到serialLength位
每天重置流水号
|
void |
setRedisTemplate(org.springframework.data.redis.core.RedisTemplate<String,Object> redisTemplate) |
void |
setSerialLength(int serialLength) |
public static String next(String prefix)
每天重置流水号
prefix - 前缀public static String next(String prefix, int serialLength)
每天重置流水号
prefix - 前缀serialLength - 补齐长度public static String next()
每天重置流水号
public static String next(int serialLength)
每天重置流水号
serialLength - 补齐长度public static String redisNext(String key, int serialLength)
每天重置流水号
key - redis中的keyserialLength - 补齐长度public void setSerialLength(int serialLength)
Copyright © 2020. All rights reserved.