activity.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package routers
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "hongze/hongze_yb/controller/activity"
  5. "hongze/hongze_yb/middleware"
  6. )
  7. func InitActivity(r *gin.Engine) {
  8. // 需要Token
  9. rGroup := r.Group("activity").Use(middleware.Token())
  10. {
  11. rGroup.GET("/getPageList", activity.GetPageList)
  12. rGroup.GET("/getActivityDetail", activity.GetActivityDetail)
  13. rGroup.GET("/getActivityVoices", activity.GetActivityVoices)
  14. rGroup.POST("/addRemind", activity.AddRemind)
  15. rGroup.POST("/cancelRemind", activity.CancelRemind)
  16. rGroup.POST("/registerActivity", activity.RegisterActivity)
  17. rGroup.POST("/cancelRegister", activity.CancelRegister)
  18. rGroup.POST("/voice_log/add", activity.AddActivityAudioLog)
  19. rGroup.POST("/voice_log/update", activity.UpdateActivityAudioLog)
  20. }
  21. // 不需要Token
  22. rGroup2 := r.Group("activity")
  23. {
  24. rGroup2.GET("/getActivityShareImg", activity.GetActivityShareImg)
  25. }
  26. initActivity(r)
  27. }
  28. func initActivity(r *gin.Engine) {
  29. // 需要Token
  30. rGroup := r.Group("api/activity").Use(middleware.Token())
  31. {
  32. rGroup.GET("/getPageList", activity.GetPageList)
  33. rGroup.GET("/getActivityDetail", activity.GetActivityDetail)
  34. rGroup.GET("/getActivityVoices", activity.GetActivityVoices)
  35. rGroup.POST("/addRemind", activity.AddRemind)
  36. rGroup.POST("/cancelRemind", activity.CancelRemind)
  37. rGroup.POST("/registerActivity", activity.RegisterActivity)
  38. rGroup.POST("/cancelRegister", activity.CancelRegister)
  39. rGroup.POST("/voice_log/add", activity.AddActivityAudioLog)
  40. rGroup.POST("/voice_log/update", activity.UpdateActivityAudioLog)
  41. }
  42. // 不需要Token
  43. rGroup2 := r.Group("api/activity")
  44. {
  45. rGroup2.GET("/getActivityShareImg", activity.GetActivityShareImg)
  46. }
  47. }