JM-WechatMini/router/system/article.go

29 lines
812 B
Go
Raw Permalink Normal View History

2023-11-02 04:34:46 +08:00
package system
import (
"github.com/gin-gonic/gin"
v1 "miniapp/api/v1"
"miniapp/middleware"
)
type ArticleRouter struct {
}
// InitArticleRouter 注册Banner路由
func (s *BannerRouter) InitArticleRouter(Router *gin.RouterGroup) {
articleRouter := Router.Group("article").Use(middleware.OperationRecord()).Use(middleware.JWTAuth())
publicRouter := Router.Group("article")
bannerApi := v1.ApiGroupApp.SystemApiGroup.ArticleApi
{
articleRouter.POST("", bannerApi.CreateArticle) // 新建文章
articleRouter.DELETE("", bannerApi.DeleteArticle) // 删除文章
articleRouter.PUT("", bannerApi.UpdateArticle) // 更新文章
}
{
publicRouter.GET("list", bannerApi.GetArticleList) // 获取医院列表
publicRouter.GET(":id", bannerApi.GetArticleById) // 获取单条医院消息
}
}