Pu Zhibing
2025-02-19 8f45afced0c6a4085560c62dbd58e6ef0f4cecf4
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.ruoyi.web.tool;
 
import lombok.Data;
 
/**
 * 分布式id模型
 */
@Data
public class IDModel {
    /**
     * 时针回拨变量(全域值)
     */
    int hourHandVariable;
    /**
     * 最大时针回拨变量
     */
    int maxHourHandVariable;
    /**
     * 自增长变量
     */
    int selfGrowth;
    /**
     * 最大自增长变量
     */
    int maxSelfGrowth;
    /**
     * 返回的唯一id
     */
    long id;
 
    public IDModel() {
    }
 
    public IDModel(int hourHandVariable, int maxHourHandVariable, int selfGrowth, int maxSelfGrowth) {
        this.hourHandVariable = hourHandVariable;
        this.maxHourHandVariable = maxHourHandVariable;
        this.selfGrowth = selfGrowth;
        this.maxSelfGrowth = maxSelfGrowth;
    }
 
 
    public IDModel setIDModel(int hourHandVariable, int maxHourHandVariable, int selfGrowth, int maxSelfGrowth, long id){
        this.setHourHandVariable(hourHandVariable);
        this.setMaxHourHandVariable(maxHourHandVariable);
        this.setSelfGrowth(selfGrowth);
        this.setMaxSelfGrowth(maxSelfGrowth);
        this.setId(id);
        return this;
    }
}