Mini refactor
This commit is contained in:
@@ -16,7 +16,7 @@ import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/auth")
|
||||
@RequestMapping("/auth")
|
||||
public class AuthenticationController {
|
||||
private final AuthenticationService authenticationService;
|
||||
|
||||
|
@@ -17,7 +17,8 @@ import org.springframework.web.bind.annotation.*;
|
||||
import java.util.Optional;
|
||||
|
||||
@RestController
|
||||
public class BibleReadingPlanMapping extends SecureApiRestController {
|
||||
@RequestMapping("/secure/bible-reading-plan")
|
||||
public class BibleReadingPlanMapping {
|
||||
|
||||
private final EntityManager entityManager;
|
||||
private final BibleReadingPlanRepository bibleReadingPlanRepository;
|
||||
@@ -27,8 +28,8 @@ public class BibleReadingPlanMapping extends SecureApiRestController {
|
||||
this.bibleReadingPlanRepository = bibleReadingPlanRepository;
|
||||
}
|
||||
|
||||
@GetMapping("/bible-reading-plan")
|
||||
public ResponseEntity<Object> getBibleReadingPlans(@RequestParam(required = true) Long id) {
|
||||
@GetMapping
|
||||
public ResponseEntity<Object> getBibleReadingPlans(@RequestParam(name = "id", required = true) Long id) {
|
||||
Optional<BibleReadingPlan> brp = bibleReadingPlanRepository.findById(id);
|
||||
if(brp.isEmpty()) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
||||
@@ -44,7 +45,7 @@ public class BibleReadingPlanMapping extends SecureApiRestController {
|
||||
return new ResponseEntity<>(bibleReadingPlanDTO, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/bible-reading-plan")
|
||||
@PostMapping
|
||||
public ResponseEntity<Object> createBibleReadingPlan(@RequestBody BibleReadingPlanDTO bibleReadingPlanDTO) {
|
||||
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
|
||||
|
||||
|
Reference in New Issue
Block a user