yintai2/app/routers/api_router.go

36 lines
822 B
Go

package routers
import (
"yintai-api/app/api/controller"
middleware2 "yintai-api/app/common/middleware"
"github.com/gin-gonic/gin"
)
// 客户端接口路由
func initApiRouter(engine *gin.Engine) {
apiGroup := engine.Group("/yt/api")
apiGroup.Use(middleware2.Recovery)
category := new(controller.Category)
apiGroup.GET("/category", category.List)
process := new(controller.Process)
apiGroup.GET("/process", process.List)
document := new(controller.Document)
apiGroup.GET("/doc", document.List)
page := new(controller.Page)
apiGroup.GET("/page", page.List)
news := new(controller.News)
apiGroup.GET("/news", news.List)
apiGroup.GET("/news/:id", news.Get)
apiGroup.GET("/news/prenext", news.PreNext)
job := new(controller.Job)
apiGroup.GET("/job", job.List)
apiGroup.GET("/job/:id", job.Get)
}