1 Star 0 Fork 195

第三方 / spring-boot-data-supporter

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

spring-boot-data-supporter

QQ交流群:

alt text

本项目的Mysql和MongoDB数据库(下面是详细的处理过程,免做伸手党,学习学习没坏处):

https://git.oschina.net/duhongming/spring-boot-data-supporter/attach_files

new-使用NLP和Hadoop统计分词个数

new-基金决策分析

new-慕课网数据爬取与分析

1 地理区域5级联动

2 身份证信息

3 全国天气情况

4 基金决策分析

5 ip地址定位库

6 一元线性回归获取样本数据建立模型

7 Ansj中文分词服务

1 地理区域5级联动

1.1 数据源导入到Mysql和MongoDB中


  1. 下载中国5级行政区域mysql库:https://github.com/kakuilan/china_area_mysql

爬取国家统计局官网的行政区域数据:http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/

  1. 通过Navicat,在数据库上右键 >>> 运行SQL文件
#数据库设置问题:set global max_allowed_packet=1024*1024*160这样就好了(因为太大了100多M,所以我设置了160M):

ERROR 2006 (HY000) at line 22: MySQL server has gone away
Operation failed with exitcode 1

3) 重命名表:cnarea_2018 >>> cnarea


4)Mysql转MongoDB数据库用的是MongoVUE,Collections右键>>>RDBMS Import>>>from Mysql

5)更新数据库中集合的字段

db.cnarea.update({}, {$rename : {"parent_id" : "parentId","area_code" : "areaCode","zip_code" : "zipCode","city_code" : "cityCode","short_name" : "shortName","merger_name" : "mergerName"}}, false, true);

6)windows导出MongoDB数据库

mongodump -d data-supporter -c cnarea -o D:/mongodump/

7)windows导入MongoDB数据库(支持跨服务器,非常方便,速度非常快)

mongorestore -h 192.168.1.108 -d data-supporter --dir D:/mongodump/data-supporter/

1.2 修改数据库配置信息

application.properties配置文件中

spring.datasource.url=jdbc:mysql://127.0.0.1:3306/data-supporter
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.data.mongodb.uri=mongodb://127.0.0.1:27017/data-supporter

1.3 请通过swagger进行项目调试

http://localhost:8080/swagger-ui.html

地理区域省级调试页面: alt text

地理区域第2-5级调试页面: alt text

1.4 地理区域5级联动演示页面

http://localhost:8080/

alt text

2 身份证信息

2.1 下载身份证信息json库

https://github.com/NoBey/IdCard

下载IdCard/data/data.json,重命名为idcard.json,放到resources\static文件夹下

2.2 身份证信息用Gson将Json数据转成Map,其他的Json框架都试了,都不好用

Map<String, Object> map = JsonUtil.toMap(JsonUtil.parseJson(injectInfo()));

2.3 idcard身份证信息获取出生年月日、岁数、性别、生肖、星座、地理位置

alt text alt text

3 全国天气情况

3.1 全国天气情况

http://www.weather.com.cn/

3.2 获取某个城市的一段时间的天气

alt text alt text

5 ip地址定位库

  1. 下载ip地址定位库:https://git.oschina.net/lionsoul/ip2region

  2. 在application.properties配置关联路径即可:

ip.region.db.file=D:\\gitRespo\\open-source\\spring-boot-data-supporter\\resources\\static\\ipdata\\ip2region.db

3) 演示地址:http://localhost:8080/swagger-ui.html

alt text

6 一元线性回归获取样本数据建立模型

alt text

7 Ansj中文分词服务

https://github.com/NLPchina/ansj_seg

Spring Boot 教程大家学习下: http://blog.didispace.com/categories/Spring-Boot/page/4/

空文件

简介

1.中国5级行政区域联动(Mysql/MongoDB版)2.身份证信息3.近5年全国各个省市区的天气信息4.汽车牌照信息5.历史上的今天 展开 收起
Java
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/third_party_code_01/spring-boot-data-supporter.git
git@gitee.com:third_party_code_01/spring-boot-data-supporter.git
third_party_code_01
spring-boot-data-supporter
spring-boot-data-supporter
master

搜索帮助