2024-11-21 18:41:28 +01:00
|
|
|
/*
|
|
|
|
GoSkola24API
|
|
|
|
Copyright (C) 2024, Zervó Zadachin
|
|
|
|
|
|
|
|
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Affero General Public License version 3
|
|
|
|
as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Affero General Public License version 3 for more details.
|
|
|
|
|
|
|
|
This program incorporates external libraries for certain functionalities.
|
|
|
|
These libraries are covered by their respective licenses, and their usage
|
|
|
|
agreements are as outlined in their respective documentation or source
|
|
|
|
code.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2024-11-22 08:10:38 +01:00
|
|
|
package GoSkola24API
|
2024-11-21 18:41:28 +01:00
|
|
|
|
|
|
|
import (
|
2024-11-26 17:04:32 +01:00
|
|
|
"git.zervo.org/zervo/goskola24api/internal/requests"
|
|
|
|
pubtypes "git.zervo.org/zervo/goskola24api/types"
|
2024-11-21 18:41:28 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
type Skola24API struct {
|
|
|
|
Host string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (api Skola24API) GetTerms() (_result pubtypes.Terms, _error error) {
|
|
|
|
return requests.GetTerms(api.Host)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (api Skola24API) GetSchools() (_result []pubtypes.School, _error error) {
|
|
|
|
return requests.GetSchools(api.Host)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (api Skola24API) GetRooms(school pubtypes.School, checkAvailability bool) (_result []pubtypes.Room, _error error) {
|
|
|
|
return requests.GetRooms(school, checkAvailability)
|
|
|
|
}
|
2024-11-21 20:24:24 +01:00
|
|
|
|
|
|
|
func (api Skola24API) GetTeachers(school pubtypes.School, checkAvailability bool) (_result []pubtypes.Teacher, _error error) {
|
|
|
|
return requests.GetTeachers(school, checkAvailability)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (api Skola24API) GetStudents(school pubtypes.School, checkAvailability bool) (_result any, _error error) {
|
|
|
|
return requests.GetStudents(school, checkAvailability)
|
|
|
|
}
|
2024-11-22 07:50:57 +01:00
|
|
|
|
|
|
|
func (api Skola24API) GetClasses(school pubtypes.School, checkAvailability bool) (_result []pubtypes.Class, _error error) {
|
|
|
|
return requests.GetClasses(school, checkAvailability)
|
|
|
|
}
|
2024-12-09 19:12:24 +01:00
|
|
|
|
|
|
|
func (api Skola24API) GetWeekSchedule(year int, week int, school pubtypes.School, term pubtypes.SchoolTerm, class pubtypes.Class) (_result any, _error error) {
|
|
|
|
return requests.GetSchedule(year, week, 0, school, term, class)
|
|
|
|
}
|