main主干首次提交,包含用户认证模块

This commit is contained in:
wh
2026-04-23 11:59:31 +08:00
commit cbef58aee5
65 changed files with 2335 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
package com.labelsys.backend.util;
import java.util.concurrent.atomic.AtomicInteger;
public final class IdGenerator {
private static final AtomicInteger SEQUENCE = new AtomicInteger();
private IdGenerator() {
}
public static long nextId() {
int sequence = SEQUENCE.updateAndGet(value -> value >= 999 ? 0 : value + 1);
return System.currentTimeMillis() * 1000 + sequence;
}
}