pasture_api.go 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package route
  2. import (
  3. "kpt-pasture/http/handler/pasture"
  4. "github.com/gin-gonic/gin"
  5. )
  6. func PastureManageAPI(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. // pasture API 组 牧场管理
  12. pastureRoute := authRouteGroup(s, "/api/v1/pasture/")
  13. pastureRoute.POST("/barn/list", pasture.SearchBarnList)
  14. pastureRoute.POST("/barn/createOrUpdate", pasture.CreatedOrUpdateBarn)
  15. pastureRoute.POST("/barn/type/list", pasture.SearchBarnTypeList)
  16. pastureRoute.POST("/barn/type/createOrUpdate", pasture.CreatedOrUpdateBarnType)
  17. pastureRoute.POST("/breed/status/list", pasture.SearchBreedStatusList)
  18. pastureRoute.POST("/breed/status/createOrUpdate", pasture.CreatedOrUpdateBreedStatus)
  19. pastureRoute.POST("/cow/kind/list", pasture.SearchCowKindList)
  20. pastureRoute.POST("/cow/kind/createOrUpdate", pasture.CreatedOrUpdateCowKind)
  21. pastureRoute.POST("/cow/status/list", pasture.SearchCowStatusList)
  22. pastureRoute.POST("/cow/status/createOrUpdate", pasture.CreatedOrUpdateCowStatus)
  23. pastureRoute.POST("/cow/type/list", pasture.SearchCowTypeList)
  24. pastureRoute.POST("/cow/type/createOrUpdate", pasture.CreatedOrUpdateCowType)
  25. pastureRoute.POST("/transfer/pen/reason/list", pasture.SearchTransferPenReasonList)
  26. pastureRoute.POST("/transfer/pen/reason/createOrUpdate", pasture.CreatedOrUpdateTransferPenReason)
  27. pastureRoute.POST("/cow/source/list", pasture.SearchCowSourceList)
  28. pastureRoute.POST("/cow/source/createOrUpdate", pasture.CreatedOrUpdateCowSource)
  29. // 疾病相关
  30. pastureRoute.POST("/disease/type/list", pasture.SearchDiseaseTypeList)
  31. pastureRoute.POST("/disease/type/createOrUpdate", pasture.CreatedOrUpdateDiseaseType)
  32. pastureRoute.POST("/disease/list", pasture.SearchDiseaseList)
  33. pastureRoute.POST("/disease/createOrUpdate", pasture.CreatedOrUpdateDisease)
  34. // 处方相关
  35. pastureRoute.POST("/prescription/list", pasture.SearchPrescriptionList)
  36. pastureRoute.POST("/prescription/createOrUpdate", pasture.CreatedOrUpdatePrescription)
  37. // 免疫计划相关
  38. pastureRoute.POST("/immunization/plan/list", pasture.SearchImmunizationList)
  39. pastureRoute.POST("/immunization/plan/createOrUpdate", pasture.CreatedOrUpdateImmunization)
  40. pastureRoute.PUT("/immunization/is_show/:id", pasture.ImmunizationIsShow)
  41. // 同期相关
  42. pastureRoute.POST("/same/time/createOrUpdate", pasture.SameTimeCreatedOrUpdate)
  43. pastureRoute.POST("/same/time/list", pasture.SameTimeList)
  44. pastureRoute.PUT("/same/time/is_show/:id", pasture.SameTimeIsShow)
  45. }
  46. }