-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add Society API #10
Add Society API #10
Conversation
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.
LGTM, would be better to have standard api response
} | ||
|
||
@GetMapping | ||
public List<Society> list(){ |
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.
Is there a standardized format for data return, such as ResultDTO?
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 thought of that, but decided to not since current API design so far isn't using it either.
In retrospect, it is much more standard to check the response code than the "ok" field.
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 much more sense to have consistent data return across all end point.
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.
Looks great!
Summary
Added a Society API and convenience configurations.
Changes
Created required CRUD apis for Society.
Added the
modelmapper
dependency. This allows us to use DTOs so that we can define what fields are taken as input (and not just the whole entity.Updated society field
isActive
toactive
. This is because the getter can beisActive
, and still make sense.Update the society entity to have createdAt and updatedAt. These values will be automatically set by Hibernate, as required.
Added an
ItemNotFoundException
. When this error is thrown, this will automatically map to a404
response.