2025-10-31 06:42:43 +00:00
|
|
|
// Code generated by hertz generator.
|
|
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
2025-10-31 09:23:44 +00:00
|
|
|
"github.com/cloudwego/hertz/pkg/app"
|
2025-10-31 06:42:43 +00:00
|
|
|
"github.com/cloudwego/hertz/pkg/app/server"
|
2025-10-31 09:23:44 +00:00
|
|
|
"weather_and_earthquake/biz/handler/weather_and_earthquake"
|
|
|
|
|
"weather_and_earthquake/internal/middleware"
|
2025-10-31 06:42:43 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// customizeRegister registers customize routers.
|
|
|
|
|
func customizedRegister(r *server.Hertz) {
|
2025-10-31 09:23:44 +00:00
|
|
|
//r.GET("/ping", handler.Ping)
|
2025-10-31 06:42:43 +00:00
|
|
|
|
|
|
|
|
// your code ...
|
2025-11-03 11:12:39 +00:00
|
|
|
//r.Use(keyauth.New(
|
|
|
|
|
// keyauth.WithFilter(func(ctx context.Context, c *app.RequestContext) bool {
|
|
|
|
|
// return true
|
|
|
|
|
// }),
|
|
|
|
|
//))
|
|
|
|
|
|
2025-10-31 09:23:44 +00:00
|
|
|
routes := make([]app.HandlerFunc, 0)
|
|
|
|
|
routes = append(routes, middleware.AuthMiddleware())
|
|
|
|
|
routes = append(routes, middleware.CorsMiddleware())
|
|
|
|
|
routes = append(routes, weather_and_earthquake.QueryMethod)
|
|
|
|
|
r.NoRoute(routes...)
|
2025-10-31 06:42:43 +00:00
|
|
|
}
|