Skip to content

Commit

Permalink
优化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
HaojunRen committed Nov 29, 2019
1 parent 18397bd commit 63bbf0a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.alibaba.csp.sentinel.slots.block.flow.FlowRule;
Expand Down Expand Up @@ -51,11 +50,6 @@ public RouterEndpoint routerEndpoint() {
public GitEndpoint gitEndpoint() {
return new GitEndpoint();
}

@Bean
public RestTemplate routerRestTemplate() {
return new RestTemplate();
}
}

@ConditionalOnClass({ RestControllerEndpoint.class, FlowRule.class })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ public class RouterEndpoint {
@Autowired
private PluginAdapter pluginAdapter;

@Autowired
private RestTemplate routerRestTemplate;

@Autowired
private DiscoveryClient discoveryClient;

private RestTemplate routerRestTemplate = new RestTemplate();

@RequestMapping(path = "/services", method = RequestMethod.GET)
@ApiOperation(value = "获取服务注册中心的服务列表", notes = "", response = List.class, httpMethod = "GET")
@ResponseBody
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class PluginSubscriber {
private PluginAdapter pluginAdapter;

@Autowired
private PluginConfigParser pluninConfigParser;
private PluginConfigParser pluginConfigParser;

@Autowired
private PluginEventWapper pluginEventWapper;
Expand All @@ -60,7 +60,7 @@ public void onRuleUpdated(RuleUpdatedEvent ruleUpdatedEvent) {

String rule = ruleUpdatedEvent.getRule();
try {
RuleEntity ruleEntity = pluninConfigParser.parse(rule);
RuleEntity ruleEntity = pluginConfigParser.parse(rule);
pluginAdapter.setDynamicRule(ruleEntity);

pluginEventWapper.fireParameterChanged();
Expand Down

0 comments on commit 63bbf0a

Please sign in to comment.