feat: entrepreneur api and api service
This commit is contained in:
@ -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"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user