Fin intégration quinte plus
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package com.pmumali.ch11_quinteplus.controller;
|
||||
|
||||
|
||||
|
||||
import com.pmumali.ch11_quinteplus.model.Cagnotte;
|
||||
import com.pmumali.ch11_quinteplus.service.ServiceCagnotte;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/cagnotte")
|
||||
public class ControleurCagnotte {
|
||||
|
||||
@Autowired
|
||||
private ServiceCagnotte serviceCagnotte;
|
||||
|
||||
@GetMapping("/montant")
|
||||
public ResponseEntity<Double> getMontantCagnotteActive() {
|
||||
return ResponseEntity.ok(serviceCagnotte.getMontantCagnotteActive());
|
||||
}
|
||||
|
||||
@GetMapping("/historique")
|
||||
public ResponseEntity<List<Cagnotte>> getHistoriqueCagnottes() {
|
||||
return ResponseEntity.ok(serviceCagnotte.getHistoriqueCagnottes());
|
||||
}
|
||||
|
||||
@PostMapping("/gerer-cas-particuliers")
|
||||
public ResponseEntity<String> gererCasParticuliers() {
|
||||
serviceCagnotte.gererCasParticuliersCagnotte();
|
||||
return ResponseEntity.ok("Cas particuliers de cagnotte gérés avec succès");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user