接口设计
我认为一个好的接口,就算是单独取出其中一个来看,也能明白它的用途
通用接口
POST /api/v1/tokens/
DELETE /api/v1/tokens/:id/
GET /api/v1/search/
客人模式接口
POST /api/v1/users/
GET /api/v1/guest/goods/
GET /api/v1/guest/goods/:id/
GET /api/v1/guest/goods/:id/comments/
GET /api/v1/guest/goods/:id/comments/:id/
用户模式接口
GET /api/v1/users/me/
PATCH /api/v1/users/me/
PUT /api/v1/users/me/password/
GET /api/v1/user/goods/
GET /api/v1/user/goods/:id/
GET /api/v1/user/goods/:id/comments/
GET /api/v1/user/goods/:id/comments/:id/
POST /api/v1/user/orders/
GET /api/v1/user/orders/
GET /api/v1/user/orders/:id/
POST /api/v1/shopping_cart/goods/
GET /api/v1/shopping_cart/goods/
DELETE /api/v1/shopping_cart/goods/:id/
PATCH /api/v1/shopping_cart/goods/:id/
后台模式接口
GET /api/v1/admin/users/
GET /api/v1/admin/users/:id/
PATCH /api/v1/admin/users/:id/
GET /api/v1/admin/users/me/
PATCH /api/v1/admin/users/me/
PUT /api/v1/admin/users/me/password/
GET /api/v1/admin/goods/
GET /api/v1/admin/goods/:id/
POST /api/v1/admin/goods/
PUT /api/v1/admin/goods/:id/
PATCH /api/v1/admin/goods/:id/
DELETE /api/v1/admin/goods/:id/
GET /api/v1/admin/orders/
GET /api/v1/admin/orders/:id/