Skip to content

Hung#57

Open
Hungs20 wants to merge 3 commits into
UETCodeCamp:masterfrom
Hungs20:hung
Open

Hung#57
Hungs20 wants to merge 3 commits into
UETCodeCamp:masterfrom
Hungs20:hung

Conversation

@Hungs20

@Hungs20 Hungs20 commented Jun 28, 2019

Copy link
Copy Markdown
Contributor

No description provided.

@quytm quytm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Push thừa: thư mục .idea, target

import java.util.Optional;

@RestController
public class UserController {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Đáng ra phải là UserService chứ?
e nên nhớ: có 3 tầng chính mà mình phải định nghĩa: Repo, Service, Controller



@Autowired
private UserController userController;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

không được phép gọi Controller trong 1 controller khác

return "add";
}
@PostMapping("add")
public String submitFormAdd(@RequestParam("name") String name,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e k cần đẩy lên từng field một như thế này, sử dụng @ModelAttribute để đẩy lên cả đối tượng User
có thể tham khảo code phía bạn VuVanTung

return "edit";
}
@PostMapping("edit/{id}")
public String submitEdit(@PathVariable("id") Long id,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tương tự trên, dùng @ModelAttribute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants