diff --git a/_sidebar.md b/_sidebar.md
index 53f3083f92789f94d9e11d5e46d5de9b3cdcb720..471e558a9e3d5d41968a1ebe60580872b3b60a8b 100644
--- a/_sidebar.md
+++ b/_sidebar.md
@@ -34,4 +34,5 @@
- 其他
- [其他](doc/index.md)
- - [chrome](doc/chrome.md)
\ No newline at end of file
+ - [chrome](doc/chrome.md)
+ - [微信支付](blog/pay/weixin-pay.md)
\ No newline at end of file
diff --git a/blog/elasticsearch/index.md b/blog/elasticsearch/index.md
index 7a69fd2161c2b060e94ea9d38d6815f6b530c647..85439a55bd63be8d020484eb6f49dd173579df5b 100644
--- a/blog/elasticsearch/index.md
+++ b/blog/elasticsearch/index.md
@@ -40,3 +40,8 @@ Elastic Stack
[聚合查询 aggregation](blog/elasticsearch/aggregation.md)
+[核心概念]
+
+[搜索和查询]
+
+https://www.bilibili.com/video/BV1LY4y167n5?p=20&vd_source=efbb4dc944fa761b6e016ce2ca5933da
\ No newline at end of file
diff --git a/blog/elasticsearch/install.md b/blog/elasticsearch/install.md
index 54bda615a8128739502e4a3c41d9cf667ed6c7c1..b313d69f88f386c5656e8fae44b7ed227c807df4 100644
--- a/blog/elasticsearch/install.md
+++ b/blog/elasticsearch/install.md
@@ -313,6 +313,24 @@ http.cors.allow-origin: "*"
备用地址:[https://github.com/mouday/ElasticSearch-Head.crx](https://github.com/mouday/ElasticSearch-Head.crx)
+## 集群健康检查
+
+- green 集群健康
+- yellow 至少一个数据可用
+- red 数据不完整,集群不可用
+
+查看健康值
+```bash
+# 返回简要
+GET _cat/health
+
+# 返回带有标题的数据
+GET _cat/health?v
+
+# 返回json数据
+GET _cluster/health
+```
+
## 5、不同编程语言的客户端
https://www.elastic.co/guide/en/elasticsearch/client/index.html
@@ -364,5 +382,4 @@ server {
}
}
```
-
https://www.bilibili.com/video/BV1LY4y167n5?p=5&spm_id_from=pageDriver&vd_source=efbb4dc944fa761b6e016ce2ca5933da
\ No newline at end of file
diff --git a/blog/pay/create-project.md b/blog/pay/create-project.md
new file mode 100644
index 0000000000000000000000000000000000000000..501c15b8039988376d019a275a1119f3e70ae2fb
--- /dev/null
+++ b/blog/pay/create-project.md
@@ -0,0 +1,426 @@
+# 创建项目
+
+- SpringBoot java SpringMVC RESTful json
+- Swagger 接口文档和测试页面生成工具
+- 定义统一的结果 让前后端数据通信更规范
+- MySQL
+- MyBatis-Plus
+- Vue.js
+
+## 创建项目
+
+阿里云脚手架:https://start.aliyun.com/
+
+版本:SpringBoot 2.3.7
+
+依赖
+
+```xml
+
+
+
+ org.springframework.boot
+
+ spring-boot-starter-web
+
+```
+
+配置文件
+
+application.properties 重命名为 application.yml
+
+```yaml
+# application.yml
+
+server:
+ port: 8090
+
+sprint:
+ applicaiotn:
+ # 应用名称
+ name: payment-demo
+
+```
+
+定义测试接口
+
+```java
+package com.mouday.paymentdemo.controller;
+
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/api/product")
+public class ProductController {
+
+ @GetMapping("/test")
+ public String test(){
+ return "Hello";
+ }
+}
+
+```
+
+
+访问测试
+
+http://localhost:8090/api/product/test
+
+
+## 引入 swagger
+
+```xml
+
+
+ io.springfox
+ springfox-swagger2
+ 2.9.2
+
+
+
+
+ io.springfox
+ springfox-swagger-ui
+ 2.9.2
+
+```
+
+配置文件
+
+```java
+package com.mouday.paymentdemo.config;
+
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+@Configuration
+@EnableSwagger2
+public class Swagger2Config {
+
+ @Bean
+ public Docket docket() {
+ return new Docket(DocumentationType.SWAGGER_2)
+ .apiInfo(new ApiInfoBuilder().title("微信支付文档").build());
+ }
+}
+
+```
+
+完善接口配置
+```java
+package com.mouday.paymentdemo.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@Api(tags = "商品管理")
+@RestController
+@RequestMapping("/api/product")
+public class ProductController {
+
+ @ApiOperation("测试接口")
+ @GetMapping("/test")
+ public String test(){
+ return "Hello";
+ }
+}
+
+```
+
+查看地址:http://localhost:8090/swagger-ui.html
+
+
+## 引入lombok
+
+```xml
+
+
+ org.projectlombok
+ lombok
+
+```
+
+## 定义统一的返回格式
+
+```java
+package com.mouday.paymentdemo.vo;
+
+import lombok.Data;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+@Data
+public class Result {
+
+ // 响应码
+ private Integer code;
+
+ //响应消息
+ private String message;
+
+ //响应数据
+ private Map data = new HashMap<>();
+
+ public static Result success() {
+ Result result = new Result();
+ result.setCode(0);
+ result.setMessage("成功");
+ return result;
+ }
+
+ public static Result error() {
+ Result result = new Result();
+ result.setCode(-1);
+ result.setMessage("失败");
+ return result;
+ }
+
+ public Result data(String key, Object value) {
+ this.data.put(key, value);
+ return this;
+ }
+}
+
+```
+
+使用
+```java
+package com.mouday.paymentdemo.controller;
+
+import com.mouday.paymentdemo.vo.Result;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Date;
+
+@Api(tags = "商品管理")
+@RestController
+@RequestMapping("/api/product")
+public class ProductController {
+
+ @ApiOperation("测试接口")
+ @GetMapping("/test")
+ public Result test(){
+ return Result.success().data("now", new Date());
+ }
+}
+
+```
+
+返回结果
+```json
+{
+ "code": 0,
+ "message": "成功",
+ "data": {
+ "now": "2022-06-12T02:59:15.447+00:00"
+ }
+}
+```
+
+## 引入数据库依赖
+
+```xml
+
+
+ mysql
+ mysql-connector-java
+ 8.0.15
+
+
+
+
+ com.baomidou
+ mybatis-plus-boot-starter
+ 3.3.2
+
+```
+
+创建数据库
+
+```bash
+mysql -uroot -p
+
+create database db_payment_demo;
+```
+数据库信息配置
+
+```yaml
+# application.yml
+sprint:
+ datasource:
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ # 设置连接的时区和字符编码
+ url: jdbc:mysql://localhost:3306/db_payment_demo?serverTimezone=Asia/Shanghai&characterEncoding=utf-8
+ username: root
+ password: 123456
+
+```
+
+实现以下类
+
+```bash
+entity
+ BaseEntity.java
+mapper
+ /xml
+service
+ /impl
+```
+
+扫描mapper类
+
+```java
+package com.mouday.paymentdemo.config;
+
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+@Configuration
+@MapperScan("com.mouday.paymentdemo.mapper")
+// 启用事务管理
+@EnableTransactionManagement
+public class MyBatisPlusConfig {
+
+}
+
+```
+
+打包xml文件
+
+```xml
+
+
+
+
+ src/main/java
+
+ **/*.xml
+
+ false
+
+
+
+```
+
+
+```yaml
+# 配置 mybatis-plus
+mybatis-plus:
+ configuratin:
+ # sql日志
+ log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+ mapper-locations: classpath:com/mouday/paymentdemo/mapper/xml/*.xml
+```
+
+## 前端项目
+
+安装Node.js
+```
+node -v
+14.18.0
+```
+
+编辑工具:vscode
+
+插件: Volar vue-helper
+
+vue.js: https://cn.vuejs.org/index.html
+
+```bash
+# 设置淘宝镜像
+npm config set registry https://registry.npm.taobao.org
+
+# 全局安装vue-cli
+npm install @vue/cli -g
+
+# 创建vue2项目
+vue create vue-demo
+
+# 运行项目
+npm run serve -- --port 8001
+
+# 清屏
+ctrl + l
+```
+
+浏览器开发工具:vue.js devtools
+
+数据绑定
+```vue
+
+
+ {{name}}
+
+
+
+
+
+
+
+
+
+```
+
+内容
+
+1. 引入支付参数
+2. 加载商户私钥
+3. 获取平台证书和验证签名
+4. 获取HttpClient对象
+5. API字典和接口规则
+6. 内网穿透
+7. API v3
+
+```xml
+
+
+ org.springframework.boot
+ spring-boot-configuration-processor
+ true
+
+```
+
+
+```xml
+
+
+ com.google.code.gson
+ gson
+
+```
+
diff --git a/blog/pay/security.md b/blog/pay/security.md
new file mode 100644
index 0000000000000000000000000000000000000000..5cb37d4b3da3c814b68603f1c1735632dd5d6719
--- /dev/null
+++ b/blog/pay/security.md
@@ -0,0 +1,79 @@
+
+# 加密
+
+术语:
+```
+明文 plain text
+密文 cipher text
+秘钥 key
+加密 encrypt
+解密 decrtpt
+加密算法
+```
+
+## 对称加密
+
+加密解密的秘钥是同一个
+```
+明文 秘钥加密 密文 秘钥解密 明文
+```
+
+eg: AES
+
+## 非对称加密
+
+加密解密的秘钥不是同一个
+
+```
+明文 公钥加密 密文 私钥解密 明文
+```
+
+eg: RSA
+
+|加密分类 | 优点 | 缺点
+|- | - | -
+|对称加密 | 速度快 | 消息容易被破解
+|非对称加密 | 速度慢 | 消息不容易被破解
+
+
+## 身份认证
+
+- 加密信息:公钥加密 -> 私钥解密
+- 身份认证:私钥加密 -> 公钥解密
+
+## 摘要算法
+
+摘要算法(Digest Algorithm)即:散列函数、哈希函数(Hash Function)
+
+作用:保证数据完整性
+
+```
+固定长度字符串 = Hash(任意长度字符串)
+```
+
+好的摘要算法:
+
+- 不可逆
+- 难题友好性
+- 发散性
+- 抗碰撞性
+
+常见算法:MD5、SHA1、SHA2(SHA224、SHA256、SHA384)
+
+## 数字签名
+
+```
+发送方:
+原文 -> hash -> 签名 -> private key -> 密文
+
+接收方:
+密文 -> public key -> 明文 -> hash -> 签名
+```
+
+## 数字证书
+
+- 公钥
+- 所有者
+- 颁发者
+
+使用场景:https
diff --git a/blog/pay/start.md b/blog/pay/start.md
new file mode 100644
index 0000000000000000000000000000000000000000..dbe10174bfa69e40d1b75e67ec35762b6ed9c0c9
--- /dev/null
+++ b/blog/pay/start.md
@@ -0,0 +1,42 @@
+# 接入指引
+
+1. 申请APPID
+ - 公众号: https://mp.weixin.qq.com/
+ - 小程序:https://mp.weixin.qq.com/
+ - APP 开放平台:https://open.weixin.qq.com/
+
+2. 申请mchid(商户号)
+ - 微信商户平台:https://pay.weixin.qq.com/
+
+3. API v3密钥
+ - 微信商户平台:https://pay.weixin.qq.com/
+
+4. 商户证书
+ - 微信商户平台:https://pay.weixin.qq.com/
+
+5. 微信平台证书
+ - Java命令行下载工具: https://github.com/wechatpay-apiv3/CertificateDownloader
+ - php命令行下载工具:[https://github.com/wechatpay-apiv3/wechatpay-php/blob/main/bin/README.md](https://github.com/wechatpay-apiv3/wechatpay-php/blob/main/bin/README.md)
+
+> 商户和微信平台进行通信,所以双方都需要有一套证书
+
+## SDK
+
+Java: https://github.com/wechatpay-apiv3/wechatpay-apache-httpclient
+
+```xml
+
+ com.github.wechatpay-apiv3
+ wechatpay-apache-httpclient
+ 0.4.7
+
+```
+
+PHP:https://github.com/wechatpay-apiv3/wechatpay-php
+
+- Guzzle 7.0,PHP >= 7.2.5
+- Guzzle 6.5,PHP >= 7.1.2
+
+```bash
+composer require wechatpay/wechatpay
+```
\ No newline at end of file
diff --git a/blog/pay/weixin-pay.md b/blog/pay/weixin-pay.md
new file mode 100644
index 0000000000000000000000000000000000000000..72c0581f49ced3364f84e22341a33caea90f2ff8
--- /dev/null
+++ b/blog/pay/weixin-pay.md
@@ -0,0 +1,16 @@
+
+【尚硅谷】微信支付&支付宝支付,一套搞定Java在线支付开发教程
+https://www.bilibili.com/video/BV1US4y1D77m
+
+
+## 微信支付
+
+https://pay.weixin.qq.com
+
+[接入指引](blog/pay/start.md)
+
+[支付安全](blog/pay/security.md)
+
+[创建项目](blog/pay/create-project.md)
+
+https://www.bilibili.com/video/BV1US4y1D77m?p=51
\ No newline at end of file
diff --git a/blog/php-mysql/index.md b/blog/php-mysql/index.md
index c3020595b011b3db1e6c1a7d3bfd472a472565b8..30a03e887804c94ced83f0cce8548edadcc90b90 100644
--- a/blog/php-mysql/index.md
+++ b/blog/php-mysql/index.md
@@ -54,9 +54,9 @@
26. [视图 view](blog/php-mysql/sql-view.md)
-[事务安全 transaction](blog/php-mysql/sql-transaction.md)
+27. [事务安全 transaction](blog/php-mysql/sql-transaction.md)
-[变量 variables](blog/php-mysql/sql-variables.md)
+28. [变量 variables](blog/php-mysql/sql-variables.md)
[流程结构 if while](blog/php-mysql/sql-if-while.md)
diff --git a/blog/php-mysql/sql-variables.md b/blog/php-mysql/sql-variables.md
index bc7c4d4af1f07d48719b9777e6bfed2a94f24501..ad95ec17b322d9fc9858b86a6340ba181e620d13 100644
--- a/blog/php-mysql/sql-variables.md
+++ b/blog/php-mysql/sql-variables.md
@@ -1,4 +1,4 @@
-# 变量
+# 变量 variables
MySQL本质是一种编程语言
diff --git a/doc/index.md b/doc/index.md
index fdd6dadef39c56d473d23aa6185f03f010577ffb..aa5adbf5dfd62e3e3cff129de640586c6fe37fc1 100644
--- a/doc/index.md
+++ b/doc/index.md
@@ -75,6 +75,8 @@ Logo:https://www.logoly.pro/
[Snipaste](https://zh.snipaste.com/index.html) 截图 + 贴图,提高您的工作效率
+[ngrok](https://ngrok.com/) 内网穿透工具
+
## 学习资料:
2022 黑马程序员 Java 学习路线图
diff --git a/doc/javascript.md b/doc/javascript.md
index a8d4e8c75d88e79eb4e306441e768309ca8e9d93..953186818fa6a1fe550ee8ae91d851ea257d1445 100644
--- a/doc/javascript.md
+++ b/doc/javascript.md
@@ -2,7 +2,10 @@
## 第三方库
-[vue.js](https://cn.vuejs.org/v2/guide/)
+vue.js: 渐进式 JavaScript 框架
+
+- [vue2.js](https://cn.vuejs.org/v2/guide/): https://cn.vuejs.org/
+- [vue3.js](https://staging-cn.vuejs.org/guide/introduction.html): https://staging-cn.vuejs.org/
- [element-ui](https://element.eleme.cn/#/zh-CN/component/installation): 一套为开发者、设计师和产品经理准备的基于 Vue 2.0 的桌面端组件库
- [vColorPicker](http://vue-color-picker.rxshc.com/): 基于 Vue 的颜色选择器插件
@@ -68,6 +71,15 @@
[preactjs](https://preactjs.com/)Fast 3kB alternative to React with the same modern API.
+[node-qrcode](https://github.com/soldair/node-qrcode) QR code/2d barcode generator.
+
+[QRCode.js](https://github.com/davidshimjs/qrcodejs): Cross-browser QRCode generator for javascript
+
+[vue-qriously](https://github.com/theomessin/vue-qriously):A Vue.js 2 component to draw QR codes on an HTML Canvas using qrious.
+
+[qrious](https://github.com/neocotic/qrious): Pure JavaScript library for QR code generation using canvas
+
+
## CDN
[BootCDN](https://www.bootcdn.cn/): 稳定、快速、免费的前端开源项目 CDN 加速服务