0%

maven的命令。如果yml文件改变了,但是没有运行的话,package命令只会打包以前在target目录下的yml,导致配置失效。

这个问题,困扰了我好多天,记录一下。

虚拟dom

image-20200922103757589

这才是React的真实场景:

image-20200922104302028

Diff算法

image-20200922105350013

image-20200922105623348

不要用index作为key值,可以用item作为key,因为重新渲染会导致key对不上,增加性能消耗

image-20200915085729705

image-20200915091146223

image-20200915145356007

image-20200915145727647

image-20200915145914282

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
server {
listen 80;
server_name localhost www.jxs17.com jxs17.com;
#charset koi8-r;

#access_log logs/host.access.log main;

location / {
root web;
index index.html index.htm;
}
# 把/api的接口重定向到8081端口
location /api/ {
proxy_pass http://127.0.0.1:8081/;
}

# 把以admin开头的接口,定位到admin这个包下
location /admin {
alias admin;
index index.html index.htm;

}
# 把www重定向到不加www
if ($http_host !~ "^jxs17.com$") {
rewrite ^(.*) http://jxs17.com$1 permanent;

}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}

AOP概念

image-20200911100300131

image-20200912143553232

image-20200912143723324

image-20200912143947565

image-20200912144656229

image-20200912144629876

image-20200912145028664

Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* @author xixing
* @version 1.0
* @date 2020/9/11 10:21
*/
@Aspect
@Component
public class ServiceAspect {

/**
* *表示所有返回类型
* ..表示该包下面的所有子包
* *表示所有类
* .*表示所有方法
* (..)表示方法不管多少个参数
*
*/
@Pointcut("execution(* site.xixing.service..*.*(..))")
public void embed(){

}

@Before("embed()")
public void before(JoinPoint joinPoint){
System.out.println("begin the joinPoint"+joinPoint);
}

@After("embed()")
public void after(JoinPoint joinPoint){
System.out.println("end the joinPoint"+joinPoint);
}

@Around("embed()")
public Object around(JoinPoint joinPoint){
long start=System.currentTimeMillis();
System.out.println("开始计时:"+start);
Object returnValue=null;

try {
((ProceedingJoinPoint) joinPoint).proceed();

System.out.println("执行成功");
} catch (Throwable throwable) {
throwable.printStackTrace();
}finally {
long endTime=System.currentTimeMillis();
System.out.println("执行时间:"+(endTime-start));
}
return returnValue;
}

@AfterReturning(pointcut = "embed()" ,returning = "returnValue")
public void afterReturning(JoinPoint joinPoint,Object returnValue){
System.out.println("afterReturning:"+joinPoint+"最后返回:"+returnValue);
}

@AfterThrowing(pointcut = "embed()" ,throwing = "exception")
public void afterThrowing(JoinPoint joinPoint,Exception exception){
System.out.println("抛出异常通知:"+joinPoint+exception.getMessage());
}

}

Introduction

1
2
@DeclareParents(value = "site.xixing.controller..*" ,defaultImpl =site.xixing.introduction.impl.LittleUniverseImpl.class)
public LittleUniverse littleUniverse;

image-20200912150612813

代理模式

1
2
3
4
5
6
7
8
9
/**
* @author xixing
* @version 1.0
* @date 2020/9/12 15:54
*/
public interface ToCPayment {

void pay();
}
1
2
3
4
5
6
7
8
9
10
11
/**
* @author xixing
* @version 1.0
* @date 2020/9/12 16:07
*/
public class ToCPaymentImpl implements ToCPayment {
@Override
public void pay() {
System.out.println("支付!!!");
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
* @author xixing
* @version 1.0
* @date 2020/9/12 16:08
*/
public class AlipayToC implements ToCPayment {

ToCPayment toCPayment;

public AlipayToC(ToCPayment toCPayment){
this.toCPayment=toCPayment;
}

@Override
public void pay() {
before();
toCPayment.pay();
after();
}

private void before() {
System.out.println("从银行取款!!!");
}

private void after() {
System.out.println("转入对应的账户!!!");
}
}

image-20200912161732584

image-20200912161807928

image-20200914094509519

image-20200914101303047

image-20200914103342114

image-20200914103416826

image-20200914103428916

代理模式代码