[type:feat] refactor param-mapping plugin (#753)
* [type:feat] refactor param-mapping plugin
* [type:fix] fix title
diff --git a/docs/plugin-center/http-process/parammapping-plugin.md b/docs/plugin-center/http-process/parammapping-plugin.md
index 07fc8a7..caa04ab 100644
--- a/docs/plugin-center/http-process/parammapping-plugin.md
+++ b/docs/plugin-center/http-process/parammapping-plugin.md
@@ -4,45 +4,89 @@
description: paramMapping-plugin
---
-## Description
+# 1. Overview
-* `paramMapping` is a native plugin of Apache ShenYu Gateway and is used to edit your request param.
+## 1.1 Plugin Name
-## Plugin Setting
+* ParamMapping Plugin
-* In `shenyu-admin` --> BasicConfig --> Plugin --> `paramMapping` , set to enable.
+## 1.2 Appropriate Scenario
-## Plugin Use
+* Add/remove/replace certain fixed parameters to the request
+
+## 1.3 Plugin functionality
+
+* `paramMapping` is used to edit your request parameters.
+
+## 1.4 Plugin code
+
+* Core Module `shenyu-plugin-param-mapping`
+
+* Core Class `org.apache.shenyu.plugin.param.mapping.ParamMappingPlugin`
+
+## 1.5 Added Since Which shenyu version
+
+* Since ShenYu 2.4.0
+
+# 2. How to use plugin
+
+## 2.1 Plugin-use procedure chart
+
+![](/img/shenyu/plugin/plugin_use_en.jpg)
+
+## 2.2 Import pom
* Introduce `paramMapping` dependency in the pom.xml file of the gateway.
```xml
- <!-- apache shenyu param_mapping plugin start-->
+<!-- apache shenyu param_mapping plugin start-->
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-spring-boot-starter-plugin-param-mapping</artifactId>
<version>${project.version}</version>
</dependency>
- <!-- apache shenyu param_mapping plugin end-->
+<!-- apache shenyu param_mapping plugin end-->
```
+## 2.3 Enable plugin
+
+- In `shenyu-admin` --> BasicConfig --> Plugin --> `paramMapping` set Status enabled.
+
+## 2.4 Config plugin
+
+### 2.4.1 Plugin Config
+
+* you should open this plugin when using.
+
+### 2.4.2 Selector Config
+
* Selectors and rules, please refer to:[Selector And Rule Config](../../user-guide/admin-usage/selector-and-rule)。
- * Only those matched requests can be modified your request body.
+* Only those matched requests can be modified your request body.
+### 2.4.3 Rule Config
-## ParamMappingPlugin Guide
-
-* 1.Configuration selector
-* 2.Configuration rule
-* 3.modify request body
- ![](/img/shenyu/plugin/param-mapping/param-mapping.png)
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
* param details:
* `addParameterKeys`: add a new `key-value` on body
* `replaceParameterKeys`: replace request body's `key` ,`key` is the value to be replaced,`value` is the value after replacement
* `removeParameterKeys`: remove a body `key`
-param_mapping modify the request body is achieved through `JSONPath` , `$.` represents the root directory.
+* param_mapping modify the request body is achieved through `JSONPath` , `$.` represents the root directory.
+
+## 2.5 Examples
+
+### 2.5.1 Add parameters in request
+
+#### 2.5.1.1 Config Plugin
+
+* you should open the plugin when using.
+
+#### 2.5.1.2 Selector Config
+
+#### 2.5.1.3 Rule Config
+
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
use the configuration,unopened the plugin,request body is:
@@ -50,6 +94,8 @@
{"id":3,"data":{"value":"18","age":"36"}}
```
+#### 2.5.1.4 Check Result
+
open the plugin,the final request body is
```json
@@ -57,3 +103,7 @@
```
add a new key-value `name:shenyu`,replace the key `id` to `userId`, remove the key `data.value` .
+
+# 3. How to disable plugin
+
+- In `shenyu-admin` --> BasicConfig --> Plugin --> `paramMapping` set Status disable.
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/http-process/parammapping-plugin.md b/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/http-process/parammapping-plugin.md
index 3fd6ade..446843f 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/http-process/parammapping-plugin.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/http-process/parammapping-plugin.md
@@ -4,17 +4,37 @@
description: ParamMapping插件
---
-## 说明
+# 1. 概述
-* `paramMapping`插件是 `Apache ShenYu` 网关自带的,用来对你的请求参数进行修改的插件。
+## 1.1 插件名称
+* paramMapping插件
+## 1.2 适用场景
-## 插件设置
+* 添加/删除/替换请求体中固定的参数
-- 在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `paramMapping` 设置为开启。
+## 1.3 插件功能
-## 插件使用
+* 用来对你的请求参数进行修改的插件。
+
+## 1.4 插件代码
+
+* 核心模块 `shenyu-plugin-param-mapping`
+
+* 核心类 `org.apache.shenyu.plugin.param.mapping.ParamMappingPlugin`
+
+## 1.5 添加自哪个shenyu版本
+
+* Since ShenYu 2.4.0
+
+# 2. 如何使用插件
+
+## 2.1 插件使用流程图
+
+![](/img/shenyu/plugin/plugin_use_zh.jpg)
+
+## 2.2 导入pom
* 在网关的 `pom.xml` 文件中添加 `paramMapping` 的支持。
@@ -28,22 +48,45 @@
<!-- apache shenyu param_mapping plugin end-->
```
+## 2.3 启用插件
+
+- 在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `paramMapping` 设置为开启。
+
+## 2.4 配置插件
+
+### 2.4.1 插件配置
+
+* 再使用插件时应该开启插件!
+
+### 2.4.2 选择器配置
+
* 选择器和规则设置,请参考:[选择器和规则管理](../../user-guide/admin-usage/selector-and-rule)。
- * 只有匹配的请求,才会修改请求体。
+* 只有匹配的请求,才会修改请求体。
-## 修改请求插件使用指南
+### 2.4.3 规则配置
-* 1.配置选择器
-* 2.配置规则
-* 3.修改请求体
- ![](/img/shenyu/plugin/param-mapping/param-mapping.png)
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
* 参数解析:
* `addParameterKeys`: 在请求体中增加一个 `key-value`
* `replaceParameterKeys`: 替换请求体中的某一个 `key` ,`key` 是要被替换的值,`value` 是替换后的值
* `removeParameterKeys`: 移除请求体中的某一个 `key`
-修改请求体是通过 `JSONPath` 来实现的, `$.` 代表根目录
+* 修改请求体是通过 `JSONPath` 来实现的, `$.` 代表根目录
+
+## 2.5 示例
+
+### 2.5.1 在请求中添加参数
+
+#### 2.5.1.1 配置插件
+
+* 使用该插件时应先开启插件!
+
+#### 2.5.1.2 选择器配置
+
+#### 2.5.1.3 规则配置
+
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
上面的配置,插件开启前,请求内容为
@@ -51,6 +94,8 @@
{"id":3,"data":{"value":"18","age":"36"}}
```
+#### 2.5.1.4 验证结果
+
插件开启后,请求内容为
```json
@@ -58,3 +103,7 @@
```
上述操作,增加一个`name:shenyu`,把`id`替换为`userId`,移除`data`中的`value` 。
+
+# 3. 如何禁用插件
+
+- 在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `paramMapping` 设置为关闭。
diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/plugin-center/http-handle/param-mapping-plugin.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/plugin-center/http-handle/param-mapping-plugin.md
index 05a1706..4a9cc93 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/plugin-center/http-handle/param-mapping-plugin.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/plugin-center/http-handle/param-mapping-plugin.md
@@ -4,19 +4,39 @@
description: Param-mapping插件
---
-## 说明
+# 1. 概述
-* `param_mapping`插件是 `Apache ShenYu` 网关自带的,用来对你的请求参数进行修改的插件。
+## 1.1 插件名称
+* paramMapping插件
+## 1.2 适用场景
-## 插件设置
+* 添加/删除/替换请求体中固定的参数
-- 在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `param_mapping` 设置为开启。
+## 1.3 插件功能
-## 插件使用
+* 用来对你的请求参数进行修改的插件。
-* 在网关的 `pom.xml` 文件中添加 `param_mapping` 的支持。
+## 1.4 插件代码
+
+* 核心模块 `shenyu-plugin-param-mapping`
+
+* 核心类 `org.apache.shenyu.plugin.param.mapping.ParamMappingPlugin`
+
+## 1.5 添加自哪个shenyu版本
+
+* Since ShenYu 2.4.0
+
+# 2. 如何使用插件
+
+## 2.1 插件使用流程图
+
+![](/img/shenyu/plugin/plugin_use_zh.jpg)
+
+## 2.2 导入pom
+
+* 在网关的 `pom.xml` 文件中添加 `paramMapping` 的支持。
```xml
<!-- apache shenyu param_mapping plugin start-->
@@ -28,22 +48,45 @@
<!-- apache shenyu param_mapping plugin end-->
```
+## 2.3 启用插件
+
+- 在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `paramMapping` 设置为开启。
+
+## 2.4 配置插件
+
+### 2.4.1 插件配置
+
+* 再使用插件时应该开启插件!
+
+### 2.4.2 选择器配置
+
* 选择器和规则设置,请参考:[选择器和规则管理](../../user-guide/admin-usage/selector-and-rule)。
- * 只有匹配的请求,才会修改响应。
+* 只有匹配的请求,才会修改请求体。
-## 修改响应插件使用指南
+### 2.4.3 规则配置
-* 1.配置选择器
-* 2.配置规则
-* 3.修改请求体
- ![](/img/shenyu/plugin/param-mapping/param-mapping.png)
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
* 参数解析:
* `addParameterKeys`: 在请求体中增加一个 `key-value`
* `replaceParameterKeys`: 替换请求体中的某一个 `key` ,`key` 是要被替换的值,`value` 是替换后的值
* `removeParameterKeys`: 移除请求体中的某一个 `key`
-修改响应体是通过 `JSONPath` 来实现的, `$.` 代表根目录
+* 修改请求体是通过 `JSONPath` 来实现的, `$.` 代表根目录
+
+## 2.5 示例
+
+### 2.5.1 在请求中添加参数
+
+#### 2.5.1.1 配置插件
+
+* 使用该插件时应先开启插件!
+
+#### 2.5.1.2 选择器配置
+
+#### 2.5.1.3 规则配置
+
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
上面的配置,插件开启前,请求内容为
@@ -51,10 +94,17 @@
{"id":3,"data":{"value":"18","age":"36"}}
```
-插件开启后,响应内容为
+#### 2.5.1.4 验证结果
+
+插件开启后,请求内容为
```json
{"name":"shenyu","userId":3,"data":{"age":"36"}}
```
上述操作,增加一个`name:shenyu`,把`id`替换为`userId`,移除`data`中的`value` 。
+
+# 3. 如何禁用插件
+
+- 在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `paramMapping` 设置为关闭。
+
diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.1/plugin-center/http-handle/param-mapping-plugin.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.1/plugin-center/http-handle/param-mapping-plugin.md
index f3de4fa..4a9cc93 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.1/plugin-center/http-handle/param-mapping-plugin.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.1/plugin-center/http-handle/param-mapping-plugin.md
@@ -4,19 +4,39 @@
description: Param-mapping插件
---
-## 说明
+# 1. 概述
-* `param_mapping`插件是 `Apache ShenYu` 网关自带的,用来对你的请求参数进行修改的插件。
+## 1.1 插件名称
+* paramMapping插件
+## 1.2 适用场景
-## 插件设置
+* 添加/删除/替换请求体中固定的参数
-- 在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `param_mapping` 设置为开启。
+## 1.3 插件功能
-## 插件使用
+* 用来对你的请求参数进行修改的插件。
-* 在网关的 `pom.xml` 文件中添加 `param_mapping` 的支持。
+## 1.4 插件代码
+
+* 核心模块 `shenyu-plugin-param-mapping`
+
+* 核心类 `org.apache.shenyu.plugin.param.mapping.ParamMappingPlugin`
+
+## 1.5 添加自哪个shenyu版本
+
+* Since ShenYu 2.4.0
+
+# 2. 如何使用插件
+
+## 2.1 插件使用流程图
+
+![](/img/shenyu/plugin/plugin_use_zh.jpg)
+
+## 2.2 导入pom
+
+* 在网关的 `pom.xml` 文件中添加 `paramMapping` 的支持。
```xml
<!-- apache shenyu param_mapping plugin start-->
@@ -28,22 +48,45 @@
<!-- apache shenyu param_mapping plugin end-->
```
+## 2.3 启用插件
+
+- 在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `paramMapping` 设置为开启。
+
+## 2.4 配置插件
+
+### 2.4.1 插件配置
+
+* 再使用插件时应该开启插件!
+
+### 2.4.2 选择器配置
+
* 选择器和规则设置,请参考:[选择器和规则管理](../../user-guide/admin-usage/selector-and-rule)。
- * 只有匹配的请求,才会修改请求体。
+* 只有匹配的请求,才会修改请求体。
-## 修改请求插件使用指南
+### 2.4.3 规则配置
-* 1.配置选择器
-* 2.配置规则
-* 3.修改请求体
- ![](/img/shenyu/plugin/param-mapping/param-mapping.png)
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
* 参数解析:
* `addParameterKeys`: 在请求体中增加一个 `key-value`
* `replaceParameterKeys`: 替换请求体中的某一个 `key` ,`key` 是要被替换的值,`value` 是替换后的值
* `removeParameterKeys`: 移除请求体中的某一个 `key`
-修改请求体是通过 `JSONPath` 来实现的, `$.` 代表根目录
+* 修改请求体是通过 `JSONPath` 来实现的, `$.` 代表根目录
+
+## 2.5 示例
+
+### 2.5.1 在请求中添加参数
+
+#### 2.5.1.1 配置插件
+
+* 使用该插件时应先开启插件!
+
+#### 2.5.1.2 选择器配置
+
+#### 2.5.1.3 规则配置
+
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
上面的配置,插件开启前,请求内容为
@@ -51,6 +94,8 @@
{"id":3,"data":{"value":"18","age":"36"}}
```
+#### 2.5.1.4 验证结果
+
插件开启后,请求内容为
```json
@@ -58,3 +103,8 @@
```
上述操作,增加一个`name:shenyu`,把`id`替换为`userId`,移除`data`中的`value` 。
+
+# 3. 如何禁用插件
+
+- 在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `paramMapping` 设置为关闭。
+
diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.2/plugin-center/http-process/parammapping-plugin.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.2/plugin-center/http-process/parammapping-plugin.md
index 3fd6ade..446843f 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.2/plugin-center/http-process/parammapping-plugin.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.2/plugin-center/http-process/parammapping-plugin.md
@@ -4,17 +4,37 @@
description: ParamMapping插件
---
-## 说明
+# 1. 概述
-* `paramMapping`插件是 `Apache ShenYu` 网关自带的,用来对你的请求参数进行修改的插件。
+## 1.1 插件名称
+* paramMapping插件
+## 1.2 适用场景
-## 插件设置
+* 添加/删除/替换请求体中固定的参数
-- 在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `paramMapping` 设置为开启。
+## 1.3 插件功能
-## 插件使用
+* 用来对你的请求参数进行修改的插件。
+
+## 1.4 插件代码
+
+* 核心模块 `shenyu-plugin-param-mapping`
+
+* 核心类 `org.apache.shenyu.plugin.param.mapping.ParamMappingPlugin`
+
+## 1.5 添加自哪个shenyu版本
+
+* Since ShenYu 2.4.0
+
+# 2. 如何使用插件
+
+## 2.1 插件使用流程图
+
+![](/img/shenyu/plugin/plugin_use_zh.jpg)
+
+## 2.2 导入pom
* 在网关的 `pom.xml` 文件中添加 `paramMapping` 的支持。
@@ -28,22 +48,45 @@
<!-- apache shenyu param_mapping plugin end-->
```
+## 2.3 启用插件
+
+- 在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `paramMapping` 设置为开启。
+
+## 2.4 配置插件
+
+### 2.4.1 插件配置
+
+* 再使用插件时应该开启插件!
+
+### 2.4.2 选择器配置
+
* 选择器和规则设置,请参考:[选择器和规则管理](../../user-guide/admin-usage/selector-and-rule)。
- * 只有匹配的请求,才会修改请求体。
+* 只有匹配的请求,才会修改请求体。
-## 修改请求插件使用指南
+### 2.4.3 规则配置
-* 1.配置选择器
-* 2.配置规则
-* 3.修改请求体
- ![](/img/shenyu/plugin/param-mapping/param-mapping.png)
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
* 参数解析:
* `addParameterKeys`: 在请求体中增加一个 `key-value`
* `replaceParameterKeys`: 替换请求体中的某一个 `key` ,`key` 是要被替换的值,`value` 是替换后的值
* `removeParameterKeys`: 移除请求体中的某一个 `key`
-修改请求体是通过 `JSONPath` 来实现的, `$.` 代表根目录
+* 修改请求体是通过 `JSONPath` 来实现的, `$.` 代表根目录
+
+## 2.5 示例
+
+### 2.5.1 在请求中添加参数
+
+#### 2.5.1.1 配置插件
+
+* 使用该插件时应先开启插件!
+
+#### 2.5.1.2 选择器配置
+
+#### 2.5.1.3 规则配置
+
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
上面的配置,插件开启前,请求内容为
@@ -51,6 +94,8 @@
{"id":3,"data":{"value":"18","age":"36"}}
```
+#### 2.5.1.4 验证结果
+
插件开启后,请求内容为
```json
@@ -58,3 +103,7 @@
```
上述操作,增加一个`name:shenyu`,把`id`替换为`userId`,移除`data`中的`value` 。
+
+# 3. 如何禁用插件
+
+- 在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `paramMapping` 设置为关闭。
diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.3/plugin-center/http-process/parammapping-plugin.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.3/plugin-center/http-process/parammapping-plugin.md
index 3fd6ade..446843f 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.3/plugin-center/http-process/parammapping-plugin.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.3/plugin-center/http-process/parammapping-plugin.md
@@ -4,17 +4,37 @@
description: ParamMapping插件
---
-## 说明
+# 1. 概述
-* `paramMapping`插件是 `Apache ShenYu` 网关自带的,用来对你的请求参数进行修改的插件。
+## 1.1 插件名称
+* paramMapping插件
+## 1.2 适用场景
-## 插件设置
+* 添加/删除/替换请求体中固定的参数
-- 在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `paramMapping` 设置为开启。
+## 1.3 插件功能
-## 插件使用
+* 用来对你的请求参数进行修改的插件。
+
+## 1.4 插件代码
+
+* 核心模块 `shenyu-plugin-param-mapping`
+
+* 核心类 `org.apache.shenyu.plugin.param.mapping.ParamMappingPlugin`
+
+## 1.5 添加自哪个shenyu版本
+
+* Since ShenYu 2.4.0
+
+# 2. 如何使用插件
+
+## 2.1 插件使用流程图
+
+![](/img/shenyu/plugin/plugin_use_zh.jpg)
+
+## 2.2 导入pom
* 在网关的 `pom.xml` 文件中添加 `paramMapping` 的支持。
@@ -28,22 +48,45 @@
<!-- apache shenyu param_mapping plugin end-->
```
+## 2.3 启用插件
+
+- 在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `paramMapping` 设置为开启。
+
+## 2.4 配置插件
+
+### 2.4.1 插件配置
+
+* 再使用插件时应该开启插件!
+
+### 2.4.2 选择器配置
+
* 选择器和规则设置,请参考:[选择器和规则管理](../../user-guide/admin-usage/selector-and-rule)。
- * 只有匹配的请求,才会修改请求体。
+* 只有匹配的请求,才会修改请求体。
-## 修改请求插件使用指南
+### 2.4.3 规则配置
-* 1.配置选择器
-* 2.配置规则
-* 3.修改请求体
- ![](/img/shenyu/plugin/param-mapping/param-mapping.png)
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
* 参数解析:
* `addParameterKeys`: 在请求体中增加一个 `key-value`
* `replaceParameterKeys`: 替换请求体中的某一个 `key` ,`key` 是要被替换的值,`value` 是替换后的值
* `removeParameterKeys`: 移除请求体中的某一个 `key`
-修改请求体是通过 `JSONPath` 来实现的, `$.` 代表根目录
+* 修改请求体是通过 `JSONPath` 来实现的, `$.` 代表根目录
+
+## 2.5 示例
+
+### 2.5.1 在请求中添加参数
+
+#### 2.5.1.1 配置插件
+
+* 使用该插件时应先开启插件!
+
+#### 2.5.1.2 选择器配置
+
+#### 2.5.1.3 规则配置
+
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
上面的配置,插件开启前,请求内容为
@@ -51,6 +94,8 @@
{"id":3,"data":{"value":"18","age":"36"}}
```
+#### 2.5.1.4 验证结果
+
插件开启后,请求内容为
```json
@@ -58,3 +103,7 @@
```
上述操作,增加一个`name:shenyu`,把`id`替换为`userId`,移除`data`中的`value` 。
+
+# 3. 如何禁用插件
+
+- 在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `paramMapping` 设置为关闭。
diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.5.0/plugin-center/http-process/parammapping-plugin.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.5.0/plugin-center/http-process/parammapping-plugin.md
index 3fd6ade..446843f 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/version-2.5.0/plugin-center/http-process/parammapping-plugin.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.5.0/plugin-center/http-process/parammapping-plugin.md
@@ -4,17 +4,37 @@
description: ParamMapping插件
---
-## 说明
+# 1. 概述
-* `paramMapping`插件是 `Apache ShenYu` 网关自带的,用来对你的请求参数进行修改的插件。
+## 1.1 插件名称
+* paramMapping插件
+## 1.2 适用场景
-## 插件设置
+* 添加/删除/替换请求体中固定的参数
-- 在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `paramMapping` 设置为开启。
+## 1.3 插件功能
-## 插件使用
+* 用来对你的请求参数进行修改的插件。
+
+## 1.4 插件代码
+
+* 核心模块 `shenyu-plugin-param-mapping`
+
+* 核心类 `org.apache.shenyu.plugin.param.mapping.ParamMappingPlugin`
+
+## 1.5 添加自哪个shenyu版本
+
+* Since ShenYu 2.4.0
+
+# 2. 如何使用插件
+
+## 2.1 插件使用流程图
+
+![](/img/shenyu/plugin/plugin_use_zh.jpg)
+
+## 2.2 导入pom
* 在网关的 `pom.xml` 文件中添加 `paramMapping` 的支持。
@@ -28,22 +48,45 @@
<!-- apache shenyu param_mapping plugin end-->
```
+## 2.3 启用插件
+
+- 在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `paramMapping` 设置为开启。
+
+## 2.4 配置插件
+
+### 2.4.1 插件配置
+
+* 再使用插件时应该开启插件!
+
+### 2.4.2 选择器配置
+
* 选择器和规则设置,请参考:[选择器和规则管理](../../user-guide/admin-usage/selector-and-rule)。
- * 只有匹配的请求,才会修改请求体。
+* 只有匹配的请求,才会修改请求体。
-## 修改请求插件使用指南
+### 2.4.3 规则配置
-* 1.配置选择器
-* 2.配置规则
-* 3.修改请求体
- ![](/img/shenyu/plugin/param-mapping/param-mapping.png)
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
* 参数解析:
* `addParameterKeys`: 在请求体中增加一个 `key-value`
* `replaceParameterKeys`: 替换请求体中的某一个 `key` ,`key` 是要被替换的值,`value` 是替换后的值
* `removeParameterKeys`: 移除请求体中的某一个 `key`
-修改请求体是通过 `JSONPath` 来实现的, `$.` 代表根目录
+* 修改请求体是通过 `JSONPath` 来实现的, `$.` 代表根目录
+
+## 2.5 示例
+
+### 2.5.1 在请求中添加参数
+
+#### 2.5.1.1 配置插件
+
+* 使用该插件时应先开启插件!
+
+#### 2.5.1.2 选择器配置
+
+#### 2.5.1.3 规则配置
+
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
上面的配置,插件开启前,请求内容为
@@ -51,6 +94,8 @@
{"id":3,"data":{"value":"18","age":"36"}}
```
+#### 2.5.1.4 验证结果
+
插件开启后,请求内容为
```json
@@ -58,3 +103,7 @@
```
上述操作,增加一个`name:shenyu`,把`id`替换为`userId`,移除`data`中的`value` 。
+
+# 3. 如何禁用插件
+
+- 在 `shenyu-admin` --> 基础配置 --> 插件管理 --> `paramMapping` 设置为关闭。
diff --git a/versioned_docs/version-2.4.0/plugin-center/http-handle/param-mapping-plugin.md b/versioned_docs/version-2.4.0/plugin-center/http-handle/param-mapping-plugin.md
index 40dec85..20ff1a3 100644
--- a/versioned_docs/version-2.4.0/plugin-center/http-handle/param-mapping-plugin.md
+++ b/versioned_docs/version-2.4.0/plugin-center/http-handle/param-mapping-plugin.md
@@ -4,45 +4,89 @@
description: param-mapping-plugin
---
-## Description
+# 1. Overview
-* `param_mapping` is a native plugin of Apache ShenYu Gateway and is used to edit your request param.
+## 1.1 Plugin Name
-## Plugin Setting
+* ParamMapping Plugin
-* In `shenyu-admin` --> BasicConfig --> Plugin --> `param_mapping` , set to enable.
+## 1.2 Appropriate Scenario
-## Plugin Use
+* Add/remove/replace certain fixed parameters to the request
-* Introduce `param_mapping` dependency in the pom.xml file of the gateway.
+## 1.3 Plugin functionality
+
+* `paramMapping` is used to edit your request parameters.
+
+## 1.4 Plugin code
+
+* Core Module `shenyu-plugin-param-mapping`
+
+* Core Class `org.apache.shenyu.plugin.param.mapping.ParamMappingPlugin`
+
+## 1.5 Added Since Which shenyu version
+
+* Since ShenYu 2.4.0
+
+# 2. How to use plugin
+
+## 2.1 Plugin-use procedure chart
+
+![](/img/shenyu/plugin/plugin_use_en.jpg)
+
+## 2.2 Import pom
+
+* Introduce `paramMapping` dependency in the pom.xml file of the gateway.
```xml
- <!-- apache shenyu param_mapping plugin start-->
+<!-- apache shenyu param_mapping plugin start-->
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-spring-boot-starter-plugin-param-mapping</artifactId>
<version>${project.version}</version>
</dependency>
- <!-- apache shenyu param_mapping plugin end-->
+<!-- apache shenyu param_mapping plugin end-->
```
+## 2.3 Enable plugin
+
+- In `shenyu-admin` --> BasicConfig --> Plugin --> `paramMapping` set Status enabled.
+
+## 2.4 Config plugin
+
+### 2.4.1 Plugin Config
+
+* you should open this plugin when using.
+
+### 2.4.2 Selector Config
+
* Selectors and rules, please refer to:[Selector And Rule Config](../../user-guide/admin-usage/selector-and-rule)。
- * Only those matched requests can be modified your request body.
+* Only those matched requests can be modified your request body.
+### 2.4.3 Rule Config
-## ParamMappingPlugin Guide
-
-* 1.Configuration selector
-* 2.Configuration rule
-* 3.modify request body
- ![](/img/shenyu/plugin/param-mapping/param-mapping.png)
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
* param details:
* `addParameterKeys`: add a new `key-value` on body
* `replaceParameterKeys`: replace request body's `key` ,`key` is the value to be replaced,`value` is the value after replacement
* `removeParameterKeys`: remove a body `key`
-param_mapping modify the request body is achieved through `JSONPath` , `$.` represents the root directory.
+* param_mapping modify the request body is achieved through `JSONPath` , `$.` represents the root directory.
+
+## 2.5 Examples
+
+### 2.5.1 Add parameters in request
+
+#### 2.5.1.1 Config Plugin
+
+* you should open the plugin when using.
+
+#### 2.5.1.2 Selector Config
+
+#### 2.5.1.3 Rule Config
+
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
use the configuration,unopened the plugin,request body is:
@@ -50,6 +94,8 @@
{"id":3,"data":{"value":"18","age":"36"}}
```
+#### 2.5.1.4 Check Result
+
open the plugin,the final request body is
```json
@@ -57,3 +103,7 @@
```
add a new key-value `name:shenyu`,replace the key `id` to `userId`, remove the key `data.value` .
+
+# 3. How to disable plugin
+
+- In `shenyu-admin` --> BasicConfig --> Plugin --> `paramMapping` set Status disable.
diff --git a/versioned_docs/version-2.4.1/plugin-center/http-handle/param-mapping-plugin.md b/versioned_docs/version-2.4.1/plugin-center/http-handle/param-mapping-plugin.md
index 40dec85..20ff1a3 100644
--- a/versioned_docs/version-2.4.1/plugin-center/http-handle/param-mapping-plugin.md
+++ b/versioned_docs/version-2.4.1/plugin-center/http-handle/param-mapping-plugin.md
@@ -4,45 +4,89 @@
description: param-mapping-plugin
---
-## Description
+# 1. Overview
-* `param_mapping` is a native plugin of Apache ShenYu Gateway and is used to edit your request param.
+## 1.1 Plugin Name
-## Plugin Setting
+* ParamMapping Plugin
-* In `shenyu-admin` --> BasicConfig --> Plugin --> `param_mapping` , set to enable.
+## 1.2 Appropriate Scenario
-## Plugin Use
+* Add/remove/replace certain fixed parameters to the request
-* Introduce `param_mapping` dependency in the pom.xml file of the gateway.
+## 1.3 Plugin functionality
+
+* `paramMapping` is used to edit your request parameters.
+
+## 1.4 Plugin code
+
+* Core Module `shenyu-plugin-param-mapping`
+
+* Core Class `org.apache.shenyu.plugin.param.mapping.ParamMappingPlugin`
+
+## 1.5 Added Since Which shenyu version
+
+* Since ShenYu 2.4.0
+
+# 2. How to use plugin
+
+## 2.1 Plugin-use procedure chart
+
+![](/img/shenyu/plugin/plugin_use_en.jpg)
+
+## 2.2 Import pom
+
+* Introduce `paramMapping` dependency in the pom.xml file of the gateway.
```xml
- <!-- apache shenyu param_mapping plugin start-->
+<!-- apache shenyu param_mapping plugin start-->
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-spring-boot-starter-plugin-param-mapping</artifactId>
<version>${project.version}</version>
</dependency>
- <!-- apache shenyu param_mapping plugin end-->
+<!-- apache shenyu param_mapping plugin end-->
```
+## 2.3 Enable plugin
+
+- In `shenyu-admin` --> BasicConfig --> Plugin --> `paramMapping` set Status enabled.
+
+## 2.4 Config plugin
+
+### 2.4.1 Plugin Config
+
+* you should open this plugin when using.
+
+### 2.4.2 Selector Config
+
* Selectors and rules, please refer to:[Selector And Rule Config](../../user-guide/admin-usage/selector-and-rule)。
- * Only those matched requests can be modified your request body.
+* Only those matched requests can be modified your request body.
+### 2.4.3 Rule Config
-## ParamMappingPlugin Guide
-
-* 1.Configuration selector
-* 2.Configuration rule
-* 3.modify request body
- ![](/img/shenyu/plugin/param-mapping/param-mapping.png)
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
* param details:
* `addParameterKeys`: add a new `key-value` on body
* `replaceParameterKeys`: replace request body's `key` ,`key` is the value to be replaced,`value` is the value after replacement
* `removeParameterKeys`: remove a body `key`
-param_mapping modify the request body is achieved through `JSONPath` , `$.` represents the root directory.
+* param_mapping modify the request body is achieved through `JSONPath` , `$.` represents the root directory.
+
+## 2.5 Examples
+
+### 2.5.1 Add parameters in request
+
+#### 2.5.1.1 Config Plugin
+
+* you should open the plugin when using.
+
+#### 2.5.1.2 Selector Config
+
+#### 2.5.1.3 Rule Config
+
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
use the configuration,unopened the plugin,request body is:
@@ -50,6 +94,8 @@
{"id":3,"data":{"value":"18","age":"36"}}
```
+#### 2.5.1.4 Check Result
+
open the plugin,the final request body is
```json
@@ -57,3 +103,7 @@
```
add a new key-value `name:shenyu`,replace the key `id` to `userId`, remove the key `data.value` .
+
+# 3. How to disable plugin
+
+- In `shenyu-admin` --> BasicConfig --> Plugin --> `paramMapping` set Status disable.
diff --git a/versioned_docs/version-2.4.2/plugin-center/http-process/parammapping-plugin.md b/versioned_docs/version-2.4.2/plugin-center/http-process/parammapping-plugin.md
index 07fc8a7..caa04ab 100644
--- a/versioned_docs/version-2.4.2/plugin-center/http-process/parammapping-plugin.md
+++ b/versioned_docs/version-2.4.2/plugin-center/http-process/parammapping-plugin.md
@@ -4,45 +4,89 @@
description: paramMapping-plugin
---
-## Description
+# 1. Overview
-* `paramMapping` is a native plugin of Apache ShenYu Gateway and is used to edit your request param.
+## 1.1 Plugin Name
-## Plugin Setting
+* ParamMapping Plugin
-* In `shenyu-admin` --> BasicConfig --> Plugin --> `paramMapping` , set to enable.
+## 1.2 Appropriate Scenario
-## Plugin Use
+* Add/remove/replace certain fixed parameters to the request
+
+## 1.3 Plugin functionality
+
+* `paramMapping` is used to edit your request parameters.
+
+## 1.4 Plugin code
+
+* Core Module `shenyu-plugin-param-mapping`
+
+* Core Class `org.apache.shenyu.plugin.param.mapping.ParamMappingPlugin`
+
+## 1.5 Added Since Which shenyu version
+
+* Since ShenYu 2.4.0
+
+# 2. How to use plugin
+
+## 2.1 Plugin-use procedure chart
+
+![](/img/shenyu/plugin/plugin_use_en.jpg)
+
+## 2.2 Import pom
* Introduce `paramMapping` dependency in the pom.xml file of the gateway.
```xml
- <!-- apache shenyu param_mapping plugin start-->
+<!-- apache shenyu param_mapping plugin start-->
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-spring-boot-starter-plugin-param-mapping</artifactId>
<version>${project.version}</version>
</dependency>
- <!-- apache shenyu param_mapping plugin end-->
+<!-- apache shenyu param_mapping plugin end-->
```
+## 2.3 Enable plugin
+
+- In `shenyu-admin` --> BasicConfig --> Plugin --> `paramMapping` set Status enabled.
+
+## 2.4 Config plugin
+
+### 2.4.1 Plugin Config
+
+* you should open this plugin when using.
+
+### 2.4.2 Selector Config
+
* Selectors and rules, please refer to:[Selector And Rule Config](../../user-guide/admin-usage/selector-and-rule)。
- * Only those matched requests can be modified your request body.
+* Only those matched requests can be modified your request body.
+### 2.4.3 Rule Config
-## ParamMappingPlugin Guide
-
-* 1.Configuration selector
-* 2.Configuration rule
-* 3.modify request body
- ![](/img/shenyu/plugin/param-mapping/param-mapping.png)
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
* param details:
* `addParameterKeys`: add a new `key-value` on body
* `replaceParameterKeys`: replace request body's `key` ,`key` is the value to be replaced,`value` is the value after replacement
* `removeParameterKeys`: remove a body `key`
-param_mapping modify the request body is achieved through `JSONPath` , `$.` represents the root directory.
+* param_mapping modify the request body is achieved through `JSONPath` , `$.` represents the root directory.
+
+## 2.5 Examples
+
+### 2.5.1 Add parameters in request
+
+#### 2.5.1.1 Config Plugin
+
+* you should open the plugin when using.
+
+#### 2.5.1.2 Selector Config
+
+#### 2.5.1.3 Rule Config
+
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
use the configuration,unopened the plugin,request body is:
@@ -50,6 +94,8 @@
{"id":3,"data":{"value":"18","age":"36"}}
```
+#### 2.5.1.4 Check Result
+
open the plugin,the final request body is
```json
@@ -57,3 +103,7 @@
```
add a new key-value `name:shenyu`,replace the key `id` to `userId`, remove the key `data.value` .
+
+# 3. How to disable plugin
+
+- In `shenyu-admin` --> BasicConfig --> Plugin --> `paramMapping` set Status disable.
diff --git a/versioned_docs/version-2.4.3/plugin-center/http-process/parammapping-plugin.md b/versioned_docs/version-2.4.3/plugin-center/http-process/parammapping-plugin.md
index 07fc8a7..caa04ab 100644
--- a/versioned_docs/version-2.4.3/plugin-center/http-process/parammapping-plugin.md
+++ b/versioned_docs/version-2.4.3/plugin-center/http-process/parammapping-plugin.md
@@ -4,45 +4,89 @@
description: paramMapping-plugin
---
-## Description
+# 1. Overview
-* `paramMapping` is a native plugin of Apache ShenYu Gateway and is used to edit your request param.
+## 1.1 Plugin Name
-## Plugin Setting
+* ParamMapping Plugin
-* In `shenyu-admin` --> BasicConfig --> Plugin --> `paramMapping` , set to enable.
+## 1.2 Appropriate Scenario
-## Plugin Use
+* Add/remove/replace certain fixed parameters to the request
+
+## 1.3 Plugin functionality
+
+* `paramMapping` is used to edit your request parameters.
+
+## 1.4 Plugin code
+
+* Core Module `shenyu-plugin-param-mapping`
+
+* Core Class `org.apache.shenyu.plugin.param.mapping.ParamMappingPlugin`
+
+## 1.5 Added Since Which shenyu version
+
+* Since ShenYu 2.4.0
+
+# 2. How to use plugin
+
+## 2.1 Plugin-use procedure chart
+
+![](/img/shenyu/plugin/plugin_use_en.jpg)
+
+## 2.2 Import pom
* Introduce `paramMapping` dependency in the pom.xml file of the gateway.
```xml
- <!-- apache shenyu param_mapping plugin start-->
+<!-- apache shenyu param_mapping plugin start-->
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-spring-boot-starter-plugin-param-mapping</artifactId>
<version>${project.version}</version>
</dependency>
- <!-- apache shenyu param_mapping plugin end-->
+<!-- apache shenyu param_mapping plugin end-->
```
+## 2.3 Enable plugin
+
+- In `shenyu-admin` --> BasicConfig --> Plugin --> `paramMapping` set Status enabled.
+
+## 2.4 Config plugin
+
+### 2.4.1 Plugin Config
+
+* you should open this plugin when using.
+
+### 2.4.2 Selector Config
+
* Selectors and rules, please refer to:[Selector And Rule Config](../../user-guide/admin-usage/selector-and-rule)。
- * Only those matched requests can be modified your request body.
+* Only those matched requests can be modified your request body.
+### 2.4.3 Rule Config
-## ParamMappingPlugin Guide
-
-* 1.Configuration selector
-* 2.Configuration rule
-* 3.modify request body
- ![](/img/shenyu/plugin/param-mapping/param-mapping.png)
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
* param details:
* `addParameterKeys`: add a new `key-value` on body
* `replaceParameterKeys`: replace request body's `key` ,`key` is the value to be replaced,`value` is the value after replacement
* `removeParameterKeys`: remove a body `key`
-param_mapping modify the request body is achieved through `JSONPath` , `$.` represents the root directory.
+* param_mapping modify the request body is achieved through `JSONPath` , `$.` represents the root directory.
+
+## 2.5 Examples
+
+### 2.5.1 Add parameters in request
+
+#### 2.5.1.1 Config Plugin
+
+* you should open the plugin when using.
+
+#### 2.5.1.2 Selector Config
+
+#### 2.5.1.3 Rule Config
+
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
use the configuration,unopened the plugin,request body is:
@@ -50,6 +94,8 @@
{"id":3,"data":{"value":"18","age":"36"}}
```
+#### 2.5.1.4 Check Result
+
open the plugin,the final request body is
```json
@@ -57,3 +103,7 @@
```
add a new key-value `name:shenyu`,replace the key `id` to `userId`, remove the key `data.value` .
+
+# 3. How to disable plugin
+
+- In `shenyu-admin` --> BasicConfig --> Plugin --> `paramMapping` set Status disable.
diff --git a/versioned_docs/version-2.5.0/plugin-center/http-process/parammapping-plugin.md b/versioned_docs/version-2.5.0/plugin-center/http-process/parammapping-plugin.md
index 07fc8a7..caa04ab 100644
--- a/versioned_docs/version-2.5.0/plugin-center/http-process/parammapping-plugin.md
+++ b/versioned_docs/version-2.5.0/plugin-center/http-process/parammapping-plugin.md
@@ -4,45 +4,89 @@
description: paramMapping-plugin
---
-## Description
+# 1. Overview
-* `paramMapping` is a native plugin of Apache ShenYu Gateway and is used to edit your request param.
+## 1.1 Plugin Name
-## Plugin Setting
+* ParamMapping Plugin
-* In `shenyu-admin` --> BasicConfig --> Plugin --> `paramMapping` , set to enable.
+## 1.2 Appropriate Scenario
-## Plugin Use
+* Add/remove/replace certain fixed parameters to the request
+
+## 1.3 Plugin functionality
+
+* `paramMapping` is used to edit your request parameters.
+
+## 1.4 Plugin code
+
+* Core Module `shenyu-plugin-param-mapping`
+
+* Core Class `org.apache.shenyu.plugin.param.mapping.ParamMappingPlugin`
+
+## 1.5 Added Since Which shenyu version
+
+* Since ShenYu 2.4.0
+
+# 2. How to use plugin
+
+## 2.1 Plugin-use procedure chart
+
+![](/img/shenyu/plugin/plugin_use_en.jpg)
+
+## 2.2 Import pom
* Introduce `paramMapping` dependency in the pom.xml file of the gateway.
```xml
- <!-- apache shenyu param_mapping plugin start-->
+<!-- apache shenyu param_mapping plugin start-->
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-spring-boot-starter-plugin-param-mapping</artifactId>
<version>${project.version}</version>
</dependency>
- <!-- apache shenyu param_mapping plugin end-->
+<!-- apache shenyu param_mapping plugin end-->
```
+## 2.3 Enable plugin
+
+- In `shenyu-admin` --> BasicConfig --> Plugin --> `paramMapping` set Status enabled.
+
+## 2.4 Config plugin
+
+### 2.4.1 Plugin Config
+
+* you should open this plugin when using.
+
+### 2.4.2 Selector Config
+
* Selectors and rules, please refer to:[Selector And Rule Config](../../user-guide/admin-usage/selector-and-rule)。
- * Only those matched requests can be modified your request body.
+* Only those matched requests can be modified your request body.
+### 2.4.3 Rule Config
-## ParamMappingPlugin Guide
-
-* 1.Configuration selector
-* 2.Configuration rule
-* 3.modify request body
- ![](/img/shenyu/plugin/param-mapping/param-mapping.png)
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
* param details:
* `addParameterKeys`: add a new `key-value` on body
* `replaceParameterKeys`: replace request body's `key` ,`key` is the value to be replaced,`value` is the value after replacement
* `removeParameterKeys`: remove a body `key`
-param_mapping modify the request body is achieved through `JSONPath` , `$.` represents the root directory.
+* param_mapping modify the request body is achieved through `JSONPath` , `$.` represents the root directory.
+
+## 2.5 Examples
+
+### 2.5.1 Add parameters in request
+
+#### 2.5.1.1 Config Plugin
+
+* you should open the plugin when using.
+
+#### 2.5.1.2 Selector Config
+
+#### 2.5.1.3 Rule Config
+
+![](/img/shenyu/plugin/param-mapping/param-mapping.png)
use the configuration,unopened the plugin,request body is:
@@ -50,6 +94,8 @@
{"id":3,"data":{"value":"18","age":"36"}}
```
+#### 2.5.1.4 Check Result
+
open the plugin,the final request body is
```json
@@ -57,3 +103,7 @@
```
add a new key-value `name:shenyu`,replace the key `id` to `userId`, remove the key `data.value` .
+
+# 3. How to disable plugin
+
+- In `shenyu-admin` --> BasicConfig --> Plugin --> `paramMapping` set Status disable.