package com.platform.utils;

import lombok.extern.log4j.Log4j2;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.UUID;

/**
 * @author abnerhou
 * @date 2020/4/22 16:39
 * @desciption
 */
@Component
@Slf4j
public class UUidGenerator {

    public static String generatorUuid(String starter) {
        StringBuilder stringBuilder = new StringBuilder();
        String tmp = UUID.randomUUID().toString().replace("-", "");
        tmp = tmp.substring(tmp.length() - 15);
        stringBuilder.append(starter).append(tmp).append((new Date()).getTime());
        return stringBuilder.toString();
    }

}
