package com.changhu.support.mybatisplus.config;

import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import com.changhu.common.utils.SnowFlakeIdUtil;
import org.springframework.context.annotation.Configuration;

/**
 * author: luozhun
 * desc: 自定义id生成器
 * createTime: 2023/12/1 16:45
 */
@Configuration
public class CustomIdGenerator implements IdentifierGenerator {
    @Override
    public Long nextId(Object entity) {
        return SnowFlakeIdUtil.snowflakeId();
    }
}
