NacosScopeConfig.java 574 B

12345678910111213141516171819202122
  1. package com.fdkankan.manage.config;
  2. import org.springframework.beans.factory.annotation.Value;
  3. import org.springframework.cloud.context.config.annotation.RefreshScope;
  4. import org.springframework.context.annotation.Bean;
  5. import org.springframework.context.annotation.Configuration;
  6. @Configuration
  7. public class NacosScopeConfig {
  8. public static String threshold = null;
  9. @Bean
  10. @RefreshScope
  11. public void setThreshold(@Value("${dingtalk.threshold:0.2}")
  12. String threshold) {
  13. NacosScopeConfig.threshold = threshold;
  14. }
  15. }