Added feedback-service

This commit is contained in:
Yohan Boujon 2024-12-23 00:15:18 +01:00
parent 42c3bb15f6
commit 8cf27b7b64
3 changed files with 93 additions and 0 deletions

View file

@ -0,0 +1,56 @@
<project xmlns="http://maven.apache.org/POM/4.0.0">
<parent>
<groupId>insa.application.helpapp</groupId>
<artifactId>helpapp</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>feedback-service</artifactId>
<dependencies>
<!-- Dépendance pour créer un service REST -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.33</version>
<scope>runtime</scope>
</dependency>
<!-- Depends on Administation Service to check roles -->
<dependency>
<groupId>insa.application.helpapp</groupId>
<artifactId>database-manager</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Plugin Maven pour Spring Boot -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>3.1.4</version>
</plugin>
<!-- Plugin pour configurer le compilateur -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>21</source>
<target>21</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,36 @@
package insa.application.helpapp.rest;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.beans.factory.annotation.Autowired;
@SpringBootApplication
@RestController
public class FeedbackServiceApplication {
@Autowired
private AdministrationService administrationService;
public static void main(String[] args) {
SpringApplication.run(FeedbackServiceApplication.class, args);
}
// CORS Configuration
@Bean
public WebMvcConfigurer corsConfigurer() {
return new WebMvcConfigurer() {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedOrigins("*")
.allowedMethods("POST", "PUT", "DELETE")
.allowedHeaders("*");
}
};
}
}

View file

@ -9,6 +9,7 @@
<modules>
<!-- database-manager is a dependency for other services -->
<module>database-manager</module>
<module>feedback-service</module>
<module>request-service</module>
<module>role-service</module>
<module>user-service</module>