chore(setup): setup java backend #1
@ -1,33 +0,0 @@
|
|||||||
package de.szut.casino.config;
|
|
||||||
|
|
||||||
|
|
||||||
import de.szut.casino.hello.HelloEntity;
|
|
||||||
import de.szut.casino.hello.HelloRepository;
|
|
||||||
import org.springframework.boot.ApplicationArguments;
|
|
||||||
import org.springframework.boot.ApplicationRunner;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class SampleDataCreator implements ApplicationRunner {
|
|
||||||
|
|
||||||
private HelloRepository repository;
|
|
||||||
|
|
||||||
public SampleDataCreator(HelloRepository repository) {
|
|
||||||
this.repository = repository;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void run(ApplicationArguments args) {
|
|
||||||
repository.save(new HelloEntity("Hallo Welt!"));
|
|
||||||
repository.save(new HelloEntity("Schöner Tag heute"));
|
|
||||||
repository.save(new HelloEntity("FooBar"));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public RestTemplate restTemplate() {
|
|
||||||
return new RestTemplate();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user