Added status for posts in init.sql. Renamed administration section because it does not run any rest API.

This commit is contained in:
Yohan Boujon 2024-12-22 16:08:48 +01:00
parent 292aea3d96
commit 87829a7766
7 changed files with 15 additions and 8 deletions

View file

@ -3,3 +3,11 @@ VALUES
(1, 'User'), (1, 'User'),
(2, 'Volunteer'), (2, 'Volunteer'),
(3, 'Admin'); (3, 'Admin');
INSERT INTO `service-architecture`.status (id, name)
VALUES
(1, 'Waiting'),
(2, 'Validated'),
(3, 'Rejected'),
(4, 'Chosen'),
(5, 'Finished');

View file

@ -5,7 +5,7 @@
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>administration-service</artifactId> <artifactId>administration</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<dependencies> <dependencies>

View file

@ -7,8 +7,8 @@
<packaging>pom</packaging> <packaging>pom</packaging>
<modules> <modules>
<!-- Administation-Service creates a dependency for other services --> <!-- Administation creates a dependency for other services -->
<module>administration-service</module> <module>administration</module>
<module>request-service</module> <module>request-service</module>
<module>role-service</module> <module>role-service</module>
<module>user-service</module> <module>user-service</module>

View file

@ -1,17 +1,14 @@
package insa.application.helpapp.rest; package insa.application.helpapp.rest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
// import org.springframework.http.HttpStatus;
// import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
// import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@SpringBootApplication @SpringBootApplication
@RestController @RestController
@ -40,6 +37,8 @@ public class RequestServiceApplication {
if(!administrationService.checkToken(idUser, token)) { if(!administrationService.checkToken(idUser, token)) {
return ResponseEntity.status(HttpStatus.FORBIDDEN).body("User or token invalid."); return ResponseEntity.status(HttpStatus.FORBIDDEN).body("User or token invalid.");
}; };
return ResponseEntity.ok("yessay");
return ResponseEntity.ok("Message posted");
} }
} }