public class ApiSwitchPlugin
extends org.apache.shenyu.plugin.base.AbstractShenyuPlugin
Checks if an API endpoint is closed by querying a code table via HSF generic invocation (QryAuthorityEscapeBusiService.getValueByCode). This is equivalent to the apiSwitch() method in api-gateway's RestController and WsController.
If the interface is closed, returns an error response immediately. Otherwise, continues the plugin chain.
DEPRECATED (kept for reference only):
The interface-closing functionality provided by this plugin has been replaced by the Mock plugin. Administrators configure Mock plugin rules with sort=1 to return a fixed error response for closed endpoints; the Mock plugin short-circuits the chain before any downstream processing occurs. This plugin is disabled in Admin and does not participate in actual request processing.
The HSF code-table query capability (getValueByCode) has been extracted into
CodeTableClient, which is reused by
SignPlugin for dynamic orderType injection in exter/syncCreateOrder/v1.
| 构造器和说明 |
|---|
ApiSwitchPlugin() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected reactor.core.publisher.Mono<java.lang.Void> |
doExecute(org.springframework.web.server.ServerWebExchange exchange,
org.apache.shenyu.plugin.api.ShenyuPluginChain chain,
org.apache.shenyu.common.dto.SelectorData selector,
org.apache.shenyu.common.dto.RuleData rule) |
int |
getOrder() |
java.lang.String |
named() |
boolean |
skip(org.springframework.web.server.ServerWebExchange exchange) |
execute, handleRuleIfNull, handleSelectorIfNullprotected reactor.core.publisher.Mono<java.lang.Void> doExecute(org.springframework.web.server.ServerWebExchange exchange,
org.apache.shenyu.plugin.api.ShenyuPluginChain chain,
org.apache.shenyu.common.dto.SelectorData selector,
org.apache.shenyu.common.dto.RuleData rule)
doExecute 在类中 org.apache.shenyu.plugin.base.AbstractShenyuPluginpublic int getOrder()
public java.lang.String named()
public boolean skip(org.springframework.web.server.ServerWebExchange exchange)
Copyright © 2026 The Apache Software Foundation. All rights reserved.