cdsl#49
Open
ruong32 wants to merge 7 commits into
Open
Conversation
quytm
reviewed
Jun 26, 2019
| @RestController | ||
| public class AddingController { | ||
| @Autowired | ||
| CustomerServices cServices; |
Contributor
There was a problem hiding this comment.
tên của service sẽ là số ít
chuyển: CustomerService -> CustomerService
quytm
reviewed
Jul 2, 2019
quytm
left a comment
Contributor
There was a problem hiding this comment.
- Tên các package, class nên đặt ở số ít: sửa
modelsthànhmodel - Với project nhỏ có thể chia thành nhiều controller (
AddingController, ...), tuy nhiên, nên gộp lại thànhCustomerController - Đặt các controller vào package
controller - 2 hàm
transferMoneyvàreceiveMoneytrongCustomer.javaphải đưa vàoCustomerServicevì nó liên quan tới business,Customer.javachỉ có nhiệm vụ mô tả dữ liệu - Push thừa: thư mục .idea và thay đổi trong thư mục của bạn khác (Chu Van Hung và Vu Van Tung)
|
|
||
|
|
||
| @RestController | ||
| public class Search { |
| import org.springframework.web.bind.annotation.RequestParam; | ||
|
|
||
| @Controller | ||
| public class TransferingController { |
|
|
||
| @PostMapping(value="/delete") | ||
| public void delCustomer(@RequestBody String delId) { | ||
| delId = delId.substring(3,delId.length()); |
Contributor
There was a problem hiding this comment.
e có thể dùng delId.substring(3) để thay thế
| customerRepository.save(c); | ||
| return true; | ||
| } | ||
| return false; |
Contributor
There was a problem hiding this comment.
dòng 45->50, có thể thay thế bằng đoạn code này => code rõ ràng, dễ nhìn hơn
if (!c.getPassword().equals(pass)) return false;
c.setLogin(1);
customerRepository.save(c);
return true;| String result = new String(); | ||
|
|
||
| List<String> listResult = new ArrayList<>(); | ||
| for(Customer customer : getAllCustomer()){ |
Contributor
There was a problem hiding this comment.
hàm search() chỉ nên trả về List<Customer>, nó không làm nhiệm vụ generate UI.
nên thực hiện việc đó sau khi ajax lấy được kết quả của /search
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.
No description provided.