diff --git a/.Rhistory b/.Rhistory deleted file mode 100644 index f759cde..0000000 --- a/.Rhistory +++ /dev/null @@ -1,295 +0,0 @@ -shiny::runApp('ap1') -p("Shiny jest dostpny w repozytorium CRAN, wiec mozesz zainstalowac go w zwykly sposob z konsoli R:"), -code("install.packages(\"shiny\")"), -br(), -br(), -br(), -br(), -img(src = "rstudio.png", height = 60, width = 200), -p("Shiny jest produktem",span("RStudio", style = "color:red")) -), -mainPanel( -h1("Wprowadzenie do Shiny", align = "left"), -p("Shiny jest nowym pakietem RStudio, ktory",em("bardzo ulatwia"),"tworzenie interaktywnych aplikacji internetowych w R."), -br(), -p("Duzo informacji i przykladow znajduje sie na",a("stronie Shiny."),""), -br(), -br(), -h2("Ficzery"), -p("-Tworz uzyteczne aplikacje internetowe zaledwie kilkoma liniami kodu - nie jest wymagana znajomosc JavaScriptu"), -p("-Aplikacje Shiny aktualizuja sie tak samo" ,strong("szybko"),"jak arkusze danych np. Excel. Wyniki zmieniaja sie natychmiast - gdy uzytkownicy modyfikuja dane wejsciowe, nie ma koniecznosci ponownego przeladowania strony.") -) -) -) -server <- function(input, output) { -} -shinyApp(ui = ui, server = server) -p("Shiny jest dostpny w repozytorium CRAN, wiec mozesz zainstalowac go w zwykly sposob z konsoli R:"), -code("install.packages(\"shiny\")"), -br(), -br(), -br(), -br(), -img(src = "rstudio.png", height = 60, width = 200), -p("Shiny jest produktem",span("RStudio", style = "color:red")) -), -mainPanel( -h1("Wprowadzenie do Shiny", align = "left"), -p("Shiny jest nowym pakietem RStudio, ktory",em("bardzo ulatwia"),"tworzenie interaktywnych aplikacji internetowych w R."), -br(), -p("Duzo informacji i przykladow znajduje sie na",a("stronie Shiny."),""), -br(), -br(), -h2("Ficzery"), -p("-Tworz uzyteczne aplikacje internetowe zaledwie kilkoma liniami kodu - nie jest wymagana znajomosc JavaScriptu"), -p("-Aplikacje Shiny aktualizuja sie tak samo" ,strong("szybko"),"jak arkusze danych np. Excel. Wyniki zmieniaja sie natychmiast - gdy uzytkownicy modyfikuja dane wejsciowe, nie ma koniecznosci ponownego przeladowania strony.") -) -) -) -server <- function(input, output) { -} -shinyApp(ui = ui, server = server) -p("Shiny jest dostpny w repozytorium CRAN, wiec mozesz zainstalowac go w zwykly sposob z konsoli R:"), -code("install.packages(\"shiny\")"), -br(), -br(), -br(), -br(), -img(src = "rstudio.png", height = 60, width = 200), -p("Shiny jest produktem",span("RStudio", style = "color:red")) -), -mainPanel( -h1("Wprowadzenie do Shiny", align = "left"), -p("Shiny jest nowym pakietem RStudio, ktory",em("bardzo ulatwia"),"tworzenie interaktywnych aplikacji internetowych w R."), -br(), -p("Duzo informacji i przykladow znajduje sie na",a("stronie Shiny."),""), -br(), -br(), -h2("Ficzery"), -p("-Tworz uzyteczne aplikacje internetowe zaledwie kilkoma liniami kodu - nie jest wymagana znajomosc JavaScriptu"), -p("-Aplikacje Shiny aktualizuja sie tak samo" ,strong("szybko"),"jak arkusze danych np. Excel. Wyniki zmieniaja sie natychmiast - gdy uzytkownicy modyfikuja dane wejsciowe, nie ma koniecznosci ponownego przeladowania strony.") -) -) -) -server <- function(input, output) { -} -shinyApp(ui = ui, server = server) -p("Shiny jest dostpny w repozytorium CRAN, wiec mozesz zainstalowac go w zwykly sposob z konsoli R:"), -code("install.packages(\"shiny\")"), -br(), -br(), -br(), -br(), -img(src = "rstudio.png", height = 60, width = 200), -p("Shiny jest produktem",span("RStudio", style = "color:red")) -), -mainPanel( -h1("Wprowadzenie do Shiny", align = "left"), -p("Shiny jest nowym pakietem RStudio, ktory",em("bardzo ulatwia"),"tworzenie interaktywnych aplikacji internetowych w R."), -br(), -p("Duzo informacji i przykladow znajduje sie na",a("stronie Shiny."),""), -br(), -br(), -h2("Ficzery"), -p("-Tworz uzyteczne aplikacje internetowe zaledwie kilkoma liniami kodu - nie jest wymagana znajomosc JavaScriptu"), -p("-Aplikacje Shiny aktualizuja sie tak samo" ,strong("szybko"),"jak arkusze danych np. Excel. Wyniki zmieniaja sie natychmiast - gdy uzytkownicy modyfikuja dane wejsciowe, nie ma koniecznosci ponownego przeladowania strony.") -) -) -) -server <- function(input, output) { -} -shinyApp(ui = ui, server = server) -p("Shiny jest dostpny w repozytorium CRAN, wiec mozesz zainstalowac go w zwykly sposob z konsoli R:"), -code("install.packages(\"shiny\")"), -br(), -br(), -br(), -br(), -img(src = "rstudio.png", height = 60, width = 200), -p("Shiny jest produktem",span("RStudio", style = "color:red")) -), -mainPanel( -h1("Wprowadzenie do Shiny", align = "left"), -p("Shiny jest nowym pakietem RStudio, ktory",em("bardzo ulatwia"),"tworzenie interaktywnych aplikacji internetowych w R."), -br(), -p("Duzo informacji i przykladow znajduje sie na",a("stronie Shiny."),""), -br(), -br(), -h2("Ficzery"), -p("-Tworz uzyteczne aplikacje internetowe zaledwie kilkoma liniami kodu - nie jest wymagana znajomosc JavaScriptu"), -p("-Aplikacje Shiny aktualizuja sie tak samo" ,strong("szybko"),"jak arkusze danych np. Excel. Wyniki zmieniaja sie natychmiast - gdy uzytkownicy modyfikuja dane wejsciowe, nie ma koniecznosci ponownego przeladowania strony.") -) -) -) -server <- function(input, output) { -} -shinyApp(ui = ui, server = server) -p("Shiny jest dostpny w repozytorium CRAN, wiec mozesz zainstalowac go w zwykly sposob z konsoli R:"), -code("install.packages(\"shiny\")"), -br(), -br(), -br(), -br(), -img(src = "rstudio.png", height = 60, width = 200), -p("Shiny jest produktem",span("RStudio", style = "color:red")) -), -mainPanel( -h1("Wprowadzenie do Shiny", align = "left"), -p("Shiny jest nowym pakietem RStudio, ktory",em("bardzo ulatwia"),"tworzenie interaktywnych aplikacji internetowych w R."), -br(), -p("Duzo informacji i przykladow znajduje sie na",a("stronie Shiny."),""), -br(), -br(), -h2("Ficzery"), -p("-Tworz uzyteczne aplikacje internetowe zaledwie kilkoma liniami kodu - nie jest wymagana znajomosc JavaScriptu"), -p("-Aplikacje Shiny aktualizuja sie tak samo" ,strong("szybko"),"jak arkusze danych np. Excel. Wyniki zmieniaja sie natychmiast - gdy uzytkownicy modyfikuja dane wejsciowe, nie ma koniecznosci ponownego przeladowania strony.") -) -) -) -server <- function(input, output) { -} -shinyApp(ui = ui, server = server) -p("Shiny jest dostpny w repozytorium CRAN, wiec mozesz zainstalowac go w zwykly sposob z konsoli R:"), -code("install.packages(\"shiny\")"), -br(), -br(), -br(), -br(), -img(src = "rstudio.png", height = 60, width = 200), -p("Shiny jest produktem",span("RStudio", style = "color:red")) -), -mainPanel( -h1("Wprowadzenie do Shiny", align = "left"), -p("Shiny jest nowym pakietem RStudio, ktory",em("bardzo ulatwia"),"tworzenie interaktywnych aplikacji internetowych w R."), -br(), -p("Duzo informacji i przykladow znajduje sie na",a("stronie Shiny."),""), -br(), -br(), -h2("Ficzery"), -p("-Tworz uzyteczne aplikacje internetowe zaledwie kilkoma liniami kodu - nie jest wymagana znajomosc JavaScriptu"), -p("-Aplikacje Shiny aktualizuja sie tak samo" ,strong("szybko"),"jak arkusze danych np. Excel. Wyniki zmieniaja sie natychmiast - gdy uzytkownicy modyfikuja dane wejsciowe, nie ma koniecznosci ponownego przeladowania strony.") -) -) -) -server <- function(input, output) { -} -shinyApp(ui = ui, server = server) -p("Shiny jest dostpny w repozytorium CRAN, wiec mozesz zainstalowac go w zwykly sposob z konsoli R:"), -code("install.packages(\"shiny\")"), -br(), -br(), -br(), -br(), -img(src = "rstudio.png", height = 60, width = 200), -p("Shiny jest produktem",span("RStudio", style = "color:red")) -), -mainPanel( -h1("Wprowadzenie do Shiny", align = "left"), -p("Shiny jest nowym pakietem RStudio, ktory",em("bardzo ulatwia"),"tworzenie interaktywnych aplikacji internetowych w R."), -br(), -p("Duzo informacji i przykladow znajduje sie na",a("stronie Shiny."),""), -br(), -br(), -h2("Ficzery"), -p("-Tworz uzyteczne aplikacje internetowe zaledwie kilkoma liniami kodu - nie jest wymagana znajomosc JavaScriptu"), -p("-Aplikacje Shiny aktualizuja sie tak samo" ,strong("szybko"),"jak arkusze danych np. Excel. Wyniki zmieniaja sie natychmiast - gdy uzytkownicy modyfikuja dane wejsciowe, nie ma koniecznosci ponownego przeladowania strony.") -) -) -) -server <- function(input, output) { -} -shinyApp(ui = ui, server = server) -p("Shiny jest dostpny w repozytorium CRAN, wiec mozesz zainstalowac go w zwykly sposob z konsoli R:"), -code("install.packages(\"shiny\")"), -br(), -br(), -br(), -br(), -img(src = "rstudio.png", height = 60, width = 200), -p("Shiny jest produktem",span("RStudio", style = "color:red")) -), -mainPanel( -h1("Wprowadzenie do Shiny", align = "left"), -p("Shiny jest nowym pakietem RStudio, ktory",em("bardzo ulatwia"),"tworzenie interaktywnych aplikacji internetowych w R."), -br(), -p("Duzo informacji i przykladow znajduje sie na",a("stronie Shiny."),""), -br(), -br(), -h2("Ficzery"), -p("-Tworz uzyteczne aplikacje internetowe zaledwie kilkoma liniami kodu - nie jest wymagana znajomosc JavaScriptu"), -p("-Aplikacje Shiny aktualizuja sie tak samo" ,strong("szybko"),"jak arkusze danych np. Excel. Wyniki zmieniaja sie natychmiast - gdy uzytkownicy modyfikuja dane wejsciowe, nie ma koniecznosci ponownego przeladowania strony.") -) -) -) -server <- function(input, output) { -} -shinyApp(ui = ui, server = server) -p("Shiny jest dostpny w repozytorium CRAN, wiec mozesz zainstalowac go w zwykly sposob z konsoli R:"), -code("install.packages(\"shiny\")"), -br(), -br(), -br(), -br(), -img(src = "rstudio.png", height = 60, width = 200), -p("Shiny jest produktem",span("RStudio", style = "color:red")) -), -mainPanel( -h1("Wprowadzenie do Shiny", align = "left"), -p("Shiny jest nowym pakietem RStudio, ktory",em("bardzo ulatwia"),"tworzenie interaktywnych aplikacji internetowych w R."), -br(), -p("Duzo informacji i przykladow znajduje sie na",a("stronie Shiny."),""), -br(), -br(), -h2("Ficzery"), -p("-Tworz uzyteczne aplikacje internetowe zaledwie kilkoma liniami kodu - nie jest wymagana znajomosc JavaScriptu"), -p("-Aplikacje Shiny aktualizuja sie tak samo" ,strong("szybko"),"jak arkusze danych np. Excel. Wyniki zmieniaja sie natychmiast - gdy uzytkownicy modyfikuja dane wejsciowe, nie ma koniecznosci ponownego przeladowania strony.") -) -) -) -server <- function(input, output) { -} -shinyApp(ui = ui, server = server) -runApp('ap1') -shiny::runApp('C:/Users/plalj/Desktop/TakeCareApp/app') -# summarize accuracy -table(predictions, iris$Species) -library(VGAM) -# load data -data(iris) -# fit model -fit <- vglm(Species~., family=multinomial, data=iris) -# summarize the fit -summary(fit) -# make predictions -probabilities <- predict(fit, iris[,1:4], type="response") -predictions <- apply(probabilities, 1, which.max) -predictions[which(predictions=="1")] <- levels(iris$Species)[1] -predictions[which(predictions=="2")] <- levels(iris$Species)[2] -predictions[which(predictions=="3")] <- levels(iris$Species)[3] -# summarize accuracy -table(predictions, iris$Species) -# load the package -library(MASS) -data(iris) -# fit model -fit <- lda(Species~., data=iris) -# summarize the fit -summary(fit) -# make predictions -predictions <- predict(fit, iris[,1:4])$class -# summarize accuracy -table(predictions, iris$Species) -# fit model -fit <- lda(Species~., data=iris) -fit -# summarize the fit -summary(fit) -# make predictions -predictions <- predict(fit, iris[,1:4])$class -predictions -# summarize accuracy -table(predictions, iris$Species) -shiny::runApp('C:/Users/plalj/Desktop/TakeCareApp/app') -setwd("C:/Users/plalj/Desktop/TakeCareApp") -shiny::runApp('app') -runApp('app') diff --git a/Dokumentacja.pdf b/Dokumentacja.pdf deleted file mode 100644 index 454cada..0000000 Binary files a/Dokumentacja.pdf and /dev/null differ diff --git a/Raport użyteczności wersji końcowej.pdf b/Raport użyteczności wersji końcowej.pdf deleted file mode 100644 index 66c1954..0000000 Binary files a/Raport użyteczności wersji końcowej.pdf and /dev/null differ diff --git a/Raport z testowania wersji końcowej.pdf b/Raport z testowania wersji końcowej.pdf deleted file mode 100644 index c3d558d..0000000 Binary files a/Raport z testowania wersji końcowej.pdf and /dev/null differ diff --git a/Test.cs b/Test.cs deleted file mode 100644 index d6529a1..0000000 --- a/Test.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using OpenQA.Selenium; -using OpenQA.Selenium.Firefox; -namespace Aplikacja -{ - class Program - { - static void Main(string[] args) - { - Console.WriteLine("Rozpoczynam test logowania!"); - - var binary = new FirefoxBinary(@"C:\software\firefox\firefox.exe"); - var profile = new FirefoxProfile(); - FirefoxDriverService service = FirefoxDriverService.CreateDefaultService(@"J:\Desktop\Automaty"); - service.FirefoxBinaryPath = @"C:\software\firefox\firefox.exe"; - var driver = new FirefoxDriver(); - - var url = "http://127.0.0.1:5173/#!/login"; - driver.Manage().Window.Maximize(); - driver.Navigate().GoToUrl(url); - - string loginX="//input[@id='login']"; - string hasloX = "//input[@id='pass']"; - string zalogujX = "//button[@id='loginBtn']"; - - var login = driver.FindElement(By.XPath(loginX)); - var pass = driver.FindElement(By.XPath(hasloX)); - var loguj = driver.FindElement(By.XPath(zalogujX)); - - string log = "student"; - string pas = "student"; - - login.Click(); - login.Clear(); - login.SendKeys(log); - pass.Click(); - pass.Clear(); - pass.SendKeys(pas); - loguj.Click(); - - //driver.Close(); - - Console.WriteLine("Test logowania zakończony powodzeniem!"); - - - - - } - } -} diff --git a/app/calculator.R b/app/calculator.R index ee0451d..ed79f01 100644 --- a/app/calculator.R +++ b/app/calculator.R @@ -185,7 +185,7 @@ calculatorServer <- function(input, output, session) { ) - r<-httr::POST("http://localhost:8080/api/prediction/save",add_headers(Authorization=paste("Bearer",input$token,sep=" ")),body=prediction,encode = 'json') + r<-httr::POST("https://syi-back.herokuapp.com/api/prediction/save",add_headers(Authorization=paste("Bearer",input$token,sep=" ")),body=prediction,encode = 'json') # SPRAWDZENIE POBIERANIA JEDNEGO I WIELU POMIAROW # r<-httr::GET("http://localhost:8080/api/prediction/get/7",add_headers(Authorization=paste("Bearer",input$token,sep=" ")),encode = 'json') diff --git a/app/calculator_view.R b/app/calculator_view.R index 9d14168..7d15b2e 100644 --- a/app/calculator_view.R +++ b/app/calculator_view.R @@ -38,7 +38,7 @@ calculatorViewServer <- function(input, output, session) { component2 <- reactive({ if(length(get_query_param())==1 ){ queryParam = as.numeric(get_query_param()) - r = httr::GET(paste("http://localhost:8080/api/prediction/get/",as.character(queryParam),sep = ""),add_headers(Authorization=paste("Bearer",input$token,sep=" ")),encode = 'json') + r = httr::GET(paste("https://syi-back.herokuapp.com/api/prediction/get/",as.character(queryParam),sep = ""),add_headers(Authorization=paste("Bearer",input$token,sep=" ")),encode = 'json') r } @@ -47,7 +47,7 @@ calculatorViewServer <- function(input, output, session) { if(length(get_query_param())==1 ){ queryParam = as.numeric(get_query_param()) - r = httr::GET(paste("http://localhost:8080/api/prediction/get/",as.character(queryParam),sep = ""),add_headers(Authorization=paste("Bearer",input$token,sep=" ")),encode = 'json') + r = httr::GET(paste("https://syi-back.herokuapp.com/api/prediction/get/",as.character(queryParam),sep = ""),add_headers(Authorization=paste("Bearer",input$token,sep=" ")),encode = 'json') r }else{ diff --git a/app/firmy_module.R b/app/firmy_module.R index 9f698ad..011a73a 100644 --- a/app/firmy_module.R +++ b/app/firmy_module.R @@ -55,7 +55,7 @@ firmyServer <- function(input, output,session) { componentFirms<-eventReactive(input$pageFIRMS,{ - r<-httr::GET("http://localhost:8080/api/firms/all",encode = 'json') + r<-httr::GET("https://syi-back.herokuapp.com/api/firms/all",encode = 'json') r diff --git a/app/login_module.R b/app/login_module.R index 1a03f5b..d2f0bb4 100644 --- a/app/login_module.R +++ b/app/login_module.R @@ -63,7 +63,7 @@ loginServer <- function(input, output,session) { to_send = list(login = tmp$login, password = tmp$pass) - r<-httr::POST("http://localhost:8080/api/login",body=to_send,encode = 'json') + r<-httr::POST("https://syi-back.herokuapp.com/api/login",body=to_send,encode = 'json') if(r$status_code==200){ diff --git a/app/profil_module.R b/app/profil_module.R index 582fbdf..f88629a 100644 --- a/app/profil_module.R +++ b/app/profil_module.R @@ -100,7 +100,7 @@ profilServer <- function(input, output,session) { - r<-httr::PUT("http://localhost:8080/api/profile",add_headers(Authorization=paste("Bearer",input$token,sep=" ")),body=to_send,encode = 'json') + r<-httr::PUT("https://syi-back.herokuapp.com/api/profile",add_headers(Authorization=paste("Bearer",input$token,sep=" ")),body=to_send,encode = 'json') if (r$status_code==200){ TRUE @@ -125,7 +125,7 @@ profilServer <- function(input, output,session) { downloadPersonalData<-reactive({ - r<-httr::GET("http://localhost:8080/api/profile",add_headers(Authorization=paste("Bearer",input$token,sep=" "))) + r<-httr::GET("https://syi-back.herokuapp.com/api/profile",add_headers(Authorization=paste("Bearer",input$token,sep=" "))) r @@ -133,7 +133,7 @@ profilServer <- function(input, output,session) { downloadHistoryData<-reactive({ - r<-httr::GET("http://localhost:8080/api/prediction/usersPredictions/ind",add_headers(Authorization=paste("Bearer",input$token,sep=" ")),encode = 'json') + r<-httr::GET("https://syi-back.herokuapp.com/api/prediction/usersPredictions/ind",add_headers(Authorization=paste("Bearer",input$token,sep=" ")),encode = 'json') print("Reactive hist") r @@ -174,10 +174,10 @@ profilServer <- function(input, output,session) { }) observeEvent(input$del_button,{ - r<-httr::DELETE(paste("http://localhost:8080/api/prediction/delete/",input$del_button,sep = ""),add_headers(Authorization=paste("Bearer",input$token,sep=" ")),encode = 'json') + r<-httr::DELETE(paste("https://syi-back.herokuapp.com/api/prediction/delete/",input$del_button,sep = ""),add_headers(Authorization=paste("Bearer",input$token,sep=" ")),encode = 'json') if(r$status_code==200){ - rr<-httr::GET("http://localhost:8080/api/prediction/usersPredictions/ind",add_headers(Authorization=paste("Bearer",input$token,sep=" ")),encode = 'json') + rr<-httr::GET("https://syi-back.herokuapp.com/api/prediction/usersPredictions/ind",add_headers(Authorization=paste("Bearer",input$token,sep=" ")),encode = 'json') historyDataVector(rr) diff --git a/app/register_module.R b/app/register_module.R index 5018f13..16f6916 100644 --- a/app/register_module.R +++ b/app/register_module.R @@ -87,7 +87,7 @@ registerServer <- function(input, output,session) { to_send = list( personalDataDTO = personalData, userDTO = userData) - r<-httr::POST("http://localhost:8080/api/register",body=to_send,encode = 'json') + r<-httr::POST("https://syi-back.herokuapp.com/api/register",body=to_send,encode = 'json') # print(content(r)) if (r$status_code==200){ diff --git a/backend/.idea/compiler.xml b/backend/.idea/compiler.xml deleted file mode 100644 index c665e75..0000000 --- a/backend/.idea/compiler.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__antlr_antlr_2_7_7.xml b/backend/.idea/libraries/Maven__antlr_antlr_2_7_7.xml deleted file mode 100644 index b8d93d8..0000000 --- a/backend/.idea/libraries/Maven__antlr_antlr_2_7_7.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_2_3.xml b/backend/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_2_3.xml deleted file mode 100644 index 6fec8f4..0000000 --- a/backend/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_2_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__ch_qos_logback_logback_core_1_2_3.xml b/backend/.idea/libraries/Maven__ch_qos_logback_logback_core_1_2_3.xml deleted file mode 100644 index 9eb8596..0000000 --- a/backend/.idea/libraries/Maven__ch_qos_logback_logback_core_1_2_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__com_fasterxml_classmate_1_3_4.xml b/backend/.idea/libraries/Maven__com_fasterxml_classmate_1_3_4.xml deleted file mode 100644 index 33c30b4..0000000 --- a/backend/.idea/libraries/Maven__com_fasterxml_classmate_1_3_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_9_0.xml b/backend/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_9_0.xml deleted file mode 100644 index 06441f4..0000000 --- a/backend/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_9_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_9_4.xml b/backend/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_9_4.xml deleted file mode 100644 index 5de0355..0000000 --- a/backend/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_9_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_9_4.xml b/backend/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_9_4.xml deleted file mode 100644 index 398994e..0000000 --- a/backend/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_9_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__com_fasterxml_jackson_dataformat_jackson_dataformat_xml_2_9_4.xml b/backend/.idea/libraries/Maven__com_fasterxml_jackson_dataformat_jackson_dataformat_xml_2_9_4.xml deleted file mode 100644 index 77665b9..0000000 --- a/backend/.idea/libraries/Maven__com_fasterxml_jackson_dataformat_jackson_dataformat_xml_2_9_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_4.xml b/backend/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_4.xml deleted file mode 100644 index 4793ed1..0000000 --- a/backend/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_4.xml b/backend/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_4.xml deleted file mode 100644 index d84e40f..0000000 --- a/backend/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_jaxb_annotations_2_9_4.xml b/backend/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_jaxb_annotations_2_9_4.xml deleted file mode 100644 index cafc86e..0000000 --- a/backend/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_jaxb_annotations_2_9_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_4.xml b/backend/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_4.xml deleted file mode 100644 index ee544ba..0000000 --- a/backend/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__com_fasterxml_woodstox_woodstox_core_5_0_3.xml b/backend/.idea/libraries/Maven__com_fasterxml_woodstox_woodstox_core_5_0_3.xml deleted file mode 100644 index c08dcae..0000000 --- a/backend/.idea/libraries/Maven__com_fasterxml_woodstox_woodstox_core_5_0_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__com_jayway_jsonpath_json_path_2_4_0.xml b/backend/.idea/libraries/Maven__com_jayway_jsonpath_json_path_2_4_0.xml deleted file mode 100644 index f19f6eb..0000000 --- a/backend/.idea/libraries/Maven__com_jayway_jsonpath_json_path_2_4_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml b/backend/.idea/libraries/Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml deleted file mode 100644 index b8581a6..0000000 --- a/backend/.idea/libraries/Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__com_zaxxer_HikariCP_2_7_8.xml b/backend/.idea/libraries/Maven__com_zaxxer_HikariCP_2_7_8.xml deleted file mode 100644 index 848c412..0000000 --- a/backend/.idea/libraries/Maven__com_zaxxer_HikariCP_2_7_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__dom4j_dom4j_1_6_1.xml b/backend/.idea/libraries/Maven__dom4j_dom4j_1_6_1.xml deleted file mode 100644 index 14681ee..0000000 --- a/backend/.idea/libraries/Maven__dom4j_dom4j_1_6_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__javax_annotation_javax_annotation_api_1_3_2.xml b/backend/.idea/libraries/Maven__javax_annotation_javax_annotation_api_1_3_2.xml deleted file mode 100644 index e74f3ab..0000000 --- a/backend/.idea/libraries/Maven__javax_annotation_javax_annotation_api_1_3_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__javax_transaction_javax_transaction_api_1_2.xml b/backend/.idea/libraries/Maven__javax_transaction_javax_transaction_api_1_2.xml deleted file mode 100644 index 5f032d2..0000000 --- a/backend/.idea/libraries/Maven__javax_transaction_javax_transaction_api_1_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__javax_validation_validation_api_2_0_1_Final.xml b/backend/.idea/libraries/Maven__javax_validation_validation_api_2_0_1_Final.xml deleted file mode 100644 index 6978c0b..0000000 --- a/backend/.idea/libraries/Maven__javax_validation_validation_api_2_0_1_Final.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__javax_xml_bind_jaxb_api_2_3_0.xml b/backend/.idea/libraries/Maven__javax_xml_bind_jaxb_api_2_3_0.xml deleted file mode 100644 index 59ff9c2..0000000 --- a/backend/.idea/libraries/Maven__javax_xml_bind_jaxb_api_2_3_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__junit_junit_4_12.xml b/backend/.idea/libraries/Maven__junit_junit_4_12.xml deleted file mode 100644 index d411041..0000000 --- a/backend/.idea/libraries/Maven__junit_junit_4_12.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__mysql_mysql_connector_java_5_1_45.xml b/backend/.idea/libraries/Maven__mysql_mysql_connector_java_5_1_45.xml deleted file mode 100644 index 8280cea..0000000 --- a/backend/.idea/libraries/Maven__mysql_mysql_connector_java_5_1_45.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_7_10.xml b/backend/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_7_10.xml deleted file mode 100644 index 7b90f25..0000000 --- a/backend/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_7_10.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__net_bytebuddy_byte_buddy_agent_1_7_10.xml b/backend/.idea/libraries/Maven__net_bytebuddy_byte_buddy_agent_1_7_10.xml deleted file mode 100644 index c9e49ad..0000000 --- a/backend/.idea/libraries/Maven__net_bytebuddy_byte_buddy_agent_1_7_10.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__net_minidev_accessors_smart_1_2.xml b/backend/.idea/libraries/Maven__net_minidev_accessors_smart_1_2.xml deleted file mode 100644 index b3d3858..0000000 --- a/backend/.idea/libraries/Maven__net_minidev_accessors_smart_1_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__net_minidev_json_smart_2_3.xml b/backend/.idea/libraries/Maven__net_minidev_json_smart_2_3.xml deleted file mode 100644 index 1083023..0000000 --- a/backend/.idea/libraries/Maven__net_minidev_json_smart_2_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_10_0.xml b/backend/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_10_0.xml deleted file mode 100644 index cbe5ca7..0000000 --- a/backend/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_10_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_10_0.xml b/backend/.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_10_0.xml deleted file mode 100644 index 1407c58..0000000 --- a/backend/.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_10_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_8_5_28.xml b/backend/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_8_5_28.xml deleted file mode 100644 index c83f72e..0000000 --- a/backend/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_8_5_28.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_8_5_28.xml b/backend/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_8_5_28.xml deleted file mode 100644 index a90b7bb..0000000 --- a/backend/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_8_5_28.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_8_5_28.xml b/backend/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_8_5_28.xml deleted file mode 100644 index 66bd03f..0000000 --- a/backend/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_8_5_28.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_8_13.xml b/backend/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_8_13.xml deleted file mode 100644 index d46e30a..0000000 --- a/backend/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_8_13.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_assertj_assertj_core_3_9_1.xml b/backend/.idea/libraries/Maven__org_assertj_assertj_core_3_9_1.xml deleted file mode 100644 index 40adaaa..0000000 --- a/backend/.idea/libraries/Maven__org_assertj_assertj_core_3_9_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_codehaus_woodstox_stax2_api_3_1_4.xml b/backend/.idea/libraries/Maven__org_codehaus_woodstox_stax2_api_3_1_4.xml deleted file mode 100644 index b510642..0000000 --- a/backend/.idea/libraries/Maven__org_codehaus_woodstox_stax2_api_3_1_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml b/backend/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml deleted file mode 100644 index f58bbc1..0000000 --- a/backend/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_hamcrest_hamcrest_library_1_3.xml b/backend/.idea/libraries/Maven__org_hamcrest_hamcrest_library_1_3.xml deleted file mode 100644 index 78dbe45..0000000 --- a/backend/.idea/libraries/Maven__org_hamcrest_hamcrest_library_1_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_hibernate_common_hibernate_commons_annotations_5_0_1_Final.xml b/backend/.idea/libraries/Maven__org_hibernate_common_hibernate_commons_annotations_5_0_1_Final.xml deleted file mode 100644 index ce34f42..0000000 --- a/backend/.idea/libraries/Maven__org_hibernate_common_hibernate_commons_annotations_5_0_1_Final.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_hibernate_hibernate_core_5_2_14_Final.xml b/backend/.idea/libraries/Maven__org_hibernate_hibernate_core_5_2_14_Final.xml deleted file mode 100644 index 3a3af4f..0000000 --- a/backend/.idea/libraries/Maven__org_hibernate_hibernate_core_5_2_14_Final.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_hibernate_javax_persistence_hibernate_jpa_2_1_api_1_0_0_Final.xml b/backend/.idea/libraries/Maven__org_hibernate_javax_persistence_hibernate_jpa_2_1_api_1_0_0_Final.xml deleted file mode 100644 index 6492b2b..0000000 --- a/backend/.idea/libraries/Maven__org_hibernate_javax_persistence_hibernate_jpa_2_1_api_1_0_0_Final.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_hibernate_validator_hibernate_validator_6_0_7_Final.xml b/backend/.idea/libraries/Maven__org_hibernate_validator_hibernate_validator_6_0_7_Final.xml deleted file mode 100644 index a4f8873..0000000 --- a/backend/.idea/libraries/Maven__org_hibernate_validator_hibernate_validator_6_0_7_Final.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_javassist_javassist_3_22_0_GA.xml b/backend/.idea/libraries/Maven__org_javassist_javassist_3_22_0_GA.xml deleted file mode 100644 index ad65915..0000000 --- a/backend/.idea/libraries/Maven__org_javassist_javassist_3_22_0_GA.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_jboss_jandex_2_0_3_Final.xml b/backend/.idea/libraries/Maven__org_jboss_jandex_2_0_3_Final.xml deleted file mode 100644 index b841e21..0000000 --- a/backend/.idea/libraries/Maven__org_jboss_jandex_2_0_3_Final.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_2_Final.xml b/backend/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_2_Final.xml deleted file mode 100644 index 5f7dd01..0000000 --- a/backend/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_2_Final.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_mockito_mockito_core_2_15_0.xml b/backend/.idea/libraries/Maven__org_mockito_mockito_core_2_15_0.xml deleted file mode 100644 index a742a6d..0000000 --- a/backend/.idea/libraries/Maven__org_mockito_mockito_core_2_15_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_objenesis_objenesis_2_6.xml b/backend/.idea/libraries/Maven__org_objenesis_objenesis_2_6.xml deleted file mode 100644 index af41e3b..0000000 --- a/backend/.idea/libraries/Maven__org_objenesis_objenesis_2_6.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_ow2_asm_asm_5_0_4.xml b/backend/.idea/libraries/Maven__org_ow2_asm_asm_5_0_4.xml deleted file mode 100644 index 0bf8cf2..0000000 --- a/backend/.idea/libraries/Maven__org_ow2_asm_asm_5_0_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_skyscreamer_jsonassert_1_5_0.xml b/backend/.idea/libraries/Maven__org_skyscreamer_jsonassert_1_5_0.xml deleted file mode 100644 index c4c54d6..0000000 --- a/backend/.idea/libraries/Maven__org_skyscreamer_jsonassert_1_5_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_25.xml b/backend/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_25.xml deleted file mode 100644 index 6073e53..0000000 --- a/backend/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_25.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_25.xml b/backend/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_25.xml deleted file mode 100644 index 20e8163..0000000 --- a/backend/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_25.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_0_0_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_0_0_RELEASE.xml deleted file mode 100644 index 6f53ce1..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_0_0_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_0_0_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_0_0_RELEASE.xml deleted file mode 100644 index bb1e179..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_0_0_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_devtools_2_0_0_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_devtools_2_0_0_RELEASE.xml deleted file mode 100644 index 11f80c1..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_devtools_2_0_0_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_0_0_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_0_0_RELEASE.xml deleted file mode 100644 index da1a887..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_0_0_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_aop_2_0_0_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_aop_2_0_0_RELEASE.xml deleted file mode 100644 index c479f04..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_aop_2_0_0_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_data_jpa_2_0_0_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_data_jpa_2_0_0_RELEASE.xml deleted file mode 100644 index ed5e1e3..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_data_jpa_2_0_0_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_jdbc_2_0_0_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_jdbc_2_0_0_RELEASE.xml deleted file mode 100644 index 250e96a..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_jdbc_2_0_0_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_0_0_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_0_0_RELEASE.xml deleted file mode 100644 index 440dbd0..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_0_0_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_0_0_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_0_0_RELEASE.xml deleted file mode 100644 index 35e7c76..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_0_0_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_2_0_0_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_2_0_0_RELEASE.xml deleted file mode 100644 index b292009..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_2_0_0_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_0_0_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_0_0_RELEASE.xml deleted file mode 100644 index b3063f3..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_0_0_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_0_0_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_0_0_RELEASE.xml deleted file mode 100644 index d1159de..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_0_0_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_2_0_0_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_2_0_0_RELEASE.xml deleted file mode 100644 index d298a45..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_2_0_0_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_0_0_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_0_0_RELEASE.xml deleted file mode 100644 index 06ed00f..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_0_0_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_data_spring_data_commons_2_0_5_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_data_spring_data_commons_2_0_5_RELEASE.xml deleted file mode 100644 index 85aa25c..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_data_spring_data_commons_2_0_5_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_data_spring_data_jpa_2_0_5_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_data_spring_data_jpa_2_0_5_RELEASE.xml deleted file mode 100644 index f48b9dc..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_data_spring_data_jpa_2_0_5_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_spring_aop_5_0_4_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_spring_aop_5_0_4_RELEASE.xml deleted file mode 100644 index 42e3c72..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_spring_aop_5_0_4_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_spring_aspects_5_0_4_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_spring_aspects_5_0_4_RELEASE.xml deleted file mode 100644 index 1f498dd..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_spring_aspects_5_0_4_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_spring_beans_5_0_4_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_spring_beans_5_0_4_RELEASE.xml deleted file mode 100644 index 9d3252b..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_spring_beans_5_0_4_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_spring_context_5_0_4_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_spring_context_5_0_4_RELEASE.xml deleted file mode 100644 index 24e83c9..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_spring_context_5_0_4_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_spring_core_5_0_4_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_spring_core_5_0_4_RELEASE.xml deleted file mode 100644 index 2784300..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_spring_core_5_0_4_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_spring_expression_5_0_4_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_spring_expression_5_0_4_RELEASE.xml deleted file mode 100644 index 8151535..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_spring_expression_5_0_4_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_spring_jcl_5_0_4_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_spring_jcl_5_0_4_RELEASE.xml deleted file mode 100644 index d0484b5..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_spring_jcl_5_0_4_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_spring_jdbc_5_0_4_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_spring_jdbc_5_0_4_RELEASE.xml deleted file mode 100644 index 8b68fe1..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_spring_jdbc_5_0_4_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_spring_orm_5_0_4_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_spring_orm_5_0_4_RELEASE.xml deleted file mode 100644 index 6e8a76f..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_spring_orm_5_0_4_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_spring_test_5_0_4_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_spring_test_5_0_4_RELEASE.xml deleted file mode 100644 index e8317f4..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_spring_test_5_0_4_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_spring_tx_5_0_4_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_spring_tx_5_0_4_RELEASE.xml deleted file mode 100644 index e6f1139..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_spring_tx_5_0_4_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_spring_web_5_0_4_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_spring_web_5_0_4_RELEASE.xml deleted file mode 100644 index 002d32d..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_spring_web_5_0_4_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_springframework_spring_webmvc_5_0_4_RELEASE.xml b/backend/.idea/libraries/Maven__org_springframework_spring_webmvc_5_0_4_RELEASE.xml deleted file mode 100644 index 0aed43d..0000000 --- a/backend/.idea/libraries/Maven__org_springframework_spring_webmvc_5_0_4_RELEASE.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_xmlunit_xmlunit_core_2_5_1.xml b/backend/.idea/libraries/Maven__org_xmlunit_xmlunit_core_2_5_1.xml deleted file mode 100644 index 474c910..0000000 --- a/backend/.idea/libraries/Maven__org_xmlunit_xmlunit_core_2_5_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/libraries/Maven__org_yaml_snakeyaml_1_19.xml b/backend/.idea/libraries/Maven__org_yaml_snakeyaml_1_19.xml deleted file mode 100644 index 33ccf19..0000000 --- a/backend/.idea/libraries/Maven__org_yaml_snakeyaml_1_19.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/.idea/vcs.xml b/backend/.idea/vcs.xml deleted file mode 100644 index 288b36b..0000000 --- a/backend/.idea/vcs.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/backend/.idea/workspace.xml b/backend/.idea/workspace.xml deleted file mode 100644 index c2b8975..0000000 --- a/backend/.idea/workspace.xml +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1538657724296 - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/README.md b/backend/README.md deleted file mode 100644 index 8e026f1..0000000 --- a/backend/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# TAS_Projekt - -W katalogu src/main/database znajsuje się skrypt SQL, który należy wczytać i uruchomić w bazie MySQL przed uruchomieniem programu. diff --git a/backend/pom.xml b/backend/pom.xml deleted file mode 100644 index c63793b..0000000 --- a/backend/pom.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - 4.0.0 - - TCA - TCA_Project - 1.0-SNAPSHOT - jar - - TakeCareApp Application - Spring Boot Web Application - - - org.springframework.boot - spring-boot-starter-parent - 2.0.0.RELEASE - - - - UTF-8 - UTF-8 - 1.8 - - - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.boot - spring-boot-starter-web - - - - org.springframework.boot - spring-boot-devtools - runtime - - - mysql - mysql-connector-java - runtime - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-starter-tomcat - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - - - org.springframework.security - spring-security-web - 5.1.1.RELEASE - - - org.springframework.security - spring-security-config - 5.1.1.RELEASE - - - org.springframework.security - spring-security-core - 5.1.1.RELEASE - - - javax.xml.bind - jaxb-api - 2.3.0 - - - io.jsonwebtoken - jjwt - 0.9.1 - - - org.projectlombok - lombok - 1.18.16 - provided - - - org.postgresql - postgresql - 42.2.18 - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - \ No newline at end of file diff --git a/backend/src/main/database/dump.sql b/backend/src/main/database/dump.sql deleted file mode 100644 index c17e124..0000000 --- a/backend/src/main/database/dump.sql +++ /dev/null @@ -1,181 +0,0 @@ --- --- PostgreSQL database dump --- - --- Dumped from database version 10.15 --- Dumped by pg_dump version 10.15 - --- Started on 2020-12-19 22:52:46 - -SET statement_timeout = 0; -SET lock_timeout = 0; -SET idle_in_transaction_session_timeout = 0; -SET client_encoding = 'UTF8'; -SET standard_conforming_strings = on; -SELECT pg_catalog.set_config('search_path', '', false); -SET check_function_bodies = false; -SET xmloption = content; -SET client_min_messages = warning; -SET row_security = off; - --- --- TOC entry 1 (class 3079 OID 12924) --- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: --- - -CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; - - --- --- TOC entry 2815 (class 0 OID 0) --- Dependencies: 1 --- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: --- - -COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; - - -SET default_tablespace = ''; - -SET default_with_oids = false; - --- --- TOC entry 196 (class 1259 OID 24577) --- Name: roles; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.roles ( - name character varying(255) NOT NULL -); - - -ALTER TABLE public.roles OWNER TO postgres; - --- --- TOC entry 198 (class 1259 OID 32808) --- Name: users; Type: TABLE; Schema: public; Owner: postgres --- - -CREATE TABLE public.users ( - id integer NOT NULL, - datebirth date NOT NULL, - email character varying(255) NOT NULL, - enabled boolean DEFAULT true, - gender character varying(255) NOT NULL, - login character varying(255) NOT NULL, - name character varying(255) NOT NULL, - password character varying(255) NOT NULL, - surname character varying(255) NOT NULL, - role character varying(255) NOT NULL -); - - -ALTER TABLE public.users OWNER TO postgres; - --- --- TOC entry 197 (class 1259 OID 32806) --- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres --- - -CREATE SEQUENCE public.users_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - -ALTER TABLE public.users_id_seq OWNER TO postgres; - --- --- TOC entry 2816 (class 0 OID 0) --- Dependencies: 197 --- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres --- - -ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id; - - --- --- TOC entry 2675 (class 2604 OID 32811) --- Name: users id; Type: DEFAULT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass); - - --- --- TOC entry 2805 (class 0 OID 24577) --- Dependencies: 196 --- Data for Name: roles; Type: TABLE DATA; Schema: public; Owner: postgres --- - -COPY public.roles (name) FROM stdin; -COMP -IND -\. - - --- --- TOC entry 2807 (class 0 OID 32808) --- Dependencies: 198 --- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: postgres --- - -COPY public.users (id, datebirth, email, enabled, gender, login, name, password, surname, role) FROM stdin; -1 1970-01-01 koko@spoko.com f 0 przyklad Przykład $2a$10$Bgau.SVIBvX5IxOCY.JBBOgJXvXRIEdRIkEhYPPNe/VIGdv51U1W. Przykładowe IND -\. - - --- --- TOC entry 2817 (class 0 OID 0) --- Dependencies: 197 --- Name: users_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres --- - -SELECT pg_catalog.setval('public.users_id_seq', 1, true); - - --- --- TOC entry 2678 (class 2606 OID 24581) --- Name: roles roles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.roles - ADD CONSTRAINT roles_pkey PRIMARY KEY (name); - - --- --- TOC entry 2680 (class 2606 OID 32819) --- Name: users uk_ow0gan20590jrb00upg3va2fn; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.users - ADD CONSTRAINT uk_ow0gan20590jrb00upg3va2fn UNIQUE (login); - - --- --- TOC entry 2682 (class 2606 OID 32817) --- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.users - ADD CONSTRAINT users_pkey PRIMARY KEY (id); - - --- --- TOC entry 2683 (class 2606 OID 32820) --- Name: users fk4c6vlshk8x83ifeoggi3exg3k; Type: FK CONSTRAINT; Schema: public; Owner: postgres --- - -ALTER TABLE ONLY public.users - ADD CONSTRAINT fk4c6vlshk8x83ifeoggi3exg3k FOREIGN KEY (role) REFERENCES public.roles(name); - - --- Completed on 2020-12-19 22:52:46 - --- --- PostgreSQL database dump complete --- - diff --git a/backend/src/main/java/project/DTO/AlgorithmDTO.java b/backend/src/main/java/project/DTO/AlgorithmDTO.java deleted file mode 100644 index f399c6b..0000000 --- a/backend/src/main/java/project/DTO/AlgorithmDTO.java +++ /dev/null @@ -1,23 +0,0 @@ -package project.DTO; - -import lombok.Getter; -import lombok.Setter; - -import javax.persistence.Column; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import java.io.Serializable; - -public class AlgorithmDTO implements Serializable { - - @Getter - @Setter - private int id; - - @Getter - @Setter - private String name; - - public AlgorithmDTO(){} -} diff --git a/backend/src/main/java/project/DTO/CompanyDataDTO.java b/backend/src/main/java/project/DTO/CompanyDataDTO.java deleted file mode 100644 index 02097b1..0000000 --- a/backend/src/main/java/project/DTO/CompanyDataDTO.java +++ /dev/null @@ -1,56 +0,0 @@ -package project.DTO; - -import lombok.Getter; -import lombok.Setter; -import project.model.CompanyData; - -import javax.persistence.*; -import java.io.Serializable; - - -public class CompanyDataDTO implements Serializable { - - @Getter - @Setter - private int id; - - @Getter - @Setter - private String name; - - @Getter - @Setter - private String email; - - @Getter - @Setter - private String address; - - @Getter - @Setter - private double longitude; - - @Getter - @Setter - private double latitude; - - - public CompanyDataDTO(){}; - - public CompanyDataDTO(String name, String email, String address, double longitude, double latitude) { - this.name = name; - this.email = email; - this.address = address; - this.longitude = longitude; - this.latitude = latitude; - } - - public CompanyDataDTO(CompanyData companyData){ - this.id = companyData.getId(); - this.name = companyData.getName(); - this.email = companyData.getEmail(); - this.address = companyData.getAddress(); - this.longitude = companyData.getLongitude(); - this.latitude = companyData.getLatitude(); - }; -} diff --git a/backend/src/main/java/project/DTO/CompanyProfileDTO.java b/backend/src/main/java/project/DTO/CompanyProfileDTO.java deleted file mode 100644 index 12565eb..0000000 --- a/backend/src/main/java/project/DTO/CompanyProfileDTO.java +++ /dev/null @@ -1,36 +0,0 @@ -package project.DTO; - -import lombok.Getter; -import lombok.Setter; -import org.hibernate.annotations.Table; -import project.model.User; - -import javax.persistence.*; -import java.io.Serializable; - - -public class CompanyProfileDTO implements Serializable { - @Getter - @Setter - private int id; - - @Getter - @Setter - private CompanyDataDTO companyData; - - - @Getter - @Setter - private UserDTO userDTO; - - public CompanyProfileDTO(){}; - - public CompanyProfileDTO(CompanyDataDTO companyData, UserDTO userDTO) { - this.companyData = companyData; - this.userDTO = userDTO; - } - - public CompanyProfileDTO(CompanyDataDTO companyData) { - this.companyData = companyData; - } -} diff --git a/backend/src/main/java/project/DTO/PersonalDataDTO.java b/backend/src/main/java/project/DTO/PersonalDataDTO.java deleted file mode 100644 index de5608c..0000000 --- a/backend/src/main/java/project/DTO/PersonalDataDTO.java +++ /dev/null @@ -1,55 +0,0 @@ -package project.DTO; - -import lombok.Getter; -import lombok.Setter; -import project.model.PersonalData; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Date; - - -public class PersonalDataDTO implements Serializable { - - @Getter - @Setter - private int id; - - @Getter - @Setter - private String name; - - @Getter - @Setter - private String surname; - - @Getter - @Setter - private String email; - - @Getter - @Setter - private String gender; - - @Getter - @Setter - private Date datebirth; - - public PersonalDataDTO(){}; - - public PersonalDataDTO(String name, String surname, String email, String gender, Date datebirth) { - this.name = name; - this.surname = surname; - this.email = email; - this.gender = gender; - this.datebirth = datebirth; - } - - public PersonalDataDTO(PersonalData personalData){ - this.name = personalData.getName(); - this.surname = personalData.getSurname(); - this.email = personalData.getEmail(); - this.gender = personalData.getGender(); - this.datebirth = personalData.getDatebirth(); - }; -} diff --git a/backend/src/main/java/project/DTO/PersonalProfileDTO.java b/backend/src/main/java/project/DTO/PersonalProfileDTO.java deleted file mode 100644 index 01dc818..0000000 --- a/backend/src/main/java/project/DTO/PersonalProfileDTO.java +++ /dev/null @@ -1,36 +0,0 @@ -package project.DTO; - -import lombok.Getter; -import lombok.Setter; -import org.hibernate.annotations.Table; -import project.model.User; - -import javax.persistence.*; -import java.io.Serializable; - - -public class PersonalProfileDTO implements Serializable { - - @Getter - @Setter - private int id; - - @Getter - @Setter - private PersonalDataDTO personalDataDTO; - - @Getter - @Setter - private UserDTO userDTO; - - public PersonalProfileDTO(){}; - - public PersonalProfileDTO(PersonalDataDTO personalDataDTO, UserDTO userDTO) { - this.personalDataDTO = personalDataDTO; - this.userDTO = userDTO; - } - - public PersonalProfileDTO(PersonalDataDTO personalDataDTO) { - this.personalDataDTO = personalDataDTO; - } -} diff --git a/backend/src/main/java/project/DTO/PredictionDTO.java b/backend/src/main/java/project/DTO/PredictionDTO.java deleted file mode 100644 index 901f37f..0000000 --- a/backend/src/main/java/project/DTO/PredictionDTO.java +++ /dev/null @@ -1,85 +0,0 @@ -package project.DTO; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import lombok.Getter; -import lombok.Setter; -import project.model.ParameterDouble; -import project.model.ParameterInt; -import project.model.Prediction; -import project.model.User; - -import javax.persistence.*; -import java.io.Serializable; -import java.time.LocalDateTime; -import java.util.List; - -public class PredictionDTO implements Serializable { - - @Getter - @Setter - private int id; - - @Getter - @Setter - private String name; - - @Getter - @Setter - private int user; - - @Getter - @Setter - private int creator; - - @Getter - @Setter - private List parameterDoubles; - - @Getter - @Setter - private List parameterInts; - - @Getter - @Setter - private double resultValue; - - @Getter - @Setter - private String resultText; - - - @Getter - @Setter - private LocalDateTime localDateTime; - - public PredictionDTO(){}; - - public PredictionDTO(PredictionDTO predictionDTO){ - this.id = predictionDTO.getId(); - this.name = predictionDTO.getName(); - this.user = predictionDTO.getUser(); - this.creator = predictionDTO.getCreator(); - this.parameterDoubles = predictionDTO.getParameterDoubles(); - this.parameterInts = predictionDTO.getParameterInts(); - this.resultValue = predictionDTO.getResultValue(); - this.resultText = predictionDTO.getResultText(); - this.localDateTime = predictionDTO.getLocalDateTime(); - - - } - - public PredictionDTO(Prediction prediction){ - this.id = prediction.getId(); - this.name = prediction.getName(); - this.user = prediction.getUser().getId(); - this.creator = prediction.getCreator().getId(); - this.parameterDoubles = prediction.getParameterDoubles(); - this.parameterInts = prediction.getParameterInts(); - this.resultValue = prediction.getResultValue(); - this.resultText = prediction.getResultText(); - this.localDateTime = prediction.getLocalDateTime(); - - - } - -} diff --git a/backend/src/main/java/project/DTO/RoleDTO.java b/backend/src/main/java/project/DTO/RoleDTO.java deleted file mode 100644 index 31f853a..0000000 --- a/backend/src/main/java/project/DTO/RoleDTO.java +++ /dev/null @@ -1,22 +0,0 @@ -package project.DTO; - -import lombok.Getter; -import lombok.Setter; - -import java.io.Serializable; - -public class RoleDTO implements Serializable { - - @Getter - @Setter - private String name; - - public RoleDTO(){ - - } - - public RoleDTO(String name){ - this.name=name; - - } -} diff --git a/backend/src/main/java/project/DTO/UserDTO.java b/backend/src/main/java/project/DTO/UserDTO.java deleted file mode 100644 index 5820ce0..0000000 --- a/backend/src/main/java/project/DTO/UserDTO.java +++ /dev/null @@ -1,60 +0,0 @@ -package project.DTO; - -import lombok.Getter; -import lombok.Setter; -import project.model.User; - -import java.io.Serializable; -import java.util.Date; - - -public class UserDTO implements Serializable { - - - @Getter - @Setter - private int id; - - - @Getter - @Setter - private String login; - - @Getter - @Setter - private String password; - - @Getter - @Setter - private RoleDTO roleDTO; - - - public UserDTO(){ - - } - - public UserDTO(String login, String password) { - this.login = login; - this.password = password; - } - - public UserDTO(UserDTO userDTO) { - - this.login = userDTO.getLogin(); - this.password = userDTO.getPassword(); - this.roleDTO= userDTO.getRoleDTO(); - } - - public UserDTO(User user) { - - this.id = user.getId(); - this.login = user.getLogin(); - this.roleDTO= new RoleDTO(user.getRole().getName()); - - } - - - - - -} diff --git a/backend/src/main/java/project/TakeCareApp.java b/backend/src/main/java/project/TakeCareApp.java deleted file mode 100644 index 62e5b23..0000000 --- a/backend/src/main/java/project/TakeCareApp.java +++ /dev/null @@ -1,25 +0,0 @@ -package project; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; -import org.springframework.data.jpa.repository.config.EnableJpaAuditing; -import org.springframework.data.jpa.repository.config.EnableJpaRepositories; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -import org.springframework.security.crypto.password.PasswordEncoder; - -@SpringBootApplication -@EnableJpaRepositories("project.repositories") - -public class TakeCareApp { - public static void main(String[] args){ - SpringApplication.run(TakeCareApp.class,args); - - - } - - - -} diff --git a/backend/src/main/java/project/config/JwtAuthenticationEntryPoint.java b/backend/src/main/java/project/config/JwtAuthenticationEntryPoint.java deleted file mode 100644 index 492a49a..0000000 --- a/backend/src/main/java/project/config/JwtAuthenticationEntryPoint.java +++ /dev/null @@ -1,22 +0,0 @@ -package project.config; - -import org.springframework.security.core.AuthenticationException; -import org.springframework.security.web.AuthenticationEntryPoint; -import org.springframework.security.web.DefaultRedirectStrategy; -import org.springframework.stereotype.Component; - - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -@Component -public class JwtAuthenticationEntryPoint implements AuthenticationEntryPoint { - - - @Override - public void commence(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AuthenticationException e) throws IOException{ - httpServletResponse.setContentType("application/json"); - new DefaultRedirectStrategy().sendRedirect(httpServletRequest,httpServletResponse,"/api/login"); - } -} diff --git a/backend/src/main/java/project/config/JwtAuthenticationFilter.java b/backend/src/main/java/project/config/JwtAuthenticationFilter.java deleted file mode 100644 index c6faf6b..0000000 --- a/backend/src/main/java/project/config/JwtAuthenticationFilter.java +++ /dev/null @@ -1,79 +0,0 @@ -package project.config; - -import io.jsonwebtoken.ExpiredJwtException; -import io.jsonwebtoken.SignatureException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.stereotype.Component; -import org.springframework.web.filter.OncePerRequestFilter; -import project.services.UserServiceImpl; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - - -import static project.config.SecurityConfiguration.TOKEN_HEADER; -import static project.config.SecurityConfiguration.TOKEN_SCHEME; - -@Component -public class JwtAuthenticationFilter extends OncePerRequestFilter { - - @Autowired - private UserServiceImpl userDetailsService; - - @Autowired - private TokenHelper tokenHelper; - - @Override - protected void doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain) throws IOException, ServletException { - - HttpServletRequest request = httpServletRequest; - HttpServletResponse response = httpServletResponse; - - String header = httpServletRequest.getHeader(TOKEN_HEADER); - String name = null; - String tokenAuth = null; - - if(header!=null && header.startsWith(TOKEN_SCHEME)){ - tokenAuth = header.replace(TOKEN_SCHEME,""); - try{ - name = tokenHelper.getUsernameFromToken(tokenAuth); - } catch (IllegalArgumentException e) { - request.setAttribute("token","token is invalid"); - logger.error("an error occured during getting username from token", e); - } catch (ExpiredJwtException e) { - request.setAttribute("token","token is expired"); - logger.warn("the token is expired and not valid anymore", e); - } catch(SignatureException e){ - request.setAttribute("token","token is invalid"); - logger.error("Authentication Failed. Username or Password not valid."); - } - - }else{ - logger.warn("Couldn't find Bearer String"); - } - if(name != null && SecurityContextHolder.getContext().getAuthentication()==null){ - - UserDetails userDetails = userDetailsService.loadUserByUsername(name); - - if(this.tokenHelper.validateToken(tokenAuth,userDetails)){ - UsernamePasswordAuthenticationToken auth = new UsernamePasswordAuthenticationToken(userDetails,SecurityContextHolder.getContext().getAuthentication(),userDetails.getAuthorities()); - String token = this.tokenHelper.refreshToken(tokenAuth); - - request.setAttribute("token",token); - - SecurityContextHolder.getContext().setAuthentication(auth); - logger.info("Authenticated user "+name); - - } - } - - - filterChain.doFilter(request,response); - - } -} diff --git a/backend/src/main/java/project/config/SecurityConfiguration.java b/backend/src/main/java/project/config/SecurityConfiguration.java deleted file mode 100644 index 4232f69..0000000 --- a/backend/src/main/java/project/config/SecurityConfiguration.java +++ /dev/null @@ -1,116 +0,0 @@ -package project.config; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; -import org.springframework.http.HttpMethod; -import org.springframework.security.authentication.AuthenticationManager; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; -import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; -import org.springframework.security.config.http.SessionCreationPolicy; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; -import org.springframework.web.cors.CorsConfiguration; -import org.springframework.web.cors.CorsConfigurationSource; -import org.springframework.web.cors.UrlBasedCorsConfigurationSource; -import project.services.UserServiceImpl; - -import java.util.Arrays; - -@EnableGlobalMethodSecurity(prePostEnabled = true) -@EnableWebSecurity -@Configuration -@EnableConfigurationProperties -@PropertySource("classpath:remote.properties") -public class SecurityConfiguration extends WebSecurityConfigurerAdapter { - - @Autowired - private UserServiceImpl userDetailsService; - - @Bean - public BCryptPasswordEncoder passwordEncoder() { - BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder(); - return bCryptPasswordEncoder; - } - - @Bean - @Override - public AuthenticationManager authenticationManagerBean() throws Exception { - return super.authenticationManagerBean(); - } - - @Override - public void configure(AuthenticationManagerBuilder authManBuild) throws Exception{ - authManBuild - .userDetailsService(userDetailsService) - .passwordEncoder(passwordEncoder()); - } - - @Override - protected void configure(HttpSecurity http) throws Exception { - - - http.cors().and().csrf().disable() - .authorizeRequests() - .antMatchers("/profile**").hasAnyAuthority("COMP","IND") - .antMatchers("/login").anonymous() - .antMatchers("/register").anonymous() - .antMatchers("/firms/all").anonymous() - .and() - .formLogin() - .loginPage("/login") - .and() - .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS); - http.addFilterBefore(jwtAuthenticationFilter(),UsernamePasswordAuthenticationFilter.class); - - } - - - public static final String TOKEN_HEADER = "Authorization"; - public static final String TOKEN_SCHEME = "Bearer "; - public static final String TOKEN_KEY = "TakeCareApp"; - public static final long TOKEN_VALIDITY = 30*60; - - - - - @Autowired - private JwtAuthenticationEntryPoint unauthHandler; - - @Bean - public JwtAuthenticationFilter jwtAuthenticationFilter(){ - - return new JwtAuthenticationFilter(); - } - - @Bean - public CorsConfigurationSource corsConfigurationSource() { - CorsConfiguration configuration = new CorsConfiguration(); - configuration.setAllowedOrigins(Arrays.asList("*")); - configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS")); - configuration.setAllowedHeaders(Arrays.asList("authorization", "content-type", "x-auth-token")); - configuration.setExposedHeaders(Arrays.asList("x-auth-token")); - UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); - source.registerCorsConfiguration("/api/**", configuration); - return source; - } - - - @Autowired - private AuthenticationManager authenticationManager; - - - - - - - - - - -} diff --git a/backend/src/main/java/project/config/TokenHelper.java b/backend/src/main/java/project/config/TokenHelper.java deleted file mode 100644 index 0da869f..0000000 --- a/backend/src/main/java/project/config/TokenHelper.java +++ /dev/null @@ -1,106 +0,0 @@ -package project.config; - -import io.jsonwebtoken.Claims; -import io.jsonwebtoken.Jwts; -import io.jsonwebtoken.SignatureAlgorithm; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.stereotype.Component; - -import project.model.User; - -import java.io.Serializable; -import java.util.*; - -import static project.config.SecurityConfiguration.TOKEN_KEY; -import static project.config.SecurityConfiguration.TOKEN_VALIDITY; - -@Component -public class TokenHelper implements Serializable { - - - //Generate Token with userID,role,name - - public String generateToken(User user) { - Claims claims = Jwts.claims().setSubject(user.getLogin()); - claims.put("userId",user.getId()); - claims.put("role",user.getRole().getName()); - - return Jwts.builder() - .setClaims(claims) - .setIssuer("http://localhost:8080") - .setIssuedAt(new Date(System.currentTimeMillis())) - .setExpiration(new Date(System.currentTimeMillis()+TOKEN_VALIDITY*1000)) - .signWith(SignatureAlgorithm.HS256,TOKEN_KEY) - .compact(); - } - - public String refreshToken(String token){ - Claims claims = getAllClaimsFromToken(token); - return Jwts.builder() - .setClaims(claims) - .setIssuer("http://localhost:8080") - .setIssuedAt(new Date(System.currentTimeMillis())) - .setExpiration(new Date(System.currentTimeMillis()+TOKEN_VALIDITY*1000)) - .signWith(SignatureAlgorithm.HS256,TOKEN_KEY) - .compact(); - - } - - public Claims getAllClaimsFromToken(String token){ - - return Jwts.parser() - .setSigningKey(TOKEN_KEY) - .parseClaimsJws(token) - .getBody(); - } - - - - public String getUsernameFromToken(String token){ - - Claims claims = getAllClaimsFromToken(token); - return claims.getSubject(); - } - - public String getAuthoritiesFromToken(String token){ - Claims claims = getAllClaimsFromToken(token); - String auth = (String)claims.get("role"); - return auth; - } - - public boolean validateToken(String token,UserDetails userDetails){ - String userName = getUsernameFromToken(token); - String tokenAuth = getAuthoritiesFromToken(token); - String userDetailsAuth = userDetails.getAuthorities() - .stream() - .findFirst() - .get() - .getAuthority(); - - if(userName.contentEquals(userDetails.getUsername()) - && !isTokenExpired(token) - && tokenAuth.contentEquals(userDetailsAuth)){ - return true; - } - else{ - return false; - } - } - - private Date getExpirationDate(String token) { - - Claims claims = getAllClaimsFromToken(token); - return claims.getExpiration(); - } - - public boolean isTokenExpired(String token){ - Date currentTime = new Date(System.currentTimeMillis()); - Date tokenTime = getExpirationDate(token); - if(currentTime.after(tokenTime)){ - return true; - } - else return false; - } - - -} diff --git a/backend/src/main/java/project/controllers/AuthenticationController.java b/backend/src/main/java/project/controllers/AuthenticationController.java deleted file mode 100644 index 3c745f6..0000000 --- a/backend/src/main/java/project/controllers/AuthenticationController.java +++ /dev/null @@ -1,103 +0,0 @@ -package project.controllers; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.security.authentication.AuthenticationManager; -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -import org.springframework.web.bind.annotation.*; -import project.DTO.UserDTO; -import project.config.TokenHelper; - -import project.model.CompanyProfile; -import project.model.PersonalProfile; -import project.model.User; -import project.services.CompanyProfileService; -import project.services.PersonalProfileService; -import project.services.UserService; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; - -@CrossOrigin(origins = "http://localhost:4200") -@RestController -@RequestMapping("/api") -public class AuthenticationController { - - @Autowired - private AuthenticationManager authenticationManager; - - @Autowired - TokenHelper tokenHelper; - - @Autowired - UserService userService; - - @Autowired - PersonalProfileService personalProfileService; - - @Autowired - CompanyProfileService companyProfileService; - - @Autowired - private BCryptPasswordEncoder bCryptPasswordEncoder; - - @PreAuthorize("isAnonymous()") - @RequestMapping(value = "/login",method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public ResponseEntity> generateToken(@RequestBody UserDTO loginForm, - HttpServletRequest request, - HttpServletResponse httpServletResponse){ - - - String token=null; - Map map = new HashMap<>(); - - - Optional userFromDatabase = this.userService.getUsersByLogin(loginForm.getLogin()); - - Authentication authentication =null; - - - if(userFromDatabase.isPresent()){ - - authentication = this.authenticationManager - .authenticate(new UsernamePasswordAuthenticationToken(loginForm.getLogin(),loginForm.getPassword())); - - SecurityContextHolder.getContext().setAuthentication(authentication); - - User authUser = userFromDatabase.get(); - token = this.tokenHelper.generateToken(authUser); - map.put("token",token); - if(authUser.getRole().getName()=="COMP"){ - CompanyProfile companyProfile = companyProfileService.getCompanyProfileByUserId(authUser.getId()); - map.put("message","Jesteś zalogowany jako "+companyProfile.getCompanyData().getName()); - - }else if(authUser.getRole().getName()=="IND"){ - PersonalProfile personalProfile = personalProfileService.getPersonalProfileByUserId(authUser.getId()); - map.put("message","Jesteś zalogowany jako "+personalProfile.getPersonalData().getName()+" "+personalProfile.getPersonalData().getSurname()); - - } - - return new ResponseEntity<>(map, HttpStatus.OK); - } - else{ - map.put("message","Niepoprawne login lub hasło"); - map.put("token",token); - return new ResponseEntity<>(map, HttpStatus.UNAUTHORIZED); - - } - - - - } - -} diff --git a/backend/src/main/java/project/controllers/CompanyProfileController.java b/backend/src/main/java/project/controllers/CompanyProfileController.java deleted file mode 100644 index 2c1a654..0000000 --- a/backend/src/main/java/project/controllers/CompanyProfileController.java +++ /dev/null @@ -1,59 +0,0 @@ -package project.controllers; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; -import project.DTO.CompanyProfileDTO; -import project.DTO.PredictionDTO; -import project.model.CompanyProfile; -import project.services.CompanyProfileService; -import project.services.GeneratorDTO; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@RestController -@RequestMapping("/api/firms") -public class CompanyProfileController { - @Autowired - private CompanyProfileService companyProfileService; - - @Autowired - private GeneratorDTO generatorDTO; - - - @PreAuthorize("isAnonymous()") - @RequestMapping(value = "/all",method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public ResponseEntity> getAllCompanies(HttpServletRequest request, - HttpServletResponse httpServletResponse){ - - Map map = new HashMap<>(); -// map.put("companies",new Integer(1)); -// return new ResponseEntity<>(map, HttpStatus.OK); - try{ - List companyProfileDTOS = new ArrayList<>(); - for (CompanyProfile cp:companyProfileService.getAllCompanies()) { - companyProfileDTOS.add(generatorDTO.generateCompanyProfileDTO(cp)); - - } - map.put("companies",companyProfileDTOS); - return new ResponseEntity<>(map, HttpStatus.OK); - }catch(Exception e){ - map.put("companies",null); - map.put("message","Błąd zapytania"); - return new ResponseEntity<>(map, HttpStatus.BAD_REQUEST); - } - - - } -} diff --git a/backend/src/main/java/project/controllers/ControllersExceptionHandler.java b/backend/src/main/java/project/controllers/ControllersExceptionHandler.java deleted file mode 100644 index 017c9ec..0000000 --- a/backend/src/main/java/project/controllers/ControllersExceptionHandler.java +++ /dev/null @@ -1,22 +0,0 @@ -package project.controllers; - -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.http.converter.HttpMessageNotReadableException; -import org.springframework.web.bind.annotation.ControllerAdvice; -import org.springframework.web.bind.annotation.ExceptionHandler; - -import java.util.HashMap; -import java.util.Map; - -@ControllerAdvice -public class ControllersExceptionHandler { - - @ExceptionHandler(HttpMessageNotReadableException.class) - public ResponseEntity> handle(){ - Map map = new HashMap<>(); - map.put("message","Wprowadzono niepoprawny typ danych"); - - return new ResponseEntity>(map,HttpStatus.BAD_REQUEST); - } -} diff --git a/backend/src/main/java/project/controllers/PredictionController.java b/backend/src/main/java/project/controllers/PredictionController.java deleted file mode 100644 index 4b14f64..0000000 --- a/backend/src/main/java/project/controllers/PredictionController.java +++ /dev/null @@ -1,229 +0,0 @@ -package project.controllers; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.web.bind.annotation.*; -import project.DTO.PredictionDTO; -import project.config.TokenHelper; -import project.model.CompanyProfile; -import project.model.PersonalProfile; -import project.model.Prediction; -import project.model.User; -import project.services.*; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; - -@RestController -@RequestMapping("/api/prediction") -public class PredictionController { - - - @Autowired - private PredictionService predictionService; - @Autowired - private UserService userService; - @Autowired - private PersonalProfileService personalProfileService; - - @Autowired - private CompanyProfileService companyProfileService; - - @Autowired - private GeneratorDTO generatorDTO; - - @Autowired - private TokenHelper tokenHelper; - - - - - @PreAuthorize("hasAnyAuthority('COMP','IND')") - @RequestMapping(value = "/save",method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public Map addPrediction(@RequestBody @Valid @NotNull PredictionDTO predictionDTO, - HttpServletRequest request, - HttpServletResponse httpServletResponse){ - - - Map map = new HashMap<>(); - UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); - Optional user = userService.getUsersByLogin(userDetails.getUsername()); - - if (user.isPresent()) { - User currentUser = user.get(); - - Object token = request.getAttribute("token"); - - map.put("token", tokenHelper.refreshToken(token.toString())); - - if(currentUser.getRole().getName()=="COMP"){ - CompanyProfile companyProfile = companyProfileService.getCompanyProfileByUserId(currentUser.getId()); - PersonalProfile personalProfile = personalProfileService.getPersonalProfileByUserId(predictionDTO.getUser()); - if(!companyProfileService.isCompanyAuthorized(companyProfile.getId(),personalProfile.getId())){ - httpServletResponse.setStatus(400); - }else{ - predictionDTO.setUser(predictionDTO.getUser()); - predictionDTO.setCreator(currentUser.getId()); - } - - }else{ - predictionDTO.setUser(currentUser.getId()); - predictionDTO.setCreator(currentUser.getId()); - } - - - - Prediction predictionSaved = this.predictionService.savePrediction(predictionDTO); - if (predictionSaved!=null){ - map.put("prediction", new PredictionDTO(predictionSaved)); - httpServletResponse.setStatus(200); - }else{ - map.put("prediction", null); - httpServletResponse.setStatus(400); - } - - } - - else { - - map.put("message", "Błąd autoryzacji"); - httpServletResponse.setStatus(401); - - } - return map; - } - - @PreAuthorize("hasAnyAuthority('COMP','IND')") - @RequestMapping(value = "/get/{id}",method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity> getPrediction(@PathVariable int id, - HttpServletRequest request, - HttpServletResponse httpServletResponse){ - - - Map map = new HashMap<>(); - UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); - Optional user = userService.getUsersByLogin(userDetails.getUsername()); - - if (user.isPresent()) { - User currentUser = user.get(); - - Object token = request.getAttribute("token"); - - map.put("token", tokenHelper.refreshToken(token.toString())); - - Prediction prediction = this.predictionService.getPrediction(id); - if (prediction!=null){ - if(prediction.getUser().getId()==currentUser.getId() || prediction.getCreator().getId()==currentUser.getId()){ - map.put("prediction", new PredictionDTO(prediction)); - return new ResponseEntity>(map, HttpStatus.OK); - }else{ - map.put("prediction", null); - return new ResponseEntity>(map, HttpStatus.BAD_REQUEST); - } - - }else{ - map.put("prediction", null); - return new ResponseEntity>(map, HttpStatus.BAD_REQUEST); - } - - } - - else { - - map.put("message", "Błąd autoryzacji"); - return new ResponseEntity>(map, HttpStatus.UNAUTHORIZED); - - } - - } - - @PreAuthorize("hasAnyAuthority('COMP','IND')") - @RequestMapping(value = "delete/{id}",method = RequestMethod.DELETE,produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity> deletePrediction(@PathVariable int id,HttpServletRequest request, - HttpServletResponse httpServletResponse){ - - Map map = new HashMap<>(); - UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); - Optional user = userService.getUsersByLogin(userDetails.getUsername()); - - if (user.isPresent()) { - User currentUser = user.get(); - - Object token = request.getAttribute("token"); - - map.put("token", tokenHelper.refreshToken(token.toString())); - - - boolean isDeleted = this.predictionService.deletePrediction(currentUser.getId(),id); - if (isDeleted){ - - return new ResponseEntity>(map, HttpStatus.OK); - }else{ - - return new ResponseEntity>(map, HttpStatus.BAD_REQUEST); - } - - } - - else { - - map.put("message", "Błąd autoryzacji"); - return new ResponseEntity>(map, HttpStatus.UNAUTHORIZED); - - } - - } - - - @PreAuthorize("hasAnyAuthority('IND')") - @RequestMapping(value = "/usersPredictions/ind",method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity> getUsersPredictions(HttpServletRequest request, - HttpServletResponse httpServletResponse){ - - Map map = new HashMap<>(); - UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); - Optional user = userService.getUsersByLogin(userDetails.getUsername()); - - if (user.isPresent()) { - User currentUser = user.get(); - - Object token = request.getAttribute("token"); - - map.put("token", tokenHelper.refreshToken(token.toString())); - - List predictions = this.predictionService.getAllPredictionsForUser(currentUser.getId()); - if (predictions!=null){ - map.put("predictions", this.generatorDTO.generatePredictionsDTO(predictions)); - return new ResponseEntity>(map, HttpStatus.OK); - }else{ - map.put("predictions", null); - return new ResponseEntity>(map, HttpStatus.BAD_REQUEST); - } - - } - - else { - - map.put("message", "Błąd autoryzacji"); - return new ResponseEntity>(map, HttpStatus.UNAUTHORIZED); - - } - - - } - - - -} diff --git a/backend/src/main/java/project/controllers/UserController.java b/backend/src/main/java/project/controllers/UserController.java deleted file mode 100644 index eeed694..0000000 --- a/backend/src/main/java/project/controllers/UserController.java +++ /dev/null @@ -1,217 +0,0 @@ -package project.controllers; - -import com.fasterxml.jackson.databind.ObjectMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.type.filter.RegexPatternTypeFilter; -import org.springframework.data.domain.PageRequest; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -import org.springframework.web.bind.annotation.*; -import project.DTO.PersonalDataDTO; -import project.DTO.PersonalProfileDTO; -import project.DTO.UserDTO; -import project.config.TokenHelper; -import project.model.*; -import project.services.*; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import java.util.*; -import java.util.regex.Pattern; - - -@CrossOrigin(origins = "http://localhost:4200") - -@RestController -@RequestMapping("/api") -public class UserController { - - @Autowired - private UserService userService; - @Autowired - private RoleService roleService; - @Autowired - private GeneratorDTO generatorDTO; - @Autowired - private PersonalDataService personalDataService; - - @Autowired - private PersonalProfileService personalProfileService; - - @Autowired - private TokenHelper tokenHelper; - - - @Autowired - private BCryptPasswordEncoder bCryptPasswordEncoder; - - @PreAuthorize("isAnonymous()") - @RequestMapping(value = "/register",method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public ResponseEntity> addUser(@RequestBody @Valid @NotNull PersonalProfileDTO personalProfileDTO, - HttpServletRequest request, - HttpServletResponse httpServletResponse){ - - ObjectMapper mapper = new ObjectMapper(); - - - Map map = new HashMap<>(); - - Object token = request.getAttribute("token"); - map.put("token",token); - - Optional users = this.userService.getUsersByLogin(personalProfileDTO.getUserDTO().getLogin()); - if(users.isPresent()){ - map.put("message","Wprowadzony użytkownik już istnieje"); - return new ResponseEntity>(map, HttpStatus.BAD_REQUEST); - } - - else if(!userService.checkIfCorrect(personalProfileDTO,false)) { - map.put("message", "Niepoprawny login lub hasło"); - return new ResponseEntity>(map, HttpStatus.UNAUTHORIZED); - } - - else{ - - User registerUser = new User(); - PersonalData personalData = new PersonalData(); - - personalData.setName(personalProfileDTO.getPersonalDataDTO().getName()); - personalData.setSurname(personalProfileDTO.getPersonalDataDTO().getSurname()); - personalData.setEmail(personalProfileDTO.getPersonalDataDTO().getEmail()); - personalData.setGender(personalProfileDTO.getPersonalDataDTO().getGender()); - personalData.setDatebirth(personalProfileDTO.getPersonalDataDTO().getDatebirth()); - - registerUser.setLogin(personalProfileDTO.getUserDTO().getLogin()); - - String pass = this.bCryptPasswordEncoder.encode(personalProfileDTO.getUserDTO().getPassword()); - - registerUser.setPassword(pass); - - Role role = this.roleService.getRoleByName(personalProfileDTO.getUserDTO().getRoleDTO().getName()); - registerUser.setRole(role); - - try { - User userSaved = this.userService.addUser(registerUser); - PersonalData personalDataSaved = this.personalDataService.addPersonalData(personalData); - - PersonalProfile personalProfile = new PersonalProfile(personalDataSaved, userSaved); - this.personalProfileService.addPersonalProfile(personalProfile); - - map.put("message", "Zostałeś pomyślnie zarejestrowany"); - return new ResponseEntity>(map, HttpStatus.OK); - }catch (Exception e){ - map.put("message", "Błąd rejestracji"); - - return new ResponseEntity>(map, HttpStatus.BAD_REQUEST); - } - - } - - } - - - - - - - @PreAuthorize("hasAnyAuthority('COMP','IND')") - @RequestMapping(value="/profile",method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public ResponseEntity> getMyProfile(HttpServletRequest request,HttpServletResponse httpServletResponse){ - - - Map map = new HashMap<>(); - UserDetails userDetails = (UserDetails)SecurityContextHolder.getContext().getAuthentication().getPrincipal(); - Optional user = userService.getUsersByLogin(userDetails.getUsername()); - - if (user.isPresent()) { - User currentUser = user.get(); - - PersonalProfile personalProfile= personalProfileService.getPersonalProfileByUserId(currentUser.getId()); - - - Object token = request.getAttribute("token"); - - map.put("token", tokenHelper.refreshToken(token.toString())); - - map.put("profil", this.generatorDTO.generatePersonalProfileDTO(personalProfile)); - return new ResponseEntity<>(map,HttpStatus.OK); - - } - - else { - - map.put("message", "Profil nie istnieje"); - return new ResponseEntity<>(map,HttpStatus.NOT_FOUND); - - } - - - } - - @PreAuthorize("hasAnyAuthority('COMP','IND')") - @RequestMapping(value="/profile",method = RequestMethod.PUT,produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public ResponseEntity> editMyProfile(@RequestBody @Valid @NotNull PersonalProfileDTO personalProfileDTO,HttpServletRequest request,HttpServletResponse httpServletResponse){ - - Map map = new HashMap<>(); - UserDetails userDetails = (UserDetails)SecurityContextHolder.getContext().getAuthentication().getPrincipal(); - Optional user = userService.getUsersByLogin(userDetails.getUsername()); - - if (user.isPresent()) { - User currentUser = user.get(); - - PersonalProfile personalProfile = this.personalProfileService.getPersonalProfileByUserId(currentUser.getId()); - PersonalData personalData = personalProfile.getPersonalData(); - - Object token = request.getAttribute("token"); - - map.put("token", tokenHelper.refreshToken(token.toString())); - - if(userService.checkIfCorrect(personalProfileDTO,true)){ - - PersonalDataDTO personalDataDTO = personalProfileDTO.getPersonalDataDTO(); - - personalData.setName(personalDataDTO.getName()); - personalData.setSurname(personalDataDTO.getSurname()); - personalData.setDatebirth(personalDataDTO.getDatebirth()); - personalData.setGender(personalDataDTO.getGender()); - personalData.setEmail(personalDataDTO.getEmail()); - - PersonalData personalDataSaved = personalDataService.addPersonalData(personalData); - personalProfile.setPersonalData(personalDataSaved); - - PersonalProfile personalProfileSaved = personalProfileService.addPersonalProfile(personalProfile); - map.put("profil", this.generatorDTO.generatePersonalProfileDTO(personalProfileSaved)); - return new ResponseEntity<>(map,HttpStatus.OK); - - } - else{ - map.put("message", "Błędne dane"); - return new ResponseEntity<>(map,HttpStatus.BAD_REQUEST); - } - - } - - else { - - map.put("message", "Profil nie istnieje"); - return new ResponseEntity<>(map,HttpStatus.NOT_FOUND); - - } - - - } - - - - -} diff --git a/backend/src/main/java/project/model/Algorithm.java b/backend/src/main/java/project/model/Algorithm.java deleted file mode 100644 index 5833250..0000000 --- a/backend/src/main/java/project/model/Algorithm.java +++ /dev/null @@ -1,26 +0,0 @@ -package project.model; - -import lombok.Getter; -import lombok.Setter; - -import javax.persistence.*; -import java.io.Serializable; - -@Entity -@Table(name="Algorithm") -public class Algorithm implements Serializable { - - @Getter - @Setter - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name="id",nullable=false) - private int id; - - @Getter - @Setter - @Column(name="name") - private String name; - - public Algorithm(){} -} diff --git a/backend/src/main/java/project/model/CompanyData.java b/backend/src/main/java/project/model/CompanyData.java deleted file mode 100644 index 825bcbc..0000000 --- a/backend/src/main/java/project/model/CompanyData.java +++ /dev/null @@ -1,52 +0,0 @@ -package project.model; - -import lombok.Getter; -import lombok.Setter; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Date; -@Entity -@Table(name="CompanyData") -public class CompanyData implements Serializable { - - @Getter - @Setter - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name="id",nullable = false) - private int id; - - @Getter - @Setter - @Column(name="name",nullable = false) - private String name; - - @Getter - @Setter - @Column(name="email",nullable = false) - private String email; - - @Getter - @Setter - @Column(name="address",nullable = false) - private String address; - - @Getter - @Setter - @Column(name="longitude",nullable = false) - private double longitude; - - @Getter - @Setter - @Column(name="latitude",nullable = false) - private double latitude; - - @Getter - @Setter - @OneToOne(mappedBy = "companyData") - private CompanyProfile companyProfile; - - public CompanyData(){}; - -} diff --git a/backend/src/main/java/project/model/CompanyProfile.java b/backend/src/main/java/project/model/CompanyProfile.java deleted file mode 100644 index 3e7abaa..0000000 --- a/backend/src/main/java/project/model/CompanyProfile.java +++ /dev/null @@ -1,60 +0,0 @@ -package project.model; - -import lombok.Getter; -import lombok.Setter; - - -import javax.persistence.*; -import java.io.Serializable; -import java.util.List; - -@Entity -@Table(name="CompanyProfile") -public class CompanyProfile implements Serializable { - @Getter - @Setter - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name="id",nullable = false) - private int id; - - @Getter - @Setter - @OneToOne(cascade=CascadeType.PERSIST) - @JoinColumn(name="companyDataId",referencedColumnName = "id") - private CompanyData companyData; - - @Getter - @Setter - @ManyToMany - @JoinTable( - name="company_part", - joinColumns = @JoinColumn(name = "companyId"), - inverseJoinColumns = @JoinColumn(name="personalId") - ) - private List personalProfiles; - - - @Getter - @Setter - @OneToOne(cascade=CascadeType.PERSIST) - @JoinColumn(name="userId",referencedColumnName = "id") - private User user; - - public CompanyProfile(){}; - - public CompanyProfile(CompanyData companyData, List personalProfiles, User user) { - this.companyData = companyData; - this.personalProfiles = personalProfiles; - this.user = user; - } - - public CompanyProfile(CompanyData companyData, User user) { - this.companyData = companyData; - this.user = user; - } - - public CompanyProfile(CompanyData companyData) { - this.companyData = companyData; - } -} diff --git a/backend/src/main/java/project/model/CustomUserDetails.java b/backend/src/main/java/project/model/CustomUserDetails.java deleted file mode 100644 index e7b7bf0..0000000 --- a/backend/src/main/java/project/model/CustomUserDetails.java +++ /dev/null @@ -1,53 +0,0 @@ -package project.model; - -import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.authority.SimpleGrantedAuthority; -import org.springframework.security.core.userdetails.UserDetails; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -public class CustomUserDetails extends User implements UserDetails { - - public CustomUserDetails(User user){ - super(user); - } - - @Override - public Collection getAuthorities() { - List authorityList = new ArrayList(); - authorityList.add(new SimpleGrantedAuthority(getRole().getName())); - return null; - } - - @Override - public String getUsername() { - return super.getLogin(); - } - - @Override - public String getPassword() { - return super.getPassword(); - } - - @Override - public boolean isAccountNonExpired() { - return false; - } - - @Override - public boolean isEnabled() { - return super.isEnabled(); - } - - @Override - public boolean isAccountNonLocked() { - return false; - } - - @Override - public boolean isCredentialsNonExpired() { - return false; - } -} diff --git a/backend/src/main/java/project/model/ParameterDouble.java b/backend/src/main/java/project/model/ParameterDouble.java deleted file mode 100644 index 182a31f..0000000 --- a/backend/src/main/java/project/model/ParameterDouble.java +++ /dev/null @@ -1,44 +0,0 @@ -package project.model; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import lombok.Getter; -import lombok.Setter; - -import javax.persistence.*; -import java.io.Serializable; - -@Entity -@Table(name="ParameterDouble") -public class ParameterDouble implements Serializable { - - @Getter - @Setter - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name="id",nullable=false) - private int id; - - @Getter - @Setter - @Column(name="value",nullable=false) - private double value; - - @Getter - @Setter - @ManyToOne - @JoinColumn(name = "prediction",referencedColumnName = "id") -// @JsonIgnoreProperties({"name", "user","parameterDoubles","parameterInts","resultValue","resultText"}) - @JsonIgnore - private Prediction prediction; - - public ParameterDouble(double value){ - this.value=value; - } - public ParameterDouble(Prediction prediction,double value){ - this.prediction=prediction; - this.value=value; - } - public ParameterDouble(){} - -} diff --git a/backend/src/main/java/project/model/ParameterInt.java b/backend/src/main/java/project/model/ParameterInt.java deleted file mode 100644 index 88d334e..0000000 --- a/backend/src/main/java/project/model/ParameterInt.java +++ /dev/null @@ -1,41 +0,0 @@ -package project.model; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import lombok.Getter; -import lombok.Setter; - -import javax.persistence.*; -import java.io.Serializable; - -@Entity -@Table(name="ParameterInt") -public class ParameterInt implements Serializable { - - @Getter - @Setter - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name="id",nullable=false) - private int id; - - @Getter - @Setter - @Column(name="value",nullable=false) - private int value; - - @Getter - @Setter - @ManyToOne - @JoinColumn(name="prediction",referencedColumnName = "id") -// @JsonIgnoreProperties({"name", "user","parameterDoubles","parameterInts","resultValue","resultText"}) - @JsonIgnore - private Prediction prediction; - - public ParameterInt(int value){ - this.value=value; - } - - public ParameterInt(){} - -} diff --git a/backend/src/main/java/project/model/PersonalData.java b/backend/src/main/java/project/model/PersonalData.java deleted file mode 100644 index f2307b3..0000000 --- a/backend/src/main/java/project/model/PersonalData.java +++ /dev/null @@ -1,54 +0,0 @@ -package project.model; - -import lombok.Getter; -import lombok.Setter; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Date; - -@Entity -@Table(name="PersonalData") -public class PersonalData implements Serializable { - - @Getter - @Setter - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name="id",nullable = false) - private int id; - - @Getter - @Setter - @Column(name="name",nullable = false) - private String name; - - @Getter - @Setter - @Column(name="surname",nullable = false) - private String surname; - - @Getter - @Setter - @Column(name="email",nullable = false) - private String email; - - @Getter - @Setter - @Column(name="gender",nullable = false) - private String gender; - - @Getter - @Setter - @Column(name="datebirth",nullable = false) - @Basic - @Temporal(TemporalType.DATE) - private Date datebirth; - - @Getter - @Setter - @OneToOne(mappedBy = "personalData") - private PersonalProfile personalProfile; - - public PersonalData(){}; -} diff --git a/backend/src/main/java/project/model/PersonalProfile.java b/backend/src/main/java/project/model/PersonalProfile.java deleted file mode 100644 index a24db39..0000000 --- a/backend/src/main/java/project/model/PersonalProfile.java +++ /dev/null @@ -1,58 +0,0 @@ -package project.model; - -import lombok.Getter; -import lombok.Setter; - - -import javax.persistence.*; -import java.io.Serializable; -import java.util.List; - -@Entity -@Table(name="PersonalProfile") -public class PersonalProfile implements Serializable { - - @Getter - @Setter - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name="id",nullable=false) - private int id; - - @Getter - @Setter - @OneToOne(cascade=CascadeType.PERSIST) - @JoinColumn(name="personalDateId",referencedColumnName = "id") - private PersonalData personalData; - - @Getter - @Setter - @OneToOne(cascade=CascadeType.PERSIST) - @JoinColumn(name="userId",referencedColumnName = "id") - private User user; - - @Getter - @Setter - @ManyToMany(mappedBy = "personalProfiles") - List companyProfileList; - - - - - public PersonalProfile(){}; - - public PersonalProfile(PersonalData personalData, User user) { - this.personalData = personalData; - this.user = user; - } - - public PersonalProfile(PersonalData personalData) { - this.personalData = personalData; - } - - public PersonalProfile(PersonalData personalData, User user, List companyProfileList) { - this.personalData = personalData; - this.user = user; - this.companyProfileList = companyProfileList; - } -} diff --git a/backend/src/main/java/project/model/Prediction.java b/backend/src/main/java/project/model/Prediction.java deleted file mode 100644 index 2702afd..0000000 --- a/backend/src/main/java/project/model/Prediction.java +++ /dev/null @@ -1,83 +0,0 @@ -package project.model; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import lombok.Getter; -import lombok.Setter; -import project.DTO.PredictionDTO; - -import javax.persistence.*; -import java.io.Serializable; -import java.time.LocalDateTime; -import java.util.Date; -import java.util.List; - -@Entity -@Table(name="Prediction") -public class Prediction implements Serializable { - - @Getter - @Setter - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name="id",nullable = false) - private int id; - - @Getter - @Setter - @Column(name="name",nullable=false) - private String name; - - @Getter - @Setter - @ManyToOne - @JoinColumn(name = "user_id", referencedColumnName = "id") - private User user; - - @Getter - @Setter - @ManyToOne - @JoinColumn(name = "creator_id", referencedColumnName = "id") - private User creator; - - - @Getter - @Setter - @OneToMany(mappedBy = "prediction",orphanRemoval = true, cascade = CascadeType.PERSIST) - @JsonIgnore - private List parameterDoubles; - - - @Getter - @Setter - @OneToMany(mappedBy = "prediction",orphanRemoval = true, cascade = CascadeType.PERSIST) - @JsonIgnore - private List parameterInts; - - @Getter - @Setter - @Column(name="resultValue",nullable = false) - private double resultValue; - - @Getter - @Setter - @Column(name="date",nullable = false) - private LocalDateTime localDateTime; - - - @Getter - @Setter - @Column(name="resultText",nullable = false) - private String resultText; - - public Prediction(){}; - public Prediction(PredictionDTO predictionDTO){ - this.name = predictionDTO.getName(); - this.parameterDoubles = predictionDTO.getParameterDoubles(); - this.parameterInts = predictionDTO.getParameterInts(); - this.resultValue = predictionDTO.getResultValue(); - this.resultText = predictionDTO.getResultText(); - } - - - -} diff --git a/backend/src/main/java/project/model/Role.java b/backend/src/main/java/project/model/Role.java deleted file mode 100644 index e48868c..0000000 --- a/backend/src/main/java/project/model/Role.java +++ /dev/null @@ -1,45 +0,0 @@ -package project.model; - - -import com.fasterxml.jackson.annotation.JsonIgnore; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.List; -import java.util.Set; - -@Entity -@Table(name="Roles") -public class Role implements Serializable { - - - @Id - @Column(name="name",nullable = false) - private String name; - - @OneToMany(mappedBy = "role",orphanRemoval = true, cascade = CascadeType.PERSIST) - @JsonIgnore - private List user; - - - - - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public List getUser() { - return user; - } - - public void setUser(List user) { - this.user = user; - } - - -} diff --git a/backend/src/main/java/project/model/User.java b/backend/src/main/java/project/model/User.java deleted file mode 100644 index dab0f48..0000000 --- a/backend/src/main/java/project/model/User.java +++ /dev/null @@ -1,99 +0,0 @@ -package project.model; - - -import com.fasterxml.jackson.annotation.JsonIdentityInfo; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.ObjectIdGenerators; -import lombok.Getter; -import lombok.Setter; -import org.springframework.security.core.userdetails.UserDetails; - -import javax.persistence.*; -import java.io.Serializable; -import java.util.Date; -import java.util.List; -import java.util.Set; - -@Entity -@Table(name="Users") -public class User implements Serializable { - - @Getter - @Setter - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name="id",nullable = false) - private int id; - - @Getter - @Setter - @Column(name="login",nullable = false,unique = true) - private String login; - - @Getter - @Setter - @Column(name="password",nullable = false) - private String password; - - @Getter - @Setter - @Column(name="enabled",columnDefinition = "boolean default true") - private boolean enabled; - - @Getter - @Setter - @ManyToOne - @JoinColumn(name = "role",nullable=false) - private Role role; - - @Getter - @Setter - @OneToMany(mappedBy = "user",orphanRemoval = true,cascade = CascadeType.PERSIST) - @JsonIgnore - private List predictions; - - @Getter - @Setter - @OneToMany(mappedBy = "creator",orphanRemoval = true,cascade = CascadeType.PERSIST) - @JsonIgnore - private List predictionsCreated; - - @Getter - @Setter - @OneToOne(mappedBy = "user") - private CompanyProfile companyProfile; - - @Getter - @Setter - @OneToOne(mappedBy = "user") - private PersonalProfile personalProfile; - - public User(){ - - } - - public User(String name, String surname, String email, String gender, Date datebirth, String login, String password, Role role) { - - this.login = login; - this.password = password; - this.role = role; - } - - public User(User user) { - - this.login = user.getLogin(); - this.password = user.getPassword(); - this.role = user.getRole(); - this.predictions = user.getPredictions(); - this.predictionsCreated = user.getPredictionsCreated(); - this.personalProfile=user.getPersonalProfile(); - this.companyProfile=user.getCompanyProfile(); - } - - - - - - - -} diff --git a/backend/src/main/java/project/repositories/CompanyDataRepository.java b/backend/src/main/java/project/repositories/CompanyDataRepository.java deleted file mode 100644 index 303b10c..0000000 --- a/backend/src/main/java/project/repositories/CompanyDataRepository.java +++ /dev/null @@ -1,11 +0,0 @@ -package project.repositories; - -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.stereotype.Repository; -import project.model.CompanyData; -import project.model.PersonalData; - -@Repository -public interface CompanyDataRepository extends JpaRepository { - -} diff --git a/backend/src/main/java/project/repositories/CompanyProfileRepository.java b/backend/src/main/java/project/repositories/CompanyProfileRepository.java deleted file mode 100644 index 6c91791..0000000 --- a/backend/src/main/java/project/repositories/CompanyProfileRepository.java +++ /dev/null @@ -1,19 +0,0 @@ -package project.repositories; - -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; -import org.springframework.stereotype.Repository; -import project.model.CompanyProfile; -import project.model.PersonalData; -import project.model.PersonalProfile; - -@Repository -public interface CompanyProfileRepository extends JpaRepository { - - @Query(value="SELECT * FROM company_profile cp WHERE cp.user_id=:userId", nativeQuery = true) - public CompanyProfile findByUserId(@Param("userId") int userId); - - @Query(value="SELECT COUNT(*) FROM company_part cp WHERE cp.company_id=:companyId AND cp.personal_id=:personalId", nativeQuery = true) - public int countCompanyPart(@Param("companyId") int companyId,@Param("personalId") int personalId); -} diff --git a/backend/src/main/java/project/repositories/ParameterDoubleRepository.java b/backend/src/main/java/project/repositories/ParameterDoubleRepository.java deleted file mode 100644 index e83044d..0000000 --- a/backend/src/main/java/project/repositories/ParameterDoubleRepository.java +++ /dev/null @@ -1,10 +0,0 @@ -package project.repositories; - -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.stereotype.Repository; -import project.model.ParameterDouble; -import project.model.Role; - -@Repository -public interface ParameterDoubleRepository extends JpaRepository { -} diff --git a/backend/src/main/java/project/repositories/ParameterIntRepository.java b/backend/src/main/java/project/repositories/ParameterIntRepository.java deleted file mode 100644 index 35fdad3..0000000 --- a/backend/src/main/java/project/repositories/ParameterIntRepository.java +++ /dev/null @@ -1,10 +0,0 @@ -package project.repositories; - -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.stereotype.Repository; -import project.model.ParameterInt; -import project.model.Role; - -@Repository -public interface ParameterIntRepository extends JpaRepository { -} diff --git a/backend/src/main/java/project/repositories/PersonalDataRepository.java b/backend/src/main/java/project/repositories/PersonalDataRepository.java deleted file mode 100644 index b667dc5..0000000 --- a/backend/src/main/java/project/repositories/PersonalDataRepository.java +++ /dev/null @@ -1,9 +0,0 @@ -package project.repositories; - -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.stereotype.Repository; -import project.model.PersonalData; - -@Repository -public interface PersonalDataRepository extends JpaRepository { -} diff --git a/backend/src/main/java/project/repositories/PersonalProfileRepository.java b/backend/src/main/java/project/repositories/PersonalProfileRepository.java deleted file mode 100644 index dd80387..0000000 --- a/backend/src/main/java/project/repositories/PersonalProfileRepository.java +++ /dev/null @@ -1,16 +0,0 @@ -package project.repositories; - -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; -import org.springframework.stereotype.Repository; -import project.model.PersonalProfile; -import project.model.Role; -import project.model.User; - -@Repository -public interface PersonalProfileRepository extends JpaRepository { - - @Query(value="SELECT * FROM personal_profile pp WHERE pp.user_id=:userId", nativeQuery = true) - public PersonalProfile findByUserId(@Param("userId") int userId); -} diff --git a/backend/src/main/java/project/repositories/PredictionRepository.java b/backend/src/main/java/project/repositories/PredictionRepository.java deleted file mode 100644 index 0da4ac4..0000000 --- a/backend/src/main/java/project/repositories/PredictionRepository.java +++ /dev/null @@ -1,20 +0,0 @@ -package project.repositories; - -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; -import org.springframework.stereotype.Repository; -import project.model.Prediction; -import project.model.Role; -import project.model.User; - -import java.util.List; -import java.util.Optional; - -@Repository -public interface PredictionRepository extends JpaRepository { - - @Query(value="SELECT * FROM prediction p WHERE p.user_id=:userId", nativeQuery = true) - public Optional> findByUserId(@Param("userId") int userId); - -} diff --git a/backend/src/main/java/project/repositories/RoleRepository.java b/backend/src/main/java/project/repositories/RoleRepository.java deleted file mode 100644 index 26f5fee..0000000 --- a/backend/src/main/java/project/repositories/RoleRepository.java +++ /dev/null @@ -1,16 +0,0 @@ -package project.repositories; - -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; -import org.springframework.stereotype.Repository; -import project.model.Role; - -@Repository -public interface RoleRepository extends JpaRepository { - - public Role findById(int id); - - @Query(value="SELECT * FROM roles r WHERE r.name LIKE %:name%", nativeQuery = true) - public Role findByName(@Param("name") String name); -} diff --git a/backend/src/main/java/project/repositories/UserRepository.java b/backend/src/main/java/project/repositories/UserRepository.java deleted file mode 100644 index 1d928ac..0000000 --- a/backend/src/main/java/project/repositories/UserRepository.java +++ /dev/null @@ -1,19 +0,0 @@ -package project.repositories; - -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.repository.query.Param; -import org.springframework.stereotype.Repository; -import project.model.User; - -import java.util.List; -import java.util.Optional; - -@Repository -public interface UserRepository extends JpaRepository { - - public User findById(int id); - public Optional findByLogin(String login); - public Optional findByLoginAndPassword(String login,String password); - -// public User findOneByName(String username); -} diff --git a/backend/src/main/java/project/services/CompanyDataService.java b/backend/src/main/java/project/services/CompanyDataService.java deleted file mode 100644 index 37fbe01..0000000 --- a/backend/src/main/java/project/services/CompanyDataService.java +++ /dev/null @@ -1,10 +0,0 @@ -package project.services; - -import project.model.CompanyData; - -public interface CompanyDataService { - - public CompanyData getCompanyData(int id); - public CompanyData addCompanyData(CompanyData companyData); -// public boolean deleteCompanyData(int id); -} diff --git a/backend/src/main/java/project/services/CompanyDataServiceImpl.java b/backend/src/main/java/project/services/CompanyDataServiceImpl.java deleted file mode 100644 index bbb0cce..0000000 --- a/backend/src/main/java/project/services/CompanyDataServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -package project.services; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import project.model.CompanyData; -import project.model.CompanyProfile; -import project.repositories.CompanyDataRepository; - -import java.util.Optional; - -@Service -public class CompanyDataServiceImpl implements CompanyDataService { - - - @Autowired - private CompanyDataRepository companyDataRepository; - - @Override - public CompanyData getCompanyData(int id) { - Optional optionalCompanyData = companyDataRepository.findById(id); - if(optionalCompanyData.isPresent()){ - return optionalCompanyData.get(); - }else{ - return null; - } - } - - @Override - public CompanyData addCompanyData(CompanyData companyData) { - return companyDataRepository.save(companyData); - } - -// @Override -// public boolean deleteCompanyData(int id) { -// companyDataRepository.deleteById(id); -// } -} diff --git a/backend/src/main/java/project/services/CompanyProfileService.java b/backend/src/main/java/project/services/CompanyProfileService.java deleted file mode 100644 index 5f220e4..0000000 --- a/backend/src/main/java/project/services/CompanyProfileService.java +++ /dev/null @@ -1,17 +0,0 @@ -package project.services; - -import project.model.CompanyData; -import project.model.CompanyProfile; -import project.model.PersonalProfile; - -import java.util.List; - -public interface CompanyProfileService { - - public CompanyProfile getCompanyProfile(int id); - public CompanyProfile addCompanyProfile(CompanyProfile companyProfile); -// public boolean deleteCompanyProfile(int id); - public CompanyProfile getCompanyProfileByUserId(int userId); - public boolean isCompanyAuthorized(int companyId,int personalId); - public List getAllCompanies(); -} diff --git a/backend/src/main/java/project/services/CompanyProfileServiceImpl.java b/backend/src/main/java/project/services/CompanyProfileServiceImpl.java deleted file mode 100644 index a277b71..0000000 --- a/backend/src/main/java/project/services/CompanyProfileServiceImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -package project.services; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import project.model.CompanyProfile; -import project.model.PersonalProfile; -import project.repositories.CompanyProfileRepository; - -import java.util.List; -import java.util.Optional; - -@Service -public class CompanyProfileServiceImpl implements CompanyProfileService { - - @Autowired - private CompanyProfileRepository companyProfileRepository; - - @Override - public CompanyProfile getCompanyProfile(int id) { - Optional optionalCompanyProfile = companyProfileRepository.findById(id); - if(optionalCompanyProfile.isPresent()){ - return optionalCompanyProfile.get(); - }else{ - return null; - } - } - - @Override - public CompanyProfile addCompanyProfile(CompanyProfile companyProfile) { - return companyProfileRepository.save(companyProfile); - } - - @Override - public CompanyProfile getCompanyProfileByUserId(int userId) { - return companyProfileRepository.findByUserId(userId); - } - - @Override - public boolean isCompanyAuthorized(int companyId, int personalId) { - int c = companyProfileRepository.countCompanyPart(companyId,personalId); - if (c==0){return false;} - else {return true;} - } - - @Override - public List getAllCompanies() { - System.out.println(companyProfileRepository.findAll().size()); - return companyProfileRepository.findAll(); - } - // @Override -// public boolean deleteCompanyProfile(int id) { -// companyProfileRepository.deleteById(id); -// return true; -// } -} diff --git a/backend/src/main/java/project/services/GeneratorDTO.java b/backend/src/main/java/project/services/GeneratorDTO.java deleted file mode 100644 index 1f673a0..0000000 --- a/backend/src/main/java/project/services/GeneratorDTO.java +++ /dev/null @@ -1,55 +0,0 @@ -package project.services; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import project.DTO.*; -import project.model.CompanyProfile; -import project.model.PersonalProfile; -import project.model.Prediction; -import project.model.User; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -@Service -public class GeneratorDTO implements Serializable { - - public UserDTO generateUserDTO(User user){ - UserDTO userDTO = new UserDTO(user); - RoleDTO roleDTO = new RoleDTO(user.getRole().getName()); - userDTO.setRoleDTO(roleDTO); - - return userDTO; - - } - public List generatePredictionsDTO( - List predictionList){ - List predictionDTOS = new ArrayList<>(); - for (Prediction prediction:predictionList) { - PredictionDTO predictionDTO = new PredictionDTO(); - predictionDTO.setId(prediction.getId()); - predictionDTO.setName(prediction.getName()); - predictionDTO.setLocalDateTime(prediction.getLocalDateTime()); - predictionDTO.setResultValue(prediction.getResultValue()); - predictionDTOS.add(predictionDTO); - } - - return predictionDTOS; - } - - public PersonalProfileDTO generatePersonalProfileDTO(PersonalProfile personalProfile){ - PersonalDataDTO personalDataDTO = new PersonalDataDTO(personalProfile.getPersonalData()); - UserDTO userDTO = generateUserDTO(personalProfile.getUser()); - - PersonalProfileDTO personalProfileDTO = new PersonalProfileDTO(personalDataDTO,userDTO); - return personalProfileDTO; - - } - public CompanyProfileDTO generateCompanyProfileDTO(CompanyProfile companyProfile){ - CompanyDataDTO companyDataDTO = new CompanyDataDTO(companyProfile.getCompanyData()); - UserDTO userDTO = generateUserDTO(companyProfile.getUser()); - - return new CompanyProfileDTO(companyDataDTO,userDTO); - } -} diff --git a/backend/src/main/java/project/services/PersonalDataService.java b/backend/src/main/java/project/services/PersonalDataService.java deleted file mode 100644 index dbe011c..0000000 --- a/backend/src/main/java/project/services/PersonalDataService.java +++ /dev/null @@ -1,10 +0,0 @@ -package project.services; - -import project.model.CompanyProfile; -import project.model.PersonalData; - -public interface PersonalDataService { - public PersonalData getPersonalData(int id); - public PersonalData addPersonalData(PersonalData personalData); -// public boolean deletePersonalData(int id); -} diff --git a/backend/src/main/java/project/services/PersonalDataServiceImpl.java b/backend/src/main/java/project/services/PersonalDataServiceImpl.java deleted file mode 100644 index 714df90..0000000 --- a/backend/src/main/java/project/services/PersonalDataServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -package project.services; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import project.model.PersonalData; -import project.model.PersonalProfile; -import project.repositories.PersonalDataRepository; - -import java.util.Optional; - -@Service -public class PersonalDataServiceImpl implements PersonalDataService { - - @Autowired - private PersonalDataRepository personalDataRepository; - - @Override - public PersonalData getPersonalData(int id) { - Optional optionalPersonalData = personalDataRepository.findById(id); - if(optionalPersonalData.isPresent()){ - return optionalPersonalData.get(); - }else{ - return null; - } - } - - @Override - public PersonalData addPersonalData(PersonalData personalData) { - return personalDataRepository.save(personalData); - } - -// @Override -// public boolean deletePersonalData(int id) { -// -// personalDataRepository.deleteById(id); -// -// } -} diff --git a/backend/src/main/java/project/services/PersonalProfileService.java b/backend/src/main/java/project/services/PersonalProfileService.java deleted file mode 100644 index 36fcb2e..0000000 --- a/backend/src/main/java/project/services/PersonalProfileService.java +++ /dev/null @@ -1,12 +0,0 @@ -package project.services; - -import project.model.PersonalData; -import project.model.PersonalProfile; - -public interface PersonalProfileService { - - public PersonalProfile getPersonalProfile(int id); - public PersonalProfile addPersonalProfile(PersonalProfile personalProfile); -// public boolean deletePersonalProfile(int id); - public PersonalProfile getPersonalProfileByUserId(int userId); -} diff --git a/backend/src/main/java/project/services/PersonalProfileServiceImpl.java b/backend/src/main/java/project/services/PersonalProfileServiceImpl.java deleted file mode 100644 index 47015a2..0000000 --- a/backend/src/main/java/project/services/PersonalProfileServiceImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -package project.services; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import project.model.PersonalProfile; -import project.repositories.PersonalProfileRepository; - -import java.util.Optional; - -@Service -public class PersonalProfileServiceImpl implements PersonalProfileService { - - @Autowired - private PersonalProfileRepository personalProfileRepository; - - @Override - public PersonalProfile getPersonalProfile(int id) { - Optional optionalPersonalProfile = personalProfileRepository.findById(id); - if(optionalPersonalProfile.isPresent()){ - return optionalPersonalProfile.get(); - }else{ - return null; - } - } - - @Override - public PersonalProfile addPersonalProfile(PersonalProfile personalProfile) { - return personalProfileRepository.save(personalProfile); - } - -// @Override -// public boolean deletePersonalProfile(int id) { -// personalProfileRepository.deleteById(id); -// } - - @Override - public PersonalProfile getPersonalProfileByUserId(int userId) { - return personalProfileRepository.findByUserId(userId); - - } -} diff --git a/backend/src/main/java/project/services/PredictionService.java b/backend/src/main/java/project/services/PredictionService.java deleted file mode 100644 index 38da888..0000000 --- a/backend/src/main/java/project/services/PredictionService.java +++ /dev/null @@ -1,14 +0,0 @@ -package project.services; - -import project.DTO.PredictionDTO; -import project.model.Prediction; - -import java.util.List; - -public interface PredictionService { - - public Prediction savePrediction(PredictionDTO predictionDTO); - public Prediction getPrediction(int id); - public List getAllPredictionsForUser(int userId); - public boolean deletePrediction(int userId,int id); -} diff --git a/backend/src/main/java/project/services/PredictionServiceImpl.java b/backend/src/main/java/project/services/PredictionServiceImpl.java deleted file mode 100644 index 1a4aa0d..0000000 --- a/backend/src/main/java/project/services/PredictionServiceImpl.java +++ /dev/null @@ -1,98 +0,0 @@ -package project.services; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import project.DTO.PredictionDTO; -import project.model.ParameterDouble; -import project.model.ParameterInt; -import project.model.Prediction; -import project.repositories.ParameterDoubleRepository; -import project.repositories.ParameterIntRepository; -import project.repositories.PredictionRepository; - -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -@Service -public class PredictionServiceImpl implements PredictionService { - - @Autowired - private PredictionRepository predictionRepository; - - @Autowired - private ParameterIntRepository parameterIntRepository; - - @Autowired - private ParameterDoubleRepository parameterDoubleRepository; - - @Autowired - private UserServiceImpl userService; - - public Prediction savePrediction(PredictionDTO predictionDTO){ - Prediction prediction = new Prediction(predictionDTO); - prediction.setParameterDoubles(null); - prediction.setParameterInts(null); - - prediction.setLocalDateTime(LocalDateTime.now()); - - prediction.setUser(userService.getUserById(predictionDTO.getUser())); - prediction.setCreator(userService.getUserById(predictionDTO.getCreator())); - Prediction savedPrediction = this.predictionRepository.save(prediction); - - List parameterInts = new ArrayList<>(); - List parameterDoubles = new ArrayList<>(); - - List parameterIntsDTO = predictionDTO.getParameterInts(); - List parameterDoublesDTO = predictionDTO.getParameterDoubles(); - if(parameterIntsDTO !=null){ - for (ParameterInt x:predictionDTO.getParameterInts()) { - x.setPrediction(savedPrediction); - parameterInts.add(parameterIntRepository.save(x)); - } - } - - savedPrediction.setParameterInts(parameterInts); - - if(parameterDoublesDTO != null){ - for (ParameterDouble x:predictionDTO.getParameterDoubles()) { - x.setPrediction(savedPrediction); - parameterDoubles.add(parameterDoubleRepository.save(x)); - } - } - - - savedPrediction.setParameterDoubles(parameterDoubles); -// return prediction; - return this.predictionRepository.save(savedPrediction); - - - } - public Prediction getPrediction(int id){ - Optional predictionOptional= this.predictionRepository.findById(id); - if(predictionOptional.isPresent()){ - return predictionOptional.get(); - } - return null; - } - - public boolean deletePrediction(int userId,int id){ - Prediction pred = getPrediction(id); - if(pred.getCreator().getId()==userId){ - this.predictionRepository.deleteById(id); - return true; - } - return false; - - } - public List getAllPredictionsForUser(int userId){ - Optional> optionalPredictions = predictionRepository.findByUserId(userId); - if(optionalPredictions.isPresent()){ - return optionalPredictions.get(); - } - return null; - } - -} diff --git a/backend/src/main/java/project/services/RoleService.java b/backend/src/main/java/project/services/RoleService.java deleted file mode 100644 index f1db2ef..0000000 --- a/backend/src/main/java/project/services/RoleService.java +++ /dev/null @@ -1,9 +0,0 @@ -package project.services; - -import project.model.Role; - -public interface RoleService { - - public Role getRoleById(int id); - public Role getRoleByName(String name); -} diff --git a/backend/src/main/java/project/services/RoleServiceImpl.java b/backend/src/main/java/project/services/RoleServiceImpl.java deleted file mode 100644 index 1ba7a5f..0000000 --- a/backend/src/main/java/project/services/RoleServiceImpl.java +++ /dev/null @@ -1,24 +0,0 @@ -package project.services; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import project.model.Role; -import project.repositories.RoleRepository; - -@Service -public class RoleServiceImpl implements RoleService{ - - @Autowired - RoleRepository roleRepository; - - @Override - public Role getRoleById(int id) { - return this.roleRepository.findById(id); - } - - @Override - public Role getRoleByName(String name) { - return this.roleRepository.findByName(name); - } -} diff --git a/backend/src/main/java/project/services/UserService.java b/backend/src/main/java/project/services/UserService.java deleted file mode 100644 index 8f5d65b..0000000 --- a/backend/src/main/java/project/services/UserService.java +++ /dev/null @@ -1,25 +0,0 @@ -package project.services; - -import project.DTO.PersonalProfileDTO; -import project.DTO.UserDTO; -import project.model.Prediction; -import project.model.User; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; -import java.util.Optional; - -public interface UserService { - - public User addUser(User user); - - public Optional getUsersByLogin(String login); - public Optional getUsersByLoginAndPassword(String login,String password); - public void deleteUser(int id); - public User getUserById(int id); - public List getAllUsers(); - public boolean checkIfCorrect(PersonalProfileDTO personalProfileDTO, boolean edit); - - - -} diff --git a/backend/src/main/java/project/services/UserServiceImpl.java b/backend/src/main/java/project/services/UserServiceImpl.java deleted file mode 100644 index 99bbf4f..0000000 --- a/backend/src/main/java/project/services/UserServiceImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -package project.services; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.authentication.AuthenticationManager; -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.authority.SimpleGrantedAuthority; -import org.springframework.security.core.context.SecurityContext; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.security.core.userdetails.UserDetailsService; -import org.springframework.security.core.userdetails.UsernameNotFoundException; -import org.springframework.stereotype.Service; -import project.DTO.PersonalProfileDTO; -import project.DTO.UserDTO; -import project.model.CustomUserDetails; -import project.model.PersonalProfile; -import project.model.Prediction; -import project.model.User; -import project.repositories.UserRepository; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.regex.Pattern; - -import static org.springframework.security.web.context.HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY; - -@Service -public class UserServiceImpl implements UserService,UserDetailsService { - - @Autowired - private UserRepository userRepository; - - @Autowired - private AuthenticationManager authManager; - - public User addUser(User user){ - - return this.userRepository.save(user); - } - - public void deleteUser(int id){ - this.userRepository.deleteById(id); - } - - public User getUserById(int id){ - return this.userRepository.findById(id); - } - - public Optional getUsersByLogin(String login){ - return this.userRepository.findByLogin(login); - } - - public Optional getUsersByLoginAndPassword(String login,String password){ - return this.userRepository.findByLoginAndPassword(login,password); - } - - public List getAllUsers(){ - return this.userRepository.findAll(); - } - - public List getAuthorities(User user){ - List authorityList = new ArrayList(); - authorityList.add(new SimpleGrantedAuthority(user.getRole().getName())); - return authorityList; - } - - @Override - public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException { - Optional optionalUser = this.userRepository.findByLogin(s); - if(optionalUser.isPresent()){ - return new org.springframework.security.core.userdetails. - User(optionalUser.get().getLogin(), - optionalUser.get().getPassword(), - getAuthorities(optionalUser.get())); - - }else{ - throw new UsernameNotFoundException("username not found"); - } - - } - - public boolean checkIfCorrect(PersonalProfileDTO personalProfileDTO, boolean edit){ - Pattern pName =Pattern.compile("^[A-Z][a-zA-ZĄąĆćĘꣳŃńÓ󌜏źŻż]{2,15}$"); - Pattern pSurname =Pattern.compile("^[A-Z][a-zA-ZĄąĆćĘꣳŃńÓ󌜏źŻż]{2,20}$"); - Pattern pEmail =Pattern.compile("^[a-z]+[0-9]*@([a-z]{2,10}\\.)+[a-z]{2,5}$"); - Pattern pLogin =Pattern.compile("^([a-zA-ZĄąĆćĘꣳŃńÓ󌜏źŻż]+[0-9\\-\\_]*){5,20}$"); - Pattern pPassword =Pattern.compile("^([a-zA-ZĄąĆćĘꣳŃńÓ󌜏źŻż]{5,}[0-9]{5,}[a-zA-ZĄąĆćĘꣳŃńÓ󌜏źŻż0-9]*)+$"); - - if(!pName.matcher(personalProfileDTO.getPersonalDataDTO().getName()).matches() | !pSurname.matcher(personalProfileDTO.getPersonalDataDTO().getSurname()).matches() | - !pEmail.matcher(personalProfileDTO.getPersonalDataDTO().getEmail()).matches() ) { - - return false; - }else if(!edit){ - if(!pLogin.matcher(personalProfileDTO.getUserDTO().getLogin()).matches() | - !pPassword.matcher(personalProfileDTO.getUserDTO().getPassword()).matches()){ - return false; - }else { - return true; - } - }else{ - return true; - } - - } - - - -} diff --git a/backend/src/main/resources/local.properties b/backend/src/main/resources/local.properties deleted file mode 100644 index 17ee235..0000000 --- a/backend/src/main/resources/local.properties +++ /dev/null @@ -1,26 +0,0 @@ -## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties) -spring.datasource.url = jdbc:postgresql://localhost:5432/takecareapp?hibernate?useUnicode=yes&characterEncoding=UTF-8 -#spring.jpa.generate-ddl=true - -#hibernate?useUnicode=yes&characterEncoding=UTF-8 - -spring.datasource.username = postgres -spring.datasource.password = postgres - -#useSSL=false - -## Hibernate Properties -# The SQL dialect makes Hibernate generate better SQL for the chosen database -spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect -spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults = false -# Hibernate ddl auto (create, create-drop, validate, update) -spring.jpa.hibernate.ddl-auto = update - - - -#Tomcat session timeout nir moze byc mniejszy niz 1 minuta -#server.servlet.session.timeout=60s - -#spring.session.store-type=jdbc -#spring.session.jdbc.initialize-schema=always -#spring.session.timeout.seconds=10 diff --git a/backend/src/main/resources/remote.properties b/backend/src/main/resources/remote.properties deleted file mode 100644 index ceb32c6..0000000 --- a/backend/src/main/resources/remote.properties +++ /dev/null @@ -1,27 +0,0 @@ -## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties) -spring.datasource.url = jdbc:postgresql://ec2-52-208-138-246.eu-west-1.compute.amazonaws.com:5432/dbtqe5jehu0mg4?hibernate?useUnicode=yes&characterEncoding=UTF-8 -#spring.jpa.generate-ddl=true - -#hibernate?useUnicode=yes&characterEncoding=UTF-8 -spring.datasource.username = nxpxoyywdkzdgy -spring.datasource.password = 4b0a06a3be25b34d0bf40a3be2049f779f5602e1793944643871a9a146557966 - - - -#useSSL=false - -## Hibernate Properties -# The SQL dialect makes Hibernate generate better SQL for the chosen database -spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect -spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults = false -# Hibernate ddl auto (create, create-drop, validate, update) -spring.jpa.hibernate.ddl-auto = update - - - -#Tomcat session timeout nir moze byc mniejszy niz 1 minuta -#server.servlet.session.timeout=60s - -#spring.session.store-type=jdbc -#spring.session.jdbc.initialize-schema=always -#spring.session.timeout.seconds=10 diff --git a/backend/src/test/java/project/TakeCareAppTest.java b/backend/src/test/java/project/TakeCareAppTest.java deleted file mode 100644 index 5a8bfc7..0000000 --- a/backend/src/test/java/project/TakeCareAppTest.java +++ /dev/null @@ -1,4 +0,0 @@ -package project; - -public class TakeCareAppTest { -} diff --git a/backend/src/test/java/project/services/PredictionServiceImplTest.java b/backend/src/test/java/project/services/PredictionServiceImplTest.java deleted file mode 100644 index 2c1e602..0000000 --- a/backend/src/test/java/project/services/PredictionServiceImplTest.java +++ /dev/null @@ -1,84 +0,0 @@ -package project.services; - -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; -import project.DTO.PredictionDTO; -import project.DTO.UserDTO; -import project.model.ParameterDouble; -import project.model.ParameterInt; -import project.model.Prediction; -import project.repositories.PredictionRepository; - -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -@RunWith(SpringRunner.class) -@SpringBootTest -public class PredictionServiceImplTest { - - @Autowired - private PredictionServiceImpl predictionService; - - - public PredictionDTO generatePredictionDTO(){ - PredictionDTO predictionDTO = new PredictionDTO(); - predictionDTO.setName("Przykład"); - predictionDTO.setUser(1); - List parameterDoubles = new ArrayList<>(); - List parameterInts = new ArrayList<>(); - double[] tableDouble = {1.2,1.5,8.5,6.3,9.9,25.1}; - int[] tableInt = {7,54,3,6,8,4,33,66,85,44,1001}; - for (double x:tableDouble) { - parameterDoubles.add(new ParameterDouble(x)); - } - for (int x:tableInt) { - parameterInts.add(new ParameterInt(x)); - } - predictionDTO.setParameterInts(parameterInts); - predictionDTO.setParameterDoubles(parameterDoubles); - predictionDTO.setResultValue(0.98); - predictionDTO.setResultText("Otrzymany wynik świadczy o b. wysokim prawdopodobieństwie zachorowalności."); - - return predictionDTO; - } - - @Test - public void saveTest(){ - - PredictionDTO predictionDTO = generatePredictionDTO(); - - Prediction prediction = predictionService.savePrediction(predictionDTO); - System.out.println(prediction.getParameterInts()); - Assert.assertTrue(prediction!=null); - } - - @Test - public void getTest(){ - Prediction prediction = predictionService.getPrediction(8); - Assert.assertTrue(prediction.getName()!=null); - Assert.assertTrue(prediction.getUser()!=null); - Assert.assertTrue(prediction.getParameterDoubles()!=null); - Assert.assertTrue(prediction.getParameterInts()!=null); - Object d = prediction.getResultValue(); - Object t = prediction.getResultText(); - Assert.assertTrue(d instanceof Double); - Assert.assertTrue(t instanceof String); - - - } - - @Test - public void getAllTest(){ - List predictions = predictionService.getAllPredictionsForUser(1); - Assert.assertTrue(predictions!=null); - Assert.assertTrue(predictions.size()!=0); - - } - - -} diff --git a/backend/src/test/java/project/services/UserServiceImplTest.java b/backend/src/test/java/project/services/UserServiceImplTest.java deleted file mode 100644 index cb1d078..0000000 --- a/backend/src/test/java/project/services/UserServiceImplTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package project.services; - -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; -import project.DTO.PersonalDataDTO; -import project.DTO.PersonalProfileDTO; -import project.DTO.UserDTO; -import project.repositories.UserRepository; - -@RunWith(SpringRunner.class) -@SpringBootTest -public class UserServiceImplTest { - - @Autowired - public UserServiceImpl userServiceImpl; - - public PersonalProfileDTO generatePersonalProfileDTO(){ - UserDTO userDTO = new UserDTO(); - PersonalDataDTO personalDataDTO = new PersonalDataDTO(); - - personalDataDTO.setName(" "); - personalDataDTO.setSurname(" "); - personalDataDTO.setEmail(" "); - return new PersonalProfileDTO(personalDataDTO,userDTO); - } - - @Test - public void checkIfCorrectTest(){ - PersonalProfileDTO personalProfileDTO = generatePersonalProfileDTO(); - UserServiceImpl userService = new UserServiceImpl(); - boolean response = userService.checkIfCorrect(personalProfileDTO,false); - - Assert.assertTrue(response==false); - } -}