Commit 8bacf639 authored by RusiraPathum's avatar RusiraPathum

final change

parent 818ef1e9
# Deployment of informatZen Services
# Deployment of zoontec Services
The architecture of the zoontec platform is shown in the diagram below.
......@@ -26,45 +26,97 @@ docker-compose up -d web
```
** After hosting website, it can be reached on `<Ip address of the Vm>:4300`.
#### 1. put Vaccine
#### 1. add student details
```
# request
curl -XPOST "http://localhost:7654/api/vaccines" \
--header "Content-Type: application/json" \
--header "Bearer: eyJkaWdzaWciOiJORWpYZnIwQjJMZG4ySGxPb2t5blp0dkNzSFVqMGFoVTVZd1F5TmJSVCtOYjlwTnBXcEsvUi9UbDZpanhPVVJiVlJHc2NHaFIrcWVCbkZhK09YYjBmMGlacVh0WHBDVXV6bnJOcTFKRmpGZC8zSU80L1o4SXl3WG1EdWFGcUg5Njc5VE9neVRkcU1nT01VeWNNWTF0bmtIUStWVUtUN0JTV0NWMEM3ZmNXbEE9IiwiaWQiOiJlcmFuZ2FlYkBnbWFpbC5jb20iLCJpc3N1ZVRpbWUiOjE1NTg0ODk4ODksInJvbGVzIjoiIiwidHRsIjo2MH0=" \
--data '
{
"id": "111110",
"execer": "admin:admin",
"messageType": "addVaccine",
"userMobile": "0715422017",
"userName": "test user",
"vaccineStatus": "done"
}
axios
.post("http://localhost:8070/student/add", newStudent)
.then(() => {
alert("Student Added");
document.getElementById('name').value = "Pathum";
document.getElementById('age').value = "23";
document.getElementById('gender').value = "Male";
})
.catch((err) => {
alert(err);
});
'
# reply
{"code":201,"msg":"vaccine added"}
{"code":200,"msg":"Student details added"}
```
#### 2. get Vaccine
#### 2. view student details
```
# request
curl -XPOST "http://localhost:7654/api/vaccines" \
--header "Content-Type: application/json" \
--header "Bearer: eyJkaWdzaWciOiJORWpYZnIwQjJMZG4ySGxPb2t5blp0dkNzSFVqMGFoVTVZd1F5TmJSVCtOYjlwTnBXcEsvUi9UbDZpanhPVVJiVlJHc2NHaFIrcWVCbkZhK09YYjBmMGlacVh0WHBDVXV6bnJOcTFKRmpGZC8zSU80L1o4SXl3WG1EdWFGcUg5Njc5VE9neVRkcU1nT01VeWNNWTF0bmtIUStWVUtUN0JTV0NWMEM3ZmNXbEE9IiwiaWQiOiJlcmFuZ2FlYkBnbWFpbC5jb20iLCJpc3N1ZVRpbWUiOjE1NTg0ODk4ODksInJvbGVzIjoiIiwidHRsIjo2MH0=" \
--data '
{
"id": "1111xx",
"execer": "admin:admin",
"messageType": "getVaccine",
"userMobile": "0715422017",
}
axois
.get("http://localhost:8070/student/")
.then((res) => {
setStudents(res.data);
// console.log(res);
})
.catch((err) => {
alert(err.message);
});
'
# reply
{"name":"Pathum","age":"23","gender": "male"}
```
#### 3. edit student details
```
# request
axios
.get(`http://localhost:8070/student/get/` + sid)
.then((res) => {
setStudents(res.data);
studentId1 = res.data._id;
name1 = res.data.name;
age1 = res.data.age;
gender1 = res.data.gender;
// console.log(age1);
document.getElementById("studentId").valu studentId1;
document.getElementById("name").value = name1;
document.getElementById("age").value = age1;
ocument.getElementById("gender").value = gender1;
})
.catch((err) => {
alert(err.message);
});
'
# reply
{"name":"Sandeepa","age":"24","gender": "male"}
{"code":200,"msg":"Successfully Edit Student Details"}
```
#### 4. delete student details
```
# request
axois
.delete(`http://localhost:8070/student${id}`)
.then(() => {
alert("Successfully Deleted");
window.location.reload();
})
.catch((err) => {
alert(err.message);
});
onClose();
'
# reply
{"userMobile":"0775321290","userName":"test user","vaccineStatus": "done", "timestamp":"2021-07-12 20:55:21.308"}
{"name":"Sandeepa","age":"24","gender": "male"}
{"code":200,"msg":"Successfully Deleted Student Details"}
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment