提交 aa4ee452 编写于 作者: 亦蔚然's avatar 亦蔚然

练习git revert 61b22195后恢复

上级 70119702
# 项目:多线程爬虫与Elasticsearch搜索引擎实战
***
## 1、前言部分:做一个项目的原则
## 、前言部分:做一个项目的原则
- 心法:
- 1、把每个项目当作人生最好的项目来精雕细琢,一丝不苟滴写好文档,保证代码质量(以自己当前最高水平去完成,可以借助代码检测工具)
- 2、使用业界标准化的模式和流程,每一行代码都不要是多余的(如:不要提交不该提交的文件 .idea 等不要上传到Github);几乎不要有本地依赖,使用者能够毫无障碍的使用
......@@ -31,8 +31,31 @@
- 单线程 -> 多线程
- console -> H2 -> MySQL
- database -> Elasticsearch
- 好的代码习惯:
- 不要写妥协的代码
- 有好的三方实现可以借用,如:Apache提供的包
***
## 2、前言部分:
## 二、项目概述:
- 1、项目目标:爬取新浪网
- 2、现阶段使用了:
## 心得:
- 冒烟测试;测试原则:每个测试是一个类,负责一个小的功能模块
- git命令回顾:
- 撤销 git add 操作,可以使用以下命令:
```shell
git restore --staged src/main/java/com/github/weiranyi/Main.java
```
- 若此时全部commit提交,想要撤销一个提交怎么办
```shell
git reset HEAD~1
```
- 撤销PR的提交
```shell
git log --获得61b22195162ec24fbbf2ef020485bb0a524c82b9
git revert 61b22195162ec24fbbf2ef020485bb0a524c82b9
```
-
......@@ -52,6 +52,12 @@
</profile>
</profiles>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
......
package com.github.weiranyi;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException {
try (CloseableHttpClient httpclient = HttpClients.createDefault()) {
HttpGet httpGet = new HttpGet("https://sina.cn/");
try (CloseableHttpResponse response1 = httpclient.execute(httpGet)) {
System.out.println(response1.getStatusLine());
HttpEntity entity1 = response1.getEntity();
// do something useful with the response body
// and ensure it is fully consumed
System.out.println(EntityUtils.toString(entity1));
}
}
}
}
package com.github.weiranyi;
import org.junit.jupiter.api.Test;
public class SmokeTest {
@Test
public void test(){
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册