ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Nacos 动态刷新@RefreshScope

2020-07-06 14:05:09  阅读:74  来源: 互联网

标签:age RefreshScope Nacos private 刷新测试 刷新 动态 Response


1、在需要动态刷新的类上加上@RefreshScope注解

  

package com.ne.isuzu.sim.manage.web.controller;

/**
 * <p>
 * 动态刷新测试
 * </p>
 *
 * @author Yungui.Zheng
 * @since 2020-07-02
 */
@Api(description = "流程操作")
@RestController
@RequestMapping("/sim/order/process")
@Slf4j
@RequiredArgsConstructor
@Validated
@RefreshScope
public class SimOrderProcessController {

    private final ISimOrderProcessService processService;
    /**
     * 动态数值
     */
    @Value("${andy.age}")
    private Integer age;

    @ApiOperation(value = "动态刷新测试")
    @GetMapping(value = "/test")
    public Response<?> test() {
        return Response.success(age);
    }

}

  

标签:age,RefreshScope,Nacos,private,刷新测试,刷新,动态,Response
来源: https://www.cnblogs.com/irobotzz/p/13254429.html

专注分享技术,共同学习,共同进步。侵权联系[admin#icode9.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有