Эх сурвалжийг харах

fix: 代码生成器中的WorkerId

jay 1 жил өмнө
parent
commit
49b8241ad1

+ 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);
     }
 
     /**