Last active
October 24, 2019 20:27
-
-
Save michaeldejong/3aa25c4d5210f8f4818eefc414235dee to your computer and use it in GitHub Desktop.
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
@RequiredArgsConstructor(onConstructor = @__(@javax.inject.Inject)) | |
public class Users { | |
private final Client client; | |
public GetUserRequest getUser(long userId) { | |
return new GetUserRequest(client, userId); | |
} | |
} | |
@Data | |
public class GetUserRequest { | |
private final Client client; | |
private final long userId; | |
public Single<User> execute() { | |
return client.get(Service.REST_API, "/users/" + userId); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment