Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Softa
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Meißner
Softa
Commits
7653d038
Commit
7653d038
authored
1 year ago
by
Florian Meissner
Browse files
Options
Downloads
Patches
Plain Diff
finished printMeals
parent
11f797d0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/ohm/softa/a11/App.java
+16
-0
16 additions, 0 deletions
src/main/java/ohm/softa/a11/App.java
with
16 additions
and
0 deletions
src/main/java/ohm/softa/a11/App.java
+
16
−
0
View file @
7653d038
...
...
@@ -4,6 +4,7 @@ import ohm.softa.a11.openmensa.OpenMensaAPI;
import
ohm.softa.a11.openmensa.OpenMensaAPIService
;
import
ohm.softa.a11.openmensa.model.Canteen
;
import
ohm.softa.a11.openmensa.model.PageInfo
;
import
retrofit2.HttpException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
...
...
@@ -109,6 +110,21 @@ public class App {
/* TODO fetch all meals for the currently selected canteen
* to avoid errors retrieve at first the state of the canteen and check if the canteen is opened at the selected day
* don't forget to check if a canteen was selected previously! */
if
(
currentCanteenId
==
-
1
)
{
System
.
out
.
println
(
"Error: no canteen selected"
);
return
;
}
openMensaAPI
.
getMeals
(
currentCanteenId
,
dateFormat
.
format
(
currentDate
.
getTime
()))
.
exceptionally
((
e
)
->
{
System
.
out
.
println
(
e
.
getMessage
());
if
(
e
instanceof
HttpException
)
System
.
out
.
println
(((
HttpException
)
e
).
response
());
return
List
.
of
();
})
.
thenAccept
(
meals
->
meals
.
forEach
(
System
.
out
::
println
))
.
join
();
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment