一、基础知识
1、三次握手和四次挥手
HTTP基于TCP,是面向连接的协议,建立连接要通过三次握手,断开连接要经过四次挥手。
2、同步异步
3、常见状态码
- 100 ~ 199 表示连接继续
- 200 ~ 299 表示各种意义上的成功
- 300 ~ 399 表示重定向
- 400 ~ 499 表示各种客户端错误
- 500 ~ 599 表示各种服务端错误
二、Ajax
Ajax | jQuery API Documentation
1、发送Get请求
2、发送Post请求
三、MP
1、日志
#配置日志
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.stdoutImpl
2、分页
//分页插件
//写在启动项中
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
//测试分页查询
public void testPage(){
//参数一:当函页
//参数二:页面大小
Page<User> page = new Page<>(current 1, size: 5);
userMapper.seiectpage(page, wrapper: null);
page.getRecords( ).forEach(System.out::println);
3、条件查询器Wrapper
void contextLoads(){
//查询name不为空的用户,并且邮箱不为空的用户,年龄大于等于12
Querywrapper<User> wrapper = new Querywrapper<>();
wrapper
.isNotNull( column: "name")
.isNotNull( column: "email")
.ge( column: "age" , val: 12);
userMapper.selectList(wrapper);
}