feat: entrepreneur api and api service

This commit is contained in:
Théo Le Lez
2025-02-26 14:51:02 +01:00
parent e66fa33577
commit dd5ca2cbd7
5 changed files with 176 additions and 25 deletions

View File

@ -1,6 +1,6 @@
package enseirb.myinpulse.controller;
import enseirb.myinpulse.model.LCSection;
import enseirb.myinpulse.model.SectionCell;
import enseirb.myinpulse.model.Project;
import enseirb.myinpulse.service.EntrepreneurApiService;
@ -29,12 +29,12 @@ public class EntrepreneurApi {
* @return status code
*/
@PutMapping("/entrepreneur/lcsection/modify/{sectionId}")
public void editLCSection(
@PathVariable String sectionId,
@RequestBody LCSection section,
public void editSectionCell(
@PathVariable Long sectionId,
@RequestBody SectionCell sectionCell,
@AuthenticationPrincipal Jwt principal) {
entrepreneurApiService.editLCSection(
sectionId, section, principal.getClaimAsString("email"));
entrepreneurApiService.editSectionCell(
sectionId, sectionCell, principal.getClaimAsString("email"));
}
/**
@ -45,9 +45,9 @@ public class EntrepreneurApi {
* @return status code
*/
@DeleteMapping("/entrepreneur/lcsection/remove/{sectionId}")
public void removeLCSection(
@PathVariable String sectionId, @AuthenticationPrincipal Jwt principal) {
entrepreneurApiService.removeLCSection(sectionId, principal.getClaimAsString("email"));
public void removeSectionCell(
@PathVariable Long sectionId, @AuthenticationPrincipal Jwt principal) {
entrepreneurApiService.removeSectionCell(sectionId, principal.getClaimAsString("email"));
}
/**
@ -57,13 +57,10 @@ public class EntrepreneurApi {
*
* @return status code
*/
@PostMapping("/entrepreneur/lcsection/add/{sectionId}")
@PostMapping("/entrepreneur/lcsection/add") // remove id from doc aswell
public void addLCSection(
@PathVariable String sectionId,
@RequestBody LCSection section,
@AuthenticationPrincipal Jwt principal) {
entrepreneurApiService.addLCSection(
sectionId, section, principal.getClaimAsString("email"));
@RequestBody SectionCell sectionCell, @AuthenticationPrincipal Jwt principal) {
entrepreneurApiService.addSectionCell(sectionCell, principal.getClaimAsString("email"));
}
/**