health-go/routers/router.go

25 lines
566 B
Go
Raw Normal View History

2024-10-17 23:52:10 +08:00
package routers
import (
"github.com/gin-gonic/gin"
"health-go/handlers"
)
func SetupRouter() *gin.Engine {
r := gin.Default()
// user
r.GET("/", handlers.TestPage)
r.GET("/firstUser", handlers.FirstUser)
// record
r.GET("/fetchHosList", handlers.FetchHospitalList)
r.GET("/fetchAllRec", handlers.FetchAllRecords)
// hospital
r.POST("/api/addHos", handlers.AddHospital) // add hospital
r.POST("/api/modifyHos", handlers.ModifyHospital) // modify hospital
r.DELETE("/api/deleteHos", handlers.DeleteHospital) // delete hospital
2024-10-17 23:52:10 +08:00
return r
}