-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HW41-solution #56
base: main
Are you sure you want to change the base?
HW41-solution #56
Conversation
private static RickAndMortyClient rickAndMortyClient; | ||
private static RickAndMortyService rickAndMortyService; | ||
|
||
public Application(RickAndMortyClient client, RickAndMortyService rickAndMortyService) { | ||
Application.rickAndMortyClient = client; | ||
Application.rickAndMortyService = rickAndMortyService; | ||
} | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(Application.class, args); | ||
rickAndMortyService.saveAll(rickAndMortyClient.getAllCharacter()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use CommandLineRunner or ApplicationRunner instead of running this here
private static RickAndMortyClient rickAndMortyClient; | |
private static RickAndMortyService rickAndMortyService; | |
public Application(RickAndMortyClient client, RickAndMortyService rickAndMortyService) { | |
Application.rickAndMortyClient = client; | |
Application.rickAndMortyService = rickAndMortyService; | |
} | |
public static void main(String[] args) { | |
SpringApplication.run(Application.class, args); | |
rickAndMortyService.saveAll(rickAndMortyClient.getAllCharacter()); | |
} | |
public static void main(String[] args) { | |
SpringApplication.run(Application.class, args); | |
} |
public List<CharacterRateDto> getAllCharacter() { | ||
HttpClient httpClient = HttpClient.newHttpClient(); | ||
int i = 1; | ||
List<CharacterRateDto> allCharacter = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better naming
List<CharacterRateDto> allCharacter = new ArrayList<>(); | |
List<CharacterRateDto> fetchedCharacters = new ArrayList<>(); |
|
||
public List<CharacterRateDto> getAllCharacter() { | ||
HttpClient httpClient = HttpClient.newHttpClient(); | ||
int i = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better naming
int i = 1; | |
int page = 1; |
No description provided.