glogcenter/glc/web/router/register.go
2022-06-27 15:27:49 +08:00

29 lines
736 B
Go

package router
import (
"glc/gweb"
"glc/gweb/method"
"glc/ldb/conf"
"glc/web/controller"
"glc/web/filter"
)
func Register() {
// ContextPath
contextPath := conf.GetContextPath()
// 过滤器
gweb.RegisterFilter(filter.ApiKeyFilter)
// 控制器器(跳转)
gweb.RegisterController(method.GET, "/", controller.RedirectToSearchController)
gweb.RegisterController(method.GET, contextPath, controller.RedirectToSearchController)
gweb.RegisterController(method.GET, contextPath+"/", controller.RedirectToSearchController)
// 控制器
gweb.RegisterController(method.POST, contextPath+"/search", controller.LogSearchController)
gweb.RegisterController(method.POST, contextPath+"/add", controller.LogAddController)
}