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. The architecture of the zoontec platform is shown in the diagram below.
...@@ -26,45 +26,97 @@ docker-compose up -d web ...@@ -26,45 +26,97 @@ docker-compose up -d web
``` ```
** After hosting website, it can be reached on `<Ip address of the Vm>:4300`. ** After hosting website, it can be reached on `<Ip address of the Vm>:4300`.
#### 1. put Vaccine #### 1. add student details
``` ```
# request # request
curl -XPOST "http://localhost:7654/api/vaccines" \ axios
--header "Content-Type: application/json" \ .post("http://localhost:8070/student/add", newStudent)
--header "Bearer: eyJkaWdzaWciOiJORWpYZnIwQjJMZG4ySGxPb2t5blp0dkNzSFVqMGFoVTVZd1F5TmJSVCtOYjlwTnBXcEsvUi9UbDZpanhPVVJiVlJHc2NHaFIrcWVCbkZhK09YYjBmMGlacVh0WHBDVXV6bnJOcTFKRmpGZC8zSU80L1o4SXl3WG1EdWFGcUg5Njc5VE9neVRkcU1nT01VeWNNWTF0bmtIUStWVUtUN0JTV0NWMEM3ZmNXbEE9IiwiaWQiOiJlcmFuZ2FlYkBnbWFpbC5jb20iLCJpc3N1ZVRpbWUiOjE1NTg0ODk4ODksInJvbGVzIjoiIiwidHRsIjo2MH0=" \ .then(() => {
--data ' alert("Student Added");
{
"id": "111110", document.getElementById('name').value = "Pathum";
"execer": "admin:admin", document.getElementById('age').value = "23";
"messageType": "addVaccine", document.getElementById('gender').value = "Male";
"userMobile": "0715422017",
"userName": "test user", })
"vaccineStatus": "done" .catch((err) => {
} alert(err);
});
' '
# reply # reply
{"code":201,"msg":"vaccine added"} {"code":200,"msg":"Student details added"}
``` ```
#### 2. get Vaccine #### 2. view student details
``` ```
# request # request
curl -XPOST "http://localhost:7654/api/vaccines" \ axois
--header "Content-Type: application/json" \ .get("http://localhost:8070/student/")
--header "Bearer: eyJkaWdzaWciOiJORWpYZnIwQjJMZG4ySGxPb2t5blp0dkNzSFVqMGFoVTVZd1F5TmJSVCtOYjlwTnBXcEsvUi9UbDZpanhPVVJiVlJHc2NHaFIrcWVCbkZhK09YYjBmMGlacVh0WHBDVXV6bnJOcTFKRmpGZC8zSU80L1o4SXl3WG1EdWFGcUg5Njc5VE9neVRkcU1nT01VeWNNWTF0bmtIUStWVUtUN0JTV0NWMEM3ZmNXbEE9IiwiaWQiOiJlcmFuZ2FlYkBnbWFpbC5jb20iLCJpc3N1ZVRpbWUiOjE1NTg0ODk4ODksInJvbGVzIjoiIiwidHRsIjo2MH0=" \ .then((res) => {
--data ' setStudents(res.data);
{ // console.log(res);
"id": "1111xx", })
"execer": "admin:admin", .catch((err) => {
"messageType": "getVaccine", alert(err.message);
"userMobile": "0715422017", });
} '
# 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 # 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