技术分享 | 数据持久化技术(Java)

本文节选自霍格沃兹测试学院内部教材

本章介绍 Web 后端开发中数据持久化技术 TKMyBatis。

TKMyBatis简介

TKMybatis 是基于 Mybatis 框架开发的一个工具,内部实现了对单表的基本数据操作,只需要简单继承 TKMybatis 提供的接口,就能够实现无需编写任何 sql 即能完成单表操作。

下面简单介绍下 MyBatis , MyBatis 是一款优秀的持久层框架,它支持自定义 SQL、存储过程以及高级映射。MyBatis 免除了几乎所有的 JDBC 代码以及设置参数和获取结果集的工作。MyBatis 可以通过简单的 XML 或注解来配置和映射原始类型、接口和 Java POJO(Plain Old Java Objects,普通老式 Java 对象)为数据库中的记录。

详细内容请参考 https://mybatis.org/mybatis-3/zh/index.html

TKMyBatis快速开始

Maven依赖

<pre class="copy-codeblocks" style="font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; font-size: 15.008px; display: block; position: relative; overflow: visible; color: rgb(34, 34, 34); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"> `<dependency>

        <groupId>org.mybatis.spring.boot</groupId>

        <artifactId>mybatis-spring-boot-starter</artifactId>

        <version>2.1.0</version>

    </dependency>

    <dependency>

        <groupId>tk.mybatis</groupId>

        <artifactId>mapper</artifactId>

        <version>4.0.3</version>

    </dependency>

    <dependency>

        <groupId>tk.mybatis</groupId>

        <artifactId>mapper-spring-boot-starter</artifactId>

        <version>2.0.3</version>

    </dependency>

    <dependency>

        <groupId>mysql</groupId>

        <artifactId>mysql-connector-java</artifactId>

        <scope>runtime</scope>

    </dependency>` </pre>

在启动类中配置 MapperScan 扫描

<pre class="copy-codeblocks" style="font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; font-size: 15.008px; display: block; position: relative; overflow: visible; color: rgb(34, 34, 34); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">`import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import tk.mybatis.spring.annotation.MapperScan;

@SpringBootApplication

@MapperScan("com.hogwartsmini.demo.dao")

public class DemoApplication {

public static void main(String[] args) {

    SpringApplication.run(DemoApplication.class, args);

}

}` </pre>

实体类中使用

在实体类中,常用的注解和意义为:

Table:描述数据库表信息,主要属性有 name(表名)、schema、catalog、uniqueConstraints 等。

Id:指定表主键字段,没有属性值。

Column:描述数据库字段信息,主要属性有 name(字段名)、columnDefinition、insertable、length、nullable(是否可为空)、precision、scale、table、unique、updatable 等。

ColumnType:描述数据库字段类型,可对一些特殊类型作配置,进行特殊处理,主要属性有 jdbcType、column、typeHandler 等。

dao 中使用

  • 创建业务 Mapper 公共接口

首先创建一个公共接口,继承 Mapper, MySqlMapper, IdsMapper 三个类,用于后续业务 Mapper 接口直接实现。

<pre class="copy-codeblocks" style="font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; font-size: 15.008px; display: block; position: relative; overflow: visible; color: rgb(34, 34, 34); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">`import tk.mybatis.mapper.common.IdsMapper;

import tk.mybatis.mapper.common.Mapper;

import tk.mybatis.mapper.common.MySqlMapper;

public interface MySqlExtensionMapper<T> extends Mapper<T>, MySqlMapper<T>, IdsMapper<T> {

}` </pre>

  • 创建业务 Mapper 接口

创建 HogwartsTestUserMapper.java 接口

<pre class="copy-codeblocks" style="font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; font-size: 15.008px; display: block; position: relative; overflow: visible; color: rgb(34, 34, 34); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">`import com.hogwartsmini.demo.common.MySqlExtensionMapper;

import com.hogwartsmini.demo.entity.HogwartsTestUser;

import org.springframework.stereotype.Repository;

@Repository

public interface HogwartsTestUserMapper extends MySqlExtensionMapper<HogwartsTestUser> {

}` </pre>

Service 层中使用

  • 新增操作
类型 说明
Mapper.insert(record) 保存一个实体,null 的属性也会保存,不会使用数据库默认值
Mapper.insertSelective(record) 保存一个实体,忽略空值,即没提交的值会使用使用数据库默认值
Mapper.insertUseGeneratedKeys(record) 保存一个实体,会自动填入在数据库中生成的 id 值。注意使用此方法插入数据时,如果 id 字段不是 AUTO_INCREMENT ,则不会生成新的 id
  • 删除
类型 说明
Mapper.delete(record) 根据实体属性作为条件进行删除,查询条件使用等号
Mapper.deleteByExample(example) 根据 Example 条件删除数据
Mapper.deleteByPrimaryKey(key) 根据主键字段进行删除,方法参数必须包含完整的主键属性
  • 修改
类型 说明
Mapper.updateByExample(record,example) 根据 Example 条件更新实体record 包含的全部属性,null 值会被更新
Mapper.updateByExampleSelective(record, example) 根据 Example 条件更新实体record 包含的不是 null 的属性值
Mapper.updateByPrimaryKey(record) 根据主键更新实体全部字段,null 值会被更新
Mapper.updateByPrimaryKeySelective(record) 根据主键更新属性不为 null 的值
  • 查询
类型 说明
Mapper.select(record) 根据实体中的属性值进行查询,查询条件使用等号
Mapper.selectAll() 查询全部结果
Mapper.selectByExample(example) 根据 Example 条件进行查询
Mapper.selectByPrimaryKey(key) 根据主键字段进行查询,方法参数必须包含完整的主键属性,查询条件使用等号
Mapper.selectCount(record) 根据实体中的属性查询总数,查询条件使用等号
Mapper.selectCountByExample(example) 根据 Example 条件进行查询总数
Mapper.selectByExample(example) 根据 Example 条件进行查询
Mapper.selectOne(record) 根据实体中的属性进行查询,只能有一个返回值,有多个结果是抛出异常,查询条件使用等号。但是如果存在某个属性为 int,则会初始化为 0。可能影响到实际使用

Spring Boot 配置文件

<pre class="copy-codeblocks" style="font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; font-size: 15.008px; display: block; position: relative; overflow: visible; color: rgb(34, 34, 34); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">`spring:

application:

name: aitest

数据库配置信息

datasource:

url: jdbc:mysql://localhost:3306/aitest_mini?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai

username: hogwarts

password: db@hogwarts

driver-class-name: com.mysql.cj.jdbc.Driver

mybatis:

mapper-locations: classpath:mapper/*.xml

type-aliases-package: com.hogwartstest.aitestmini.entity

configuration:

mapUnderscoreToCamelCase: true

logging:

level:

com.hogwartstest.aitestmini.dao: debug #打印sql` </pre>

示例表结构

<pre class="copy-codeblocks" style="font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; font-size: 15.008px; display: block; position: relative; overflow: visible; color: rgb(34, 34, 34); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">CREATE TABLEhogwarts_test_user` (

id int NOT NULL AUTO_INCREMENT COMMENT '主键',

user_name varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户名',

password varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '密码',

email varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '邮箱',

auto_create_case_job_name varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '自动生成用例job名称 不为空时表示已经创建job',

start_test_job_name varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '执行测试job名称 不为空时表示已经创建job',

default_jenkins_id int DEFAULT NULL COMMENT '默认Jenkins服务器',

create_time datetime NOT NULL COMMENT '创建时间',

update_time datetime NOT NULL COMMENT '更新时间',

PRIMARY KEY (id) USING BTREE

) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='用户表';` </pre>

Controller 代码

<pre class="copy-codeblocks" style="font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; font-size: 15.008px; display: block; position: relative; overflow: visible; color: rgb(34, 34, 34); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">`import com.hogwartsmini.demo.entity.HogwartsTestUser;

import com.hogwartsmini.demo.service.HogwartsTestUserService;

import io.swagger.annotations.Api;

import io.swagger.annotations.ApiOperation;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.*;

import java.util.List;

/**

  • @Author tlibn

  • @Date 2020/7/16 17:14

**/

@Api(tags = "霍格沃兹测试学院-用户管理模块")

@RestController

@RequestMapping("hogwartsUser")

public class HogwartsTestUserDbController {

@Autowired

private HogwartsTestUserService hogwartsTestUserService;

@ApiOperation("用户注册")

@PostMapping("register")

public HogwartsTestUser register(

        @RequestBody HogwartsTestUser hogwartsTestUser){

    return hogwartsTestUserService.save(hogwartsTestUser);

}

@ApiOperation("用户信息修改接口")

@PutMapping()

public HogwartsTestUser updateUserInfo(

        @RequestBody HogwartsTestUser hogwartsTestUser){

    return hogwartsTestUserService.update(hogwartsTestUser);

}

@ApiOperation("根据用户id删除用户信息")

@DeleteMapping("{userId}")

public Integer delete(@PathVariable("userId") Integer userId){

    return hogwartsTestUserService.delete(userId);

}

@ApiOperation("根据用户名查询")

@GetMapping("byName")

public List<HogwartsTestUser> getByName(

        @RequestParam("userName") String userName){

    HogwartsTestUser hogwartsTestUser = new HogwartsTestUser();

    hogwartsTestUser.setUserName(userName);

    return hogwartsTestUserService.getByName(hogwartsTestUser);

}` </pre>

HogwartsTestUserService 代码

<pre class="copy-codeblocks" style="font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; font-size: 15.008px; display: block; position: relative; overflow: visible; color: rgb(34, 34, 34); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">`import com.hogwartsmini.demo.entity.HogwartsTestUser;

import java.util.List;

public interface HogwartsTestUserService {

/**

  • 保存

  • @param hogwartsTestUser

  • @return

/
HogwartsTestUser save(HogwartsTestUser hogwartsTestUser);
/
*

  • 更新

  • @param hogwartsTestUser

  • @return

/
HogwartsTestUser update(HogwartsTestUser hogwartsTestUser);
/
*

  • 根据用户名查询

  • @param hogwartsTestUser

  • @return

/
List<HogwartsTestUser> getByName(HogwartsTestUser hogwartsTestUser);
/
*

  • 根据用户id删除用户信息

  • @param userId

  • @return

*/
Integer delete(Integer userId);
}` </pre>

HogwartsTestUserServiceImpl 代码

<pre class="copy-codeblocks" style="font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; font-size: 15.008px; display: block; position: relative; overflow: visible; color: rgb(34, 34, 34); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">`import com.hogwartsmini.demo.dao.HogwartsTestUserMapper;
import com.hogwartsmini.demo.entity.HogwartsTestUser;
import com.hogwartsmini.demo.service.HogwartsTestUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**

  • @Author tlibn
  • @Date 2020/7/17 11:03
    **/

@Service

public class HogwartsTestUserServiceImpl implements HogwartsTestUserService {

@Autowired
private HogwartsTestUserMapper hogwartsTestUserMapper;
/**
 * 保存
 *
 * @param hogwartsTestUser
 * @return
 */

@Override

public HogwartsTestUser save(HogwartsTestUser hogwartsTestUser) {

    hogwartsTestUser.setCreateTime(new Date());

    hogwartsTestUser.setUpdateTime(new Date());

    hogwartsTestUserMapper.insertUseGeneratedKeys(hogwartsTestUser);

    return hogwartsTestUser;

}

/**
 * 更新
 *
 * @param hogwartsTestUser
 * @return
 */
@Override
public HogwartsTestUser update(HogwartsTestUser hogwartsTestUser) {
    hogwartsTestUser.setCreateTime(new Date());
    hogwartsTestUser.setUpdateTime(new Date());
    hogwartsTestUserMapper.updateByPrimaryKeySelective(hogwartsTestUser);
    return hogwartsTestUser;
}
/**
 * 根据用户名查询
 *
 * @param hogwartsTestUser
 * @return
 */
@Override
public List<HogwartsTestUser> getByName(HogwartsTestUser hogwartsTestUser) {
    List<HogwartsTestUser> hogwartsTestUserList = hogwartsTestUserMapper.select(hogwartsTestUser);
    return hogwartsTestUserList;
}

/**
 * 根据用户id删除用户信息
 *
 * @param userId
 * @return
 */
@Override
public Integer delete(Integer userId) {
    HogwartsTestUser hogwartsTestUser = new HogwartsTestUser();
    hogwartsTestUser.setId(userId);
    hogwartsTestUserMapper.delete(hogwartsTestUser);
    return userId;
}

}` </pre>

使用 Postman 测试增删改查

  • 新增

POST http://127.0.0.1:8081/hogwartsUser/register

请求参数

<pre class="copy-codeblocks" style="font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; font-size: 15.008px; display: block; position: relative; overflow: visible; color: rgb(34, 34, 34); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">{ "userName": "霍格沃兹test123", "password": "test123" } </pre>

响应参数

<pre class="copy-codeblocks" style="font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; font-size: 15.008px; display: block; position: relative; overflow: visible; color: rgb(34, 34, 34); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">{ "id": 15, "userName": "霍格沃兹test123", "password": "test123", "email": null, "autoCreateCaseJobName": null, "startTestJobName": null, "defaultJenkinsId": null, "createTime": "2021-04-14T09:37:58.358+00:00", "updateTime": "2021-04-14T09:37:58.358+00:00" } </pre>

  • 查询

GET http://127.0.0.1:8081/hogwartsUser/byName?userName=霍格沃兹test123

请求参数

<pre class="copy-codeblocks" style="font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; font-size: 15.008px; display: block; position: relative; overflow: visible; color: rgb(34, 34, 34); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">见请求地址中 userName =霍格沃兹test123 </pre>

响应参数

<pre class="copy-codeblocks" style="font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; font-size: 15.008px; display: block; position: relative; overflow: visible; color: rgb(34, 34, 34); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">[ { "id": 15, "userName": "霍格沃兹test123", "password": "test123", "email": null, "autoCreateCaseJobName": null, "startTestJobName": null, "defaultJenkinsId": null, "createTime": "2021-04-14T09:37:58.000+00:00", "updateTime": "2021-04-14T09:37:58.000+00:00" } ] </pre>

  • 修改

PUT http://127.0.0.1:8081/hogwartsUser

请求参数

<pre class="copy-codeblocks" style="font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; font-size: 15.008px; display: block; position: relative; overflow: visible; color: rgb(34, 34, 34); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">{ "id": 15, "userName": "霍格沃兹test12345", "password": "test123" } </pre>

响应参数

<pre class="copy-codeblocks" style="font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; font-size: 15.008px; display: block; position: relative; overflow: visible; color: rgb(34, 34, 34); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">{ "id": 15, "userName": "霍格沃兹test12345", "password": "test123", "email": null, "autoCreateCaseJobName": null, "startTestJobName": null, "defaultJenkinsId": null, "createTime": "2021-04-14T09:43:45.018+00:00", "updateTime": "2021-04-14T09:43:45.018+00:00" } </pre>

  • 删除

DELETE http://127.0.0.1:8081/hogwartsUser/15

请求参数

<pre class="copy-codeblocks" style="font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; font-size: 15.008px; display: block; position: relative; overflow: visible; color: rgb(34, 34, 34); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">见请求地址中15 </pre>

响应参数

<pre class="copy-codeblocks" style="font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; font-size: 15.008px; display: block; position: relative; overflow: visible; color: rgb(34, 34, 34); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">15 </pre>

数据持久化技术就先讲到这里啦~大家要多练习哦,才能学的更扎实。
更多技术文章

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 224,642评论 6 522
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 96,168评论 3 402
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 171,809评论 0 366
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 60,921评论 1 300
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 69,924评论 6 399
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 53,415评论 1 314
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 41,794评论 3 428
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 40,765评论 0 279
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 47,297评论 1 324
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 39,331评论 3 345
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 41,458评论 1 354
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 37,065评论 5 350
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 42,777评论 3 337
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 33,233评论 0 25
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 34,366评论 1 275
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 50,001评论 3 381
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 46,524评论 2 365

推荐阅读更多精彩内容