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 + 指定位数流水号)
|
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 void setSerialLength(int serialLength)
Copyright © 2020. All rights reserved.