community.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. rGroup.POST("/question/transfer", community.QuestionTransfer)
  21. rGroup.POST("/question/stop", community.QuestionStop)
  22. // 视频社区
  23. noAuthGroup := r.Group("api/community").Use(middleware.Token())
  24. rGroup.GET("/video/list", community.VideoList)
  25. noAuthGroup.POST("/video/play_log", community.VideoPlayLog)
  26. //点赞、吐槽、评论
  27. rGroup.POST("/set_like_or_tease", community.SetLikeOrTease)
  28. rGroup.POST("/comment", community.Comment)
  29. rGroup.POST("/comment/delete", community.DeleteComment)
  30. rGroup.GET("/need_anonymous_user_tips", community.GetNeedCommentAnonymousUserTips)
  31. rGroup.POST("/set_anonymous_user_tips", community.SetCommentAnonymousUserTips)
  32. rGroup.GET("/comment/hot", community.HotList)
  33. rGroup.GET("/comment/my", community.MyList)
  34. }