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
299049ab
Commit
299049ab
authored
Jul 13, 2016
by
Jason Song
Committed by
GitHub
Jul 13, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #325 from lepdou/history
bugfix cluster sort
parents
35f07cfb
13ce22ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
Cluster.java
...n/java/com/ctrip/framework/apollo/biz/entity/Cluster.java
+14
-1
ClusterService.java
...om/ctrip/framework/apollo/biz/service/ClusterService.java
+1
-0
No files found.
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/entity/Cluster.java
View file @
299049ab
...
...
@@ -16,7 +16,7 @@ import org.hibernate.annotations.Where;
@Table
(
name
=
"Cluster"
)
@SQLDelete
(
sql
=
"Update Cluster set isDeleted = 1 where id = ?"
)
@Where
(
clause
=
"isDeleted = 0"
)
public
class
Cluster
extends
BaseEntity
{
public
class
Cluster
extends
BaseEntity
implements
Comparable
<
Cluster
>
{
@Column
(
name
=
"Name"
,
nullable
=
false
)
private
String
name
;
...
...
@@ -43,4 +43,17 @@ public class Cluster extends BaseEntity {
public
String
toString
()
{
return
toStringHelper
().
add
(
"name"
,
name
).
add
(
"appId"
,
appId
).
toString
();
}
@Override
public
int
compareTo
(
Cluster
o
)
{
if
(
o
==
null
||
getId
()
>
o
.
getId
())
{
return
1
;
}
if
(
getId
()
==
o
.
getId
())
{
return
0
;
}
return
-
1
;
}
}
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/ClusterService.java
View file @
299049ab
...
...
@@ -46,6 +46,7 @@ public class ClusterService {
}
List
<
Cluster
>
clusters
=
clusterRepository
.
findByAppId
(
appId
);
Collections
.
sort
(
clusters
);
if
(
clusters
==
null
)
{
return
Collections
.
emptyList
();
}
...
...
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