说明: 通过抓取网页数据时时更新数据---------用jpa来进行数据存储
1,导入jar
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.0.29</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.6</version>
</dependency>
<dependency>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>
</dependencies>
*********************************************
2,写实体类
public class DrawModel {
// 游戏编号
private String game;
// 采集源编号
private String source;
// 游戏期号
private String issue;
// 开奖结果
private String drawcode;
// 开奖时间
private String drawtime;
// 身份验证token
private String token;
........省去 get set
}
******************************
4,写个枚举 enum
/**
* 所有游戏的枚举
*/
public enum GameType {
GDKL10,
CQSSC,
GXKL10,
XYNC,
BJPK10,
.......
}
******************
作者:滔滔逐浪
链接:https://www.jianshu.com/p/9326d37c6727
共同学习,写下你的评论
评论加载中...
作者其他优质文章