mica 2.0.1 发布新增最好用的 ip2region boot stater
2021-03-03 21:50
573 查看
mica(云母)
mica 由如梦技术内部的 lutool(撸秃)演变而来。lutool 诞生于 2017 年,受 jhipster 启发逐步形成一个微服务的核心集。
因 lutool 名称与功能不太符合,故在2019年开源时将其改名为 mica(云母),寓意为云服务的基石。
mica 2.x核心依赖
mica 基于 java 8,没有历史包袱,支持传统 Servlet 和 Reactive(webflux)。采用 mica-auto 自动生成 spring.factories 和 spring-devtools.properties 配置,仅依赖 Spring boot、Spring cloud 全家桶,无第三方依赖。市面上鲜有的微服务核心组件。
依赖 | 版本 |
---|---|
Spring Boot | 2.2.x |
mica 2.0.1 更新说明
- :sparkles: 开源 mica-ip2region 组件。
- :zap: mica-core 优化 R.isNotSuccess 改为 isFail。
- :bug: mica-redis jackson class info。
- :bug: mica-redis jackson findAndRegisterModules。
- :wrench: travis 替换为 Github actions,用于构建和 Snapshot 版本自动发布。
- :arrow_up: update spring boot to 2.2.7.RELEASE。
版本号说明
release版本号格式为
x.x.x.发版当然日期,避免和内部的版本号冲突。
snapshots版本号格式为
x.x.x-SNAPSHOT,
snapshots版每次提交后会自动构建。
引用
mica-bom,可以简化依赖和依赖版本统一处理,避免jar冲突。
<dependencyManagement>
<dependencies>
<dependency>
<groupId>net.dreamlu</groupId>
<artifactId>mica-bom</artifactId>
<version>2.0.1.20200510</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
注意:maven 是按先后顺序进行依赖的,所以 mica-bom 顺序按
mica、
spring boot、
spring cloud依次添加。
mica-ip2region 最好用的 ip2region spring stater
maven
<dependency>
<groupId>net.dreamlu</groupId>
<artifactId>mica-ip2region</artifactId>
<version>${version}</version>
</dependency>
gradle
compile("net.dreamlu:mica-ip2region:${version}")
配置说明(已经内置,忽略)
配置项 | 默认值 | 说明 |
---|---|---|
mica.ip2region.db-file-location | classpath:ip2region/ip2region.db | ip2region.db 文件的地址,默认内置的文件 |
maven 自定义 ip2region.db 注意事项:
maven
resources拷贝文件是默认会做
filter,会导致我们的文件发生变化,导致不能读,
pom中你需要添加下面的配置。
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>db</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
关于 ip2region
ip2region Gitee 源码地址:https://gitee.com/lionsoul/ip2region
我们都会同步更新
ip2region.db文件,一般不需要手动配置。
使用文档
注入 bean
@Autowired
private Ip2regionSearcher regionSearcher;
方法说明
/**
* ip 位置 搜索
*
* @param ip ip
* @return 位置
*/
@Nullable
IpInfo memorySearch(long ip);
/**
* ip 位置 搜索
*
* @param ip ip
* @return 位置
*/
@Nullable
IpInfo memorySearch(String ip);
/**
* ip 位置 搜索
*
* @param ptr ptr
* @return 位置
*/
@Nullable
IpInfo getByIndexPtr(long ptr);
/**
* ip 位置 搜索
*
* @param ip ip
* @return 位置
*/
@Nullable
IpInfo btreeSearch(long ip);
/**
* ip 位置 搜索
*
* @param ip ip
* @return 位置
*/
@Nullable
IpInfo btreeSearch(String ip);
/**
* ip 位置 搜索
*
* @param ip ip
* @return 位置
*/
@Nullable
IpInfo binarySearch(long ip);
/**
* ip 位置 搜索
*
* @param ip ip
* @return 位置
*/
@Nullable
IpInfo binarySearch(String ip);
相关文章推荐
- MySoft.Data新版v2.7.3 beta发布,修正较多bug,新增功能尚未完全测试
- 地图服务器控件GIS Map Server v3.6发布,新增航空影像数据集功能
- 地图服务器控件GIS Map Server v3.6发布,新增航空影像数据集功能
- Visual Entity 1.7.0 发布(做最好的 NHibernate 设计器)
- Aspose.Pdf V17.4.0发布,改进功能新增多个API | 附下载
- ConVirt 2.0.1 中文版发布,图形化虚拟机管理
- PHP5.0正式发布 不完全兼容PHP4 新增多项功能
- 微软发布Silverlight 3正式版 新增50多项功能
- Android及JavaSE游戏引擎LGame-0.2.9发布(新增物理引擎支持)
- HTML5文档查看器PrizmDoc发布v13.0,新增文档比较功能
- Essential Studio for ASP.NET Web Forms发布2017 v2,新增自定义树形网格工具栏等
- 图像工具包VintaSoftImaging.NET SDK发布v8.5,新增独立web服务
- PDF插件VintaSoftPDF.NET Plug-in v5.5发布,新增PDF验证功能
- 2012财富世界500强发布,大陆首超日本,新增12家
- 站长发布外链怎样做效果最好
- Spring boot stater开发小助手,mica-auto 1.1.0 发布
- Qt5最快最好的程序发布方法——windeployqt
- 行动起来,制造最好的报表系统。 发布0.001版。
- LevenBlog2.0.1发布[提供下载]
- 最好用的安卓反编译、编译工具-AntiDroid V1.4.3发布了