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
e4d3ba56
Commit
e4d3ba56
authored
Apr 20, 2016
by
lepdou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item lastModifiedBy
parent
fed39e80
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
4 deletions
+36
-4
ItemController.java
.../ctrip/apollo/adminservice/controller/ItemController.java
+10
-1
BaseEntity.java
...src/main/java/com/ctrip/apollo/biz/entity/BaseEntity.java
+1
-0
ItemSetService.java
...ain/java/com/ctrip/apollo/biz/service/ItemSetService.java
+0
-1
ItemDTO.java
...core/src/main/java/com/ctrip/apollo/core/dto/ItemDTO.java
+23
-0
app.html
apollo-portal/src/main/resources/static/views/app.html
+2
-2
No files found.
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/controller/ItemController.java
View file @
e4d3ba56
package
com
.
ctrip
.
apollo
.
adminservice
.
controller
;
import
java.util.LinkedList
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -59,7 +60,15 @@ public class ItemController {
@PathVariable
(
"clusterName"
)
String
clusterName
,
@PathVariable
(
"namespaceName"
)
String
namespaceName
)
{
List
<
Item
>
items
=
viewService
.
findItems
(
appId
,
clusterName
,
namespaceName
);
return
BeanUtils
.
batchTransform
(
ItemDTO
.
class
,
items
);
List
<
ItemDTO
>
itemDTOs
=
new
LinkedList
<>();
for
(
Item
item:
items
){
ItemDTO
itemDTO
=
BeanUtils
.
transfrom
(
ItemDTO
.
class
,
item
);
itemDTO
.
setLastModifiedBy
(
item
.
getDataChangeLastModifiedBy
());
itemDTO
.
setLastModifiedTime
(
item
.
getDataChangeLastModifiedTime
());
itemDTOs
.
add
(
itemDTO
);
}
return
itemDTOs
;
}
@RequestMapping
(
"/items/{itemId}"
)
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/BaseEntity.java
View file @
e4d3ba56
...
...
@@ -90,6 +90,7 @@ public abstract class BaseEntity {
@PrePersist
protected
void
prePersist
()
{
if
(
this
.
dataChangeCreatedTime
==
null
)
dataChangeCreatedTime
=
new
Date
();
if
(
this
.
dataChangeLastModifiedTime
==
null
)
dataChangeLastModifiedTime
=
new
Date
();
}
@PreUpdate
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/service/ItemSetService.java
View file @
e4d3ba56
...
...
@@ -27,7 +27,6 @@ public class ItemSetService {
if
(
changeSet
.
getCreateItems
()
!=
null
)
{
for
(
ItemDTO
item
:
changeSet
.
getCreateItems
())
{
Item
entity
=
BeanUtils
.
transfrom
(
Item
.
class
,
item
);
entity
.
setDataChangeCreatedTime
(
new
Date
());
entity
.
setDataChangeCreatedBy
(
owner
);
entity
.
setDataChangeLastModifiedBy
(
owner
);
itemRepository
.
save
(
entity
);
...
...
apollo-core/src/main/java/com/ctrip/apollo/core/dto/ItemDTO.java
View file @
e4d3ba56
package
com
.
ctrip
.
apollo
.
core
.
dto
;
import
java.util.Date
;
public
class
ItemDTO
{
private
long
id
;
...
...
@@ -14,6 +16,10 @@ public class ItemDTO {
private
int
lineNum
;
private
String
lastModifiedBy
;
private
Date
lastModifiedTime
;
public
ItemDTO
()
{
}
...
...
@@ -73,6 +79,21 @@ public class ItemDTO {
this
.
lineNum
=
lineNum
;
}
public
String
getLastModifiedBy
()
{
return
lastModifiedBy
;
}
public
void
setLastModifiedBy
(
String
lastModifiedBy
)
{
this
.
lastModifiedBy
=
lastModifiedBy
;
}
public
Date
getLastModifiedTime
()
{
return
lastModifiedTime
;
}
public
void
setLastModifiedTime
(
Date
lastModifiedTime
)
{
this
.
lastModifiedTime
=
lastModifiedTime
;
}
@Override
public
String
toString
()
{
...
...
@@ -83,6 +104,8 @@ public class ItemDTO {
", value='"
+
value
+
'\''
+
", comment='"
+
comment
+
'\''
+
", lineNum="
+
lineNum
+
", lastModifiedBy='"
+
lastModifiedBy
+
'\''
+
", lastModifiedTime="
+
lastModifiedTime
+
'}'
;
}
}
apollo-portal/src/main/resources/static/views/app.html
View file @
e4d3ba56
...
...
@@ -148,10 +148,10 @@
{{config.item.comment}}
</td>
<td>
{{config.item.
dataChangeL
astModifiedBy}}
{{config.item.
l
astModifiedBy}}
</td>
<td>
{{config.item.
dataChangeL
astModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'}}
{{config.item.
l
astModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'}}
</td>
</tr>
...
...
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