PAN-52 Fixed a typo in the parameter arguments

This commit is contained in:
2019-03-17 13:58:51 -06:00
parent 52a21e72f3
commit 2c03c75938
5 changed files with 23 additions and 23 deletions
+1 -1
View File
@@ -38,5 +38,5 @@ jobs:
script: ./gradlew test script: ./gradlew test
- stage: Integration Tests - stage: Integration Tests
script: ./gradlew integrationTest script: ./gradlew integrationTest
- stage: Sonar analysis - stage: Sonar Analysis
script: ./gradlew sonar script: ./gradlew sonar
@@ -26,7 +26,7 @@ import java.util.Optional;
public class AccountController { public class AccountController {
private final AccountsRepository accountsRepository; private final AccountsRepository accountsRepository;
@GetMapping("/") @GetMapping({"","/"})
public @ResponseBody public @ResponseBody
ResponseEntity<Iterable<AccountDto>> getListOfAccounts() { ResponseEntity<Iterable<AccountDto>> getListOfAccounts() {
LOG.info("Received request to list all accounts"); LOG.info("Received request to list all accounts");
@@ -46,9 +46,9 @@ public class AccountController {
return new ResponseEntity<>(listOfAccounts, HttpStatus.OK); return new ResponseEntity<>(listOfAccounts, HttpStatus.OK);
} }
@GetMapping("/{id}") @GetMapping("/id")
public @ResponseBody public @ResponseBody
ResponseEntity<AccountDto> getAccountById(@PathVariable("id") final Integer id) { ResponseEntity<AccountDto> getAccountById(@RequestParam("id") final Integer id) {
LOG.info("Received request to query for account with id {}", id); LOG.info("Received request to query for account with id {}", id);
if (id == null) { if (id == null) {
LOG.error("ERROR: ID was null"); LOG.error("ERROR: ID was null");
@@ -75,9 +75,9 @@ public class AccountController {
); );
} }
@GetMapping("/{username}") @GetMapping("/username")
public @ResponseBody public @ResponseBody
ResponseEntity<AccountDto> getAccountByUsername(@PathVariable("username") final String username) { ResponseEntity<AccountDto> getAccountByUsername(@RequestParam("username") final String username) {
LOG.info("Received request to query for account with username {}", username); LOG.info("Received request to query for account with username {}", username);
if (username == null) { if (username == null) {
LOG.error("ERROR: username was null"); LOG.error("ERROR: username was null");
@@ -104,7 +104,7 @@ public class AccountController {
); );
} }
@PostMapping("/") @PostMapping({"","/"})
@Validated({AccountDto.Insert.class, Default.class}) @Validated({AccountDto.Insert.class, Default.class})
public @ResponseBody ResponseEntity<AccountDto> insertAccount( public @ResponseBody ResponseEntity<AccountDto> insertAccount(
@Valid @RequestBody final AccountDto accountDto, final BindingResult bindingResult) { @Valid @RequestBody final AccountDto accountDto, final BindingResult bindingResult) {
@@ -24,7 +24,7 @@ import java.util.Optional;
public class DefinitionController { public class DefinitionController {
private final DefinitionRepository definitionRepository; private final DefinitionRepository definitionRepository;
@GetMapping("/") @GetMapping({"","/"})
public @ResponseBody public @ResponseBody
ResponseEntity<Iterable<DefinitionDto>> getAllDefinitions() { ResponseEntity<Iterable<DefinitionDto>> getAllDefinitions() {
LOG.info("Received request to list all definitions"); LOG.info("Received request to list all definitions");
@@ -73,7 +73,7 @@ public class DefinitionController {
} }
@PostMapping("/") @PostMapping({"","/"})
@Validated({DefinitionDto.Insert.class, Default.class}) @Validated({DefinitionDto.Insert.class, Default.class})
public @ResponseBody ResponseEntity<DefinitionDto> insertDefinition( public @ResponseBody ResponseEntity<DefinitionDto> insertDefinition(
@Valid @RequestBody final DefinitionDto definitionDto, @Valid @RequestBody final DefinitionDto definitionDto,
@@ -24,7 +24,7 @@ import java.util.Optional;
public class ProofController { public class ProofController {
private final ProofRepository proofRepository; private final ProofRepository proofRepository;
@GetMapping("/") @GetMapping({"","/"})
public @ResponseBody public @ResponseBody
ResponseEntity<Iterable<ProofDto>> getAllProofs() { ResponseEntity<Iterable<ProofDto>> getAllProofs() {
LOG.info("Received request to list all theorems"); LOG.info("Received request to list all theorems");
@@ -43,9 +43,9 @@ public class ProofController {
return new ResponseEntity<>(listOfProofs, HttpStatus.OK); return new ResponseEntity<>(listOfProofs, HttpStatus.OK);
} }
@GetMapping("/{id}") @GetMapping("/id")
public @ResponseBody public @ResponseBody
ResponseEntity<ProofDto> getProofById(@PathVariable("id") final Integer id) { ResponseEntity<ProofDto> getProofById(@RequestParam("id") final Integer id) {
LOG.info("Received request to query for proof with id {}", id); LOG.info("Received request to query for proof with id {}", id);
if (id == null) { if (id == null) {
LOG.error("ERROR: ID was null"); LOG.error("ERROR: ID was null");
@@ -73,9 +73,9 @@ public class ProofController {
} }
@GetMapping("/{branch}") @GetMapping("/branch")
public @ResponseBody public @ResponseBody
ResponseEntity<List<ProofDto>> getAllProofsByBranch(@PathVariable("branch") final String branch) { ResponseEntity<List<ProofDto>> getAllProofsByBranch(@RequestParam("branch") final String branch) {
LOG.info("Received request to query for proofs related to the {} branch of mathematics", branch); LOG.info("Received request to query for proofs related to the {} branch of mathematics", branch);
if (branch == null) { if (branch == null) {
LOG.error("ERROR: branch was null"); LOG.error("ERROR: branch was null");
@@ -103,7 +103,7 @@ public class ProofController {
return new ResponseEntity<>(listOfProofs, HttpStatus.OK); return new ResponseEntity<>(listOfProofs, HttpStatus.OK);
} }
@GetMapping("/{theorem_name}") @GetMapping("/theorem_name")
public @ResponseBody public @ResponseBody
ResponseEntity<List<ProofDto>> getAllProofsByTheoremName(@PathVariable("theorem_name") final String theoremName) { ResponseEntity<List<ProofDto>> getAllProofsByTheoremName(@PathVariable("theorem_name") final String theoremName) {
LOG.info("Received request to query for proofs of the theorem {}", theoremName); LOG.info("Received request to query for proofs of the theorem {}", theoremName);
@@ -133,7 +133,7 @@ public class ProofController {
return new ResponseEntity<>(listOfProofs, HttpStatus.OK); return new ResponseEntity<>(listOfProofs, HttpStatus.OK);
} }
@PostMapping("/") @PostMapping({"","/"})
@Validated({ProofDto.Insert.class, Default.class}) @Validated({ProofDto.Insert.class, Default.class})
public @ResponseBody ResponseEntity<ProofDto> insertProof( public @ResponseBody ResponseEntity<ProofDto> insertProof(
@Valid @RequestBody final ProofDto proofDto, @Valid @RequestBody final ProofDto proofDto,
@@ -24,7 +24,7 @@ import java.util.Optional;
public class TheoremController { public class TheoremController {
private final TheoremRepository theoremRepository; private final TheoremRepository theoremRepository;
@GetMapping("/") @GetMapping({"","/"})
public @ResponseBody public @ResponseBody
ResponseEntity<Iterable<TheoremDto>> getAllTheorems() { ResponseEntity<Iterable<TheoremDto>> getAllTheorems() {
LOG.info("Received request to list all theorems"); LOG.info("Received request to list all theorems");
@@ -43,9 +43,9 @@ public class TheoremController {
return new ResponseEntity<>(listOfTheorems, HttpStatus.OK); return new ResponseEntity<>(listOfTheorems, HttpStatus.OK);
} }
@GetMapping("/{branch}") @GetMapping("/branch")
public @ResponseBody public @ResponseBody
ResponseEntity<List<TheoremDto>> getAllTheoremsByBranch(@PathVariable("branch") final String branch) { ResponseEntity<List<TheoremDto>> getAllTheoremsByBranch(@RequestParam("branch") final String branch) {
LOG.info("Received request to query for theorems related to the {} branch of mathematics", branch); LOG.info("Received request to query for theorems related to the {} branch of mathematics", branch);
if (branch == null) { if (branch == null) {
LOG.error("ERROR: branch was null"); LOG.error("ERROR: branch was null");
@@ -73,7 +73,7 @@ public class TheoremController {
return new ResponseEntity<>(listOfTheorems, HttpStatus.OK); return new ResponseEntity<>(listOfTheorems, HttpStatus.OK);
} }
@GetMapping("/{proven_status}") @GetMapping("/proven_status")
public @ResponseBody public @ResponseBody
ResponseEntity<List<TheoremDto>> getAllTheoremsByProvenStatus(@PathVariable("proven_status") final Boolean provenStatus) { ResponseEntity<List<TheoremDto>> getAllTheoremsByProvenStatus(@PathVariable("proven_status") final Boolean provenStatus) {
LOG.info("Received request to query for theorems whose proven status is {}", provenStatus); LOG.info("Received request to query for theorems whose proven status is {}", provenStatus);
@@ -103,7 +103,7 @@ public class TheoremController {
return new ResponseEntity<>(listOfTheorems, HttpStatus.OK); return new ResponseEntity<>(listOfTheorems, HttpStatus.OK);
} }
@GetMapping("/{name}") @GetMapping("/name")
public @ResponseBody public @ResponseBody
ResponseEntity<List<TheoremDto>> getAllTheoremsByName(@PathVariable("name") final String name) { ResponseEntity<List<TheoremDto>> getAllTheoremsByName(@PathVariable("name") final String name) {
LOG.info("Received request to query for theorems whose name is {}", name); LOG.info("Received request to query for theorems whose name is {}", name);
@@ -133,7 +133,7 @@ public class TheoremController {
return new ResponseEntity<>(listOfTheorems, HttpStatus.OK); return new ResponseEntity<>(listOfTheorems, HttpStatus.OK);
} }
@GetMapping("/{id}") @GetMapping("/id")
public @ResponseBody public @ResponseBody
ResponseEntity<TheoremDto> getTheoremById(@PathVariable("id") final Integer id) { ResponseEntity<TheoremDto> getTheoremById(@PathVariable("id") final Integer id) {
LOG.info("Received request to query for theorem with id {}", id); LOG.info("Received request to query for theorem with id {}", id);
@@ -163,7 +163,7 @@ public class TheoremController {
} }
@PostMapping("/") @PostMapping({"","/"})
@Validated({TheoremDto.Insert.class, Default.class}) @Validated({TheoremDto.Insert.class, Default.class})
public @ResponseBody ResponseEntity<TheoremDto> insertTheorem( public @ResponseBody ResponseEntity<TheoremDto> insertTheorem(
@Valid @RequestBody final TheoremDto theoremDto, @Valid @RequestBody final TheoremDto theoremDto,