This is an automated email from the ASF dual-hosted git repository.

dengliming pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu-website.git


The following commit(s) were added to refs/heads/main by this push:
     new 1c79753  [ISSUE #159] Add custom-condition-match en document (#173)
1c79753 is described below

commit 1c79753eb194db7ff744ea4beb5ed3e0c9f4276b
Author: zhaiweij <[email protected]>
AuthorDate: Tue Aug 3 17:59:48 2021 +0800

    [ISSUE #159] Add custom-condition-match en document (#173)
    
    * update divide-plugin en
    
    * update en png
    
    * Add SPI Document #159
    
    add custom-condition-match en document
---
 content/en/projects/shenyu/_index.md               |   4 ++
 .../shenyu/custom-condition-match/index.md         |  74 +++++++++++++++++++++
 .../shenyu/custom-condition-match/index.md         |   2 +-
 .../shenyu/custom/custom-condition-match-en.png    | Bin 0 -> 292248 bytes
 ...-match-zh.png => custom-condition-match-zh.png} | Bin
 5 files changed, 79 insertions(+), 1 deletion(-)

diff --git a/content/en/projects/shenyu/_index.md 
b/content/en/projects/shenyu/_index.md
index 5818484..6df5331 100644
--- a/content/en/projects/shenyu/_index.md
+++ b/content/en/projects/shenyu/_index.md
@@ -183,6 +183,10 @@ sidebar:
        link: 'thread'
      - title: 'Shenyu Optimize'
        link: 'shenyu-optimize'
+     - title: 'SPI'
+       sub:
+         - title: 'Custom Condition Match'
+           link: 'custom-condition-match'
   - title: 'Release Notes'
     link: 'release-notes'
   - title: 'Download'
diff --git a/content/en/projects/shenyu/custom-condition-match/index.md 
b/content/en/projects/shenyu/custom-condition-match/index.md
new file mode 100644
index 0000000..7277952
--- /dev/null
+++ b/content/en/projects/shenyu/custom-condition-match/index.md
@@ -0,0 +1,74 @@
+---
+title: Custom Condition Match
+keywords: Apache ShenYu
+description: custom condition match
+---
+
+
+## Explanation
+
+* Before custom development, please customize and build the gateway 
environment first, please refer to: [custom deployment](../deployment-custom)
+
+* This article describes how to customize the extension of  
`org.apache.shenyu.plugin.base.condition.strategy.MatchStrategy`.
+
+## Extension
+
+* Create a new class `${you class}`,implements 
`org.apache.shenyu.plugin.base.condition.strategy.MatchStrategy`
+
+```
+public class ${you class} implements MatchStrategy {
+    
+      @Override
+      public Boolean match(final List<ConditionData> conditionDataList, final 
ServerWebExchange exchange) {
+        //coding and return
+        return true;
+      }
+}
+```
+
+* In the project  `resources` directory,Create a new `META-INF/shenyu` 
directory, and the new file name is : 
`org.apache.shenyu.plugin.base.condition.strategy.MatchStrategy`.
+add `${you spi name}` = `${you class path}`:
+
+```
+${you spi name} = ${you class path}
+``` 
+
+* In the `Admin` service ---> BasicConfig ---> Dictionary ,  Find the 
dictionary code as `MATCH_MODE`, add a new piece of data, pay attention to the 
dictionary name: `${you spi name}`.
+
+<img src="/img/shenyu/custom/custom-condition-match-en.png" width="40%" 
height="30%" />
+
+* Or execute the following custom `SQL` statement:
+
+```sql
+INSERT IGNORE INTO `shenyu_dict` (
+        `id`,
+        `type`,
+        `dict_code`,
+        `dict_name`,
+        `dict_value`,
+        `desc`,
+        `sort`,
+        `enabled`,
+        `date_created`,
+        `date_updated`
+    )
+VALUES (
+        'you id',
+        'matchMode',
+        'MATCH_MODE',
+        'you spi name',
+        'you value',
+        'you spi name',
+        0,
+        1,
+        '2021-05-30 19:29:10',
+        '2021-05-30 20:15:23'
+    );
+```
+
+
+
+
+
+
+
diff --git a/content/zh/projects/shenyu/custom-condition-match/index.md 
b/content/zh/projects/shenyu/custom-condition-match/index.md
index cc2ca0e..20a3707 100644
--- a/content/zh/projects/shenyu/custom-condition-match/index.md
+++ b/content/zh/projects/shenyu/custom-condition-match/index.md
@@ -35,7 +35,7 @@ ${you spi name} = ${you class path}
 
 * 在 `Admin` 后台 ---> 基础管理 ---> 字典管理 ,  找到字典编码为 `MATCH_MODE`,新增一条数据,注意字典名称要为: 
`${you spi name}`。
 
-<img src="/img/shenyu/custom/custmo-condition-match-zh.png" width="40%" 
height="30%" />
+<img src="/img/shenyu/custom/custom-condition-match-zh.png" width="40%" 
height="30%" />
 
 * 或者执行以下自定义`SQL`语句:
 
diff --git a/static/img/shenyu/custom/custom-condition-match-en.png 
b/static/img/shenyu/custom/custom-condition-match-en.png
new file mode 100644
index 0000000..3de3d9e
Binary files /dev/null and 
b/static/img/shenyu/custom/custom-condition-match-en.png differ
diff --git a/static/img/shenyu/custom/custmo-condition-match-zh.png 
b/static/img/shenyu/custom/custom-condition-match-zh.png
similarity index 100%
rename from static/img/shenyu/custom/custmo-condition-match-zh.png
rename to static/img/shenyu/custom/custom-condition-match-zh.png

Reply via email to