JSON配置
2023-09-10
推荐使用XML配置
配置相关配置文件
{
"configs": [
"handler.json",
"limit.json",
"handlerChain.json",
"paths.json"
]
}
配置Handler
{
"handler": [
{
"id": "test",
"class": "com.example.simpleauthtest.handler.MyHandler",
"scope": "singleton",
"pathsId":"test"
},
{
"id": "myHandlerId2",
"class": "com.example.simpleauthtest.handler.MyHandler",
"scope": "singleton",
"paths": {
"id": "myHandlerPath2",
"path": [
"/say",
"/eat"
]
}
}
]
}
配置Limit
{
"limit": [
{
"id": "limitId",
"times": 1,
"seconds": 2,
"ban": 3,
"pathsId": "myLimitPath"
}
]
}
配置HandlerChain
{
"handlerChain": [
{
"id": "myHandlerChain",
"list": [
{
"id": "test"
},
{
"class": "com.example.simpleauthtest.handler.MyHandler"
}
],
"paths": {
"id": "myPath"
}
},
{
"id": "myHandlerChain2",
"list": [
{
"id": "test"
},
{
"class": "com.example.simpleauthtest.handler.MyHandler"
}
],
"paths": {
"id": "myPath"
}
}
]
}
配置Paths
[
"paths": [
{
"id": "myLimitPath",
"path": [
"/say",
"/eat",
"/sleep"
]
},
{
"id": "myPath",
"path": [
"/say",
"/eat",
"/sleep"
]
}
]
]