Skip to content
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

jaxtell - added get payment by user id functionality #28

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jaxtell
Copy link

@jaxtell jaxtell commented May 18, 2022

No description provided.


import javax.servlet.http.HttpServletResponse;

@RequestMapping(value = "/payment")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any comment on how the endpoint should look if you were to design it without pattern following?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends on how it would be used. If user id is always going to be present it might make sense to be /user/{userId}/payment. If there are future requests that allow searching across users then I'd leave it top level. Instead of using words in the URL I'd favor http verbs to indicate action, e.g. GET on /payment/user/{userId} to get all payments for a user and/or GET on /payment with parameters to get payment(s) based on query parameters, PUT on /payment to add a payment, PATCH on /payment to update a payment, POSTs on /payment/[ACTION] for more complex operations. I'd want to balance keeping the URL short while still being descriptive of what it does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants