From 0c3d7ebb32438d4b8e9fdebd2e67713f8145342d Mon Sep 17 00:00:00 2001 From: felix Date: Wed, 28 Feb 2024 14:31:47 +0100 Subject: [PATCH] init --- .../SAE/ApiREST/Client/ClientApplication.java | 6 +- .../SAE/ApiREST/Client/TestArticleApi.java | 14 --- .../SAE/ApiREST/Client/model/Article.java | 100 ------------------ .../SAE/ApiREST/Client/model/Response.java | 30 ------ 4 files changed, 1 insertion(+), 149 deletions(-) delete mode 100644 Client/src/main/java/SAE/ApiREST/Client/TestArticleApi.java delete mode 100644 Client/src/main/java/SAE/ApiREST/Client/model/Article.java delete mode 100644 Client/src/main/java/SAE/ApiREST/Client/model/Response.java diff --git a/Client/src/main/java/SAE/ApiREST/Client/ClientApplication.java b/Client/src/main/java/SAE/ApiREST/Client/ClientApplication.java index 8ebe147..c5459b7 100644 --- a/Client/src/main/java/SAE/ApiREST/Client/ClientApplication.java +++ b/Client/src/main/java/SAE/ApiREST/Client/ClientApplication.java @@ -3,14 +3,10 @@ package SAE.ApiREST.Client; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import main.java.SAE.ApiREST.Client.TestArticleApi; - @SpringBootApplication public class ClientApplication { - private static final Logger log = LoggerFactory.getLogger(DemoApplication.class); - public static void main(String[] args) { - TestArticleApi test = new TestArticleApi(); + SpringApplication.run(ClientApplication.class, args); } } \ No newline at end of file diff --git a/Client/src/main/java/SAE/ApiREST/Client/TestArticleApi.java b/Client/src/main/java/SAE/ApiREST/Client/TestArticleApi.java deleted file mode 100644 index ef78307..0000000 --- a/Client/src/main/java/SAE/ApiREST/Client/TestArticleApi.java +++ /dev/null @@ -1,14 +0,0 @@ -package main.java.SAE.ApiREST.Client; - -public class TestArticleApi { - private RestTemplate restTemplate = new RestTemplate(); - private String baseURI = "http://localhost:8080/ArticleWebService/"; - - public TestArticleApi() { - testPost(); - } - - private void testPost() { - restTemplate.postForObject(baseURI + "") - } -} diff --git a/Client/src/main/java/SAE/ApiREST/Client/model/Article.java b/Client/src/main/java/SAE/ApiREST/Client/model/Article.java deleted file mode 100644 index 5979388..0000000 --- a/Client/src/main/java/SAE/ApiREST/Client/model/Article.java +++ /dev/null @@ -1,100 +0,0 @@ -package SAE.ApiREST.Client; - -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; - -@Entity -public class Article { - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - Integer id; - String title; - String url; - LocalDate dateAdded; - LocalDate datePublished; - Boolean visible; - Integer type; - // ArrayList keywords = new ArrayList<>(); - - public Article() {} - - public Article(String title, String url, LocalDate dateAdded, LocalDate datePublished, Boolean visibility, Integer type) { - this.id = 1; - this.title = title; - this.url = url; - this.dateAdded = dateAdded; - this.datePublished = datePublished; - this.visible = visibility; - this.type = type; - } - - public Integer getId() { - return this.id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getUrl() { - return this.url; - } - - public void setUrl(String url) { - this.url = url; - } - - public LocalDate getDateAdded() { - return this.dateAdded; - } - - public void setDateAdded(String dateAdded) { - this.dateAdded = LocalDate.parse(dateAdded, DateTimeFormatter.ofPattern("dd-MM-yyyy")); - } - - public LocalDate getDatePublished() { - return this.datePublished; - } - - public void setDatePublished(String datePublished) { - this.datePublished = LocalDate.parse(datePublished, DateTimeFormatter.ofPattern("dd-MM-yyyy")); - } - - public Boolean getVisible() { - return this.visible; - } - - public void setVisibility(Boolean visible) { - this.visible = visible; - } - - public Integer getType() { - return this.type; - } - - public void setType(Integer type) { - this.type = type; - } -/* - public List getKeywords() { - return this.keywords; - } - - public void setKeywords(List keywords) { - this.keywords = keywords; - } -*/ -} diff --git a/Client/src/main/java/SAE/ApiREST/Client/model/Response.java b/Client/src/main/java/SAE/ApiREST/Client/model/Response.java deleted file mode 100644 index d9e5f5e..0000000 --- a/Client/src/main/java/SAE/ApiREST/Client/model/Response.java +++ /dev/null @@ -1,30 +0,0 @@ -package SAE.ApiREST.Client; - -public class Response { - - Integer id; - String statusMessage; - - public Response() {} - - public Response(Integer id, String statusMessage) { - this.id = id; - this.statusMessage = statusMessage; - } - - public Integer getId() { - return this.id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getStatusMessage() { - return this.statusMessage; - } - - public void setStatusMessage(String statusMessage) { - this.statusMessage = statusMessage; - } -}