Commit d167a3876feb2e83466f612f408f78e823a76f2b
1 parent
496ce01e
On génère mieux
(ouais, tout ce temps pour ça, je sais)
Showing
10 changed files
with
469 additions
and
4 deletions
Show diff stats
.gitignore
pom.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | 2 | +<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" |
3 | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | 3 | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
4 | <modelVersion>4.0.0</modelVersion> | 4 | <modelVersion>4.0.0</modelVersion> |
5 | 5 | ||
@@ -46,17 +46,17 @@ | @@ -46,17 +46,17 @@ | ||
46 | <artifactId>springmvc-raml-plugin</artifactId> | 46 | <artifactId>springmvc-raml-plugin</artifactId> |
47 | <version>0.8.9</version> | 47 | <version>0.8.9</version> |
48 | <configuration> | 48 | <configuration> |
49 | - <ramlPath>api.raml</ramlPath> | 49 | + <ramlPath>/api.raml</ramlPath> |
50 | <outputRelativePath>/src/main/java</outputRelativePath> | 50 | <outputRelativePath>/src/main/java</outputRelativePath> |
51 | <addTimestampFolder>false</addTimestampFolder> | 51 | <addTimestampFolder>false</addTimestampFolder> |
52 | - <basePackage>etunicorn</basePackage> | 52 | + <basePackage>etunicorn.generated</basePackage> |
53 | <baseUri>/v1</baseUri> | 53 | <baseUri>/v1</baseUri> |
54 | <generateUnreferencedSchemas>true</generateUnreferencedSchemas> | 54 | <generateUnreferencedSchemas>true</generateUnreferencedSchemas> |
55 | <generationConfig> | 55 | <generationConfig> |
56 | <includeAdditionalProperties>true</includeAdditionalProperties> | 56 | <includeAdditionalProperties>true</includeAdditionalProperties> |
57 | </generationConfig> | 57 | </generationConfig> |
58 | <seperateMethodsByContentType>false</seperateMethodsByContentType> | 58 | <seperateMethodsByContentType>false</seperateMethodsByContentType> |
59 | - <rule>com.phoenixnap.oss.ramlapisync.generation.rule.Spring4ControllerStubRule</rule> | 59 | + <rule>com.phoenixnap.oss.ramlapisync.generation.rules.Spring4ControllerInterfaceRule</rule> |
60 | <ruleConfiguration> | 60 | <ruleConfiguration> |
61 | </ruleConfiguration> | 61 | </ruleConfiguration> |
62 | </configuration> | 62 | </configuration> |
@@ -0,0 +1,40 @@ | @@ -0,0 +1,40 @@ | ||
1 | +package etunicorn; | ||
2 | + | ||
3 | +import org.springframework.http.ResponseEntity; | ||
4 | +import org.springframework.web.bind.annotation.PathVariable; | ||
5 | +import org.springframework.web.bind.annotation.RequestParam; | ||
6 | +import org.springframework.web.bind.annotation.RestController; | ||
7 | + | ||
8 | +import java.util.Date; | ||
9 | + | ||
10 | +/** | ||
11 | + * Created by geoffrey on 28/01/17. | ||
12 | + */ | ||
13 | + | ||
14 | +@RestController | ||
15 | +public class PersonneController implements etunicorn.generated.PersonneController { | ||
16 | + @Override | ||
17 | + public ResponseEntity<?> getPersonne() { | ||
18 | + return null; | ||
19 | + } | ||
20 | + | ||
21 | + @Override | ||
22 | + public ResponseEntity<?> updatePersonne(@RequestParam(required = false) String carte, @RequestParam(required = false) Date naissance, @RequestParam(required = false) String login, @RequestParam(required = false, defaultValue = "etudiant") String role) { | ||
23 | + return null; | ||
24 | + } | ||
25 | + | ||
26 | + @Override | ||
27 | + public ResponseEntity<?> getPersonneById(@PathVariable String idPersonne) { | ||
28 | + return null; | ||
29 | + } | ||
30 | + | ||
31 | + @Override | ||
32 | + public ResponseEntity<?> updatePersonneById(@PathVariable String idPersonne, @RequestParam(required = false) String carte, @RequestParam(required = false) Date naissance, @RequestParam(required = false) String login, @RequestParam(required = false) String role) { | ||
33 | + return null; | ||
34 | + } | ||
35 | + | ||
36 | + @Override | ||
37 | + public ResponseEntity<?> deletePersonneById(@PathVariable String idPersonne) { | ||
38 | + return null; | ||
39 | + } | ||
40 | +} |
src/main/java/etunicorn/generated/ConsomationController.java
0 → 100644
@@ -0,0 +1,63 @@ | @@ -0,0 +1,63 @@ | ||
1 | + | ||
2 | +package etunicorn.generated; | ||
3 | + | ||
4 | +import org.springframework.http.ResponseEntity; | ||
5 | +import org.springframework.web.bind.annotation.*; | ||
6 | + | ||
7 | +import java.math.BigDecimal; | ||
8 | + | ||
9 | + | ||
10 | +/** | ||
11 | + * No description | ||
12 | + * (Generated with springmvc-raml-parser v.0.8.9) | ||
13 | + */ | ||
14 | +@RestController | ||
15 | +@RequestMapping("/v1/consomation") | ||
16 | +public interface ConsomationController { | ||
17 | + | ||
18 | + | ||
19 | + /** | ||
20 | + * Obtenir la liste de toutes les consomations. Nécessite CONSO_ADMIN ou CONSO_ACHETER ou CONSO_REMBOURSER | ||
21 | + */ | ||
22 | + @RequestMapping(value = "", method = RequestMethod.GET) | ||
23 | + public ResponseEntity<?> getConsomation(); | ||
24 | + | ||
25 | + /** | ||
26 | + * Permet de creer une nouvelle consomation. Nécessite CONSO_ADMIN | ||
27 | + */ | ||
28 | + @RequestMapping(value = "", method = RequestMethod.POST) | ||
29 | + public ResponseEntity<?> updateConsomation( | ||
30 | + @RequestParam | ||
31 | + String nomConsomation, | ||
32 | + @RequestParam | ||
33 | + BigDecimal prix); | ||
34 | + | ||
35 | + /** | ||
36 | + * Permet de modifier une consommation. Nécessite CONSO_ADMIN | ||
37 | + */ | ||
38 | + @RequestMapping(value = "/{consomationId}", method = RequestMethod.PUT) | ||
39 | + public ResponseEntity<?> updateConsomationById( | ||
40 | + @PathVariable | ||
41 | + String consomationId, | ||
42 | + @RequestParam(required = false) | ||
43 | + String nomEvenement, | ||
44 | + @RequestParam(required = false) | ||
45 | + BigDecimal prix); | ||
46 | + | ||
47 | + /** | ||
48 | + * Obtenir la Consomation {consomationId}. Nécessite CONSO_ADMIN ou CONSO_ACHETER ou CONSO_REMBOURSER | ||
49 | + */ | ||
50 | + @RequestMapping(value = "/{consomationId}", method = RequestMethod.GET) | ||
51 | + public ResponseEntity<?> getConsomationById( | ||
52 | + @PathVariable | ||
53 | + String consomationId); | ||
54 | + | ||
55 | + /** | ||
56 | + * Permet de supprimer la consomation {consomationId}. Nécessite CONSO_ADMIN | ||
57 | + */ | ||
58 | + @RequestMapping(value = "/{consomationId}", method = RequestMethod.DELETE) | ||
59 | + public ResponseEntity<?> deleteConsomationById( | ||
60 | + @PathVariable | ||
61 | + String consomationId); | ||
62 | + | ||
63 | +} |
src/main/java/etunicorn/generated/EvenementController.java
0 → 100644
@@ -0,0 +1,68 @@ | @@ -0,0 +1,68 @@ | ||
1 | + | ||
2 | +package etunicorn.generated; | ||
3 | + | ||
4 | +import org.springframework.http.ResponseEntity; | ||
5 | +import org.springframework.web.bind.annotation.*; | ||
6 | + | ||
7 | +import java.math.BigDecimal; | ||
8 | +import java.util.Date; | ||
9 | + | ||
10 | + | ||
11 | +/** | ||
12 | + * No description | ||
13 | + * (Generated with springmvc-raml-parser v.0.8.9) | ||
14 | + */ | ||
15 | +@RestController | ||
16 | +@RequestMapping("/v1/evenement") | ||
17 | +public interface EvenementController { | ||
18 | + | ||
19 | + | ||
20 | + /** | ||
21 | + * Obtenir la liste de tout les evenements. Nécessite EVNMT_ADMIN ou EVNMT_ACHETER ou EVNMT_REMBOURSER | ||
22 | + */ | ||
23 | + @RequestMapping(value = "", method = RequestMethod.GET) | ||
24 | + public ResponseEntity<?> getEvenement(); | ||
25 | + | ||
26 | + /** | ||
27 | + * Permet de creer un nouvel evenement. Nécessite EVNMT_ADMIN | ||
28 | + */ | ||
29 | + @RequestMapping(value = "", method = RequestMethod.POST) | ||
30 | + public ResponseEntity<?> updateEvenement( | ||
31 | + @RequestParam | ||
32 | + String nomEvenement, | ||
33 | + @RequestParam | ||
34 | + BigDecimal prix, | ||
35 | + @RequestParam | ||
36 | + Date date); | ||
37 | + | ||
38 | + /** | ||
39 | + * Permet de modifier un évènement existant. Nécessite EVNMT_ADMIN | ||
40 | + */ | ||
41 | + @RequestMapping(value = "/{evenementId}", method = RequestMethod.PUT) | ||
42 | + public ResponseEntity<?> updateEvenementById( | ||
43 | + @PathVariable | ||
44 | + String evenementId, | ||
45 | + @RequestParam(required = false) | ||
46 | + String nomEvenement, | ||
47 | + @RequestParam(required = false) | ||
48 | + BigDecimal prix, | ||
49 | + @RequestParam(required = false) | ||
50 | + Date date); | ||
51 | + | ||
52 | + /** | ||
53 | + * Obtenir l'evenement {evenementId}. Nécessite EVNMT_ADMIN ou EVNMT_ACHETER ou EVNMT_REMBOURSER | ||
54 | + */ | ||
55 | + @RequestMapping(value = "/{evenementId}", method = RequestMethod.GET) | ||
56 | + public ResponseEntity<?> getEvenementById( | ||
57 | + @PathVariable | ||
58 | + String evenementId); | ||
59 | + | ||
60 | + /** | ||
61 | + * Permet de supprimer l'evenement {evenementId}. Nécessite EVNMT_ADMIN | ||
62 | + */ | ||
63 | + @RequestMapping(value = "/{evenementId}", method = RequestMethod.DELETE) | ||
64 | + public ResponseEntity<?> deleteEvenementById( | ||
65 | + @PathVariable | ||
66 | + String evenementId); | ||
67 | + | ||
68 | +} |
src/main/java/etunicorn/generated/LoginController.java
0 → 100644
@@ -0,0 +1,35 @@ | @@ -0,0 +1,35 @@ | ||
1 | + | ||
2 | +package etunicorn.generated; | ||
3 | + | ||
4 | +import org.springframework.http.ResponseEntity; | ||
5 | +import org.springframework.web.bind.annotation.*; | ||
6 | + | ||
7 | + | ||
8 | +/** | ||
9 | + * No description | ||
10 | + * (Generated with springmvc-raml-parser v.0.8.9) | ||
11 | + */ | ||
12 | +@RestController | ||
13 | +@RequestMapping("/v1/login") | ||
14 | +public interface LoginController { | ||
15 | + | ||
16 | + | ||
17 | + /** | ||
18 | + * Instancie une nouvelle connexion | ||
19 | + */ | ||
20 | + @RequestMapping(value = "", method = RequestMethod.POST) | ||
21 | + public ResponseEntity<?> updateLogin( | ||
22 | + @RequestParam | ||
23 | + String login, | ||
24 | + @RequestParam(required = false) | ||
25 | + String password); | ||
26 | + | ||
27 | + /** | ||
28 | + * Se déconnecter | ||
29 | + */ | ||
30 | + @RequestMapping(value = "/{token}", method = RequestMethod.DELETE) | ||
31 | + public ResponseEntity<?> deleteLoginByToken( | ||
32 | + @PathVariable | ||
33 | + String token); | ||
34 | + | ||
35 | +} |
src/main/java/etunicorn/generated/ParticipeController.java
0 → 100644
@@ -0,0 +1,40 @@ | @@ -0,0 +1,40 @@ | ||
1 | + | ||
2 | +package etunicorn.generated; | ||
3 | + | ||
4 | +import org.springframework.http.ResponseEntity; | ||
5 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
6 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
7 | +import org.springframework.web.bind.annotation.RequestParam; | ||
8 | +import org.springframework.web.bind.annotation.RestController; | ||
9 | + | ||
10 | + | ||
11 | +/** | ||
12 | + * No description | ||
13 | + * (Generated with springmvc-raml-parser v.0.8.9) | ||
14 | + */ | ||
15 | +@RestController | ||
16 | +@RequestMapping("/v1/participe") | ||
17 | +public interface ParticipeController { | ||
18 | + | ||
19 | + | ||
20 | + /** | ||
21 | + * Permet d'ajouter une personne a un evenement | ||
22 | + */ | ||
23 | + @RequestMapping(value = "", method = RequestMethod.POST) | ||
24 | + public ResponseEntity<?> updateParticipe( | ||
25 | + @RequestParam | ||
26 | + Long idPersonne, | ||
27 | + @RequestParam | ||
28 | + Long idEvenement); | ||
29 | + | ||
30 | + /** | ||
31 | + * Permet de savoir si une personne participe a un evenement | ||
32 | + */ | ||
33 | + @RequestMapping(value = "", method = RequestMethod.GET) | ||
34 | + public ResponseEntity<?> getParticipe( | ||
35 | + @RequestParam | ||
36 | + Long idPersonne, | ||
37 | + @RequestParam | ||
38 | + Long idEvenement); | ||
39 | + | ||
40 | +} |
src/main/java/etunicorn/generated/PersonneController.java
0 → 100644
@@ -0,0 +1,71 @@ | @@ -0,0 +1,71 @@ | ||
1 | + | ||
2 | +package etunicorn.generated; | ||
3 | + | ||
4 | +import org.springframework.http.ResponseEntity; | ||
5 | +import org.springframework.web.bind.annotation.*; | ||
6 | + | ||
7 | +import java.util.Date; | ||
8 | + | ||
9 | + | ||
10 | +/** | ||
11 | + * No description | ||
12 | + * (Generated with springmvc-raml-parser v.0.8.9) | ||
13 | + */ | ||
14 | +@RestController | ||
15 | +@RequestMapping("/v1/personne") | ||
16 | +public interface PersonneController { | ||
17 | + | ||
18 | + | ||
19 | + /** | ||
20 | + * Obtenir la liste des persones. Nécessite COMPTE_ADMIN | ||
21 | + */ | ||
22 | + @RequestMapping(value = "", method = RequestMethod.GET) | ||
23 | + public ResponseEntity<?> getPersonne(); | ||
24 | + | ||
25 | + /** | ||
26 | + * Ajoute une nouvelle personne | ||
27 | + */ | ||
28 | + @RequestMapping(value = "", method = RequestMethod.POST) | ||
29 | + public ResponseEntity<?> updatePersonne( | ||
30 | + @RequestParam(required = false) | ||
31 | + String carte, | ||
32 | + @RequestParam(required = false) | ||
33 | + Date naissance, | ||
34 | + @RequestParam(required = false) | ||
35 | + String login, | ||
36 | + @RequestParam(required = false, defaultValue = "etudiant") | ||
37 | + String role); | ||
38 | + | ||
39 | + /** | ||
40 | + * Obtenir les infos sur une personne. Nécessite COMPTE_ADMIN | ||
41 | + */ | ||
42 | + @RequestMapping(value = "/{idPersonne}", method = RequestMethod.GET) | ||
43 | + public ResponseEntity<?> getPersonneById( | ||
44 | + @PathVariable | ||
45 | + String idPersonne); | ||
46 | + | ||
47 | + /** | ||
48 | + * Modifer les infos d'une personne. Nécessite COMPTE_ADMIN | ||
49 | + */ | ||
50 | + @RequestMapping(value = "/{idPersonne}", method = RequestMethod.PUT) | ||
51 | + public ResponseEntity<?> updatePersonneById( | ||
52 | + @PathVariable | ||
53 | + String idPersonne, | ||
54 | + @RequestParam(required = false) | ||
55 | + String carte, | ||
56 | + @RequestParam(required = false) | ||
57 | + Date naissance, | ||
58 | + @RequestParam(required = false) | ||
59 | + String login, | ||
60 | + @RequestParam(required = false) | ||
61 | + String role); | ||
62 | + | ||
63 | + /** | ||
64 | + * Obtenir les infos sur une personne. Nécessite COMPTE_ADMIN | ||
65 | + */ | ||
66 | + @RequestMapping(value = "/{idPersonne}", method = RequestMethod.DELETE) | ||
67 | + public ResponseEntity<?> deletePersonneById( | ||
68 | + @PathVariable | ||
69 | + String idPersonne); | ||
70 | + | ||
71 | +} |
src/main/java/etunicorn/generated/RoleController.java
0 → 100644
@@ -0,0 +1,65 @@ | @@ -0,0 +1,65 @@ | ||
1 | + | ||
2 | +package etunicorn.generated; | ||
3 | + | ||
4 | +import org.springframework.http.ResponseEntity; | ||
5 | +import org.springframework.web.bind.annotation.*; | ||
6 | + | ||
7 | + | ||
8 | +/** | ||
9 | + * No description | ||
10 | + * (Generated with springmvc-raml-parser v.0.8.9) | ||
11 | + */ | ||
12 | +@RestController | ||
13 | +@RequestMapping("/v1/role") | ||
14 | +public interface RoleController { | ||
15 | + | ||
16 | + | ||
17 | + /** | ||
18 | + * Liste les rôles. Nécessite ROLE_ADMIN | ||
19 | + */ | ||
20 | + @RequestMapping(value = "", method = RequestMethod.GET) | ||
21 | + public ResponseEntity<?> getRole(); | ||
22 | + | ||
23 | + /** | ||
24 | + * Ajoute un nouveau rôle. Nécessite ROLE_ADMIN | ||
25 | + */ | ||
26 | + @RequestMapping(value = "", method = RequestMethod.POST) | ||
27 | + public ResponseEntity<?> updateRole( | ||
28 | + @RequestParam | ||
29 | + String nom); | ||
30 | + | ||
31 | + /** | ||
32 | + * Supprime un rôle. Nécessite ROLE_ADMIN | ||
33 | + */ | ||
34 | + @RequestMapping(value = "/{nomRole}", method = RequestMethod.DELETE) | ||
35 | + public ResponseEntity<?> deleteRoleById( | ||
36 | + @PathVariable | ||
37 | + String nomRole); | ||
38 | + | ||
39 | + /** | ||
40 | + * Ajoute une permission à un rôle. Nécessite ROLE_ADMIN | ||
41 | + */ | ||
42 | + @RequestMapping(value = "/{nomRole}", method = RequestMethod.POST) | ||
43 | + public ResponseEntity<?> updateRoleById( | ||
44 | + @PathVariable | ||
45 | + String nomRole, | ||
46 | + @RequestParam | ||
47 | + String nom); | ||
48 | + | ||
49 | + /** | ||
50 | + * Enlève la permission du rôle. Nécessite ROLE_ADMIN | ||
51 | + */ | ||
52 | + @RequestMapping(value = "/{nomRole}/{nomPermission}", method = RequestMethod.DELETE) | ||
53 | + public ResponseEntity<?> deleteRoleByNomPermission( | ||
54 | + @PathVariable | ||
55 | + String nomPermission, | ||
56 | + @PathVariable | ||
57 | + String nomRole); | ||
58 | + | ||
59 | + /** | ||
60 | + * Liste les permissions. Nécessite ROLE_ADMIN | ||
61 | + */ | ||
62 | + @RequestMapping(value = "/permission", method = RequestMethod.GET) | ||
63 | + public ResponseEntity<?> getPermission(); | ||
64 | + | ||
65 | +} |
src/main/java/etunicorn/generated/TransactionController.java
0 → 100644
@@ -0,0 +1,82 @@ | @@ -0,0 +1,82 @@ | ||
1 | + | ||
2 | +package etunicorn.generated; | ||
3 | + | ||
4 | +import org.springframework.http.ResponseEntity; | ||
5 | +import org.springframework.web.bind.annotation.*; | ||
6 | + | ||
7 | +import java.math.BigDecimal; | ||
8 | + | ||
9 | + | ||
10 | +/** | ||
11 | + * No description | ||
12 | + * (Generated with springmvc-raml-parser v.0.8.9) | ||
13 | + */ | ||
14 | +@RestController | ||
15 | +@RequestMapping("/v1/transaction") | ||
16 | +public interface TransactionController { | ||
17 | + | ||
18 | + | ||
19 | + /** | ||
20 | + * Permet de recuperer la liste des transaction | ||
21 | + */ | ||
22 | + @RequestMapping(value = "", method = RequestMethod.GET) | ||
23 | + public ResponseEntity<?> getTransaction(); | ||
24 | + | ||
25 | + /** | ||
26 | + * Permet de faire payer ou de crediter un Compte. >0 la personne a crediter de l'argent. <0 la personne a été débité. | ||
27 | + */ | ||
28 | + @RequestMapping(value = "/consomation", method = RequestMethod.POST) | ||
29 | + public ResponseEntity<?> updateConsomation( | ||
30 | + @RequestParam | ||
31 | + Long participant, | ||
32 | + @RequestParam | ||
33 | + Long id); | ||
34 | + | ||
35 | + /** | ||
36 | + * | ||
37 | + * | ||
38 | + */ | ||
39 | + @RequestMapping(value = "/evenement", method = RequestMethod.POST) | ||
40 | + public ResponseEntity<?> updateEvenement( | ||
41 | + @RequestParam | ||
42 | + Long participant, | ||
43 | + @RequestParam | ||
44 | + Long id); | ||
45 | + | ||
46 | + /** | ||
47 | + * Permet de recharger un compte | ||
48 | + */ | ||
49 | + @RequestMapping(value = "/evenement/credit", method = RequestMethod.POST) | ||
50 | + public ResponseEntity<?> updateEvenementCredit( | ||
51 | + @RequestParam | ||
52 | + Long participant, | ||
53 | + @RequestParam | ||
54 | + BigDecimal prix); | ||
55 | + | ||
56 | + /** | ||
57 | + * Permet de debiter la carte | ||
58 | + */ | ||
59 | + @RequestMapping(value = "/evenement/debit", method = RequestMethod.POST) | ||
60 | + public ResponseEntity<?> updateEvenementDebit( | ||
61 | + @RequestParam | ||
62 | + Long participant, | ||
63 | + @RequestParam | ||
64 | + BigDecimal prix); | ||
65 | + | ||
66 | + /** | ||
67 | + * Permet de recuperer la liste des transaction d'une personne | ||
68 | + */ | ||
69 | + @RequestMapping(value = "/participant/{idPersonne}", method = RequestMethod.GET) | ||
70 | + public ResponseEntity<?> getParticipantByIdPersonne( | ||
71 | + @PathVariable | ||
72 | + String idPersonne); | ||
73 | + | ||
74 | + /** | ||
75 | + * Permet de recuperer la liste des transaction d'une personne | ||
76 | + */ | ||
77 | + @RequestMapping(value = "/acteur/{idPersonne}", method = RequestMethod.GET) | ||
78 | + public ResponseEntity<?> getActeurByIdPersonne( | ||
79 | + @PathVariable | ||
80 | + String idPersonne); | ||
81 | + | ||
82 | +} |