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
1665f492
Commit
1665f492
authored
Jul 07, 2016
by
lepdou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
not found lock return null
parent
e7d91c7d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
14 deletions
+2
-14
NamespaceLockController.java
...ollo/adminservice/controller/NamespaceLockController.java
+2
-2
NamespaceLockController.java
...ork/apollo/portal/controller/NamespaceLockController.java
+0
-11
NamespaceLockService.java
...framework/apollo/portal/service/NamespaceLockService.java
+0
-1
No files found.
apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/NamespaceLockController.java
View file @
1665f492
...
...
@@ -35,13 +35,13 @@ public class NamespaceLockController {
}
if
(
apolloSwitcher
.
isNamespaceLockSwitchOff
())
{
throw
new
NotFoundException
(
namespaceName
+
" is not locked"
)
;
return
null
;
}
NamespaceLock
lock
=
namespaceLockService
.
findLock
(
namespace
.
getId
());
if
(
lock
==
null
)
{
throw
new
NotFoundException
(
namespaceName
+
" is not locked"
)
;
return
null
;
}
return
BeanUtils
.
transfrom
(
NamespaceLockDTO
.
class
,
lock
);
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/NamespaceLockController.java
View file @
1665f492
...
...
@@ -2,15 +2,12 @@ package com.ctrip.framework.apollo.portal.controller;
import
com.ctrip.framework.apollo.core.dto.NamespaceLockDTO
;
import
com.ctrip.framework.apollo.core.enums.Env
;
import
com.ctrip.framework.apollo.core.exception.ServiceException
;
import
com.ctrip.framework.apollo.portal.service.NamespaceLockService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.client.HttpClientErrorException
;
@RestController
public
class
NamespaceLockController
{
...
...
@@ -22,15 +19,7 @@ public class NamespaceLockController {
public
NamespaceLockDTO
getNamespaceLock
(
@PathVariable
String
appId
,
@PathVariable
String
env
,
@PathVariable
String
clusterName
,
@PathVariable
String
namespaceName
){
try
{
return
namespaceLockService
.
getNamespaceLock
(
appId
,
Env
.
valueOf
(
env
),
clusterName
,
namespaceName
);
}
catch
(
HttpClientErrorException
e
){
if
(
e
.
getStatusCode
()
==
HttpStatus
.
NOT_FOUND
){
return
null
;
}
throw
new
ServiceException
(
"service error"
,
e
);
}
}
}
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/NamespaceLockService.java
View file @
1665f492
...
...
@@ -13,7 +13,6 @@ public class NamespaceLockService {
@Autowired
private
AdminServiceAPI
.
NamespaceLockAPI
namespaceLockAPI
;
public
NamespaceLockDTO
getNamespaceLock
(
String
appId
,
Env
env
,
String
clusterName
,
String
namespaceName
){
return
namespaceLockAPI
.
getNamespaceLockOwner
(
appId
,
env
,
clusterName
,
namespaceName
);
...
...
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