Add base support for kindergarten diaries
This commit is contained in:
parent
42bce37748
commit
8971d39691
28 changed files with 529 additions and 379 deletions
|
@ -14,6 +14,8 @@ dependencies {
|
|||
implementation "com.squareup.retrofit2:converter-scalars:$retrofit"
|
||||
implementation "pl.droidsonroids.retrofit2:converter-jspoon:$jspoon"
|
||||
|
||||
implementation "com.brsanthu:migbase64:2.2"
|
||||
|
||||
implementation "com.squareup.moshi:moshi:$moshi"
|
||||
implementation "com.squareup.moshi:moshi-adapters:$moshi"
|
||||
kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshi"
|
||||
|
|
|
@ -107,6 +107,18 @@ class Scrapper {
|
|||
field = value
|
||||
}
|
||||
|
||||
var unitId: Int = 0
|
||||
set(value) {
|
||||
if (field != value) changeManager.reset()
|
||||
field = value
|
||||
}
|
||||
|
||||
var kindergartenDiaryId: Int = 0
|
||||
set(value) {
|
||||
if (field != value) changeManager.reset()
|
||||
field = value
|
||||
}
|
||||
|
||||
var schoolYear: Int = 0
|
||||
set(value) {
|
||||
if (field != value) changeManager.reset()
|
||||
|
@ -160,6 +172,7 @@ class Scrapper {
|
|||
schoolSymbol = schoolSymbol,
|
||||
studentId = studentId,
|
||||
diaryId = diaryId,
|
||||
kindergartenDiaryId = kindergartenDiaryId,
|
||||
schoolYear = schoolYear,
|
||||
androidVersion = androidVersion,
|
||||
buildTag = buildTag,
|
||||
|
@ -175,12 +188,21 @@ class Scrapper {
|
|||
|
||||
private val register by resettableLazy(changeManager) {
|
||||
RegisterRepository(
|
||||
normalizedSymbol, email, password,
|
||||
LoginHelper(loginType, schema, host, normalizedSymbol, serviceManager.getCookieManager(), serviceManager.getLoginService()),
|
||||
serviceManager.getRegisterService(),
|
||||
serviceManager.getMessagesService(withLogin = false),
|
||||
serviceManager.getStudentService(withLogin = false, studentInterceptor = false),
|
||||
serviceManager.urlGenerator
|
||||
startSymbol = normalizedSymbol,
|
||||
email = email,
|
||||
password = password,
|
||||
loginHelper = LoginHelper(
|
||||
loginType = loginType,
|
||||
schema = schema,
|
||||
host = host,
|
||||
symbol = normalizedSymbol,
|
||||
cookies = serviceManager.getCookieManager(),
|
||||
api = serviceManager.getLoginService()
|
||||
),
|
||||
register = serviceManager.getRegisterService(),
|
||||
messages = serviceManager.getMessagesService(withLogin = false),
|
||||
student = serviceManager.getStudentService(withLogin = false, studentInterceptor = false),
|
||||
url = serviceManager.urlGenerator
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -190,6 +212,7 @@ class Scrapper {
|
|||
StudentStartRepository(
|
||||
studentId = studentId,
|
||||
classId = classId,
|
||||
unitId = unitId,
|
||||
api = serviceManager.getStudentService(withLogin = true, studentInterceptor = false)
|
||||
)
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ class StudentCookieInterceptor(
|
|||
private val schema: String,
|
||||
private val host: String,
|
||||
private val diaryId: Int,
|
||||
private val kindergartenDiaryId: Int,
|
||||
private val studentId: Int,
|
||||
private val schoolYear: Int
|
||||
) : Interceptor {
|
||||
|
@ -19,7 +20,7 @@ class StudentCookieInterceptor(
|
|||
arrayOf(
|
||||
"idBiezacyDziennik" to diaryId,
|
||||
"idBiezacyUczen" to studentId,
|
||||
"idBiezacyDziennikPrzedszkole" to 0,
|
||||
"idBiezacyDziennikPrzedszkole" to kindergartenDiaryId,
|
||||
"biezacyRokSzkolny" to schoolYear
|
||||
).forEach { (name, value) ->
|
||||
HttpCookie(name, value.toString()).let {
|
||||
|
|
|
@ -10,7 +10,7 @@ import io.github.wulkanowy.sdk.scrapper.Scrapper.LoginType.AUTO
|
|||
import io.github.wulkanowy.sdk.scrapper.Scrapper.LoginType.STANDARD
|
||||
import io.github.wulkanowy.sdk.scrapper.exception.ScrapperException
|
||||
import io.github.wulkanowy.sdk.scrapper.exception.VulcanException
|
||||
import io.github.wulkanowy.sdk.scrapper.register.SendCertificateResponse
|
||||
import io.github.wulkanowy.sdk.scrapper.register.HomePageResponse
|
||||
import io.github.wulkanowy.sdk.scrapper.service.LoginService
|
||||
import org.slf4j.LoggerFactory
|
||||
import pl.droidsonroids.jspoon.Jspoon
|
||||
|
@ -48,11 +48,11 @@ class LoginHelper(
|
|||
Jspoon.create().adapter(CertificateResponse::class.java)
|
||||
}
|
||||
|
||||
suspend fun login(email: String, password: String): SendCertificateResponse {
|
||||
suspend fun login(email: String, password: String): HomePageResponse {
|
||||
val res = sendCredentials(email, password)
|
||||
logger.info("Login ${loginType.name} started")
|
||||
when {
|
||||
res.title.startsWith("Witryna ucznia i rodzica") -> return SendCertificateResponse()
|
||||
res.title.startsWith("Witryna ucznia i rodzica") -> return HomePageResponse()
|
||||
res.action.isBlank() -> throw VulcanException("Invalid certificate page: '${res.title}'. Try again")
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ class LoginHelper(
|
|||
}
|
||||
}
|
||||
|
||||
suspend fun sendCertificate(cert: CertificateResponse, email: String, url: String = cert.action): SendCertificateResponse {
|
||||
suspend fun sendCertificate(cert: CertificateResponse, email: String, url: String = cert.action): HomePageResponse {
|
||||
cookies.cookieStore.removeAll()
|
||||
val res = api.sendCertificate(
|
||||
url = url,
|
||||
|
|
|
@ -46,6 +46,12 @@ data class Diary(
|
|||
@Json(name = "Okresy")
|
||||
val semesters: List<Semester>? = emptyList(),
|
||||
|
||||
@Json(name = "DziennikDataOd")
|
||||
val start: Date,
|
||||
|
||||
@Json(name = "DziennikDataDo")
|
||||
val end: Date,
|
||||
|
||||
@Json(name = "UczenPelnaNazwa")
|
||||
val fullName: String
|
||||
) {
|
||||
|
|
|
@ -2,16 +2,39 @@ package io.github.wulkanowy.sdk.scrapper.register
|
|||
|
||||
import io.github.wulkanowy.sdk.scrapper.toLocalDate
|
||||
|
||||
fun Diary.toSemesters() = semesters!!.map {
|
||||
Semester(
|
||||
diaryId = diaryId,
|
||||
diaryName = "$level$symbol",
|
||||
schoolYear = year,
|
||||
semesterId = it.id,
|
||||
semesterNumber = it.number,
|
||||
start = it.start.toLocalDate(),
|
||||
end = it.end.toLocalDate(),
|
||||
classId = it.classId,
|
||||
unitId = it.unitId
|
||||
)
|
||||
}
|
||||
fun List<Diary>.toSemesters(studentId: Int, classId: Int, unitId: Int): List<Semester> = this
|
||||
.filter { it.studentId == studentId }
|
||||
.filter { (it.semesters?.firstOrNull()?.classId ?: 0) == classId }
|
||||
.flatMap { diary ->
|
||||
when {
|
||||
diary.kindergartenDiaryId != 0 -> listOf(
|
||||
Semester(
|
||||
diaryId = diary.diaryId,
|
||||
kindergartenDiaryId = diary.kindergartenDiaryId,
|
||||
diaryName = "${diary.level}${diary.symbol}",
|
||||
schoolYear = diary.year,
|
||||
semesterId = 0,
|
||||
semesterNumber = 1,
|
||||
start = diary.start.toLocalDate(),
|
||||
end = diary.end.toLocalDate(),
|
||||
classId = classId,
|
||||
unitId = unitId,
|
||||
)
|
||||
)
|
||||
!diary.semesters.isNullOrEmpty() -> diary.semesters.map {
|
||||
Semester(
|
||||
diaryId = diary.diaryId,
|
||||
kindergartenDiaryId = 0,
|
||||
diaryName = "${diary.level}${diary.symbol}",
|
||||
schoolYear = diary.year,
|
||||
semesterId = it.id,
|
||||
semesterNumber = it.number,
|
||||
start = it.start.toLocalDate(),
|
||||
end = it.end.toLocalDate(),
|
||||
classId = it.classId,
|
||||
unitId = it.unitId
|
||||
)
|
||||
}
|
||||
else -> throw IllegalArgumentException("Unknown diary format: $diary")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,11 @@ package io.github.wulkanowy.sdk.scrapper.register
|
|||
import org.jsoup.nodes.Element
|
||||
import pl.droidsonroids.jspoon.annotation.Selector
|
||||
|
||||
class SendCertificateResponse {
|
||||
class HomePageResponse {
|
||||
|
||||
@Selector(".panel.linkownia.pracownik.klient a[href*=\"uonetplus-uczen\"]")
|
||||
var studentSchools: List<Element> = emptyList()
|
||||
|
||||
@Selector("html")
|
||||
lateinit var document: Element
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package io.github.wulkanowy.sdk.scrapper.register
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Permission(
|
||||
|
||||
@Json(name = "AuthInfos")
|
||||
val authInfos: List<AuthInfo>,
|
||||
|
||||
@Json(name = "Units")
|
||||
val units: List<Unit>
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class AuthInfo(
|
||||
@Json(name = "JednostkaSprawozdawczaId")
|
||||
val unitId: Int,
|
||||
|
||||
@Json(name = "LinkedAccountUids")
|
||||
val linkedAccountUids: List<Int>,
|
||||
|
||||
@Json(name = "LoginId")
|
||||
val loginId: Int,
|
||||
|
||||
@Json(name = "LoginValue")
|
||||
val loginValue: String,
|
||||
|
||||
@Json(name = "OpiekunIds")
|
||||
val parentIds: List<Int>,
|
||||
|
||||
@Json(name = "PracownikIds")
|
||||
val employeeIds: List<Int>,
|
||||
|
||||
@Json(name = "Roles")
|
||||
val roles: List<Int>,
|
||||
|
||||
@Json(name = "UczenIds")
|
||||
val studentIds: List<Int>
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Unit(
|
||||
@Json(name = "Id")
|
||||
val id: Int,
|
||||
|
||||
@Json(name = "Nazwa")
|
||||
val name: String,
|
||||
|
||||
@Json(name = "Skrot")
|
||||
val short: String,
|
||||
|
||||
@Json(name = "Symbol")
|
||||
val symbol: String
|
||||
)
|
|
@ -5,6 +5,7 @@ import java.time.LocalDate.now
|
|||
|
||||
data class Semester(
|
||||
val diaryId: Int,
|
||||
val kindergartenDiaryId: Int,
|
||||
val diaryName: String,
|
||||
val schoolYear: Int,
|
||||
val semesterId: Int,
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package io.github.wulkanowy.sdk.scrapper.repository
|
||||
|
||||
import com.migcomponents.migbase64.Base64
|
||||
import com.squareup.moshi.Moshi
|
||||
import io.github.wulkanowy.sdk.scrapper.Scrapper
|
||||
import io.github.wulkanowy.sdk.scrapper.exception.ScrapperException
|
||||
import io.github.wulkanowy.sdk.scrapper.exception.TemporarilyDisabledException
|
||||
|
@ -11,6 +13,8 @@ import io.github.wulkanowy.sdk.scrapper.login.CertificateResponse
|
|||
import io.github.wulkanowy.sdk.scrapper.login.LoginHelper
|
||||
import io.github.wulkanowy.sdk.scrapper.messages.ReportingUnit
|
||||
import io.github.wulkanowy.sdk.scrapper.register.Diary
|
||||
import io.github.wulkanowy.sdk.scrapper.register.Permission
|
||||
import io.github.wulkanowy.sdk.scrapper.register.PermissionJsonAdapter
|
||||
import io.github.wulkanowy.sdk.scrapper.register.Student
|
||||
import io.github.wulkanowy.sdk.scrapper.register.toSemesters
|
||||
import io.github.wulkanowy.sdk.scrapper.repository.AccountRepository.Companion.SELECTOR_ADFS
|
||||
|
@ -26,6 +30,7 @@ import org.jsoup.nodes.Element
|
|||
import org.jsoup.parser.Parser
|
||||
import org.slf4j.LoggerFactory
|
||||
import java.net.URL
|
||||
import java.nio.charset.StandardCharsets
|
||||
|
||||
class RegisterRepository(
|
||||
private val startSymbol: String,
|
||||
|
@ -43,6 +48,8 @@ class RegisterRepository(
|
|||
private val logger = LoggerFactory.getLogger(this::class.java)
|
||||
}
|
||||
|
||||
private val moshi by lazy { Moshi.Builder().build() }
|
||||
|
||||
suspend fun getStudents(): List<Student> {
|
||||
return getSymbols().flatMap { (symbol, certificate) ->
|
||||
val cert = try {
|
||||
|
@ -54,9 +61,11 @@ class RegisterRepository(
|
|||
|
||||
url.symbol = symbol
|
||||
val unitsUrl = url.generate(ServiceManager.UrlGenerator.Site.MESSAGES) + "NowaWiadomosc.mvc/GetJednostkiUzytkownika"
|
||||
|
||||
val units = messages.getUserReportingUnits(unitsUrl).handleErrors().data.orEmpty()
|
||||
val permissions = getPermissions(cert.document.toString())
|
||||
cert.studentSchools.flatMap { moduleUrl ->
|
||||
getStudentsBySymbol(symbol, moduleUrl, units)
|
||||
getStudentsBySymbol(symbol, moduleUrl, permissions, units)
|
||||
}
|
||||
}.distinctBy { pupil -> listOf(pupil.studentId, pupil.classId, pupil.schoolSymbol) }
|
||||
}
|
||||
|
@ -101,24 +110,30 @@ class RegisterRepository(
|
|||
}
|
||||
}
|
||||
|
||||
private suspend fun getStudentsBySymbol(symbol: String, moduleUrl: Element, units: List<ReportingUnit>): List<Student> {
|
||||
private suspend fun getStudentsBySymbol(
|
||||
symbol: String,
|
||||
moduleUrl: Element,
|
||||
permissions: Permission?,
|
||||
units: List<ReportingUnit>
|
||||
): List<Student> {
|
||||
val loginType = getLoginType(symbol)
|
||||
val schoolUrl = moduleUrl.attr("href")
|
||||
url.schoolId = getExtractedSchoolSymbolFromUrl(schoolUrl)
|
||||
|
||||
val startPage = try {
|
||||
val studentStartPage = try {
|
||||
student.getStart(url.generate(ServiceManager.UrlGenerator.Site.STUDENT) + "Start")
|
||||
} catch (e: TemporarilyDisabledException) {
|
||||
logger.debug("Start page is unavailable", e)
|
||||
return listOf()
|
||||
}
|
||||
|
||||
val cache = getStudentCache(startPage)
|
||||
val cache = getStudentCache(studentStartPage)
|
||||
|
||||
val diaries = getStudentDiaries()
|
||||
return diaries.filterDiaries().map { diary ->
|
||||
val unit = units.getUnitByStudentId(diary, permissions)
|
||||
val schoolSymbol = getExtractedSchoolSymbolFromUrl(schoolUrl)
|
||||
val unit = units.firstOrNull { it.unitId == diary.semesters!![0].unitId }
|
||||
val classId = diary.semesters?.firstOrNull()?.classId ?: 0
|
||||
|
||||
Student(
|
||||
email = email,
|
||||
|
@ -132,15 +147,13 @@ class RegisterRepository(
|
|||
studentSurname = diary.studentSurname,
|
||||
schoolSymbol = schoolSymbol,
|
||||
schoolShortName = moduleUrl.text().takeIf { "Uczeń" !in it }.orEmpty(),
|
||||
schoolName = getScriptParam("organizationName", startPage, diary.symbol + " " + (diary.year - diary.level + 1)),
|
||||
schoolName = getScriptParam("organizationName", studentStartPage, diary.symbol + " " + (diary.year - diary.level + 1)),
|
||||
className = diary.symbol.orEmpty(),
|
||||
classId = diary.semesters!![0].classId,
|
||||
classId = classId,
|
||||
baseUrl = url.generate(ServiceManager.UrlGenerator.Site.BASE),
|
||||
loginType = loginType,
|
||||
isParent = cache?.isParent == true,
|
||||
semesters = diaries
|
||||
.filter { it.studentId == diary.studentId && it.semesters?.getOrNull(0)?.classId == diary.semesters[0].classId }
|
||||
.flatMap { it.toSemesters() }
|
||||
semesters = diaries.toSemesters(diary.studentId, classId, unit?.unitId ?: 0),
|
||||
)
|
||||
}.ifEmpty {
|
||||
logger.error("No supported student found in diaries: $diaries")
|
||||
|
@ -161,12 +174,27 @@ class RegisterRepository(
|
|||
.data.orEmpty()
|
||||
|
||||
private fun List<Diary>.filterDiaries() = this
|
||||
.filter { it.semesters.orEmpty().isNotEmpty() }
|
||||
.filter { it.semesters.orEmpty().isNotEmpty() || it.kindergartenDiaryId != 0 }
|
||||
.sortedByDescending { it.level }
|
||||
.distinctBy { listOf(it.studentId, it.semesters!![0].classId) }
|
||||
.distinctBy { listOf(it.studentId, it.semesters?.firstOrNull()?.classId ?: 0) }
|
||||
|
||||
private fun getExtractedSchoolSymbolFromUrl(snpPageUrl: String): String {
|
||||
val path = URL(snpPageUrl).path.split("/")
|
||||
return path[2]
|
||||
}
|
||||
|
||||
private fun List<ReportingUnit>.getUnitByStudentId(diary: Diary, permissions: Permission?): ReportingUnit? {
|
||||
val idFromPermissions = permissions?.authInfos.orEmpty().firstOrNull { it.studentIds.contains(diary.studentId) }?.unitId
|
||||
val idFromSemesters = diary.semesters?.getOrNull(0)?.unitId
|
||||
val unitId = idFromSemesters ?: idFromPermissions
|
||||
|
||||
return firstOrNull { it.unitId == unitId }
|
||||
}
|
||||
|
||||
private fun getPermissions(homepage: String): Permission? {
|
||||
val base64 = getScriptParam("permissions", homepage).substringBefore("|")
|
||||
return Base64.decode(base64).toString(StandardCharsets.UTF_8).takeIf { it.isNotBlank() }?.let {
|
||||
PermissionJsonAdapter(moshi).fromJson(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,9 +78,9 @@ class StudentRepository(private val api: StudentService) {
|
|||
val it = api.getStart("Start")
|
||||
|
||||
val res = api.getUserCache(
|
||||
getScriptParam("antiForgeryToken", it),
|
||||
getScriptParam("appGuid", it),
|
||||
getScriptParam("version", it)
|
||||
token = getScriptParam("antiForgeryToken", it),
|
||||
appGuid = getScriptParam("appGuid", it),
|
||||
appVersion = getScriptParam("version", it)
|
||||
).handleErrors()
|
||||
|
||||
val data = requireNotNull(res.data) {
|
||||
|
@ -113,10 +113,10 @@ class StudentRepository(private val api: StudentService) {
|
|||
suspend fun excuseForAbsence(absents: List<Absent>, content: String?): Boolean {
|
||||
val it = api.getStart("Start")
|
||||
return api.excuseForAbsence(
|
||||
getScriptParam("antiForgeryToken", it),
|
||||
getScriptParam("appGuid", it),
|
||||
getScriptParam("version", it),
|
||||
AttendanceExcuseRequest(
|
||||
token = getScriptParam("antiForgeryToken", it),
|
||||
appGuid = getScriptParam("appGuid", it),
|
||||
appVersion = getScriptParam("version", it),
|
||||
attendanceExcuseRequest = AttendanceExcuseRequest(
|
||||
AttendanceExcuseRequest.Excuse(
|
||||
absents = absents.map { absence ->
|
||||
AttendanceExcuseRequest.Excuse.Absent(
|
||||
|
|
|
@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory
|
|||
class StudentStartRepository(
|
||||
private val studentId: Int,
|
||||
private val classId: Int,
|
||||
private val unitId: Int,
|
||||
private val api: StudentService
|
||||
) {
|
||||
|
||||
|
@ -19,15 +20,8 @@ class StudentStartRepository(
|
|||
|
||||
suspend fun getSemesters(): List<Semester> {
|
||||
val diaries = api.getDiaries().handleErrors().data
|
||||
return diaries.orEmpty()
|
||||
.asSequence()
|
||||
.filter { it.semesters.orEmpty().isNotEmpty() }
|
||||
.filter { it.studentId == studentId }
|
||||
.filter { it.semesters!![0].classId == classId }
|
||||
.map { it.toSemesters() }
|
||||
.flatten()
|
||||
return diaries?.toSemesters(studentId, classId, unitId).orEmpty()
|
||||
.sortedByDescending { it.semesterId }
|
||||
.toList()
|
||||
.ifEmpty {
|
||||
logger.debug("Student $studentId, class $classId not found in diaries: $diaries")
|
||||
emptyList()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package io.github.wulkanowy.sdk.scrapper.service
|
||||
|
||||
import io.github.wulkanowy.sdk.scrapper.login.ADFSFormResponse
|
||||
import io.github.wulkanowy.sdk.scrapper.register.SendCertificateResponse
|
||||
import io.github.wulkanowy.sdk.scrapper.register.HomePageResponse
|
||||
import retrofit2.http.FieldMap
|
||||
import retrofit2.http.FormUrlEncoded
|
||||
import retrofit2.http.GET
|
||||
|
@ -17,10 +17,10 @@ interface LoginService {
|
|||
|
||||
@POST
|
||||
@FormUrlEncoded
|
||||
suspend fun sendCertificate(@Url url: String, @FieldMap certificate: Map<String, String>): SendCertificateResponse
|
||||
suspend fun sendCertificate(@Url url: String, @FieldMap certificate: Map<String, String>): HomePageResponse
|
||||
|
||||
@GET
|
||||
suspend fun switchLogin(@Url url: String): SendCertificateResponse
|
||||
suspend fun switchLogin(@Url url: String): HomePageResponse
|
||||
|
||||
// ADFS
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ class ServiceManager(
|
|||
private val schoolSymbol: String,
|
||||
private val studentId: Int,
|
||||
private val diaryId: Int,
|
||||
private val kindergartenDiaryId: Int,
|
||||
private val schoolYear: Int,
|
||||
emptyCookieJarIntercept: Boolean,
|
||||
androidVersion: String,
|
||||
|
@ -126,7 +127,7 @@ class ServiceManager(
|
|||
|
||||
val client = getClientBuilder(loginIntercept = withLogin)
|
||||
if (studentInterceptor) {
|
||||
if (0 == diaryId || 0 == studentId) throw ScrapperException("Student or/and diaryId id are not set")
|
||||
if ((0 == diaryId && 0 == kindergartenDiaryId) || 0 == studentId) throw ScrapperException("Student or/and diaryId id are not set")
|
||||
|
||||
client.addInterceptor(
|
||||
StudentCookieInterceptor(
|
||||
|
@ -134,6 +135,7 @@ class ServiceManager(
|
|||
schema = schema,
|
||||
host = host,
|
||||
diaryId = diaryId,
|
||||
kindergartenDiaryId = kindergartenDiaryId,
|
||||
studentId = studentId,
|
||||
schoolYear = when (schoolYear) {
|
||||
0 -> if (LocalDate.now().monthValue < 9) LocalDate.now().year - 1 else LocalDate.now().year // fallback
|
||||
|
|
|
@ -29,8 +29,6 @@ abstract class BaseLocalTest : BaseTest() {
|
|||
enqueue(MockResponse().setBody(clazz.getResource(fileName).readText()))
|
||||
}
|
||||
|
||||
fun <T : Any> Class<T>.getResourceText(name: String): String = this::class.java.getResource(name)?.readText().let { requireNotNull(it) }
|
||||
|
||||
@After
|
||||
fun tearDown() {
|
||||
server.shutdown()
|
||||
|
|
|
@ -2,15 +2,16 @@ package io.github.wulkanowy.sdk.scrapper
|
|||
|
||||
import io.github.wulkanowy.sdk.scrapper.attendance.AttendanceSummaryTest
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import okhttp3.mockwebserver.MockResponse
|
||||
import org.junit.Test
|
||||
|
||||
class ScrapperTest : BaseLocalTest() {
|
||||
|
||||
@Test
|
||||
fun changeTest() {
|
||||
server.enqueue(MockResponse().setBody(AttendanceSummaryTest::class.java.getResource("Przedmioty.json").readText()))
|
||||
server.start(3000) //
|
||||
with(server) {
|
||||
enqueue("Przedmioty.json", AttendanceSummaryTest::class.java)
|
||||
start(3000) //
|
||||
}
|
||||
|
||||
val api = Scrapper().apply {
|
||||
loginType = Scrapper.LoginType.STANDARD
|
||||
|
|
|
@ -70,14 +70,21 @@ class AutoLoginInterceptorTest : BaseLocalTest() {
|
|||
|
||||
// @Test
|
||||
fun simultaneousLogin() = runBlocking {
|
||||
repeat(3) { server.enqueue("unknown-error.txt", RegisterTest::class.java) }
|
||||
with(server) {
|
||||
repeat(3) {
|
||||
enqueue("unknown-error.txt", RegisterTest::class.java)
|
||||
}
|
||||
|
||||
server.enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
server.enqueue("Login-success.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
enqueue("Login-success.html", LoginTest::class.java)
|
||||
|
||||
repeat(3) { server.enqueue("UwagiIOsiagniecia.json", NotesTest::class.java) }
|
||||
repeat(3) {
|
||||
enqueue("UwagiIOsiagniecia.json", NotesTest::class.java)
|
||||
}
|
||||
|
||||
start(3000)
|
||||
}
|
||||
|
||||
server.start(3000)
|
||||
init()
|
||||
val service = getService { loginHelper.login("", "") }
|
||||
|
||||
|
@ -92,14 +99,21 @@ class AutoLoginInterceptorTest : BaseLocalTest() {
|
|||
|
||||
// @Test
|
||||
fun simultaneousLoginWithError() = runBlocking {
|
||||
repeat(3) { server.enqueue("unknown-error.txt", RegisterTest::class.java) }
|
||||
with(server) {
|
||||
repeat(3) {
|
||||
enqueue("unknown-error.txt", RegisterTest::class.java)
|
||||
}
|
||||
|
||||
server.enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
server.enqueue("Offline.html", AutoLoginInterceptor::class.java)
|
||||
enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
enqueue("Offline.html", AutoLoginInterceptor::class.java)
|
||||
|
||||
repeat(3) { server.enqueue("unknown-error.txt", RegisterTest::class.java) }
|
||||
repeat(3) {
|
||||
enqueue("unknown-error.txt", RegisterTest::class.java)
|
||||
}
|
||||
|
||||
start(3000)
|
||||
}
|
||||
|
||||
server.start(3000)
|
||||
init()
|
||||
|
||||
val service = getService { loginHelper.login("", "") }
|
||||
|
|
|
@ -12,7 +12,6 @@ import io.github.wulkanowy.sdk.scrapper.service.RegisterService
|
|||
import io.github.wulkanowy.sdk.scrapper.service.ServiceManager
|
||||
import io.github.wulkanowy.sdk.scrapper.service.StudentService
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import okhttp3.mockwebserver.MockResponse
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
import java.net.CookieManager
|
||||
|
@ -26,14 +25,34 @@ class RegisterTest : BaseLocalTest() {
|
|||
host = "fakelog.localhost:3000",
|
||||
symbol = "default",
|
||||
cookies = CookieManager(),
|
||||
api = getService(LoginService::class.java, "http://fakelog.localhost:3000/", true, getOkHttp(true, false, Scrapper.LoginType.STANDARD))
|
||||
api = getService(
|
||||
service = LoginService::class.java,
|
||||
url = "http://fakelog.localhost:3000/",
|
||||
html = true,
|
||||
okHttp = getOkHttp(
|
||||
errorInterceptor = true,
|
||||
autoLoginInterceptorOn = false,
|
||||
loginType = Scrapper.LoginType.STANDARD
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private val registerStudent by lazy {
|
||||
RegisterRepository(
|
||||
startSymbol = "default", email = "jan@fakelog.localhost", password = "jan123", loginHelper = login,
|
||||
register = getService(RegisterService::class.java, "http://fakelog.localhost:3000/Default/", true, getOkHttp(false, false)),
|
||||
startSymbol = "default",
|
||||
email = "jan@fakelog.localhost",
|
||||
password = "jan123",
|
||||
loginHelper = login,
|
||||
register = getService(
|
||||
service = RegisterService::class.java,
|
||||
url = "http://fakelog.localhost:3000/Default/",
|
||||
html = true,
|
||||
okHttp = getOkHttp(
|
||||
errorInterceptor = false,
|
||||
autoLoginInterceptorOn = false
|
||||
)
|
||||
),
|
||||
messages = getService(MessagesService::class.java, "http://fakelog.localhost:3000", false),
|
||||
student = getService(StudentService::class.java, "http://fakelog.localhost:3000", false),
|
||||
url = ServiceManager.UrlGenerator("http", "fakelog.localhost:3000", "default", "123")
|
||||
|
@ -42,19 +61,21 @@ class RegisterTest : BaseLocalTest() {
|
|||
|
||||
@Test
|
||||
fun filterStudentsByClass() {
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("LoginPage-standard.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Logowanie-uonet.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Login-success.html").readText()))
|
||||
server.enqueue("JednostkiUzytkownika.json", MessagesTest::class.java)
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("LoginPage-standard.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("WitrynaUcznia.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("UczenCache.json").readText()))
|
||||
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("UczenDziennik-multi.json").readText()))
|
||||
(1..4).onEach { // 4x symbol
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Logowanie-brak-dostepu.html").readText()))
|
||||
}
|
||||
with(server) {
|
||||
enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
enqueue("Login-success.html", LoginTest::class.java)
|
||||
enqueue("JednostkiUzytkownika.json", MessagesTest::class.java)
|
||||
enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
enqueue("WitrynaUcznia.html", RegisterTest::class.java)
|
||||
enqueue("UczenCache.json", RegisterTest::class.java)
|
||||
enqueue("UczenDziennik-multi.json", RegisterTest::class.java)
|
||||
(1..4).onEach { // 4x symbol
|
||||
enqueue("Logowanie-brak-dostepu.html", LoginTest::class.java)
|
||||
}
|
||||
|
||||
server.start(3000)
|
||||
start(3000)
|
||||
}
|
||||
|
||||
val res = runBlocking { registerStudent.getStudents() }
|
||||
|
||||
|
@ -80,20 +101,24 @@ class RegisterTest : BaseLocalTest() {
|
|||
}
|
||||
|
||||
@Test
|
||||
fun getStudents_filterDiariesWithoutSemester() {
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("LoginPage-standard.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Logowanie-uonet.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Login-success.html").readText()))
|
||||
server.enqueue("JednostkiUzytkownika.json", MessagesTest::class.java)
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("LoginPage-standard.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("WitrynaUcznia.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("UczenCache.json").readText()))
|
||||
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("UczenDziennik-no-semester.json").readText()))
|
||||
(1..4).onEach { // 4x symbol
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Logowanie-brak-dostepu.html").readText()))
|
||||
}
|
||||
fun getStudents_filterKindergartenDiaries() {
|
||||
with(server) {
|
||||
enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
enqueue("Login-success.html", LoginTest::class.java)
|
||||
enqueue("JednostkiUzytkownika.json", MessagesTest::class.java)
|
||||
|
||||
server.start(3000)
|
||||
enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
enqueue("WitrynaUcznia.html", RegisterTest::class.java)
|
||||
enqueue("UczenCache.json", RegisterTest::class.java)
|
||||
enqueue("UczenDziennik-no-semester.json", RegisterTest::class.java)
|
||||
|
||||
(1..4).onEach { // 4x symbol
|
||||
enqueue("Logowanie-brak-dostepu.html", LoginTest::class.java)
|
||||
}
|
||||
|
||||
start(3000)
|
||||
}
|
||||
|
||||
val res = runBlocking { registerStudent.getStudents() }
|
||||
|
||||
|
@ -103,56 +128,31 @@ class RegisterTest : BaseLocalTest() {
|
|||
assertEquals(1, studentId)
|
||||
assertEquals("Jan", studentName)
|
||||
assertEquals("Kowalski", studentSurname)
|
||||
assertEquals(1, classId)
|
||||
assertEquals(0, classId) // always 0 for kindergarten
|
||||
assertEquals("Publiczna szkoła Wulkanowego nr 1 w fakelog.cf", schoolName)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getStudents_filterDiariesWithEmptySemester() {
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("LoginPage-standard.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Logowanie-uonet.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Login-success.html").readText()))
|
||||
server.enqueue("JednostkiUzytkownika.json", MessagesTest::class.java)
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("LoginPage-standard.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("WitrynaUcznia.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("UczenCache.json").readText()))
|
||||
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("UczenDziennik-empty-semester.json").readText()))
|
||||
(1..4).onEach { // 4x symbol
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Logowanie-brak-dostepu.html").readText()))
|
||||
}
|
||||
|
||||
server.start(3000)
|
||||
|
||||
val res = runBlocking { registerStudent.getStudents() }
|
||||
|
||||
assertEquals(1, res.size)
|
||||
|
||||
res[0].run {
|
||||
assertEquals(1, studentId)
|
||||
assertEquals("Jan", studentName)
|
||||
assertEquals("Kowalski", studentSurname)
|
||||
assertEquals(1, classId)
|
||||
assertEquals("Publiczna szkoła Wulkanowego nr 1 w fakelog.cf", schoolName)
|
||||
assertEquals("A", className)
|
||||
assertEquals(2, semesters.size)
|
||||
assertEquals(2016, semesters[0].schoolYear)
|
||||
assertEquals(2017, semesters[1].schoolYear)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getStudents_classNameOrder() {
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("LoginPage-standard.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Logowanie-uonet.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Login-success.html").readText()))
|
||||
server.enqueue("JednostkiUzytkownika.json", MessagesTest::class.java)
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("LoginPage-standard.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("WitrynaUcznia.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("UczenCache.json").readText()))
|
||||
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("UczenDziennik.json").readText()))
|
||||
(1..4).onEach { // 4x symbol
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Logowanie-brak-dostepu.html").readText()))
|
||||
}
|
||||
with(server) {
|
||||
enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
enqueue("Login-success.html", LoginTest::class.java)
|
||||
enqueue("JednostkiUzytkownika.json", MessagesTest::class.java)
|
||||
enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
enqueue("WitrynaUcznia.html", RegisterTest::class.java)
|
||||
enqueue("UczenCache.json", RegisterTest::class.java)
|
||||
enqueue("UczenDziennik.json", RegisterTest::class.java)
|
||||
(1..4).onEach { // 4x symbol
|
||||
enqueue("Logowanie-brak-dostepu.html", LoginTest::class.java)
|
||||
}
|
||||
|
||||
server.start(3000)
|
||||
start(3000)
|
||||
}
|
||||
|
||||
val res = runBlocking { registerStudent.getStudents() }
|
||||
|
||||
|
|
|
@ -33,7 +33,11 @@ class RegisterRepositoryTest : BaseLocalTest() {
|
|||
Scrapper.LoginType.STANDARD, "http", "fakelog.localhost:3000", symbol, CookieManager(),
|
||||
getService(LoginService::class.java, "http://fakelog.localhost:3000/")
|
||||
),
|
||||
register = getService(service = RegisterService::class.java, url = "http://fakelog.localhost:3000/", okHttp = getOkHttp(errorInterceptor = false, autoLoginInterceptorOn = false)),
|
||||
register = getService(
|
||||
service = RegisterService::class.java,
|
||||
url = "http://fakelog.localhost:3000/",
|
||||
okHttp = getOkHttp(errorInterceptor = false, autoLoginInterceptorOn = false)
|
||||
),
|
||||
messages = getService(service = MessagesService::class.java, html = false),
|
||||
student = getService(service = StudentService::class.java, html = false),
|
||||
url = ServiceManager.UrlGenerator("http", "fakelog.localhost:3000", symbol, "")
|
||||
|
@ -42,20 +46,22 @@ class RegisterRepositoryTest : BaseLocalTest() {
|
|||
|
||||
@Test
|
||||
fun normalLogin_one() {
|
||||
server.enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
server.enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
server.enqueue("Login-success.html", LoginTest::class.java)
|
||||
with(server) {
|
||||
enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
enqueue("Login-success.html", LoginTest::class.java)
|
||||
|
||||
server.enqueue("JednostkiUzytkownika.json", MessagesTest::class.java)
|
||||
server.enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
server.enqueue("WitrynaUcznia.html", RegisterTest::class.java)
|
||||
server.enqueue("UczenCache.json", RegisterTest::class.java)
|
||||
server.enqueue("UczenDziennik-no-semester.json", RegisterTest::class.java)
|
||||
enqueue("JednostkiUzytkownika.json", MessagesTest::class.java)
|
||||
enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
enqueue("WitrynaUcznia.html", RegisterTest::class.java)
|
||||
enqueue("UczenCache.json", RegisterTest::class.java)
|
||||
enqueue("UczenDziennik-no-semester.json", RegisterTest::class.java)
|
||||
|
||||
(1..4).onEach { // 4x symbol
|
||||
server.enqueue("Logowanie-brak-dostepu.html", LoginTest::class.java)
|
||||
(1..4).onEach { // 4x symbol
|
||||
enqueue("Logowanie-brak-dostepu.html", LoginTest::class.java)
|
||||
}
|
||||
start(3000)
|
||||
}
|
||||
server.start(3000)
|
||||
|
||||
val students = runBlocking { getRegisterRepository("Default").getStudents() }
|
||||
|
||||
|
@ -69,20 +75,22 @@ class RegisterRepositoryTest : BaseLocalTest() {
|
|||
|
||||
@Test
|
||||
fun normalLogin_semesters() {
|
||||
server.enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
server.enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
server.enqueue("Login-success.html", LoginTest::class.java)
|
||||
with(server) {
|
||||
enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
enqueue("Login-success.html", LoginTest::class.java)
|
||||
|
||||
server.enqueue("JednostkiUzytkownika.json", MessagesTest::class.java)
|
||||
server.enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
server.enqueue("WitrynaUcznia.html", RegisterTest::class.java)
|
||||
server.enqueue("UczenCache.json", RegisterTest::class.java)
|
||||
server.enqueue("UczenDziennik.json", RegisterTest::class.java)
|
||||
enqueue("JednostkiUzytkownika.json", MessagesTest::class.java)
|
||||
enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
enqueue("WitrynaUcznia.html", RegisterTest::class.java)
|
||||
enqueue("UczenCache.json", RegisterTest::class.java)
|
||||
enqueue("UczenDziennik.json", RegisterTest::class.java)
|
||||
|
||||
(1..4).onEach { // 4x symbol
|
||||
server.enqueue("Logowanie-brak-dostepu.html", LoginTest::class.java)
|
||||
(1..4).onEach { // 4x symbol
|
||||
enqueue("Logowanie-brak-dostepu.html", LoginTest::class.java)
|
||||
}
|
||||
start(3000)
|
||||
}
|
||||
server.start(3000)
|
||||
|
||||
val students = runBlocking { getRegisterRepository("Default").getStudents() }
|
||||
|
||||
|
@ -97,22 +105,24 @@ class RegisterRepositoryTest : BaseLocalTest() {
|
|||
|
||||
@Test
|
||||
fun normalLogin_triple() {
|
||||
server.enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
server.enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
server.enqueue("Login-success-triple.html", LoginTest::class.java)
|
||||
with(server) {
|
||||
enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
enqueue("Login-success-triple.html", LoginTest::class.java)
|
||||
|
||||
server.enqueue("JednostkiUzytkownika.json", MessagesTest::class.java)
|
||||
(0..2).onEach {
|
||||
server.enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
server.enqueue("WitrynaUcznia.html", RegisterTest::class.java)
|
||||
server.enqueue("UczenCache.json", RegisterTest::class.java)
|
||||
server.enqueue("UczenDziennik-no-semester.json", RegisterTest::class.java)
|
||||
}
|
||||
enqueue("JednostkiUzytkownika.json", MessagesTest::class.java)
|
||||
(0..2).onEach {
|
||||
enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
enqueue("WitrynaUcznia.html", RegisterTest::class.java)
|
||||
enqueue("UczenCache.json", RegisterTest::class.java)
|
||||
enqueue("UczenDziennik-no-semester.json", RegisterTest::class.java)
|
||||
}
|
||||
|
||||
(1..4).onEach { // 4x symbol
|
||||
server.enqueue("Logowanie-brak-dostepu.html", LoginTest::class.java)
|
||||
(1..4).onEach { // 4x symbol
|
||||
enqueue("Logowanie-brak-dostepu.html", LoginTest::class.java)
|
||||
}
|
||||
start(3000)
|
||||
}
|
||||
server.start(3000)
|
||||
|
||||
val students = runBlocking { getRegisterRepository("Default").getStudents() }
|
||||
assertEquals(3, students.size)
|
||||
|
@ -135,26 +145,28 @@ class RegisterRepositoryTest : BaseLocalTest() {
|
|||
|
||||
@Test
|
||||
fun normalLogin_temporarilyOff() {
|
||||
server.enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
server.enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
server.enqueue("Login-success-triple.html", LoginTest::class.java)
|
||||
with(server) {
|
||||
enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
enqueue("Login-success-triple.html", LoginTest::class.java)
|
||||
|
||||
server.enqueue("JednostkiUzytkownika.json", MessagesTest::class.java)
|
||||
(0..1).onEach {
|
||||
server.enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
server.enqueue("WitrynaUcznia.html", RegisterTest::class.java)
|
||||
server.enqueue("UczenCache.json", RegisterTest::class.java)
|
||||
server.enqueue("UczenDziennik-no-semester.json", RegisterTest::class.java)
|
||||
enqueue("JednostkiUzytkownika.json", MessagesTest::class.java)
|
||||
(0..1).onEach {
|
||||
enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
enqueue("WitrynaUcznia.html", RegisterTest::class.java)
|
||||
enqueue("UczenCache.json", RegisterTest::class.java)
|
||||
enqueue("UczenDziennik-no-semester.json", RegisterTest::class.java)
|
||||
}
|
||||
|
||||
enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
enqueue("AplikacjaCzasowoWyłączona.html", ErrorInterceptorTest::class.java)
|
||||
|
||||
(1..4).onEach { // 4x symbol
|
||||
enqueue("Logowanie-brak-dostepu.html", LoginTest::class.java)
|
||||
}
|
||||
start(3000)
|
||||
}
|
||||
|
||||
server.enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
server.enqueue("AplikacjaCzasowoWyłączona.html", ErrorInterceptorTest::class.java)
|
||||
|
||||
(1..4).onEach { // 4x symbol
|
||||
server.enqueue("Logowanie-brak-dostepu.html", LoginTest::class.java)
|
||||
}
|
||||
server.start(3000)
|
||||
|
||||
val students = runBlocking { getRegisterRepository("Default").getStudents() }
|
||||
assertEquals(2, students.size)
|
||||
}
|
||||
|
@ -176,27 +188,32 @@ class RegisterRepositoryTest : BaseLocalTest() {
|
|||
|
||||
@Test
|
||||
fun filterSymbolsWithSpaces() {
|
||||
server.enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
server.enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
with(server) {
|
||||
enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
|
||||
(1..5).onEach {
|
||||
server.enqueue("Login-success-old.html", LoginTest::class.java)
|
||||
server.enqueue("JednostkiUzytkownika.json", MessagesTest::class.java)
|
||||
(1..5).onEach {
|
||||
enqueue("Login-success-old.html", LoginTest::class.java)
|
||||
enqueue("JednostkiUzytkownika.json", MessagesTest::class.java)
|
||||
}
|
||||
|
||||
start(3000)
|
||||
}
|
||||
|
||||
server.start(3000)
|
||||
|
||||
runBlocking { normal.getStudents() }
|
||||
val students = runBlocking { normal.getStudents() }
|
||||
assertEquals(0, students.size)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun normalizeInvalidSymbol_default() {
|
||||
server.enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
server.enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
server.enqueue("Logowanie-brak-dostepu.html", LoginTest::class.java)
|
||||
server.enqueue("Offline.html", ErrorInterceptorTest::class.java)
|
||||
with(server) {
|
||||
enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-brak-dostepu.html", LoginTest::class.java)
|
||||
enqueue("Offline.html", ErrorInterceptorTest::class.java)
|
||||
|
||||
server.start(3000)
|
||||
start(3000)
|
||||
}
|
||||
|
||||
try {
|
||||
runBlocking { getRegisterRepository("Default").getStudents() }
|
||||
|
@ -211,12 +228,14 @@ class RegisterRepositoryTest : BaseLocalTest() {
|
|||
|
||||
@Test
|
||||
fun normalizeInvalidSymbol_custom() {
|
||||
server.enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
server.enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
server.enqueue("Logowanie-brak-dostepu.html", LoginTest::class.java)
|
||||
server.enqueue("Offline.html", ErrorInterceptorTest::class.java)
|
||||
with(server) {
|
||||
enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-brak-dostepu.html", LoginTest::class.java)
|
||||
enqueue("Offline.html", ErrorInterceptorTest::class.java)
|
||||
|
||||
server.start(3000)
|
||||
start(3000)
|
||||
}
|
||||
|
||||
try {
|
||||
runBlocking { getRegisterRepository(" Rzeszów + ").getStudents() }
|
||||
|
@ -231,12 +250,14 @@ class RegisterRepositoryTest : BaseLocalTest() {
|
|||
|
||||
@Test
|
||||
fun normalizeInvalidSymbol_trimMultipleSpaces() {
|
||||
server.enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
server.enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
server.enqueue("Logowanie-brak-dostepu.html", LoginTest::class.java)
|
||||
server.enqueue("Offline.html", ErrorInterceptorTest::class.java)
|
||||
with(server) {
|
||||
enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-brak-dostepu.html", LoginTest::class.java)
|
||||
enqueue("Offline.html", ErrorInterceptorTest::class.java)
|
||||
|
||||
server.start(3000)
|
||||
start(3000)
|
||||
}
|
||||
|
||||
try {
|
||||
runBlocking { getRegisterRepository(" Niepoprawny symbol no ale + ").getStudents() }
|
||||
|
@ -251,12 +272,14 @@ class RegisterRepositoryTest : BaseLocalTest() {
|
|||
|
||||
@Test
|
||||
fun normalizeInvalidSymbol_emptyFallback() {
|
||||
server.enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
server.enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
server.enqueue("Logowanie-brak-dostepu.html", LoginTest::class.java)
|
||||
server.enqueue("Offline.html", ErrorInterceptorTest::class.java)
|
||||
with(server) {
|
||||
enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-brak-dostepu.html", LoginTest::class.java)
|
||||
enqueue("Offline.html", ErrorInterceptorTest::class.java)
|
||||
|
||||
server.start(3000)
|
||||
start(3000)
|
||||
}
|
||||
|
||||
try {
|
||||
runBlocking { getRegisterRepository(" + ").getStudents() }
|
||||
|
@ -271,12 +294,14 @@ class RegisterRepositoryTest : BaseLocalTest() {
|
|||
|
||||
@Test
|
||||
fun normalizeInvalidSymbol_digits() {
|
||||
server.enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
server.enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
server.enqueue("Logowanie-brak-dostepu.html", LoginTest::class.java)
|
||||
server.enqueue("Offline.html", ErrorInterceptorTest::class.java)
|
||||
with(server) {
|
||||
enqueue("LoginPage-standard.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-brak-dostepu.html", LoginTest::class.java)
|
||||
enqueue("Offline.html", ErrorInterceptorTest::class.java)
|
||||
|
||||
server.start(3000)
|
||||
start(3000)
|
||||
}
|
||||
|
||||
try {
|
||||
runBlocking { getRegisterRepository("Default").getStudents() }
|
||||
|
|
|
@ -5,7 +5,6 @@ import io.github.wulkanowy.sdk.scrapper.Scrapper
|
|||
import io.github.wulkanowy.sdk.scrapper.login.LoginTest
|
||||
import io.github.wulkanowy.sdk.scrapper.register.RegisterTest
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import okhttp3.mockwebserver.MockResponse
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
|
||||
|
@ -26,8 +25,10 @@ class StudentStartRepositoryTest : BaseLocalTest() {
|
|||
|
||||
@Test
|
||||
fun getSemesters() {
|
||||
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("UczenDziennik.json").readText()))
|
||||
server.start(3000) //
|
||||
with(server) {
|
||||
enqueue("UczenDziennik.json", RegisterTest::class.java)
|
||||
start(3000) //
|
||||
}
|
||||
|
||||
api.studentId = 1
|
||||
api.classId = 1
|
||||
|
@ -48,8 +49,10 @@ class StudentStartRepositoryTest : BaseLocalTest() {
|
|||
|
||||
@Test
|
||||
fun getSemesters_empty() {
|
||||
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("UczenDziennik.json").readText()))
|
||||
server.start(3000) //
|
||||
with(server) {
|
||||
enqueue("UczenDziennik.json", RegisterTest::class.java)
|
||||
start(3000) //
|
||||
}
|
||||
|
||||
api.studentId = 1
|
||||
api.classId = 2 //
|
||||
|
@ -61,8 +64,10 @@ class StudentStartRepositoryTest : BaseLocalTest() {
|
|||
|
||||
@Test
|
||||
fun getSemesters_studentWithMultiClasses() {
|
||||
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("UczenDziennik-multi.json").readText()))
|
||||
server.start(3000) //
|
||||
with(server) {
|
||||
enqueue("UczenDziennik-multi.json", RegisterTest::class.java)
|
||||
start(3000)
|
||||
}
|
||||
|
||||
api.studentId = 3881
|
||||
api.classId = 121
|
||||
|
@ -77,8 +82,10 @@ class StudentStartRepositoryTest : BaseLocalTest() {
|
|||
|
||||
@Test
|
||||
fun getSemesters_graduate() {
|
||||
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("UczenDziennik.json").readText()))
|
||||
server.start(3000) //
|
||||
with(server) {
|
||||
enqueue("UczenDziennik.json", RegisterTest::class.java)
|
||||
start(3000) //
|
||||
}
|
||||
|
||||
api.studentId = 2
|
||||
api.classId = 2
|
||||
|
@ -93,13 +100,15 @@ class StudentStartRepositoryTest : BaseLocalTest() {
|
|||
|
||||
@Test
|
||||
fun getSemesters_normal() {
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Logowanie-standard.html").readText()))
|
||||
with(server) {
|
||||
enqueue("Logowanie-standard.html", LoginTest::class.java)
|
||||
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Logowanie-uonet.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Login-success.html").readText()))
|
||||
enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
enqueue("Login-success.html", LoginTest::class.java)
|
||||
|
||||
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("UczenDziennik.json").readText()))
|
||||
server.start(3000) //
|
||||
enqueue("UczenDziennik.json", RegisterTest::class.java)
|
||||
start(3000) //
|
||||
}
|
||||
|
||||
with(api) {
|
||||
studentId = 1
|
||||
|
@ -117,14 +126,16 @@ class StudentStartRepositoryTest : BaseLocalTest() {
|
|||
|
||||
@Test
|
||||
fun getSemesters_ADFS() {
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("ADFS.html").readText())) //
|
||||
with(server) {
|
||||
enqueue("ADFS.html", LoginTest::class.java) //
|
||||
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Logowanie-cufs.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Logowanie-uonet.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Login-success.html").readText()))
|
||||
enqueue("Logowanie-cufs.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
enqueue("Login-success.html", LoginTest::class.java)
|
||||
|
||||
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("UczenDziennik.json").readText()))
|
||||
server.start(3000) //
|
||||
enqueue("UczenDziennik.json", RegisterTest::class.java)
|
||||
start(3000) //
|
||||
}
|
||||
|
||||
with(api) {
|
||||
studentId = 1
|
||||
|
@ -142,14 +153,16 @@ class StudentStartRepositoryTest : BaseLocalTest() {
|
|||
|
||||
@Test
|
||||
fun getSemesters_ADFSLight() {
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("ADFSLight-form-1.html").readText()))
|
||||
with(server) {
|
||||
enqueue("ADFSLight-form-1.html", LoginTest::class.java)
|
||||
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Logowanie-cufs.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Logowanie-uonet.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Login-success.html").readText()))
|
||||
enqueue("Logowanie-cufs.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
enqueue("Login-success.html", LoginTest::class.java)
|
||||
|
||||
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("UczenDziennik.json").readText()))
|
||||
server.start(3000) //
|
||||
enqueue("UczenDziennik.json", RegisterTest::class.java)
|
||||
start(3000) //
|
||||
}
|
||||
|
||||
with(api) {
|
||||
studentId = 1
|
||||
|
@ -167,15 +180,17 @@ class StudentStartRepositoryTest : BaseLocalTest() {
|
|||
|
||||
@Test
|
||||
fun getSemesters_ADFSCards() {
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("ADFSCards.html").readText()))
|
||||
with(server) {
|
||||
enqueue("ADFSCards.html", LoginTest::class.java)
|
||||
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("ADFSCards.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Logowanie-cufs.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Logowanie-uonet.html").readText()))
|
||||
server.enqueue(MockResponse().setBody(LoginTest::class.java.getResource("Login-success.html").readText()))
|
||||
enqueue("ADFSCards.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-cufs.html", LoginTest::class.java)
|
||||
enqueue("Logowanie-uonet.html", LoginTest::class.java)
|
||||
enqueue("Login-success.html", LoginTest::class.java)
|
||||
|
||||
server.enqueue(MockResponse().setBody(RegisterTest::class.java.getResource("UczenDziennik.json").readText()))
|
||||
server.start(3000) //
|
||||
enqueue("UczenDziennik.json", RegisterTest::class.java)
|
||||
start(3000) //
|
||||
}
|
||||
|
||||
with(api) {
|
||||
studentId = 1
|
||||
|
|
|
@ -32,6 +32,7 @@ class ServiceManagerTest : BaseLocalTest() {
|
|||
schoolSymbol = "schoolSymbol",
|
||||
studentId = 123,
|
||||
diaryId = 101,
|
||||
kindergartenDiaryId = 0,
|
||||
schoolYear = 2019,
|
||||
emptyCookieJarIntercept = false,
|
||||
androidVersion = "",
|
||||
|
@ -62,6 +63,7 @@ class ServiceManagerTest : BaseLocalTest() {
|
|||
schoolSymbol = "schoolSymbol",
|
||||
studentId = 123,
|
||||
diaryId = 101,
|
||||
kindergartenDiaryId = 0,
|
||||
schoolYear = 2019,
|
||||
emptyCookieJarIntercept = false,
|
||||
androidVersion = "",
|
||||
|
@ -117,9 +119,22 @@ class ServiceManagerTest : BaseLocalTest() {
|
|||
server.enqueue(MockResponse().setResponseCode(503))
|
||||
server.start(3000)
|
||||
val manager = ServiceManager(
|
||||
OkHttpClientBuilderFactory(), HttpLoggingInterceptor.Level.NONE,
|
||||
Scrapper.LoginType.STANDARD, "http", "fakelog.localhost:3000", "default", "email", "password",
|
||||
"schoolSymbol", 123, 101, 2019, true, "", ""
|
||||
okHttpClientBuilderFactory = OkHttpClientBuilderFactory(),
|
||||
logLevel = HttpLoggingInterceptor.Level.NONE,
|
||||
loginType = Scrapper.LoginType.STANDARD,
|
||||
schema = "http",
|
||||
host = "fakelog.localhost:3000",
|
||||
symbol = "default",
|
||||
email = "email",
|
||||
password = "password",
|
||||
schoolSymbol = "schoolSymbol",
|
||||
studentId = 123,
|
||||
diaryId = 101,
|
||||
kindergartenDiaryId = 0,
|
||||
schoolYear = 2019,
|
||||
emptyCookieJarIntercept = true,
|
||||
androidVersion = "",
|
||||
buildTag = "",
|
||||
)
|
||||
|
||||
val res = runCatching {
|
||||
|
|
|
@ -3,6 +3,11 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Uonet+</title>
|
||||
<script>
|
||||
var VParam = {
|
||||
// should works without these values
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="startScreen" id="app" >
|
||||
|
@ -17,12 +22,15 @@
|
|||
<div class="panel linkownia pracownik klient">
|
||||
<div class="appLink">
|
||||
<div id="idAppUczen" class="subDiv">
|
||||
<a href="https://uonetplus-opiekun.fakelog.cf:3000/Default/000788/Start/Index/"><span class="header directLink">ZST-CKZiU</span></a>
|
||||
<br />
|
||||
<a href="https://uonetplus-opiekun.fakelog.cf:3000/Default/004355/Start/Index/"><span class="header directLink">ZSET</span></a>
|
||||
<br />
|
||||
<a href="https://uonetplus-opiekun.fakelog.cf:3000/Default/016636/Start/Index/"><span class="header directLink">G7 Wulkanowo</span></a>
|
||||
<br />
|
||||
<a href="https://uonetplus-opiekun.fakelog.cf:3000/Default/000788/Start/Index/"><span
|
||||
class="header directLink">ZST-CKZiU</span></a>
|
||||
<br/>
|
||||
<a href="https://uonetplus-opiekun.fakelog.cf:3000/Default/004355/Start/Index/"><span
|
||||
class="header directLink">ZSET</span></a>
|
||||
<br/>
|
||||
<a href="https://uonetplus-opiekun.fakelog.cf:3000/Default/016636/Start/Index/"><span
|
||||
class="header directLink">G7 Wulkanowo</span></a>
|
||||
<br/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="newAppLink">
|
||||
|
@ -31,23 +39,25 @@
|
|||
<div>
|
||||
<div class="UczenExtImg appImg"></div>
|
||||
<div class="name">
|
||||
Uczeń<br />
|
||||
Uczeń<br/>
|
||||
<span><b>NOWOŚĆ</b></span>
|
||||
</div>
|
||||
<div class="newAppLogo"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="idAppUczenExt" class="subDiv">
|
||||
<a href="https://uonetplus-uczen.fakelog.cf:3000/Default/000788/"><span class="header directLink">ZST-CKZiU</span></a><br />
|
||||
<a href="https://uonetplus-uczen.fakelog.cf:3000/Default/004355/"><span class="header directLink">ZSET</span></a><br />
|
||||
<a href="https://uonetplus-uczen.fakelog.cf:3000/Default/016636/"><span class="header directLink">G7 Wulkanowo</span></a><br />
|
||||
<a href="https://uonetplus-uczen.fakelog.cf:3000/Default/000788/"><span class="header directLink">ZST-CKZiU</span></a><br/>
|
||||
<a href="https://uonetplus-uczen.fakelog.cf:3000/Default/004355/"><span
|
||||
class="header directLink">ZSET</span></a><br/>
|
||||
<a href="https://uonetplus-uczen.fakelog.cf:3000/Default/016636/"><span class="header directLink">G7 Wulkanowo</span></a><br/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottomBar"><span><a href="http://www.vulcan.edu.pl/" class="appVersion" target="_blank">VULCAN sp. z o.o., UONET+, wersja 19.11.0002.35804</a></span></div>
|
||||
<div class="bottomBar"><span><a href="http://www.vulcan.edu.pl/" class="appVersion" target="_blank">VULCAN sp. z o.o., UONET+, wersja 19.11.0002.35804</a></span>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -3,6 +3,14 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Uonet+</title>
|
||||
<script>
|
||||
var VParam = {
|
||||
rootUrl: 'http://uonetplus-opiekun.fakelog.localhost:3000/',
|
||||
clientSymbol: 'powiatwulkanowy',
|
||||
appVersion: '19.9.0.3497',
|
||||
permissions: 'eyJVbml0cyI6W3siSWQiOjYsIk5hendhIjoiUHVibGljem5hIHN6a2/FgmEgV3Vsa2Fub3dlZ28gbnIgMSB3IGZha2Vsb2cuY2YiLCJTa3JvdCI6IkZha2UxMjM0NTYiLCJTeW1ib2wiOiIxMjM0NTYifSx7IklkIjo3LCJOYXp3YSI6IlB1YmxpY3puYSBzemtvxYJhIFd1bGthbm93ZWdvIG5yIDIgdyBmYWtlbG9nLmNmIiwiU2tyb3QiOiJGYWtlMTIzNDU3IiwiU3ltYm9sIjoiMTIzNDU3In0seyJJZCI6OCwiTmF6d2EiOiJQdWJsaWN6bmEgc3prb8WCYSBXdWxrYW5vd2VnbyBuciAzIHcgZmFrZWxvZy5jZiIsIlNrcm90IjoiRmFrZTEyMzQ1OCIsIlN5bWJvbCI6IjEyMzQ1OCJ9XSwiQXV0aEluZm9zIjpbeyJKZWRub3N0a2FTcHJhd296ZGF3Y3phSWQiOjYsIkxvZ2luSWQiOjY1NDMyMSwiTG9naW5WYWx1ZSI6ImphbkBmYWtlbG9nLmNmIiwiVWN6ZW5JZHMiOlsxLDJdLCJPcGlla3VuSWRzIjpbXSwiUHJhY293bmlrSWRzIjpbXSwiUm9sZXMiOls3XSwiTGlua2VkQWNjb3VudFVpZHMiOltdfSx7IkplZG5vc3RrYVNwcmF3b3pkYXdjemFJZCI6NywiTG9naW5JZCI6NzU0MzIxLCJMb2dpblZhbHVlIjoiamFuQGZha2Vsb2cuY2YiLCJVY3plbklkcyI6WzEsMl0sIk9waWVrdW5JZHMiOltdLCJQcmFjb3duaWtJZHMiOltdLCJSb2xlcyI6WzddLCJMaW5rZWRBY2NvdW50VWlkcyI6W119LHsiSmVkbm9zdGthU3ByYXdvemRhd2N6YUlkIjo4LCJMb2dpbklkIjo4NTQzMjEsIkxvZ2luVmFsdWUiOiJqYW5AZmFrZWxvZy5jZiIsIlVjemVuSWRzIjpbMSwyXSwiT3BpZWt1bklkcyI6W10sIlByYWNvd25pa0lkcyI6W10sIlJvbGVzIjpbN10sIkxpbmtlZEFjY291bnRVaWRzIjpbXX1dfQ==|bqmc7UKWp4Xh17GpcwELUzpEICxn9su8VhGAlz5hrlg=',
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="startScreen">
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<input id="Password" name="Password" type="password">
|
||||
</div>
|
||||
<div class="center">
|
||||
<input type="submit" value="Zaloguj się >"/>
|
||||
<input type="submit" class="loginButton" value="Zaloguj się >"/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
@ -1,74 +0,0 @@
|
|||
{
|
||||
"data": [
|
||||
{
|
||||
"Id": 1,
|
||||
"IdUczen": 1,
|
||||
"UczenImie": "Jan",
|
||||
"UczenImie2": "Marek",
|
||||
"UczenNazwisko": "Kowalski",
|
||||
"IsDziennik": true,
|
||||
"IdDziennik": 11,
|
||||
"IdPrzedszkoleDziennik": 0,
|
||||
"Poziom": 1,
|
||||
"Symbol": "A",
|
||||
"Nazwa": null,
|
||||
"DziennikRokSzkolny": 2016,
|
||||
"Okresy": [
|
||||
{
|
||||
"NumerOkresu": 1,
|
||||
"Poziom": 1,
|
||||
"DataOd": "2016-08-31 22:00:00",
|
||||
"DataDo": "2017-01-30 23:00:00",
|
||||
"IdOddzial": 1,
|
||||
"IdJednostkaSprawozdawcza": 6,
|
||||
"IsLastOkres": false,
|
||||
"Id": 1234563
|
||||
},
|
||||
{
|
||||
"NumerOkresu": 2,
|
||||
"Poziom": 1,
|
||||
"DataOd": "2017-01-31 22:00:00",
|
||||
"DataDo": "2017-08-30 23:00:00",
|
||||
"IdOddzial": 1,
|
||||
"IdJednostkaSprawozdawcza": 6,
|
||||
"IsLastOkres": true,
|
||||
"Id": 1234564
|
||||
}
|
||||
],
|
||||
"IdSioTyp": 11,
|
||||
"IsDorosli": false,
|
||||
"IsPolicealna": false,
|
||||
"Is13": false,
|
||||
"IsArtystyczna": false,
|
||||
"IsArtystyczna13": false,
|
||||
"IsSpecjalny": false,
|
||||
"IsPrzedszkola": false,
|
||||
"UczenPelnaNazwa": "1A 2016 - Jan Kowalski"
|
||||
},
|
||||
{
|
||||
"Id": 2,
|
||||
"IdUczen": 1,
|
||||
"UczenImie": "Jan",
|
||||
"UczenImie2": "Marek",
|
||||
"UczenNazwisko": "Kowalski",
|
||||
"IsDziennik": true,
|
||||
"IdDziennik": 13,
|
||||
"IdPrzedszkoleDziennik": 0,
|
||||
"Poziom": 2,
|
||||
"Symbol": "A",
|
||||
"Nazwa": null,
|
||||
"DziennikRokSzkolny": 2017,
|
||||
"Okresy": [],
|
||||
"IdSioTyp": 11,
|
||||
"IsDorosli": false,
|
||||
"IsPolicealna": false,
|
||||
"Is13": false,
|
||||
"IsArtystyczna": false,
|
||||
"IsArtystyczna13": false,
|
||||
"IsSpecjalny": false,
|
||||
"IsPrzedszkola": false,
|
||||
"UczenPelnaNazwa": "2A 2017 - Jan Kowalski"
|
||||
}
|
||||
],
|
||||
"success": true
|
||||
}
|
|
@ -35,6 +35,8 @@
|
|||
"Id": 714
|
||||
}
|
||||
],
|
||||
"DziennikDataOd": "2015-09-01 00:00:00",
|
||||
"DziennikDataDo": "2016-08-31 00:00:00",
|
||||
"IdSioTyp": 16,
|
||||
"IsDorosli": false,
|
||||
"IsPolicealna": false,
|
||||
|
@ -80,6 +82,8 @@
|
|||
"Id": 698
|
||||
}
|
||||
],
|
||||
"DziennikDataOd": "2015-09-01 00:00:00",
|
||||
"DziennikDataDo": "2016-08-31 00:00:00",
|
||||
"IdSioTyp": 16,
|
||||
"IsDorosli": false,
|
||||
"IsPolicealna": false,
|
||||
|
|
|
@ -8,33 +8,14 @@
|
|||
"UczenNazwisko": "Kowalski",
|
||||
"IsDziennik": true,
|
||||
"IdDziennik": 11,
|
||||
"IdPrzedszkoleDziennik": 0,
|
||||
"Poziom": 1,
|
||||
"IdPrzedszkoleDziennik": 14,
|
||||
"Poziom": 4,
|
||||
"Symbol": "A",
|
||||
"Nazwa": null,
|
||||
"DziennikRokSzkolny": 2016,
|
||||
"Okresy": [
|
||||
{
|
||||
"NumerOkresu": 1,
|
||||
"Poziom": 1,
|
||||
"DataOd": "2016-08-31 22:00:00",
|
||||
"DataDo": "2017-01-30 23:00:00",
|
||||
"IdOddzial": 1,
|
||||
"IdJednostkaSprawozdawcza": 6,
|
||||
"IsLastOkres": false,
|
||||
"Id": 1234563
|
||||
},
|
||||
{
|
||||
"NumerOkresu": 2,
|
||||
"Poziom": 1,
|
||||
"DataOd": "2017-01-31 22:00:00",
|
||||
"DataDo": "2017-08-30 23:00:00",
|
||||
"IdOddzial": 1,
|
||||
"IdJednostkaSprawozdawcza": 6,
|
||||
"IsLastOkres": true,
|
||||
"Id": 1234564
|
||||
}
|
||||
],
|
||||
"Okresy": [],
|
||||
"DziennikDataOd": "2016-09-01 00:00:00",
|
||||
"DziennikDataDo": "2017-08-31 00:00:00",
|
||||
"IdSioTyp": 11,
|
||||
"IsDorosli": false,
|
||||
"IsPolicealna": false,
|
||||
|
@ -43,7 +24,7 @@
|
|||
"IsArtystyczna13": false,
|
||||
"IsSpecjalny": false,
|
||||
"IsPrzedszkola": false,
|
||||
"UczenPelnaNazwa": "1A 2016 - Jan Kowalski"
|
||||
"UczenPelnaNazwa": "Poziomki 2016 - Jan Kowalski"
|
||||
},
|
||||
{
|
||||
"Id": 2,
|
||||
|
@ -53,12 +34,14 @@
|
|||
"UczenNazwisko": "Kowalski",
|
||||
"IsDziennik": true,
|
||||
"IdDziennik": 13,
|
||||
"IdPrzedszkoleDziennik": 0,
|
||||
"Poziom": 2,
|
||||
"IdPrzedszkoleDziennik": 14,
|
||||
"Poziom": 14,
|
||||
"Symbol": "A",
|
||||
"Nazwa": null,
|
||||
"DziennikRokSzkolny": 2017,
|
||||
"Okresy": null,
|
||||
"DziennikDataOd": "2017-09-01 00:00:00",
|
||||
"DziennikDataDo": "2018-08-31 00:00:00",
|
||||
"IdSioTyp": 11,
|
||||
"IsDorosli": false,
|
||||
"IsPolicealna": false,
|
||||
|
@ -67,7 +50,7 @@
|
|||
"IsArtystyczna13": false,
|
||||
"IsSpecjalny": false,
|
||||
"IsPrzedszkola": false,
|
||||
"UczenPelnaNazwa": "2A 2017 - Jan Kowalski"
|
||||
"UczenPelnaNazwa": "Poziomki 2017 - Jan Kowalski"
|
||||
}
|
||||
],
|
||||
"success": true
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
"Id": 1234564
|
||||
}
|
||||
],
|
||||
"DziennikDataOd": "2016-08-31 22:00:00",
|
||||
"DziennikDataDo": "2017-08-30 23:00:00",
|
||||
"IdSioTyp": 11,
|
||||
"IsDorosli": false,
|
||||
"IsPolicealna": false,
|
||||
|
@ -80,6 +82,8 @@
|
|||
"Id": 1234566
|
||||
}
|
||||
],
|
||||
"DziennikDataOd": "2017-08-31 22:00:00",
|
||||
"DziennikDataDo": "2018-08-30 23:00:00",
|
||||
"IdSioTyp": 11,
|
||||
"IsDorosli": false,
|
||||
"IsPolicealna": false,
|
||||
|
@ -125,6 +129,8 @@
|
|||
"Id": 1234568
|
||||
}
|
||||
],
|
||||
"DziennikDataOd": "2018-08-31 22:00:00",
|
||||
"DziennikDataDo": "2019-08-30 23:00:00",
|
||||
"IdSioTyp": 11,
|
||||
"IsDorosli": false,
|
||||
"IsPolicealna": false,
|
||||
|
@ -170,6 +176,8 @@
|
|||
"Id": 1234568
|
||||
}
|
||||
],
|
||||
"DziennikDataOd": "2015-09-01 00:00:00",
|
||||
"DziennikDataDo": "2016-08-31 08:00:00",
|
||||
"IdSioTyp": 11,
|
||||
"IsDorosli": false,
|
||||
"IsPolicealna": false,
|
||||
|
@ -215,6 +223,8 @@
|
|||
"Id": 6
|
||||
}
|
||||
],
|
||||
"DziennikDataOd": "2016-09-01 00:00:00",
|
||||
"DziennikDataDo": "2017-08-31 00:00:00",
|
||||
"IdSioTyp": 11,
|
||||
"IsDorosli": false,
|
||||
"IsPolicealna": false,
|
||||
|
@ -260,6 +270,8 @@
|
|||
"Id": 4
|
||||
}
|
||||
],
|
||||
"DziennikDataOd": "2017-09-01 00:00:00",
|
||||
"DziennikDataDo": "2018-08-31 00:00:00",
|
||||
"IdSioTyp": 11,
|
||||
"IsDorosli": false,
|
||||
"IsPolicealna": false,
|
||||
|
|
Loading…
Reference in a new issue