package com.prolog.upcloud.base.wh.operate.utils;

import cn.hutool.core.lang.Assert;
import com.prolog.framework.bz.common.sequence.SequenceApi;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class IdUtil {

    /**
     * 得到id
     *
     * @param resource 资源
     * @return {@link String}
     */
    public static String getId(String resource) {
        String result = SequenceApi.getInstance().next(resource);
        log.info("id:{},resource:{}", result, resource);
        Assert.notEmpty(result, "获取ID失败");
        return result;
    }
}
