/** * /user/create/company?email=[email]&name=[name] -> create a new company * user and save it in the database. * * @param email The company's email * @param name The company's name * @return A string describing if the company is succesfully created or not. */ @RequestMapping("/user/create/company") @ResponseBody public String createCompany(String email, String name) { try { Company company = new Company(); company.setEmail(email); company.setName(name); companyRepository.save(company); } catch (Exception ex) { return "Error creating the company: " + ex.toString(); } return "Company succesfully created!"; }