admin flow - Watthakorn/EZ_finance GitHub Wiki
Login
-
login api
GET /user
Request
{
"username": "admin"
"password": "admin"
}
Response
{
"id": 1,
"fullname": "TestUser",
"email": "[email protected]",
"address": "address1",
"picture": "Tc/f/d/s",
"username": "admin",
"password": "admin",
"role": "admin"
}
Manage User
-
list-of-user api
GET /users
Request
{}
Response
[
{
"id": 1,
"fullname": "TestUser",
"email": "[email protected]",
"address": "address1",
"picture": "Tc/f/d/s",
"username": "username",
"password": "username",
"role": "user"
},
{
"id": 2,
"fullname": "TestManager",
"email": "[email protected]",
"address": "address2",
"picture": "Tc/f/d/s",
"username": "manager",
"password": "manager",
"role": "manager"
},
{
"id": 3,
"fullname": "TestAdmin",
"email": "[email protected]",
"address": "address3",
"picture": "Tc/f/d/s",
"username": "admin",
"password": "admin",
"role": "admin"
},
{
"id": 4,
"fullname": "TestUser2",
"email": "[email protected]",
"address": "address4",
"picture": "Tc/f/d/s",
"username": "username2",
"password": "username",
"role": "user"
},
{
"id": 5,
"fullname": "TestUser3",
"email": "[email protected]",
"address": "address5",
"picture": "Tc/f/d/s",
"username": "username3",
"password": "username",
"role": "user"
}
]
-
delete-user api
put /user/{id}/delete
Request
{
"user_id":1
}
Response : status 200 OK
{
}
Manage Field
-
list-of-field api
GET /listfield
Request
{}
Response
[
{
"field_id": 1,
"field_name": "SamPaoSan Football",
"tel": "081-732-7343",
"price": "3,000 - 3,500",
"location": "98/1 M.13 Soi.Kubon Ramintra road ",
"email": "[email protected]",
"website": null,
"detail": "Test123",
"image": "path to image",
"stime": 9,
"etime": 24,
"username": "man"
},
{
"field_id": 2,
"field_name": "KaoSan Football",
"tel": "081-918-2677",
"price": "2,000 - 2,600",
"location": "Suansiam Soi 16 Bangkok 10320",
"email": "[email protected]",
"website": null,
"detail": null,
"image": "path to image",
"stime": 9,
"etime": 24,
"username": "man1"
},
{
"field_id": 3,
"field_name": "TungTraKai Football",
"tel": "02-513-3425",
"price": "1,200 - 1,300",
"location": "Soi Ladprao 18 Ladprao road Bangkok 10900",
"email": null,
"website": null,
"detail": null,
"image": "path to image",
"stime": 9,
"etime": 24,
"username": "man2"
}
]
-
delete-field api
put /field/{field_id}/delete
Request
{
"field_id":1
}
Response : status 200 OK
{
}