ops_api.go 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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/list", feed.SearchFeedFormulaList)
  50. opsRoute.DELETE("/feed_formula/delete/:feed_formula_id", feed.DeleteFeedFormula)
  51. opsRoute.POST("/feed_formula/is_modify_show", feed.IsShowModifyFeedFormula)
  52. opsRoute.POST("/feed_formula/excel_export", feed.ExcelExportFeedFormula)
  53. opsRoute.POST("/feed_formula/excel_import", feed.ExcelImportFeedFormula)
  54. opsRoute.POST("/feed_formula/excel_template", feed.ExcelTemplateFeedFormula)
  55. opsRoute.GET("/feed_formula/encode_number", feed.EncodeNumber)
  56. opsRoute.POST("/feed_formula/distribute", feed.DistributeFeedFormula)
  57. opsRoute.POST("/feed_formula/usage", feed.Usage)
  58. //统计分析 statistic analysis
  59. opsRoute.POST("/feed_estimate/list", statistic.SearchFormulaEstimateList)
  60. opsRoute.POST("/inventory/statistics", statistic.SearchInventoryStatistics)
  61. opsRoute.POST("/inventory/statistics/excel_export", statistic.SearchInventoryStatisticsExcelExport)
  62. opsRoute.POST("/inventory/user_materials_statistics", statistic.SearchUserMaterialsStatistics)
  63. opsRoute.POST("/inventory/user_materials_statistics/excel_export", statistic.SearchUserMaterialsStatisticsExcelExport)
  64. opsRoute.POST("/inventory/price_statistics", statistic.SearchPriceStatistics)
  65. opsRoute.POST("/feed_efficiency/statistics", statistic.SearchFeedStatistics)
  66. opsRoute.POST("/feed_efficiency/chart_statistics", statistic.SearchFeedChartStatistics)
  67. opsRoute.POST("/feed_efficiency/cows_analysis", statistic.SearchCowsAnalysis)
  68. opsRoute.POST("/accuracy/agg_statistics", statistic.SearchAccuracyAggStatistics)
  69. opsRoute.POST("/accuracy/mixed_statistics", statistic.SearchMixFeedStatistics)
  70. opsRoute.POST("/accuracy/sprinkle_statistics", statistic.SearchSprinkleStatistics)
  71. opsRoute.POST("/accuracy/data_by_name", statistic.GetDataByName)
  72. opsRoute.POST("/process/analysis", statistic.SearchProcessAnalysis)
  73. opsRoute.POST("/statistics/train_number", statistic.TrainNumber)
  74. // 首页仪表盘
  75. opsRoute.POST("/dashboard/accuracy", dashboard.AnalysisAccuracy)
  76. opsRoute.POST("/dashboard/top_pasture", dashboard.TopPasture)
  77. opsRoute.POST("/dashboard/exec_time", dashboard.ExecutionTime)
  78. opsRoute.POST("/dashboard/sprinkle_time", dashboard.SprinkleFeedTime)
  79. }
  80. }