<commit_before>/* 
 * 作者：钟勋 (e-mail:<EMAIL>)
 */

/*
 * 修订记录:
 * @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);
    }
}<commit_msg>刷新客户端服务：按照环境树刷新<commit_after>/* 
 * 作者：钟勋 (e-mail:<EMAIL>)
 */

/*
 * 修订记录:
 * @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 rootAppId     根应用id（不传表示刷新所有应用）
     * @param rootProfileId 根环境id（不传表示刷新所有环境）
     */
    @RequestMapping("/refreshClients")
    public EmptyResult refreshClients(String rootAppId, String rootProfileId) {
        if (rootAppId == null) {
            ManagerAssert.admin();
        } else {
            ManagerAssert.adminOrHaveRelation(rootAppId);
        }
        RefreshClientsOrder order = new RefreshClientsOrder();
        order.setRootAppId(rootAppId);
        order.setRootProfileId(rootProfileId);

        return refreshService.refreshClients(order);
    }
}
{'fraction_non_alphanumeric': 0.10985401459854015, 'fraction_numerical': 0.008759124087591242, 'mean_word_length': 3.6854700854700853, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3639490', 'n_tokens_mistral': 907, 'n_tokens_neox': 931, 'n_words': 126}