Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
apollo
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
apollo
Commits
d237cec2
Commit
d237cec2
authored
Apr 20, 2016
by
Yiming Liu
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #122 from lepdou/lepdou_master
item lastModifiedBy
parents
fed39e80
e4d3ba56
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
4 deletions
+36
-4
apollo-adminservice/src/main/java/com/ctrip/apollo/adminservice/controller/ItemController.java
.../ctrip/apollo/adminservice/controller/ItemController.java
+10
-1
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/BaseEntity.java
...src/main/java/com/ctrip/apollo/biz/entity/BaseEntity.java
+1
-0
apollo-biz/src/main/java/com/ctrip/apollo/biz/service/ItemSetService.java
...ain/java/com/ctrip/apollo/biz/service/ItemSetService.java
+0
-1
apollo-core/src/main/java/com/ctrip/apollo/core/dto/ItemDTO.java
...core/src/main/java/com/ctrip/apollo/core/dto/ItemDTO.java
+23
-0
apollo-portal/src/main/resources/static/views/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 @
d237cec2
package
com
.
ctrip
.
apollo
.
adminservice
.
controller
;
package
com
.
ctrip
.
apollo
.
adminservice
.
controller
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -59,7 +60,15 @@ public class ItemController {
...
@@ -59,7 +60,15 @@ public class ItemController {
@PathVariable
(
"clusterName"
)
String
clusterName
,
@PathVariable
(
"clusterName"
)
String
clusterName
,
@PathVariable
(
"namespaceName"
)
String
namespaceName
)
{
@PathVariable
(
"namespaceName"
)
String
namespaceName
)
{
List
<
Item
>
items
=
viewService
.
findItems
(
appId
,
clusterName
,
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}"
)
@RequestMapping
(
"/items/{itemId}"
)
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/entity/BaseEntity.java
View file @
d237cec2
...
@@ -90,6 +90,7 @@ public abstract class BaseEntity {
...
@@ -90,6 +90,7 @@ public abstract class BaseEntity {
@PrePersist
@PrePersist
protected
void
prePersist
()
{
protected
void
prePersist
()
{
if
(
this
.
dataChangeCreatedTime
==
null
)
dataChangeCreatedTime
=
new
Date
();
if
(
this
.
dataChangeCreatedTime
==
null
)
dataChangeCreatedTime
=
new
Date
();
if
(
this
.
dataChangeLastModifiedTime
==
null
)
dataChangeLastModifiedTime
=
new
Date
();
}
}
@PreUpdate
@PreUpdate
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/service/ItemSetService.java
View file @
d237cec2
...
@@ -27,7 +27,6 @@ public class ItemSetService {
...
@@ -27,7 +27,6 @@ public class ItemSetService {
if
(
changeSet
.
getCreateItems
()
!=
null
)
{
if
(
changeSet
.
getCreateItems
()
!=
null
)
{
for
(
ItemDTO
item
:
changeSet
.
getCreateItems
())
{
for
(
ItemDTO
item
:
changeSet
.
getCreateItems
())
{
Item
entity
=
BeanUtils
.
transfrom
(
Item
.
class
,
item
);
Item
entity
=
BeanUtils
.
transfrom
(
Item
.
class
,
item
);
entity
.
setDataChangeCreatedTime
(
new
Date
());
entity
.
setDataChangeCreatedBy
(
owner
);
entity
.
setDataChangeCreatedBy
(
owner
);
entity
.
setDataChangeLastModifiedBy
(
owner
);
entity
.
setDataChangeLastModifiedBy
(
owner
);
itemRepository
.
save
(
entity
);
itemRepository
.
save
(
entity
);
...
...
apollo-core/src/main/java/com/ctrip/apollo/core/dto/ItemDTO.java
View file @
d237cec2
package
com
.
ctrip
.
apollo
.
core
.
dto
;
package
com
.
ctrip
.
apollo
.
core
.
dto
;
import
java.util.Date
;
public
class
ItemDTO
{
public
class
ItemDTO
{
private
long
id
;
private
long
id
;
...
@@ -14,6 +16,10 @@ public class ItemDTO {
...
@@ -14,6 +16,10 @@ public class ItemDTO {
private
int
lineNum
;
private
int
lineNum
;
private
String
lastModifiedBy
;
private
Date
lastModifiedTime
;
public
ItemDTO
()
{
public
ItemDTO
()
{
}
}
...
@@ -73,6 +79,21 @@ public class ItemDTO {
...
@@ -73,6 +79,21 @@ public class ItemDTO {
this
.
lineNum
=
lineNum
;
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
@Override
public
String
toString
()
{
public
String
toString
()
{
...
@@ -83,6 +104,8 @@ public class ItemDTO {
...
@@ -83,6 +104,8 @@ public class ItemDTO {
", value='"
+
value
+
'\''
+
", value='"
+
value
+
'\''
+
", comment='"
+
comment
+
'\''
+
", comment='"
+
comment
+
'\''
+
", lineNum="
+
lineNum
+
", lineNum="
+
lineNum
+
", lastModifiedBy='"
+
lastModifiedBy
+
'\''
+
", lastModifiedTime="
+
lastModifiedTime
+
'}'
;
'}'
;
}
}
}
}
apollo-portal/src/main/resources/static/views/app.html
View file @
d237cec2
...
@@ -148,10 +148,10 @@
...
@@ -148,10 +148,10 @@
{{config.item.comment}}
{{config.item.comment}}
</td>
</td>
<td>
<td>
{{config.item.
dataChangeL
astModifiedBy}}
{{config.item.
l
astModifiedBy}}
</td>
</td>
<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>
</td>
</tr>
</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