I have implemented the CustomerEndpoint like this.
Code: Select all
@RestController
@RequestMapping(value ="/customer/",
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE},
consumes = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE})
public class CustomerEndpoint extends
org.broadleafcommerce.core.web.api.endpoint.customer.CustomerEndpoint {
@RequestMapping(value = "search", method = RequestMethod.GET)
public CustomerWrapper findCustomerByEmail(HttpServletRequest request, @RequestParam("email") String emailAddress) {
Customer customer = customerService.readCustomerByEmail(emailAddress);
if (customer != null) {
CustomerWrapper wrapper;
wrapper = (CustomerWrapper) context.getBean(CustomerWrapper.class.getName());
wrapper.wrapDetails(customer, request);
return wrapper;
}
throw BroadleafWebServicesException.build(HttpStatus.NOT_FOUND.value())
.addMessage(BroadleafWebServicesException.CUSTOMER_NOT_FOUND, emailAddress);
}
}
However, I get nothing when I hit /api/v1/customer/search
Is there anything I am missing? Please help.