Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from vkolodrevskiy/master
Update spring-social vk
- Loading branch information
Showing
36 changed files
with
1,369 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
spring-social-vkontakte/src/main/java/org/springframework/social/vkontakte/api/Comment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package org.springframework.social.vkontakte.api; | ||
|
||
import org.springframework.social.vkontakte.api.attachment.Attachment; | ||
import org.springframework.util.StringUtils; | ||
|
||
import java.util.Date; | ||
import java.util.List; | ||
|
||
/** | ||
* Model class representing a comment on a post on a user wall or community wall. | ||
* | ||
* @see <a href="https://vk.com/dev/comment_object">Comment object | Developers | VK</a> | ||
*/ | ||
public class Comment { | ||
private long id; | ||
private long fromId; | ||
private Date date; | ||
private String text; | ||
private long replyToUser; | ||
private long replyToComment; | ||
private Post.Likes likes; | ||
private List<? extends Attachment> attachments; | ||
|
||
public long getFromId() { | ||
return fromId; | ||
} | ||
|
||
public Date getDate() { | ||
return date; | ||
} | ||
|
||
public String getText() { | ||
return text; | ||
} | ||
|
||
public long getId() { | ||
return id; | ||
} | ||
|
||
public long getReplyToUser() { | ||
return replyToUser; | ||
} | ||
|
||
public long getReplyToComment() { | ||
return replyToComment; | ||
} | ||
|
||
public Post.Likes getLikes() { | ||
return likes; | ||
} | ||
|
||
public List<? extends Attachment> getAttachments() { | ||
return attachments; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Comment{" + | ||
"id='" + id + '\'' + | ||
", date=" + date + | ||
", text='" + text + '\'' + | ||
", likes=" + likes + | ||
", attachments=" + (attachments == null ? null : StringUtils.collectionToDelimitedString(attachments, ",\n")) + | ||
'}'; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...al-vkontakte/src/main/java/org/springframework/social/vkontakte/api/CommentsResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package org.springframework.social.vkontakte.api; | ||
|
||
import org.springframework.social.vkontakte.api.impl.wall.CommentsQuery; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Model class representing a response that contains a list of comments on a post on a user wall or community wall. | ||
* | ||
* @see IWallOperations#getComments(CommentsQuery) | ||
*/ | ||
public class CommentsResponse { | ||
private final long count; | ||
private final List<Comment> comments; | ||
private final List<VKontakteProfile> profiles; | ||
private final List<Group> groups; | ||
private final Long realOffset; | ||
|
||
public CommentsResponse(List<Comment> comments, long count, Long realOffset, List<VKontakteProfile> profiles, List<Group> groups) { | ||
this.comments = comments; | ||
this.count = count; | ||
this.realOffset = realOffset; | ||
this.groups = groups; | ||
this.profiles = profiles; | ||
} | ||
|
||
public long getCount() { | ||
return count; | ||
} | ||
|
||
public long getRealOffset() { | ||
return realOffset; | ||
} | ||
|
||
public List<Comment> getComments() { | ||
return comments; | ||
} | ||
|
||
public List<VKontakteProfile> getProfiles() { | ||
return profiles; | ||
} | ||
} |
100 changes: 100 additions & 0 deletions
100
spring-social-vkontakte/src/main/java/org/springframework/social/vkontakte/api/Counters.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/* | ||
* Copyright 2011-2015 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.springframework.social.vkontakte.api; | ||
|
||
/** | ||
* Counters. | ||
* https://vk.com/dev/fields | ||
* | ||
* @author dIsoVi | ||
*/ | ||
public class Counters { | ||
private int albums; | ||
private int videos; | ||
private int audios; | ||
private int notes; | ||
private int photos; | ||
private int groups; | ||
private int gifts; | ||
private int friends; | ||
private int onlineFriends; | ||
private int mutualFriends; | ||
private int userPhotos; | ||
private int userVideos; | ||
private int followers; | ||
private int subscriptions; | ||
private int pages; | ||
|
||
public int getUserVideos() { | ||
return userVideos; | ||
} | ||
|
||
public int getUserPhotos() { | ||
return userPhotos; | ||
} | ||
|
||
public int getAlbums() { | ||
return albums; | ||
} | ||
|
||
public int getVideos() { | ||
return videos; | ||
} | ||
|
||
public int getAudios() { | ||
return audios; | ||
} | ||
|
||
public int getNotes() { | ||
return notes; | ||
} | ||
|
||
public int getPhotos() { | ||
return photos; | ||
} | ||
|
||
public int getGroups() { | ||
return groups; | ||
} | ||
|
||
public int getGifts() { | ||
return gifts; | ||
} | ||
|
||
public int getFriends() { | ||
return friends; | ||
} | ||
|
||
public int getOnlineFriends() { | ||
return onlineFriends; | ||
} | ||
|
||
public int getMutualFriends() { | ||
return mutualFriends; | ||
} | ||
|
||
public int getFollowers() { | ||
return followers; | ||
} | ||
|
||
public int getSubscriptions() { | ||
return subscriptions; | ||
} | ||
|
||
public int getPages() { | ||
return pages; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.