Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
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
openSource
apollo
Commits
4054304f
Commit
4054304f
authored
Apr 19, 2016
by
Yiming Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inject authed RestTemplate into Portal
parent
429792a4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
11 deletions
+23
-11
pom.xml
apollo-biz/pom.xml
+0
-5
pom.xml
apollo-configservice/pom.xml
+5
-0
PortalApplication.java
...tal/src/main/java/com/ctrip/apollo/PortalApplication.java
+1
-1
API.java
...portal/src/main/java/com/ctrip/apollo/portal/api/API.java
+14
-4
application.yml
apollo-portal/src/main/resources/application.yml
+1
-1
AbstractPortalTest.java
...test/java/com/ctrip/apollo/portal/AbstractPortalTest.java
+2
-0
No files found.
apollo-biz/pom.xml
View file @
4054304f
...
...
@@ -26,10 +26,5 @@
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
</dependency>
<dependency>
<groupId>
com.h2database
</groupId>
<artifactId>
h2
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
</project>
apollo-configservice/pom.xml
View file @
4054304f
...
...
@@ -67,6 +67,11 @@
</exclusions>
</dependency>
<!-- end of eureka -->
<dependency>
<groupId>
com.h2database
</groupId>
<artifactId>
h2
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<plugins>
...
...
apollo-portal/src/main/java/com/ctrip/apollo/
portal/
PortalApplication.java
→
apollo-portal/src/main/java/com/ctrip/apollo/PortalApplication.java
View file @
4054304f
package
com
.
ctrip
.
apollo
.
portal
;
package
com
.
ctrip
.
apollo
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.actuate.system.ApplicationPidFileWriter
;
...
...
apollo-portal/src/main/java/com/ctrip/apollo/portal/api/API.java
View file @
4054304f
package
com
.
ctrip
.
apollo
.
portal
.
api
;
import
com.ctrip.apollo.core.enums.Env
;
import
com.ctrip.apollo.core.exception.ServiceException
;
import
com.ctrip.apollo.portal.service.ServiceLocator
;
import
javax.annotation.PostConstruct
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.client.RestTemplate
;
import
com.ctrip.apollo.common.auth.RestTemplateFactory
;
import
com.ctrip.apollo.core.enums.Env
;
import
com.ctrip.apollo.core.exception.ServiceException
;
import
com.ctrip.apollo.portal.service.ServiceLocator
;
public
class
API
{
@Autowired
protected
ServiceLocator
serviceLocator
;
@Autowired
private
RestTemplateFactory
restTemplateFactory
;
protected
RestTemplate
restTemplate
;
@PostConstruct
private
void
postConstruct
()
{
restTemplate
=
restTemplateFactory
.
getObject
();
}
public
String
getAdminServiceHost
(
Env
env
)
{
// 本地测试用
// return "http://localhost:8090";
...
...
@@ -25,5 +35,5 @@ public class API {
}
return
""
;
}
}
apollo-portal/src/main/resources/application.yml
View file @
4054304f
...
...
@@ -15,4 +15,4 @@ ctrip:
apollo
:
portal
:
env
:
dev
env
:
local
apollo-portal/src/test/java/com/ctrip/apollo/portal/AbstractPortalTest.java
View file @
4054304f
...
...
@@ -4,6 +4,8 @@ import org.junit.runner.RunWith;
import
org.springframework.boot.test.SpringApplicationConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
com.ctrip.apollo.PortalApplication
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringApplicationConfiguration
(
classes
=
PortalApplication
.
class
)
public
abstract
class
AbstractPortalTest
{
...
...
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