community.go 1.1 KB

1234567891011121314151617181920212223242526
  1. package routers
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "hongze/hongze_yb/controller/community"
  5. "hongze/hongze_yb/middleware"
  6. )
  7. func InitCommunity(r *gin.Engine) {
  8. rGroup := r.Group("api/community").Use(middleware.Token(), middleware.CheckBaseAuth())
  9. // 问答社区
  10. rGroup.GET("/question/list", community.QuestionList)
  11. rGroup.GET("/question/detail", community.QuestionDetail)
  12. rGroup.POST("/question/ask", community.QuestionAsk)
  13. rGroup.POST("/question/reply", community.QuestionReply)
  14. rGroup.POST("/question/reply/read", community.QuestionReplyRead)
  15. rGroup.GET("/question/list/total", community.QuestionListTotal)
  16. rGroup.POST("/question/reply/upload_audio", community.QuestionUploadAudio)
  17. rGroup.GET("/question/unread", community.QuestionUnread)
  18. rGroup.GET("/question/research_group", community.ResearchGroupList)
  19. rGroup.POST("/question/audio/log", community.AddAudioLog)
  20. // 视频社区
  21. noAuthGroup := r.Group("api/community").Use(middleware.Token())
  22. noAuthGroup.GET("/video/list", community.VideoList)
  23. noAuthGroup.POST("/video/play_log", community.VideoPlayLog)
  24. }