Class ContactsController
java.lang.Object
info.ejava.examples.db.validation.contacts.controller.ContactsController
- Direct Known Subclasses:
ContactsConfiguration.ValidatedContactsController
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity
<PersonPocDTO> createPOC
(PersonPocDTO personDTO) org.springframework.http.ResponseEntity
<Void> org.springframework.http.ResponseEntity
<Void> deletePOC
(@Pattern(regexp="[0-9]+",message="must be a number",groups=DetailedOnly.class) String id) org.springframework.http.ResponseEntity
<PersonsPageDTO> findPocsByExample
(@PositiveOrZero Integer pageNumber, @Positive Integer pageSize, String sortString, PersonPocDTO probe) org.springframework.http.ResponseEntity
<PersonPocDTO> org.springframework.http.ResponseEntity
<?> positive
(@jakarta.validation.constraints.PositiveOrZero int value) This endpoint will always reach an internal validated exchange that causes a violation.org.springframework.http.ResponseEntity
<Void> updatePOC
(String id, @Valid PersonPocDTO personDTO)
-
Field Details
-
CONTACTS_PATH
- See Also:
-
CONTACT_PATH
- See Also:
-
RANDOM_CONTACT_PATH
- See Also:
-
EXAMPLE_CONTACTS_PATH
- See Also:
-
POSITIVE_OR_ZERO_PATH
- See Also:
-
contactsService
-
-
Constructor Details
-
ContactsController
public ContactsController()
-
-
Method Details
-
createPOC
@RequestMapping(path="api/contacts", method=POST, consumes={"application/json","application/xml"}, produces={"application/json","application/xml"}) @Validated(CreatePlusDefault.class) public org.springframework.http.ResponseEntity<PersonPocDTO> createPOC(@RequestBody @Validated(CreatePlusDefault.class) PersonPocDTO personDTO) -
getPOC
@RequestMapping(path="api/contacts/{id}", method=GET, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<PersonPocDTO> getPOC(@PathVariable(name="id") @Pattern(regexp="[0-9]+",message="must be a number") @Pattern(regexp="[0-9]+",message="must be a number") String id) -
updatePOC
@RequestMapping(path="api/contacts/{id}", method=PUT, consumes={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<Void> updatePOC(@PathVariable(value="id",required=true) String id, @RequestBody @Valid @Valid PersonPocDTO personDTO) -
deletePOC
@RequestMapping(path="api/contacts/{id}", method=DELETE) @Validated(DetailedOnly.class) public org.springframework.http.ResponseEntity<Void> deletePOC(@PathVariable(name="id",required=true) @Pattern(regexp="[0-9]+",message="must be a number",groups=DetailedOnly.class) @Pattern(regexp="[0-9]+",message="must be a number",groups=DetailedOnly.class) String id) -
deleteAllPOCs
@RequestMapping(path="api/contacts", method=DELETE) public org.springframework.http.ResponseEntity<Void> deleteAllPOCs() -
findPocsByExample
@RequestMapping(path="api/contacts/example", method=POST, consumes={"application/json","application/xml"}, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<PersonsPageDTO> findPocsByExample(@RequestParam(value="pageNumber",defaultValue="0",required=false) @PositiveOrZero @PositiveOrZero Integer pageNumber, @RequestParam(value="pageSize",required=false) @Positive @Positive Integer pageSize, @RequestParam(value="sort",required=false) String sortString, @RequestBody PersonPocDTO probe) -
positive
@RequestMapping(path="api/contacts/positiveOrZero", method=GET, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<?> positive(@PositiveOrZero @RequestParam(name="value") @jakarta.validation.constraints.PositiveOrZero int value) This endpoint will always reach an internal validated exchange that causes a violation. It is here to show the potential ambiguity of a client input error versus an internal error.
-