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
5af5ece9
Commit
5af5ece9
authored
Aug 11, 2016
by
lepdou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change open api error msg to en
parent
9670438e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
ItemController.java
...ramework/apollo/openapi/v1/controller/ItemController.java
+6
-6
ReleaseController.java
...ework/apollo/openapi/v1/controller/ReleaseController.java
+1
-1
No files found.
apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java
View file @
5af5ece9
...
@@ -68,17 +68,17 @@ public class ItemController {
...
@@ -68,17 +68,17 @@ public class ItemController {
RequestPrecondition
.
checkArguments
(
RequestPrecondition
.
checkArguments
(
!
StringUtils
.
isContainEmpty
(
item
.
getKey
(),
item
.
getValue
(),
item
.
getDataChangeLastModifiedBy
()),
!
StringUtils
.
isContainEmpty
(
item
.
getKey
(),
item
.
getValue
(),
item
.
getDataChangeLastModifiedBy
()),
"key,value,dataChangeLastModifiedBy
字段不能为空
"
);
"key,value,dataChangeLastModifiedBy
can not be empty
"
);
RequestPrecondition
.
checkArguments
(
item
.
getKey
().
equals
(
key
),
"
path中的key和payload中的key不一致
"
);
RequestPrecondition
.
checkArguments
(
item
.
getKey
().
equals
(
key
),
"
Key in path and payload is not consistent
"
);
if
(
userService
.
findByUserId
(
item
.
getDataChangeLastModifiedBy
())
==
null
)
{
if
(
userService
.
findByUserId
(
item
.
getDataChangeLastModifiedBy
())
==
null
)
{
throw
new
BadRequestException
(
"
用户不存在
"
);
throw
new
BadRequestException
(
"
user(dataChangeLastModifiedBy) not exists
"
);
}
}
ItemDTO
toUpdateItem
=
itemService
.
loadItem
(
Env
.
fromString
(
env
),
appId
,
clusterName
,
namespaceName
,
item
.
getKey
());
ItemDTO
toUpdateItem
=
itemService
.
loadItem
(
Env
.
fromString
(
env
),
appId
,
clusterName
,
namespaceName
,
item
.
getKey
());
if
(
toUpdateItem
==
null
)
{
if
(
toUpdateItem
==
null
)
{
throw
new
BadRequestException
(
"item
不存在
"
);
throw
new
BadRequestException
(
"item
not exists
"
);
}
}
//protect. only value,comment,lastModifiedBy can be modified
//protect. only value,comment,lastModifiedBy can be modified
toUpdateItem
.
setComment
(
item
.
getComment
());
toUpdateItem
.
setComment
(
item
.
getComment
());
...
@@ -97,12 +97,12 @@ public class ItemController {
...
@@ -97,12 +97,12 @@ public class ItemController {
HttpServletRequest
request
)
{
HttpServletRequest
request
)
{
if
(
userService
.
findByUserId
(
operator
)
==
null
)
{
if
(
userService
.
findByUserId
(
operator
)
==
null
)
{
throw
new
BadRequestException
(
"
用户不存在
"
);
throw
new
BadRequestException
(
"
user(operator) not exists
"
);
}
}
ItemDTO
toDeleteItem
=
itemService
.
loadItem
(
Env
.
valueOf
(
env
),
appId
,
clusterName
,
namespaceName
,
key
);
ItemDTO
toDeleteItem
=
itemService
.
loadItem
(
Env
.
valueOf
(
env
),
appId
,
clusterName
,
namespaceName
,
key
);
if
(
toDeleteItem
==
null
){
if
(
toDeleteItem
==
null
){
throw
new
BadRequestException
(
"item
不存在
"
);
throw
new
BadRequestException
(
"item
not exists
"
);
}
}
itemService
.
deleteItem
(
Env
.
fromString
(
env
),
toDeleteItem
.
getId
(),
operator
);
itemService
.
deleteItem
(
Env
.
fromString
(
env
),
toDeleteItem
.
getId
(),
operator
);
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ReleaseController.java
View file @
5af5ece9
...
@@ -47,7 +47,7 @@ public class ReleaseController {
...
@@ -47,7 +47,7 @@ public class ReleaseController {
"releaseTitle and releaseBy can not be empty"
);
"releaseTitle and releaseBy can not be empty"
);
if
(
userService
.
findByUserId
(
model
.
getReleasedBy
())
==
null
)
{
if
(
userService
.
findByUserId
(
model
.
getReleasedBy
())
==
null
)
{
throw
new
BadRequestException
(
"
用户不存在.
"
);
throw
new
BadRequestException
(
"
user(releaseBy) not exists
"
);
}
}
model
.
setAppId
(
appId
);
model
.
setAppId
(
appId
);
...
...
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