apache / dubbo-admin

@@ -398,7 +398,7 @@
Loading
398 398
    	List<Route> oldList = new LinkedList<Route>();
399 399
    	for (String condition : route.getConditions()) {
400 400
	        Route old = new Route();
401 -
	        old.setService(route.getService());
401 +
            old.setService(ConvertUtil.getIdFromDTO(route));
402 402
	        old.setEnabled(route.isEnabled());
403 403
	        old.setForce(route.isForce());
404 404
	        old.setRuntime(route.isRuntime());

@@ -19,7 +19,7 @@
Loading
19 19
20 20
21 21
import org.apache.dubbo.admin.common.util.Constants;
22 -
import org.apache.dubbo.admin.common.util.Tool;
22 +
import org.apache.dubbo.admin.common.util.ConvertUtil;
23 23
import org.apache.dubbo.common.URL;
24 24
25 25
import java.util.List;
@@ -209,9 +209,16 @@
Loading
209 209
    }
210 210
211 211
    public URL toUrl() {
212 -
        String group = Tool.getGroup(service);
213 -
        String version = Tool.getVersion(service);
214 -
        String interfaze = Tool.getInterface(service);
212 +
        String[] detachResult = ConvertUtil.detachId(service);
213 +
        String group = null;
214 +
        String version = null;
215 +
        String interfaze = detachResult[0];
216 +
        if (detachResult.length > 1) {
217 +
            version = detachResult[1];
218 +
        }
219 +
        if (detachResult.length > 2) {
220 +
            group = detachResult[2];
221 +
        }
215 222
        return URL.valueOf(Constants.ROUTE_PROTOCOL + "://" + Constants.ANYHOST_VALUE + "/" + interfaze
216 223
                + "?" + Constants.CATEGORY_KEY + "=" + Constants.ROUTERS_CATEGORY
217 224
                + "&router=condition&runtime=" + isRuntime() + "&enabled=" + isEnabled() + "&priority=" + getPriority() + "&force=" + (getMatchRule().contains("host") ? "true" : isForce()) + "&dynamic=" + isDynamic()

@@ -342,7 +342,7 @@
Loading
342 342
        if (scope.equals(Constants.APPLICATION)) {
343 343
            accessDTO.setApplication(key);
344 344
        } else {
345 -
            accessDTO.setService(key);
345 +
            ConvertUtil.detachIdToService(key, accessDTO);
346 346
        }
347 347
        if (blackWhiteList != null) {
348 348
            for (String condition : blackWhiteList) {
@@ -363,7 +363,7 @@
Loading
363 363
364 364
    public static Route convertAccessDTOtoRoute(AccessDTO accessDTO) {
365 365
        Route route = new Route();
366 -
        route.setService(accessDTO.getService());
366 +
        route.setService(ConvertUtil.getIdFromDTO(accessDTO));
367 367
        route.setForce(true);
368 368
        route.setFilterRule("false");
369 369
        route.setEnabled(true);
Files Complexity Coverage
dubbo-admin-server/src/main/java/org/apache/dubbo/admin 18.90% 20.36%
Project Totals (97 files) 18.90% 20.36%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading