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
e0ec9f9c
Commit
e0ec9f9c
authored
Nov 23, 2016
by
Jason Song
Committed by
GitHub
Nov 23, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #456 from lepdou/bugfix_1123
bugfix: branch modify master's item should ignore some field
parents
c06d5eee
d689fe5b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
ItemController.java
...ramework/apollo/openapi/v1/controller/ItemController.java
+2
-0
ItemController.java
...ip/framework/apollo/portal/controller/ItemController.java
+9
-0
ItemService.java
...om/ctrip/framework/apollo/portal/service/ItemService.java
+0
-6
No files found.
apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java
View file @
e0ec9f9c
...
@@ -52,6 +52,8 @@ public class ItemController {
...
@@ -52,6 +52,8 @@ public class ItemController {
toCreate
.
setLineNum
(
0
);
toCreate
.
setLineNum
(
0
);
toCreate
.
setId
(
0
);
toCreate
.
setId
(
0
);
toCreate
.
setDataChangeLastModifiedBy
(
toCreate
.
getDataChangeCreatedBy
());
toCreate
.
setDataChangeLastModifiedBy
(
toCreate
.
getDataChangeCreatedBy
());
toCreate
.
setDataChangeLastModifiedTime
(
null
);
toCreate
.
setDataChangeCreatedTime
(
null
);
ItemDTO
createdItem
=
itemService
.
createItem
(
appId
,
Env
.
fromString
(
env
),
ItemDTO
createdItem
=
itemService
.
createItem
(
appId
,
Env
.
fromString
(
env
),
clusterName
,
namespaceName
,
toCreate
);
clusterName
,
namespaceName
,
toCreate
);
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ItemController.java
View file @
e0ec9f9c
...
@@ -58,6 +58,15 @@ public class ItemController {
...
@@ -58,6 +58,15 @@ public class ItemController {
@RequestBody
ItemDTO
item
)
{
@RequestBody
ItemDTO
item
)
{
checkModel
(
isValidItem
(
item
));
checkModel
(
isValidItem
(
item
));
//protect
item
.
setLineNum
(
0
);
item
.
setId
(
0
);
String
userId
=
userInfoHolder
.
getUser
().
getUserId
();
item
.
setDataChangeCreatedBy
(
userId
);
item
.
setDataChangeLastModifiedBy
(
userId
);
item
.
setDataChangeCreatedTime
(
null
);
item
.
setDataChangeLastModifiedTime
(
null
);
return
configService
.
createItem
(
appId
,
Env
.
valueOf
(
env
),
clusterName
,
namespaceName
,
item
);
return
configService
.
createItem
(
appId
,
Env
.
valueOf
(
env
),
clusterName
,
namespaceName
,
item
);
}
}
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/ItemService.java
View file @
e0ec9f9c
...
@@ -91,12 +91,6 @@ public class ItemService {
...
@@ -91,12 +91,6 @@ public class ItemService {
}
}
item
.
setNamespaceId
(
namespace
.
getId
());
item
.
setNamespaceId
(
namespace
.
getId
());
if
(
StringUtils
.
isEmpty
(
item
.
getDataChangeCreatedBy
()))
{
String
username
=
userInfoHolder
.
getUser
().
getUserId
();
item
.
setDataChangeCreatedBy
(
username
);
item
.
setDataChangeLastModifiedBy
(
username
);
}
ItemDTO
itemDTO
=
itemAPI
.
createItem
(
appId
,
env
,
clusterName
,
namespaceName
,
item
);
ItemDTO
itemDTO
=
itemAPI
.
createItem
(
appId
,
env
,
clusterName
,
namespaceName
,
item
);
Cat
.
logEvent
(
CatEventType
.
MODIFY_NAMESPACE
,
String
.
format
(
"%s+%s+%s+%s"
,
appId
,
env
,
clusterName
,
namespaceName
));
Cat
.
logEvent
(
CatEventType
.
MODIFY_NAMESPACE
,
String
.
format
(
"%s+%s+%s+%s"
,
appId
,
env
,
clusterName
,
namespaceName
));
return
itemDTO
;
return
itemDTO
;
...
...
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