Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,18 @@ public Map<String, Object> getPushSwitch() {
@Path("getDataInfoIdList")
@Produces(MediaType.APPLICATION_JSON)
public Collection<String> getDataInfoIdList() {
Collection<String> ret = new ArrayList<>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里建议使用HashSet去重

ret.addAll(sessionInterests.getInterestDataInfoIds());
ret.addAll(sessionDataStore.getStoreDataInfoIds());
return sessionInterests.getInterestDataInfoIds();
}

@GET
@Path("checkSumDataInfoIdList")
@Produces(MediaType.APPLICATION_JSON)
public int checkSumDataInfoIdList() {
return sessionInterests.getInterestDataInfoIds().hashCode();
return sessionInterests.getInterestDataInfoIds().hashCode()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以基于上面的方法,返回 getDataInfoIdList().hashcode()即可

+ sessionDataStore.getStoreDataInfoIds().hashCode();
}

private void fillServerList(String type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,26 @@
*/
public interface DataStore extends DataManager<Publisher, String, String> {

/**
* get all publishers by dataInfoId
* @param dataInfoId
* @return
*/
Collection<Publisher> getStoreDataByDataInfoId(String dataInfoId);

/***
* get Publiser by registerId and dataInfoId
* @param registerId
* @param dataInfoId
* @return
*/
Publisher queryById(String registerId, String dataInfoId);

/**
* get all publisher dataInfoIds
*
* @return
*/
Collection<String> getStoreDataInfoIds();

}
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ public Publisher queryById(String registerId, String dataInfoId) {
return publishers.get(registerId);
}

@Override
public Collection<String> getStoreDataInfoIds() {
return registry.keySet();
}

@Override
public long count() {
AtomicLong count = new AtomicLong(0);
Expand Down