Skip to content

Commit caa2b29

Browse files
committed
更新导航栏
1 parent 74a8d08 commit caa2b29

File tree

3 files changed

+255
-34
lines changed

3 files changed

+255
-34
lines changed

docs/.vuepress/navbar.ts

Lines changed: 86 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,6 @@ export default navbar([
6060
{text: "Kafka面试题", link: "/message-queue/kafka.md"},
6161
]
6262
}
63-
]
64-
},
65-
{
66-
text: "计算机基础",
67-
icon: "computer",
68-
children: [
69-
{text: "网络", link: "/computer-basic/network.md"},
70-
{text: "操作系统", link: "/computer-basic/operate-system.md"},
71-
{text: "算法", link: "/computer-basic/algorithm.md"},
72-
{text: "LeetCode题解", link: "/leetcode/hot120"},
73-
{text: "数据结构", link: "/computer-basic/data-structure.md"},
7463
{
7564
text: "关系型数据库",
7665
children: [
@@ -88,8 +77,64 @@ export default navbar([
8877
{text: "ElasticSearch面试题", link: "https://mp.weixin.qq.com/s/Ffb8NDgavf9QAWYBm0qAVg"},
8978
]
9079
},
91-
]
92-
},
80+
{
81+
text: "计算机基础",
82+
icon: "computer",
83+
children: [
84+
{text: "网络", link: "/computer-basic/network.md"},
85+
{text: "操作系统", link: "/computer-basic/operate-system.md"},
86+
{text: "算法", link: "/computer-basic/algorithm.md"},
87+
{text: "LeetCode题解", link: "/leetcode/hot120"},
88+
{text: "数据结构", link: "/computer-basic/data-structure.md"},
89+
//{
90+
// text: "关系型数据库",
91+
// children: [
92+
// //{text: "MySQL基础", children: ["/database/mysql-basic/"],},
93+
// {text: "MySQL基础", link: "/database/mysql-basic/"},
94+
// {text: "MySQL面试题", link: "/database/mysql.md"},
95+
// {text: "MySQL执行计划详解", link: "/database/mysql-execution-plan.md"},
96+
// ]
97+
//},
98+
//{
99+
// text: "非关系型数据库",
100+
// children: [
101+
// {text: "Redis基础", link: "/redis/redis-basic/"},
102+
// {text: "Redis面试题", link: "/redis/redis.md"},
103+
// {text: "ElasticSearch面试题", link: "https://mp.weixin.qq.com/s/Ffb8NDgavf9QAWYBm0qAVg"},
104+
// ]
105+
//},
106+
]
107+
},
108+
]
109+
},
110+
//{
111+
// text: "计算机基础",
112+
// icon: "computer",
113+
// children: [
114+
// {text: "网络", link: "/computer-basic/network.md"},
115+
// {text: "操作系统", link: "/computer-basic/operate-system.md"},
116+
// {text: "算法", link: "/computer-basic/algorithm.md"},
117+
// {text: "LeetCode题解", link: "/leetcode/hot120"},
118+
// {text: "数据结构", link: "/computer-basic/data-structure.md"},
119+
// //{
120+
// // text: "关系型数据库",
121+
// // children: [
122+
// // //{text: "MySQL基础", children: ["/database/mysql-basic/"],},
123+
// // {text: "MySQL基础", link: "/database/mysql-basic/"},
124+
// // {text: "MySQL面试题", link: "/database/mysql.md"},
125+
// // {text: "MySQL执行计划详解", link: "/database/mysql-execution-plan.md"},
126+
// // ]
127+
// //},
128+
// //{
129+
// // text: "非关系型数据库",
130+
// // children: [
131+
// // {text: "Redis基础", link: "/redis/redis-basic/"},
132+
// // {text: "Redis面试题", link: "/redis/redis.md"},
133+
// // {text: "ElasticSearch面试题", link: "https://mp.weixin.qq.com/s/Ffb8NDgavf9QAWYBm0qAVg"},
134+
// // ]
135+
// //},
136+
// ]
137+
//},
93138
{
94139
text: "进阶之路",
95140
icon: "win",
@@ -130,6 +175,13 @@ export default navbar([
130175
// {text: "微信红包系统如何设计?", link: "/advance/system-design/6-wechat-redpacket-design.md"},
131176
// {text: "单点登录设计与实现", link: "/advance/system-design/8-sso-design.md"},
132177
//]
178+
children: [
179+
{text: "扫码登录设计", link: "/advance/system-design/README.md"},
180+
{text: "超时订单自动取消", link: "/advance/system-design/README.md"},
181+
{text: "短链系统设计", link: "/advance/system-design/README.md"},
182+
{text: "微信红包系统如何设计?", link: "/advance/system-design/README.md"},
183+
{text: "单点登录设计与实现", link: "/advance/system-design/README.md"},
184+
]
133185
},
134186
{
135187
text: "海量数据",
@@ -193,27 +245,27 @@ export default navbar([
193245
},
194246
]
195247
},
196-
// {
197-
// text: "珍藏资源",
198-
// icon: "collection",
199-
// children: [
200-
// {
201-
// text: "学习资源",
202-
// children: [
203-
// {text: "计算机经典电子书PDF", link: "https://github.com/Tyson0314/java-books"},
204-
// {text: "Leetcode刷题笔记", link: "/learning-resources/leetcode-note.md"},
205-
// ]
206-
// },
207-
// {
208-
// text: "学习路线",
209-
// children: [
210-
// {text: "Java学习路线", link: "/learning-resources/java-learn-guide.md"},
211-
// {text: "CS学习路线", link: "/learning-resources/cs-learn-guide.md"},
212-
// ]
213-
// },
214-
//
215-
// ]
216-
// },
248+
{
249+
text: "珍藏资源",
250+
icon: "collection",
251+
children: [
252+
{
253+
text: "学习资源",
254+
children: [
255+
{text: "计算机经典电子书PDF", link: "https://github.com/Tyson0314/java-books"},
256+
{text: "Leetcode刷题笔记", link: "/learning-resources/leetcode-note.md"},
257+
]
258+
},
259+
{
260+
text: "学习路线",
261+
children: [
262+
{text: "Java学习路线", link: "/learning-resources/java-learn-guide.md"},
263+
{text: "CS学习路线", link: "/learning-resources/cs-learn-guide.md"},
264+
]
265+
},
266+
267+
]
268+
},
217269
{
218270
text: "关于",
219271
icon: "about",

docs/database/mysql.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -954,11 +954,16 @@ B+树中**非叶子节点存的是key + 指针**;**叶子节点存的是数据
954954
当MySQL单表记录数过大时,数据库的性能会明显下降,一些常见的优化措施如下:
955955

956956
* 合理建立索引。在合适的字段上建立索引,例如在WHERE和ORDER BY命令上涉及的列建立索引,可根据EXPLAIN来查看是否用了索引还是全表扫描
957+
* 索引优化,SQL优化。最左匹配原则等,参考:https://topjavaer.cn/database/mysql.html#%E4%BB%80%E4%B9%88%E6%98%AF%E8%A6%86%E7%9B%96%E7%B4%A2%E5%BC%95
957958
* 建立分区。对关键字段建立水平分区,比如时间字段,若查询条件往往通过时间范围来进行查询,能提升不少性能
958959
* 利用缓存。利用Redis等缓存热点数据,提高查询效率
959960
* 限定数据的范围。比如:用户在查询历史信息的时候,可以控制在一个月的时间范围内
960961
* 读写分离。经典的数据库拆分方案,主库负责写,从库负责读
961962
* 通过分库分表的方式进行优化,主要有垂直拆分和水平拆分
963+
* 合理建立索引。在合适的字段上建立索引,例如在WHERE和ORDERBY命令上涉及的列建立索引
964+
7. 数据异构到es
965+
9. 冷热数据分离。几个月之前不常用的数据放到冷库中,最新的数据比较新的数据放到热库中
966+
10. 升级数据库类型,换一种能兼容MySQL的数据库(OceanBase、tidb)
962967

963968
## 说说count(1)、count(*)和count(字段名)的区别
964969

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
# SpringBoot 三大开发工具,你都用过么?
2+
3+
## 一、SpringBoot Dedevtools
4+
5+
他是一个让SpringBoot支持热部署的工具,下面是引用的方法
6+
7+
要么在创建项目的时候直接勾选下面的配置:
8+
9+
![image-20230211115527377](C:\Users\Tyson\AppData\Roaming\Typora\typora-user-images\image-20230211115527377.png)
10+
11+
要么给springBoot项目添加下面的依赖:
12+
13+
```xml
14+
<dependency>
15+
<groupId>org.springframework.boot</groupId>
16+
<artifactId>spring-boot-devtools</artifactId>
17+
<optional>true</optional>
18+
</dependency>
19+
复制代码
20+
```
21+
22+
- idea修改完代码后再按下 ctrl + f9 使其重新编译一下,即完成了热部署功能
23+
- eclipse是按ctrl + s保存 即可自动编译
24+
25+
如果你想一修改代码就自动重新编译,无需按ctrl+f9。只需要下面的操作:
26+
27+
### 1.在idea的setting中把下面的勾都打上
28+
29+
![](http://img.topjavaer.cn/img/image-20230211115603710.png)
30+
31+
### 2.进入pom.xml,在build的反标签后给个光标,然后按Alt+Shift+ctrl+/
32+
33+
![](http://img.topjavaer.cn/img/image-20230211115616354.png)
34+
35+
### 3.然后勾选下面的东西,接着重启idea即可
36+
37+
![](http://img.topjavaer.cn/img/image-20230211115627263.png)
38+
39+
## 二、Lombok
40+
41+
Lombok是简化JavaBean开发的工具,让开发者省去构造器,getter,setter的书写。
42+
43+
在项目初始化时勾选下面的配置,即可使用Lombok
44+
45+
![](http://img.topjavaer.cn/img/image-20230211115645530.png)
46+
47+
或者在项目中导入下面的依赖:
48+
49+
```xml
50+
<dependency>
51+
<groupId>org.projectlombok</groupId>
52+
<artifactId>lombok</artifactId>
53+
<optional>true</optional>
54+
</dependency>
55+
复制代码
56+
```
57+
58+
使用时,idea还需要下载下面的插件:
59+
60+
![](http://img.topjavaer.cn/img/image-20230211115658171.png)
61+
62+
下面的使用的例子
63+
64+
```kotlin
65+
import com.baomidou.mybatisplus.annotation.TableField;
66+
import com.baomidou.mybatisplus.annotation.TableName;
67+
import lombok.AllArgsConstructor;
68+
import lombok.Data;
69+
import lombok.NoArgsConstructor;
70+
71+
@AllArgsConstructor//全参构造器
72+
@NoArgsConstructor//无参构造器
73+
@Data//getter + setter
74+
public class User {
75+
private Long id;
76+
private String name;
77+
private Integer age;
78+
private String email;
79+
}
80+
复制代码
81+
```
82+
83+
### 三、Spring Configuration Processor
84+
85+
该工具是给实体类的属性注入开启提示,自我感觉该工具意义不是特别大!
86+
87+
因为SpringBoot存在属性注入,比如下面的实体类:
88+
89+
```typescript
90+
package org.lzl.HelloWorld.entity;
91+
92+
import org.springframework.boot.context.properties.ConfigurationProperties;
93+
import org.springframework.stereotype.Component;
94+
95+
/**
96+
* @author Lenovo
97+
*
98+
*/
99+
@Component
100+
@ConfigurationProperties(prefix = "mypet")
101+
public class Pet {
102+
private String nickName;
103+
private String strain;
104+
public String getNickName() {
105+
return nickName;
106+
}
107+
public void setNickName(String nickName) {
108+
this.nickName = nickName;
109+
}
110+
public String getStrain() {
111+
return strain;
112+
}
113+
public void setStrain(String strain) {
114+
this.strain = strain;
115+
}
116+
@Override
117+
public String toString() {
118+
return "Pet [nickName=" + nickName + ", strain=" + strain + "]";
119+
}
120+
121+
122+
}
123+
复制代码
124+
```
125+
126+
想要在`application.properties``application.yml`中给mypet注入属性,却没有任何的提示,为了解决这一问题,我们在创建SpringBoot的时候勾选下面的场景:
127+
128+
![](http://img.topjavaer.cn/img/image-20230211115712481.png)
129+
130+
或者直接在项目中添加下面的依赖:
131+
132+
```xml
133+
<dependency>
134+
<groupId>org.springframework.boot</groupId>
135+
<artifactId>spring-boot-configuration-processor</artifactId>
136+
<optional>true</optional>
137+
</dependency>
138+
复制代码
139+
```
140+
141+
并在build的标签中排除对该工具的打包:(减少打成jar包的大小)
142+
143+
```xml
144+
<build>
145+
<plugins>
146+
<plugin>
147+
<groupId>org.springframework.boot</groupId>
148+
<artifactId>spring-boot-maven-plugin</artifactId>
149+
<configuration>
150+
<excludes>
151+
<exclude>
152+
<groupId>org.springframework.boot</groupId>
153+
<artifactId>spring-boot-configuration-processor</artifactId>
154+
</exclude>
155+
</excludes>
156+
</configuration>
157+
</plugin>
158+
</plugins>
159+
</build>
160+
```
161+
162+
163+
164+
> 原文:blog.csdn.net/MoastAll/article/details/108237154

0 commit comments

Comments
 (0)