All Downloads are FREE. Search and download functionalities are using the official Maven repository.

love.keeping.starter.web.utils.IdUtil Maven / Gradle / Ivy

The newest version!
package love.keeping.starter.web.utils;

import love.keeping.starter.common.utils.IdWorker;
import love.keeping.starter.web.common.utils.ApplicationUtil;

/**
 * ID工具类
 *
 * @author Keeping
 */
public class IdUtil {

  /**
   * 获取ID(雪花算法)
   *
   * @return
   */
  public static String getId() {

    IdWorker idWorker = ApplicationUtil.getBean(IdWorker.class);
    return idWorker.nextIdStr();
  }

  /**
   * 获取UUID
   *
   * @return
   */
  public static String getUUID() {
    return cn.hutool.core.util.IdUtil.fastSimpleUUID();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy