Skip to content

Commit

Permalink
Merge pull request #124 from chuntaojun/develop
Browse files Browse the repository at this point in the history
refactor: update version to 0.3.0 and modify test example
  • Loading branch information
chuntaojun authored Jul 12, 2019
2 parents e8461e6 + c4454cc commit 3683a56
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 11 deletions.
4 changes: 2 additions & 2 deletions nacos-spring-context/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<parent>
<artifactId>nacos-spring-parent</artifactId>
<groupId>com.alibaba.nacos</groupId>
<version>0.3.0-RC1</version>
<version>0.3.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-spring-context</artifactId>
<version>0.3.0-RC1</version>
<version>0.3.0</version>
<name>Alibaba Nacos :: Spring :: Context</name>
<packaging>jar</packaging>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySources;
import com.alibaba.nacos.spring.context.config.xml.NacosPropertySourceXmlBeanDefinition;

import com.alibaba.nacos.spring.context.event.config.DelegatingEventPublishingListener;
import com.alibaba.nacos.spring.context.event.config.EventPublishingConfigService;
import com.alibaba.nacos.spring.factory.NacosServiceFactory;
import com.alibaba.spring.util.BeanUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package com.alibaba.nacos.spring.test;

import com.alibaba.nacos.api.config.ConfigType;
import com.alibaba.nacos.api.config.annotation.NacosConfigurationProperties;

import java.util.List;
Expand All @@ -26,7 +27,7 @@
* @author <a href="mailto:[email protected]">liaochuntao</a>
* @since 0.3.0
*/
@NacosConfigurationProperties(dataId = "yaml_app", autoRefreshed = true, ignoreNestedProperties = true, yaml = true)
@NacosConfigurationProperties(dataId = "yaml_app", autoRefreshed = true, ignoreNestedProperties = true, type = ConfigType.YAML)
public class YamlApp {

public static final String DATA_ID_YAML = "yaml_app";
Expand Down
2 changes: 1 addition & 1 deletion nacos-spring-samples/nacos-embedded-webserver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>nacos-spring-parent</artifactId>
<groupId>com.alibaba.nacos</groupId>
<version>0.3.0-RC1</version>
<version>0.3.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion nacos-spring-samples/nacos-spring-webmvc-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>nacos-spring-samples</artifactId>
<groupId>com.alibaba.nacos</groupId>
<version>0.3.0-RC1</version>
<version>0.3.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* @since 0.1.0
*/
@Configuration
@NacosPropertySource(name = "first", dataId = FIRST_DATA_ID, first = true) // First PropertySource
@NacosPropertySource(name = "first", dataId = FIRST_DATA_ID, first = true, autoRefreshed = true) // First PropertySource
@NacosPropertySources({
@NacosPropertySource(name = "before-os-env", dataId = BEFORE_OS_ENV_DATA_ID, before = SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME),
@NacosPropertySource(name = "after-system-properties", dataId = AFTER_SYS_PROP_DATA_ID, after = SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.alibaba.nacos.api.annotation.NacosInjected;
import com.alibaba.nacos.api.config.ConfigService;
import com.alibaba.nacos.api.config.annotation.NacosValue;
import com.alibaba.nacos.api.exception.NacosException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
Expand All @@ -37,9 +38,11 @@
* @since 0.1.0
*/
@Controller
@RequestMapping("/nacos/config/service")
public class ConfigServiceController {

@NacosValue(value = "${people.enable:false}", autoRefreshed = true)
private String enable;

@NacosInjected
private ConfigService configService;

Expand All @@ -49,6 +52,12 @@ public String get(@RequestParam String dataId, @RequestParam(defaultValue = DEFA
return configService.getConfig(dataId, groupId, TimeUnit.SECONDS.toMillis(1));
}

@RequestMapping()
@ResponseBody
public String value() {
return enable;
}

@RequestMapping(value = "/publish", method = POST)
@ResponseBody
public boolean publish(@RequestParam String dataId, @RequestParam(defaultValue = DEFAULT_GROUP) String groupId,
Expand Down
2 changes: 1 addition & 1 deletion nacos-spring-samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>nacos-spring-parent</artifactId>
<groupId>com.alibaba.nacos</groupId>
<version>0.3.0-RC1</version>
<version>0.3.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-spring-parent</artifactId>
<version>0.3.0-RC1</version>
<version>0.3.0</version>
<name>Alibaba Nacos :: Spring :: POM</name>
<packaging>pom</packaging>

Expand Down Expand Up @@ -85,7 +85,7 @@
<sonar.jacoco.itReportPath>${project.basedir}/../test/target/jacoco-it.exec</sonar.jacoco.itReportPath>
<sonar.exclusions>file:**/generated-sources/**,**/test/**</sonar.exclusions>
<!-- Nacos -->
<nacos.version>1.1.0</nacos.version>
<nacos.version>1.1.1</nacos.version>
<!-- Spring -->
<spring.framework.version>3.2.18.RELEASE</spring.framework.version>
<!--snake-yaml-->
Expand Down

0 comments on commit 3683a56

Please sign in to comment.