fix: made endpoints match documentation naming conventions 'just the mapping' and noted endpoints not yet implemented in documentation/openapi/notes.md
Some checks failed
Format / formatting (push) Failing after 6s
Build / build (push) Successful in 40s
CI / build (push) Successful in 11s

This commit is contained in:
2025-04-21 23:55:14 +02:00
parent 561f6d16b3
commit 8a13993d8a
9 changed files with 38 additions and 113 deletions

View File

@ -1,14 +1,19 @@
package enseirb.myinpulse.controller;
import enseirb.myinpulse.model.Project;
import enseirb.myinpulse.model.SectionCell;
import enseirb.myinpulse.service.EntrepreneurApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.security.oauth2.jwt.Jwt;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import enseirb.myinpulse.model.Project;
import enseirb.myinpulse.model.SectionCell;
import enseirb.myinpulse.service.EntrepreneurApiService;
@SpringBootApplication
@RestController
@ -28,13 +33,13 @@ public class EntrepreneurApi {
*
* @return status code
*/
@PutMapping("/entrepreneur/lcsection/modify/{sectionId}")
@PutMapping("/entrepreneur/sectionCells/{sectionCellId}")
public void editSectionCell(
@PathVariable Long sectionId,
@PathVariable Long sectionCellId,
@RequestBody String content,
@AuthenticationPrincipal Jwt principal) {
entrepreneurApiService.editSectionCell(
sectionId, content, principal.getClaimAsString("email"));
sectionCellId, content, principal.getClaimAsString("email"));
}
/**
@ -44,10 +49,10 @@ public class EntrepreneurApi {
*
* @return status code
*/
@DeleteMapping("/entrepreneur/lcsection/remove/{sectionId}")
@DeleteMapping("/entrepreneur/sectionCells/{sectionCellId}")
public void removeSectionCell(
@PathVariable Long sectionId, @AuthenticationPrincipal Jwt principal) {
entrepreneurApiService.removeSectionCell(sectionId, principal.getClaimAsString("email"));
@PathVariable Long sectionCellId, @AuthenticationPrincipal Jwt principal) {
entrepreneurApiService.removeSectionCell(sectionCellId, principal.getClaimAsString("email"));
}
/**
@ -57,7 +62,7 @@ public class EntrepreneurApi {
*
* @return status code
*/
@PostMapping("/entrepreneur/lcsection/add") // remove id from doc aswell
@PostMapping("/entrepreneur/sectionCells")
public void addLCSection(
@RequestBody SectionCell sectionCell, @AuthenticationPrincipal Jwt principal) {
entrepreneurApiService.addSectionCell(sectionCell, principal.getClaimAsString("email"));
@ -70,7 +75,7 @@ public class EntrepreneurApi {
*
* @return status code
*/
@PostMapping("/entrepreneur/project/request")
@PostMapping("/entrepreneur/projects/request")
public void requestNewProject(
@RequestBody Project project, @AuthenticationPrincipal Jwt principal) {
entrepreneurApiService.requestNewProject(project, principal.getClaimAsString("email"));