package com.kwan.springcloud.controller; import org.springframework.beans.factory.annotation.Value; import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController;
/** * 需要向客户端发送post请求动态刷新才能生效 * curl -X POST "http://localhost:7002/actuator/refresh" * * @author : qinyingjie * @version : 2.2.0 * @date : 2023/1/10 17:26 */
@RefreshScope @RestController
class ConfigClientController {
@Value("${from}") private String from; @RequestMapping("/from") public String from() { return this.from; } }