Browse Source

初始化区域

master
WendyYang 1 year ago
parent
commit
2b679c8090
2 changed files with 27 additions and 1 deletions
  1. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/helper/basic/AbstractRegionCacheHelper.java
  2. +26
    -0
      pmapi/src/test/java/com/ningdatech/pmapi/common/helper/RegionCacheHelperTest.java

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/helper/basic/AbstractRegionCacheHelper.java View File

@@ -63,7 +63,7 @@ public abstract class AbstractRegionCacheHelper implements InitializingBean {
return RegionConverter.toRegionDTO(region); return RegionConverter.toRegionDTO(region);
}); });
// 初始化所有区域数据到缓存 // 初始化所有区域数据到缓存
// initRegionCache();
initRegionCache();
} }


} }

+ 26
- 0
pmapi/src/test/java/com/ningdatech/pmapi/common/helper/RegionCacheHelperTest.java View File

@@ -0,0 +1,26 @@
package com.ningdatech.pmapi.common.helper;

import com.ningdatech.pmapi.AppTests;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

import static org.junit.jupiter.api.Assertions.*;

/**
* <p>
* RegionCacheHelperTest
* </p>
*
* @author WendyYang
* @since 15:52 2023/3/7
*/
class RegionCacheHelperTest extends AppTests {

@Autowired
private RegionCacheHelper regionCacheHelper;

@Test
void listChildren() {
regionCacheHelper.listChildren("331100", 2).forEach(System.out::println);
}
}

Loading…
Cancel
Save