new_api.go 585 B

123456789101112131415161718192021
  1. package routers
  2. import (
  3. "tmr-watch/http/handle/api"
  4. "github.com/gin-gonic/gin"
  5. )
  6. func NewAPI(opts ...func(engine *gin.Engine)) func(s *gin.Engine) {
  7. return func(s *gin.Engine) {
  8. for _, opt := range opts {
  9. opt(s)
  10. }
  11. newApiGroup := s.Group("/new_api")
  12. newApiGroup.POST("feet_template/list", api.SearchFeetTemplateList)
  13. newApiGroup.POST("feet_template/version", api.GetFeetTemplateVersion)
  14. newApiGroup.POST("feet_template/upgrade", api.FeetTemplateUpgradeNewVersion)
  15. newApiGroup.POST("tmr/gear", api.UpdateTmrGear)
  16. newApiGroup.POST("user/gear", api.UseGear)
  17. }
  18. }