✨ init project
This commit is contained in:
28
router/category/category.go
Normal file
28
router/category/category.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package category
|
||||
|
||||
import (
|
||||
"git.echol.cn/loser/lckt/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type CategoryRouter struct{}
|
||||
|
||||
// InitCategoryRouter 初始化 类别 路由信息
|
||||
func (s *CategoryRouter) InitCategoryRouter(Router *gin.RouterGroup, PublicRouter *gin.RouterGroup) {
|
||||
catRouter := Router.Group("cat").Use(middleware.OperationRecord())
|
||||
catRouterWithoutRecord := Router.Group("cat")
|
||||
catRouterWithoutAuth := PublicRouter.Group("cat")
|
||||
{
|
||||
catRouter.POST("createCategory", catApi.CreateCategory) // 新建类别
|
||||
catRouter.DELETE("deleteCategory", catApi.DeleteCategory) // 删除类别
|
||||
catRouter.DELETE("deleteCategoryByIds", catApi.DeleteCategoryByIds) // 批量删除类别
|
||||
catRouter.PUT("updateCategory", catApi.UpdateCategory) // 更新类别
|
||||
}
|
||||
{
|
||||
catRouterWithoutRecord.GET("findCategory", catApi.FindCategory) // 根据ID获取类别
|
||||
catRouterWithoutRecord.GET("getCategoryList", catApi.GetCategoryList) // 获取类别列表
|
||||
}
|
||||
{
|
||||
catRouterWithoutAuth.GET("getCategoryPublic", catApi.GetCategoryPublic) // 类别开放接口
|
||||
}
|
||||
}
|
||||
7
router/category/enter.go
Normal file
7
router/category/enter.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package category
|
||||
|
||||
import api "git.echol.cn/loser/lckt/api/v1"
|
||||
|
||||
type RouterGroup struct{ CategoryRouter }
|
||||
|
||||
var catApi = api.ApiGroupApp.CategoryApiGroup.CategoryApi
|
||||
Reference in New Issue
Block a user