Simplified the codes

pull/2596/head
chengpu.rzh 3 years ago
parent 1210837331
commit fc66755983

@ -1,36 +0,0 @@
/*
* Copyright 2013-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.cloud.examples.configuration;
import com.alibaba.cloud.examples.model.NacosConfigInfo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* Bean definition.
*
* @author lixiaoshuang
*/
@Configuration
public class BeanConfiguration {
@Bean
public NacosConfigInfo nacosConfigInfo() {
return new NacosConfigInfo();
}
}

@ -18,9 +18,14 @@ package com.alibaba.cloud.examples.model;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;
/**
* @author lixiaoshuang
*/
@ConfigurationProperties(prefix = "spring.cloud.nacos.config") @ConfigurationProperties(prefix = "spring.cloud.nacos.config")
@RefreshScope @RefreshScope
@Component
public class NacosConfigInfo { public class NacosConfigInfo {
/** /**

Loading…
Cancel
Save