modif
This commit is contained in:
parent
a73a34f29a
commit
c83632ea6d
3 changed files with 31 additions and 0 deletions
5
pom.xml
5
pom.xml
|
|
@ -76,6 +76,11 @@
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springdoc</groupId>
|
||||||
|
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||||
|
<version>2.8.6</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package fr.clelia.avis.controller;
|
||||||
|
|
||||||
|
import fr.clelia.avis.business.Editeur;
|
||||||
|
import fr.clelia.avis.repository.EditeurRepository;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/editeur")
|
||||||
|
public class EditeurRestController {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EditeurRepository editeurRepository;
|
||||||
|
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public Editeur getEntityById(@PathVariable int id) {
|
||||||
|
return editeurRepository.findById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -27,4 +27,6 @@ public interface EditeurRepository extends JpaRepository<Editeur, Long> {
|
||||||
WHERE j IS NULL
|
WHERE j IS NULL
|
||||||
""")
|
""")
|
||||||
List<Editeur> findEditeurWithoutJeux();
|
List<Editeur> findEditeurWithoutJeux();
|
||||||
|
|
||||||
|
Editeur findById(int id);
|
||||||
}
|
}
|
||||||
Loading…
Add table
Reference in a new issue