فهرست منبع

fix: 代码生成器中的WorkerId

jay 1 سال پیش
والد
کامیت
49b8241ad1
1فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 3 2
      iot-module/iot-generator/src/main/java/cc/iotkit/generator/config/MybatisPlusConfig.java

+ 3 - 2
iot-module/iot-generator/src/main/java/cc/iotkit/generator/config/MybatisPlusConfig.java

@@ -81,8 +81,9 @@ public class MybatisPlusConfig {
      */
     @Bean
     public IdentifierGenerator idGenerator() {
-        String hostAddress = NetUtil.getLocalhost().getHostAddress();
-        return new DbIdGenerator((short) ((short) hostAddress.hashCode()%64));
+//        String hostAddress = NetUtil.getLocalhost().getHostAddress();
+       // TODO: 采用配置文件里的
+        return new DbIdGenerator((short) 1);
     }
 
     /**