package cn.reghao.tnb.common.util;

import cn.reghao.jutil.jdk.string.SnowFlake;
import org.springframework.stereotype.Component;

import java.util.UUID;

/**
 * ID 生成服务
 *
 * @author reghao
 * @date 2025-09-05 17:07:53
 */
@Component
public class IdService {
    private final SnowFlake idGenerator;
    private int dcId = 1;
    private int machineId = 1;

    public IdService() {
        this.idGenerator = new SnowFlake(dcId, machineId);
    }

    public long getLongId() {
        return idGenerator.nextId();
    }

    public String getStringId() {
        return null;
    }

    public String getFileId() {
        return UUID.randomUUID().toString().replace("-", "");
    }
}
