Last active
September 3, 2019 08:42
-
-
Save circlee/7e24b6dada97a0e0129367ce9f7a5698 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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