pasture.go 328 B

123456789101112131415
  1. package module
  2. import (
  3. "tmr-watch/http/handle/restful"
  4. "tmr-watch/models"
  5. )
  6. // GetPastureById 获取牧场详情
  7. func GetPastureById(pastureID int64) (*models.Pasture, error) {
  8. res := &models.Pasture{}
  9. if _, err := restful.Engine.Table(new(models.Pasture)).Get(&res); err != nil {
  10. return nil, err
  11. }
  12. return res, nil
  13. }