@Secured({ "ROLE_CLIENT", "ROLE_TRUSTED_CLIENT", "ROLE_CUSTOMERMANAGERGROUP","ROLE_CUSTOMERGROUP" })
@PostMapping(value = "/create", consumes ={ MediaType.MULTIPART_FORM_DATA_VALUE , MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE })
@ResponseBody
@ApiOperation(nickname = "SaveCompanyDetail", value = " Saves Company Detail", notes = "Saves Company Detail requires the WsDTO with the customer data.", produces = MediaType.APPLICATION_JSON_VALUE)
@ApiBaseSiteIdParam
public String createCompanyDetail(@RequestPart(value = "companyDetails", required = false) final CompanyDetailsData dataObject, @RequestPart(value = "companyLogo", required = false) final MultipartFile companyLogo) {
try {
///getting dataObject all the time
} catch (Exception ex) {
LOG.error("createCompanyDetail :: ",ex.getMessage());
return FAILED;
}
return SUCCESS;
}
public class CompanyDetailsData implements Serializable {
private static final long serialVersionUID = 1L;
private String id;
private String email;
private String title;
private String phoneNumber;
}
Always getting null in dataObject object in the controller class.
Payload: { "id": "123", "email": "string", "phoneNumber": "string", "title": "title test" }