Demo: https://bookstore-restapi.herokuapp.com/swagger-ui.html
- account: user, authorization and authentication
- catalog: product, favourite and category
- shipment: shipment
- transaction: cart, transaction, report
- configglobal: swagger, minio, pagination, websecurity
- Register, Login, Logout (done)
- HomePage
- List Buku
- Search
- Add to Favorite (done)
- Detail Buku (done)
- Add to Cart (done)
- Checkout (done)
- Payment via Wallet
- Konfirmasi Pembelian Page (done)
- Status Pembelian Page
- Register, Login, Logout
- CRUD Buku/Product (done)
- CRUD kategori (done)
- CRUD Daftar Pembelian
- Status Pendapatan
Content-Type : [{"key":"Content-Type","value":"application/json","description":"","type":"text","enabled":true}]
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJyb3N5aWQiLCJpYXQiOjE1ODgxMjExMzIsImV4cCI6MTU4ODEyMTEzN30.foHbKUF5Edw3eCfB1wsmGIz1t-GGpG2zU2LaBZJ9HGa0BoXnRqgmQpvkyzTISB7nZLbHREcvcqOjtEijjW-VoQ
API Name | HTTP Method | Path | Status Code | Desciption | |
---|---|---|---|---|---|
1 | GET Products | GET | /api/v1/products | 200 OK | All product resources are fetched |
2 | POST Products | POST | /api/v1/products | 201 Created | A new product resource is created |
3 | GET Products | GET | /api/v1/products/{id} | 200 OK | One product resource is fetched |
4 | PUT/PATCH Products | PUT/PATCH | /api/v1/products/{id} | 200 OK | Product resource is updated |
5 | DELETE Products | DELETE | /api/v1/products/{id} | 204 No Content | Product resource is deleted |
- CreatedBy and CreatedAt are not changed
- Id cannot changed
Create new product
# 2 Sample
{
"categoryId": 1,
"description": "Buku rekomendasi buat Anda",
"name": "Belajar Java",
"photoId": 0,
"price": 120000,
"productCategoryId": { "id": 1 },
"productStatus": "FOR_SELL",
"quantity": 10,
"slug": "belajar-java",
"productVisibility": "VISIBLE"
}
{
"categoryId": 1,
"description": "Buku rekomendasi buat Anda",
"name": "Belajar PHP",
"photoId": 0,
"price": 124000,
"productCategoryId": { "id": 1 },
"productStatus": "OUT_OF_STOCK",
"quantity": 5,
"slug": "belajar-php",
"productVisibility": "VISIBLE"
}
productVisibility": "VISIBLE" merupakan fitur untuk aktif dan menon-aktikan product. Karena terkadang pengguna tidak ingin menghapus tapi hanya menon-aktifkan product.
Value of productStatus:
- FOR_SELL : Button is actived and it's available for selling.
- OUT_OF_STOCK : Disable button.
- HIDDEN : Product price is not visible.
- Download / Clone melalui GitHub
- Buat Database
- Sesuaikan konfigurasi Databasenya: Edit file application.properties
{
"username": "rosyidgrobogan",
"email": "rosyid@bookstore.com",
"fullName": "Rosyid Grobogan",
"password": "rahasia",
"role": [
"ADMIN", "USER"
]
}
Key "role" bernilai array, misal
- ["USER]
- ["ADMIN", "USER"]
- Silakan SigIn dengan username dan password yang sudah didaftarkan