Springboot2集成pagehelper过程图解

springboot2集成pagehelper超级简单,本示例直接抄袭官方示例,仅将数据库由H2改成MySQL而已。

1、pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.2.1.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
  </parent>
  <groupId>qinfeng.zheng</groupId>
  <artifactId>learn-pagequery</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>learn-pagequery</name>
  <description>Demo project for Spring Boot</description>

  <properties>
    <java.version>1.8</java.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
      <groupId>org.mybatis.spring.boot</groupId>
      <artifactId>mybatis-spring-boot-starter</artifactId>
      <version>1.3.2</version>
    </dependency>
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>5.1.47</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.junit.vintage</groupId>
          <artifactId>junit-vintage-engine</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.github.pagehelper</groupId>
      <artifactId>pagehelper-spring-boot-starter</artifactId>
      <version>1.2.12</version>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

</project>

2. application.peroperties

#pagehelper
pagehelper.helper-dialect=mysql
pagehelper.params=count=countSql
pagehelper.reasonable=true
pagehelper.support-methods-arguments=true

#mysql
spring.datasource.driver-class-name = com.mysql.jdbc.Driver
spring.datasource.url= jdbc:mysql://120.79.xx.xx:3306/test?useUnicode=yes&characterEncoding=UTF-8&useSSL=false
spring.datasource.username = root
spring.datasource.password = 1212212

3.实体类

public class Country implements Serializable {
  private static final long serialVersionUID = 6569081236403751407L;

  private int  id;
  private String countryname;
  private String countrycode;

  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }

  public String getCountryname() {
    return countryname;
  }

  public void setCountryname(String countryname) {
    this.countryname = countryname;
  }

  public String getCountrycode() {
    return countrycode;
  }

  public void setCountrycode(String countrycode) {
    this.countrycode = countrycode;
  }
}

4,mapper接口类

@Mapper
public interface CountryMapper {
  @Select("select * from country")
  List<Country> findAll();

}

5.cotroller类

@RestController
public class CountryController {
  @Autowired
  private CountryMapper countryMapper;

  @GetMapping("/findAll")
  public List<Country> findAll(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "20") Integer pageSize) {
    PageHelper.startPage(pageNum, pageSize);
    List<Country> countries = countryMapper.findAll();

    Page page = (Page) countries;
    System.out.println("每页展示条数:" + page.getPageSize());
    System.out.println("总条数:" + page.getTotal());
    System.out.println("当前页:" + page.getPageNum());
    System.out.println("总页数:" + page.getPages());

    return countries;
  }
}

7.测试数据

  直接抄官方数据

drop table country if exists;

create table country (
 id int primary key auto_increment,
 countryname varchar(32),
 countrycode varchar(2)
);

insert into country (id, countryname, countrycode) values(1,'Angola','AO');
insert into country (id, countryname, countrycode) values(2,'Afghanistan','AF');
insert into country (id, countryname, countrycode) values(3,'Albania','AL');
insert into country (id, countryname, countrycode) values(4,'Algeria','DZ');
insert into country (id, countryname, countrycode) values(5,'Andorra','AD');
insert into country (id, countryname, countrycode) values(6,'Anguilla','AI');
insert into country (id, countryname, countrycode) values(7,'Antigua and Barbuda','AG');
insert into country (id, countryname, countrycode) values(8,'Argentina','AR');
insert into country (id, countryname, countrycode) values(9,'Armenia','AM');
insert into country (id, countryname, countrycode) values(10,'Australia','AU');
insert into country (id, countryname, countrycode) values(11,'Austria','AT');
insert into country (id, countryname, countrycode) values(12,'Azerbaijan','AZ');
insert into country (id, countryname, countrycode) values(13,'Bahamas','BS');
insert into country (id, countryname, countrycode) values(14,'Bahrain','BH');
insert into country (id, countryname, countrycode) values(15,'Bangladesh','BD');
insert into country (id, countryname, countrycode) values(16,'Barbados','BB');
insert into country (id, countryname, countrycode) values(17,'Belarus','BY');
insert into country (id, countryname, countrycode) values(18,'Belgium','BE');
insert into country (id, countryname, countrycode) values(19,'Belize','BZ');
insert into country (id, countryname, countrycode) values(20,'Benin','BJ');
insert into country (id, countryname, countrycode) values(21,'Bermuda Is.','BM');
insert into country (id, countryname, countrycode) values(22,'Bolivia','BO');
insert into country (id, countryname, countrycode) values(23,'Botswana','BW');
insert into country (id, countryname, countrycode) values(24,'Brazil','BR');
insert into country (id, countryname, countrycode) values(25,'Brunei','BN');
insert into country (id, countryname, countrycode) values(26,'Bulgaria','BG');
insert into country (id, countryname, countrycode) values(27,'Burkina-faso','BF');
insert into country (id, countryname, countrycode) values(28,'Burma','MM');
insert into country (id, countryname, countrycode) values(29,'Burundi','BI');
insert into country (id, countryname, countrycode) values(30,'Cameroon','CM');
insert into country (id, countryname, countrycode) values(31,'Canada','CA');
insert into country (id, countryname, countrycode) values(32,'Central African Republic','CF');
insert into country (id, countryname, countrycode) values(33,'Chad','TD');
insert into country (id, countryname, countrycode) values(34,'Chile','CL');
insert into country (id, countryname, countrycode) values(35,'China','CN');
insert into country (id, countryname, countrycode) values(36,'Colombia','CO');
insert into country (id, countryname, countrycode) values(37,'Congo','CG');
insert into country (id, countryname, countrycode) values(38,'Cook Is.','CK');
insert into country (id, countryname, countrycode) values(39,'Costa Rica','CR');
insert into country (id, countryname, countrycode) values(40,'Cuba','CU');
insert into country (id, countryname, countrycode) values(41,'Cyprus','CY');
insert into country (id, countryname, countrycode) values(42,'Czech Republic','CZ');
insert into country (id, countryname, countrycode) values(43,'Denmark','DK');
insert into country (id, countryname, countrycode) values(44,'Djibouti','DJ');
insert into country (id, countryname, countrycode) values(45,'Dominica Rep.','DO');
insert into country (id, countryname, countrycode) values(46,'Ecuador','EC');
insert into country (id, countryname, countrycode) values(47,'Egypt','EG');
insert into country (id, countryname, countrycode) values(48,'EI Salvador','SV');
insert into country (id, countryname, countrycode) values(49,'Estonia','EE');
insert into country (id, countryname, countrycode) values(50,'Ethiopia','ET');
insert into country (id, countryname, countrycode) values(51,'Fiji','FJ');
insert into country (id, countryname, countrycode) values(52,'Finland','FI');
insert into country (id, countryname, countrycode) values(53,'France','FR');
insert into country (id, countryname, countrycode) values(54,'French Guiana','GF');
insert into country (id, countryname, countrycode) values(55,'Gabon','GA');
insert into country (id, countryname, countrycode) values(56,'Gambia','GM');
insert into country (id, countryname, countrycode) values(57,'Georgia','GE');
insert into country (id, countryname, countrycode) values(58,'Germany','DE');
insert into country (id, countryname, countrycode) values(59,'Ghana','GH');
insert into country (id, countryname, countrycode) values(60,'Gibraltar','GI');
insert into country (id, countryname, countrycode) values(61,'Greece','GR');
insert into country (id, countryname, countrycode) values(62,'Grenada','GD');
insert into country (id, countryname, countrycode) values(63,'Guam','GU');
insert into country (id, countryname, countrycode) values(64,'Guatemala','GT');
insert into country (id, countryname, countrycode) values(65,'Guinea','GN');
insert into country (id, countryname, countrycode) values(66,'Guyana','GY');
insert into country (id, countryname, countrycode) values(67,'Haiti','HT');
insert into country (id, countryname, countrycode) values(68,'Honduras','HN');
insert into country (id, countryname, countrycode) values(69,'Hongkong','HK');
insert into country (id, countryname, countrycode) values(70,'Hungary','HU');
insert into country (id, countryname, countrycode) values(71,'Iceland','IS');
insert into country (id, countryname, countrycode) values(72,'India','IN');
insert into country (id, countryname, countrycode) values(73,'Indonesia','ID');
insert into country (id, countryname, countrycode) values(74,'Iran','IR');
insert into country (id, countryname, countrycode) values(75,'Iraq','IQ');
insert into country (id, countryname, countrycode) values(76,'Ireland','IE');
insert into country (id, countryname, countrycode) values(77,'Israel','IL');
insert into country (id, countryname, countrycode) values(78,'Italy','IT');
insert into country (id, countryname, countrycode) values(79,'Jamaica','JM');
insert into country (id, countryname, countrycode) values(80,'Japan','JP');
insert into country (id, countryname, countrycode) values(81,'Jordan','JO');
insert into country (id, countryname, countrycode) values(82,'Kampuchea (Cambodia )','KH');
insert into country (id, countryname, countrycode) values(83,'Kazakstan','KZ');
insert into country (id, countryname, countrycode) values(84,'Kenya','KE');
insert into country (id, countryname, countrycode) values(85,'Korea','KR');
insert into country (id, countryname, countrycode) values(86,'Kuwait','KW');
insert into country (id, countryname, countrycode) values(87,'Kyrgyzstan','KG');
insert into country (id, countryname, countrycode) values(88,'Laos','LA');
insert into country (id, countryname, countrycode) values(89,'Latvia','LV');
insert into country (id, countryname, countrycode) values(90,'Lebanon','LB');
insert into country (id, countryname, countrycode) values(91,'Lesotho','LS');
insert into country (id, countryname, countrycode) values(92,'Liberia','LR');
insert into country (id, countryname, countrycode) values(93,'Libya','LY');
insert into country (id, countryname, countrycode) values(94,'Liechtenstein','LI');
insert into country (id, countryname, countrycode) values(95,'Lithuania','LT');
insert into country (id, countryname, countrycode) values(96,'Luxembourg','LU');
insert into country (id, countryname, countrycode) values(97,'Macao','MO');
insert into country (id, countryname, countrycode) values(98,'Madagascar','MG');
insert into country (id, countryname, countrycode) values(99,'Malawi','MW');
insert into country (id, countryname, countrycode) values(100,'Malaysia','MY');
insert into country (id, countryname, countrycode) values(101,'Maldives','MV');
insert into country (id, countryname, countrycode) values(102,'Mali','ML');
insert into country (id, countryname, countrycode) values(103,'Malta','MT');
insert into country (id, countryname, countrycode) values(104,'Mauritius','MU');
insert into country (id, countryname, countrycode) values(105,'Mexico','MX');
insert into country (id, countryname, countrycode) values(106,'Moldova, Republic of','MD');
insert into country (id, countryname, countrycode) values(107,'Monaco','MC');
insert into country (id, countryname, countrycode) values(108,'Mongolia','MN');
insert into country (id, countryname, countrycode) values(109,'Montserrat Is','MS');
insert into country (id, countryname, countrycode) values(110,'Morocco','MA');
insert into country (id, countryname, countrycode) values(111,'Mozambique','MZ');
insert into country (id, countryname, countrycode) values(112,'Namibia','NA');
insert into country (id, countryname, countrycode) values(113,'Nauru','NR');
insert into country (id, countryname, countrycode) values(114,'Nepal','NP');
insert into country (id, countryname, countrycode) values(115,'Netherlands','NL');
insert into country (id, countryname, countrycode) values(116,'New Zealand','NZ');
insert into country (id, countryname, countrycode) values(117,'Nicaragua','NI');
insert into country (id, countryname, countrycode) values(118,'Niger','NE');
insert into country (id, countryname, countrycode) values(119,'Nigeria','NG');
insert into country (id, countryname, countrycode) values(120,'North Korea','KP');
insert into country (id, countryname, countrycode) values(121,'Norway','NO');
insert into country (id, countryname, countrycode) values(122,'Oman','OM');
insert into country (id, countryname, countrycode) values(123,'Pakistan','PK');
insert into country (id, countryname, countrycode) values(124,'Panama','PA');
insert into country (id, countryname, countrycode) values(125,'Papua New Cuinea','PG');
insert into country (id, countryname, countrycode) values(126,'Paraguay','PY');
insert into country (id, countryname, countrycode) values(127,'Peru','PE');
insert into country (id, countryname, countrycode) values(128,'Philippines','PH');
insert into country (id, countryname, countrycode) values(129,'Poland','PL');
insert into country (id, countryname, countrycode) values(130,'French Polynesia','PF');
insert into country (id, countryname, countrycode) values(131,'Portugal','PT');
insert into country (id, countryname, countrycode) values(132,'Puerto Rico','PR');
insert into country (id, countryname, countrycode) values(133,'Qatar','QA');
insert into country (id, countryname, countrycode) values(134,'Romania','RO');
insert into country (id, countryname, countrycode) values(135,'Russia','RU');
insert into country (id, countryname, countrycode) values(136,'Saint Lueia','LC');
insert into country (id, countryname, countrycode) values(137,'Saint Vincent','VC');
insert into country (id, countryname, countrycode) values(138,'San Marino','SM');
insert into country (id, countryname, countrycode) values(139,'Sao Tome and Principe','ST');
insert into country (id, countryname, countrycode) values(140,'Saudi Arabia','SA');
insert into country (id, countryname, countrycode) values(141,'Senegal','SN');
insert into country (id, countryname, countrycode) values(142,'Seychelles','SC');
insert into country (id, countryname, countrycode) values(143,'Sierra Leone','SL');
insert into country (id, countryname, countrycode) values(144,'Singapore','SG');
insert into country (id, countryname, countrycode) values(145,'Slovakia','SK');
insert into country (id, countryname, countrycode) values(146,'Slovenia','SI');
insert into country (id, countryname, countrycode) values(147,'Solomon Is','SB');
insert into country (id, countryname, countrycode) values(148,'Somali','SO');
insert into country (id, countryname, countrycode) values(149,'South Africa','ZA');
insert into country (id, countryname, countrycode) values(150,'Spain','ES');
insert into country (id, countryname, countrycode) values(151,'Sri Lanka','LK');
insert into country (id, countryname, countrycode) values(152,'St.Lucia','LC');
insert into country (id, countryname, countrycode) values(153,'St.Vincent','VC');
insert into country (id, countryname, countrycode) values(154,'Sudan','SD');
insert into country (id, countryname, countrycode) values(155,'Suriname','SR');
insert into country (id, countryname, countrycode) values(156,'Swaziland','SZ');
insert into country (id, countryname, countrycode) values(157,'Sweden','SE');
insert into country (id, countryname, countrycode) values(158,'Switzerland','CH');
insert into country (id, countryname, countrycode) values(159,'Syria','SY');
insert into country (id, countryname, countrycode) values(160,'Taiwan','TW');
insert into country (id, countryname, countrycode) values(161,'Tajikstan','TJ');
insert into country (id, countryname, countrycode) values(162,'Tanzania','TZ');
insert into country (id, countryname, countrycode) values(163,'Thailand','TH');
insert into country (id, countryname, countrycode) values(164,'Togo','TG');
insert into country (id, countryname, countrycode) values(165,'Tonga','TO');
insert into country (id, countryname, countrycode) values(166,'Trinidad and Tobago','TT');
insert into country (id, countryname, countrycode) values(167,'Tunisia','TN');
insert into country (id, countryname, countrycode) values(168,'Turkey','TR');
insert into country (id, countryname, countrycode) values(169,'Turkmenistan','TM');
insert into country (id, countryname, countrycode) values(170,'Uganda','UG');
insert into country (id, countryname, countrycode) values(171,'Ukraine','UA');
insert into country (id, countryname, countrycode) values(172,'United Arab Emirates','AE');
insert into country (id, countryname, countrycode) values(173,'United Kiongdom','GB');
insert into country (id, countryname, countrycode) values(174,'United States of America','US');
insert into country (id, countryname, countrycode) values(175,'Uruguay','UY');
insert into country (id, countryname, countrycode) values(176,'Uzbekistan','UZ');
insert into country (id, countryname, countrycode) values(177,'Venezuela','VE');
insert into country (id, countryname, countrycode) values(178,'Vietnam','VN');
insert into country (id, countryname, countrycode) values(179,'Yemen','YE');
insert into country (id, countryname, countrycode) values(180,'Yugoslavia','YU');
insert into country (id, countryname, countrycode) values(181,'Zimbabwe','ZW');
insert into country (id, countryname, countrycode) values(182,'Zaire','ZR');
insert into country (id, countryname, countrycode) values(183,'Zambia','ZM');

好,一切准备就绪,启动springboot项目,浏览器访问,注意controller中打印

第一次请求:

controller打印:

第二次请求:

controller打印:

OK ,验证完毕!完美!!!

补充:

  在做分页功能时,前端分页插件一般都需要一些诸如当前页数,总条数,总共多少页之类的数据,这时可以引用PageInfo这个对象,它完全能够满足插件的分页要求。

@GetMapping("/findAll")
  public PageInfo<Country> findAll(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "20") Integer pageSize) {
    PageHelper.startPage(pageNum, pageSize);
    List<Country> countries = countryMapper.findAll();

//    Page page = (Page) countries;
//    System.out.println("每页展示条数:" + page.getPageSize());
//    System.out.println("总条数:" + page.getTotal());
//    System.out.println("当前页:" + page.getPageNum());
//    System.out.println("总页数:" + page.getPages());
    PageInfo<Country> result = new PageInfo<>(countries);
    return result;
  }

请求测试:

查看PageInfo类的源码,不难发现,它对前端分页插件的属性支持还是很全面的

private int pageNum; // 当前页码
  private int pageSize; // 每页展示的多少条数据
  private int size;     // 数据总条数
  private int startRow;
  private int endRow;
  private int pages;   // 总共多少页
  private int prePage;  // 前一页
  private int nextPage; // 后一页
  private boolean isFirstPage;
  private boolean isLastPage;
  private boolean hasPreviousPage;
  private boolean hasNextPage;
  private int navigatePages;
  private int[] navigatepageNums;
  private int navigateFirstPage;
  private int navigateLastPage;

好,暂时就到这里吧,以后再补充!

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持我们。

(0)

相关推荐

  • SpringBoot+Mybatis+Druid+PageHelper实现多数据源并分页方法

    前言 本篇文章主要讲述的是SpringBoot整合Mybatis.Druid和PageHelper 并实现多数据源和分页.其中SpringBoot整合Mybatis这块,在之前的的一篇文章中已经讲述了,这里就不过多说明了.重点是讲述在多数据源下的如何配置使用Druid和PageHelper. Druid介绍和使用 在使用Druid之前,先来简单的了解下Druid. Druid是一个数据库连接池.Druid可以说是目前最好的数据库连接池!因其优秀的功能.性能和扩展性方面,深受开发人员的青睐. Dr

  • SpringBoot集成MyBatis的分页插件PageHelper实例代码

    昨天给各位总结了本人学习springboot整合mybatis第一阶段的一些学习心得和源码,主要就算是敲了一下SpringBoot的门儿,希望能给各位的入门带给一点儿捷径,今天给各位温习一下MyBatis的分页插件PageHelper和SpringBoot的集成,它的使用也非常简单,开发更为高效.因为PageHelper插件是属于MyBatis框架的,所以相信很多哥们儿都已经用烂了,下面带着各位吃一下回头草. 首先说说MyBatis框架的PageHelper插件吧,它是一个非常好用的分页插件,通

  • Springboot整合pagehelper分页功能

    本文实例为大家分享了Springboot整合pagehelper分页展示的具体代码,供大家参考,具体内容如下 一.添加依赖 查找maven中pagehelper的版本 在pom中添加依赖 <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-spring-boot-starter</artifactId> <version>1.2.2&

  • Spring Boot+Mybatis+Druid+PageHelper实现多数据源并分页的方法

    前言 本篇文章主要讲述的是SpringBoot整合Mybatis.Druid和PageHelper 并实现多数据源和分页.其中SpringBoot整合Mybatis这块,在之前的的一篇文章中已经讲述了,这里就不过多说明了.重点是讲述在多数据源下的如何配置使用Druid和PageHelper . Druid介绍和使用 在使用Druid之前,先来简单的了解下Druid. Druid是一个数据库连接池.Druid可以说是目前最好的数据库连接池!因其优秀的功能.性能和扩展性方面,深受开发人员的青睐. D

  • SpringBoot整合mybatis结合pageHelper插件实现分页

    SpringBoot整合mybatis分页操作 SpringBoot整合Mybatis进行分页操作,这里需要使用Mybatis的分页插件:pageHelper, 关于pageHelper的介绍,请查看官方文档: https://pagehelper.github.io/ 1.使用前配置 关于pageHelper的使用配置,主要有以下2个步骤: 1.1.在pom文件中导入pageHelper依赖 <dependency> <groupId>com.github.pagehelper&

  • spring boot集成pagehelper(两种方式)

    参看了pagehelper-spring-boot,使用起来非常放方便,关于更多PageHelper可以点击https://github.com/pagehelper/Mybatis-PageHelper. 当spring boot集成好mybatis时候需要进行分页,我们首先添加maven支持 <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper</a

  • Springboot2集成pagehelper过程图解

    springboot2集成pagehelper超级简单,本示例直接抄袭官方示例,仅将数据库由H2改成MySQL而已. 1.pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance

  • Springboot集成activity过程图解

    1.第一步添加bpmn文件得插件,不然没法查看和编辑bpmn文件,添加插件的方法各自百度即可,很简单 2.安装好bpmn插件后开始新建bpmn文件,也就是画流程图 一般是在代码中进行指定流程审批人的,我这里只做入门案例 3.添加pom依赖 这里包含了在线设计流程图的相关依赖,在下一篇会写出来,项目中一般都是在前端在线设计:所以直接放上去也没事 <?xml version="1.0" encoding="UTF-8"?> <project xmlns

  • 基于Jenkins搭建.NET Core持续集成环境过程图解

    我们用NuGet还原.NET Core项目会报以下错误: error NETSDK1064: 未找到版本为 1.8.2 的包 BouncyCastle.NetCore.它可能已在 NuGet 还原后删除.否则,NuGet 还原可能只是部分完成,这种情况可能是最大路径长度限制所导致. 关于这个问题我找了好久 也是google到一条信息才明白 这里就直接放解决办法,其实网上就有方法,有的简短,有的笼统 我们这里用到的是dotnet命令来还原.构建.以及部署 从 .NET Core 2.0 开始,无需

  • Python远程开发环境部署与调试过程图解

    这篇文章主要介绍了Python远程开发环境部署与调试过程图解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下 一.下载相应开发工具 Pycharm :下载地址 二.部署开发机 一般在工作过程中,开发环境并不是本地环境,而是指在开发机:因为,有很多依赖本地部署非常麻烦,而开发机中则内置了很多相关的服务 三.代码自动化部署 由于我们在本地进行代码编辑.在开发机中进行代码的运行及调试,因此,需要一种很方便的方式进行代码的远程自动化部署Pycharm 基

  • pyinstaller还原python代码过程图解

    这篇文章主要介绍了pyinstaller还原python代码过程图解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下 pyinstaller 的作用就是将python打包成对应平台的可执行文件.一般这种可执行文件的体积都比较大. 我们可以先通过逆向软件查看一下具体信息 查看字符串信息 只要有诸如以上的字符串 就说明这个可执行文件有很大程度上是通过pyinstaller打包的 解密方法有两个 1. pyinstxtractor.py 方法很简单 直

  • Spring Boot 集成PageHelper的使用方法

    目录 前言: 一.基本集成 引入jar包 Yml配置文件中添加相关配置 封装相关分页方法 示例代码 前段传入参数 执行结果 二.分页中的排序字段如何防止SQL注入问题 三.复杂的SQL分页语句 四.分页失效的常见的场景有哪些? 五.大表数据PageHelper分页性能如何 总结: 前言: 项目中数据分页是一个很常见的需求,目前大部分项目都会使用pagehelper进行分页,那么在使用的过程中是否考虑如下问题? 一.基本集成 引入jar包 <dependency> <groupId>

  • c++ 快速排序算法【过程图解】

    第一.算法描述 快速排序由C. A. R. Hoare在1962年提出,该算法是目前实践中使用最频繁,实用高效的最好排序算法, 快速排序算法是采用分治思想的算法,算法分三个步骤 1.从数组中抽出一个元素作为基数v(我们称之为划界元素),一般是取第一个.最后一个元素或中间的元素 2.将剩余的元素中小于v的移动到v的左边,将大于v元素移动到v的右边 3.对左右两个分区重复以上步骤直到所有元素都是有排序好. 第二.算法实现 /*序列划分函数*/ int partition(int a[], int p

  • mysql5.7.22 下载过程图解

    1.进入官网 www.mysql.com  ,选择downloads: 2.选择 Community 再选择MySQL community server 3.选择5.7的版本,这个看自己选择,有问题看标题 4.选择5.7.22版本,windows系统类型 5.选择下载包,并点击dawnload 6.无需注册,点击下载 7.下载后安装包放在你想要放的目录下 总结 以上所述是小编给大家介绍的mysql5.7.22 下载过程图解,希望对大家有所帮助,如果大家有任何疑问欢迎给我留言,小编会及时回复大家的

  • vue脚手架搭建过程图解

    vue脚手架是个好东西,能够快速搭建vue单页面应用,vue是基于node环境的,所以要先安装node,去官网下载安装就可以. 进入某个文件夹的命令为: 查看node版本: 搭建步骤为: 出现下图说明搭建成功: 按照提示输入: 如果出现下图说明运行成功: 在浏览器中按照指示输入: 运行结果为: ok,至此vue脚手架就搭建完成了! 总结 以上所述是小编给大家介绍的vue脚手架搭建过程图解,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的.在此也非常感谢大家对我们网站的支持!

  • Java+Tomcat 环境部署及安装过程图解

    下面在Centos7进行安装Java+Tomcat,网上的很多文章,我在部署中都有些问题,下面是我自己总结的一个安装过程! 安装Java环境 首先,我们先到Java官网下载JDK 这里我下载jdk1.8版本的 https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 点击 Accept License Agreement 选择好版本进行下载,需要注册Oracle账户登陆下载! 将下载的

随机推荐