z1415143022
2025-04-11 c95af62539744af5c622f91c9b4668b117211032
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.zhitan.common.utils.id;
 
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 
import java.util.UUID;
 
/**
 * 生成ID
 * @author ZhiTan
 * @date 2024/12/31
 */
public class IdGenUtil {
    public static long nextLongId() {
        return IncrLongIdUtil.nextLongId();
    }
 
    public static String randomId() {
        long id = IdWorker.getId();
        return String.valueOf(id);
    }
 
    public static Integer nextIntegerId() {
        return Math.abs(UUID.randomUUID().hashCode());
    }
}