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

Merged
merged 3 commits into from
Oct 13, 2024

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>

@seionmoya seionmoya merged commit 6a4545d into project-fika:dev Oct 13, 2024
1 check passed
@nexus4880 nexus4880 deleted the rework-http-controllers branch October 14, 2024 02:59
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: Done
Development

Successfully merging this pull request may close these issues.

2 participants