config.go 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. package config
  2. import (
  3. "kpt-pasture/http/middleware"
  4. "gitee.com/xuyiping_admin/pkg/apierr"
  5. "gitee.com/xuyiping_admin/pkg/ginutil"
  6. "github.com/gin-gonic/gin"
  7. )
  8. func BarnTypeOptions(c *gin.Context) {
  9. res, err := middleware.Dependency(c).StoreEventHub.OpsService.BarnTypeOptions(c)
  10. if err != nil {
  11. apierr.ClassifiedAbort(c, err)
  12. return
  13. }
  14. ginutil.JSONResp(c, res)
  15. }
  16. func BarnListOptions(c *gin.Context) {
  17. res, err := middleware.Dependency(c).StoreEventHub.OpsService.BarnListOptions(c)
  18. if err != nil {
  19. apierr.ClassifiedAbort(c, err)
  20. return
  21. }
  22. ginutil.JSONResp(c, res)
  23. }
  24. func BreedStatusOptions(c *gin.Context) {
  25. res, err := middleware.Dependency(c).StoreEventHub.OpsService.BreedStatusOptions(c)
  26. if err != nil {
  27. apierr.ClassifiedAbort(c, err)
  28. return
  29. }
  30. ginutil.JSONResp(c, res)
  31. }
  32. func CowKindOptions(c *gin.Context) {
  33. res, err := middleware.Dependency(c).StoreEventHub.OpsService.CowKindOptions(c)
  34. if err != nil {
  35. apierr.ClassifiedAbort(c, err)
  36. return
  37. }
  38. ginutil.JSONResp(c, res)
  39. }
  40. func CowSourceOptions(c *gin.Context) {
  41. res, err := middleware.Dependency(c).StoreEventHub.OpsService.CowSourceOptions(c)
  42. if err != nil {
  43. apierr.ClassifiedAbort(c, err)
  44. return
  45. }
  46. ginutil.JSONResp(c, res)
  47. }
  48. func CowStatusOptions(c *gin.Context) {
  49. res, err := middleware.Dependency(c).StoreEventHub.OpsService.CowStatusOptions(c)
  50. if err != nil {
  51. apierr.ClassifiedAbort(c, err)
  52. return
  53. }
  54. ginutil.JSONResp(c, res)
  55. }
  56. func CowTypeOptions(c *gin.Context) {
  57. res, err := middleware.Dependency(c).StoreEventHub.OpsService.CowTypeOptions(c)
  58. if err != nil {
  59. apierr.ClassifiedAbort(c, err)
  60. return
  61. }
  62. ginutil.JSONResp(c, res)
  63. }
  64. func CowTransferPenReasonOptions(c *gin.Context) {
  65. res, err := middleware.Dependency(c).StoreEventHub.OpsService.CowTransferPenReasonOptions(c)
  66. if err != nil {
  67. apierr.ClassifiedAbort(c, err)
  68. return
  69. }
  70. ginutil.JSONResp(c, res)
  71. }