/* 
 * 作者：钟勋 (e-mail:zhongxunking@163.com)
 */

/*
 * 修订记录:
 * @author 钟勋 2017-09-16 16:34 创建
 */
package org.antframework.configcenter.web.controller.manage;

import org.antframework.common.util.facade.EmptyResult;
import org.antframework.configcenter.facade.api.RefreshService;
import org.antframework.configcenter.facade.order.RefreshClientsOrder;
import org.antframework.manager.web.common.ManagerAssert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 刷新controller
 */
@RestController
@RequestMapping("/manage/refresh")
public class RefreshController {
    @Autowired
    private RefreshService refreshService;

    /**
     * 刷新客户端
     *
     * @param appId     应用id（不传表示刷新所有应用）
     * @param profileId 环境id（不传表示刷新所有环境）
     */
    @RequestMapping("/refreshClients")
    public EmptyResult refreshClients(String appId, String profileId) {
        if (appId == null) {
            ManagerAssert.admin();
        } else {
            ManagerAssert.adminOrHaveRelation(appId);
        }
        RefreshClientsOrder order = new RefreshClientsOrder();
        order.setAppId(appId);
        order.setProfileId(profileId);

        return refreshService.refreshClients(order);
    }
}

@@ -801,17 +801,21 @@
  @param 
-a
+rootA
 ppId    
@@ -815,16 +815,17 @@
 pId     
+%E6%A0%B9
 %E5%BA%94%E7%94%A8id%EF%BC%88%E4%B8%8D%E4%BC%A0%E8%A1%A8
@@ -847,17 +847,21 @@
  @param 
-p
+rootP
 rofileId
@@ -861,16 +861,17 @@
 ofileId 
+%E6%A0%B9
 %E7%8E%AF%E5%A2%83id%EF%BC%88%E4%B8%8D%E4%BC%A0%E8%A1%A8
@@ -971,17 +971,21 @@
 (String 
-a
+rootA
 ppId, St
@@ -989,17 +989,21 @@
  String 
-p
+rootP
 rofileId
@@ -1018,17 +1018,21 @@
     if (
-a
+rootA
 ppId == 
@@ -1137,17 +1137,21 @@
 elation(
-a
+rootA
 ppId);%0A 
@@ -1243,15 +1243,23 @@
 .set
+Root
 AppId(
-a
+rootA
 ppId
@@ -1278,16 +1278,20 @@
 rder.set
+Root
 ProfileI
@@ -1292,17 +1292,21 @@
 ofileId(
-p
+rootP
 rofileId

刷新客户端服务：按照环境树刷新