ops_api.go 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. package route
  2. import (
  3. "kpt-tmr-group/http/handler/dashboard"
  4. "kpt-tmr-group/http/handler/feed"
  5. "kpt-tmr-group/http/handler/pasture"
  6. "kpt-tmr-group/http/handler/statistic"
  7. "github.com/gin-gonic/gin"
  8. )
  9. func OpsAPI(opts ...func(engine *gin.Engine)) func(s *gin.Engine) {
  10. return func(s *gin.Engine) {
  11. for _, opt := range opts {
  12. opt(s)
  13. }
  14. // 牧场管理
  15. opsRoute := authRouteGroup(s, "/api/v1/ops/")
  16. opsRoute.POST("/pasture/add", pasture.AddGroupPasture)
  17. opsRoute.POST("/pasture/edit", pasture.EditGroupPasture)
  18. opsRoute.POST("/pasture/list", pasture.SearchGroupPastureList)
  19. opsRoute.DELETE("/pasture/:pasture_id", pasture.DeleteGroupPasture)
  20. opsRoute.POST("/pasture/rest_password/:pasture_id", pasture.ResetPasswordGroupPasture)
  21. opsRoute.POST("/pasture/is_show", pasture.IsShowGroupPasture)
  22. // 牲牧类型
  23. opsRoute.POST("/cattle/category/add", pasture.AddCattleCategory)
  24. opsRoute.POST("/cattle/category/edit", pasture.EditCattleCategory)
  25. opsRoute.POST("/cattle/category/is_show", pasture.IsShowCattleCategory)
  26. opsRoute.DELETE("/cattle/category/:cattle_category_id", pasture.DeleteCattleCategory)
  27. opsRoute.POST("/cattle/category/list", pasture.SearchCattleCategory)
  28. // 饲料类别
  29. opsRoute.POST("/forage/category/add", pasture.AddForageCategory)
  30. opsRoute.POST("/forage/category/edit", pasture.EditForageCategory)
  31. opsRoute.POST("/forage/category/is_show", pasture.IsShowForageCategory)
  32. opsRoute.DELETE("/forage/category/:forage_category_id", pasture.DeleteForageCategory)
  33. opsRoute.POST("/forage/category/list", pasture.SearchForageCategory)
  34. // 饲料列表
  35. opsRoute.POST("/forage/add", pasture.AddForage)
  36. opsRoute.POST("/forage/edit", pasture.EditForage)
  37. opsRoute.POST("/forage/list", pasture.SearchForageList)
  38. opsRoute.POST("forage/delete", pasture.DeleteForageList)
  39. opsRoute.POST("forage/is_show", pasture.IsShowForage)
  40. opsRoute.POST("forage/excel_import", pasture.ExcelImportForage)
  41. opsRoute.POST("forage/excel_export", pasture.ExcelExportForage)
  42. opsRoute.POST("forage/excel_template", pasture.ExcelTemplateForage)
  43. opsRoute.POST("/forage/small_material", pasture.SmallMaterial)
  44. opsRoute.POST("/forage/sort", pasture.ForageListSort)
  45. opsRoute.GET("/forage/enum/list", pasture.SearchForageEnumList)
  46. // 饲料配方
  47. opsRoute.POST("/feed_formula/add", feed.AddFeedFormula)
  48. opsRoute.POST("/feed_formula/edit", feed.EditFeedFormula)
  49. opsRoute.POST("/feed_formula/feed/add", feed.AddFeedByFeedFormula)
  50. opsRoute.POST("/feed_formula/feed/edit", feed.EditFeedByFeedFormula)
  51. opsRoute.POST("/feed_formula/feed/sort", feed.DetailBySort)
  52. opsRoute.POST("/feed_formula/feed/is_modify", feed.IsModifyFeedDetail)
  53. opsRoute.POST("/feed_formula/feed/delete", feed.DeleteFeedDetail)
  54. opsRoute.POST("/feed_formula/feed/search", feed.SearchFeedDetail)
  55. opsRoute.POST("/feed_formula/feed/mixed", feed.MixedFeedFormula)
  56. opsRoute.POST("/feed_formula/list", feed.SearchFeedFormulaList)
  57. opsRoute.POST("/feed_formula/forage_list", feed.SearchFeedFormulaByForageList)
  58. opsRoute.DELETE("/feed_formula/delete/:feed_formula_id", feed.DeleteFeedFormula)
  59. opsRoute.POST("/feed_formula/is_modify_show", feed.IsShowModifyFeedFormula)
  60. opsRoute.POST("/feed_formula/excel_export", feed.ExcelExportFeedFormula)
  61. opsRoute.POST("/feed_formula/excel_import", feed.ExcelImportFeedFormula)
  62. opsRoute.POST("/feed_formula/excel_template", feed.ExcelTemplateFeedFormula)
  63. opsRoute.GET("/feed_formula/encode_number", feed.EncodeNumber)
  64. opsRoute.POST("/feed_formula/distribute", feed.DistributeFeedFormula)
  65. opsRoute.POST("/feed_formula/cancel/distribute", feed.CancelDistributeFeedFormula)
  66. opsRoute.POST("/feed_formula/feed_detail/list", feed.ForageDetailList)
  67. opsRoute.POST("/feed_formula/edit_record/list", feed.EditRecordFeedFormula)
  68. opsRoute.POST("/feed_formula/usage", feed.Usage)
  69. //统计分析 statistic analysis
  70. opsRoute.POST("/feed_estimate/list", statistic.SearchFormulaEstimateList)
  71. opsRoute.POST("/inventory/statistics", statistic.SearchInventoryStatistics)
  72. opsRoute.POST("/inventory/statistics/excel_export", statistic.SearchInventoryStatisticsExcelExport)
  73. opsRoute.POST("/inventory/user_materials_statistics", statistic.SearchUserMaterialsStatistics)
  74. opsRoute.POST("/inventory/user_materials_statistics/excel_export", statistic.SearchUserMaterialsStatisticsExcelExport)
  75. opsRoute.POST("/inventory/price_statistics", statistic.SearchPriceStatistics)
  76. opsRoute.POST("/feed_efficiency/statistics", statistic.SearchFeedStatistics)
  77. opsRoute.POST("/feed_efficiency/chart_statistics", statistic.SearchFeedChartStatistics)
  78. opsRoute.POST("/feed_efficiency/cows_analysis", statistic.SearchCowsAnalysis)
  79. opsRoute.POST("/accuracy/agg_statistics", statistic.SearchAccuracyAggStatistics)
  80. opsRoute.POST("/accuracy/mixed_statistics", statistic.SearchMixFeedStatistics)
  81. opsRoute.POST("/accuracy/sprinkle_statistics", statistic.SearchSprinkleStatistics)
  82. opsRoute.POST("/accuracy/data_by_name", statistic.GetDataByName)
  83. opsRoute.POST("/process/analysis", statistic.SearchProcessAnalysis)
  84. opsRoute.POST("/process/analysis/mixed_sprinkle_detail", statistic.AnalysisMixedSprinkleDetail)
  85. opsRoute.POST("/statistics/train_number", statistic.TrainNumber)
  86. opsRoute.POST("/statistics/mixed_category_tmr_name", statistic.FeedMixedAndTmrName)
  87. // 首页仪表盘
  88. opsRoute.POST("/dashboard/accuracy", dashboard.AnalysisAccuracy)
  89. opsRoute.POST("/dashboard/top_pasture", dashboard.TopPasture)
  90. opsRoute.POST("/dashboard/exec_time", dashboard.ExecutionTime)
  91. opsRoute.POST("/dashboard/sprinkle_time", dashboard.SprinkleFeedTime)
  92. }
  93. }