소스 검색

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