Skip to content

Instantly share code, notes, and snippets.

@circlee
Last active September 3, 2019 08:42
Show Gist options
  • Save circlee/7e24b6dada97a0e0129367ce9f7a5698 to your computer and use it in GitHub Desktop.
Save circlee/7e24b6dada97a0e0129367ce9f7a5698 to your computer and use it in GitHub Desktop.
@RestController
public class ApiController {
Logger logger = LoggerFactory.getLogger(ApiController.class);
@Autowired(required = false)
CentralConfig centralConfig;
@Autowired(required = false)
ContextRefresher contextRefresher;
@GetMapping("/centralConfig")
public CentralConfig getCentralConfig(@RequestParam(value = "refresh" , required = false) boolean refresh){
if(refresh) {
if(contextRefresher != null) {
contextRefresher.refresh();
}
}
logger.info("CentralConfig >> {}" , centralConfig);
CentralConfig copyConfig = new CentralConfig();
BeanUtils.copyProperties(centralConfig, copyConfig);
return copyConfig;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment