feat(*): go 后端项目脚手架
This commit is contained in:
20
internal/api/handler/cateage.go
Normal file
20
internal/api/handler/cateage.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/zhilv666/navsite/internal/service"
|
||||
"github.com/zhilv666/navsite/pkg/common"
|
||||
)
|
||||
|
||||
func GetAllCateageWithSites(c *gin.Context) {
|
||||
cateagies, err := service.GetAllCateageWithSites()
|
||||
if err != nil {
|
||||
common.Fail(c, err.Error())
|
||||
return
|
||||
}
|
||||
common.Succ(c, cateagies)
|
||||
}
|
||||
|
||||
func RegisterRouterCateage(g *gin.RouterGroup) {
|
||||
g.GET("/", GetAllCateageWithSites)
|
||||
}
|
||||
Reference in New Issue
Block a user