Fin intégration quinte plus
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package com.pmumali.ch5_trio.controller;
|
||||
|
||||
import com.pmumali.ch5_trio.dto.ResultatCourseDto;
|
||||
import com.pmumali.ch5_trio.service.ResultatCourseService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/resultats")
|
||||
public class ResultatCourseController {
|
||||
@Autowired
|
||||
private ResultatCourseService resultatCourseService;
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<?> enregistrerResultat(@RequestBody ResultatCourseDto resultatDto) {
|
||||
try {
|
||||
resultatCourseService.traiterResultatCourse(resultatDto);
|
||||
return ResponseEntity.ok().build();
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.badRequest().body(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user