Open
Conversation
truongnguyenptit
requested changes
Jul 31, 2019
| // make this as rest controller | ||
|
|
||
| @RestController | ||
| @RequestMapping(path="/api/v1/employee") // This means URL's start with /user (after Application path) |
Collaborator
There was a problem hiding this comment.
url neen laf: path="/api/v1/employees"
| return "Welcome to Java Inspires"; | ||
| } | ||
|
|
||
| @GetMapping(path = "/addemployee") |
Collaborator
There was a problem hiding this comment.
Khi server ghi dữ liệu vào CSDL thì là method Post, e đang để GetMapping
path chỉ cần path = "/" là được
|
|
||
| @GetMapping(path = "/addemployee") | ||
| // @ResponseBody | ||
| public ResponseEntity<?> addemployee(@RequestParam int id, @RequestParam String firstName, @RequestParam String lastName, @RequestParam String address) { |
Collaborator
There was a problem hiding this comment.
method nên đặt theo camelCase
và để CRUD cho dễ tìm sau này. addemployee => createEmployeee
| * this method return list of usernames | ||
| * @return usernameList | ||
| */ | ||
| @GetMapping(path = "/getallemployee") |
Collaborator
There was a problem hiding this comment.
path = "/getallemployee" => path = "/"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please check my code !!!!