Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
eureka-server
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cmiov005
eureka-server
Commits
883ded6b
Commit
883ded6b
authored
Jun 18, 2019
by
houg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apollo
parent
05cf1163
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
136 additions
and
88 deletions
+136
-88
pom.xml
pom.xml
+90
-77
EurekaServerApplication.java
...com/enovate/newretail/eureka/EurekaServerApplication.java
+14
-11
TestController.java
...ain/java/com/enovate/newretail/eureka/TestController.java
+23
-0
apollo-env.properties
src/main/resources/apollo-env.properties
+4
-0
application.properties
src/main/resources/application.properties
+5
-0
No files found.
pom.xml
View file @
883ded6b
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
...
...
@@ -16,7 +15,7 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.1.5.RELEASE
</version>
<relativePath
/>
<!-- lookup parent from repository -->
<relativePath
/>
<!-- lookup parent from repository -->
</parent>
<properties>
...
...
@@ -40,6 +39,20 @@
<artifactId>
spring-boot-starter-security
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
<dependency>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo-client
</artifactId>
<version>
1.1.1
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-rest
</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
...
...
src/main/java/com/enovate/newretail/eureka/EurekaServerApplication.java
View file @
883ded6b
...
...
@@ -7,11 +7,14 @@ import org.springframework.context.annotation.Configuration;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
import
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
;
import
com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig
;
/**
* @author Ryan
*/
@EnableEurekaServer
@SpringBootApplication
@EnableApolloConfig
public
class
EurekaServerApplication
{
public
static
void
main
(
String
[]
args
)
{
...
...
src/main/java/com/enovate/newretail/eureka/TestController.java
0 → 100644
View file @
883ded6b
package
com
.
enovate
.
newretail
.
eureka
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.ctrip.framework.apollo.Config
;
import
com.ctrip.framework.apollo.spring.annotation.ApolloConfig
;
@RestController
@RequestMapping
(
path
=
"/config"
)
public
class
TestController
{
@ApolloConfig
private
Config
config
;
@RequestMapping
(
path
=
"/get/{key}"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
String
get
(
@PathVariable
(
"key"
)
String
key
)
{
return
config
.
getProperty
(
key
,
config
.
getSourceType
().
name
());
}
}
src/main/resources/apollo-env.properties
0 → 100644
View file @
883ded6b
dev.meta
=
http://132.232.68.227:8080
fat.meta
=
http://172.21.28.19:8080
uat.meta
=
http://192.168.1.38:8082
pro.meta
=
http://192.168.1.38:8083
\ No newline at end of file
src/main/resources/application.properties
View file @
883ded6b
spring.application.name
=
eureka-server
server.port
=
8761
app.id
=
evonate-newretail-eureka
apollo.meta
=
http://192.168.1.38:8080
#spring.profiles.active = apollo-env.properties
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment