API corresponding to each social networking library function.

This commit is contained in:
Ahmed Salah Tawfik Ibrahim 2023-11-21 17:58:34 +01:00
parent 3400f6539d
commit a8aa40c1cd
3 changed files with 5 additions and 12 deletions

View File

@ -26,13 +26,13 @@ public class CommentClient extends BaseClient{
super(SUB_SERVICE_PATH);
}
public Comment addCommentLib(Comment comment){
public Boolean addCommentLib(Comment comment){
Validate.isTrue(comment != null, "Comment to write cannot be null");
logger.debug("Request for writing comment");
String thisMethodSignature = "add-comment-lib";
String request = getServiceEndpoint() + thisMethodSignature;
return HttpClient.post(new GenericType<ResponseBean<Comment>>(){}, request, comment);
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, comment);
}
public Comment readCommentByIdLib(String commentid){
Validate.isTrue(commentid != null, "Commentid to read cannot be null");
@ -61,13 +61,13 @@ public class CommentClient extends BaseClient{
return HttpClient.get(new GenericType<ResponseBean<ArrayList<Comment>>>(){}, request);
}
public Comment editCommentLib(Comment comment){
public Boolean editCommentLib(Comment comment){
Validate.isTrue(comment != null, "Comment to write cannot be null");
logger.debug("Request for writing comment");
String thisMethodSignature = "edit-comment-lib";
String request = getServiceEndpoint() + thisMethodSignature;
return HttpClient.post(new GenericType<ResponseBean<Comment>>(){}, request, comment);
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, comment);
}
public boolean deleteCommentLib(String commentid, String postid){

View File

@ -97,13 +97,6 @@ public class HashTagClient extends BaseClient{
}
public List<Feed> getVREFeedsByHashtagLib(String vreid, String hashtag){
logger.debug("Request for vre of hashtags");
String thisMethodSignature = "get-vre-feed-by-hashtag-lib";
String request = getServiceEndpoint() + thisMethodSignature + "?vreid=" + vreid + "&hashtag=" + hashtag;
return HttpClient.get(new GenericType<ResponseBean<ArrayList<Feed>>>(){}, request);
}
public List<Post> getVREPostsByHashtagLib(String vreid, String hashtag){
logger.debug("Request for vre of hashtags");
String thisMethodSignature = "get-vre-post-by-hashtag-lib";

View File

@ -233,7 +233,7 @@ public class PostClient extends BaseClient{
public List<Post> getRecentPostsByUserAndDateLib(String userid, long timeinmillis){
logger.debug("Request for getting recent posts by user");
String thisMethodSignature = "get-recent-posts-by-user-lib";
String thisMethodSignature = "get-recent-posts-by-user-date-lib";
String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid + "&time=" + timeinmillis;
return HttpClient.get(new GenericType<ResponseBean<ArrayList<Post>>>(){}, request);
} //list<post>