package org.nl.config.mybatis;

import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import org.springframework.stereotype.Component;

/**
 * @Author: lyd
 * @Description: ID自动生成策略
 * @Date: 2023/5/4
 */
@Component
public class CustomIdGenerator implements IdentifierGenerator {
    @Override
    public Number nextId(Object entity) {
        return IdUtil.getSnowflake(1,1).nextId();
    }
}
