fixed broken interfsce by mistake, added getAllLikesByFeed back

This commit is contained in:
Massimiliano Assante 2022-09-20 18:39:38 +02:00
parent 60abff8772
commit 6bb93b7de2
2 changed files with 17 additions and 3 deletions

View File

@ -2440,11 +2440,19 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Deprecated
@Override @Override
public List<Like> getAllLikesByPost(String feedid) { public List<Like> getAllLikesByFeed(String feedid) {
return getAllLikesByPost(feedid);
}
/**
* {@inheritDoc}
*/
@Override
public List<Like> getAllLikesByPost(String postid) {
List<Like> toReturn = new ArrayList<Like>(); List<Like> toReturn = new ArrayList<Like>();
OperationResult<Rows<String, String>> result; OperationResult<Rows<String, String>> result;
PreparedIndexExpression<String, String> clause = cf_Likes.newIndexClause().whereColumn("Feedid").equals().value(feedid); PreparedIndexExpression<String, String> clause = cf_Likes.newIndexClause().whereColumn("Feedid").equals().value(postid);
try { try {
result = conn.getKeyspace().prepareQuery(cf_Likes) result = conn.getKeyspace().prepareQuery(cf_Likes)
.searchWithIndex() .searchWithIndex()
@ -2467,7 +2475,7 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
else if (col.getName().compareTo("Feedid") == 0) else if (col.getName().compareTo("Feedid") == 0)
toAdd.setFeedid(col.getStringValue()); toAdd.setFeedid(col.getStringValue());
else { else {
_log.error("getAllLikesByFeed(): Could not assign variable to this Like for column name: " + col.getName()); _log.error("getAllLikesByPost(): Could not assign variable to this Like for column name: " + col.getName());
} }
} }
toReturn.add(toAdd); toReturn.add(toAdd);

View File

@ -532,6 +532,12 @@ public interface DatabookStore {
* @return the likes made to feeds in the range from: today to: timeInMillis * @return the likes made to feeds in the range from: today to: timeInMillis
*/ */
List<Post> getRecentLikedPostsByUserAndDate(String userid, long timeInMillis) throws IllegalArgumentException; List<Post> getRecentLikedPostsByUserAndDate(String userid, long timeInMillis) throws IllegalArgumentException;
/**
* @deprecated use getAllLikesByPost
* @param postid postid identifier
* return all the likes belonging to the postid
*/
List<Like> getAllLikesByFeed(String postid);
/** /**
* @param postid postid identifier * @param postid postid identifier
* return all the likes belonging to the postid * return all the likes belonging to the postid