Compare commits
24 commits
Author | SHA1 | Date | |
---|---|---|---|
|
cd14eb62f3 | ||
|
7ea3df0b2b | ||
|
58db9adf6e | ||
|
359cd64dc6 | ||
|
637744236c | ||
|
5d45fdf4bd | ||
|
eb13ce2e41 | ||
|
817236c98d | ||
|
2e8fb36f26 | ||
|
15d5b02073 | ||
|
a7fa593d15 | ||
|
616a84d983 | ||
|
3576d5ce28 | ||
|
d098965883 | ||
|
0d4c597ad2 | ||
|
1996707ee4 | ||
|
c914984deb | ||
|
91cbf2d390 | ||
|
d0a76eb28d | ||
|
97ae7a0be4 | ||
|
ba83fcedd1 | ||
|
e50e756195 | ||
|
1055c44aa3 | ||
|
7560af2d6f |
|
@ -16,10 +16,14 @@ assignees: hernikplays
|
|||
- [ ] ziskejJidelnicek
|
||||
- [ ] jidelnicekDen
|
||||
- [ ] objednat
|
||||
- [ ] doBurzy
|
||||
- [ ] objednatZBurzy
|
||||
- [ ] ziskatBurzu
|
||||
- [ ] ziskejUzivatele
|
||||
|
||||
**V případě nefunkčnosti některé z metod vkládejte sem chybové hlášky a váš kód**
|
||||
|
||||
*Příklad:*
|
||||
- *chybová hláška pro `login`*
|
||||
- *chybová hláška pro `jidelnicekDen`*
|
||||
- *chybová hláška pro `objednat`*
|
||||
- *chybová hláška pro `objednat`*
|
||||
|
|
42
.github/workflows/dart.yml
vendored
Normal file
42
.github/workflows/dart.yml
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
# This workflow uses actions that are not certified by GitHub.
|
||||
# They are provided by a third-party and are governed by
|
||||
# separate terms of service, privacy policy, and support
|
||||
# documentation.
|
||||
|
||||
name: Dart check
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
# Note: This workflow uses the latest stable version of the Dart SDK.
|
||||
# You can specify other versions if desired, see documentation here:
|
||||
# https://github.com/dart-lang/setup-dart/blob/main/README.md
|
||||
# - uses: dart-lang/setup-dart@v1
|
||||
- uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603
|
||||
|
||||
- name: Install dependencies
|
||||
run: dart pub get
|
||||
|
||||
# Uncomment this step to verify the use of 'dart format' on each commit.
|
||||
# - name: Verify formatting
|
||||
# run: dart format --output=none --set-exit-if-changed .
|
||||
|
||||
# Consider passing '--fatal-infos' for slightly stricter analysis.
|
||||
- name: Analyze project source
|
||||
run: dart analyze
|
||||
|
||||
# Your project will need to have tests in test/ and a dependency on
|
||||
# package:test for this step to succeed. Note that Flutter projects will
|
||||
# want to change this to 'flutter test'.
|
||||
#- name: Run tests
|
||||
# run: dart test
|
16
CHANGELOG.md
16
CHANGELOG.md
|
@ -1,3 +1,19 @@
|
|||
## 2.0.0
|
||||
- Alergeny jsou nyní ve tříde `Alergen`
|
||||
- Opravena chyba, kdy se HTML alergenů propisovalo do názvu jídla
|
||||
|
||||
## 1.1.4
|
||||
- Opravit info o stavu na burze
|
||||
## 1.1.3
|
||||
- Opravit hledání burza URL u jídelen, kde je tlačítko ve tvaru `X ks do burzy`
|
||||
## 1.1.2
|
||||
- Opravit negativní čísla v kreditu, účet pro platby by @tpkowastaken in https://github.com/hernikplays/canteenlib/pull/4
|
||||
## 1.1.1
|
||||
- Opravit problém s burzou
|
||||
## 1.1.0-alpha.1
|
||||
- Experimentální podpora pro SPŠEI Ostrava
|
||||
- Hezčí kód
|
||||
- Alergeny
|
||||
## 1.0.1
|
||||
- změnit získávání názvu jídla
|
||||
## 1.0.0
|
||||
|
|
|
@ -3,13 +3,16 @@ V následující tabulce naleznete instance iCanteen, které byly testovány pro
|
|||
|
||||
Výchozí verze, pro kterou aktuálně je knihovna tvořena, je **2.18.19**
|
||||
|
||||
Kantýny, které v adrese obsahují i číslo portu, dokážou být často problémové.
|
||||
|
||||
- ❌ - nefunkční nebo netestováno
|
||||
- ✅ - plně funkční nebo pouze s malými chybami
|
||||
- ❓ - částečně funkční
|
||||
|
||||
| Provozovatel | Verze iCanteen | Funkční | Verze knihovny |
|
||||
|:--------------:|------------------|---------|----------------|
|
||||
| SŠTE Brno | iCanteen 2.18.19 | ✅ | 1.0.1 |
|
||||
| SPŠ Třebíč | iCanteen 2.10.25 | ❓ | 0.1.0-alpha |
|
||||
| Provozovatel | Verze iCanteen | Funkční | Verze knihovny | Adresa |
|
||||
|:--------------:|------------------|---------|----------------|---------|
|
||||
| SŠTE Brno | iCanteen 2.19.13 | ✅ | 2.0.0 | https://stravovani.sstebrno.cz
|
||||
| SPŠ Třebíč | iCanteen 2.10.25 | ❌ | 0.1.0-alpha | https://icanteen.spst.cz
|
||||
| SPŠEI Ostrava | iCanteen 2.17.03 | ❌ [zde](https://git.mnau.xyz/hernik/canteenlib/issues/2) | 1.0.1 | https://obedy.spseiostrava.cz:8443/
|
||||
|
||||
Pokud chcete přispět s testem, otestujte tuto knihovnu na instanci iCanteen, kde, nejlépe legálně, máte přístup, a nahlašte své poznatky [zde](https://github.com/hernikplays/canteenlib/issues/new?assignees=hernikplays&labels=kompatibilita&template=hl--en--kompatibility.md&title=Kompatibilita%3A+)
|
||||
Pokud chcete přispět s testem, otestujte tuto knihovnu na instanci iCanteen, kde, nejlépe legálně, máte přístup, a nahlašte své poznatky [zde](https://git.mnau.xyz/hernik/canteenlib/issues/new?template=.github%2fISSUE_TEMPLATE%2fhl--en--kompatibility.md)
|
||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2022 Matyáš Caras and contributors
|
||||
Copyright (c) 2022 Matyáš Caras
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
34
README.md
34
README.md
|
@ -1,3 +1,6 @@
|
|||
## INFO
|
||||
__Tato verze knihovny není dále vyvíjena. Vývoj teď probíhá na https://github.com/tpkowastaken/canteenlib__
|
||||
|
||||
## O knihovně
|
||||
Experimentální **neoficiální** webscrape knihovna pro komunikaci se systémem [iCanteen](https://www.z-ware.cz/internetove-objednavky). **Knihovna je aktuálně nestabilní! Používejte na vlastní riziko!**
|
||||
|
||||
|
@ -12,7 +15,34 @@ Experimentální **neoficiální** webscrape knihovna pro komunikaci se systéme
|
|||
## To do
|
||||
- Kompatibilita se staršími verzemi iCanteen
|
||||
|
||||
*\* Knihovna nemusí fungovat na všech instancích systému iCanteen, proto žádám každého, kdo může a je uživatelem iCanteen, aby otestoval funkčnost této knihovny a případné problémy [nahlásil](https://github.com/hernikplays/canteenlib/issues)*
|
||||
Příklad používání [zde](https://git.mnau.xyz/hernik/canteenlib/src/branch/main/example/canteenlib_example.dart)
|
||||
|
||||
*\* Knihovna nemusí fungovat na všech instancích systému iCanteen, proto žádám každého, kdo může a je uživatelem iCanteen, aby otestoval funkčnost této knihovny a případné problémy [nahlásil](https://git.mnau.xyz/hernik/canteenlib/issues/new)*
|
||||
|
||||
### Otestované instance iCanteen
|
||||
[zde](https://github.com/hernikplays/canteenlib/blob/main/COMPATIBILITY.md)
|
||||
[zde](https://git.mnau.xyz/hernik/canteenlib/src/branch/main/COMPATIBILITY.md)
|
||||
|
||||
## Licence
|
||||
```
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 Matyáš Caras
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
```
|
|
@ -1,20 +1,15 @@
|
|||
import 'package:canteenlib/canteenlib.dart';
|
||||
|
||||
void main(List<String> args) {
|
||||
Canteen c = Canteen("https://kantyna.neco.cz");
|
||||
c.login("uzivatel", "heslo").then((value) {
|
||||
c.jidelnicekDen(den: DateTime.parse("2022-04-04")).then((t) async {
|
||||
print((await c.ziskejUzivatele()).kredit);
|
||||
c.objednat(t.jidla[0]).then(
|
||||
(value) {
|
||||
t.jidla[0] = value; // divně udělané ale nic lepšího teď nevymyslím
|
||||
print(t.jidla[0].objednano);
|
||||
print(t.jidla[0].orderUrl);
|
||||
},
|
||||
);
|
||||
});
|
||||
}).catchError((o) {
|
||||
print(o);
|
||||
return null;
|
||||
});
|
||||
void main(List<String> args) async {
|
||||
Canteen c = Canteen(
|
||||
"https://kantyna.neco.cz"); // vytvořit instanci kantýny, všechna komunikace probíhá skrz ni
|
||||
try {
|
||||
await c.login("uzivatel", "heslo"); // přihlásit se
|
||||
var jidelnicek = await c.jidelnicekDen(den: DateTime.parse("2022-04-04"));
|
||||
print((await c.ziskejUzivatele()).kredit);
|
||||
var objednano = await c.objednat(jidelnicek.jidla[0]);
|
||||
print(objednano.objednano);
|
||||
} catch (e) {
|
||||
print("Při získávání informací nastala chyba: $e");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
import 'tridy.dart';
|
||||
|
@ -50,17 +48,20 @@ class Canteen {
|
|||
prihlasen = false;
|
||||
return Future.error("Uživatel není přihlášen");
|
||||
}
|
||||
var m = double.tryParse(RegExp(r' +<span id="Kredit" .+?>(.+?)(?=&)')
|
||||
.firstMatch(r)!
|
||||
.group(1)!
|
||||
.replaceAll(",", ".")
|
||||
.replaceAll(RegExp(r"[^\w.]"), ""));
|
||||
var kreditMatch = double.tryParse(
|
||||
RegExp(r' +<span id="Kredit" .+?>(.+?)(?=&)')
|
||||
.firstMatch(r)!
|
||||
.group(1)!
|
||||
.replaceAll(",", ".")
|
||||
.replaceAll(RegExp(r"[^\w.-]"), ""));
|
||||
var jmenoMatch = RegExp(r'(?<=jméno: <b>).+?(?=<\/b)').firstMatch(r);
|
||||
var prijmeniMatch = RegExp(r'(?<=příjmení: <b>).+?(?=<\/b)').firstMatch(r);
|
||||
var kategorieMatch =
|
||||
RegExp(r'(?<=kategorie: <b>).+?(?=<\/b)').firstMatch(r);
|
||||
var ucetMatch = RegExp(r'(?<=účet pro platby do jídelny: <b>).+?(?=<\/b)')
|
||||
.firstMatch(r);
|
||||
var ucetMatch = RegExp(r'účet pro platby do jídelny:\s*<b>(\d+/\d+)</b>')
|
||||
.firstMatch(r)
|
||||
?.group(1)
|
||||
?.replaceAll(RegExp(r'<\/?b>'), ''); //odstranit html tag <b>
|
||||
var varMatch =
|
||||
RegExp(r'(?<=variabilní symbol: <b>).+?(?=<\/b)').firstMatch(r);
|
||||
var specMatch =
|
||||
|
@ -69,9 +70,10 @@ class Canteen {
|
|||
var jmeno = jmenoMatch?.group(0) ?? "";
|
||||
var prijmeni = prijmeniMatch?.group(0) ?? "";
|
||||
var kategorie = kategorieMatch?.group(0) ?? "";
|
||||
var ucet = ucetMatch?.group(0) ?? "";
|
||||
var ucet = ucetMatch ?? "";
|
||||
var varSymbol = varMatch?.group(0) ?? "";
|
||||
var specSymbol = specMatch?.group(0) ?? "";
|
||||
var kredit = kreditMatch ?? 0.0;
|
||||
|
||||
return Uzivatel(
|
||||
jmeno: jmeno,
|
||||
|
@ -80,7 +82,7 @@ class Canteen {
|
|||
ucetProPlatby: ucet,
|
||||
varSymbol: varSymbol,
|
||||
specSymbol: specSymbol,
|
||||
kredit: m ?? 0.0);
|
||||
kredit: kredit);
|
||||
}
|
||||
|
||||
Future<void> _getFirstSession() async {
|
||||
|
@ -118,13 +120,9 @@ class Canteen {
|
|||
}
|
||||
|
||||
var res =
|
||||
await http.post(Uri.parse(url + "/j_spring_security_check"), headers: {
|
||||
"Cookie": "JSESSIONID=" +
|
||||
cookies["JSESSIONID"]! +
|
||||
"; " +
|
||||
"XSRF-TOKEN=" +
|
||||
cookies["XSRF-TOKEN"]! +
|
||||
";",
|
||||
await http.post(Uri.parse("$url/j_spring_security_check"), headers: {
|
||||
"Cookie":
|
||||
"JSESSIONID=${cookies["JSESSIONID"]!}; XSRF-TOKEN=${cookies["XSRF-TOKEN"]!};",
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
}, body: {
|
||||
"j_username": user,
|
||||
|
@ -152,14 +150,8 @@ class Canteen {
|
|||
/// Builder pro GET request
|
||||
Future<String> _getRequest(String path) async {
|
||||
var r = await http.get(Uri.parse(url + path), headers: {
|
||||
"Cookie": "JSESSIONID=" +
|
||||
cookies["JSESSIONID"]! +
|
||||
"; " +
|
||||
"XSRF-TOKEN=" +
|
||||
cookies["XSRF-TOKEN"]! +
|
||||
(cookies.containsKey("remember-me")
|
||||
? "; " + cookies["remember-me"]! + ";"
|
||||
: ";"),
|
||||
"Cookie":
|
||||
"JSESSIONID=${cookies["JSESSIONID"]!}; XSRF-TOKEN=${cookies["XSRF-TOKEN"]!}${cookies.containsKey("remember-me") ? "; ${cookies["remember-me"]!};" : ";"}",
|
||||
});
|
||||
|
||||
if (r.statusCode != 200 ||
|
||||
|
@ -271,7 +263,7 @@ class Canteen {
|
|||
String res;
|
||||
try {
|
||||
res = await _getRequest(
|
||||
"/faces/secured/main.jsp?day=${den.year}-${(den.month < 10) ? "0" + den.month.toString() : den.month}-${(den.day < 10) ? "0" + den.day.toString() : den.day}&terminal=false&printer=false&keyboard=false");
|
||||
"/faces/secured/main.jsp?day=${den.year}-${(den.month < 10) ? "0${den.month}" : den.month}-${(den.day < 10) ? "0${den.day}" : den.day}&terminal=false&printer=false&keyboard=false");
|
||||
} catch (e) {
|
||||
return Future.error(e);
|
||||
}
|
||||
|
@ -281,10 +273,11 @@ class Canteen {
|
|||
.group(0)
|
||||
.toString());
|
||||
var jidla = <Jidlo>[];
|
||||
var jidelnicek =
|
||||
RegExp(r'(?<=<div class="jidWrapLeft">).+?((fa-clock))', dotAll: true)
|
||||
.allMatches(res)
|
||||
.toList();
|
||||
var jidelnicek = RegExp(
|
||||
r'(?<=<div class="jidWrapLeft">).+?((fa-clock)|(fa-ban))',
|
||||
dotAll: true)
|
||||
.allMatches(res)
|
||||
.toList();
|
||||
for (var obed in jidelnicek) {
|
||||
// formátování do třídy
|
||||
var o = obed
|
||||
|
@ -297,7 +290,7 @@ class Canteen {
|
|||
o.contains("nelze změnit"));
|
||||
|
||||
var cenaMatch =
|
||||
RegExp(r'(?<=Cena objednaného jídla">).+?(?=&)').firstMatch(o);
|
||||
RegExp(r'((?<=Cena objednaného jídla">).+?(?=&))').firstMatch(o);
|
||||
cenaMatch ??=
|
||||
RegExp(r'(?<=Cena při objednání jídla: ).+?(?=&)').firstMatch(o);
|
||||
cenaMatch ??=
|
||||
|
@ -311,7 +304,23 @@ class Canteen {
|
|||
.group(1)
|
||||
.toString()
|
||||
.replaceAll(' ,', ",")
|
||||
.replaceAll(" <br>", "");
|
||||
.replaceAll(" <br>", "")
|
||||
.replaceAll("\n", "");
|
||||
var alergenyList =
|
||||
RegExp(r"""<span(?: |\n).+?title="(.+?)".+?>(\d{1,2})""")
|
||||
.allMatches(jidlaProDen)
|
||||
.toList();
|
||||
|
||||
var alergeny = alergenyList.map<Alergen>((e) {
|
||||
var jmeno = RegExp(r'<b>(.+?)<\/b>')
|
||||
.firstMatch(e.group(1).toString())!
|
||||
.group(1);
|
||||
var popis =
|
||||
RegExp(r'<\/b> - (.+)').firstMatch(e.group(1).toString())?.group(1);
|
||||
var kod = int.parse(e.group(2).toString());
|
||||
return Alergen(nazev: jmeno!, kod: kod, popis: popis);
|
||||
}).toList();
|
||||
|
||||
var vydejna = RegExp(
|
||||
r'(?<=<span class="smallBoldTitle button-link-align">).+?(?=<)')
|
||||
.firstMatch(o)!
|
||||
|
@ -329,25 +338,31 @@ class Canteen {
|
|||
} else {
|
||||
// jinak nastavíme URL pro burzu
|
||||
var match = RegExp(
|
||||
r"(?<=ajaxOrder\(this, ')(.+?)(?=').+?((do burzy)|(z burzy))")
|
||||
r"""db\/dbProcessOrder\.jsp.+?type=((plusburza)|(minusburza)|(multiburza)).+?(?=')""")
|
||||
.firstMatch(o);
|
||||
if (match != null) {
|
||||
burzaUrl = match.group(1)!.replaceAll("amp;", "");
|
||||
burzaUrl = match.group(0)!.replaceAll("amp;", "");
|
||||
}
|
||||
}
|
||||
|
||||
jidla.add(Jidlo(
|
||||
nazev: jidlaProDen.replaceAll(
|
||||
r' (?=[^a-zA-ZěščřžýáíéĚŠČŘŽÝÁÍÉŤŇťň])', ''),
|
||||
objednano: objednano,
|
||||
varianta: vydejna,
|
||||
lzeObjednat: lzeObjednat,
|
||||
cena: cena,
|
||||
orderUrl: orderUrl,
|
||||
den: obedDen,
|
||||
burzaUrl: burzaUrl,
|
||||
naBurze:
|
||||
(burzaUrl == null) ? false : !burzaUrl.contains("plusburza")));
|
||||
var jidloJmeno = RegExp(r'(.+?)(?=<sub>)')
|
||||
.firstMatch(jidlaProDen)!
|
||||
.group(1)
|
||||
.toString();
|
||||
jidla.add(
|
||||
Jidlo(
|
||||
nazev: jidloJmeno.replaceAll(
|
||||
r' (?=[^a-zA-ZěščřžýáíéĚŠČŘŽÝÁÍÉŤŇťň])', ''),
|
||||
objednano: objednano,
|
||||
varianta: vydejna,
|
||||
lzeObjednat: lzeObjednat,
|
||||
cena: cena,
|
||||
orderUrl: orderUrl,
|
||||
den: obedDen,
|
||||
burzaUrl: burzaUrl,
|
||||
naBurze:
|
||||
(burzaUrl == null) ? false : burzaUrl.contains("minusburza"),
|
||||
alergeny: alergeny),
|
||||
);
|
||||
// KONEC formátování do třídy
|
||||
}
|
||||
|
||||
|
@ -372,7 +387,7 @@ class Canteen {
|
|||
}
|
||||
|
||||
try {
|
||||
await _getRequest("/faces/secured/" + j.orderUrl!); // provést operaci
|
||||
await _getRequest("/faces/secured/${j.orderUrl!}"); // provést operaci
|
||||
} catch (e) {
|
||||
return Future.error(e);
|
||||
}
|
||||
|
@ -394,7 +409,7 @@ class Canteen {
|
|||
///
|
||||
/// Výstup:
|
||||
/// - Aktualizovaná instance [Jidlo] tohoto jídla NEBO [Future] jako chyba
|
||||
Future<Jidlo> doBurzy(Jidlo j) async {
|
||||
Future<Jidlo> doBurzy(Jidlo j, {int amount = 1}) async {
|
||||
if (!prihlasen) {
|
||||
return Future.error("Uživatel není přihlášen");
|
||||
}
|
||||
|
@ -404,8 +419,13 @@ class Canteen {
|
|||
"Jídlo nelze uložit do burzy nebo nemá adresu pro uložení");
|
||||
}
|
||||
|
||||
if (amount < 1 && j.burzaUrl!.endsWith("amount=")) {
|
||||
return Future.error("Nemůžeš dát do burzy méně než jeden kus");
|
||||
}
|
||||
var finalUrl =
|
||||
(j.burzaUrl!.endsWith("amount=")) ? "${j.burzaUrl}$amount" : j.burzaUrl;
|
||||
try {
|
||||
await _getRequest("/faces/secured/" + j.burzaUrl!); // provést operaci
|
||||
await _getRequest("/faces/secured/$finalUrl"); // provést operaci
|
||||
} catch (e) {
|
||||
return Future.error(e);
|
||||
}
|
||||
|
@ -487,7 +507,7 @@ class Canteen {
|
|||
Future<bool> objednatZBurzy(Burza b) async {
|
||||
if (!prihlasen) return Future.error("Uživatel není přihlášen");
|
||||
try {
|
||||
await _getRequest("/faces/secured/" + b.url!);
|
||||
await _getRequest("/faces/secured/${b.url!}");
|
||||
} catch (e) {
|
||||
return Future.error(e.toString());
|
||||
}
|
||||
|
|
|
@ -21,6 +21,11 @@ class Jidlo {
|
|||
/// Den, který je jídlo vydáváno
|
||||
DateTime den;
|
||||
|
||||
/// Seznam alergenů
|
||||
///
|
||||
/// Pokud se žádný nepodařilo najít, vrací prázdný seznam
|
||||
List<Alergen> alergeny;
|
||||
|
||||
/// URL pro požadavek na objednání jídla
|
||||
final String? orderUrl;
|
||||
|
||||
|
@ -31,6 +36,7 @@ class Jidlo {
|
|||
required this.objednano,
|
||||
required this.varianta,
|
||||
required this.den,
|
||||
this.alergeny = const [],
|
||||
this.cena,
|
||||
required this.lzeObjednat,
|
||||
this.orderUrl,
|
||||
|
@ -38,6 +44,15 @@ class Jidlo {
|
|||
required this.naBurze});
|
||||
}
|
||||
|
||||
/// Popisuje alergen v jídelníčku
|
||||
class Alergen {
|
||||
final int kod;
|
||||
final String nazev;
|
||||
final String? popis;
|
||||
|
||||
const Alergen({required this.nazev, required this.kod, this.popis});
|
||||
}
|
||||
|
||||
/// Reprezentuje cizí jídlo na burze
|
||||
class Burza {
|
||||
/// Den, který je jídlo vydáváno
|
||||
|
|
3712
package-lock.json
generated
3712
package-lock.json
generated
File diff suppressed because it is too large
Load diff
10
package.json
10
package.json
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"devDependencies": {
|
||||
"cz-conventional-changelog": "^3.3.0"
|
||||
},
|
||||
"config": {
|
||||
"commitizen": {
|
||||
"path": "./node_modules/cz-conventional-changelog"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,12 +1,11 @@
|
|||
name: canteenlib
|
||||
description: Library for communication with the czech canteen food ordering system iCanteen
|
||||
version: 1.0.1
|
||||
repository: 'https://github.com/hernikplays/canteenlib'
|
||||
issue_tracker: 'https://github.com/hernikplays/canteenlib/issues'
|
||||
documentation: 'https://docs.hernikplays.cz'
|
||||
version: 2.0.0
|
||||
repository: 'https://git.mnau.xyz/hernik/canteenlib'
|
||||
issue_tracker: 'https://git.mnau.xyz/hernik/canteenlib/issues'
|
||||
|
||||
environment:
|
||||
sdk: '>=2.16.1 <3.0.0'
|
||||
sdk: '>=2.16.1 <4.0.0'
|
||||
|
||||
dev_dependencies:
|
||||
dotenv: ^4.0.1
|
||||
|
|
Reference in a new issue