public class RoleFunctionListController extends RestrictedBaseController {
private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(RoleFunctionListController.class);
+ private static final String SUCCESS = "SUCCESS";
@Autowired
private RoleService service;
RoleFunction domainRoleFunction = service.getRoleFunction(user.getOrgUserId(), code);
domainRoleFunction.setName(availableRoleFunction.getName());
domainRoleFunction.setCode(code);
- restCallStatus = "success";
+ restCallStatus = SUCCESS;
service.saveRoleFunction(user.getOrgUserId(), domainRoleFunction);
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "saveRoleFunction failed", e);
RoleFunction availableRoleFunction = mapper.readValue(data, RoleFunction.class);
String code = availableRoleFunction.getCode();
List<RoleFunction> currentRoleFunction = service.getRoleFunctions(user.getOrgUserId());
- restCallStatus = "success";
+ restCallStatus = SUCCESS;
for (RoleFunction roleF : currentRoleFunction) {
if (roleF.getCode().equals(code)) {
restCallStatus = "code exists";
service.deleteRoleFunction(user.getOrgUserId(), domainRoleFunction);
logger.info(EELFLoggerDelegate.auditLogger, "Remove role function " + domainRoleFunction.getName());
- restCallStatus = "success";
+ restCallStatus = SUCCESS;
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "removeRoleFunction failed", e);
throw new IOException(e);