group_api.go 1.4 KB

12345678910111213141516171819202122232425262728
  1. package routers
  2. import (
  3. "tmr-watch/http/handle/group"
  4. "github.com/gin-gonic/gin"
  5. )
  6. func GroupAPI(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. s.NoRoute(group.Handle404)
  12. apiPasture := s.Group("/pasture")
  13. apiPasture.POST("feed_formula/distribute", group.DistributeFeedFormula) // 饲料配方下发
  14. apiPasture.POST("feed_formula/is_modify", group.FeedFormulaIsModify) // 饲料配方是否可修改
  15. apiPasture.POST("feed_formula/list", group.FeedFormulaList) // 获取配方列表
  16. apiPasture.POST("dashboard/accuracy_data", group.AnalysisAccuracy) // 准确率分析
  17. apiPasture.POST("dashboard/process_analysis", group.ProcessAnalysis) // 执行时间
  18. apiPasture.POST("dashboard/sprinkle_statistics", group.SprinkleStatistics) // 撒料统计
  19. apiPasture.POST("forage_category/distribute", group.ForageCategoryDistribute) // 饲料分类下发
  20. apiPasture.POST("forage_category/delete", group.ForageCategoryDelete) // 饲料分类删除
  21. apiPasture.POST("cattle_category/distribute", group.CowCategoryDistribute) // 畜牧分类下发
  22. apiPasture.POST("cattle_category/delete", group.CowCategoryDelete) // 畜牧分类删除
  23. apiPasture.POST("feed/usage", group.FeedUsage) // 配方使用概况
  24. }
  25. }