-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync districts #16
base: master
Are you sure you want to change the base?
Sync districts #16
Conversation
…erving MainViewModel which get's districts via coroutines
|
||
interface WegliEndpoints { | ||
|
||
@GET("/districts.json") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to use the Accept: application/json
HTTP Header instead of the .json
format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what that means. Care to elaborate?
private val client = OkHttpClient.Builder().build() | ||
|
||
private val retrofit = Retrofit.Builder() | ||
.baseUrl("https://www.weg-li.de/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would make sense to put this in some kind of configuration that can be overwritten for development purposes in order to test changes on the API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, but I would only do this, if we actually use this for tests later. I'm a fan of YAGNI
val zip: String, | ||
val name: String, | ||
val email: String, | ||
val prefix: String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of prefix i would add the aliases
array, otherwise it's basically not possible to use the app in Munich.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is aliases? Looking at the json most at the beginning are either [] or null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just found an entry: [email protected]","[email protected]
Looks to me like the alternative email addresses? I'll add that.
If we have no use for the prefix, I can remove it. I only picked data, that seemed interesting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Munich does not have a central e-mail address to handle charges. People have to know which police station they have to e-mail it to. At least, we can give a little guidance based on ZIPs.
No description provided.