1. Clone dự án
git clone https://github.com/ledinhloc/APIUniDocs.git2. Tạo cơ sở dữ liệu database
create database uni_docs3. Thay đổi tên người dùng và mật khẩu mysql theo cài đặt của bạn
- Mở
src/main/resources/application.yaml - Thêm biến môi trường Database
DATASOURCE_NAME, DATASOURCE_PASS - Thêm biến môi trường Email
EMAIL, PASSWORD - Thêm biến môi trường Cloudinary
CLOUDINARY_API_KEY, CLOUDINARY_API_SECRET, CLOUDINARY_CLOUD_NAME
4. Đường dẫn chạy dự án và test API
- Ứng dụng chạy trên http://localhost:8080
- Swagger chạy trên http://localhost:8080/swagger-ui/index.html#/
| Method | Url | Description | Sample Valid Request Body |
|---|---|---|---|
| POST | /api/user/register | Đăng ký người dùng mới | {"name": "Tran An","age": 25,"gender": "male","birthday": "1998-05-12","email": "[email protected]","password": "123"} |
| POST | /api/user/login | Đăng nhập người dùng | { "email": "[email protected]", "password": "rd123" } |
| POST | /api/user/forgot-password | Gửi yêu cầu quên mật khẩu qua email | [email protected] |
| POST | /api/user/verify-otp-for-activation | Xác minh OTP để kích hoạt tài khoản người dùng | { "email": "[email protected]", "otp": "123456" } |
| POST | /api/user/verify-otp-for-password-reset | Xác minh OTP để thay đổi mật khẩu người dùng | { "email": "[email protected]", "otp": "123456", "newPassword": "123" } |