代码拉取完成,页面将自动刷新
package web_server
import (
"gitee.com/cheneylau/components/com"
"gitee.com/cheneylau/components/web-server/controller"
"gitee.com/cheneylau/components/web-server/controller/user"
"github.com/gin-gonic/gin"
"net/http"
"os"
"path"
)
func ConfigRoute(r *gin.Engine) {
r.Use(gin.Logger())
r.Use(com.Cors())
r.Use(gin.Recovery())
r.StaticFS("/static", http.Dir(path.Dir(os.Args[0])+"/static"))
r.LoadHTMLGlob(path.Dir(os.Args[0])+"/static/templates/**/*")
r.GET("/", func(context *gin.Context) {
context.Redirect(302, "/static/hospital")
})
authorized := r.Group("/hospital")
authorized.POST("/list", controller.HospitalList)
authorized.POST("/add", controller.HospitalAdd)
authorized.POST("/delete", controller.HospitalDelete)
apiGroup := r.Group("api")
v1 := apiGroup.Group("v1")
userGroup := v1.Group("users")
userGroup.GET("/", user.User)
userGroup.POST("/", user.User)
userGroup.Any(":id", user.User)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。