Commit b825d963 by Yiming Liu

Add basic info controller for env and version

parent f5898737
package com.ctrip.apollo.common.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ctrip.apollo.Apollo;
import com.ctrip.framework.foundation.Foundation;
@RestController
@RequestMapping(path = "/apollo")
public class ApolloInfoController {
@RequestMapping("app")
public String getApp() {
return Foundation.app().toString();
}
@RequestMapping("web")
public String getEnv() {
return Foundation.web().toString();
}
@RequestMapping("net")
public String getNet() {
return Foundation.net().toString();
}
@RequestMapping("server")
public String getServer() {
return Foundation.server().toString();
}
@RequestMapping("version")
public String getVersion() {
return Apollo.VERSION;
}
}
......@@ -4,5 +4,6 @@ package com.ctrip.apollo;
* @author Jason Song(song_s@ctrip.com)
*/
public class Apollo {
public final static String VERSION = "java-0.0.1-SNAPSHOT";
public final static String VERSION =
"java-" + Apollo.class.getPackage().getImplementationVersion();
}
......@@ -84,7 +84,6 @@
<jetty.version>9.2.15.v20160210</jetty.version>
<github.global.server>github</github.global.server>
<github.global.oauth2Token>${env.GITHUB_OAUTH_TOKEN}</github.global.oauth2Token>
<github.path></github.path>
</properties>
<modules>
......@@ -250,7 +249,7 @@
<dependency>
<groupId>com.ctrip.apollo</groupId>
<artifactId>apollo-buildtools</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>${project.version}</version>
</dependency>
</dependencies>
<configuration>
......@@ -283,6 +282,11 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
......@@ -294,6 +298,22 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment