package main
import (
"context"
"github.com/eatmoreapple/ginx"
"github.com/gin-gonic/gin"
)
type User struct {
Name string `json:"name" form:"name"`
}
func helloworld(_ context.Context, req User) (any, error) {
if req.Name == "" {
req.Name = "hello world"
}
return req, nil
}
func main() {
engine := gin.Default()
router := ginx.NewRouter(engine)
router.GET("/", ginx.G(helloworld).JSON())
engine.Run(":8080")
}
-
Notifications
You must be signed in to change notification settings - Fork 0
eatmoreapple/ginx
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published