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
7b3551e1
Commit
7b3551e1
authored
Jul 14, 2017
by
张乐
Committed by
GitHub
Jul 14, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #659 from lepdou/bugfix_appnamespace
Bugfix: check application namespace existed
parents
d010aa59
56b195e4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
AppNamespaceService.java
.../framework/apollo/portal/service/AppNamespaceService.java
+4
-3
No files found.
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/AppNamespaceService.java
View file @
7b3551e1
...
@@ -46,18 +46,19 @@ public class AppNamespaceService {
...
@@ -46,18 +46,19 @@ public class AppNamespaceService {
@Transactional
@Transactional
public
void
createDefaultAppNamespace
(
String
appId
)
{
public
void
createDefaultAppNamespace
(
String
appId
)
{
if
(!
isAppNamespaceNameUnique
(
appId
,
appId
))
{
if
(!
isAppNamespaceNameUnique
(
appId
,
ConfigConsts
.
NAMESPACE_APPLICATION
))
{
throw
new
ServiceException
(
"appnamespace not unique"
);
throw
new
BadRequestException
(
String
.
format
(
"App already has application namespace. AppId = %s"
,
appId
)
);
}
}
AppNamespace
appNs
=
new
AppNamespace
();
AppNamespace
appNs
=
new
AppNamespace
();
appNs
.
setAppId
(
appId
);
appNs
.
setAppId
(
appId
);
appNs
.
setName
(
ConfigConsts
.
NAMESPACE_APPLICATION
);
appNs
.
setName
(
ConfigConsts
.
NAMESPACE_APPLICATION
);
appNs
.
setComment
(
"default app namespace"
);
appNs
.
setComment
(
"default app namespace"
);
appNs
.
setFormat
(
ConfigFileFormat
.
Properties
.
getValue
());
appNs
.
setFormat
(
ConfigFileFormat
.
Properties
.
getValue
());
String
userId
=
userInfoHolder
.
getUser
().
getUserId
();
String
userId
=
userInfoHolder
.
getUser
().
getUserId
();
appNs
.
setDataChangeCreatedBy
(
userId
);
appNs
.
setDataChangeCreatedBy
(
userId
);
appNs
.
setDataChangeLastModifiedBy
(
userId
);
appNs
.
setDataChangeLastModifiedBy
(
userId
);
appNamespaceRepository
.
save
(
appNs
);
appNamespaceRepository
.
save
(
appNs
);
}
}
...
...
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