1
0
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:
flystar32
2018-10-11 21:48:35 +08:00
parent 319f249021
commit 7fdd8fa3e2
9 changed files with 54 additions and 53 deletions

View File

@@ -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>>() {
});
}
}

View File

@@ -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();
}