KxUtilsConfigurationProperties.java 825 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
package com.kx.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * utils 项目配置application.yaml配置项
 * @author kongxiang
 */
@ConfigurationProperties(prefix = "spring.utils" )
@Data
public class KxUtilsConfigurationProperties {

    private IdConfig id = new IdConfig();


    @Data
    public static class IdConfig {
        /**
         * 默认id生成器算法
         */
        String defaultIdGenerator = "uuid";
23 24 25

        SnowFlowerConfig snowFlower = new SnowFlowerConfig();

26 27
    }

28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
    /**
     * 雪花算法配置
     */
    @Data
    public static class SnowFlowerConfig {
        /**
         * data center id
         */
        long dataCenterId = 1L;

        /**
         * worker id
         */
        long workerId = 1L;
    }


45
}