We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removes redundant hashmap declarations and replaces them with Response. Fix to handle http status code correctly when an error occurs.
Before
public Map<String, String> insertRole(@RequestBody RoleInformation roleInformation) { if (AdditionValueValidator.validateRoleId(roleInformation.getRoleId()) == false) { Map<String, String> result = new HashMap<>(); result.put("errorCode", "500"); result.put("errorMessage", "roleId pattern is invalid"); return result; } roleService.insertRoleInformation(roleInformation); Map<String, String> result = new HashMap<>(); result.put("result", "SUCCESS"); return result; }
After
public ResponseEntity<Response> insertRole(@RequestBody RoleInformation roleInformation) { if (AdditionValueValidator.validateRoleId(roleInformation.getRoleId()) == false) { return ErrorResponse.badRequest("roleId pattern is invalid"); } roleService.insertRoleInformation(roleInformation); return SuccessResponse.ok(); }
The text was updated successfully, but these errors were encountered:
[pinpoint-apm#8806] Refactor HashMap for HttpResponse to Response object
764e90e
b03f306
df7b3e2
[pinpoint-apm#8806] Apply ResponseEntity to CodeResult
7290c0a
4689c5b
[#8806] Refactor HashMap for HttpResponse to Response object
89b4570
[#8806] Apply ResponseEntity to CodeResult
13763b7
Successfully merging a pull request may close this issue.
Removes redundant hashmap declarations and replaces them with Response.
Fix to handle http status code correctly when an error occurs.
Before
After
The text was updated successfully, but these errors were encountered: