Add new homepage endpoints (19.06 update)

This commit is contained in:
Mikołaj Pich 2019-09-10 13:37:54 +02:00
parent 6ec2a28d26
commit bd6c5f5bea
No known key found for this signature in database
GPG key ID: F62B26E36D4C4BAA
6 changed files with 292 additions and 0 deletions

View file

@ -0,0 +1,35 @@
{
"data": [
{
"IkonkaNazwa": null,
"Num": null,
"Zawartosc": [
{
"IkonkaNazwa": null,
"Num": null,
"Zawartosc": [],
"Nazwa": "Czwartek (20.06.2019) - Sobota (31.08.2019) - Ferie letnie",
"Url": null,
"Symbol": null,
"Nieaktywny": false
},
{
"IkonkaNazwa": null,
"Num": null,
"Zawartosc": [],
"Nazwa": "Czwartek (15.08.2019) - Wniebowzięcie Najświętszej Maryi Panny",
"Url": null,
"Symbol": null,
"Nieaktywny": false
}
],
"Nazwa": "",
"Url": null,
"Symbol": null,
"Nieaktywny": false
}
],
"success": true,
"errorMessage": null,
"feedback": null
}

View file

@ -0,0 +1,64 @@
{
"data": [
{
"IkonkaNazwa": null,
"Num": null,
"Zawartosc": [
{
"IkonkaNazwa": null,
"Num": null,
"Zawartosc": [
{
"IkonkaNazwa": null,
"Num": null,
"Zawartosc": [],
"Nazwa": "Szczęśliwy numer w dzienniku: 18",
"Url": null,
"Symbol": null,
"Nieaktywny": false
}
],
"Nazwa": "SPL",
"Url": null,
"Symbol": null,
"Nieaktywny": false
},
{
"IkonkaNazwa": null,
"Num": null,
"Zawartosc": [
{
"IkonkaNazwa": null,
"Num": null,
"Zawartosc": [],
"Nazwa": "Szczęśliwy numer w dzienniku: 42",
"Url": null,
"Symbol": null,
"Nieaktywny": false
},
{
"IkonkaNazwa": null,
"Num": null,
"Zawartosc": [],
"Nazwa": "Szczęśliwy numer w dzienniku bo nigdy nie wiadomo: 41",
"Url": null,
"Symbol": null,
"Nieaktywny": false
}
],
"Nazwa": "T1",
"Url": null,
"Symbol": null,
"Nieaktywny": false
}
],
"Nazwa": "",
"Url": null,
"Symbol": null,
"Nieaktywny": false
}
],
"success": true,
"errorMessage": null,
"feedback": null
}

View file

@ -0,0 +1,44 @@
{
"data": [
{
"IkonkaNazwa": null,
"Num": null,
"Zawartosc": [
{
"IkonkaNazwa": null,
"Num": null,
"Zawartosc": [],
"Nazwa": "j. angielski: 1, 6",
"Url": null,
"Symbol": null,
"Nieaktywny": false
},
{
"IkonkaNazwa": null,
"Num": null,
"Zawartosc": [],
"Nazwa": "j. polski: 6, 1",
"Url": null,
"Symbol": null,
"Nieaktywny": false
},
{
"IkonkaNazwa": null,
"Num": null,
"Zawartosc": [],
"Nazwa": "matematyka: 4+, -",
"Url": null,
"Symbol": null,
"Nieaktywny": false
}
],
"Nazwa": "",
"Url": null,
"Symbol": null,
"Nieaktywny": false
}
],
"success": true,
"errorMessage": null,
"feedback": null
}

60
package-lock.json generated
View file

@ -17,6 +17,66 @@
"@types/babel-types": "*"
}
},
"@types/body-parser": {
"version": "1.17.1",
"resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.17.1.tgz",
"integrity": "sha512-RoX2EZjMiFMjZh9lmYrwgoP9RTpAjSHiJxdp4oidAQVO02T7HER3xj9UKue5534ULWeqVEkujhWcyvUce+d68w==",
"requires": {
"@types/connect": "*",
"@types/node": "*"
}
},
"@types/connect": {
"version": "3.4.32",
"resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.32.tgz",
"integrity": "sha512-4r8qa0quOvh7lGD0pre62CAb1oni1OO6ecJLGCezTmhQ8Fz50Arx9RUszryR8KlgK6avuSXvviL6yWyViQABOg==",
"requires": {
"@types/node": "*"
}
},
"@types/express": {
"version": "4.17.1",
"resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.1.tgz",
"integrity": "sha512-VfH/XCP0QbQk5B5puLqTLEeFgR8lfCJHZJKkInZ9mkYd+u8byX0kztXEQxEk4wZXJs8HI+7km2ALXjn4YKcX9w==",
"requires": {
"@types/body-parser": "*",
"@types/express-serve-static-core": "*",
"@types/serve-static": "*"
}
},
"@types/express-serve-static-core": {
"version": "4.16.9",
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.16.9.tgz",
"integrity": "sha512-GqpaVWR0DM8FnRUJYKlWgyARoBUAVfRIeVDZQKOttLFp5SmhhF9YFIYeTPwMd/AXfxlP7xVO2dj1fGu0Q+krKQ==",
"requires": {
"@types/node": "*",
"@types/range-parser": "*"
}
},
"@types/mime": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.1.tgz",
"integrity": "sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw=="
},
"@types/node": {
"version": "12.7.4",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.4.tgz",
"integrity": "sha512-W0+n1Y+gK/8G2P/piTkBBN38Qc5Q1ZSO6B5H3QmPCUewaiXOo2GCAWZ4ElZCcNhjJuBSUSLGFUJnmlCn5+nxOQ=="
},
"@types/range-parser": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.3.tgz",
"integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA=="
},
"@types/serve-static": {
"version": "1.13.3",
"resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.3.tgz",
"integrity": "sha512-oprSwp094zOglVrXdlo/4bAHtKTAxX6VT8FOZlBKrmyLbNvE1zxZyJ6yikMVtHIvwP45+ZQGJn+FdXGKTozq0g==",
"requires": {
"@types/express-serve-static-core": "*",
"@types/mime": "*"
}
},
"abbrev": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",

View file

@ -8,6 +8,7 @@
"test": "jshint src/ app.js --verbose"
},
"dependencies": {
"@types/express": "^4.17.1",
"body-parser": "~1.19.0",
"cookie-parser": "^1.4.4",
"cors": "^2.8.5",

View file

@ -44,4 +44,92 @@ router.get("/Default/Start.mvc/Index", (req, res) => {
});
});
router.get("/Default/Start.mvc/Endpoints", (req, res) => {
const base = protocol(req) + "://" + req.get('host') + "/Default/Start.mvc";
res.json({
status: "sucess",
data: {
endpoints: [
"/GetSelfGovernments",
"/GetStudentTrips",
"/GetLastNotes",
"/GetFreeDays",
"/GetKidsLuckyNumbers",
"/GetKidsLessonPlan",
"/GetLastHomeworks",
"/GetLastTests",
"/GetLastStudentLessons",
].map(item => {
return base + item;
})
}
});
});
router.get("/Default/Start.mvc/GetSelfGovernments", (req, res) => {
res.json({
"data": [],
"success": false,
"errorMessage": "Not implemented yet",
"feedback": null
});
});
router.get("/Default/Start.mvc/GetStudentTrips", (req, res) => {
res.json({
"data": [],
"success": false,
"errorMessage": "Not implemented yet",
"feedback": null
});
});
router.get("/Default/Start.mvc/GetLastNotes", (req, res) => {
res.json(require("../../data/uonetplus/GetLastNotes"));
});
router.get("/Default/Start.mvc/GetFreeDays", (req, res) => {
res.json(require("../../data/uonetplus/GetFreeDays"));
});
router.get("/Default/Start.mvc/GetKidsLuckyNumbers", (req, res) => {
res.json(require("../../data/uonetplus/GetKidsLuckyNumbers"));
});
router.get("/Default/Start.mvc/GetKidsLessonPlan", (req, res) => {
res.json({
"data": [],
"success": false,
"errorMessage": "Not implemented yet",
"feedback": null
});
});
router.get("/Default/Start.mvc/GetLastHomeworks", (req, res) => {
res.json({
"data": [],
"success": false,
"errorMessage": "Not implemented yet",
"feedback": null
});
});
router.get("/Default/Start.mvc/GetLastTests", (req, res) => {
res.json({
"data": [],
"success": false,
"errorMessage": "Not implemented yet",
"feedback": null
});
});
router.get("/Default/Start.mvc/GetLastStudentLessons", (req, res) => {
res.json({
"data": [],
"success": false,
"errorMessage": "Not implemented yet",
"feedback": null
});
});
module.exports = router;