/** * Get organization info * * @param principal * @return organization object */ @RequestMapping(value = "/orginfo", method = RequestMethod.GET) public Organization getOrganization(Principal principal) { if (!Account.findRole(principal.getName()).equals("1")) { logger.error("[getOrganization] org: " + principal.getName() + " permission denied"); throw new PermissionErrorException(); } return accountService.getOrganization(Account.findMobile(principal.getName())); }
/** * Update organization * * @param principal * @param postclass * @return Boolean f */ @RequestMapping(value = "/orginfo", method = RequestMethod.PUT) public ResponseResult updateOrganization( Principal principal, @RequestBody Organization postclass) { if (!Account.findRole(principal.getName()).equals("1")) { logger.error("[updateOrganization] org: " + principal.getName() + " permission denied"); throw new PermissionErrorException(); } return accountService.updateOrganizationInfo( Account.findMobile(principal.getName()), postclass); }