Project in Database Management Class (Backend)
Please edit db-example.js
follow this and save it as db.js
.
const connection = mysql.createConnection({
host: /*your host url*/,
user: /*your host username*/,
password: /*your host password*/,
database: /*your database name*/
});
request
{
"ID":"0000000101",
"password":"12345678"
}
response
{
"status": "success",
"data": [
{
"ID": "0000000101",
"Password": "12345678",
"type": "teacher"
}
]
}
response
{
"data": [
{
"semester": 2,
"year": 2017,
"paydate": "2017-01-01T16:59:59.000Z",
"regdate": "2017-12-29T16:59:59.000Z",
"dropdate": "2018-02-16T16:59:59.000Z",
"withdrawdate": "2018-03-30T16:59:59.000Z"
}
]
}
response
{
"data": [
{
"subjectID": "1234567",
"subjectName": "test",
"requisite": []
}
]
}
response
{
"data": [
{
"subjectID": "1234567",
"subjectName": "test",
"subjectDesc": "test1234",
"type": "reg",
"credits": 3,
"requisite": [
{
"courseID":"2102252",
"type":"PreReq"
}
],
"detail": [
{
"sec": "1",
"seat": 29,
"maxSeat": 30,
"teacher": [
"T. teacher teacherL"
],
"time": [
{
"day": "TUE",
"time": "08:00:00-11:00:00",
"roomID": "1",
"buildingID": "1"
}
]
},
{
"sec": "21",
"teacher": [
"T. teacher teacherL"
],
"time": [
{
"day": "MON",
"time": "08:00:00-11:00:00",
"roomID": "2",
"buildingID": "2"
}
]
}
]
}
]
}
response
{
"data": [
{
"subjectID": "0123101",
"subjectName": "PARAGRAP WRITING",
"subjectDesc": "PARAGRAPH WRITING",
"type": "Gened-hu",
"credits": 3,
"sec": 1,
"semester": 2,
"year": 2017,
"grade": 1
"time": [
{
"day": "MON",
"time": "08:00:00-11:00:00",
"roomID": "101",
"buildingID": "04000"
},
{
"day": "TUE",
"time": "08:00:00-11:00:00",
"roomID": "101",
"buildingID": "04000"
}
],
"teacher": [
"Assist. Prof. Dr. Jessupha Inchareon",
"Prof. Dr. Kanthee Kantawong"
]
}
]
}
response
{
"data": [
{
"studentID": "5208389731",
"studentName": "Ms. Cacheknock Pyramid"
},
{
"studentID": "5507967031",
"studentName": "Ms. Valve Software"
},
{
"studentID": "5508955931",
"studentName": "Mr. Video Chlorophyll"
}
]
}
response
{
"data": [
{
"courseID": "0123101",
"courseName": "PARAGRAP WRITING",
"sec": 1,
"buildingID": null,
"roomID": null,
"day": null,
"startTime": null,
"duration": null
}
]
}
request
{
"courseID":"0123101",
"sec":1,
"studentID":"5211067333"
}
response
{
"success": {
...
}
}
or
{
"error": {
...
}
}
request
{
"courseID":"0123101",
"studentID":"5211067333"
}
response
{
"success": {
...
}
}
or
{
"error": {
...
}
}
response
{
"data": [
{
"courseID": "0123101",
"sec": 1,
}
]
}
response
{
"data": [
{
"studentID": "5211067333",
"grade": 3.5,
}
]
}
request
{
"courseID":"0123101",
"sec":1,
"studentID":"5211067333",
"grade":3.5
}
response
{
"success": {
...
}
}
or
{
"error": {
...
}
}
response
{
"data": [
{
"payStatus": "paid" or "wait",
"curName": "Vet_Bachelor",
"degree": "B",
"fullTimePrice": 21000,
"partTimePrice": 13000
}
]
}