package main

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"log"
)

func main() {
	engine := gin.Default()
	engine.GET("/hello", func(context *gin.Context) {
		fmt.Println("请求路径: ", context.FullPath())
		var student Student
		err := context.ShouldBindQuery(&student)
		if err != nil {
			log.Fatalln(err.Error())
			return
		}
		fmt.Println(student.Name)
		fmt.Println(student.Classes)
		context.Writer.Write([]byte("hello," + student.Name + student.Classes))

	})
	engine.Run()

}

type Student struct {
	Name    string `form:"name" `
	Classes string ` form:"classes" `
}
