https://github.com/j03-dev/wcc-final-back
https://github.com/j03-dev/wcc-final-back
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/j03-dev/wcc-final-back
- Owner: j03-dev
- Created: 2023-07-22T14:44:39.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-23T17:16:57.000Z (almost 3 years ago)
- Last Synced: 2025-01-22T14:33:57.388Z (over 1 year ago)
- Language: Python
- Size: 314 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# API doc
## Endpoints
- `POST api/v1/user/login`
Request :
```
{
"username": "Gracy",
"password": "xyz",
}
```
Response :
```
{
"token" : jflkajslkdfjlkajsdlkfjdsf,
}
```
- `POST api/v1/user/register`
Request
```
{
"username": "Gracy",
"password": "xyz",
}
```
Response
```
{
"success": true,
}
```
- `GET /generate`
- Generate a clothing combination
- Need auth
Request
| Name | Type |
| ---- | -------------------------------------- |
| hot | boolean |
| type | ('sport', 'plage', 'casual', 'formel') |
```
{
"hot": false
"type": "sport"
}
```
Response
```
```
- `POST /api/v1/clothes`
- Add a new one
- Need auth
Request
(formdata)
| Name | Type |
| -------- | -------------------------------------- |
| image | file |
| type | ('sport', 'plage', 'casual', 'formel') |
| category | ('haut', 'bas', 'accessory', 'shoe') |
| hot | boolean |
| colors | string |
```
{
"label": "T-shirt",
"image": file,
"type": "sport",
"category": "haut",
"hot": true
"hexcode": "#ffffff",
}
```
Response
```
{
"success": true,
"new_cloth_id": 123,
}
```
- `GET /api/v1/clothes`
- Get all clothes of an user
- Need token
Response
```
{
"total": 4,
"clothes": [
{
"id": 123,
"label": "t-shirt",
"image": "fsljl.png",
"type": "sport",
"category": "haut",
"hxcode": "#fffff",
"hot": true
},
{
"id": 123,
"label": "t-shirt",
"image": "fsljl.png",
"type": "sport",
"category": "haut",
"hxcode": "#fffff",
"hot": true
},
{
"id": 123,
"label": "t-shirt",
"image": "fsljl.png",
"type": "sport",
"category": "haut",
"hxcode": "#fffff",
"hot": true
},
{
"id": 123,
"label": "t-shirt",
"image": "fsljl.png",
"type": "sport",
"category": "haut",
"hxcode": "#fffff",
"hot": true
},
]
}
```
# mbola tsy vita
- `DELETE /clothes/{clothe_id}`
- Need auth
Response
```
{
"success": true,
}
```