forked from bwerquin/Knowledge-Back-Office
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from davdarras/main
feat: use generics and no generics :p
- Loading branch information
Showing
39 changed files
with
355 additions
and
433 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/java/fr/insee/knowledge/controller/hierarchy/GenericHierarchyController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package fr.insee.knowledge.controller.hierarchy; | ||
|
||
import fr.insee.knowledge.domain.hierarchy.*; | ||
import fr.insee.knowledge.service.GenericHierarchyService; | ||
import fr.insee.knowledge.service.impl.HierarchyGsbpmServiceImpl; | ||
import fr.insee.knowledge.service.impl.HierarchyProductServiceImpl; | ||
import fr.insee.knowledge.service.impl.HierarchySvcServiceImpl; | ||
import fr.insee.knowledge.service.impl.HierarchyUserServiceImpl; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
public class GenericHierarchyController<T extends Hierarchy> { | ||
|
||
private final static Logger logger = LoggerFactory.getLogger(GenericHierarchyController.class); | ||
|
||
private final GenericHierarchyService<T> hierarchyService; | ||
|
||
public GenericHierarchyController(GenericHierarchyService<T> hierarchyService) { | ||
this.hierarchyService = hierarchyService; | ||
} | ||
|
||
public ResponseEntity<T> getHierarchy() { | ||
return new ResponseEntity<T>(hierarchyService.getHierarchy(), HttpStatus.OK); | ||
} | ||
} |
64 changes: 0 additions & 64 deletions
64
src/main/java/fr/insee/knowledge/controller/hierarchy/HierarchyController.java
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
src/main/java/fr/insee/knowledge/controller/hierarchy/HierarchyGsbpmController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package fr.insee.knowledge.controller.hierarchy; | ||
|
||
import fr.insee.knowledge.domain.hierarchy.HierarchyGsbpm; | ||
import fr.insee.knowledge.service.impl.HierarchyGsbpmServiceImpl; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@Tag(name = "Hierarchy", description = "") | ||
@RestController | ||
@RequestMapping(path = "/hierarchy") | ||
public class HierarchyGsbpmController extends GenericHierarchyController<HierarchyGsbpm> { | ||
public HierarchyGsbpmController(HierarchyGsbpmServiceImpl hierarchyService) { | ||
super(hierarchyService); | ||
} | ||
|
||
@Operation(summary = "Get Gsbpm") | ||
@GetMapping(path = "/gsbpm") | ||
public ResponseEntity<HierarchyGsbpm> getGsbpm() { | ||
return getHierarchy(); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/fr/insee/knowledge/controller/hierarchy/HierarchyProductController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package fr.insee.knowledge.controller.hierarchy; | ||
|
||
import fr.insee.knowledge.domain.hierarchy.HierarchyProduct; | ||
import fr.insee.knowledge.service.impl.HierarchyProductServiceImpl; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@Tag(name = "Hierarchy", description = "") | ||
@RestController | ||
@RequestMapping(path = "/hierarchy") | ||
public class HierarchyProductController extends GenericHierarchyController<HierarchyProduct> { | ||
public HierarchyProductController(HierarchyProductServiceImpl hierarchyService) { | ||
super(hierarchyService); | ||
} | ||
|
||
@Operation(summary = "Get Products") | ||
@GetMapping(path = "/products") | ||
public ResponseEntity<HierarchyProduct> getProducts() { | ||
return getHierarchy(); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/fr/insee/knowledge/controller/hierarchy/HierarchyServiceController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package fr.insee.knowledge.controller.hierarchy; | ||
|
||
import fr.insee.knowledge.domain.hierarchy.HierarchySvc; | ||
import fr.insee.knowledge.service.impl.HierarchySvcServiceImpl; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@Tag(name = "Hierarchy", description = "") | ||
@RestController | ||
@RequestMapping(path = "/hierarchy") | ||
public class HierarchyServiceController extends GenericHierarchyController<HierarchySvc> { | ||
public HierarchyServiceController(HierarchySvcServiceImpl hierarchyService) { | ||
super(hierarchyService); | ||
} | ||
|
||
@Operation(summary = "Get Services") | ||
@GetMapping(path = "/services") | ||
public ResponseEntity<HierarchySvc> getServices() { | ||
return getHierarchy(); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/fr/insee/knowledge/controller/hierarchy/HierarchyUserController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package fr.insee.knowledge.controller.hierarchy; | ||
|
||
import fr.insee.knowledge.domain.hierarchy.HierarchyProduct; | ||
import fr.insee.knowledge.domain.hierarchy.HierarchyUser; | ||
import fr.insee.knowledge.service.impl.HierarchyProductServiceImpl; | ||
import fr.insee.knowledge.service.impl.HierarchyUserServiceImpl; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@Tag(name = "Hierarchy", description = "") | ||
@RestController | ||
@RequestMapping(path = "/hierarchy") | ||
public class HierarchyUserController extends GenericHierarchyController<HierarchyUser> { | ||
public HierarchyUserController(HierarchyUserServiceImpl hierarchyService) { | ||
super(hierarchyService); | ||
} | ||
|
||
@Operation(summary = "Get Users") | ||
@GetMapping(path = "/users") | ||
public ResponseEntity<HierarchyUser> getUsers() { | ||
return getHierarchy(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
src/main/java/fr/insee/knowledge/dao/HierarchyProductDAO.java
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
src/main/java/fr/insee/knowledge/dao/HierarchyServiceDAO.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.