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

Rework HttpControllers #68

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

nexus4880
Copy link
Contributor

I added the class BodyAwareHttpController<TRequest> which works just as the ItemEventController<TEvent> does just as @seionmoya and I discussed.

Instead of inheriting from HttpController for your route and getting the body from the context within RunAsync you can instead inherit from BodyAwareHttpController and use the generic to put your expected body type.

I have converted all existing usages of context.GetJsonAsync<T> to instead use BodyAwareHttpController<T>.

@seionmoya seionmoya self-requested a review October 8, 2024 09:38
@seionmoya seionmoya added enhancement New feature or request backend Related to Fuyu.Backend libs Related to Fuyu.Common, Zlib.Managed labels Oct 8, 2024
Copy link
Collaborator

@seionmoya seionmoya left a comment

Choose a reason for hiding this comment

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

I like the work but not the type name.
I think HttpDataController would work better for me.
@TheSpartaPT @Lacyway suggestions?

@seionmoya
Copy link
Collaborator

Resolved by changing BodyAwareHttpController<TBody> to HttpController<TBody>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to Fuyu.Backend enhancement New feature or request libs Related to Fuyu.Common, Zlib.Managed
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants