package routers import ( "github.com/gin-gonic/gin" "hongze/hongze_yb/controller/community" "hongze/hongze_yb/middleware" ) func InitCommunity(r *gin.Engine) { rGroup := r.Group("api/community").Use(middleware.Token(), middleware.CheckBaseAuth()) // 问答社区 rGroup.GET("/question/list", community.QuestionList) rGroup.GET("/question/detail", community.QuestionDetail) rGroup.POST("/question/ask", community.QuestionAsk) rGroup.POST("/question/reply", community.QuestionReply) rGroup.POST("/question/reply/read", community.QuestionReplyRead) rGroup.GET("/question/list/total", community.QuestionListTotal) rGroup.POST("/question/reply/upload_audio", community.QuestionUploadAudio) rGroup.GET("/question/unread", community.QuestionUnread) rGroup.GET("/question/research_group", community.ResearchGroupList) rGroup.POST("/question/audio/log", community.AddAudioLog) rGroup.POST("/question/transfer", community.QuestionTransfer) rGroup.POST("/question/stop", community.QuestionStop) // 视频社区 noAuthGroup := r.Group("api/community").Use(middleware.Token()) rGroup.GET("/video/list", community.VideoList) noAuthGroup.POST("/video/play_log", community.VideoPlayLog) //点赞、吐槽、评论 rGroup.POST("/set_like_or_tease", community.SetLikeOrTease) rGroup.POST("/comment", community.Comment) rGroup.POST("/comment/delete", community.DeleteComment) rGroup.GET("/need_anonymous_user_tips", community.GetNeedCommentAnonymousUserTips) rGroup.POST("/set_anonymous_user_tips", community.SetCommentAnonymousUserTips) rGroup.GET("/comment/hot", community.HotList) rGroup.GET("/comment/my", community.MyList) }