birt
2025-04-13 b0530ed9211230227a8f94e394eda779d5ae5fc1
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 Geoffrey
 * @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());
    }
}