Skip to content
New issue

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

Bài tập về nhà buổi 4 #8

Open
dngiang2003 opened this issue Apr 7, 2024 · 0 comments
Open

Bài tập về nhà buổi 4 #8

dngiang2003 opened this issue Apr 7, 2024 · 0 comments

Comments

@dngiang2003
Copy link
Collaborator

dngiang2003 commented Apr 7, 2024

Tài liệu buổi 4 trên lớp base mvc.

Pull code mới nhất từ nhánh master git pull origin master

Tạo nhánh mới git checkout -b btvn-buoi4/ho-va-ten

Dựa vào kiến thức đã học viết mới 6 API liên quan tới user chi tiết như sau:

Route Method Mô tả
/api/v1/users POST Trả về fullname, email và password từ req.body
/api/v1/users GET Trả về mảng users: [] (rỗng) và các query từ res.query
/api/v1/users/:userId GET Trả về message: "Lấy thông tin người dùng có Id ${userId} thành công"
/api/v1/users/:userId PUT Trả về message: "Cập nhật thông tin người dùng có Id ${userId} thành công". Kèm fullname và password từ req.body
/api/v1/users/:userId DELETE Trả về message: "Xoá người dùng có Id ${userId} thành công"
/api/v1/users/:userId OPTIONS Trả về message: "Khoá người dùng có Id ${userId} thành công"

Chú ý tách file như đã học trên lớp - thêm 2 file user.controller.jsuser.route.js kèm sửa file server.js

Đặt tên hàm gợi ý chức năng: createUser, getUsers, getUserById, updateUserById, deleteUserById, lockUserById

Sau khi hoàn thành push lên nhánh của mình và tạo pull request. Tag mình hoặc các supporter khác nhé

Hạn nộp bài 20h thứ 6 12/04/2024 👍

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

No branches or pull requests

1 participant