mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
update sentinel version to 0.2.0
This commit is contained in:
@@ -2,7 +2,7 @@ package org.springframework.cloud.alibaba.cloud.examples;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.csp.sentinel.datasource.ConfigParser;
|
||||
import com.alibaba.csp.sentinel.datasource.Converter;
|
||||
import com.alibaba.csp.sentinel.slots.block.flow.FlowRule;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
@@ -10,9 +10,10 @@ import com.alibaba.fastjson.TypeReference;
|
||||
/**
|
||||
* @author fangjian
|
||||
*/
|
||||
public class JsonFlowRuleListParser implements ConfigParser<String, List<FlowRule>> {
|
||||
public class JsonFlowRuleListParser implements Converter<String, List<FlowRule>> {
|
||||
@Override
|
||||
public List<FlowRule> parse(String source) {
|
||||
return JSON.parseObject(source, new TypeReference<List<FlowRule>>() {});
|
||||
public List<FlowRule> convert(String source) {
|
||||
return JSON.parseObject(source, new TypeReference<List<FlowRule>>() {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package org.springframework.cloud.alibaba.cloud.examples;
|
||||
|
||||
import com.alibaba.csp.sentinel.datasource.ConfigParser;
|
||||
import com.alibaba.csp.sentinel.datasource.Converter;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.alibaba.sentinel.annotation.SentinelProtect;
|
||||
@@ -25,7 +25,7 @@ public class ServiceApplication {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ConfigParser myParser() {
|
||||
public Converter myParser() {
|
||||
return new JsonFlowRuleListParser();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user