2020-06-09 18:14:49 +02:00
|
|
|
package com.plannaplan;
|
|
|
|
|
2020-09-14 12:39:25 +02:00
|
|
|
import com.plannaplan.entities.User;
|
|
|
|
import com.plannaplan.services.UserService;
|
|
|
|
import com.plannaplan.types.UserRoles;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
2020-06-09 18:14:49 +02:00
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
2020-09-14 12:39:25 +02:00
|
|
|
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
|
|
|
import org.springframework.context.event.EventListener;
|
2020-06-09 18:14:49 +02:00
|
|
|
|
|
|
|
@SpringBootApplication
|
|
|
|
public class App {
|
2020-06-10 10:53:22 +02:00
|
|
|
|
2020-10-01 16:46:45 +02:00
|
|
|
public final static String API_VERSION = "v1";
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
UserService userService;
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
Logo logo = new Logo("beta");
|
|
|
|
System.out.println(logo.getLogo());
|
|
|
|
System.out.println(
|
|
|
|
"|=============================================================================================|");
|
|
|
|
SpringApplication.run(App.class, args);
|
|
|
|
}
|
|
|
|
|
|
|
|
@EventListener(ApplicationReadyEvent.class)
|
|
|
|
public void importData() {
|
|
|
|
User filip = new User();
|
|
|
|
filip.setEmail("filizy@st.amu.edu.pl");
|
|
|
|
filip.setName("Filip");
|
|
|
|
filip.setSurname("Izydorczyk");
|
2020-10-28 13:44:13 +01:00
|
|
|
filip.setRole(UserRoles.ADMIN);
|
2020-10-01 16:46:45 +02:00
|
|
|
this.userService.save(filip);
|
|
|
|
|
|
|
|
User hub = new User();
|
|
|
|
hub.setEmail("hubwrz1@st.amu.edu.pl");
|
|
|
|
hub.setName("Hubert");
|
|
|
|
hub.setSurname("Wrzesiński");
|
|
|
|
hub.setRole(UserRoles.STUDENT);
|
|
|
|
this.userService.save(hub);
|
|
|
|
|
|
|
|
User mac = new User();
|
|
|
|
mac.setEmail("macglo2@st.amu.edu.pl");
|
|
|
|
mac.setName("Maciej");
|
|
|
|
mac.setSurname("Głowacki");
|
|
|
|
mac.setRole(UserRoles.STUDENT);
|
|
|
|
this.userService.save(mac);
|
|
|
|
|
|
|
|
User mar = new User();
|
|
|
|
mar.setEmail("marwoz16@st.amu.edu.pl");
|
|
|
|
mar.setName("Marcin");
|
|
|
|
mar.setSurname("Woźniak");
|
2020-10-30 17:22:40 +01:00
|
|
|
mar.setRole(UserRoles.ADMIN);
|
2020-10-01 16:46:45 +02:00
|
|
|
this.userService.save(mar);
|
|
|
|
|
|
|
|
}
|
2020-06-09 18:14:49 +02:00
|
|
|
}
|