1
0
mirror of https://github.com/actix/examples synced 2025-06-27 01:27:43 +02:00

Add example for Mysql client library (MySql database driver) #622 (#623)

This commit is contained in:
Last Emperor
2023-07-17 19:31:58 +03:00
committed by GitHub
parent 7736cbb7f7
commit 8e736d9ea4
16 changed files with 948 additions and 0 deletions

View File

@ -0,0 +1,17 @@
1.
Linux
curl -d '{"bank_name":"Bank ABC","country":"Kenya"}' -H 'Content-Type: application/json' http://127.0.0.1:8080/addbank
2.
Windows
curl -H "Content-type:application/json" --data-binary "{\"bank_name\":\"Bank ABC\",\"country\":\"Kenya\"}" http://127.0.0.1:8080/addbank
3.
Json response
{
"status_code": 0,
"status_description": "Successful"
}

View File

@ -0,0 +1,18 @@
1.
Linux
curl -d '{"branch_name":"HQ branch", "location":"Central Business District"}' -H 'Content-Type: application/json' http://127.0.0.1:8080/addbranch
2.
Windows
curl -H "Content-type:application/json" --data-binary "{\"branch_name\":\"HQ branch\", \"location\":\"Central Business District\"}" http://127.0.0.1:8080/addbranch
3.
Json response
{
"status_code": 0,
"status_description": "Successful"
}

View File

@ -0,0 +1,18 @@
1.
Linux
curl -d '{"customer_name":"Peter Paul", "branch_name":"Central Business District"}' -H 'Content-Type: application/json' http://127.0.0.1:8080/addcustomer
2.
Windows
curl -H "Content-type:application/json" --data-binary "{\"customer_name\":\"Peter Paul\", \"branch_name\":\"Central Business District\"}" http://127.0.0.1:8080/addcustomer
3.
Json response
{
"status_code": 0,
"status_description": "Successful"
}

View File

@ -0,0 +1,18 @@
1.
Linux
curl -d '{"teller_name":"John Doe", "branch_name":"Central Business District"}' -H 'Content-Type: application/json' http://127.0.0.1:8080/addteller
2.
Windows
curl -H "Content-type:application/json" --data-binary "{\"teller_name\":\"John Doe\", \"branch_name\":\"Central Business District\"}" http://127.0.0.1:8080/addteller
3.
Json response
{
"status_code": 0,
"status_description": "Successful"
}

View File

@ -0,0 +1,23 @@
1.
Linux
curl 'http://localhost:8080/getbank'
2.
Windows
curl http://localhost:8080/getbank
3.
Json response
{
"status_code": 0,
"status_description": "Successful",
"bank_data": [
{
"bank_name": "bank abc",
"country": "kenya"
}
]
}

View File

@ -0,0 +1,23 @@
1.
Linux
curl 'http://localhost:8080/getbranch'
2.
Windows
curl http://localhost:8080/getbranch
3.
Json response
{
"status_code": 0,
"status_description": "Successful",
"branch_data": [
{
"branch_name": "hq branch",
"location": "central business district"
}
]
}

View File

@ -0,0 +1,23 @@
1.
Linux
curl 'http://localhost:8080/getcustomer'
2.
Windows
curl http://localhost:8080/getcustomer
3.
Json response
{
"status_code": 0,
"status_description": "Successful",
"customer_data": [
{
"customer_name": "peter paul",
"branch_name": "central business district"
}
]
}

View File

@ -0,0 +1,23 @@
1.
Linux
curl 'http://localhost:8080/getteller'
2.
Windows
curl http://localhost:8080/getteller
3.
Json response
{
"status_code": 0,
"status_description": "Successful",
"teller_data": [
{
"teller_name": "john doe",
"branch_name": "central business district"
}
]
}