content.go 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. package autocode
  2. import (
  3. "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
  4. "github.com/flipped-aurora/gin-vue-admin/server/middleware"
  5. "github.com/gin-gonic/gin"
  6. )
  7. type ContentRouter struct {
  8. }
  9. // InitContentRouter 初始化 Content 路由信息
  10. func (s *ContentRouter) InitContentRouter(Router *gin.RouterGroup) {
  11. contentRouter := Router.Group("content").Use(middleware.OperationRecord())
  12. var contentApi = v1.ApiGroupApp.AutoCodeApiGroup.ContentApi
  13. {
  14. contentRouter.POST("createContent", contentApi.CreateContent) // 新建Content
  15. contentRouter.DELETE("deleteContent", contentApi.DeleteContent) // 删除Content
  16. contentRouter.DELETE("deleteContentByIds", contentApi.DeleteContentByIds) // 批量删除Content
  17. contentRouter.PUT("updateContent", contentApi.UpdateContent) // 更新Content
  18. contentRouter.GET("getContentList", contentApi.GetContentList) // 获取Content列表
  19. }
  20. }
  21. func (s *ContentRouter) InitContentPRouter(Router *gin.RouterGroup) {
  22. contentRouter := Router.Group("content").Use(middleware.OperationRecord())
  23. var contentApi = v1.ApiGroupApp.AutoCodeApiGroup.ContentApi
  24. {
  25. contentRouter.GET("findContent", contentApi.FindContent) // 根据ID获取Content
  26. }
  27. }