Skip to content

Commit 6ad7b5f

Browse files
committed
Get followers/following as full
1 parent 98307a0 commit 6ad7b5f

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

core/src/main/java/com/github/api/v2/services/UserService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public interface UserService extends GitHubService {
8181
*
8282
* @return the user followers
8383
*/
84-
public List<String> getUserFollowers(String userName);
84+
public List<User> getUserFollowers(String userName);
8585

8686
/**
8787
* Gets the user following.
@@ -91,7 +91,7 @@ public interface UserService extends GitHubService {
9191
*
9292
* @return the user following
9393
*/
94-
public List<String> getUserFollowing(String userName);
94+
public List<User> getUserFollowing(String userName);
9595

9696
/**
9797
* Follow user.

core/src/main/java/com/github/api/v2/services/impl/UserServiceImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,13 @@ public User getUserByUsername(String userName) {
147147
* @see com.github.api.v2.services.UserService#getUserFollowers(java.lang.String)
148148
*/
149149
@Override
150-
public List<String> getUserFollowers(String userName) {
150+
public List<User> getUserFollowers(String userName) {
151151
GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.UserApiUrls.GET_USER_FOLLOWERS_URL);
152152
String apiUrl = builder.withField(ParameterNames.USER_NAME, userName).buildUrl();
153153
JsonObject json = unmarshall(callApiGet(apiUrl));
154154

155155
try {
156-
return unmarshall(new TypeToken<List<String>>(){}, json.get("users"));
156+
return unmarshall(new TypeToken<List<User>>(){}, json.get("users"));
157157
}
158158
catch (JsonParseException e) {
159159
throw new GitHubException(e.getMessage(), e);
@@ -164,13 +164,13 @@ public List<String> getUserFollowers(String userName) {
164164
* @see com.github.api.v2.services.UserService#getUserFollowing(java.lang.String)
165165
*/
166166
@Override
167-
public List<String> getUserFollowing(String userName) {
167+
public List<User> getUserFollowing(String userName) {
168168
GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.UserApiUrls.GET_USER_FOLLOWING_URL);
169169
String apiUrl = builder.withField(ParameterNames.USER_NAME, userName).buildUrl();
170170
JsonObject json = unmarshall(callApiGet(apiUrl));
171171

172172
try {
173-
return unmarshall(new TypeToken<List<String>>(){}, json.get("users"));
173+
return unmarshall(new TypeToken<List<User>>(){}, json.get("users"));
174174
}
175175
catch (JsonParseException e) {
176176
throw new GitHubException(e.getMessage(), e);

core/src/main/resources/com/github/api/v2/services/constant/GitHubApiUrls.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ com.github.api.v2.services.userService.searchUsersByEmail=http://github.com/api/
1212
com.github.api.v2.services.userService.getUser=http://github.com/api/{version}/{format}/user/show/{userName}
1313
com.github.api.v2.services.userService.getCurrentUser=http://github.com/api/{version}/{format}/user/show
1414
com.github.api.v2.services.userService.updateUser=http://github.com/api/{version}/{format}/user/show/{userName}
15-
com.github.api.v2.services.userService.getUserFollowers=http://github.com/api/{version}/{format}/user/show/{userName}/followers
16-
com.github.api.v2.services.userService.getUserFollowing=http://github.com/api/{version}/{format}/user/show/{userName}/following
15+
com.github.api.v2.services.userService.getUserFollowers=http://github.com/api/{version}/{format}/user/show/{userName}/followers?full=1
16+
com.github.api.v2.services.userService.getUserFollowing=http://github.com/api/{version}/{format}/user/show/{userName}/following?full=1
1717
com.github.api.v2.services.userService.followUser=http://github.com/api/{version}/{format}/user/follow/{userName}
1818
com.github.api.v2.services.userService.unfollowUser=http://github.com/api/{version}/{format}/user/unfollow/{userName}
1919
com.github.api.v2.services.userService.getWatchedRepositories=http://github.com/api/{version}/{format}/repos/watched/{userName}

0 commit comments

Comments
 (0)