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
04383980
Commit
04383980
authored
Jun 15, 2016
by
lepdou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
4db23ba8
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
26 additions
and
20 deletions
+26
-20
AdminServiceApplication.java
...ramework/apollo/adminservice/AdminServiceApplication.java
+0
-1
pom.xml
apollo-portal/pom.xml
+0
-5
PortalApplication.java
.../com/ctrip/framework/apollo/portal/PortalApplication.java
+5
-1
AppController.java
...rip/framework/apollo/portal/controller/AppController.java
+9
-1
NamespaceController.java
...amework/apollo/portal/controller/NamespaceController.java
+2
-1
AppRepository.java
...rip/framework/apollo/portal/repository/AppRepository.java
+0
-6
AppService.java
...com/ctrip/framework/apollo/portal/service/AppService.java
+7
-2
NamespaceService.java
...rip/framework/apollo/portal/service/NamespaceService.java
+2
-2
app.js
apollo-portal/src/main/resources/static/scripts/app.js
+1
-1
No files found.
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/AdminServiceApplication.java
View file @
04383980
...
...
@@ -14,7 +14,6 @@ import org.springframework.context.annotation.Configuration;
import
org.springframework.context.annotation.EnableAspectJAutoProxy
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
@EnableAspectJAutoProxy
@EnableEurekaClient
@Configuration
...
...
apollo-portal/pom.xml
View file @
04383980
...
...
@@ -28,11 +28,6 @@
<artifactId>
h2
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-hateoas
</artifactId>
<version>
1.3.5.RELEASE
</version>
</dependency>
</dependencies>
<build>
<plugins>
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/PortalApplication.java
View file @
04383980
...
...
@@ -9,10 +9,14 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.EnableAspectJAutoProxy
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
@EnableA
utoConfiguration
@EnableA
spectJAutoProxy
@Configuration
@EnableAutoConfiguration
@EnableTransactionManagement
@PropertySource
(
value
=
{
"classpath:portal.properties"
})
@ComponentScan
(
basePackageClasses
=
{
ApolloCommonConfig
.
class
,
PortalApplication
.
class
})
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/AppController.java
View file @
04383980
...
...
@@ -2,6 +2,7 @@ package com.ctrip.framework.apollo.portal.controller;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
...
@@ -17,6 +18,7 @@ import com.ctrip.framework.apollo.common.http.RichResponseEntity;
import
com.ctrip.framework.apollo.core.enums.Env
;
import
com.ctrip.framework.apollo.portal.PortalSettings
;
import
com.ctrip.framework.apollo.portal.entity.vo.EnvClusterInfo
;
import
com.ctrip.framework.apollo.portal.listener.AppCreationEvent
;
import
com.ctrip.framework.apollo.portal.service.AppService
;
import
java.util.List
;
...
...
@@ -33,6 +35,9 @@ public class AppController {
@Autowired
private
PortalSettings
portalSettings
;
@Autowired
private
ApplicationEventPublisher
publisher
;
@RequestMapping
(
""
)
public
List
<
App
>
findAllApp
()
{
return
appService
.
findAll
();
...
...
@@ -60,7 +65,10 @@ public class AppController {
checkArgument
(
app
.
getName
(),
app
.
getAppId
(),
app
.
getOwnerEmail
(),
app
.
getOwnerName
());
appService
.
createApp
(
app
);
appService
.
enrichUserInfo
(
app
);
App
createdApp
=
appService
.
createOrUpdateAppInLocal
(
app
);
publisher
.
publishEvent
(
new
AppCreationEvent
(
createdApp
));
return
ResponseEntity
.
ok
().
build
();
}
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/NamespaceController.java
View file @
04383980
package
com
.
ctrip
.
framework
.
apollo
.
portal
.
controller
;
import
com.ctrip.framework.apollo.common.entity.AppNamespace
;
import
com.ctrip.framework.apollo.core.dto.AppNamespaceDTO
;
import
com.ctrip.framework.apollo.core.dto.NamespaceDTO
;
import
com.ctrip.framework.apollo.core.enums.Env
;
...
...
@@ -25,7 +26,7 @@ public class NamespaceController {
private
NamespaceService
namespaceService
;
@RequestMapping
(
"/appnamespaces/public"
)
public
List
<
AppNamespace
DTO
>
findPublicAppNamespaces
()
{
public
List
<
AppNamespace
>
findPublicAppNamespaces
()
{
return
namespaceService
.
findPublicAppNamespaces
();
}
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/repository/AppRepository.java
View file @
04383980
...
...
@@ -2,17 +2,11 @@ package com.ctrip.framework.apollo.portal.repository;
import
com.ctrip.framework.apollo.common.entity.App
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
org.springframework.data.repository.query.Param
;
import
java.util.List
;
public
interface
AppRepository
extends
PagingAndSortingRepository
<
App
,
Long
>
{
@Query
(
"SELECT a from App a WHERE a.name LIKE %:name%"
)
List
<
App
>
findByName
(
@Param
(
"name"
)
String
name
);
App
findByAppId
(
String
appId
);
}
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/AppService.java
View file @
04383980
...
...
@@ -92,21 +92,26 @@ public class AppService {
}
}
p
rivate
void
enrichUserInfo
(
App
app
)
{
p
ublic
void
enrichUserInfo
(
App
app
)
{
String
username
=
userInfoHolder
.
getUser
().
getUserId
();
app
.
setDataChangeCreatedBy
(
username
);
app
.
setDataChangeLastModifiedBy
(
username
);
}
@Transactional
p
rivate
App
createOrUpdateAppInLocal
(
App
app
)
{
p
ublic
App
createOrUpdateAppInLocal
(
App
app
)
{
String
appId
=
app
.
getAppId
();
App
managedApp
=
appRepository
.
findByAppId
(
appId
);
if
(
managedApp
!=
null
)
{
BeanUtils
.
copyEntityProperties
(
app
,
managedApp
);
return
appRepository
.
save
(
managedApp
);
}
else
{
App
createdApp
=
appRepository
.
save
(
app
);
if
(
app
.
getName
().
equals
(
"xx"
)){
throw
new
RuntimeException
(
"xxxx"
);
}
namespaceService
.
createDefaultAppNamespace
(
appId
);
//role
roleInitializationService
.
initAppRoles
(
createdApp
);
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/NamespaceService.java
View file @
04383980
...
...
@@ -58,8 +58,8 @@ public class NamespaceService {
private
Gson
gson
=
new
Gson
();
public
List
<
AppNamespace
DTO
>
findPublicAppNamespaces
()
{
return
namespaceAPI
.
findPublicAppNamespaces
(
portalSettings
.
getFirstAliveEnv
()
);
public
List
<
AppNamespace
>
findPublicAppNamespaces
()
{
return
appNamespaceRepository
.
findByNameNot
(
ConfigConsts
.
NAMESPACE_APPLICATION
);
}
public
NamespaceDTO
createNamespace
(
Env
env
,
NamespaceDTO
namespace
)
{
...
...
apollo-portal/src/main/resources/static/scripts/app.js
View file @
04383980
...
...
@@ -20,7 +20,7 @@ var sync_item_module = angular.module('sync_item', ['app.service', 'apollo.direc
var
namespace_module
=
angular
.
module
(
'namespace'
,
[
'app.service'
,
'apollo.directive'
,
'app.util'
,
'toastr'
,
'angular-loading-bar'
]);
//server config
var
server_config_module
=
angular
.
module
(
'server_config'
,
[
'app.service'
,
'apollo.directive'
,
'app.util'
,
'toastr'
,
'angular-loading-bar'
]);
//
namespace
role
//role
var
role_module
=
angular
.
module
(
'role'
,
[
'app.service'
,
'apollo.directive'
,
'app.util'
,
'toastr'
,
'angular-loading-bar'
]);
...
...
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