Skip to content

Commit d99dcfc

Browse files
committed
style: update format style
1 parent 4645887 commit d99dcfc

139 files changed

Lines changed: 1096 additions & 1138 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build/mysql-master-slave/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,45 +27,53 @@ docker-compose up -d
2727
### 🧩 主服务器配置
2828

2929
1. 进入主服务器容器
30+
3031
```sh
3132
docker exec -it mysql-master bash
3233
```
3334

3435
2. 进入 MySQL 客户端
36+
3537
```bash
3638
mysql -uroot -p123456
3739
```
3840

3941
3. 创建复制用户,并授予权限,用于同步数据
42+
4043
```sql
4144
CREATE USER 'slave'@'%' IDENTIFIED BY '123456';
4245
GRANT REPLICATION SLAVE ON *.* TO 'slave'@'%';
4346
FLUSH PRIVILEGES;
4447
```
4548

4649
4. 记录主服务器的二进制日志文件名和位置(即File和Position对应的值)
50+
4751
```sql
4852
SHOW MASTER STATUS;
4953
```
5054

5155
### 🔁 从服务器配置
5256

5357
1. 查询主服务器IP
58+
5459
```sh
5560
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${MYSQL_MASTER_NAME}
5661
```
5762

5863
2. 进入从服务器容器
64+
5965
```sh
6066
docker exec -it ${MYSQL_SLAVE_NAME} bash
6167
```
6268

6369
3. 进入 MySQL 客户端
70+
6471
```bash
6572
mysql -uroot -p123456
6673
```
6774

6875
4. 配置从服务器连接主服务器
76+
6977
```sql
7078
CHANGE MASTER TO
7179
master_host='${MYSQL_MASTER_HOST}',
@@ -88,11 +96,13 @@ master_connect_retry=60;
8896
- master_connect_retry: 连接主服务器失败后,重试的时间间隔,单位秒,默认60秒
8997

9098
5. 启动从服务器
99+
91100
```sql
92101
START SLAVE;
93102
```
94103

95104
6. 查看从服务器状态
105+
96106
```sql
97107
SHOW SLAVE STATUS \G;
98108
```

build/mysql-master-slave/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ services:
1212
- ./mysql-master/volumes/data:/var/lib/mysql
1313
environment:
1414
MYSQL_ROOT_PASSWORD: "123456"
15-
# entrypoint: bash -c "chmod 644 /etc/mysql/my.cnf && exec /usr/local/bin/docker-entrypoint.sh mysqld"
15+
# entrypoint: bash -c "chmod 644 /etc/mysql/my.cnf && exec /usr/local/bin/docker-entrypoint.sh mysqld"
1616
command: [
1717
'--character-set-server=utf8mb4',
1818
'--collation-server=utf8mb4_general_ci',
@@ -34,7 +34,7 @@ services:
3434
- ./mysql-slave/volumes/data:/var/lib/mysql
3535
environment:
3636
MYSQL_ROOT_PASSWORD: "123456"
37-
# entrypoint: bash -c "chmod 644 /etc/mysql/my.cnf && exec /usr/local/bin/docker-entrypoint.sh mysqld"
37+
# entrypoint: bash -c "chmod 644 /etc/mysql/my.cnf && exec /usr/local/bin/docker-entrypoint.sh mysqld"
3838
command: [
3939
'--character-set-server=utf8mb4',
4040
'--collation-server=utf8mb4_general_ci',

build/mysql-master-slave/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://maven.apache.org/POM/4.0.0"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

build/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://maven.apache.org/POM/4.0.0"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

demo-aspectj/src/main/java/com/helltractor/demo/AutoFillAspectJ.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,28 @@
1515
@Aspect
1616
@Component
1717
public class AutoFillAspectJ {
18-
18+
1919
@Pointcut("execution(* com.helltractor.demo.service.IBuy.buy(..))")
2020
public void aopPointCut() {
21-
21+
2222
}
23-
23+
2424
@Before("aopPointCut()")
2525
// @Before("execution(* org.aopdemo.service.IBuy.buy(..)) && within(org.aopdemo.entity.*) && bean(girl)")
2626
public void haha() {
2727
System.out.println("男孩女孩都买了自己喜欢的东西");
2828
}
29-
29+
3030
@After("aopPointCut()")
3131
public void hehe() {
3232
System.out.println("After ...");
3333
}
34-
34+
3535
@AfterReturning("aopPointCut()")
3636
public void xixi() {
3737
System.out.println("AfterReturning ...");
3838
}
39-
39+
4040
@Around("aopPointCut()")
4141
public void xxx(ProceedingJoinPoint pj) {
4242
try {
@@ -47,11 +47,11 @@ public void xxx(ProceedingJoinPoint pj) {
4747
throwable.printStackTrace();
4848
}
4949
}
50-
50+
5151
@Pointcut("execution(* com.helltractor.demo.service.IBuy.buyPrice(double)) && args(price) && bean(girl)")
5252
public void gift(double price) {
5353
}
54-
54+
5555
/**
5656
* around notice
5757
*

demo-aspectj/src/main/java/com/helltractor/demo/annotation/AutoFill.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
@Target(ElementType.METHOD)
1414
@Retention(RetentionPolicy.RUNTIME)
1515
public @interface AutoFill {
16-
16+
1717
OperationType value() default OperationType.INSERT;
1818
}

demo-aspectj/src/main/java/com/helltractor/demo/entity/Boy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
*/
1010
@Component
1111
public class Boy implements IBuy {
12-
12+
1313
@Override
1414
public String buy() {
1515
System.out.println("男孩买了一个游戏机");
1616
return "游戏机";
1717
}
18-
18+
1919
@Override
2020
public String buyPrice(double price) {
2121
System.out.println(String.format("男孩花了%s元买了一个游戏机", price));

demo-aspectj/src/main/java/com/helltractor/demo/entity/Girl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
*/
1010
@Component
1111
public class Girl implements IBuy {
12-
12+
1313
@Override
1414
public String buy() {
1515
System.out.println("女孩买了一件漂亮的衣服");
1616
return "衣服";
1717
}
18-
18+
1919
@Override
2020
public final String buyPrice(double price) {
2121
System.out.printf("女孩花了%s元买了一件漂亮的衣服%n", price);
2222
return "衣服";
2323
}
24-
24+
2525
}

demo-aspectj/src/main/java/com/helltractor/demo/service/IBuy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* 服务类,购买方法
55
*/
66
public interface IBuy {
7-
7+
88
String buy();
9-
9+
1010
String buyPrice(double price);
1111
}

demo-aspectj/src/test/java/com/helltractor/demo/AutoFillTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@
1515
@SpringBootTest
1616
@ContextConfiguration(classes = {AutoFillConfig.class})
1717
public class AutoFillTest {
18-
18+
1919
@Test
2020
public void autoFillTest() {
2121
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AutoFillConfig.class);
2222
Boy boy = context.getBean("boy", Boy.class);
2323
Girl girl = (Girl) context.getBean("girl");
24-
24+
2525
boy.buy();
2626
girl.buy();
27-
27+
2828
String boyBought = boy.buyPrice(35);
2929
String girlBought = girl.buyPrice(99.8);
30-
30+
3131
System.out.println("男孩买到了:" + boyBought);
3232
System.out.println("女孩买到了:" + girlBought);
3333
}
34-
34+
3535
}

0 commit comments

Comments
 (0)