package com.njcn.gather.systemops.database.util;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.UUID;

/**
 * 数据库运维编号工具。
 */
public final class DatabaseOpsIdUtil {

    private static final DateTimeFormatter TASK_FORMATTER = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS");

    private DatabaseOpsIdUtil() {
    }

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

    public static String taskNo(String prefix) {
        return prefix + LocalDateTime.now().format(TASK_FORMATTER);
    }
}
